mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
meson: Convert more options to meson features
The semantics for libidn2 and pwquality have changed slightly: We will pick a preferred one if both are enabled instead of making it an error.
This commit is contained in:
parent
847e5585b6
commit
1e73a64a7a
2
.github/workflows/unit_tests.sh
vendored
2
.github/workflows/unit_tests.sh
vendored
@ -60,7 +60,7 @@ for phase in "${PHASES[@]}"; do
|
|||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
if [[ "$phase" == RUN_CLANG ]]; then
|
if [[ "$phase" == RUN_CLANG ]]; then
|
||||||
# The docs build is slow and is not affected by compiler/flags, so do it just once
|
# The docs build is slow and is not affected by compiler/flags, so do it just once
|
||||||
MESON_ARGS+=(-Dman=true)
|
MESON_ARGS+=(-Dman=enabled)
|
||||||
else
|
else
|
||||||
MESON_ARGS+=(-Dmode=release --optimization=2)
|
MESON_ARGS+=(-Dmode=release --optimization=2)
|
||||||
fi
|
fi
|
||||||
|
@ -6,9 +6,9 @@ subdir('rules')
|
|||||||
want_man = get_option('man')
|
want_man = get_option('man')
|
||||||
want_html = get_option('html')
|
want_html = get_option('html')
|
||||||
xsltproc = find_program('xsltproc',
|
xsltproc = find_program('xsltproc',
|
||||||
required : want_man == 'true' or want_html == 'true')
|
required : want_man.enabled() or want_html.enabled())
|
||||||
want_man = want_man != 'false' and xsltproc.found()
|
want_man = want_man.allowed() and xsltproc.found()
|
||||||
want_html = want_html != 'false' and xsltproc.found()
|
want_html = want_html.allowed() and xsltproc.found()
|
||||||
|
|
||||||
xsltproc_flags = [
|
xsltproc_flags = [
|
||||||
'--nonet',
|
'--nonet',
|
||||||
|
126
meson.build
126
meson.build
@ -33,13 +33,13 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
|
|||||||
|
|
||||||
conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer',
|
conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer',
|
||||||
description : 'tailor build to development or release builds')
|
description : 'tailor build to development or release builds')
|
||||||
verification = get_option('log-message-verification')
|
feature = get_option('log-message-verification')
|
||||||
if verification == 'auto'
|
if feature.auto()
|
||||||
verification = conf.get('BUILD_MODE_DEVELOPER') == 1
|
have = conf.get('BUILD_MODE_DEVELOPER') == 1
|
||||||
else
|
else
|
||||||
verification = verification == 'true'
|
have = feature.enabled()
|
||||||
endif
|
endif
|
||||||
conf.set10('LOG_MESSAGE_VERIFICATION', verification)
|
conf.set10('LOG_MESSAGE_VERIFICATION', have)
|
||||||
|
|
||||||
want_ossfuzz = get_option('oss-fuzz')
|
want_ossfuzz = get_option('oss-fuzz')
|
||||||
want_libfuzzer = get_option('llvm-fuzz')
|
want_libfuzzer = get_option('llvm-fuzz')
|
||||||
@ -1119,32 +1119,19 @@ libfdisk = dependency('fdisk',
|
|||||||
required : get_option('fdisk'))
|
required : get_option('fdisk'))
|
||||||
conf.set10('HAVE_LIBFDISK', libfdisk.found())
|
conf.set10('HAVE_LIBFDISK', libfdisk.found())
|
||||||
|
|
||||||
want_passwdqc = get_option('passwdqc')
|
# This prefers pwquality if both are enabled or auto.
|
||||||
want_pwquality = get_option('pwquality')
|
feature = get_option('pwquality').disable_auto_if(get_option('passwdqc').enabled())
|
||||||
if want_passwdqc == 'true' and want_pwquality == 'true'
|
libpwquality = dependency('pwquality',
|
||||||
error('passwdqc and pwquality cannot be requested simultaneously')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if want_pwquality != 'false' and want_passwdqc != 'true' and not skip_deps
|
|
||||||
libpwquality = dependency('pwquality',
|
|
||||||
version : '>= 1.4.1',
|
version : '>= 1.4.1',
|
||||||
required : want_pwquality == 'true')
|
required : feature)
|
||||||
have = libpwquality.found()
|
have = libpwquality.found()
|
||||||
else
|
if not have
|
||||||
have = false
|
# libpwquality is used for both features for simplicity
|
||||||
libpwquality = []
|
libpwquality = dependency('passwdqc',
|
||||||
|
required : get_option('passwdqc'))
|
||||||
endif
|
endif
|
||||||
conf.set10('HAVE_PWQUALITY', have)
|
conf.set10('HAVE_PWQUALITY', have)
|
||||||
|
conf.set10('HAVE_PASSWDQC', not have and libpwquality.found())
|
||||||
if not have and want_passwdqc != 'false' and not skip_deps
|
|
||||||
libpasswdqc = dependency('passwdqc',
|
|
||||||
required : want_passwdqc == 'true')
|
|
||||||
have = libpasswdqc.found()
|
|
||||||
else
|
|
||||||
have = false
|
|
||||||
libpasswdqc = []
|
|
||||||
endif
|
|
||||||
conf.set10('HAVE_PASSWDQC', have)
|
|
||||||
|
|
||||||
libseccomp = dependency('libseccomp',
|
libseccomp = dependency('libseccomp',
|
||||||
version : '>= 2.3.1',
|
version : '>= 2.3.1',
|
||||||
@ -1225,20 +1212,21 @@ libmicrohttpd = dependency('libmicrohttpd',
|
|||||||
required : get_option('microhttpd'))
|
required : get_option('microhttpd'))
|
||||||
conf.set10('HAVE_MICROHTTPD', libmicrohttpd.found())
|
conf.set10('HAVE_MICROHTTPD', libmicrohttpd.found())
|
||||||
|
|
||||||
want_libcryptsetup = get_option('libcryptsetup')
|
libcryptsetup = get_option('libcryptsetup')
|
||||||
want_libcryptsetup_plugins = get_option('libcryptsetup-plugins')
|
libcryptsetup_plugins = get_option('libcryptsetup-plugins')
|
||||||
|
if libcryptsetup_plugins.enabled()
|
||||||
if want_libcryptsetup_plugins == 'true' and want_libcryptsetup == 'false'
|
if libcryptsetup.disabled()
|
||||||
error('libcryptsetup-plugins can not be requested without libcryptsetup')
|
error('libcryptsetup-plugins can not be requested without libcryptsetup')
|
||||||
|
endif
|
||||||
|
libcryptsetup = libcryptsetup_plugins
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if want_libcryptsetup != 'false' and not skip_deps
|
libcryptsetup = dependency('libcryptsetup',
|
||||||
libcryptsetup = dependency('libcryptsetup',
|
version : libcryptsetup_plugins.enabled() ? '>= 2.4.0' : '>= 2.0.1',
|
||||||
version : want_libcryptsetup_plugins == 'true' ? '>= 2.4.0' : '>= 2.0.1',
|
required : libcryptsetup)
|
||||||
required : want_libcryptsetup == 'true' or want_libcryptsetup_plugins == 'true')
|
|
||||||
have = libcryptsetup.found()
|
|
||||||
|
|
||||||
foreach ident : ['crypt_set_metadata_size',
|
have = libcryptsetup.found()
|
||||||
|
foreach ident : ['crypt_set_metadata_size',
|
||||||
'crypt_activate_by_signed_key',
|
'crypt_activate_by_signed_key',
|
||||||
'crypt_token_max',
|
'crypt_token_max',
|
||||||
'crypt_reencrypt_init_by_passphrase',
|
'crypt_reencrypt_init_by_passphrase',
|
||||||
@ -1249,14 +1237,11 @@ if want_libcryptsetup != 'false' and not skip_deps
|
|||||||
prefix : '#include <libcryptsetup.h>',
|
prefix : '#include <libcryptsetup.h>',
|
||||||
dependencies : libcryptsetup)
|
dependencies : libcryptsetup)
|
||||||
conf.set10('HAVE_' + ident.to_upper(), have_ident)
|
conf.set10('HAVE_' + ident.to_upper(), have_ident)
|
||||||
endforeach
|
endforeach
|
||||||
else
|
|
||||||
have = false
|
|
||||||
libcryptsetup = []
|
|
||||||
endif
|
|
||||||
conf.set10('HAVE_LIBCRYPTSETUP', have)
|
conf.set10('HAVE_LIBCRYPTSETUP', have)
|
||||||
|
|
||||||
if want_libcryptsetup_plugins != 'false' and not skip_deps
|
# TODO: Use has_function(required : libcryptsetup_plugins) with meson >= 1.3.0
|
||||||
|
if libcryptsetup_plugins.allowed()
|
||||||
have = (cc.has_function(
|
have = (cc.has_function(
|
||||||
'crypt_activate_by_token_pin',
|
'crypt_activate_by_token_pin',
|
||||||
prefix : '#include <libcryptsetup.h>',
|
prefix : '#include <libcryptsetup.h>',
|
||||||
@ -1276,30 +1261,17 @@ libcurl = dependency('libcurl',
|
|||||||
conf.set10('HAVE_LIBCURL', libcurl.found())
|
conf.set10('HAVE_LIBCURL', libcurl.found())
|
||||||
conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1)
|
conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1)
|
||||||
|
|
||||||
want_libidn = get_option('libidn')
|
feature = get_option('libidn2').disable_auto_if(get_option('libidn').enabled())
|
||||||
want_libidn2 = get_option('libidn2')
|
libidn = dependency('libidn2',
|
||||||
if want_libidn == 'true' and want_libidn2 == 'true'
|
required : feature)
|
||||||
error('libidn and libidn2 cannot be requested simultaneously')
|
have = libidn.found()
|
||||||
endif
|
if not have
|
||||||
|
|
||||||
if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps
|
|
||||||
libidn = dependency('libidn2',
|
|
||||||
required : want_libidn2 == 'true')
|
|
||||||
have = libidn.found()
|
|
||||||
else
|
|
||||||
have = false
|
|
||||||
libidn = []
|
|
||||||
endif
|
|
||||||
conf.set10('HAVE_LIBIDN2', have)
|
|
||||||
if not have and want_libidn != 'false' and not skip_deps
|
|
||||||
# libidn is used for both libidn and libidn2 objects
|
# libidn is used for both libidn and libidn2 objects
|
||||||
libidn = dependency('libidn',
|
libidn = dependency('libidn',
|
||||||
required : want_libidn == 'true')
|
required : get_option('libidn'))
|
||||||
have = libidn.found()
|
|
||||||
else
|
|
||||||
have = false
|
|
||||||
endif
|
endif
|
||||||
conf.set10('HAVE_LIBIDN', have)
|
conf.set10('HAVE_LIBIDN', not have and libidn.found())
|
||||||
|
conf.set10('HAVE_LIBIDN2', have)
|
||||||
|
|
||||||
libiptc = dependency('libiptc',
|
libiptc = dependency('libiptc',
|
||||||
required : get_option('libiptc'))
|
required : get_option('libiptc'))
|
||||||
@ -1574,21 +1546,17 @@ conf.set10('ENABLE_HOMED', have)
|
|||||||
have = have and conf.get('HAVE_PAM') == 1
|
have = have and conf.get('HAVE_PAM') == 1
|
||||||
conf.set10('ENABLE_PAM_HOME', have)
|
conf.set10('ENABLE_PAM_HOME', have)
|
||||||
|
|
||||||
want_remote = get_option('remote')
|
feature = get_option('remote')
|
||||||
if want_remote != 'false'
|
have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
|
||||||
have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
|
|
||||||
conf.get('HAVE_LIBCURL') == 1]
|
conf.get('HAVE_LIBCURL') == 1]
|
||||||
# sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
|
# sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
|
||||||
# it's possible to build one without the other. Complain only if
|
# it's possible to build one without the other. Complain only if
|
||||||
# support was explicitly requested. The auxiliary files like sysusers
|
# support was explicitly requested. The auxiliary files like sysusers
|
||||||
# config should be installed when any of the programs are built.
|
# config should be installed when any of the programs are built.
|
||||||
if want_remote == 'true' and not (have_deps[0] and have_deps[1])
|
if feature.enabled() and not (have_deps[0] and have_deps[1])
|
||||||
error('remote support was requested, but dependencies are not available')
|
error('remote support was requested, but dependencies are not available')
|
||||||
endif
|
|
||||||
have = have_deps[0] or have_deps[1]
|
|
||||||
else
|
|
||||||
have = false
|
|
||||||
endif
|
endif
|
||||||
|
have = feature.allowed() and (have_deps[0] or have_deps[1])
|
||||||
conf.set10('ENABLE_REMOTE', have)
|
conf.set10('ENABLE_REMOTE', have)
|
||||||
|
|
||||||
foreach term : ['analyze',
|
foreach term : ['analyze',
|
||||||
@ -1643,9 +1611,9 @@ enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1
|
|||||||
foreach tuple : [['nss-mymachines', 'machined'],
|
foreach tuple : [['nss-mymachines', 'machined'],
|
||||||
['nss-resolve', 'resolve']]
|
['nss-resolve', 'resolve']]
|
||||||
want = get_option(tuple[0])
|
want = get_option(tuple[0])
|
||||||
if want != 'false'
|
if want.allowed()
|
||||||
have = get_option(tuple[1])
|
have = get_option(tuple[1])
|
||||||
if want == 'true' and not have
|
if want.enabled() and not have
|
||||||
error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
|
error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@ -134,15 +134,15 @@ option('timedated', type : 'boolean',
|
|||||||
description : 'install the systemd-timedated daemon')
|
description : 'install the systemd-timedated daemon')
|
||||||
option('timesyncd', type : 'boolean',
|
option('timesyncd', type : 'boolean',
|
||||||
description : 'install the systemd-timesyncd daemon')
|
description : 'install the systemd-timesyncd daemon')
|
||||||
option('remote', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('remote', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'support for "journal over the network"')
|
description : 'support for "journal over the network"')
|
||||||
option('create-log-dirs', type : 'boolean',
|
option('create-log-dirs', type : 'boolean',
|
||||||
description : 'create /var/log/journal{,/remote}')
|
description : 'create /var/log/journal{,/remote}')
|
||||||
option('nss-myhostname', type : 'boolean',
|
option('nss-myhostname', type : 'boolean',
|
||||||
description : 'install nss-myhostname module')
|
description : 'install nss-myhostname module')
|
||||||
option('nss-mymachines', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('nss-mymachines', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'install nss-mymachines module')
|
description : 'install nss-mymachines module')
|
||||||
option('nss-resolve', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('nss-resolve', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'install nss-resolve module')
|
description : 'install nss-resolve module')
|
||||||
option('nss-systemd', type : 'boolean',
|
option('nss-systemd', type : 'boolean',
|
||||||
description : 'install nss-systemd module')
|
description : 'install nss-systemd module')
|
||||||
@ -168,11 +168,11 @@ option('rfkill', type : 'boolean',
|
|||||||
description : 'support for the rfkill tools')
|
description : 'support for the rfkill tools')
|
||||||
option('xdg-autostart', type : 'boolean',
|
option('xdg-autostart', type : 'boolean',
|
||||||
description : 'install the xdg-autostart-generator and unit')
|
description : 'install the xdg-autostart-generator and unit')
|
||||||
option('man', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('man', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
value : 'false',
|
value : 'disabled',
|
||||||
description : 'build and install man pages')
|
description : 'build and install man pages')
|
||||||
option('html', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('html', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
value : 'false',
|
value : 'disabled',
|
||||||
description : 'build and install html pages')
|
description : 'build and install html pages')
|
||||||
option('translations', type : 'boolean', value : true,
|
option('translations', type : 'boolean', value : true,
|
||||||
description : 'build and install translations')
|
description : 'build and install translations')
|
||||||
@ -381,23 +381,23 @@ option('xenctrl', type : 'feature', deprecated : { 'true' : 'enabled', 'false' :
|
|||||||
description : 'support for Xen kexec')
|
description : 'support for Xen kexec')
|
||||||
option('pam', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
option('pam', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'PAM support')
|
description : 'PAM support')
|
||||||
option('passwdqc', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('passwdqc', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libpasswdqc support')
|
description : 'libpasswdqc support')
|
||||||
option('pwquality', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('pwquality', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libpwquality support')
|
description : 'libpwquality support')
|
||||||
option('microhttpd', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
option('microhttpd', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libµhttpd support')
|
description : 'libµhttpd support')
|
||||||
option('libcryptsetup', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('libcryptsetup', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libcryptsetup support')
|
description : 'libcryptsetup support')
|
||||||
option('libcryptsetup-plugins', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('libcryptsetup-plugins', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libcryptsetup LUKS2 external token handlers support (plugins)')
|
description : 'libcryptsetup LUKS2 external token handlers support (plugins)')
|
||||||
option('libcurl', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
option('libcurl', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libcurl support')
|
description : 'libcurl support')
|
||||||
option('idn', type : 'boolean',
|
option('idn', type : 'boolean',
|
||||||
description : 'use IDN when printing hostnames')
|
description : 'use IDN when printing hostnames')
|
||||||
option('libidn2', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('libidn2', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libidn2 support')
|
description : 'libidn2 support')
|
||||||
option('libidn', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('libidn', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libidn support')
|
description : 'libidn support')
|
||||||
option('libiptc', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
option('libiptc', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'libiptc support')
|
description : 'libiptc support')
|
||||||
@ -476,7 +476,7 @@ option('fuzz-tests', type : 'boolean', value : false,
|
|||||||
description : 'run the fuzzer regression tests by default (with sanitizers)')
|
description : 'run the fuzzer regression tests by default (with sanitizers)')
|
||||||
option('install-tests', type : 'boolean', value : false,
|
option('install-tests', type : 'boolean', value : false,
|
||||||
description : 'install test executables')
|
description : 'install test executables')
|
||||||
option('log-message-verification', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('log-message-verification', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
|
||||||
description : 'do fake printf() calls to verify format strings')
|
description : 'do fake printf() calls to verify format strings')
|
||||||
|
|
||||||
option('ok-color', type : 'combo',
|
option('ok-color', type : 'combo',
|
||||||
|
@ -65,7 +65,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
|||||||
|
|
||||||
CONFIGURE_OPTS=(
|
CONFIGURE_OPTS=(
|
||||||
-D sysvinit-path="$sysvinit_path"
|
-D sysvinit-path="$sysvinit_path"
|
||||||
-D man=false
|
-D man=disabled
|
||||||
-D translations=false
|
-D translations=false
|
||||||
-D version-tag="${VERSION_TAG}"
|
-D version-tag="${VERSION_TAG}"
|
||||||
-D mode=developer
|
-D mode=developer
|
||||||
@ -99,10 +99,10 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
|||||||
-D networkd=true
|
-D networkd=true
|
||||||
-D timedated=true
|
-D timedated=true
|
||||||
-D timesyncd=true
|
-D timesyncd=true
|
||||||
-D remote=true
|
-D remote=enabled
|
||||||
-D nss-myhostname=true
|
-D nss-myhostname=true
|
||||||
-D nss-mymachines=true
|
-D nss-mymachines=enabled
|
||||||
-D nss-resolve=true
|
-D nss-resolve=enabled
|
||||||
-D nss-systemd=true
|
-D nss-systemd=true
|
||||||
-D firstboot=true
|
-D firstboot=true
|
||||||
-D randomseed=true
|
-D randomseed=true
|
||||||
@ -123,12 +123,12 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
|||||||
-D fdisk=enabled
|
-D fdisk=enabled
|
||||||
-D kmod=enabled
|
-D kmod=enabled
|
||||||
-D pam=enabled
|
-D pam=enabled
|
||||||
-D pwquality=true
|
-D pwquality=enabled
|
||||||
-D microhttpd=enabled
|
-D microhttpd=enabled
|
||||||
-D libcryptsetup=true
|
-D libcryptsetup=enabled
|
||||||
-D libcurl=enabled
|
-D libcurl=enabled
|
||||||
-D idn=true
|
-D idn=true
|
||||||
-D libidn2=true
|
-D libidn2=enabled
|
||||||
-D qrencode=enabled
|
-D qrencode=enabled
|
||||||
-D gcrypt=enabled
|
-D gcrypt=enabled
|
||||||
-D gnutls=enabled
|
-D gnutls=enabled
|
||||||
|
Loading…
Reference in New Issue
Block a user