Remove autoconf-isms from the meson configure options

See https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
This commit is contained in:
Richard Hughes 2017-11-27 10:40:59 +00:00
parent 4016c839a8
commit d0cff7caec
25 changed files with 108 additions and 108 deletions

View File

@ -8,15 +8,15 @@ mkdir -p build && pushd build
rm -rf *
meson .. \
-Dwerror=true \
-Denable-doc=true \
-Denable-man=true \
-Denable-tests=true \
-Denable-dummy=true \
-Denable-thunderbolt=true \
-Denable-uefi=true \
-Denable-dell=true \
-Denable-synaptics=true \
-Denable-colorhug=true $@
-Dgtkdoc=true \
-Dman=true \
-Dtests=true \
-Dplugin_dummy=true \
-Dplugin_thunderbolt=true \
-Dplugin_uefi=true \
-Dplugin_dell=true \
-Dplugin_synaptics=true \
-Dplugin_colorhug=true $@
ninja-build dist
popd
VERSION=`mesonintrospect build --projectinfo | jq -r .version`

View File

@ -10,13 +10,13 @@ cd build
meson .. \
--cross-file s390x_cross.txt \
-Dwerror=true \
-Denable-uefi=false \
-Denable-uefi-labels=false \
-Denable-dell=false \
-Denable-synaptics=false \
-Denable-introspection=false \
-Denable-doc=false \
-Denable-man=false
-Dplugin_uefi=false \
-Dplugin_uefi_labels=false \
-Dplugin_dell=false \
-Dplugin_synaptics=false \
-Dintrospection=false \
-Dgtkdoc=false \
-Dman=false
ninja -v
ninja test -v
cd ..

View File

@ -21,16 +21,16 @@ override_dh_auto_clean:
override_dh_auto_configure:
if pkg-config --exists fwup; then \
export UEFI="-Denable-uefi=true"; \
export UEFI="-Dplugin_uefi=true"; \
else \
export UEFI="-Denable-uefi=false"; \
export UEFI="-Dplugin_uefi=false"; \
fi; \
if pkg-config --exists libsmbios_c; then \
export DELL="-Denable-dell=true -Denable-synaptics=true"; \
export DELL="-Dplugin_dell=true -Dplugin_synaptics=true"; \
else \
export DELL="-Denable-dell=false -Denable-synaptics=false"; \
export DELL="-Dplugin_dell=false -Dplugin_synaptics=false"; \
fi; \
dh_auto_configure -- $$UEFI $$DELL $$CI -Denable-dummy=true --libexecdir=/usr/lib
dh_auto_configure -- $$UEFI $$DELL $$CI -Dplugin_dummy=true --libexecdir=/usr/lib
override_dh_install:
find debian/tmp/usr -type f -name "*a" -print | xargs rm -f

View File

@ -123,34 +123,34 @@ Data files for installed tests.
%build
%meson \
-Denable-doc=true \
-Denable-man=true \
-Dgtkdoc=true \
-Dman=true \
%if 0%{?enable_tests}
-Denable-tests=true \
-Dtests=true \
%else
-Denable-tests=false \
-Dtests=false \
%endif
%if 0%{?enable_dummy}
-Denable-dummy=true \
-Dplugin_dummy=true \
%else
-Denable-dummy=false \
-Dplugin_dummy=false \
%endif
-Denable-thunderbolt=true \
-Dplugin_thunderbolt=true \
%if 0%{?have_uefi}
-Denable-uefi=true \
-Denable-uefi-labels=true \
-Dplugin_uefi=true \
-Dplugin_uefi_labels=true \
%else
-Denable-uefi=false \
-Denable-uefi-labels=false \
-Dplugin_uefi=false \
-Dplugin_uefi_labels=false \
%endif
%if 0%{?have_dell}
-Denable-dell=true \
-Denable-synaptics=true \
-Dplugin_dell=true \
-Dplugin_synaptics=true \
%else
-Denable-dell=false \
-Denable-synaptics=false \
-Dplugin_dell=false \
-Dplugin_synaptics=false \
%endif
-Denable-colorhug=true
-Dplugin_colorhug=true
%meson_build

View File

@ -2,7 +2,7 @@ subdir('builder')
subdir('pki')
subdir('remotes.d')
if get_option('enable-tests')
if get_option('tests')
subdir('tests')
subdir('installed-tests')
endif
@ -32,7 +32,7 @@ con2.set('libexecdir', libexecdir)
con2.set('bindir', bindir)
con2.set('localstatedir', localstatedir)
con2.set('datadir', datadir)
con2.set('bootdir', get_option('with-bootdir'))
con2.set('bootdir', get_option('bootdir'))
con2.set('sysconfdir', default_sysconfdir)
# replace @libexecdir@
@ -46,7 +46,7 @@ configure_file(
'system-services'),
)
if get_option('enable-systemd')
if get_option('systemd')
# replace @bindir@
configure_file(
input : 'fwupd-offline-update.service.in',
@ -57,7 +57,7 @@ if get_option('enable-systemd')
)
endif
if get_option('enable-systemd')
if get_option('systemd')
# replace @localstatedir@, @sysconfdir@ and @bootdir@
configure_file(
input : 'fwupd.service.in',

View File

@ -1,4 +1,4 @@
if get_option('enable-gpg')
if get_option('gpg')
install_data([
'GPG-KEY-Hughski-Limited',
'GPG-KEY-Linux-Vendor-Firmware-Service',
@ -13,7 +13,7 @@ if get_option('enable-gpg')
)
endif
if get_option('enable-pkcs7')
if get_option('pkcs7')
install_data([
'LVFS-CA.pem',
],

View File

@ -1,4 +1,4 @@
if get_option('enable-lvfs')
if get_option('lvfs')
install_data([
'lvfs.conf',
'lvfs-testing.conf',

View File

@ -1,4 +1,4 @@
if get_option('enable-tests')
if get_option('tests')
tar = find_program('tar')
builder_test_firmware = custom_target('builder-test-firmware',
input : [

View File

@ -1,3 +1,3 @@
if get_option('enable-doc')
if get_option('gtkdoc')
subdir('libfwupd')
endif

View File

@ -67,7 +67,7 @@ pkgg.generate(
description : 'fwupd is a system daemon for installing device firmware',
)
if get_option('enable-introspection')
if get_option('introspection')
gir = gnome.generate_gir(fwupd,
sources : [
'fwupd-client.c',
@ -135,7 +135,7 @@ if get_option('enable-introspection')
)
endif
if get_option('enable-tests')
if get_option('tests')
testdatadir = join_paths(meson.source_root(), 'data')
e = executable(
'fwupd-self-test',

View File

@ -155,11 +155,11 @@ else
valgrind = dependency('valgrindXXX', required: false)
endif
soup = dependency('libsoup-2.4', version : '>= 2.51.92')
if get_option('enable-pkcs7')
if get_option('pkcs7')
gnutls = dependency('gnutls')
conf.set('ENABLE_PKCS7', '1')
endif
if get_option('enable-gpg')
if get_option('gpg')
gpgme = cc.find_library('gpgme')
gpgerror = cc.find_library('gpg-error')
conf.set('ENABLE_GPG', '1')
@ -172,7 +172,7 @@ if gcab.version().version_compare('>= 0.8')
conf.set('HAVE_GCAB_0_8', '1')
endif
if get_option('enable-uefi-labels')
if get_option('plugin_uefi_labels')
cairo = dependency('cairo')
fontconfig = cc.find_library('fontconfig')
freetype = cc.find_library('freetype')
@ -186,44 +186,44 @@ if valgrind.found()
conf.set('HAVE_VALGRIND', '1')
endif
if get_option('enable-colorhug')
if get_option('plugin_colorhug')
colorhug = dependency('colorhug', version : '>= 1.2.12')
conf.set('HAVE_COLORHUG', '1')
endif
if get_option('enable-altos')
if get_option('plugin_altos')
libelf = dependency('libelf')
endif
if get_option('enable-uefi')
if get_option('plugin_uefi')
fwup = dependency('fwup', version : '>= 5')
if fwup.version().version_compare('>= 10')
conf.set('HAVE_FWUP_GET_BGRT_INFO', '1')
endif
endif
if get_option('enable-dell')
if get_option('plugin_dell')
libsmbios_c = dependency('libsmbios_c', version : '>= 2.3.0')
efivar = dependency('efivar')
fwup = dependency('fwup', version : '>= 5')
conf.set('HAVE_DELL', '1')
endif
if get_option('enable-synaptics')
if get_option('plugin_synaptics')
conf.set('HAVE_SYNAPTICS', '1')
endif
if get_option('enable-thunderbolt')
if get_option('plugin_thunderbolt')
umockdev = dependency('umockdev-1.0', required: false)
conf.set('HAVE_THUNDERBOLT', '1')
endif
if get_option('enable-systemd')
if get_option('systemd')
systemd = dependency('systemd', version : '>= 231')
conf.set('HAVE_SYSTEMD' , '1')
endif
if get_option('enable-consolekit')
if get_option('consolekit')
conf.set('HAVE_CONSOLEKIT' , '1')
endif
@ -238,12 +238,12 @@ localstatedir = join_paths(prefix, get_option('localstatedir'))
mandir = join_paths(prefix, get_option('mandir'))
localedir = join_paths(prefix, get_option('localedir'))
systemdunitdir = get_option('with-systemdunitdir')
if systemdunitdir == '' and get_option('enable-systemd')
systemdunitdir = get_option('systemdunitdir')
if systemdunitdir == '' and get_option('systemd')
systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
endif
udevdir = get_option('with-udevdir')
udevdir = get_option('udevdir')
if udevdir == ''
udevdir = udev.get_pkgconfig_variable('udevdir')
endif
@ -307,6 +307,6 @@ if meson.version().version_compare('<0.41.0')
endif
endif
if get_option('enable-systemd')
if get_option('systemd')
meson.add_install_script('meson_post_install.sh', systemdunitdir, localstatedir)
endif

View File

@ -1,21 +1,21 @@
option('enable-doc', type : 'boolean', value : true, description : 'enable developer documentation')
option('enable-introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
option('enable-man', type : 'boolean', value : true, description : 'enable man pages')
option('enable-tests', type : 'boolean', value : true, description : 'enable tests')
option('enable-lvfs', type : 'boolean', value : true, description : 'enable LVFS remotes')
option('enable-colorhug', type : 'boolean', value : true, description : 'enable ColorHug support')
option('enable-altos', type : 'boolean', value : true, description : 'enable altos support')
option('enable-uefi', type : 'boolean', value : true, description : 'enable UEFI support')
option('enable-uefi-labels', type : 'boolean', value : true, description : 'enable UEFI labels support')
option('enable-dell', type : 'boolean', value : true, description : 'enable Dell-specific support')
option('enable-amt', type : 'boolean', value : true, description : 'enable Intel AMT support')
option('enable-thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
option('enable-synaptics', type: 'boolean', value: true, description : 'enable Synaptics MST hub support')
option('enable-systemd', type : 'boolean', value : true, description : 'enable systemd support')
option('enable-consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support')
option('enable-dummy', type : 'boolean', value : false, description : 'enable the dummy device')
option('enable-gpg', type : 'boolean', value : true, description : 'enable the GPG verification support')
option('enable-pkcs7', type : 'boolean', value : true, description : 'enable the PKCS7 verification support')
option('with-bootdir', type : 'string', value : '/boot/efi', description : 'Directory for EFI system partition')
option('with-systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units')
option('with-udevdir', type: 'string', value: '', description: 'Directory for udev rules')
option('bootdir', type : 'string', value : '/boot/efi', description : 'Directory for EFI system partition')
option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support')
option('gpg', type : 'boolean', value : true, description : 'enable the GPG verification support')
option('gtkdoc', type : 'boolean', value : true, description : 'enable developer documentation')
option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
option('lvfs', type : 'boolean', value : true, description : 'enable LVFS remotes')
option('man', type : 'boolean', value : true, description : 'enable man pages')
option('pkcs7', type : 'boolean', value : true, description : 'enable the PKCS7 verification support')
option('plugin_altos', type : 'boolean', value : true, description : 'enable altos support')
option('plugin_amt', type : 'boolean', value : true, description : 'enable Intel AMT support')
option('plugin_colorhug', type : 'boolean', value : true, description : 'enable ColorHug support')
option('plugin_dell', type : 'boolean', value : true, description : 'enable Dell-specific support')
option('plugin_dummy', type : 'boolean', value : false, description : 'enable the dummy device')
option('plugin_synaptics', type: 'boolean', value: true, description : 'enable Synaptics MST hub support')
option('plugin_thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
option('plugin_uefi_labels', type : 'boolean', value : true, description : 'enable UEFI labels support')
option('plugin_uefi', type : 'boolean', value : true, description : 'enable UEFI support')
option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
option('systemdunitdir', type: 'string', value: '', description: 'Directory for systemd units')
option('tests', type : 'boolean', value : true, description : 'enable tests')
option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')

View File

@ -28,7 +28,7 @@ shared_module('fu_plugin_dell',
],
)
if get_option('enable-tests')
if get_option('tests')
cargs += '-DFU_OFFLINE_DESTDIR="/tmp/fwupd-self-test"'
cargs += '-DPLUGINBUILDDIR="' + meson.current_build_dir() + '"'
e = executable(

View File

@ -87,7 +87,7 @@ executable(
install_dir : bindir
)
if get_option('enable-man')
if get_option('man')
docbook2man = find_program('docbook2man')
custom_target('dfu-tool-man',
input : 'dfu-tool.sgml',
@ -101,7 +101,7 @@ if get_option('enable-man')
)
endif
if get_option('enable-tests')
if get_option('tests')
testdatadir = join_paths(meson.current_source_dir(), 'tests')
cargs += '-DTESTDATADIR="' + testdatadir + '"'
e = executable(

View File

@ -8,31 +8,31 @@ subdir('udev')
subdir('unifying')
subdir('upower')
if get_option('enable-altos')
if get_option('plugin_altos')
subdir('altos')
endif
if get_option('enable-amt')
if get_option('plugin_amt')
subdir('amt')
endif
if get_option('enable-thunderbolt') and udev.found()
if get_option('plugin_thunderbolt') and udev.found()
subdir('thunderbolt')
subdir('thunderbolt-power')
endif
if get_option('enable-colorhug')
if get_option('plugin_colorhug')
subdir('colorhug')
endif
if get_option('enable-dell')
if get_option('plugin_dell')
subdir('dell')
endif
if get_option('enable-synaptics')
if get_option('plugin_synaptics')
subdir('synapticsmst')
endif
if get_option('enable-uefi')
if get_option('plugin_uefi')
subdir('uefi')
endif

View File

@ -19,7 +19,7 @@ shared_module('fu_plugin_nitrokey',
],
)
if get_option('enable-tests')
if get_option('tests')
e = executable(
'nitrokey-self-test',
sources : [

View File

@ -22,7 +22,7 @@ shared_module('fu_plugin_raspberrypi',
],
)
if get_option('enable-tests')
if get_option('tests')
testdatadir_src = meson.current_source_dir()
testdatadir_dst = meson.current_build_dir()
e = executable(

View File

@ -41,7 +41,7 @@ executable(
c_args : cargs,
)
if get_option('enable-tests')
if get_option('tests')
cargs += '-DFU_OFFLINE_DESTDIR="/tmp/fwupd-self-test"'
cargs += '-DPLUGINBUILDDIR="' + meson.current_build_dir() + '"'
e = executable(

View File

@ -1,7 +1,7 @@
cargs = ['-DG_LOG_DOMAIN="FuPluginTest"']
install_dummy = false
if get_option('enable-dummy')
if get_option('plugin_dummy')
install_dummy = true
endif

View File

@ -44,7 +44,7 @@ executable('tbtfwucli',
)
# we use functions from 2.52 in the tests
if get_option('enable-tests') and umockdev.found() and gio.version().version_compare('>= 2.52')
if get_option('tests') and umockdev.found() and gio.version().version_compare('>= 2.52')
cargs += '-DFU_OFFLINE_DESTDIR="/tmp/fwupd-self-test"'
cargs += '-DPLUGINBUILDDIR="' + meson.current_build_dir() + '"'
e = executable(

View File

@ -40,7 +40,7 @@ executable(
c_args : cargs,
)
if get_option('enable-tests')
if get_option('tests')
cargs += '-DFU_OFFLINE_DESTDIR="/tmp/fwupd-self-test"'
cargs += '-DPLUGINBUILDDIR="' + meson.current_build_dir() + '"'
testdatadir = join_paths(meson.current_source_dir(), 'tests')

View File

@ -87,7 +87,7 @@ lu_hidpp_msg_fcn_id_to_string (LuHidppMsg *msg)
if (msg->function_id == HIDPP_REGISTER_HIDPP_NOTIFICATIONS)
return "hidpp-notifications";
if (msg->function_id == HIDPP_REGISTER_ENABLE_INDIVIDUAL_FEATURES)
return "enable-individual-features";
return "individual-features";
if (msg->function_id == HIDPP_REGISTER_BATTERY_STATUS)
return "battery-status";
if (msg->function_id == HIDPP_REGISTER_BATTERY_MILEAGE)

View File

@ -57,7 +57,7 @@ executable(
c_args : cargs,
)
if get_option('enable-tests')
if get_option('tests')
e = executable(
'unifying-self-test',
sources : [

View File

@ -5,6 +5,6 @@ i18n.gettext(meson.project_name(),
]
)
if get_option('enable-uefi-labels')
if get_option('plugin_uefi_labels')
meson.add_install_script('make-images.sh')
endif

View File

@ -7,13 +7,13 @@ install_data(['org.freedesktop.fwupd.xml'],
keyring_deps = []
keyring_src = []
if get_option('enable-gpg')
if get_option('gpg')
keyring_src += 'fu-keyring-gpg.c'
keyring_deps += gpgme
keyring_deps += gpgerror
endif
if get_option('enable-pkcs7')
if get_option('pkcs7')
keyring_src += 'fu-keyring-pkcs7.c'
keyring_deps += gnutls
endif
@ -89,7 +89,7 @@ fwupdmgr = executable(
install_dir : bindir
)
if get_option('enable-man')
if get_option('man')
help2man = find_program('help2man')
custom_target('fwupdmgr-man',
input : fwupdmgr,
@ -170,7 +170,7 @@ executable(
install_dir : join_paths(libexecdir, 'fwupd')
)
if get_option('enable-tests')
if get_option('tests')
testdatadir_src = join_paths(meson.source_root(), 'data', 'tests')
testdatadir_dst = join_paths(meson.build_root(), 'data', 'tests')
pluginbuilddir = join_paths(meson.build_root(), 'plugins', 'test')
@ -241,7 +241,7 @@ if get_option('enable-tests')
test('fu-self-test', e, is_parallel:false)
endif
if get_option('enable-introspection')
if get_option('introspection')
gir_dep = declare_dependency(sources: gir)
gnome.generate_gir(fwupd,
sources : [