2020-11-09 13:23:58 +09:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-11-18 18:32:01 +01:00
2017-04-04 23:03:47 -04:00
project ( 'systemd' , 'c' ,
2022-10-07 14:08:16 +02:00
version : '252' ,
2017-04-04 23:03:47 -04:00
license : 'LGPLv2+' ,
default_options : [
2022-03-11 15:13:23 +09:00
'c_std=gnu11' ,
2017-04-17 19:25:00 -04:00
'prefix=/usr' ,
'sysconfdir=/etc' ,
'localstatedir=/var' ,
2019-11-10 11:39:15 +01:00
'warning_level=2' ,
2017-04-04 23:03:47 -04:00
] ,
2021-07-27 16:16:07 +02:00
meson_version : '>= 0.53.2' ,
2017-04-04 23:03:47 -04:00
)
2022-10-07 14:08:16 +02:00
libsystemd_version = '0.35.0'
libudev_version = '1.7.5'
2017-09-28 19:24:16 +02:00
2017-04-04 23:03:47 -04:00
conf = configuration_data ( )
2022-05-19 13:58:15 +02:00
conf . set_quoted ( 'PROJECT_URL' , 'https://systemd.io/' )
2021-05-16 17:52:42 +02:00
conf . set ( 'PROJECT_VERSION' , meson . project_version ( ) ,
2020-02-28 11:09:16 +01:00
description : 'Numerical project version (used where a simple number is expected)' )
2017-04-04 23:03:47 -04:00
2019-02-27 11:19:07 -05:00
# This is to be used instead of meson.source_root(), as the latter will return
# the wrong result when systemd is being built as a meson subproject
project_source_root = meson . current_source_dir ( )
2020-04-24 20:12:03 +02:00
project_build_root = meson . current_build_dir ( )
2019-06-07 14:41:36 +02:00
relative_source_path = run_command ( 'realpath' ,
2020-04-24 20:12:03 +02:00
'--relative-to=@0@' . format ( project_build_root ) ,
2021-11-17 13:58:53 +01:00
project_source_root ,
check : true ) . stdout ( ) . strip ( )
2019-06-07 14:41:36 +02:00
conf . set_quoted ( 'RELATIVE_SOURCE_PATH' , relative_source_path )
2019-02-27 11:19:07 -05:00
2021-04-14 13:17:22 +02:00
conf . set10 ( 'BUILD_MODE_DEVELOPER' , get_option ( 'mode' ) == 'developer' ,
description : 'tailor build to development or release builds' )
2022-05-11 16:42:13 +02:00
verification = get_option ( 'log-message-verification' )
if verification == 'auto'
verification = conf . get ( 'BUILD_MODE_DEVELOPER' ) == 1
else
verification = verification == 'true'
endif
conf . set10 ( 'LOG_MESSAGE_VERIFICATION' , verification )
2020-08-27 17:26:49 +02:00
2018-10-10 11:56:45 +02:00
want_ossfuzz = get_option ( 'oss-fuzz' )
want_libfuzzer = get_option ( 'llvm-fuzz' )
2021-09-03 12:43:33 -04:00
if want_ossfuzz and want_libfuzzer
2020-03-30 06:42:19 +00:00
error ( 'only one of oss-fuzz or llvm-fuzz can be specified' )
2018-10-10 11:56:45 +02:00
endif
2019-05-05 19:28:42 +00:00
2022-02-22 10:49:46 +00:00
skip_deps = want_ossfuzz or get_option ( 'skip-deps' )
2020-03-30 06:42:19 +00:00
fuzzer_build = want_ossfuzz or want_libfuzzer
2018-10-10 11:56:45 +02:00
2022-05-12 12:51:11 +02:00
# If we're building *not* for actual fuzzing, allow input samples of any size
# (for testing and for reproduction of issues discovered with previously-higher
# limits).
conf . set10 ( 'FUZZ_USE_SIZE_LIMIT' , fuzzer_build )
2021-12-23 13:05:01 +01:00
# Create a title-less summary section early, so it ends up first in the output.
# More items are added later after they have been detected.
summary ( { 'build mode' : get_option ( 'mode' ) } )
2017-04-04 23:03:47 -04:00
#####################################################################
2017-07-24 04:41:45 -04:00
# Try to install the git pre-commit hook
2020-03-28 09:30:51 +01:00
add_git_hook_sh = find_program ( 'tools/add-git-hook.sh' , required : false )
if add_git_hook_sh . found ( )
2021-11-17 13:58:53 +01:00
git_hook = run_command ( add_git_hook_sh , check : false )
2020-03-28 09:30:51 +01:00
if git_hook . returncode ( ) == 0
message ( git_hook . stdout ( ) . strip ( ) )
endif
2017-07-24 04:41:45 -04:00
endif
#####################################################################
2021-11-13 17:01:16 +01:00
fs = import ( 'fs' )
2018-03-01 11:49:42 +01:00
if get_option ( 'split-usr' ) == 'auto'
2021-11-13 17:01:16 +01:00
split_usr = not fs . is_symlink ( '/bin' )
2018-03-01 11:49:42 +01:00
else
split_usr = get_option ( 'split-usr' ) == 'true'
endif
2021-02-03 10:20:49 +01:00
if split_usr
warning ( '\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n'
+ ' split-usr mode is going to be removed\n' +
'\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' )
endif
2018-03-01 21:48:36 +01:00
conf . set10 ( 'HAVE_SPLIT_USR' , split_usr ,
description : '/usr/bin and /bin directories are separate' )
2017-11-28 21:46:53 +01:00
2018-03-01 10:28:29 +01:00
if get_option ( 'split-bin' ) == 'auto'
2021-11-13 17:01:16 +01:00
split_bin = not fs . is_symlink ( '/usr/sbin' )
2018-03-01 10:28:29 +01:00
else
split_bin = get_option ( 'split-bin' ) == 'true'
endif
2018-03-01 21:48:36 +01:00
conf . set10 ( 'HAVE_SPLIT_BIN' , split_bin ,
description : 'bin and sbin directories are separate' )
2018-03-01 10:28:29 +01:00
2017-11-28 20:00:10 +01:00
rootprefixdir = get_option ( 'rootprefix' )
# Unusual rootprefixdir values are used by some distros
# (see https://github.com/systemd/systemd/pull/7461).
2018-02-28 10:20:48 +01:00
rootprefix_default = split_usr ? '/' : '/usr'
2017-11-28 21:46:53 +01:00
if rootprefixdir == ''
rootprefixdir = rootprefix_default
2017-11-28 20:00:10 +01:00
endif
2019-03-05 16:46:52 +01:00
rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
2017-04-04 23:03:47 -04:00
2020-06-03 14:02:59 -07:00
have_standalone_binaries = get_option ( 'standalone-binaries' )
2017-04-04 23:03:47 -04:00
sysvinit_path = get_option ( 'sysvinit-path' )
sysvrcnd_path = get_option ( 'sysvrcnd-path' )
2018-05-07 18:17:35 +09:00
conf . set10 ( 'HAVE_SYSV_COMPAT' , sysvinit_path != '' and sysvrcnd_path != '' ,
2017-10-03 10:41:51 +02:00
description : 'SysV init scripts and rcN.d links are supported' )
2021-07-08 09:47:32 +00:00
conf . set10 ( 'CREATE_LOG_DIRS' , get_option ( 'create-log-dirs' ) )
2017-04-04 23:03:47 -04:00
2020-04-08 23:59:13 +02:00
if get_option ( 'hibernate' ) and not get_option ( 'initrd' )
error ( 'hibernate depends on initrd' )
endif
2018-10-11 18:23:26 +02:00
conf . set10 ( 'BUMP_PROC_SYS_FS_FILE_MAX' , get_option ( 'bump-proc-sys-fs-file-max' ) )
conf . set10 ( 'BUMP_PROC_SYS_FS_NR_OPEN' , get_option ( 'bump-proc-sys-fs-nr-open' ) )
2018-11-15 09:50:42 +01:00
conf . set ( 'HIGH_RLIMIT_NOFILE' , 512 * 1024 )
2018-10-11 18:23:26 +02:00
2021-07-27 19:32:35 +02:00
# Meson ignores the preceding arguments when joining paths if an absolute
# component is encountered, so this should canonicalize various paths when they
# are absolute or relative.
2017-04-04 23:03:47 -04:00
prefixdir = get_option ( 'prefix' )
if not prefixdir . startswith ( '/' )
2017-04-17 19:25:00 -04:00
error ( 'Prefix is not absolute: "@0@"' . format ( prefixdir ) )
2017-04-04 23:03:47 -04:00
endif
2021-05-27 17:05:34 +02:00
if prefixdir != rootprefixdir and rootprefixdir != '/' and not prefixdir . strip ( '/' ) . startswith ( rootprefixdir . strip ( '/' ) + '/' )
2021-02-24 18:02:36 +01:00
error ( 'Prefix is not below root prefix (now rootprefix=@0@ prefix=@1@)' . format (
rootprefixdir , prefixdir ) )
endif
2021-07-27 19:32:35 +02:00
bindir = prefixdir / get_option ( 'bindir' )
libdir = prefixdir / get_option ( 'libdir' )
sysconfdir = prefixdir / get_option ( 'sysconfdir' )
includedir = prefixdir / get_option ( 'includedir' )
datadir = prefixdir / get_option ( 'datadir' )
localstatedir = '/' / get_option ( 'localstatedir' )
2017-04-04 23:03:47 -04:00
2021-07-27 19:32:35 +02:00
rootbindir = rootprefixdir / 'bin'
rootsbindir = rootprefixdir / ( split_bin ? 'sbin' : 'bin' )
rootlibexecdir = rootprefixdir / 'lib/systemd'
2017-04-04 23:03:47 -04:00
rootlibdir = get_option ( 'rootlibdir' )
if rootlibdir == ''
2022-06-06 20:55:45 -04:00
# This will be a relative path if libdir is in prefix.
rootlibdir = get_option ( 'libdir' )
endif
if not rootlibdir . startswith ( '/' )
# If we have a relative path, add rootprefixdir to the front.
rootlibdir = rootprefixdir / rootlibdir
2017-04-04 23:03:47 -04:00
endif
2022-06-01 08:23:02 +02:00
rootpkglibdir = rootlibdir / 'systemd'
2017-04-04 23:03:47 -04:00
2020-12-30 15:11:30 -08:00
install_sysconfdir = get_option ( 'install-sysconfdir' ) != 'false'
install_sysconfdir_samples = get_option ( 'install-sysconfdir' ) == 'true'
2017-04-04 23:03:47 -04:00
# Dirs of external packages
2021-07-27 19:32:35 +02:00
pkgconfigdatadir = get_option ( 'pkgconfigdatadir' ) != '' ? get_option ( 'pkgconfigdatadir' ) : datadir / 'pkgconfig'
pkgconfiglibdir = get_option ( 'pkgconfiglibdir' ) != '' ? get_option ( 'pkgconfiglibdir' ) : libdir / 'pkgconfig'
polkitpolicydir = datadir / 'polkit-1/actions'
polkitrulesdir = datadir / 'polkit-1/rules.d'
polkitpkladir = localstatedir / 'lib/polkit-1/localauthority/10-vendor.d'
xinitrcdir = get_option ( 'xinitrcdir' ) != '' ? get_option ( 'xinitrcdir' ) : sysconfdir / 'X11/xinit/xinitrc.d'
2017-11-23 22:20:22 +09:00
rpmmacrosdir = get_option ( 'rpmmacrosdir' )
if rpmmacrosdir != 'no'
2021-07-27 19:32:35 +02:00
rpmmacrosdir = prefixdir / rpmmacrosdir
2017-11-23 22:20:22 +09:00
endif
2021-07-27 19:32:35 +02:00
modprobedir = rootprefixdir / 'lib/modprobe.d'
2017-04-04 23:03:47 -04:00
# Our own paths
2021-07-27 19:32:35 +02:00
pkgdatadir = datadir / 'systemd'
environmentdir = prefixdir / 'lib/environment.d'
pkgsysconfdir = sysconfdir / 'systemd'
userunitdir = prefixdir / 'lib/systemd/user'
userpresetdir = prefixdir / 'lib/systemd/user-preset'
tmpfilesdir = prefixdir / 'lib/tmpfiles.d'
2022-06-20 15:06:09 +02:00
usertmpfilesdir = prefixdir / 'share/user-tmpfiles.d'
2021-07-27 19:32:35 +02:00
sysusersdir = prefixdir / 'lib/sysusers.d'
sysctldir = prefixdir / 'lib/sysctl.d'
binfmtdir = prefixdir / 'lib/binfmt.d'
modulesloaddir = prefixdir / 'lib/modules-load.d'
networkdir = rootprefixdir / 'lib/systemd/network'
pkgincludedir = includedir / 'systemd'
systemgeneratordir = rootlibexecdir / 'system-generators'
usergeneratordir = prefixdir / 'lib/systemd/user-generators'
systemenvgeneratordir = prefixdir / 'lib/systemd/system-environment-generators'
userenvgeneratordir = prefixdir / 'lib/systemd/user-environment-generators'
systemshutdowndir = rootlibexecdir / 'system-shutdown'
systemsleepdir = rootlibexecdir / 'system-sleep'
systemunitdir = rootprefixdir / 'lib/systemd/system'
systempresetdir = rootprefixdir / 'lib/systemd/system-preset'
udevlibexecdir = rootprefixdir / 'lib/udev'
udevrulesdir = udevlibexecdir / 'rules.d'
udevhwdbdir = udevlibexecdir / 'hwdb.d'
catalogdir = prefixdir / 'lib/systemd/catalog'
2021-03-16 16:47:34 +01:00
kerneldir = prefixdir / 'lib/kernel'
kernelinstalldir = kerneldir / 'install.d'
2021-07-27 19:32:35 +02:00
factorydir = datadir / 'factory'
bootlibdir = prefixdir / 'lib/systemd/boot/efi'
testsdir = prefixdir / 'lib/systemd/tests'
systemdstatedir = localstatedir / 'lib/systemd'
catalogstatedir = systemdstatedir / 'catalog'
randomseeddir = localstatedir / 'lib/systemd'
profiledir = rootlibexecdir / 'portable' / 'profile'
ntpservicelistdir = rootprefixdir / 'lib/systemd/ntp-units.d'
2017-04-04 23:03:47 -04:00
2018-02-01 22:46:15 +01:00
docdir = get_option ( 'docdir' )
if docdir == ''
2021-07-27 19:32:35 +02:00
docdir = datadir / 'doc/systemd'
2018-02-01 22:46:15 +01:00
endif
2017-04-04 23:03:47 -04:00
pamlibdir = get_option ( 'pamlibdir' )
if pamlibdir == ''
2021-07-27 19:32:35 +02:00
pamlibdir = rootlibdir / 'security'
2017-04-04 23:03:47 -04:00
endif
pamconfdir = get_option ( 'pamconfdir' )
if pamconfdir == ''
2021-07-27 19:32:35 +02:00
pamconfdir = prefixdir / 'lib/pam.d'
2017-04-04 23:03:47 -04:00
endif
2021-03-16 20:13:28 +01:00
libcryptsetup_plugins_dir = get_option ( 'libcryptsetup-plugins-dir' )
if libcryptsetup_plugins_dir == ''
2021-07-27 19:32:35 +02:00
libcryptsetup_plugins_dir = rootlibdir / 'cryptsetup'
2021-03-16 20:13:28 +01:00
endif
2018-02-15 11:43:08 +01:00
memory_accounting_default = get_option ( 'memory-accounting-default' )
2019-06-06 19:22:20 +02:00
status_unit_format_default = get_option ( 'status-unit-format-default' )
2022-06-09 20:33:29 +02:00
if status_unit_format_default == 'auto'
status_unit_format_default = conf . get ( 'BUILD_MODE_DEVELOPER' ) == 1 ? 'name' : 'description'
endif
2018-02-15 11:43:08 +01:00
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'BINFMT_DIR' , binfmtdir )
conf . set_quoted ( 'BOOTLIBDIR' , bootlibdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'CATALOG_DATABASE' , catalogstatedir / 'database' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'CERTIFICATE_ROOT' , get_option ( 'certificate-root' ) )
2021-07-08 09:47:32 +00:00
conf . set_quoted ( 'DOC_DIR' , docdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'DOCUMENT_ROOT' , pkgdatadir / 'gatewayd' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'ENVIRONMENT_DIR' , environmentdir )
conf . set_quoted ( 'INCLUDE_DIR' , includedir )
conf . set_quoted ( 'LIBDIR' , libdir )
conf . set_quoted ( 'MODPROBE_DIR' , modprobedir )
conf . set_quoted ( 'MODULESLOAD_DIR' , modulesloaddir )
2017-04-04 23:03:47 -04:00
conf . set_quoted ( 'PKGSYSCONFDIR' , pkgsysconfdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'POLKIT_AGENT_BINARY_PATH' , bindir / 'pkttyagent' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'PREFIX' , prefixdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'RANDOM_SEED' , randomseeddir / 'random-seed' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'RANDOM_SEED_DIR' , randomseeddir )
conf . set_quoted ( 'RC_LOCAL_PATH' , get_option ( 'rc-local' ) )
conf . set_quoted ( 'ROOTBINDIR' , rootbindir )
conf . set_quoted ( 'ROOTLIBDIR' , rootlibdir )
conf . set_quoted ( 'ROOTLIBEXECDIR' , rootlibexecdir )
conf . set_quoted ( 'ROOTPREFIX' , rootprefixdir )
conf . set_quoted ( 'ROOTPREFIX_NOSLASH' , rootprefixdir_noslash )
conf . set_quoted ( 'SYSCONF_DIR' , sysconfdir )
conf . set_quoted ( 'SYSCTL_DIR' , sysctldir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'SYSTEMCTL_BINARY_PATH' , rootbindir / 'systemctl' )
conf . set_quoted ( 'SYSTEMD_BINARY_PATH' , rootlibexecdir / 'systemd' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'SYSTEMD_CATALOG_DIR' , catalogdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'SYSTEMD_CGROUPS_AGENT_PATH' , rootlibexecdir / 'systemd-cgroups-agent' )
conf . set_quoted ( 'SYSTEMD_CRYPTSETUP_PATH' , rootlibexecdir / 'systemd-cryptsetup' )
conf . set_quoted ( 'SYSTEMD_EXPORT_PATH' , rootlibexecdir / 'systemd-export' )
conf . set_quoted ( 'SYSTEMD_FSCK_PATH' , rootlibexecdir / 'systemd-fsck' )
conf . set_quoted ( 'SYSTEMD_GROWFS_PATH' , rootlibexecdir / 'systemd-growfs' )
conf . set_quoted ( 'SYSTEMD_HOMEWORK_PATH' , rootlibexecdir / 'systemd-homework' )
conf . set_quoted ( 'SYSTEMD_IMPORT_FS_PATH' , rootlibexecdir / 'systemd-import-fs' )
conf . set_quoted ( 'SYSTEMD_IMPORT_PATH' , rootlibexecdir / 'systemd-import' )
2021-09-26 11:53:42 -05:00
conf . set_quoted ( 'SYSTEMD_INTEGRITYSETUP_PATH' , rootlibexecdir / 'systemd-integritysetup' )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'SYSTEMD_KBD_MODEL_MAP' , pkgdatadir / 'kbd-model-map' )
conf . set_quoted ( 'SYSTEMD_LANGUAGE_FALLBACK_MAP' , pkgdatadir / 'language-fallback-map' )
conf . set_quoted ( 'SYSTEMD_MAKEFS_PATH' , rootlibexecdir / 'systemd-makefs' )
conf . set_quoted ( 'SYSTEMD_PULL_PATH' , rootlibexecdir / 'systemd-pull' )
conf . set_quoted ( 'SYSTEMD_SHUTDOWN_BINARY_PATH' , rootlibexecdir / 'systemd-shutdown' )
conf . set_quoted ( 'SYSTEMD_TEST_DATA' , testsdir / 'testdata' )
conf . set_quoted ( 'SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH' , rootbindir / 'systemd-tty-ask-password-agent' )
conf . set_quoted ( 'SYSTEMD_UPDATE_HELPER_PATH' , rootlibexecdir / 'systemd-update-helper' )
conf . set_quoted ( 'SYSTEMD_USERWORK_PATH' , rootlibexecdir / 'systemd-userwork' )
conf . set_quoted ( 'SYSTEMD_VERITYSETUP_PATH' , rootlibexecdir / 'systemd-veritysetup' )
conf . set_quoted ( 'SYSTEM_CONFIG_UNIT_DIR' , pkgsysconfdir / 'system' )
2021-05-16 16:44:47 +02:00
conf . set_quoted ( 'SYSTEM_DATA_UNIT_DIR' , systemunitdir )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'SYSTEM_ENV_GENERATOR_DIR' , systemenvgeneratordir )
conf . set_quoted ( 'SYSTEM_GENERATOR_DIR' , systemgeneratordir )
2021-05-16 16:44:47 +02:00
conf . set_quoted ( 'SYSTEM_PRESET_DIR' , systempresetdir )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'SYSTEM_SHUTDOWN_PATH' , systemshutdowndir )
conf . set_quoted ( 'SYSTEM_SLEEP_PATH' , systemsleepdir )
2017-04-04 23:03:47 -04:00
conf . set_quoted ( 'SYSTEM_SYSVINIT_PATH' , sysvinit_path )
conf . set_quoted ( 'SYSTEM_SYSVRCND_PATH' , sysvrcnd_path )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'SYSUSERS_DIR' , sysusersdir )
conf . set_quoted ( 'TMPFILES_DIR' , tmpfilesdir )
2022-06-20 15:06:09 +02:00
conf . set_quoted ( 'USER_TMPFILES_DIR' , usertmpfilesdir )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'UDEVLIBEXECDIR' , udevlibexecdir )
2021-05-16 16:44:47 +02:00
conf . set_quoted ( 'UDEV_HWDB_DIR' , udevhwdbdir )
conf . set_quoted ( 'UDEV_RULES_DIR' , udevrulesdir )
2021-07-07 14:37:57 +02:00
conf . set_quoted ( 'UPDATE_HELPER_USER_TIMEOUT' , get_option ( 'update-helper-user-timeout' ) )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'USER_CONFIG_UNIT_DIR' , pkgsysconfdir / 'user' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'USER_DATA_UNIT_DIR' , userunitdir )
conf . set_quoted ( 'USER_ENV_GENERATOR_DIR' , userenvgeneratordir )
conf . set_quoted ( 'USER_GENERATOR_DIR' , usergeneratordir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'USER_KEYRING_PATH' , pkgsysconfdir / 'import-pubring.gpg' )
2021-05-16 19:34:52 +02:00
conf . set_quoted ( 'USER_PRESET_DIR' , userpresetdir )
2021-07-27 19:32:35 +02:00
conf . set_quoted ( 'VENDOR_KEYRING_PATH' , rootlibexecdir / 'import-pubring.gpg' )
2018-03-01 13:12:02 +01:00
2018-03-02 09:09:29 +01:00
conf . set ( 'ANSI_OK_COLOR' , 'ANSI_' + get_option ( 'ok-color' ) . underscorify ( ) . to_upper ( ) )
2021-07-11 04:39:33 -06:00
conf . set10 ( 'ENABLE_URLIFY' , get_option ( 'urlify' ) )
2020-11-06 15:01:13 +01:00
conf . set10 ( 'ENABLE_FEXECVE' , get_option ( 'fexecve' ) )
2018-10-17 14:36:09 +02:00
conf . set10 ( 'MEMORY_ACCOUNTING_DEFAULT' , memory_accounting_default )
2019-06-06 19:22:20 +02:00
conf . set ( 'STATUS_UNIT_FORMAT_DEFAULT' , 'STATUS_UNIT_FORMAT_' + status_unit_format_default . to_upper ( ) )
2021-05-16 17:52:42 +02:00
conf . set_quoted ( 'STATUS_UNIT_FORMAT_DEFAULT_STR' , status_unit_format_default )
2017-04-04 23:03:47 -04:00
2020-03-23 12:25:19 -04:00
conf . set10 ( 'FIRST_BOOT_FULL_PRESET' , get_option ( 'first-boot-full-preset' ) )
2022-07-27 10:58:29 +02:00
conf . set10 ( 'EFI_TPM_PCR_COMPAT' , get_option ( 'efi-tpm-pcr-compat' ) )
2017-04-04 23:03:47 -04:00
#####################################################################
cc = meson . get_compiler ( 'c' )
pkgconfig = import ( 'pkgconfig' )
2018-01-19 17:54:30 +11:00
meson_build_sh = find_program ( 'tools/meson-build.sh' )
2017-04-04 23:03:47 -04:00
2018-09-12 11:02:58 +02:00
want_tests = get_option ( 'tests' )
slow_tests = want_tests != 'false' and get_option ( 'slow-tests' )
2020-05-21 16:59:40 +02:00
fuzz_tests = want_tests != 'false' and get_option ( 'fuzz-tests' )
2018-09-12 11:02:58 +02:00
install_tests = get_option ( 'install-tests' )
2018-12-27 09:16:20 +08:00
if add_languages ( 'cpp' , required : fuzzer_build )
2018-09-12 16:52:08 +02:00
# Used only for tests
2019-11-10 12:16:41 +01:00
cxx = meson . get_compiler ( 'cpp' )
cxx_cmd = ' ' . join ( cxx . cmd_array ( ) )
2018-10-09 18:48:09 +02:00
else
2018-10-10 11:50:57 +02:00
cxx_cmd = ''
2017-05-13 13:23:28 -04:00
endif
2018-01-16 10:25:43 -05:00
if want_libfuzzer
2019-05-09 00:03:41 +02:00
fuzzing_engine = meson . get_compiler ( 'cpp' ) . find_library ( 'Fuzzer' , required : false )
if fuzzing_engine . found ( )
add_project_arguments ( '-fsanitize-coverage=trace-pc-guard,trace-cmp' , language : 'c' )
elif cc . has_argument ( '-fsanitize=fuzzer-no-link' )
add_project_arguments ( '-fsanitize=fuzzer-no-link' , language : 'c' )
else
error ( 'Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported' )
endif
2018-10-10 11:56:45 +02:00
elif want_ossfuzz
2018-01-13 19:51:07 -05:00
fuzzing_engine = meson . get_compiler ( 'cpp' ) . find_library ( 'FuzzingEngine' )
endif
2019-11-10 12:16:41 +01:00
# Those generate many false positives, and we do not want to change the code to
# avoid them.
basic_disabled_warnings = [
2021-06-02 15:53:29 +09:00
'-Wno-missing-field-initializers' ,
'-Wno-unused-parameter' ,
2019-11-10 12:16:41 +01:00
]
2021-06-02 15:49:44 +09:00
possible_common_cc_flags = [
2021-06-02 15:53:29 +09:00
'-Wdate-time' ,
2018-05-10 15:30:42 +09:00
'-Wendif-labels' ,
2021-06-02 15:53:29 +09:00
'-Werror=format=2' ,
2022-08-30 09:57:53 +02:00
'-Werror=format-signedness' ,
2021-06-02 15:53:29 +09:00
'-Werror=implicit-function-declaration' ,
'-Werror=incompatible-pointer-types' ,
2021-09-25 00:16:20 +09:00
'-Werror=int-conversion' ,
2018-05-10 15:30:42 +09:00
'-Werror=overflow' ,
2021-11-26 11:52:04 +01:00
'-Werror=override-init' ,
2021-06-02 15:53:29 +09:00
'-Werror=return-type' ,
2018-06-09 13:12:52 +02:00
'-Werror=shift-count-overflow' ,
2018-06-11 13:17:43 +02:00
'-Werror=shift-overflow=2' ,
2021-06-02 15:53:29 +09:00
'-Werror=undef' ,
'-Wfloat-equal' ,
2022-05-28 11:41:10 +02:00
# gperf prevents us from enabling this because it does not emit fallthrough
# attribute with clang.
#'-Wimplicit-fallthrough',
2021-06-02 15:53:29 +09:00
'-Wimplicit-fallthrough=5' ,
'-Winit-self' ,
'-Wlogical-op' ,
'-Wmissing-include-dirs' ,
'-Wmissing-noreturn' ,
2018-05-10 15:30:42 +09:00
'-Wnested-externs' ,
2021-06-02 15:53:29 +09:00
'-Wold-style-definition' ,
'-Wpointer-arith' ,
'-Wredundant-decls' ,
'-Wshadow' ,
'-Wstrict-aliasing=2' ,
'-Wstrict-prototypes' ,
'-Wsuggest-attribute=noreturn' ,
2021-11-16 09:52:39 +00:00
'-Wunused-function' ,
2021-06-02 15:53:29 +09:00
'-Wwrite-strings' ,
2018-09-08 13:55:09 -07:00
# negative arguments are correctly detected starting with meson 0.46.
2019-03-07 10:56:15 +01:00
'-Wno-error=#warnings' , # clang
'-Wno-string-plus-int' , # clang
2018-05-10 15:30:42 +09:00
]
2022-04-29 14:35:20 +02:00
c_args = get_option ( 'c_args' )
2022-07-18 05:02:48 +09:00
# Our json library does not support -ffinite-math-only, which is enabled by -Ofast or -ffast-math.
2022-08-09 14:48:14 +09:00
if ( ( '-Ofast' in c_args or '-ffast-math' in c_args or '-ffinite-math-only' in c_args ) and '-fno-finite-math-only' not in c_args )
2022-07-18 05:02:48 +09:00
error ( '-Ofast, -ffast-math, or -ffinite-math-only is specified in c_args.' )
endif
2022-03-07 15:32:22 +09:00
# Disable -Wmaybe-uninitialized when compiling with -Os/-O1/-O3/etc. There are
2021-03-31 17:05:49 +02:00
# too many false positives with gcc >= 8. Effectively, we only test with -O0
# and -O2; this should be enough to catch most important cases without too much
# busywork. See https://github.com/systemd/systemd/pull/19226.
if cc . get_id ( ) == 'gcc' and ( not '02' . contains ( get_option ( 'optimization' ) ) or
2022-04-29 14:35:20 +02:00
cc . version ( ) . version_compare ( '<10' ) or
'-Os' in c_args or
'-O1' in c_args or
'-O3' in c_args or
'-Og' in c_args )
2021-06-02 15:49:44 +09:00
possible_common_cc_flags + = '-Wno-maybe-uninitialized'
2021-03-31 17:05:49 +02:00
endif
2021-07-06 15:13:00 +02:00
# Disable -Wno-unused-result with gcc, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425.
if cc . get_id ( ) == 'gcc'
possible_common_cc_flags + = '-Wno-unused-result'
endif
2018-05-10 15:30:42 +09:00
# --as-needed and --no-undefined are provided by meson by default,
2021-07-27 16:16:07 +02:00
# run 'meson configure' to see what is enabled
2018-05-10 15:30:42 +09:00
possible_link_flags = [
2021-11-04 19:03:45 +01:00
'-Wl,--fatal-warnings' ,
2018-05-10 15:30:42 +09:00
'-Wl,-z,now' ,
2021-11-04 19:03:45 +01:00
'-Wl,-z,relro' ,
2019-09-19 17:49:20 +02:00
'-fstack-protector' ,
2018-05-10 15:30:42 +09:00
]
2017-04-04 23:03:47 -04:00
2021-11-04 19:03:45 +01:00
if get_option ( 'b_sanitize' ) == 'none'
possible_link_flags + = '-Wl,--warn-common'
endif
2018-05-10 15:30:42 +09:00
if cc . get_id ( ) == 'clang'
2021-06-02 15:49:44 +09:00
possible_common_cc_flags + = [
2018-05-10 15:30:42 +09:00
'-Wno-typedef-redefinition' ,
'-Wno-gnu-variable-sized-type-not-at-end' ,
]
endif
2022-05-07 11:31:26 +02:00
if get_option ( 'mode' ) == 'release'
# We could enable 'pattern' for developer mode, but that can interfere with
# valgrind and sanitizer builds. Also, clang does not zero-initialize unions,
# breaking some of our code (https://reviews.llvm.org/D68115).
possible_common_cc_flags + = '-ftrivial-auto-var-init=zero'
endif
2021-06-08 09:23:50 +09:00
possible_cc_flags = possible_common_cc_flags + [
'-Werror=missing-declarations' ,
'-Werror=missing-prototypes' ,
'-fdiagnostics-show-option' ,
'-fno-common' ,
'-fno-strict-aliasing' ,
'-fstack-protector' ,
'-fstack-protector-strong' ,
'-fvisibility=hidden' ,
'--param=ssp-buffer-size=4' ,
]
2018-05-10 15:30:42 +09:00
if get_option ( 'buildtype' ) != 'debug'
2021-06-08 09:23:50 +09:00
possible_cc_flags + = [
2018-05-10 15:30:42 +09:00
'-ffunction-sections' ,
'-fdata-sections' ,
]
possible_link_flags + = '-Wl,--gc-sections'
endif
2022-06-08 22:32:49 +02:00
if get_option ( 'mode' ) == 'developer'
possible_cc_flags + = '-fno-omit-frame-pointer'
endif
2019-11-10 12:16:41 +01:00
add_project_arguments ( cc . get_supported_arguments ( basic_disabled_warnings ) , language : 'c' )
2018-05-10 15:30:42 +09:00
add_project_arguments ( cc . get_supported_arguments ( possible_cc_flags ) , language : 'c' )
2018-05-15 20:18:24 +09:00
add_project_link_arguments ( cc . get_supported_link_arguments ( possible_link_flags ) , language : 'c' )
2018-05-10 15:30:42 +09:00
2020-05-09 09:09:11 +02:00
have = cc . has_argument ( '-Wzero-length-bounds' )
conf . set10 ( 'HAVE_ZERO_LENGTH_BOUNDS' , have )
2018-02-19 01:37:19 -08:00
if cc . compiles ( '''
2017-04-04 23:03:47 -04:00
#include <time.h>
#include <inttypes.h>
typedef uint64_t usec_t;
usec_t now(clockid_t clock);
int main(void) {
struct timespec now;
return 0;
}
2018-11-29 13:22:08 +01:00
''' , args : '-Werror=shadow' , name : '-Werror=shadow with local shadowing' )
2017-04-17 19:25:00 -04:00
add_project_arguments ( '-Werror=shadow' , language : 'c' )
2017-04-04 23:03:47 -04:00
endif
2019-11-10 12:16:41 +01:00
if cxx_cmd != ''
add_project_arguments ( cxx . get_supported_arguments ( basic_disabled_warnings ) , language : 'cpp' )
endif
2018-10-11 15:12:41 +02:00
cpp = ' ' . join ( cc . cmd_array ( ) ) + ' -E'
2017-04-11 10:25:34 -04:00
2019-05-07 15:10:58 +02:00
has_wstringop_truncation = cc . has_argument ( '-Wstringop-truncation' )
2017-04-04 23:03:47 -04:00
#####################################################################
# compilation result tests
2017-04-27 21:13:08 -04:00
conf . set ( '_GNU_SOURCE' , true )
conf . set ( '__SANE_USERSPACE_TYPES__' , true )
2019-05-07 15:10:58 +02:00
conf . set10 ( 'HAVE_WSTRINGOP_TRUNCATION' , has_wstringop_truncation )
2017-04-04 23:03:47 -04:00
conf . set ( 'SIZEOF_DEV_T' , cc . sizeof ( 'dev_t' , prefix : '#include <sys/types.h>' ) )
conf . set ( 'SIZEOF_INO_T' , cc . sizeof ( 'ino_t' , prefix : '#include <sys/types.h>' ) )
conf . set ( 'SIZEOF_TIME_T' , cc . sizeof ( 'time_t' , prefix : '#include <sys/time.h>' ) )
conf . set ( 'SIZEOF_RLIM_T' , cc . sizeof ( 'rlim_t' , prefix : '#include <sys/resource.h>' ) )
2021-12-21 20:10:09 +09:00
conf . set ( 'SIZEOF_TIMEX_MEMBER' , cc . sizeof ( 'typeof(((struct timex *)0)->freq)' , prefix : '#include <sys/timex.h>' ) )
2017-04-04 23:03:47 -04:00
decl_headers = '''
#include <uchar.h>
2021-04-27 14:16:06 +02:00
#include <sys/mount.h>
2018-02-20 12:48:33 +01:00
#include <sys/stat.h>
2017-04-04 23:03:47 -04:00
'''
foreach decl : [ 'char16_t' ,
'char32_t' ,
2021-04-27 14:16:06 +02:00
'struct mount_attr' ,
2018-02-20 12:48:33 +01:00
'struct statx' ,
2017-04-04 23:03:47 -04:00
]
2017-04-27 21:13:08 -04:00
# We get -1 if the size cannot be determined
2018-07-18 17:26:17 +02:00
have = cc . sizeof ( decl , prefix : decl_headers , args : '-D_GNU_SOURCE' ) > 0
2022-07-23 10:38:49 +00:00
if decl == 'struct mount_attr'
if have
want_linux_fs_h = false
else
have = cc . sizeof ( decl ,
prefix : decl_headers + '#include <linux/fs.h>' ,
args : '-D_GNU_SOURCE' ) > 0
want_linux_fs_h = have
endif
endif
2018-07-18 17:26:17 +02:00
if decl == 'struct statx'
if have
want_linux_stat_h = false
else
have = cc . sizeof ( decl ,
prefix : decl_headers + '#include <linux/stat.h>' ,
args : '-D_GNU_SOURCE' ) > 0
want_linux_stat_h = have
endif
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_' + decl . underscorify ( ) . to_upper ( ) , have )
2017-04-04 23:03:47 -04:00
endforeach
2018-07-18 17:26:17 +02:00
conf . set10 ( 'WANT_LINUX_STAT_H' , want_linux_stat_h )
2022-07-23 10:38:49 +00:00
conf . set10 ( 'WANT_LINUX_FS_H' , want_linux_fs_h )
2018-07-15 22:43:35 -07:00
2017-04-04 23:03:47 -04:00
foreach ident : [ 'secure_getenv' , '__secure_getenv' ]
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_' + ident . to_upper ( ) , cc . has_function ( ident ) )
2017-04-04 23:03:47 -04:00
endforeach
foreach ident : [
2017-12-25 12:01:14 +01:00
[ 'memfd_create' , '''#include <sys/mman.h>''' ] ,
2017-12-25 12:35:28 +01:00
[ 'gettid' , '''#include <sys/types.h>
#include <unistd.h>''' ] ,
2017-12-25 12:07:40 +01:00
[ 'pivot_root' , '''#include <stdlib.h>
#include <unistd.h>''' ] , # no known header declares pivot_root
2021-09-14 16:27:32 +02:00
[ 'ioprio_get' , '''#include <sched.h>''' ] , # no known header declares ioprio_get
[ 'ioprio_set' , '''#include <sched.h>''' ] , # no known header declares ioprio_set
2017-12-25 12:01:14 +01:00
[ 'name_to_handle_at' , '''#include <sys/types.h>
2017-04-17 19:25:00 -04:00
#include <sys/stat.h>
#include <fcntl.h>''' ] ,
2017-12-25 12:01:14 +01:00
[ 'setns' , '''#include <sched.h>''' ] ,
2017-12-25 12:35:43 +01:00
[ 'renameat2' , '''#include <stdio.h>
#include <fcntl.h>''' ] ,
2017-04-17 19:25:00 -04:00
[ 'kcmp' , '''#include <linux/kcmp.h>''' ] ,
[ 'keyctl' , '''#include <sys/types.h>
#include <keyutils.h>''' ] ,
2017-12-25 12:01:14 +01:00
[ 'copy_file_range' , '''#include <sys/syscall.h>
2017-04-17 19:25:00 -04:00
#include <unistd.h>''' ] ,
2016-10-18 17:57:10 +02:00
[ 'bpf' , '''#include <sys/syscall.h>
#include <unistd.h>''' ] ,
2018-02-20 12:48:33 +01:00
[ 'statx' , '''#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>''' ] ,
2018-02-26 21:20:00 +01:00
[ 'explicit_bzero' , '''#include <string.h>''' ] ,
2020-12-12 16:15:57 -08:00
[ 'reallocarray' , '''#include <stdlib.h>''' ] ,
2019-03-12 18:58:26 +01:00
[ 'set_mempolicy' , '''#include <stdlib.h>
#include <unistd.h>''' ] ,
[ 'get_mempolicy' , '''#include <stdlib.h>
#include <unistd.h>''' ] ,
2019-10-25 16:06:06 +02:00
[ 'pidfd_send_signal' , '''#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>''' ] ,
[ 'pidfd_open' , '''#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>''' ] ,
2019-10-30 16:29:42 +01:00
[ 'rt_sigqueueinfo' , '''#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>''' ] ,
2020-10-09 16:48:03 +02:00
[ 'mallinfo' , '''#include <malloc.h>''' ] ,
2021-05-03 20:36:32 +02:00
[ 'mallinfo2' , '''#include <malloc.h>''' ] ,
2020-09-23 16:23:30 +02:00
[ 'execveat' , '''#include <unistd.h>''' ] ,
2020-10-13 17:53:25 +02:00
[ 'close_range' , '''#include <unistd.h>''' ] ,
2021-02-25 16:56:07 +01:00
[ 'epoll_pwait2' , '''#include <sys/epoll.h>''' ] ,
2021-04-27 14:16:06 +02:00
[ 'mount_setattr' , '''#include <sys/mount.h>''' ] ,
[ 'move_mount' , '''#include <sys/mount.h>''' ] ,
[ 'open_tree' , '''#include <sys/mount.h>''' ] ,
2021-10-08 10:46:02 +02:00
[ 'getdents64' , '''#include <dirent.h>''' ] ,
2017-04-17 19:25:00 -04:00
]
2017-04-04 23:03:47 -04:00
2017-12-25 12:01:14 +01:00
have = cc . has_function ( ident [ 0 ] , prefix : ident [ 1 ] , args : '-D_GNU_SOURCE' )
2017-10-03 10:32:34 +02:00
conf . set10 ( 'HAVE_' + ident [ 0 ] . to_upper ( ) , have )
2017-04-04 23:03:47 -04:00
endforeach
2017-12-25 12:01:14 +01:00
if cc . has_function ( 'getrandom' , prefix : '''#include <sys/random.h>''' , args : '-D_GNU_SOURCE' )
2017-10-03 10:41:51 +02:00
conf . set10 ( 'USE_SYS_RANDOM_H' , true )
2017-10-03 10:32:34 +02:00
conf . set10 ( 'HAVE_GETRANDOM' , true )
2017-04-19 21:20:54 -04:00
else
have = cc . has_function ( 'getrandom' , prefix : '''#include <linux/random.h>''' )
2017-10-03 10:41:51 +02:00
conf . set10 ( 'USE_SYS_RANDOM_H' , false )
2017-10-03 10:32:34 +02:00
conf . set10 ( 'HAVE_GETRANDOM' , have )
2017-04-19 21:20:54 -04:00
endif
2017-04-04 23:03:47 -04:00
#####################################################################
2021-01-10 13:18:36 +01:00
version_tag = get_option ( 'version-tag' )
if version_tag != ''
vcs_data = configuration_data ( )
vcs_data . set ( 'VCS_TAG' , version_tag )
version_h = configure_file ( configuration : vcs_data ,
input : 'src/version/version.h.in' ,
output : 'version.h' )
else
vcs_tagger = [
project_source_root + '/tools/meson-vcs-tag.sh' ,
project_source_root ,
meson . project_version ( ) ]
2018-12-20 20:35:25 +01:00
2021-01-10 13:18:36 +01:00
version_h = vcs_tag (
input : 'src/version/version.h.in' ,
output : 'version.h' ,
command : vcs_tagger )
endif
2019-01-21 21:45:36 +00:00
versiondep = declare_dependency ( sources : version_h )
2021-12-14 18:03:06 +01:00
shared_lib_tag = get_option ( 'shared-lib-tag' )
if shared_lib_tag == ''
shared_lib_tag = meson . project_version ( )
endif
2021-05-14 14:16:17 +02:00
sh = find_program ( 'sh' )
echo = find_program ( 'echo' )
2017-04-04 23:03:47 -04:00
sed = find_program ( 'sed' )
awk = find_program ( 'awk' )
stat = find_program ( 'stat' )
2021-05-14 14:16:17 +02:00
ln = find_program ( 'ln' )
2017-04-06 14:33:27 -04:00
git = find_program ( 'git' , required : false )
2018-01-19 17:54:30 +11:00
env = find_program ( 'env' )
2018-03-22 08:34:21 +01:00
perl = find_program ( 'perl' , required : false )
2021-05-14 14:16:17 +02:00
rsync = find_program ( 'rsync' , required : false )
2021-05-14 16:12:51 +02:00
meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
2021-05-14 14:16:17 +02:00
mkdir_p = 'mkdir -p $DESTDIR/@0@'
2017-04-09 23:55:05 -04:00
2021-07-27 16:16:07 +02:00
# If -Dxxx-path option is found, use that. Otherwise, check in $PATH,
2017-04-04 23:03:47 -04:00
# /usr/sbin, /sbin, and fall back to the default from middle column.
2018-01-04 07:14:20 -05:00
progs = [ [ 'quotaon' , '/usr/sbin/quotaon' ] ,
2017-04-04 23:03:47 -04:00
[ 'quotacheck' , '/usr/sbin/quotacheck' ] ,
[ 'kmod' , '/usr/bin/kmod' ] ,
[ 'kexec' , '/usr/sbin/kexec' ] ,
[ 'sulogin' , '/usr/sbin/sulogin' ] ,
[ 'mount' , '/usr/bin/mount' , 'MOUNT_PATH' ] ,
[ 'umount' , '/usr/bin/umount' , 'UMOUNT_PATH' ] ,
[ 'loadkeys' , '/usr/bin/loadkeys' , 'KBD_LOADKEYS' ] ,
[ 'setfont' , '/usr/bin/setfont' , 'KBD_SETFONT' ] ,
2019-07-18 01:24:00 +02:00
[ 'nologin' , '/usr/sbin/nologin' , ] ,
2017-04-04 23:03:47 -04:00
]
foreach prog : progs
2017-04-17 19:25:00 -04:00
path = get_option ( prog [ 0 ] + '-path' )
if path != ''
message ( 'Using @1@ for @0@' . format ( prog [ 0 ] , path ) )
else
exe = find_program ( prog [ 0 ] ,
'/usr/sbin/' + prog [ 0 ] ,
'/sbin/' + prog [ 0 ] ,
required : false )
path = exe . found ( ) ? exe . path ( ) : prog [ 1 ]
endif
name = prog . length ( ) > 2 ? prog [ 2 ] : prog [ 0 ] . to_upper ( )
conf . set_quoted ( name , path )
2017-04-04 23:03:47 -04:00
endforeach
2018-01-04 07:14:20 -05:00
conf . set_quoted ( 'TELINIT' , get_option ( 'telinit-path' ) )
2021-11-17 13:58:53 +01:00
if run_command ( ln , '--relative' , '--help' , check : false ) . returncode ( ) != 0
2018-03-09 08:56:23 +01:00
error ( 'ln does not support --relative (added in coreutils 8.16)' )
2017-04-18 19:11:54 -04:00
endif
2017-04-04 23:03:47 -04:00
############################################################
2022-03-21 20:47:02 +01:00
python = find_program ( 'python3' )
if run_command ( python , '-c' , 'import jinja2' , check : false ) . returncode ( ) != 0
2021-05-16 15:31:00 +02:00
error ( 'python3 jinja2 missing' )
endif
############################################################
2017-04-04 23:03:47 -04:00
gperf = find_program ( 'gperf' )
gperf_test_format = '''
#include <string.h>
const char * in_word_set(const char *, @0@);
@1@
'''
2022-05-15 11:11:24 -04:00
gperf_snippet = run_command ( sh , '-c' , 'echo foo,bar | "$1" -L ANSI-C' , '_' , gperf ,
2021-11-17 13:58:53 +01:00
check : true )
2017-04-04 23:03:47 -04:00
gperf_test = gperf_test_format . format ( 'size_t' , gperf_snippet . stdout ( ) )
if cc . compiles ( gperf_test )
2017-04-17 19:25:00 -04:00
gperf_len_type = 'size_t'
2017-04-04 23:03:47 -04:00
else
2017-04-17 19:25:00 -04:00
gperf_test = gperf_test_format . format ( 'unsigned' , gperf_snippet . stdout ( ) )
if cc . compiles ( gperf_test )
gperf_len_type = 'unsigned'
else
error ( 'unable to determine gperf len type' )
endif
2017-04-04 23:03:47 -04:00
endif
message ( 'gperf len type is @0@' . format ( gperf_len_type ) )
2017-04-17 19:25:00 -04:00
conf . set ( 'GPERF_LEN_TYPE' , gperf_len_type ,
description : 'The type of gperf "len" parameter' )
2017-04-04 23:03:47 -04:00
############################################################
if not cc . has_header ( 'sys/capability.h' )
2017-04-17 19:25:00 -04:00
error ( 'POSIX caps headers not found' )
2017-04-04 23:03:47 -04:00
endif
2018-01-25 15:30:15 +01:00
foreach header : [ 'crypt.h' ,
2017-04-04 23:03:47 -04:00
'linux/memfd.h' ,
'linux/vm_sockets.h' ,
2017-10-03 12:09:40 +02:00
'sys/auxv.h' ,
2017-04-04 23:03:47 -04:00
'valgrind/memcheck.h' ,
'valgrind/valgrind.h' ,
2021-02-25 16:56:07 +01:00
'linux/time_types.h' ,
2020-08-24 11:21:44 +02:00
'sys/sdt.h' ,
2017-04-04 23:03:47 -04:00
]
2017-04-27 21:13:08 -04:00
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_' + header . underscorify ( ) . to_upper ( ) ,
cc . has_header ( header ) )
2017-04-04 23:03:47 -04:00
endforeach
############################################################
2020-05-07 17:30:02 +02:00
fallback_hostname = get_option ( 'fallback-hostname' )
if fallback_hostname == '' or fallback_hostname [ 0 ] == '.' or fallback_hostname [ 0 ] == '-'
error ( 'Invalid fallback-hostname configuration' )
# A more extensive test is done in test-hostname-util. Let's catch
# the most obvious errors here so we don't fail with an assert later.
endif
conf . set_quoted ( 'FALLBACK_HOSTNAME' , fallback_hostname )
2017-04-04 23:03:47 -04:00
default_hierarchy = get_option ( 'default-hierarchy' )
conf . set_quoted ( 'DEFAULT_HIERARCHY_NAME' , default_hierarchy ,
description : 'default cgroup hierarchy as string' )
if default_hierarchy == 'legacy'
2017-04-17 19:25:00 -04:00
conf . set ( 'DEFAULT_HIERARCHY' , 'CGROUP_UNIFIED_NONE' )
2017-04-04 23:03:47 -04:00
elif default_hierarchy == 'hybrid'
2017-04-17 19:25:00 -04:00
conf . set ( 'DEFAULT_HIERARCHY' , 'CGROUP_UNIFIED_SYSTEMD' )
2017-04-04 23:03:47 -04:00
else
2017-04-17 19:25:00 -04:00
conf . set ( 'DEFAULT_HIERARCHY' , 'CGROUP_UNIFIED_ALL' )
2017-04-04 23:03:47 -04:00
endif
2021-09-28 10:12:36 +02:00
extra_net_naming_schemes = [ ]
extra_net_naming_map = [ ]
foreach scheme : get_option ( 'extra-net-naming-schemes' ) . split ( ',' )
if scheme != ''
name = scheme . split ( '=' ) [ 0 ]
value = scheme . split ( '=' ) [ 1 ]
NAME = name . underscorify ( ) . to_upper ( )
VALUE = [ ]
foreach field : value . split ( '+' )
VALUE + = 'NAMING_' + field . underscorify ( ) . to_upper ( )
endforeach
extra_net_naming_schemes + = 'NAMING_@0@ = @1@,' . format ( NAME , '|' . join ( VALUE ) )
extra_net_naming_map + = '{ "@0@", NAMING_@1@ },' . format ( name , NAME )
endif
endforeach
conf . set ( 'EXTRA_NET_NAMING_SCHEMES' , ' ' . join ( extra_net_naming_schemes ) )
conf . set ( 'EXTRA_NET_NAMING_MAP' , ' ' . join ( extra_net_naming_map ) )
2018-12-11 23:28:29 +01:00
default_net_naming_scheme = get_option ( 'default-net-naming-scheme' )
conf . set_quoted ( 'DEFAULT_NET_NAMING_SCHEME' , default_net_naming_scheme )
2021-09-28 09:33:30 +02:00
if default_net_naming_scheme != 'latest'
conf . set ( '_DEFAULT_NET_NAMING_SCHEME_TEST' ,
'NAMING_' + default_net_naming_scheme . underscorify ( ) . to_upper ( ) )
endif
2018-12-11 23:28:29 +01:00
2017-04-04 23:03:47 -04:00
time_epoch = get_option ( 'time-epoch' )
2022-07-30 13:44:11 +09:00
if time_epoch < = 0
2021-11-17 13:58:53 +01:00
time_epoch = run_command ( sh , '-c' , 'echo "$SOURCE_DATE_EPOCH"' , check : true ) . stdout ( ) . strip ( )
2021-11-13 17:01:16 +01:00
if time_epoch == '' and git . found ( ) and fs . exists ( '.git' )
2020-07-20 20:41:48 +01:00
# If we're in a git repository, use the creation time of the latest git tag.
2021-11-17 13:58:53 +01:00
latest_tag = run_command ( git , 'describe' , '--abbrev=0' , '--tags' ,
check : false )
if latest_tag . returncode ( ) == 0
time_epoch = run_command (
git , 'log' , '--no-show-signature' , '-1' , '--format=%at' ,
latest_tag . stdout ( ) . strip ( ) ,
check : false ) . stdout ( )
endif
2020-05-15 19:16:05 +01:00
endif
2020-07-23 12:23:58 +02:00
if time_epoch == ''
NEWS = files ( 'NEWS' )
2021-11-17 13:58:53 +01:00
time_epoch = run_command ( stat , '-c' , '%Y' , NEWS ,
check : true ) . stdout ( )
2020-07-23 12:23:58 +02:00
endif
2022-07-26 21:13:55 -04:00
time_epoch = time_epoch . strip ( ) . to_int ( )
2017-04-04 23:03:47 -04:00
endif
conf . set ( 'TIME_EPOCH' , time_epoch )
2021-07-28 12:13:31 +03:00
conf . set ( 'CLOCK_VALID_RANGE_USEC_MAX' , get_option ( 'clock-valid-range-usec-max' ) )
2022-03-24 17:15:39 +01:00
default_user_shell = get_option ( 'default-user-shell' )
conf . set_quoted ( 'DEFAULT_USER_SHELL' , default_user_shell )
conf . set_quoted ( 'DEFAULT_USER_SHELL_NAME' , fs . name ( default_user_shell ) )
2020-09-25 16:50:45 +02:00
foreach tuple : [ [ 'system-alloc-uid-min' , 'SYS_UID_MIN' , 1 ] , # Also see login.defs(5).
[ 'system-uid-max' , 'SYS_UID_MAX' , 999 ] ,
[ 'system-alloc-gid-min' , 'SYS_GID_MIN' , 1 ] ,
[ 'system-gid-max' , 'SYS_GID_MAX' , 999 ] ]
v = get_option ( tuple [ 0 ] )
2022-07-30 13:44:11 +09:00
if v < = 0
2020-09-25 16:50:45 +02:00
v = run_command (
awk ,
'/^\s*@0@\s+/ { uid=$2 } END { print uid }' . format ( tuple [ 1 ] ) ,
2021-11-17 13:58:53 +01:00
'/etc/login.defs' ,
check : false ) . stdout ( ) . strip ( )
2020-09-25 16:50:45 +02:00
if v == ''
v = tuple [ 2 ]
else
v = v . to_int ( )
endif
2018-02-18 18:33:16 -08:00
endif
2020-09-25 16:50:45 +02:00
conf . set ( tuple [ 0 ] . underscorify ( ) . to_upper ( ) , v )
endforeach
if conf . get ( 'SYSTEM_ALLOC_UID_MIN' ) > = conf . get ( 'SYSTEM_UID_MAX' )
error ( 'Invalid uid allocation range' )
2017-04-04 23:03:47 -04:00
endif
2020-09-25 16:50:45 +02:00
if conf . get ( 'SYSTEM_ALLOC_GID_MIN' ) > = conf . get ( 'SYSTEM_GID_MAX' )
error ( 'Invalid gid allocation range' )
2017-04-04 23:03:47 -04:00
endif
2018-05-10 16:04:16 +09:00
dynamic_uid_min = get_option ( 'dynamic-uid-min' )
dynamic_uid_max = get_option ( 'dynamic-uid-max' )
2017-12-02 12:48:31 +01:00
conf . set ( 'DYNAMIC_UID_MIN' , dynamic_uid_min )
conf . set ( 'DYNAMIC_UID_MAX' , dynamic_uid_max )
2018-05-10 16:04:16 +09:00
container_uid_base_min = get_option ( 'container-uid-base-min' )
container_uid_base_max = get_option ( 'container-uid-base-max' )
2017-12-02 12:48:31 +01:00
conf . set ( 'CONTAINER_UID_BASE_MIN' , container_uid_base_min )
conf . set ( 'CONTAINER_UID_BASE_MAX' , container_uid_base_max )
2017-12-05 11:00:24 +01:00
nobody_user = get_option ( 'nobody-user' )
nobody_group = get_option ( 'nobody-group' )
2018-07-23 14:53:09 +08:00
if not meson . is_cross_build ( )
2021-11-17 13:58:53 +01:00
getent_result = run_command ( 'getent' , 'passwd' , '65534' , check : false )
2018-07-23 14:53:09 +08:00
if getent_result . returncode ( ) == 0
name = getent_result . stdout ( ) . split ( ':' ) [ 0 ]
if name != nobody_user
warning ( '\n' +
'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n' . format ( nobody_user , name ) +
'Your build will result in an user table setup that is incompatible with the local system.' )
endif
2017-12-05 11:00:24 +01:00
endif
2021-11-17 13:58:53 +01:00
id_result = run_command ( 'id' , '-u' , nobody_user , check : false )
2018-07-23 14:53:09 +08:00
if id_result . returncode ( ) == 0
2022-07-26 21:13:55 -04:00
id = id_result . stdout ( ) . strip ( ) . to_int ( )
2018-07-23 14:53:09 +08:00
if id != 65534
warning ( '\n' +
'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n' . format ( nobody_user , id ) +
'Your build will result in an user table setup that is incompatible with the local system.' )
endif
2017-12-05 11:00:24 +01:00
endif
2021-11-17 13:58:53 +01:00
getent_result = run_command ( 'getent' , 'group' , '65534' , check : false )
2018-07-23 14:53:09 +08:00
if getent_result . returncode ( ) == 0
name = getent_result . stdout ( ) . split ( ':' ) [ 0 ]
if name != nobody_group
warning ( '\n' +
'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n' . format ( nobody_group , name ) +
'Your build will result in an group table setup that is incompatible with the local system.' )
endif
2017-12-05 11:00:24 +01:00
endif
2021-11-17 13:58:53 +01:00
id_result = run_command ( 'id' , '-g' , nobody_group , check : false )
2018-07-23 14:53:09 +08:00
if id_result . returncode ( ) == 0
2022-07-26 21:13:55 -04:00
id = id_result . stdout ( ) . strip ( ) . to_int ( )
2018-07-23 14:53:09 +08:00
if id != 65534
warning ( '\n' +
2021-04-15 00:01:53 +01:00
'The local group with the configured group name "@0@" of the nobody group does not have GID 65534 (it has @1@).\n' . format ( nobody_group , id ) +
2018-07-23 14:53:09 +08:00
'Your build will result in an group table setup that is incompatible with the local system.' )
endif
2017-12-05 11:00:24 +01:00
endif
endif
2017-12-07 17:19:11 +09:00
if nobody_user != nobody_group and not ( nobody_user == 'nobody' and nobody_group == 'nogroup' )
2018-05-10 14:50:52 +09:00
warning ( '\n' +
'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n' . format ( nobody_user , nobody_group ) +
'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.' )
2017-12-07 17:19:11 +09:00
endif
2017-12-05 11:00:24 +01:00
conf . set_quoted ( 'NOBODY_USER_NAME' , nobody_user )
conf . set_quoted ( 'NOBODY_GROUP_NAME' , nobody_group )
2017-12-02 12:48:31 +01:00
2021-05-23 22:00:22 +02:00
static_ugids = [ ]
foreach option : [ 'adm-gid' ,
'audio-gid' ,
'cdrom-gid' ,
'dialout-gid' ,
'disk-gid' ,
'input-gid' ,
'kmem-gid' ,
'kvm-gid' ,
'lp-gid' ,
'render-gid' ,
'sgx-gid' ,
'tape-gid' ,
'tty-gid' ,
'users-gid' ,
'utmp-gid' ,
'video-gid' ,
'wheel-gid' ,
'systemd-journal-gid' ,
'systemd-network-uid' ,
'systemd-resolve-uid' ,
'systemd-timesync-uid' ]
name = option . underscorify ( ) . to_upper ( )
val = get_option ( option )
2017-04-04 23:03:47 -04:00
2021-05-23 22:00:22 +02:00
# Ensure provided GID argument is numeric, otherwise fall back to default assignment
2022-07-30 13:44:11 +09:00
conf . set ( name , val > 0 ? val : '-' )
if val > 0
2021-05-23 22:00:22 +02:00
static_ugids + = '@0@:@1@' . format ( option , val )
endif
endforeach
2017-12-03 12:28:23 +00:00
2018-05-07 18:17:35 +09:00
conf . set10 ( 'ENABLE_ADM_GROUP' , get_option ( 'adm-group' ) )
conf . set10 ( 'ENABLE_WHEEL_GROUP' , get_option ( 'wheel-group' ) )
2017-04-04 23:03:47 -04:00
2018-07-13 23:36:13 +02:00
dev_kvm_mode = get_option ( 'dev-kvm-mode' )
2021-05-16 13:35:51 +02:00
conf . set_quoted ( 'DEV_KVM_MODE' , dev_kvm_mode ) # FIXME: convert to 0o… notation
2018-07-13 23:36:13 +02:00
conf . set10 ( 'DEV_KVM_UACCESS' , dev_kvm_mode != '0666' )
2019-03-13 23:22:26 +01:00
group_render_mode = get_option ( 'group-render-mode' )
2021-05-16 15:51:17 +02:00
conf . set_quoted ( 'GROUP_RENDER_MODE' , group_render_mode )
2019-03-13 23:22:26 +01:00
conf . set10 ( 'GROUP_RENDER_UACCESS' , group_render_mode != '0666' )
2017-04-04 23:03:47 -04:00
2017-04-12 19:54:33 -04:00
kill_user_processes = get_option ( 'default-kill-user-processes' )
conf . set10 ( 'KILL_USER_PROCESSES' , kill_user_processes )
2017-04-04 23:03:47 -04:00
2017-04-27 20:54:52 -04:00
dns_servers = get_option ( 'dns-servers' )
conf . set_quoted ( 'DNS_SERVERS' , dns_servers )
2017-04-04 23:03:47 -04:00
2017-04-27 20:54:52 -04:00
ntp_servers = get_option ( 'ntp-servers' )
conf . set_quoted ( 'NTP_SERVERS' , ntp_servers )
2017-04-04 23:03:47 -04:00
2018-12-28 07:38:36 -05:00
default_locale = get_option ( 'default-locale' )
conf . set_quoted ( 'SYSTEMD_DEFAULT_LOCALE' , default_locale )
2022-06-03 13:18:10 +02:00
nspawn_locale = get_option ( 'nspawn-locale' )
conf . set_quoted ( 'SYSTEMD_NSPAWN_LOCALE' , nspawn_locale )
2021-01-08 23:59:38 +01:00
localegen_path = get_option ( 'localegen-path' )
if localegen_path != ''
conf . set_quoted ( 'LOCALEGEN_PATH' , localegen_path )
endif
2021-05-16 20:13:14 +02:00
conf . set10 ( 'HAVE_LOCALEGEN' , localegen_path != '' )
2021-01-08 23:59:38 +01:00
2017-04-04 23:03:47 -04:00
conf . set_quoted ( 'GETTEXT_PACKAGE' , meson . project_name ( ) )
2019-10-25 12:17:24 +02:00
service_watchdog = get_option ( 'service-watchdog' )
2019-10-25 15:46:21 -07:00
watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog
2021-05-16 11:55:36 +02:00
conf . set_quoted ( 'SERVICE_WATCHDOG' , watchdog_value )
2019-10-25 12:17:24 +02:00
2021-05-16 11:55:36 +02:00
conf . set_quoted ( 'SUSHELL' , get_option ( 'debug-shell' ) )
2019-04-25 12:19:16 +02:00
conf . set_quoted ( 'DEBUGTTY' , get_option ( 'debug-tty' ) )
2017-04-10 19:06:45 -04:00
2017-10-03 10:41:51 +02:00
enable_debug_hashmap = false
enable_debug_mmap_cache = false
2018-11-23 00:36:35 +09:00
enable_debug_siphash = false
2018-08-19 19:11:30 +02:00
foreach name : get_option ( 'debug-extra' )
2018-05-02 13:56:28 +09:00
if name == 'hashmap'
enable_debug_hashmap = true
elif name == 'mmap-cache'
enable_debug_mmap_cache = true
2018-11-23 00:36:35 +09:00
elif name == 'siphash'
enable_debug_siphash = true
2018-05-02 13:56:28 +09:00
else
message ( 'unknown debug option "@0@", ignoring' . format ( name ) )
endif
endforeach
2017-10-03 10:41:51 +02:00
conf . set10 ( 'ENABLE_DEBUG_HASHMAP' , enable_debug_hashmap )
conf . set10 ( 'ENABLE_DEBUG_MMAP_CACHE' , enable_debug_mmap_cache )
2018-11-23 00:36:35 +09:00
conf . set10 ( 'ENABLE_DEBUG_SIPHASH' , enable_debug_siphash )
2017-04-27 20:51:34 -04:00
2018-05-13 22:28:24 +02:00
conf . set10 ( 'VALGRIND' , get_option ( 'valgrind' ) )
2018-08-07 17:34:47 +02:00
conf . set10 ( 'LOG_TRACE' , get_option ( 'log-trace' ) )
2018-05-13 22:28:24 +02:00
2019-11-12 15:38:19 +01:00
default_user_path = get_option ( 'user-path' )
if default_user_path != ''
conf . set_quoted ( 'DEFAULT_USER_PATH' , default_user_path )
endif
2019-11-13 22:22:58 +01:00
2017-04-04 23:03:47 -04:00
#####################################################################
threads = dependency ( 'threads' )
librt = cc . find_library ( 'rt' )
libm = cc . find_library ( 'm' )
libdl = cc . find_library ( 'dl' )
libcrypt = cc . find_library ( 'crypt' )
2022-10-19 16:23:41 +02:00
# On some architectures, libatomic is required. But on some installations,
# it is found, but actual linking fails. So let's try to use it opportunistically.
# If it is installed, but not needed, it will be dropped because of --as-needed.
if cc . links ( '''int main(int argc, char **argv) { return 0; }''' ,
args : '-latomic' ,
name : 'libatomic' )
libatomic = declare_dependency ( link_args : '-latomic' )
else
libatomic = [ ]
endif
2020-09-21 11:41:17 -07:00
crypt_header = conf . get ( 'HAVE_CRYPT_H' ) == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>'''
2020-09-08 20:02:31 +02:00
foreach ident : [
2020-09-25 11:19:56 +01:00
[ 'crypt_ra' , crypt_header ] ,
[ 'crypt_preferred_method' , crypt_header ] ,
[ 'crypt_gensalt_ra' , crypt_header ] ]
2020-09-08 20:02:31 +02:00
have = cc . has_function ( ident [ 0 ] , prefix : ident [ 1 ] , args : '-D_GNU_SOURCE' ,
dependencies : libcrypt )
conf . set10 ( 'HAVE_' + ident [ 0 ] . to_upper ( ) , have )
endforeach
2017-04-27 01:30:30 -04:00
libcap = dependency ( 'libcap' , required : false )
if not libcap . found ( )
# Compat with Ubuntu 14.04 which ships libcap w/o .pc file
libcap = cc . find_library ( 'cap' )
endif
2020-11-13 17:08:15 -08:00
want_bpf_framework = get_option ( 'bpf-framework' )
2022-10-01 00:09:53 +00:00
bpf_compiler = get_option ( 'bpf-compiler' )
2020-11-13 17:08:15 -08:00
bpf_framework_required = want_bpf_framework == 'true'
2022-09-30 19:25:18 +09:00
libbpf_version_requirement = '>= 0.1.0'
2022-10-01 00:09:53 +00:00
if bpf_compiler == 'gcc'
libbpf_version_requirement = '>= 1.0.0'
endif
libbpf = dependency ( 'libbpf' , required : bpf_framework_required , version : libbpf_version_requirement )
2020-11-13 17:08:15 -08:00
conf . set10 ( 'HAVE_LIBBPF' , libbpf . found ( ) )
2022-10-01 00:09:53 +00:00
bpftool_strip_version_requirement = '>= 5.13.0'
if bpf_compiler == 'gcc'
bpftool_strip_version_requirement = '>= 7.0.0'
endif
2022-05-15 23:13:38 +09:00
if want_bpf_framework == 'false' or not libbpf . found ( ) or skip_deps
2022-05-15 18:10:25 +09:00
conf . set10 ( 'BPF_FRAMEWORK' , false )
2020-11-13 17:08:15 -08:00
else
2022-06-08 10:13:42 +00:00
clang_found = false
clang_supports_bpf = false
bpf_gcc_found = false
2022-10-01 00:09:53 +00:00
bpftool_strip = false
2022-06-08 10:13:42 +00:00
deps_found = false
if bpf_compiler == 'clang'
# Support 'versioned' clang/llvm-strip binaries, as seen on Debian/Ubuntu
# (like clang-10/llvm-strip-10)
if meson . is_cross_build ( ) or cc . get_id ( ) != 'clang' or cc . cmd_array ( ) [ 0 ] . contains ( 'afl-clang' ) or cc . cmd_array ( ) [ 0 ] . contains ( 'hfuzz-clang' )
r = find_program ( 'clang' , required : bpf_framework_required , version : '>= 10.0.0' )
clang_found = r . found ( )
if clang_found
clang = r . path ( )
endif
# Assume that the required flags are supported by the found clang.
clang_supports_flags = clang_found
else
clang_found = true
clang = cc . cmd_array ( )
clang_supports_flags = cc . has_argument ( '-Wno-compare-distinct-pointer-types' )
2022-01-13 15:43:24 +09:00
endif
2022-06-08 10:13:42 +00:00
if clang_found
# Check if 'clang -target bpf' is supported.
clang_supports_bpf = run_command ( clang , '-target' , 'bpf' , '--print-supported-cpus' , check : false ) . returncode ( ) == 0
endif
elif bpf_compiler == 'gcc'
warning ( 'GCC BPF Compiler support is experimental and not recommended.' )
bpf_gcc = find_program ( 'bpf-gcc' ,
required : true ,
version : '>= 12.1.0' )
bpf_gcc_found = bpf_gcc . found ( )
2021-12-21 21:05:10 +00:00
endif
2022-01-13 15:33:46 +09:00
2022-06-08 10:13:42 +00:00
if clang_supports_bpf or bpf_gcc_found
# Debian installs this in /usr/sbin/ which is not in $PATH.
# We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.
# We use 'bpftool gen object' subcommand for bpftool strip, it was added by d80b2fcbe0a023619e0fc73112f2a02c2662f6ab (v5.13).
2022-10-01 00:09:53 +00:00
bpftool_strip_required = bpf_framework_required and bpf_compiler == 'gcc'
2022-01-30 21:47:38 -07:00
bpftool = find_program ( 'bpftool' ,
'/usr/sbin/bpftool' ,
2022-10-01 00:09:53 +00:00
required : bpftool_strip_required ,
version : bpftool_strip_version_requirement )
2022-01-30 21:47:38 -07:00
2022-06-08 10:13:42 +00:00
if bpftool . found ( )
bpftool_strip = true
deps_found = true
2022-10-01 00:09:53 +00:00
elif bpf_compiler == 'clang'
2022-06-08 10:13:42 +00:00
# We require the 'bpftool gen skeleton' subcommand, it was added by 985ead416df39d6fe8e89580cc1db6aa273e0175 (v5.6).
bpftool = find_program ( 'bpftool' ,
'/usr/sbin/bpftool' ,
required : bpf_framework_required ,
version : '>= 5.6.0' )
2022-01-30 21:47:38 -07:00
endif
2022-06-08 10:13:42 +00:00
# We use `llvm-strip` as a fallback if `bpftool gen object` strip support is not available.
if not bpftool_strip and bpftool . found ( ) and clang_supports_bpf
if not meson . is_cross_build ( )
llvm_strip_bin = run_command ( clang , '--print-prog-name' , 'llvm-strip' ,
check : true ) . stdout ( ) . strip ( )
else
llvm_strip_bin = 'llvm-strip'
endif
llvm_strip = find_program ( llvm_strip_bin , required : bpf_framework_required , version : '>= 10.0.0' )
deps_found = llvm_strip . found ( )
endif
endif
2021-07-27 16:20:40 +02:00
2020-11-13 17:08:15 -08:00
# Can build BPF program from source code in restricted C
2021-08-11 21:59:19 -06:00
conf . set10 ( 'BPF_FRAMEWORK' , deps_found )
2020-11-13 17:08:15 -08:00
endif
2017-04-04 23:03:47 -04:00
libmount = dependency ( 'mount' ,
2018-03-09 14:58:47 +01:00
version : fuzzer_build ? '>= 0' : '>= 2.30' )
2017-04-04 23:03:47 -04:00
2019-12-10 21:31:41 +01:00
want_libfdisk = get_option ( 'fdisk' )
if want_libfdisk != 'false' and not skip_deps
libfdisk = dependency ( 'fdisk' ,
2022-02-24 13:29:54 +00:00
version : '>= 2.32' ,
2019-12-10 21:31:41 +01:00
required : want_libfdisk == 'true' )
have = libfdisk . found ( )
else
have = false
libfdisk = [ ]
endif
conf . set10 ( 'HAVE_LIBFDISK' , have )
2019-07-04 18:35:39 +02:00
want_pwquality = get_option ( 'pwquality' )
if want_pwquality != 'false' and not skip_deps
libpwquality = dependency ( 'pwquality' , required : want_pwquality == 'true' )
have = libpwquality . found ( )
else
have = false
libpwquality = [ ]
endif
conf . set10 ( 'HAVE_PWQUALITY' , have )
2017-04-04 23:03:47 -04:00
want_seccomp = get_option ( 'seccomp' )
2019-05-05 19:28:42 +00:00
if want_seccomp != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libseccomp = dependency ( 'libseccomp' ,
2017-04-27 10:05:18 -04:00
version : '>= 2.3.1' ,
2017-04-17 19:25:00 -04:00
required : want_seccomp == 'true' )
2017-10-03 10:41:51 +02:00
have = libseccomp . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libseccomp = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_SECCOMP' , have )
2017-04-04 23:03:47 -04:00
want_selinux = get_option ( 'selinux' )
2019-05-05 19:28:42 +00:00
if want_selinux != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libselinux = dependency ( 'libselinux' ,
version : '>= 2.1.9' ,
required : want_selinux == 'true' )
2017-10-03 10:41:51 +02:00
have = libselinux . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libselinux = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_SELINUX' , have )
2017-04-04 23:03:47 -04:00
want_apparmor = get_option ( 'apparmor' )
2019-05-05 19:28:42 +00:00
if want_apparmor != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libapparmor = dependency ( 'libapparmor' ,
2020-05-25 10:46:54 +02:00
version : '>= 2.13' ,
2017-04-17 19:25:00 -04:00
required : want_apparmor == 'true' )
2017-10-03 10:41:51 +02:00
have = libapparmor . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libapparmor = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_APPARMOR' , have )
2017-04-04 23:03:47 -04:00
2021-09-21 19:53:20 +02:00
have = get_option ( 'smack' ) and get_option ( 'smack-run-label' ) != ''
conf . set10 ( 'HAVE_SMACK_RUN_LABEL' , have )
if have
conf . set_quoted ( 'SMACK_RUN_LABEL' , get_option ( 'smack-run-label' ) )
endif
2017-04-04 23:03:47 -04:00
2022-07-06 13:09:51 +02:00
have = get_option ( 'smack' ) and get_option ( 'smack-default-process-label' ) != ''
if have
conf . set_quoted ( 'SMACK_DEFAULT_PROCESS_LABEL' , get_option ( 'smack-default-process-label' ) )
endif
2017-04-12 19:09:26 -04:00
want_polkit = get_option ( 'polkit' )
install_polkit = false
install_polkit_pkla = false
2019-05-05 19:28:42 +00:00
if want_polkit != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
install_polkit = true
2017-04-12 19:09:26 -04:00
2017-04-17 19:25:00 -04:00
libpolkit = dependency ( 'polkit-gobject-1' ,
required : false )
if libpolkit . found ( ) and libpolkit . version ( ) . version_compare ( '< 0.106' )
message ( 'Old polkit detected, will install pkla files' )
install_polkit_pkla = true
endif
2017-04-12 19:09:26 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'ENABLE_POLKIT' , install_polkit )
2017-04-12 19:09:26 -04:00
2017-04-21 13:53:59 -04:00
want_acl = get_option ( 'acl' )
2019-05-05 19:28:42 +00:00
if want_acl != 'false' and not skip_deps
2017-04-21 13:53:59 -04:00
libacl = cc . find_library ( 'acl' , required : want_acl == 'true' )
2017-10-03 10:41:51 +02:00
have = libacl . found ( )
2017-04-21 13:53:59 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-21 13:53:59 -04:00
libacl = [ ]
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_ACL' , have )
2017-04-21 13:53:59 -04:00
2017-04-04 23:03:47 -04:00
want_audit = get_option ( 'audit' )
2019-05-05 19:28:42 +00:00
if want_audit != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libaudit = dependency ( 'audit' , required : want_audit == 'true' )
2017-10-03 10:41:51 +02:00
have = libaudit . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libaudit = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_AUDIT' , have )
2017-04-04 23:03:47 -04:00
want_blkid = get_option ( 'blkid' )
2019-05-05 19:28:42 +00:00
if want_blkid != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libblkid = dependency ( 'blkid' , required : want_blkid == 'true' )
2017-10-03 10:41:51 +02:00
have = libblkid . found ( )
2020-11-30 11:38:21 +01:00
conf . set10 ( 'HAVE_BLKID_PROBE_SET_HINT' ,
have and cc . has_function ( 'blkid_probe_set_hint' , dependencies : libblkid ) )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libblkid = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_BLKID' , have )
2017-04-04 23:03:47 -04:00
want_kmod = get_option ( 'kmod' )
2019-05-05 19:28:42 +00:00
if want_kmod != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libkmod = dependency ( 'libkmod' ,
version : '>= 15' ,
required : want_kmod == 'true' )
2017-10-03 10:41:51 +02:00
have = libkmod . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libkmod = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_KMOD' , have )
2017-04-04 23:03:47 -04:00
want_pam = get_option ( 'pam' )
2019-05-05 19:28:42 +00:00
if want_pam != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libpam = cc . find_library ( 'pam' , required : want_pam == 'true' )
libpam_misc = cc . find_library ( 'pam_misc' , required : want_pam == 'true' )
2017-10-03 10:41:51 +02:00
have = libpam . found ( ) and libpam_misc . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libpam = [ ]
libpam_misc = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_PAM' , have )
2017-04-04 23:03:47 -04:00
want_microhttpd = get_option ( 'microhttpd' )
2019-05-05 19:28:42 +00:00
if want_microhttpd != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libmicrohttpd = dependency ( 'libmicrohttpd' ,
version : '>= 0.9.33' ,
required : want_microhttpd == 'true' )
2017-10-03 10:41:51 +02:00
have = libmicrohttpd . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libmicrohttpd = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_MICROHTTPD' , have )
2017-04-04 23:03:47 -04:00
want_libcryptsetup = get_option ( 'libcryptsetup' )
2021-03-16 20:13:28 +01:00
want_libcryptsetup_plugins = get_option ( 'libcryptsetup-plugins' )
if want_libcryptsetup_plugins == 'true' and want_libcryptsetup == 'false'
error ( 'libcryptsetup-plugins can not be requested without libcryptsetup' )
endif
2019-05-05 19:28:42 +00:00
if want_libcryptsetup != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libcryptsetup = dependency ( 'libcryptsetup' ,
2021-03-16 20:13:28 +01:00
version : want_libcryptsetup_plugins == 'true' ? '>= 2.4.0' : '>= 2.0.1' ,
required : want_libcryptsetup == 'true' or want_libcryptsetup_plugins == 'true' )
2017-10-03 10:41:51 +02:00
have = libcryptsetup . found ( )
2019-07-04 18:35:39 +02:00
2021-12-30 14:51:44 +01:00
foreach ident : [ 'crypt_set_metadata_size' ,
'crypt_activate_by_signed_key' ,
'crypt_token_max' ]
have_ident = have and cc . has_function (
ident ,
prefix : '#include <libcryptsetup.h>' ,
dependencies : libcryptsetup )
conf . set10 ( 'HAVE_' + ident . to_upper ( ) , have_ident )
endforeach
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libcryptsetup = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_LIBCRYPTSETUP' , have )
2017-04-04 23:03:47 -04:00
2021-03-16 20:13:28 +01:00
if want_libcryptsetup_plugins != 'false' and not skip_deps
2021-12-30 14:51:44 +01:00
have = ( cc . has_function (
'crypt_activate_by_token_pin' ,
prefix : '#include <libcryptsetup.h>' ,
dependencies : libcryptsetup ) and
cc . has_function (
'crypt_token_external_path' ,
prefix : '#include <libcryptsetup.h>' ,
dependencies : libcryptsetup ) )
2021-03-16 20:13:28 +01:00
else
have = false
endif
conf . set10 ( 'HAVE_LIBCRYPTSETUP_PLUGINS' , have )
2017-04-04 23:03:47 -04:00
want_libcurl = get_option ( 'libcurl' )
2019-05-05 19:28:42 +00:00
if want_libcurl != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libcurl = dependency ( 'libcurl' ,
version : '>= 7.32.0' ,
required : want_libcurl == 'true' )
2017-10-03 10:41:51 +02:00
have = libcurl . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libcurl = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_LIBCURL' , have )
2021-04-14 13:17:22 +02:00
conf . set10 ( 'CURL_NO_OLDIES' , conf . get ( 'BUILD_MODE_DEVELOPER' ) == 1 )
2017-04-04 23:03:47 -04:00
want_libidn = get_option ( 'libidn' )
2017-05-09 21:56:34 -04:00
want_libidn2 = get_option ( 'libidn2' )
if want_libidn == 'true' and want_libidn2 == 'true'
error ( 'libidn and libidn2 cannot be requested simultaneously' )
endif
2019-06-29 03:13:30 +09:00
if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps
2017-07-12 03:25:59 -04:00
libidn = dependency ( 'libidn2' ,
required : want_libidn2 == 'true' )
2017-10-03 10:41:51 +02:00
have = libidn . found ( )
else
have = false
2019-06-29 03:13:30 +09:00
libidn = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_LIBIDN2' , have )
2019-06-29 03:13:30 +09:00
if not have and want_libidn != 'false' and not skip_deps
# libidn is used for both libidn and libidn2 objects
libidn = dependency ( 'libidn' ,
required : want_libidn == 'true' )
have = libidn . found ( )
else
have = false
endif
conf . set10 ( 'HAVE_LIBIDN' , have )
2017-04-04 23:03:47 -04:00
want_libiptc = get_option ( 'libiptc' )
2019-05-05 19:28:42 +00:00
if want_libiptc != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libiptc = dependency ( 'libiptc' ,
required : want_libiptc == 'true' )
2017-10-03 10:41:51 +02:00
have = libiptc . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libiptc = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_LIBIPTC' , have )
2017-04-04 23:03:47 -04:00
want_qrencode = get_option ( 'qrencode' )
2019-05-05 19:28:42 +00:00
if want_qrencode != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libqrencode = dependency ( 'libqrencode' ,
2022-10-14 14:21:43 +02:00
version : '>= 3' ,
2017-04-17 19:25:00 -04:00
required : want_qrencode == 'true' )
2017-10-03 10:41:51 +02:00
have = libqrencode . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libqrencode = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_QRENCODE' , have )
2017-04-04 23:03:47 -04:00
2017-07-26 14:08:46 -04:00
want_gcrypt = get_option ( 'gcrypt' )
2019-05-05 19:28:42 +00:00
if want_gcrypt != 'false' and not skip_deps
2017-07-26 14:08:46 -04:00
libgcrypt = cc . find_library ( 'gcrypt' , required : want_gcrypt == 'true' )
libgpg_error = cc . find_library ( 'gpg-error' , required : want_gcrypt == 'true' )
2017-10-03 10:41:51 +02:00
have = libgcrypt . found ( ) and libgpg_error . found ( )
2017-07-26 14:08:46 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
endif
if not have
# link to neither of the libs if one is not found
2017-07-26 14:08:46 -04:00
libgcrypt = [ ]
libgpg_error = [ ]
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_GCRYPT' , have )
2017-07-26 14:08:46 -04:00
2017-04-04 23:03:47 -04:00
want_gnutls = get_option ( 'gnutls' )
2019-05-05 19:28:42 +00:00
if want_gnutls != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libgnutls = dependency ( 'gnutls' ,
version : '>= 3.1.4' ,
required : want_gnutls == 'true' )
2017-10-03 10:41:51 +02:00
have = libgnutls . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libgnutls = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_GNUTLS' , have )
2017-04-04 23:03:47 -04:00
2018-07-26 22:47:50 +01:00
want_openssl = get_option ( 'openssl' )
2019-05-05 19:28:42 +00:00
if want_openssl != 'false' and not skip_deps
2018-07-26 22:47:50 +01:00
libopenssl = dependency ( 'openssl' ,
version : '>= 1.1.0' ,
required : want_openssl == 'true' )
have = libopenssl . found ( )
else
have = false
libopenssl = [ ]
endif
conf . set10 ( 'HAVE_OPENSSL' , have )
2019-11-05 11:49:27 +01:00
want_p11kit = get_option ( 'p11kit' )
if want_p11kit != 'false' and not skip_deps
libp11kit = dependency ( 'p11-kit-1' ,
2020-04-28 09:08:04 +02:00
version : '>= 0.23.3' ,
required : want_p11kit == 'true' )
2019-11-05 11:49:27 +01:00
have = libp11kit . found ( )
else
have = false
libp11kit = [ ]
endif
conf . set10 ( 'HAVE_P11KIT' , have )
2020-04-14 15:54:52 +02:00
want_libfido2 = get_option ( 'libfido2' )
if want_libfido2 != 'false' and not skip_deps
2022-09-25 07:33:52 +09:00
if conf . get ( 'HAVE_OPENSSL' ) == 1
libfido2 = dependency ( 'libfido2' ,
required : want_libfido2 == 'true' )
have = libfido2 . found ( )
elif want_libfido2 == 'true'
error ( 'libfido2=true requires openssl' )
else
have = false
libfido2 = [ ]
endif
2020-04-14 15:54:52 +02:00
else
have = false
libfido2 = [ ]
endif
conf . set10 ( 'HAVE_LIBFIDO2' , have )
2020-11-28 15:27:34 +01:00
want_tpm2 = get_option ( 'tpm2' )
if want_tpm2 != 'false' and not skip_deps
tpm2 = dependency ( 'tss2-esys tss2-rc tss2-mu' ,
2021-04-15 09:45:48 +02:00
required : want_tpm2 == 'true' )
2020-11-28 15:27:34 +01:00
have = tpm2 . found ( )
else
have = false
tpm2 = [ ]
endif
conf . set10 ( 'HAVE_TPM2' , have )
2017-04-04 23:03:47 -04:00
want_elfutils = get_option ( 'elfutils' )
2019-05-05 19:28:42 +00:00
if want_elfutils != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libdw = dependency ( 'libdw' ,
required : want_elfutils == 'true' )
2017-10-03 10:41:51 +02:00
have = libdw . found ( )
2021-11-18 00:03:48 +00:00
# New in elfutils 0.177
conf . set10 ( 'HAVE_DWELF_ELF_E_MACHINE_STRING' ,
have and cc . has_function ( 'dwelf_elf_e_machine_string' , dependencies : libdw ) )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libdw = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_ELFUTILS' , have )
2017-04-04 23:03:47 -04:00
want_zlib = get_option ( 'zlib' )
2019-05-05 19:28:42 +00:00
if want_zlib != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libz = dependency ( 'zlib' ,
required : want_zlib == 'true' )
2017-10-03 10:41:51 +02:00
have = libz . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libz = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_ZLIB' , have )
2017-04-04 23:03:47 -04:00
want_bzip2 = get_option ( 'bzip2' )
2019-05-05 19:28:42 +00:00
if want_bzip2 != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libbzip2 = cc . find_library ( 'bz2' ,
required : want_bzip2 == 'true' )
2017-10-03 10:41:51 +02:00
have = libbzip2 . found ( )
2017-04-04 23:03:47 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libbzip2 = [ ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_BZIP2' , have )
2017-04-04 23:03:47 -04:00
want_xz = get_option ( 'xz' )
2019-05-05 19:28:42 +00:00
if want_xz != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libxz = dependency ( 'liblzma' ,
required : want_xz == 'true' )
2020-06-24 16:33:41 +02:00
have_xz = libxz . found ( )
2017-04-04 23:03:47 -04:00
else
2020-06-24 16:33:41 +02:00
have_xz = false
2017-04-17 19:25:00 -04:00
libxz = [ ]
2017-04-04 23:03:47 -04:00
endif
2020-06-24 16:33:41 +02:00
conf . set10 ( 'HAVE_XZ' , have_xz )
2017-04-04 23:03:47 -04:00
want_lz4 = get_option ( 'lz4' )
2019-05-05 19:28:42 +00:00
if want_lz4 != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
liblz4 = dependency ( 'liblz4' ,
2018-10-29 18:32:51 +01:00
version : '>= 1.3.0' ,
2017-04-17 19:25:00 -04:00
required : want_lz4 == 'true' )
2020-06-24 16:33:41 +02:00
have_lz4 = liblz4 . found ( )
2017-04-04 23:03:47 -04:00
else
2020-06-24 16:33:41 +02:00
have_lz4 = false
2017-04-17 19:25:00 -04:00
liblz4 = [ ]
2017-04-04 23:03:47 -04:00
endif
2020-06-24 16:33:41 +02:00
conf . set10 ( 'HAVE_LZ4' , have_lz4 )
2017-04-04 23:03:47 -04:00
2020-04-12 01:09:05 +02:00
want_zstd = get_option ( 'zstd' )
if want_zstd != 'false' and not skip_deps
libzstd = dependency ( 'libzstd' ,
required : want_zstd == 'true' ,
version : '>= 1.4.0' )
2020-06-24 16:33:41 +02:00
have_zstd = libzstd . found ( )
2020-04-12 01:09:05 +02:00
else
2020-06-24 16:33:41 +02:00
have_zstd = false
2020-04-12 01:09:05 +02:00
libzstd = [ ]
endif
2020-06-24 16:33:41 +02:00
conf . set10 ( 'HAVE_ZSTD' , have_zstd )
conf . set10 ( 'HAVE_COMPRESSION' , have_xz or have_lz4 or have_zstd )
2020-04-12 01:09:05 +02:00
2022-04-09 18:38:06 +01:00
compression = get_option ( 'default-compression' )
if compression == 'auto'
if have_zstd
compression = 'zstd'
elif have_lz4
compression = 'lz4'
elif have_xz
compression = 'xz'
else
compression = 'none'
endif
elif compression == 'zstd' and not have_zstd
error ( 'default-compression=zstd requires zstd' )
elif compression == 'lz4' and not have_lz4
error ( 'default-compression=lz4 requires lz4' )
elif compression == 'xz' and not have_xz
error ( 'default-compression=xz requires xz' )
endif
2022-04-27 20:49:17 +09:00
conf . set ( 'DEFAULT_COMPRESSION' , 'COMPRESSION_@0@' . format ( compression . to_upper ( ) ) )
2022-04-09 18:38:06 +01:00
2017-07-26 14:08:46 -04:00
want_xkbcommon = get_option ( 'xkbcommon' )
2019-05-05 19:28:42 +00:00
if want_xkbcommon != 'false' and not skip_deps
2017-07-26 14:08:46 -04:00
libxkbcommon = dependency ( 'xkbcommon' ,
version : '>= 0.3.0' ,
required : want_xkbcommon == 'true' )
2017-10-03 10:41:51 +02:00
have = libxkbcommon . found ( )
2017-07-26 14:08:46 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-07-26 14:08:46 -04:00
libxkbcommon = [ ]
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_XKBCOMMON' , have )
2017-07-26 14:08:46 -04:00
2018-01-12 05:47:17 +01:00
want_pcre2 = get_option ( 'pcre2' )
2022-05-29 06:44:45 +00:00
if want_pcre2 != 'false' and not skip_deps
2018-01-12 05:47:17 +01:00
libpcre2 = dependency ( 'libpcre2-8' ,
required : want_pcre2 == 'true' )
have = libpcre2 . found ( )
else
have = false
libpcre2 = [ ]
endif
conf . set10 ( 'HAVE_PCRE2' , have )
2017-04-07 00:19:09 -04:00
want_glib = get_option ( 'glib' )
2019-05-05 19:28:42 +00:00
if want_glib != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libglib = dependency ( 'glib-2.0' ,
version : '>= 2.22.0' ,
required : want_glib == 'true' )
libgobject = dependency ( 'gobject-2.0' ,
version : '>= 2.22.0' ,
required : want_glib == 'true' )
libgio = dependency ( 'gio-2.0' ,
required : want_glib == 'true' )
2017-04-27 21:13:08 -04:00
have = libglib . found ( ) and libgobject . found ( ) and libgio . found ( )
2017-04-07 00:19:09 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libglib = [ ]
libgobject = [ ]
libgio = [ ]
2017-04-07 00:19:09 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_GLIB' , have )
2017-04-07 00:19:09 -04:00
want_dbus = get_option ( 'dbus' )
2019-05-05 19:28:42 +00:00
if want_dbus != 'false' and not skip_deps
2017-04-17 19:25:00 -04:00
libdbus = dependency ( 'dbus-1' ,
version : '>= 1.3.2' ,
required : want_dbus == 'true' )
2017-10-03 10:41:51 +02:00
have = libdbus . found ( )
2017-04-07 00:19:09 -04:00
else
2017-10-03 10:41:51 +02:00
have = false
2017-04-17 19:25:00 -04:00
libdbus = [ ]
2017-04-07 00:19:09 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'HAVE_DBUS' , have )
2017-04-07 00:19:09 -04:00
2021-12-26 16:19:17 +09:00
dbusdatadir = datadir / 'dbus-1'
if conf . get ( 'HAVE_DBUS' ) == 1
dbusdatadir = libdbus . get_variable ( pkgconfig : 'datadir' , default_value : datadir ) / 'dbus-1'
endif
dbuspolicydir = get_option ( 'dbuspolicydir' )
if dbuspolicydir == ''
dbuspolicydir = dbusdatadir / 'system.d'
endif
dbussessionservicedir = get_option ( 'dbussessionservicedir' )
if dbussessionservicedir == ''
dbussessionservicedir = dbusdatadir / 'services'
if conf . get ( 'HAVE_DBUS' ) == 1
dbussessionservicedir = libdbus . get_variable ( pkgconfig : 'session_bus_services_dir' , default_value : dbussessionservicedir )
endif
endif
dbussystemservicedir = get_option ( 'dbussystemservicedir' )
if dbussystemservicedir == ''
dbussystemservicedir = dbusdatadir / 'system-services'
if conf . get ( 'HAVE_DBUS' ) == 1
dbussystemservicedir = libdbus . get_variable ( pkgconfig : 'system_bus_services_dir' , default_value : dbussystemservicedir )
endif
endif
dbus_interfaces_dir = get_option ( 'dbus-interfaces-dir' )
if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes'
if meson . is_cross_build ( ) and dbus_interfaces_dir != 'yes'
dbus_interfaces_dir = 'no'
warning ( 'Exporting D-Bus interface XML files is disabled during cross build. Pass path or "yes" to force enable.' )
else
dbus_interfaces_dir = dbusdatadir / 'interfaces'
if conf . get ( 'HAVE_DBUS' ) == 1
dbus_interfaces_dir = libdbus . get_variable ( pkgconfig : 'interfaces_dir' , default_value : dbus_interfaces_dir )
endif
endif
endif
2021-12-02 11:29:45 +01:00
# We support one or the other. If gcrypt is available, we assume it's there to
# be used, and use it in preference.
opt = get_option ( 'cryptolib' )
if opt == 'openssl' and conf . get ( 'HAVE_OPENSSL' ) == 0
error ( 'openssl requested as the default cryptolib, but not available' )
2018-01-15 18:27:37 -05:00
endif
2021-12-02 11:29:45 +01:00
conf . set10 ( 'PREFER_OPENSSL' ,
opt == 'openssl' or ( opt == 'auto' and conf . get ( 'HAVE_OPENSSL' ) == 1 and conf . get ( 'HAVE_GCRYPT' ) == 0 ) )
conf . set10 ( 'HAVE_OPENSSL_OR_GCRYPT' ,
conf . get ( 'HAVE_OPENSSL' ) == 1 or conf . get ( 'HAVE_GCRYPT' ) == 1 )
2021-12-24 10:06:13 +09:00
lib_openssl_or_gcrypt = conf . get ( 'PREFER_OPENSSL' ) == 1 ? [ libopenssl ] : [ libgcrypt , libgpg_error ]
2017-06-18 05:22:32 +09:00
2018-06-21 01:29:49 +09:00
dns_over_tls = get_option ( 'dns-over-tls' )
if dns_over_tls != 'false'
2021-12-02 11:29:45 +01:00
if dns_over_tls == 'gnutls' and conf . get ( 'PREFER_OPENSSL' ) == 1
error ( 'Sorry, -Ddns-over-tls=gnutls is not supported when openssl is used as the cryptolib' )
endif
2022-05-17 20:09:49 +01:00
if dns_over_tls == 'gnutls'
2018-07-26 22:47:50 +01:00
have_openssl = false
else
have_openssl = conf . get ( 'HAVE_OPENSSL' ) == 1
2022-05-17 20:09:49 +01:00
if dns_over_tls == 'openssl' and not have_openssl
error ( 'DNS-over-TLS support was requested with openssl, but dependencies are not available' )
endif
endif
if dns_over_tls == 'openssl' or have_openssl
have_gnutls = false
else
have_gnutls = conf . get ( 'HAVE_GNUTLS' ) == 1 and libgnutls . version ( ) . version_compare ( '>= 3.6.0' )
if dns_over_tls != 'auto' and not have_gnutls
str = dns_over_tls == 'gnutls' ? ' with gnutls' : ''
2019-06-17 10:22:54 +09:00
error ( 'DNS-over-TLS support was requested@0@, but dependencies are not available' . format ( str ) )
2018-07-26 22:47:50 +01:00
endif
endif
have = have_gnutls or have_openssl
2018-06-21 01:29:49 +09:00
else
2018-11-11 11:30:53 +01:00
have = false
have_gnutls = false
have_openssl = false
2018-06-21 01:29:49 +09:00
endif
conf . set10 ( 'ENABLE_DNS_OVER_TLS' , have )
2018-07-26 22:47:50 +01:00
conf . set10 ( 'DNS_OVER_TLS_USE_GNUTLS' , have_gnutls )
conf . set10 ( 'DNS_OVER_TLS_USE_OPENSSL' , have_openssl )
2018-06-21 01:29:49 +09:00
2018-06-13 20:26:24 +02:00
default_dns_over_tls = get_option ( 'default-dns-over-tls' )
2019-05-05 19:28:42 +00:00
if skip_deps
2018-06-13 20:26:24 +02:00
default_dns_over_tls = 'no'
2018-04-27 17:50:38 +02:00
endif
2018-06-21 01:29:49 +09:00
if default_dns_over_tls != 'no' and conf . get ( 'ENABLE_DNS_OVER_TLS' ) == 0
2019-02-18 20:41:46 +01:00
message ( 'default-dns-over-tls cannot be enabled or set to opportunistic when DNS-over-TLS support is disabled. Setting default-dns-over-tls to no.' )
2018-06-13 20:26:24 +02:00
default_dns_over_tls = 'no'
2018-04-27 17:50:38 +02:00
endif
2018-06-13 20:26:24 +02:00
conf . set ( 'DEFAULT_DNS_OVER_TLS_MODE' ,
'DNS_OVER_TLS_' + default_dns_over_tls . underscorify ( ) . to_upper ( ) )
2021-05-16 16:55:16 +02:00
conf . set_quoted ( 'DEFAULT_DNS_OVER_TLS_MODE_STR' , default_dns_over_tls )
2018-04-27 17:50:38 +02:00
2020-04-14 22:18:18 +02:00
default_mdns = get_option ( 'default-mdns' )
conf . set ( 'DEFAULT_MDNS_MODE' ,
'RESOLVE_SUPPORT_' + default_mdns . to_upper ( ) )
2021-05-16 16:55:16 +02:00
conf . set_quoted ( 'DEFAULT_MDNS_MODE_STR' , default_mdns )
2020-04-14 22:18:18 +02:00
default_llmnr = get_option ( 'default-llmnr' )
conf . set ( 'DEFAULT_LLMNR_MODE' ,
'RESOLVE_SUPPORT_' + default_llmnr . to_upper ( ) )
2021-05-16 16:55:16 +02:00
conf . set_quoted ( 'DEFAULT_LLMNR_MODE_STR' , default_llmnr )
2020-04-14 22:18:18 +02:00
2019-12-10 21:31:41 +01:00
want_repart = get_option ( 'repart' )
if want_repart != 'false'
2021-12-05 13:42:38 +00:00
have = conf . get ( 'HAVE_LIBFDISK' ) == 1
2019-12-10 21:31:41 +01:00
if want_repart == 'true' and not have
error ( 'repart support was requested, but dependencies are not available' )
endif
else
have = false
endif
conf . set10 ( 'ENABLE_REPART' , have )
2021-10-27 15:39:48 +02:00
default_dnssec = get_option ( 'default-dnssec' )
if skip_deps
default_dnssec = 'no'
endif
if default_dnssec != 'no' and conf . get ( 'HAVE_OPENSSL_OR_GCRYPT' ) == 0
message ( 'default-dnssec cannot be set to yes or allow-downgrade openssl and gcrypt are disabled. Setting default-dnssec to no.' )
default_dnssec = 'no'
endif
conf . set ( 'DEFAULT_DNSSEC_MODE' ,
'DNSSEC_' + default_dnssec . underscorify ( ) . to_upper ( ) )
conf . set_quoted ( 'DEFAULT_DNSSEC_MODE_STR' , default_dnssec )
2020-12-28 15:17:54 +01:00
want_sysupdate = get_option ( 'sysupdate' )
if want_sysupdate != 'false'
have = ( conf . get ( 'HAVE_OPENSSL' ) == 1 and
conf . get ( 'HAVE_LIBFDISK' ) == 1 )
if want_sysupdate == 'true' and not have
error ( 'sysupdate support was requested, but dependencies are not available' )
endif
else
have = false
endif
conf . set10 ( 'ENABLE_SYSUPDATE' , have )
2017-04-04 23:03:47 -04:00
want_importd = get_option ( 'importd' )
2017-04-13 20:30:07 -04:00
if want_importd != 'false'
2017-10-03 10:41:51 +02:00
have = ( conf . get ( 'HAVE_LIBCURL' ) == 1 and
2021-11-02 09:58:04 +01:00
conf . get ( 'HAVE_OPENSSL_OR_GCRYPT' ) == 1 and
2017-10-03 10:41:51 +02:00
conf . get ( 'HAVE_ZLIB' ) == 1 and
2021-11-02 09:58:04 +01:00
conf . get ( 'HAVE_XZ' ) == 1 )
2017-10-03 10:41:51 +02:00
if want_importd == 'true' and not have
2017-04-17 19:25:00 -04:00
error ( 'importd support was requested, but dependencies are not available' )
endif
2017-10-03 10:41:51 +02:00
else
have = false
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'ENABLE_IMPORTD' , have )
2017-04-04 23:03:47 -04:00
2022-03-31 11:17:10 +02:00
want_kernel_install = get_option ( 'kernel-install' )
conf . set10 ( 'ENABLE_KERNEL_INSTALL' , want_kernel_install )
2019-07-04 18:35:39 +02:00
want_homed = get_option ( 'homed' )
if want_homed != 'false'
have = ( conf . get ( 'HAVE_OPENSSL' ) == 1 and
conf . get ( 'HAVE_LIBFDISK' ) == 1 and
conf . get ( 'HAVE_LIBCRYPTSETUP' ) == 1 )
if want_homed == 'true' and not have
error ( 'homed support was requested, but dependencies are not available' )
endif
else
have = false
endif
conf . set10 ( 'ENABLE_HOMED' , have )
2020-02-01 11:01:41 +09:00
have = have and conf . get ( 'HAVE_PAM' ) == 1
conf . set10 ( 'ENABLE_PAM_HOME' , have )
2020-10-15 15:53:57 +02:00
have = get_option ( 'oomd' )
2020-10-14 23:14:15 -07:00
conf . set10 ( 'ENABLE_OOMD' , have )
2017-04-04 23:03:47 -04:00
want_remote = get_option ( 'remote' )
2017-04-13 20:30:07 -04:00
if want_remote != 'false'
2017-10-03 10:41:51 +02:00
have_deps = [ conf . get ( 'HAVE_MICROHTTPD' ) == 1 ,
conf . get ( 'HAVE_LIBCURL' ) == 1 ]
2017-04-17 19:25:00 -04:00
# sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
# it's possible to build one without the other. Complain only if
2019-04-26 20:22:40 -04:00
# support was explicitly requested. The auxiliary files like sysusers
2017-04-17 19:25:00 -04:00
# config should be installed when any of the programs are built.
if want_remote == 'true' and not ( have_deps [ 0 ] and have_deps [ 1 ] )
error ( 'remote support was requested, but dependencies are not available' )
endif
2017-10-03 10:41:51 +02:00
have = have_deps [ 0 ] or have_deps [ 1 ]
else
have = false
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
conf . set10 ( 'ENABLE_REMOTE' , have )
2017-04-04 23:03:47 -04:00
2020-08-20 17:35:50 +02:00
foreach term : [ 'analyze' ,
'backlight' ,
2017-10-03 13:15:27 +02:00
'binfmt' ,
'coredump' ,
2020-08-20 17:35:50 +02:00
'efi' ,
'environment-d' ,
'firstboot' ,
'gshadow' ,
'hibernate' ,
2017-10-03 13:15:27 +02:00
'hostnamed' ,
2020-08-20 17:35:50 +02:00
'hwdb' ,
'idn' ,
'ima' ,
'initrd' ,
2020-09-25 16:31:42 +02:00
'compat-mutable-uid-boundaries' ,
2020-12-07 08:45:15 +01:00
'nscd' ,
2020-08-20 17:35:50 +02:00
'ldconfig' ,
2017-10-03 13:15:27 +02:00
'localed' ,
2020-08-20 17:35:50 +02:00
'logind' ,
2017-10-03 13:15:27 +02:00
'machined' ,
'networkd' ,
2020-08-20 17:35:50 +02:00
'nss-myhostname' ,
'nss-systemd' ,
'portabled' ,
2021-01-08 16:57:27 +01:00
'sysext' ,
2020-08-20 17:35:50 +02:00
'pstore' ,
'quotacheck' ,
'randomseed' ,
'resolve' ,
'rfkill' ,
'smack' ,
'sysusers' ,
2017-10-03 13:15:27 +02:00
'timedated' ,
'timesyncd' ,
'tmpfiles' ,
'tpm' ,
2020-08-20 17:35:50 +02:00
'userdb' ,
'utmp' ,
'vconsole' ,
'xdg-autostart' ]
2017-10-03 13:15:27 +02:00
have = get_option ( term )
name = 'ENABLE_' + term . underscorify ( ) . to_upper ( )
conf . set10 ( name , have )
2017-04-04 23:03:47 -04:00
endforeach
2020-09-26 11:58:24 +02:00
enable_sysusers = conf . get ( 'ENABLE_SYSUSERS' ) == 1
2018-07-18 09:25:57 +09:00
foreach tuple : [ [ 'nss-mymachines' , 'machined' ] ,
[ 'nss-resolve' , 'resolve' ] ]
want = get_option ( tuple [ 0 ] )
if want != 'false'
have = get_option ( tuple [ 1 ] )
if want == 'true' and not have
error ( '@0@ is requested but @1@ is disabled' . format ( tuple [ 0 ] , tuple [ 1 ] ) )
endif
else
have = false
endif
name = 'ENABLE_' + tuple [ 0 ] . underscorify ( ) . to_upper ( )
conf . set10 ( name , have )
endforeach
enable_nss = false
foreach term : [ 'ENABLE_NSS_MYHOSTNAME' ,
'ENABLE_NSS_MYMACHINES' ,
'ENABLE_NSS_RESOLVE' ,
'ENABLE_NSS_SYSTEMD' ]
if conf . get ( term ) == 1
enable_nss = true
endif
endforeach
conf . set10 ( 'ENABLE_NSS' , enable_nss )
2018-05-07 18:17:35 +09:00
conf . set10 ( 'ENABLE_TIMEDATECTL' , get_option ( 'timedated' ) or get_option ( 'timesyncd' ) )
2018-05-03 18:07:43 +09:00
2018-01-19 17:54:30 +11:00
conf . set10 ( 'SYSTEMD_SLOW_TESTS_DEFAULT' , slow_tests )
2017-07-12 21:25:17 +00:00
2021-12-10 11:55:38 +01:00
############################################################
2017-04-04 23:03:47 -04:00
2021-12-10 11:55:38 +01:00
tests = [ ]
fuzzers = [ ]
2022-01-21 14:28:23 +00:00
catalogs = [ ]
2021-12-10 11:55:38 +01:00
############################################################
# Include these now as they provide gnu-efi detection.
2021-08-30 18:38:09 +02:00
subdir ( 'src/fundamental' )
subdir ( 'src/boot/efi' )
2021-01-04 20:47:00 +09:00
############################################################
2021-01-27 14:04:14 +01:00
generate_gperfs = find_program ( 'tools/generate-gperfs.py' )
2021-01-04 20:47:00 +09:00
make_autosuspend_rules_py = find_program ( 'tools/make-autosuspend-rules.py' )
make_directive_index_py = find_program ( 'tools/make-directive-index.py' )
make_man_index_py = find_program ( 'tools/make-man-index.py' )
2021-05-16 11:55:36 +02:00
meson_render_jinja2 = find_program ( 'tools/meson-render-jinja2.py' )
2021-01-27 14:04:14 +01:00
update_dbus_docs_py = find_program ( 'tools/update-dbus-docs.py' )
2022-03-22 21:51:33 +01:00
update_man_rules_py = find_program ( 'tools/update-man-rules.py' )
2021-01-27 14:04:14 +01:00
update_hwdb_sh = find_program ( 'tools/update-hwdb.sh' )
update_hwdb_autosuspend_sh = find_program ( 'tools/update-hwdb-autosuspend.sh' )
update_syscall_tables_sh = find_program ( 'tools/update-syscall-tables.sh' )
xml_helper_py = find_program ( 'tools/xml_helper.py' )
2021-07-24 10:30:42 +03:00
export_dbus_interfaces_py = find_program ( 'tools/dbus_exporter.py' )
2021-01-04 20:47:00 +09:00
2021-12-10 11:55:38 +01:00
############################################################
2017-04-04 23:03:47 -04:00
2022-04-08 13:20:15 +02:00
if get_option ( 'b_coverage' )
add_project_arguments ( '-include' , 'src/basic/coverage.h' , language : 'c' )
endif
############################################################
2017-04-04 23:03:47 -04:00
config_h = configure_file (
2017-04-17 19:25:00 -04:00
output : 'config.h' ,
configuration : conf )
2017-04-04 23:03:47 -04:00
2021-01-04 20:47:00 +09:00
add_project_arguments ( '-include' , 'config.h' , language : 'c' )
2022-04-05 16:52:44 +02:00
jinja2_cmdline = [ meson_render_jinja2 , config_h , version_h ]
2021-01-04 20:47:00 +09:00
############################################################
2018-05-07 18:17:35 +09:00
2021-01-04 21:27:00 +09:00
# binaries that have --help and are intended for use by humans,
# usually, but not always, installed in /bin.
public_programs = [ ]
2021-07-24 10:30:42 +03:00
# D-Bus introspection XML export
dbus_programs = [ ]
2021-01-04 23:36:00 +09:00
basic_includes = include_directories (
'src/basic' ,
2021-02-04 03:21:08 +09:00
'src/fundamental' ,
2021-01-04 23:36:00 +09:00
'src/systemd' ,
'.' )
libsystemd_includes = [ basic_includes , include_directories (
'src/libsystemd/sd-bus' ,
'src/libsystemd/sd-device' ,
'src/libsystemd/sd-event' ,
'src/libsystemd/sd-hwdb' ,
'src/libsystemd/sd-id128' ,
'src/libsystemd/sd-journal' ,
'src/libsystemd/sd-netlink' ,
'src/libsystemd/sd-network' ,
'src/libsystemd/sd-resolve' ) ]
includes = [ libsystemd_includes , include_directories ( 'src/shared' ) ]
2017-04-04 23:03:47 -04:00
subdir ( 'po' )
subdir ( 'catalog' )
subdir ( 'src/basic' )
subdir ( 'src/libsystemd' )
2021-01-04 21:13:30 +09:00
subdir ( 'src/shared' )
subdir ( 'src/udev' )
subdir ( 'src/libudev' )
2021-03-16 20:13:28 +01:00
subdir ( 'src/cryptsetup/cryptsetup-tokens' )
2017-04-04 23:03:47 -04:00
2022-06-11 18:34:08 +01:00
alias_target ( 'devel' , libsystemd_pc , libudev_pc )
2017-04-04 23:03:47 -04:00
libsystemd = shared_library (
2017-04-17 19:25:00 -04:00
'systemd' ,
2017-09-28 19:24:16 +02:00
version : libsystemd_version ,
2021-01-04 23:36:00 +09:00
include_directories : libsystemd_includes ,
2017-04-17 19:25:00 -04:00
link_args : [ '-shared' ,
'-Wl,--version-script=' + libsystemd_sym_path ] ,
2017-12-19 19:06:56 +01:00
link_with : [ libbasic ,
2022-04-20 15:35:28 +02:00
libbasic_gcrypt ,
libbasic_compress ] ,
2021-01-01 04:30:47 +09:00
link_whole : [ libsystemd_static ] ,
2017-04-17 19:25:00 -04:00
dependencies : [ threads ,
2022-04-20 15:35:28 +02:00
librt ] ,
2017-04-17 19:25:00 -04:00
link_depends : libsystemd_sym ,
install : true ,
2022-04-27 10:54:14 +01:00
install_tag : 'libsystemd' ,
2017-04-17 19:25:00 -04:00
install_dir : rootlibdir )
2017-04-04 23:03:47 -04:00
2022-06-11 18:34:08 +01:00
alias_target ( 'libsystemd' , libsystemd )
2018-04-09 02:43:35 -07:00
install_libsystemd_static = static_library (
'systemd' ,
libsystemd_sources ,
2018-04-25 15:29:48 +02:00
basic_sources ,
basic_gcrypt_sources ,
2022-04-20 15:35:28 +02:00
basic_compress_sources ,
2021-02-04 03:21:08 +09:00
fundamental_sources ,
2021-01-04 23:36:00 +09:00
include_directories : libsystemd_includes ,
2018-04-09 02:43:35 -07:00
build_by_default : static_libsystemd != 'false' ,
install : static_libsystemd != 'false' ,
2022-04-27 10:54:14 +01:00
install_tag : 'libsystemd' ,
2018-04-09 02:43:35 -07:00
install_dir : rootlibdir ,
2021-01-05 14:51:17 +09:00
pic : static_libsystemd_pic ,
2018-04-09 02:43:35 -07:00
dependencies : [ threads ,
librt ,
libxz ,
2020-04-12 01:09:05 +02:00
libzstd ,
2018-04-09 02:43:35 -07:00
liblz4 ,
2021-05-23 13:04:53 +01:00
libdl ,
2018-04-25 15:29:48 +02:00
libcap ,
libblkid ,
libmount ,
2021-06-24 13:57:16 +02:00
libgcrypt ,
libopenssl ] ,
2018-04-09 02:43:35 -07:00
c_args : libsystemd_c_args + ( static_libsystemd_pic ? [ ] : [ '-fno-PIC' ] ) )
2021-01-04 21:13:30 +09:00
libudev = shared_library (
'udev' ,
version : libudev_version ,
include_directories : includes ,
link_args : [ '-shared' ,
'-Wl,--version-script=' + libudev_sym_path ] ,
link_with : [ libsystemd_static , libshared_static ] ,
link_whole : libudev_basic ,
dependencies : [ threads ] ,
link_depends : libudev_sym ,
install : true ,
2022-04-27 10:54:14 +01:00
install_tag : 'libudev' ,
2021-01-04 21:13:30 +09:00
install_dir : rootlibdir )
2022-06-11 18:34:08 +01:00
alias_target ( 'libudev' , libudev )
2021-01-04 21:13:30 +09:00
install_libudev_static = static_library (
'udev' ,
basic_sources ,
2021-02-04 03:21:08 +09:00
fundamental_sources ,
2021-01-04 21:13:30 +09:00
shared_sources ,
libsystemd_sources ,
libudev_sources ,
include_directories : includes ,
build_by_default : static_libudev != 'false' ,
install : static_libudev != 'false' ,
2022-04-27 10:54:14 +01:00
install_tag : 'libudev' ,
2021-01-04 21:13:30 +09:00
install_dir : rootlibdir ,
link_depends : libudev_sym ,
dependencies : libshared_deps + [ libmount ] ,
c_args : static_libudev_pic ? [ ] : [ '-fno-PIC' ] ,
pic : static_libudev_pic )
2021-03-16 20:13:28 +01:00
if conf . get ( 'HAVE_LIBCRYPTSETUP_PLUGINS' ) == 1
if conf . get ( 'HAVE_TPM2' ) == 1
cryptsetup_token_systemd_tpm2 = shared_library (
'cryptsetup-token-systemd-tpm2' ,
2021-12-16 11:51:08 +01:00
cryptsetup_token_systemd_tpm2_sources ,
include_directories : includes ,
2021-03-16 20:13:28 +01:00
link_args : [ '-shared' ,
'-Wl,--version-script=' + cryptsetup_token_sym_path ] ,
2021-12-16 11:51:08 +01:00
link_with : [ lib_cryptsetup_token_common ,
libshared ] ,
dependencies : [ libcryptsetup ,
tpm2 ,
versiondep ] ,
2021-03-16 20:13:28 +01:00
link_depends : cryptsetup_token_sym ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-03-16 20:13:28 +01:00
install : true ,
install_dir : libcryptsetup_plugins_dir )
endif
2021-05-17 15:26:14 +02:00
if conf . get ( 'HAVE_LIBFIDO2' ) == 1
cryptsetup_token_systemd_fido2 = shared_library (
'cryptsetup-token-systemd-fido2' ,
2021-12-16 11:51:08 +01:00
cryptsetup_token_systemd_fido2_sources ,
include_directories : includes ,
2021-05-17 15:26:14 +02:00
link_args : [ '-shared' ,
'-Wl,--version-script=' + cryptsetup_token_sym_path ] ,
2021-12-16 11:51:08 +01:00
link_with : [ lib_cryptsetup_token_common ,
libshared ] ,
dependencies : [ libcryptsetup ,
libfido2 ,
versiondep ] ,
2021-05-17 15:26:14 +02:00
link_depends : cryptsetup_token_sym ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-05-17 15:26:14 +02:00
install : true ,
install_dir : libcryptsetup_plugins_dir )
endif
2021-05-20 15:37:08 +02:00
if conf . get ( 'HAVE_P11KIT' ) == 1
cryptsetup_token_systemd_pkcs11 = shared_library (
'cryptsetup-token-systemd-pkcs11' ,
2021-12-16 11:51:08 +01:00
cryptsetup_token_systemd_pkcs11_sources ,
include_directories : includes ,
2021-05-20 15:37:08 +02:00
link_args : [ '-shared' ,
'-Wl,--version-script=' + cryptsetup_token_sym_path ] ,
2021-12-16 11:51:08 +01:00
link_with : [ lib_cryptsetup_token_common ,
libshared ] ,
dependencies : [ libcryptsetup ,
libp11kit ,
versiondep ] ,
2021-05-20 15:37:08 +02:00
link_depends : cryptsetup_token_sym ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-05-20 15:37:08 +02:00
install : true ,
install_dir : libcryptsetup_plugins_dir )
endif
2021-03-16 20:13:28 +01:00
endif
2020-08-18 16:27:20 +02:00
############################################################
2021-01-04 21:27:00 +09:00
# systemd-analyze requires 'libcore'
2017-04-04 23:03:47 -04:00
subdir ( 'src/core' )
2021-01-04 21:27:00 +09:00
# systemd-journal-remote requires 'libjournal_core'
subdir ( 'src/journal' )
# systemd-networkd requires 'libsystemd_network'
subdir ( 'src/libsystemd-network' )
2017-04-04 23:03:47 -04:00
2017-04-07 00:19:09 -04:00
subdir ( 'src/analyze' )
2021-01-04 20:35:33 +09:00
subdir ( 'src/busctl' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/coredump' )
2021-01-04 20:29:01 +09:00
subdir ( 'src/cryptenroll' )
2021-01-04 20:26:20 +09:00
subdir ( 'src/cryptsetup' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/home' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/hostname' )
subdir ( 'src/import' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/journal-remote' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/kernel-install' )
subdir ( 'src/locale' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/login' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/machine' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/network' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/nspawn' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/oom' )
subdir ( 'src/partition' )
subdir ( 'src/portable' )
subdir ( 'src/pstore' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/resolve' )
2021-01-31 17:16:32 +01:00
subdir ( 'src/rpm' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/shutdown' )
2021-01-08 16:57:27 +01:00
subdir ( 'src/sysext' )
2021-01-04 20:12:28 +09:00
subdir ( 'src/systemctl' )
2020-12-28 15:17:54 +01:00
subdir ( 'src/sysupdate' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/timedate' )
subdir ( 'src/timesync' )
2020-06-03 14:49:53 -07:00
subdir ( 'src/tmpfiles' )
2021-01-04 21:27:00 +09:00
subdir ( 'src/userdb' )
2021-01-04 20:41:37 +09:00
subdir ( 'src/xdg-autostart-generator' )
2017-04-07 00:19:09 -04:00
2021-01-04 21:13:30 +09:00
subdir ( 'src/systemd' )
2017-04-07 00:19:09 -04:00
subdir ( 'src/test' )
2018-01-13 19:51:07 -05:00
subdir ( 'src/fuzz' )
2019-10-08 16:43:18 +02:00
subdir ( 'rules.d' )
2017-04-13 20:47:20 -04:00
subdir ( 'test' )
2017-04-07 00:19:09 -04:00
2017-04-14 20:10:28 -04:00
############################################################
# only static linking apart from libdl, to make sure that the
# module is linked to all libraries that it uses.
test_dlopen = executable (
2017-04-17 19:25:00 -04:00
'test-dlopen' ,
test_dlopen_c ,
include_directories : includes ,
link_with : [ libbasic ] ,
2018-09-12 21:47:56 +09:00
dependencies : [ libdl ] ,
build_by_default : want_tests != 'false' )
2017-04-14 20:10:28 -04:00
2018-07-18 09:25:57 +09:00
foreach tuple : [ [ 'myhostname' , 'ENABLE_NSS_MYHOSTNAME' ] ,
2021-01-04 20:17:22 +09:00
[ 'systemd' , 'ENABLE_NSS_SYSTEMD' , [ 'nss-systemd.h' , 'userdb-glue.c' , 'userdb-glue.h' ] ] ,
2018-07-18 09:25:57 +09:00
[ 'mymachines' , 'ENABLE_NSS_MYMACHINES' ] ,
2021-01-04 23:36:00 +09:00
[ 'resolve' , 'ENABLE_NSS_RESOLVE' , [ ] , resolve_includes ] ]
2017-04-14 20:10:28 -04:00
2017-10-03 10:41:51 +02:00
condition = tuple [ 1 ] == '' or conf . get ( tuple [ 1 ] ) == 1
2017-04-17 19:25:00 -04:00
if condition
module = tuple [ 0 ]
2017-04-14 20:10:28 -04:00
2017-04-17 19:25:00 -04:00
sym = 'src/nss-@0@/nss-@0@.sym' . format ( module )
2021-07-27 19:32:35 +02:00
version_script_arg = project_source_root / sym
2017-04-14 20:10:28 -04:00
2019-07-04 18:31:11 +02:00
sources = [ 'src/nss-@0@/nss-@0@.c' . format ( module ) ]
if tuple . length ( ) > 2
2021-01-04 20:17:22 +09:00
foreach s : tuple [ 2 ]
sources + = [ 'src/nss-@0@/@1@' . format ( module , s ) ]
endforeach
2019-07-04 18:31:11 +02:00
endif
2021-01-04 23:36:00 +09:00
incs = tuple . length ( ) > 3 ? tuple [ 3 ] : includes
2017-04-17 19:25:00 -04:00
nss = shared_library (
'nss_' + module ,
2019-07-04 18:31:11 +02:00
sources ,
2017-04-17 19:25:00 -04:00
version : '2' ,
2021-01-04 23:36:00 +09:00
include_directories : incs ,
2017-12-12 20:13:16 +01:00
# Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
link_args : [ '-Wl,-z,nodelete' ,
'-shared' ,
2019-04-06 21:59:06 +02:00
'-Wl,--version-script=' + version_script_arg ] ,
2017-12-19 11:35:01 +01:00
link_with : [ libsystemd_static ,
2019-07-23 14:22:06 +02:00
libshared_static ,
2017-04-17 19:25:00 -04:00
libbasic ] ,
dependencies : [ threads ,
2017-05-12 08:31:46 -04:00
librt ] ,
2017-04-17 19:25:00 -04:00
link_depends : sym ,
install : true ,
2022-05-14 11:21:20 -04:00
install_tag : 'nss' ,
2017-04-17 19:25:00 -04:00
install_dir : rootlibdir )
2017-04-14 20:10:28 -04:00
2017-04-17 19:25:00 -04:00
# We cannot use shared_module because it does not support version suffix.
# Unfortunately shared_library insists on creating the symlink…
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' ,
2017-04-17 19:25:00 -04:00
'rm $DESTDIR@0@/libnss_@1@.so'
2022-05-14 11:21:20 -04:00
. format ( rootlibdir , module ) ,
install_tag : 'nss'
)
2017-04-14 20:10:28 -04:00
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'dlopen-nss_' + module ,
test_dlopen ,
# path to dlopen must include a slash
2022-01-21 14:28:23 +00:00
args : nss . full_path ( ) ,
depends : nss )
2018-09-12 11:08:49 +02:00
endif
2017-04-17 19:25:00 -04:00
endif
2017-04-14 20:10:28 -04:00
endforeach
############################################################
2022-04-05 14:12:52 +02:00
exe = executable (
2020-04-28 09:08:04 +02:00
'systemd' ,
systemd_sources ,
include_directories : includes ,
link_with : [ libcore ,
libshared ] ,
dependencies : [ versiondep ,
2021-12-14 13:20:28 +01:00
libseccomp ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2022-04-05 14:12:52 +02:00
dbus_programs + = exe
public_programs + = exe
2017-04-04 23:03:47 -04:00
2018-02-28 10:20:48 +01:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
rootlibexecdir / 'systemd' ,
rootsbindir / 'init' )
2018-02-28 10:20:48 +01:00
2022-05-18 10:40:54 +02:00
exe = executable (
2020-04-28 09:08:04 +02:00
'systemd-analyze' ,
systemd_analyze_sources ,
2021-01-04 23:36:00 +09:00
include_directories : core_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libcore ,
libshared ] ,
dependencies : [ versiondep ,
2021-12-14 13:20:28 +01:00
libseccomp ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2022-07-26 21:49:48 -04:00
install : conf . get ( 'ENABLE_ANALYZE' ) == 1 )
2022-05-18 10:40:54 +02:00
public_programs + = exe
if want_tests != 'false'
test ( 'test-compare-versions' ,
test_compare_versions_sh ,
args : exe . full_path ( ) )
endif
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-journald' ,
systemd_journald_sources ,
include_directories : includes ,
link_with : [ libjournal_core ,
libshared ] ,
dependencies : [ threads ,
libxz ,
liblz4 ,
2020-04-12 01:09:05 +02:00
libselinux ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-cat' ,
systemd_cat_sources ,
include_directories : includes ,
link_with : [ libjournal_core ,
libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2022-07-27 15:28:09 -06:00
if get_option ( 'link-journalctl-shared' )
2022-10-07 18:14:16 +02:00
journalctl_link_with = [ libshared ]
2022-07-27 15:28:09 -06:00
else
journalctl_link_with = [ libsystemd_static ,
libshared_static ,
2022-10-07 18:14:16 +02:00
libbasic_gcrypt ]
2022-07-27 15:28:09 -06:00
endif
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'journalctl' ,
journalctl_sources ,
include_directories : includes ,
2022-07-27 15:28:09 -06:00
link_with : [ journalctl_link_with ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ threads ,
2020-06-11 13:16:53 +02:00
libdl ,
2020-04-28 09:08:04 +02:00
libxz ,
liblz4 ,
2020-06-24 14:56:28 +02:00
libzstd ,
libdl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-getty-generator' ,
'src/getty-generator/getty-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-debug-generator' ,
'src/debug-generator/debug-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2018-11-15 22:09:29 +01:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-run-generator' ,
'src/run-generator/run-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2022-01-06 20:12:27 +09:00
exe = executable (
2020-04-28 09:08:04 +02:00
'systemd-fstab-generator' ,
'src/fstab-generator/fstab-generator.c' ,
include_directories : includes ,
2021-01-01 05:38:06 +09:00
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2022-07-14 14:36:52 +02:00
meson . add_install_script ( meson_make_symlink ,
systemgeneratordir / 'systemd-fstab-generator' ,
rootlibexecdir / 'systemd-sysroot-fstab-check' )
2022-01-06 20:12:27 +09:00
if want_tests != 'false'
test ( 'test-fstab-generator' ,
test_fstab_generator_sh ,
# https://github.com/mesonbuild/meson/issues/2681
2022-01-21 14:28:23 +00:00
args : exe . full_path ( ) ,
depends : exe )
2022-01-06 20:12:27 +09:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_ENVIRONMENT_D' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'30-systemd-environment-d-generator' ,
'src/environment-d-generator/environment-d-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : userenvgeneratordir )
2017-04-09 23:55:50 -04:00
2017-04-17 19:25:00 -04:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
sysconfdir / 'environment' ,
environmentdir / '99-environment.conf' )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_HIBERNATE' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-hibernate-resume-generator' ,
'src/hibernate-resume/hibernate-resume-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-hibernate-resume' ,
'src/hibernate-resume/hibernate-resume.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_BLKID' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-gpt-auto-generator' ,
'src/gpt-auto-generator/gpt-auto-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : libblkid ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-dissect' ,
'src/dissect/dissect.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-07-29 15:39:33 +02:00
install : true )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 13:12:29 +02:00
if conf . get ( 'ENABLE_RESOLVE' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-resolved' ,
systemd_resolved_sources ,
2021-01-04 23:36:00 +09:00
include_directories : resolve_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ,
libbasic_gcrypt ,
libsystemd_resolve_core ] ,
dependencies : systemd_resolved_dependencies ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'resolvectl' ,
resolvectl_sources ,
include_directories : includes ,
link_with : [ libshared ,
libbasic_gcrypt ,
libsystemd_resolve_core ] ,
dependencies : [ threads ,
2020-12-10 16:08:26 -08:00
lib_openssl_or_gcrypt ,
2020-04-28 09:08:04 +02:00
libm ,
libidn ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2018-02-27 17:48:54 +01:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
bindir / 'resolvectl' ,
rootsbindir / 'resolvconf' )
2018-04-19 03:24:23 +09:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
bindir / 'resolvectl' ,
bindir / 'systemd-resolve' )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_LOGIND' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-logind' ,
systemd_logind_sources ,
include_directories : includes ,
link_with : [ liblogind_core ,
libshared ] ,
dependencies : [ threads ,
libacl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'loginctl' ,
loginctl_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
liblz4 ,
2020-04-12 01:09:05 +02:00
libxz ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-inhibit' ,
'src/login/inhibit.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-14 20:10:28 -04:00
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_PAM' ) == 1
2021-07-27 19:32:35 +02:00
version_script_arg = project_source_root / pam_systemd_sym
2017-04-17 19:25:00 -04:00
pam_systemd = shared_library (
'pam_systemd' ,
pam_systemd_c ,
name_prefix : '' ,
include_directories : includes ,
link_args : [ '-shared' ,
'-Wl,--version-script=' + version_script_arg ] ,
2017-12-19 11:35:01 +01:00
link_with : [ libsystemd_static ,
2017-04-17 19:25:00 -04:00
libshared_static ] ,
dependencies : [ threads ,
libpam ,
libpam_misc ] ,
link_depends : pam_systemd_sym ,
install : true ,
2022-05-15 17:43:48 -04:00
install_tag : 'pam' ,
2017-04-17 19:25:00 -04:00
install_dir : pamlibdir )
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'dlopen-pam_systemd' ,
test_dlopen ,
# path to dlopen must include a slash
2022-01-21 14:28:23 +00:00
args : pam_systemd . full_path ( ) ,
depends : pam_systemd )
2018-09-12 11:08:49 +02:00
endif
2017-04-17 19:25:00 -04:00
endif
2018-08-08 14:50:57 +02:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-user-runtime-dir' ,
user_runtime_dir_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_PAM' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-user-sessions' ,
'src/user-sessions/user-sessions.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2021-08-30 18:38:09 +02:00
if conf . get ( 'HAVE_BLKID' ) == 1 and conf . get ( 'HAVE_GNU_EFI' ) == 1
2021-12-12 01:27:03 +01:00
if get_option ( 'link-boot-shared' )
boot_link_with = [ libshared ]
else
boot_link_with = [ libsystemd_static , libshared_static ]
endif
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'bootctl' ,
'src/boot/bootctl.c' ,
include_directories : includes ,
2021-12-12 01:27:03 +01:00
link_with : [ boot_link_with ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ libblkid ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2018-06-25 17:24:09 +02:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-bless-boot' ,
'src/boot/bless-boot.c' ,
include_directories : includes ,
2021-12-12 01:27:03 +01:00
link_with : [ boot_link_with ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ libblkid ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-06-22 17:00:47 +02:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-bless-boot-generator' ,
'src/boot/bless-boot-generator.c' ,
include_directories : includes ,
2021-12-12 01:27:03 +01:00
link_with : [ boot_link_with ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2022-07-26 00:13:16 +02:00
2022-10-06 11:59:58 +02:00
if conf . get ( 'HAVE_OPENSSL' ) == 1 and conf . get ( 'HAVE_TPM2' ) == 1
2022-07-26 00:13:16 +02:00
executable (
'systemd-measure' ,
'src/boot/measure.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libopenssl ] ,
install_rpath : rootpkglibdir ,
install : true ,
install_dir : rootlibexecdir )
2022-09-16 23:57:26 +02:00
executable (
'systemd-pcrphase' ,
'src/boot/pcrphase.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libopenssl , tpm2 ] ,
install_rpath : rootpkglibdir ,
install : true ,
install_dir : rootlibexecdir )
2022-07-26 00:13:16 +02:00
endif
2017-04-04 23:03:47 -04:00
endif
2020-04-28 09:08:04 +02:00
executable (
'systemd-boot-check-no-failures' ,
'src/boot/boot-check-no-failures.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libblkid ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-socket-activate' ,
'src/activate/activate.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2018-05-22 15:08:57 -04:00
2022-03-28 20:03:37 +02:00
systemctl = executable (
2020-04-28 09:08:04 +02:00
'systemctl' ,
2021-01-04 20:12:28 +09:00
systemctl_sources ,
2020-04-28 09:08:04 +02:00
include_directories : includes ,
link_with : systemctl_link_with ,
dependencies : [ threads ,
libcap ,
libselinux ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2022-03-28 20:03:37 +02:00
public_programs + = systemctl
2017-04-04 23:03:47 -04:00
2018-04-16 21:41:40 +02:00
if conf . get ( 'ENABLE_PORTABLED' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-portabled' ,
systemd_portabled_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
2021-09-16 12:47:42 +01:00
dependencies : [ threads , libselinux ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-04-16 21:41:40 +02:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'portablectl' ,
'src/portable/portablectl.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2018-04-16 21:41:40 +02:00
endif
2021-01-08 16:57:27 +01:00
if conf . get ( 'ENABLE_SYSEXT' ) == 1
public_programs + = executable (
'systemd-sysext' ,
systemd_sysext_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-01-08 16:57:27 +01:00
install : true ,
2021-01-19 17:23:57 +00:00
install_dir : rootbindir )
2021-01-08 16:57:27 +01:00
endif
2019-07-04 18:33:30 +02:00
if conf . get ( 'ENABLE_USERDB' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-userwork' ,
systemd_userwork_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2019-07-04 18:33:30 +02:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-userdbd' ,
systemd_userdbd_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2019-08-05 18:22:01 +02:00
2020-04-28 09:08:37 +02:00
public_programs + = executable (
2020-04-28 09:08:04 +02:00
'userdbctl' ,
userdbctl_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2022-05-28 12:00:08 +02:00
install : true )
2019-07-04 18:33:30 +02:00
endif
2019-07-04 18:35:39 +02:00
if conf . get ( 'ENABLE_HOMED' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-homework' ,
systemd_homework_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libblkid ,
libcrypt ,
libopenssl ,
libfdisk ,
2020-11-25 15:07:06 +01:00
libp11kit ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2019-07-04 18:35:39 +02:00
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-homed' ,
systemd_homed_sources ,
2021-01-04 23:36:00 +09:00
include_directories : home_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ] ,
dependencies : [ threads ,
libcrypt ,
2021-11-02 23:11:59 +01:00
libopenssl ,
libm ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2019-07-04 19:06:15 +02:00
2020-04-28 09:08:37 +02:00
public_programs + = executable (
2020-04-28 09:08:04 +02:00
'homectl' ,
homectl_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libcrypt ,
libopenssl ,
libp11kit ,
2020-08-17 15:59:00 +02:00
libdl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2022-05-28 12:00:08 +02:00
install : true )
2019-07-04 19:06:26 +02:00
if conf . get ( 'HAVE_PAM' ) == 1
2021-07-27 19:32:35 +02:00
version_script_arg = project_source_root / pam_systemd_home_sym
2022-06-03 06:40:43 +09:00
pam_systemd_home = shared_library (
2019-07-04 19:06:26 +02:00
'pam_systemd_home' ,
pam_systemd_home_c ,
name_prefix : '' ,
include_directories : includes ,
link_args : [ '-shared' ,
'-Wl,--version-script=' + version_script_arg ] ,
link_with : [ libsystemd_static ,
libshared_static ] ,
dependencies : [ threads ,
libpam ,
libpam_misc ,
libcrypt ] ,
link_depends : pam_systemd_home_sym ,
install : true ,
2022-05-15 17:43:48 -04:00
install_tag : 'pam' ,
2019-07-04 19:06:26 +02:00
install_dir : pamlibdir )
2022-06-03 06:40:43 +09:00
if want_tests != 'false'
test ( 'dlopen-pam_systemd_home' ,
test_dlopen ,
# path to dlopen must include a slash
args : pam_systemd_home . full_path ( ) ,
depends : pam_systemd_home )
endif
2019-07-04 19:06:26 +02:00
endif
2019-07-04 18:35:39 +02:00
endif
2020-04-28 23:11:55 +02:00
foreach alias : ( [ 'halt' , 'poweroff' , 'reboot' , 'shutdown' ] +
2021-04-15 09:45:48 +02:00
( conf . get ( 'HAVE_SYSV_COMPAT' ) == 1 ? [ 'runlevel' , 'telinit' ] : [ ] ) )
2018-02-28 10:20:48 +01:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
rootbindir / 'systemctl' ,
rootsbindir / alias )
2018-02-28 10:20:48 +01:00
endforeach
2020-05-26 10:26:12 +02:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
rootbindir / 'udevadm' ,
rootlibexecdir / 'systemd-udevd' )
2020-05-26 10:26:12 +02:00
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_BACKLIGHT' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-backlight' ,
'src/backlight/backlight.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_RFKILL' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-rfkill' ,
'src/rfkill/rfkill.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2020-04-28 09:08:04 +02:00
executable (
'systemd-system-update-generator' ,
'src/system-update-generator/system-update-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_LIBCRYPTSETUP' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-cryptsetup' ,
systemd_cryptsetup_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libcryptsetup ,
libp11kit ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-cryptsetup-generator' ,
'src/cryptsetup/cryptsetup-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-veritysetup' ,
'src/veritysetup/veritysetup.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libcryptsetup ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-veritysetup-generator' ,
'src/veritysetup/veritysetup-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2020-11-24 13:41:47 +01:00
2022-04-05 14:12:52 +02:00
public_programs + = executable (
2020-11-24 13:41:47 +01:00
'systemd-cryptenroll' ,
systemd_cryptenroll_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libcryptsetup ,
2020-11-28 15:27:34 +01:00
libdl ,
2020-11-24 13:41:47 +01:00
libopenssl ,
libp11kit ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-01-18 21:17:04 +01:00
install : true )
2021-09-26 11:53:42 -05:00
executable (
'systemd-integritysetup' ,
[ 'src/integritysetup/integritysetup.c' , 'src/integritysetup/integrity-util.c' ] ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libcryptsetup ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-09-26 11:53:42 -05:00
install : true ,
install_dir : rootlibexecdir )
executable (
'systemd-integritysetup-generator' ,
[ 'src/integritysetup/integritysetup-generator.c' , 'src/integritysetup/integrity-util.c' ] ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-09-26 11:53:42 -05:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_SYSV_COMPAT' ) == 1
2022-01-21 14:28:23 +00:00
exe = executable (
2020-04-28 09:08:04 +02:00
'systemd-sysv-generator' ,
'src/sysv-generator/sysv-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
2022-01-21 14:28:23 +00:00
sysv_generator_test_py = find_program ( 'test/sysv-generator-test.py' )
if want_tests != 'false'
test ( 'sysv-generator-test' ,
sysv_generator_test_py ,
depends : exe )
endif
2020-04-28 09:08:04 +02:00
executable (
'systemd-rc-local-generator' ,
'src/rc-local-generator/rc-local-generator.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : systemgeneratordir )
2017-04-04 23:03:47 -04:00
endif
2020-03-25 16:59:40 +01:00
if conf . get ( 'ENABLE_XDG_AUTOSTART' ) == 1
executable (
'systemd-xdg-autostart-generator' ,
2021-01-04 20:41:37 +09:00
systemd_xdg_autostart_generator_sources ,
2020-03-25 16:59:40 +01:00
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-03-25 16:59:40 +01:00
install : true ,
install_dir : usergeneratordir )
executable (
'systemd-xdg-autostart-condition' ,
'src/xdg-autostart-generator/xdg-autostart-condition.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-03-25 16:59:40 +01:00
install : true ,
install_dir : rootlibexecdir )
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_HOSTNAMED' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-hostnamed' ,
'src/hostname/hostnamed.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'hostnamectl' ,
'src/hostname/hostnamectl.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_LOCALED' ) == 1
if conf . get ( 'HAVE_XKBCOMMON' ) == 1
2021-10-18 10:13:07 +02:00
# logind will load libxkbcommon.so dynamically on its own, but we still
# need to specify where the headers are
deps = [ libdl , libxkbcommon . partial_dependency ( compile_args : true ) ]
2017-04-17 19:25:00 -04:00
else
deps = [ ]
endif
2017-04-13 19:37:14 -04:00
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-localed' ,
systemd_localed_sources ,
2021-10-18 10:13:07 +02:00
include_directories : includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ] ,
dependencies : deps ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'localectl' ,
localectl_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_TIMEDATED' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-timedated' ,
'src/timedate/timedated.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-05-03 18:07:43 +09:00
endif
2017-04-17 19:25:00 -04:00
2018-05-03 18:07:43 +09:00
if conf . get ( 'ENABLE_TIMEDATECTL' ) == 1
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'timedatectl' ,
'src/timedate/timedatectl.c' ,
include_directories : includes ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ] ,
dependencies : [ libm ] ,
install : true )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_TIMESYNCD' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-timesyncd' ,
systemd_timesyncd_sources ,
include_directories : includes ,
2021-01-04 20:09:06 +09:00
link_with : [ libtimesyncd_core ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ threads ,
libm ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-03-21 06:42:04 -05:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-time-wait-sync' ,
2021-01-01 05:10:09 +09:00
'src/timesync/wait-sync.c' ,
2020-04-28 09:08:04 +02:00
include_directories : includes ,
2021-01-04 20:09:06 +09:00
link_with : [ libtimesyncd_core ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_MACHINED' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-machined' ,
systemd_machined_sources ,
include_directories : includes ,
link_with : [ libmachine_core ,
libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'machinectl' ,
'src/machine/machinectl.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_IMPORTD' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-importd' ,
systemd_importd_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
systemd_pull = executable (
'systemd-pull' ,
systemd_pull_sources ,
include_directories : includes ,
2021-12-07 15:39:43 +01:00
link_with : [ libshared ,
lib_import_common ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ versiondep ,
libcurl ,
2021-11-02 09:58:04 +01:00
lib_openssl_or_gcrypt ,
2020-04-28 09:08:04 +02:00
libz ,
libbzip2 ,
2021-11-02 09:58:04 +01:00
libxz ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
systemd_import = executable (
'systemd-import' ,
systemd_import_sources ,
include_directories : includes ,
2021-12-07 15:39:43 +01:00
link_with : [ libshared ,
lib_import_common ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ libcurl ,
libz ,
libbzip2 ,
libxz ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
systemd_import_fs = executable (
'systemd-import-fs' ,
systemd_import_fs_sources ,
include_directories : includes ,
2021-12-07 15:39:43 +01:00
link_with : [ libshared ,
lib_import_common ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-10-10 21:20:08 +02:00
2020-04-28 09:08:04 +02:00
systemd_export = executable (
'systemd-export' ,
systemd_export_sources ,
include_directories : includes ,
2021-12-07 15:39:43 +01:00
link_with : [ libshared ,
lib_import_common ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ libcurl ,
libz ,
libbzip2 ,
libxz ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2018-10-10 21:20:08 +02:00
public_programs + = [ systemd_pull , systemd_import , systemd_import_fs , systemd_export ]
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_REMOTE' ) == 1 and conf . get ( 'HAVE_LIBCURL' ) == 1
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-journal-upload' ,
systemd_journal_upload_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ versiondep ,
threads ,
libcurl ,
libgnutls ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_REMOTE' ) == 1 and conf . get ( 'HAVE_MICROHTTPD' ) == 1
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-journal-remote' ,
systemd_journal_remote_sources ,
2021-11-30 16:18:56 +01:00
include_directories : journal_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ,
libsystemd_journal_remote ] ,
dependencies : [ threads ,
libmicrohttpd ,
libgnutls ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-journal-gatewayd' ,
systemd_journal_gatewayd_sources ,
2021-11-30 16:18:56 +01:00
include_directories : journal_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libshared ] ,
dependencies : [ threads ,
libmicrohttpd ,
libgnutls ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_COREDUMP' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-coredump' ,
systemd_coredump_sources ,
include_directories : includes ,
2022-04-20 15:35:28 +02:00
link_with : [ libshared ,
libbasic_compress ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ threads ,
libacl ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'coredumpctl' ,
coredumpctl_sources ,
include_directories : includes ,
2022-04-20 15:35:28 +02:00
link_with : [ libshared ,
libbasic_compress ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ threads ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
endif
2019-05-16 08:59:01 -05:00
if conf . get ( 'ENABLE_PSTORE' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-pstore' ,
systemd_pstore_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libacl ,
libxz ,
2020-04-12 01:09:05 +02:00
liblz4 ,
libzstd ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2019-05-16 08:59:01 -05:00
endif
2020-03-23 17:32:27 -07:00
if conf . get ( 'ENABLE_OOMD' ) == 1
2021-07-24 10:30:42 +03:00
dbus_programs + = executable ( 'systemd-oomd' ,
2020-03-23 17:32:27 -07:00
systemd_oomd_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-09-12 18:41:34 +02:00
dependencies : [ libatomic ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-03-23 17:32:27 -07:00
install : true ,
install_dir : rootlibexecdir )
2020-09-08 23:46:27 -07:00
public_programs + = executable (
2021-04-15 09:45:48 +02:00
'oomctl' ,
oomctl_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2022-01-05 22:14:14 +01:00
install : true )
2020-03-23 17:32:27 -07:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_BINFMT' ) == 1
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-binfmt' ,
'src/binfmt/binfmt.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-17 19:25:00 -04:00
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' ,
mkdir_p . format ( binfmtdir ) )
2020-11-12 08:01:39 +01:00
if install_sysconfdir
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' ,
2021-07-27 19:32:35 +02:00
mkdir_p . format ( sysconfdir / 'binfmt.d' ) )
2020-11-12 08:01:39 +01:00
endif
2017-04-17 19:25:00 -04:00
endif
2020-12-28 15:17:54 +01:00
if conf . get ( 'ENABLE_SYSUPDATE' ) == 1
exe = executable (
'systemd-sysupdate' ,
systemd_sysupdate_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libblkid ,
libfdisk ,
libopenssl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-12-28 15:17:54 +01:00
install : true ,
install_dir : rootlibexecdir )
public_programs + = exe
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_VCONSOLE' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-vconsole-setup' ,
'src/vconsole/vconsole-setup.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_RANDOMSEED' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-random-seed' ,
'src/random-seed/random-seed.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_FIRSTBOOT' ) == 1
2022-04-05 14:12:52 +02:00
public_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-firstboot' ,
'src/firstboot/firstboot.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libcrypt ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
endif
2020-04-28 09:08:04 +02:00
executable (
'systemd-remount-fs' ,
'src/remount-fs/remount-fs.c' ,
include_directories : includes ,
2021-01-01 05:38:06 +09:00
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-machine-id-setup' ,
'src/machine-id-setup/machine-id-setup-main.c' ,
include_directories : includes ,
2021-01-01 05:38:06 +09:00
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-fsck' ,
'src/fsck/fsck.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2017-10-23 13:40:38 +02:00
executable ( 'systemd-growfs' ,
'src/partition/growfs.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2017-10-23 13:40:38 +02:00
install : true ,
install_dir : rootlibexecdir )
2020-04-28 09:08:04 +02:00
executable (
'systemd-makefs' ,
'src/partition/makefs.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-11-26 22:51:29 +01:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-sleep' ,
'src/sleep/sleep.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-12-30 15:11:30 -08:00
if install_sysconfdir_samples
2020-11-12 08:01:39 +01:00
install_data ( 'src/sleep/sleep.conf' ,
install_dir : pkgsysconfdir )
endif
2019-01-03 02:32:57 +09:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-sysctl' ,
'src/sysctl/sysctl.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-ac-power' ,
'src/ac-power/ac-power.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-detect-virt' ,
'src/detect-virt/detect-virt.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-delta' ,
'src/delta/delta.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-escape' ,
'src/escape/escape.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-notify' ,
'src/notify/notify.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2021-06-21 17:54:09 +02:00
public_programs + = executable (
'systemd-creds' ,
'src/creds/creds.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libopenssl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-06-21 17:54:09 +02:00
install : true ,
install_dir : rootbindir )
2020-04-28 09:08:04 +02:00
executable (
'systemd-volatile-root' ,
'src/volatile-root/volatile-root.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-08 23:59:13 +02:00
install : conf . get ( 'ENABLE_INITRD' ) == 1 ,
2020-04-28 09:08:04 +02:00
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-cgroups-agent' ,
'src/cgroups-agent/cgroups-agent.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2022-03-28 20:03:37 +02:00
systemd_id128 = executable (
2020-04-28 09:08:04 +02:00
'systemd-id128' ,
'src/id128/id128.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2022-03-28 20:03:37 +02:00
public_programs + = systemd_id128
if want_tests != 'false'
test ( 'test-systemctl-enable' ,
test_systemctl_enable_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : [ systemctl . full_path ( ) ,
systemd_id128 . full_path ( ) ] )
endif
2018-08-21 16:08:48 +02:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-path' ,
'src/path/path.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-ask-password' ,
'src/ask-password/ask-password.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-reply-password' ,
'src/reply-password/reply-password.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-tty-ask-password-agent' ,
'src/tty-ask-password-agent/tty-ask-password-agent.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-cgls' ,
'src/cgls/cgls.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-cgtop' ,
'src/cgtop/cgtop.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-initctl' ,
'src/initctl/initctl.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 23:11:55 +02:00
install : ( conf . get ( 'HAVE_SYSV_COMPAT' ) == 1 ) ,
2020-04-28 09:08:04 +02:00
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-mount' ,
'src/mount/mount-tool.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libmount ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2017-04-09 23:55:50 -04:00
meson . add_install_script ( meson_make_symlink ,
2021-07-27 19:32:35 +02:00
'systemd-mount' , bindir / 'systemd-umount' )
2017-04-09 23:55:50 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-run' ,
'src/run/run.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-stdio-bridge' ,
'src/stdio-bridge/stdio-bridge.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ versiondep ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'busctl' ,
2021-01-04 20:35:33 +09:00
busctl_sources ,
2020-04-28 09:08:04 +02:00
include_directories : includes ,
link_with : [ libshared ] ,
2021-12-24 22:07:40 -08:00
dependencies : [ versiondep ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2020-09-26 11:58:24 +02:00
if enable_sysusers
exe = executable (
2020-04-28 09:08:04 +02:00
'systemd-sysusers' ,
'src/sysusers/sysusers.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2020-09-26 11:58:24 +02:00
public_programs + = exe
if want_tests != 'false'
test ( 'test-sysusers' ,
test_sysusers_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) )
endif
2020-06-03 14:02:59 -07:00
if have_standalone_binaries
2020-09-26 11:58:24 +02:00
exe = executable (
2020-06-03 14:02:59 -07:00
'systemd-sysusers.standalone' ,
'src/sysusers/sysusers.c' ,
include_directories : includes ,
2020-10-09 18:02:54 +02:00
c_args : '-DSTANDALONE' ,
2020-06-03 14:02:59 -07:00
link_with : [ libshared_static ,
libbasic ,
libbasic_gcrypt ,
2021-01-01 04:30:47 +09:00
libsystemd_static ] ,
2020-06-03 14:02:59 -07:00
install : true ,
install_dir : rootbindir )
2020-09-26 11:58:24 +02:00
public_programs + = exe
if want_tests != 'false'
test ( 'test-sysusers.standalone' ,
test_sysusers_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) )
endif
2020-06-03 14:02:59 -07:00
endif
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_TMPFILES' ) == 1
2020-04-28 09:08:04 +02:00
exe = executable (
'systemd-tmpfiles' ,
2020-06-03 14:49:53 -07:00
systemd_tmpfiles_sources ,
2020-04-28 09:08:04 +02:00
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libacl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2018-07-31 09:44:11 +02:00
public_programs + = exe
2017-11-22 14:13:32 +01:00
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'test-systemd-tmpfiles' ,
test_systemd_tmpfiles_py ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) )
endif
2020-06-03 14:49:53 -07:00
if have_standalone_binaries
2022-04-17 09:48:28 -04:00
exe = executable (
2020-06-03 14:49:53 -07:00
'systemd-tmpfiles.standalone' ,
systemd_tmpfiles_sources ,
include_directories : includes ,
2020-10-09 18:02:54 +02:00
c_args : '-DSTANDALONE' ,
2020-06-03 14:49:53 -07:00
link_with : [ libshared_static ,
libbasic ,
libbasic_gcrypt ,
2021-01-01 04:30:47 +09:00
libsystemd_static ] ,
2020-06-03 14:49:53 -07:00
dependencies : [ libacl ] ,
install : true ,
install_dir : rootbindir )
2022-04-17 09:48:28 -04:00
public_programs + = exe
if want_tests != 'false'
test ( 'test-systemd-tmpfiles.standalone' ,
test_systemd_tmpfiles_py ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) )
endif
2020-06-03 14:49:53 -07:00
endif
2017-04-04 23:03:47 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_HWDB' ) == 1
2021-04-15 08:20:31 +02:00
systemd_hwdb = executable (
2020-04-28 09:08:04 +02:00
'systemd-hwdb' ,
'src/hwdb/hwdb.c' ,
include_directories : includes ,
2020-12-14 20:41:32 +09:00
link_with : udev_link_with ,
2020-04-28 09:08:04 +02:00
install_rpath : udev_rpath ,
install : true ,
install_dir : rootbindir )
2021-04-15 08:20:31 +02:00
public_programs + = systemd_hwdb
if want_tests != 'false'
test ( 'hwdb-test' ,
hwdb_test_sh ,
2022-05-02 11:12:34 +02:00
suite : 'dist-check' ,
2021-04-15 08:20:31 +02:00
args : [ systemd_hwdb . full_path ( ) ] ,
timeout : 90 )
endif
2017-04-17 19:25:00 -04:00
endif
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_QUOTACHECK' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-quotacheck' ,
'src/quotacheck/quotacheck.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
endif
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-socket-proxyd' ,
'src/socket-proxy/socket-proxyd.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2022-04-04 15:56:00 +02:00
udevadm = executable (
2020-04-28 09:08:04 +02:00
'udevadm' ,
udevadm_sources ,
include_directories : includes ,
2020-12-14 20:41:32 +09:00
link_with : [ libudevd_core ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ versiondep ,
threads ,
libkmod ,
libidn ,
libacl ,
libblkid ] ,
install_rpath : udev_rpath ,
install : true ,
install_dir : rootbindir )
2022-04-04 15:56:00 +02:00
public_programs + = udevadm
if conf . get ( 'ENABLE_REPART' ) == 1
exe = executable (
'systemd-repart' ,
systemd_repart_sources ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ threads ,
libblkid ,
2022-09-11 10:49:24 +02:00
libfdisk ,
libopenssl ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2022-04-04 15:56:00 +02:00
install : true ,
install_dir : rootbindir )
public_programs + = exe
endif
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-shutdown' ,
systemd_shutdown_sources ,
include_directories : includes ,
2021-01-01 05:38:06 +09:00
link_with : [ libshared ] ,
2020-04-28 09:08:04 +02:00
dependencies : [ libmount ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-update-done' ,
'src/update-done/update-done.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-update-utmp' ,
'src/update-utmp/update-utmp.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libaudit ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-07-14 00:49:25 +02:00
install : ( conf . get ( 'ENABLE_UTMP' ) == 1 ) ,
2020-04-28 09:08:04 +02:00
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2017-10-03 10:41:51 +02:00
if conf . get ( 'HAVE_KMOD' ) == 1
2020-04-28 09:08:04 +02:00
executable (
'systemd-modules-load' ,
'src/modules-load/modules-load.c' ,
include_directories : includes ,
link_with : [ libshared ] ,
dependencies : [ libkmod ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-09 23:55:05 -04:00
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' ,
mkdir_p . format ( modulesloaddir ) )
2020-11-12 08:01:39 +01:00
if install_sysconfdir
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' ,
2021-07-27 19:32:35 +02:00
mkdir_p . format ( sysconfdir / 'modules-load.d' ) )
2020-11-12 08:01:39 +01:00
endif
2017-04-04 23:03:47 -04:00
endif
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'systemd-nspawn' ,
systemd_nspawn_sources ,
include_directories : includes ,
2021-01-01 05:38:06 +09:00
link_with : [ libnspawn_core ,
2020-04-28 09:08:04 +02:00
libshared ] ,
dependencies : [ libblkid ,
libseccomp ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true )
2017-04-04 23:03:47 -04:00
2017-10-03 10:41:51 +02:00
if conf . get ( 'ENABLE_NETWORKD' ) == 1
2021-12-10 19:22:23 +03:00
dbus_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-networkd' ,
systemd_networkd_sources ,
2021-01-04 23:36:00 +09:00
include_directories : network_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libnetworkd_core ,
libsystemd_network ,
networkd_link_with ] ,
dependencies : [ threads ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2022-04-05 14:12:52 +02:00
public_programs + = executable (
2020-04-28 09:08:04 +02:00
'systemd-networkd-wait-online' ,
systemd_networkd_wait_online_sources ,
include_directories : includes ,
2021-01-04 23:36:00 +09:00
link_with : [ networkd_link_with ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-04-04 23:03:47 -04:00
2020-04-28 09:08:04 +02:00
public_programs + = executable (
'networkctl' ,
networkctl_sources ,
2021-01-04 23:36:00 +09:00
include_directories : libsystemd_network_includes ,
2020-04-28 09:08:04 +02:00
link_with : [ libsystemd_network ,
networkd_link_with ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootbindir )
2021-12-16 01:51:22 +09:00
endif
2019-07-13 03:35:04 +09:00
2021-12-16 01:51:22 +09:00
exe = executable (
'systemd-network-generator' ,
network_generator_sources ,
include_directories : includes ,
link_with : [ networkd_link_with ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2021-12-16 01:51:22 +09:00
install : true ,
install_dir : rootlibexecdir )
2019-12-10 13:04:39 +01:00
2021-12-16 01:51:22 +09:00
if want_tests != 'false'
test ( 'test-network-generator-conversion' ,
test_network_generator_conversion_sh ,
# https://github.com/mesonbuild/meson/issues/2681
2022-01-21 14:28:23 +00:00
args : exe . full_path ( ) ,
depends : exe )
2017-08-21 09:48:41 -03:00
endif
2017-12-07 10:44:43 +01:00
2020-04-28 09:08:04 +02:00
executable (
'systemd-sulogin-shell' ,
2021-01-04 20:43:44 +09:00
'src/sulogin-shell/sulogin-shell.c' ,
2020-04-28 09:08:04 +02:00
include_directories : includes ,
link_with : [ libshared ] ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2020-04-28 09:08:04 +02:00
install : true ,
install_dir : rootlibexecdir )
2017-12-07 10:44:43 +01:00
2022-07-01 13:08:31 +02:00
exe = custom_target (
2022-04-05 18:18:56 +02:00
'kernel-install' ,
input : kernel_install_in ,
output : 'kernel-install' ,
command : [ jinja2_cmdline , '@INPUT@' , '@OUTPUT@' ] ,
install : want_kernel_install ,
install_mode : 'rwxr-xr-x' ,
install_dir : bindir )
2022-07-01 13:08:31 +02:00
public_programs + = exe
if want_tests != 'false'
test ( 'test-kernel-install' ,
test_kernel_install_sh ,
args : [ exe . full_path ( ) , loaderentry_install ] )
endif
2022-04-05 18:18:56 +02:00
2017-04-07 00:19:09 -04:00
############################################################
2022-01-21 14:28:23 +00:00
runtest_env = custom_target (
2018-09-11 23:55:02 -07:00
'systemd-runtest.env' ,
output : 'systemd-runtest.env' ,
2021-05-14 14:16:17 +02:00
command : [ sh , '-c' ,
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@' . format (
2021-07-27 19:32:35 +02:00
project_source_root / 'test' ,
project_build_root / 'catalog' ) ] ,
2022-01-21 14:28:23 +00:00
depends : catalogs ,
2018-09-11 23:55:02 -07:00
build_by_default : true )
2021-04-14 15:55:16 +02:00
test_cflags = [ '-DTEST_CODE=1' ]
# We intentionally do not do inline initializations with definitions for a
# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
# false positives when the combination of -O2 and -flto is used. Suppress them.
2022-04-29 14:35:20 +02:00
if '-O2' in c_args and '-flto=auto' in c_args
2021-04-14 15:55:16 +02:00
test_cflags + = cc . first_supported_argument ( '-Wno-maybe-uninitialized' )
endif
2017-04-07 00:19:09 -04:00
foreach tuple : tests
2017-04-17 19:25:00 -04:00
sources = tuple [ 0 ]
2021-01-01 06:29:03 +09:00
link_with = tuple . length ( ) > 1 and tuple [ 1 ] . length ( ) > 0 ? tuple [ 1 ] : [ libshared ]
dependencies = tuple . length ( ) > 2 ? tuple [ 2 ] : [ ]
incs = tuple . length ( ) > 3 and tuple [ 3 ] . length ( ) > 0 ? tuple [ 3 ] : includes
condition = tuple . length ( ) > 4 ? tuple [ 4 ] : ''
type = tuple . length ( ) > 5 ? tuple [ 5 ] : ''
defs = tuple . length ( ) > 6 ? tuple [ 6 ] : [ ]
2021-04-14 15:55:16 +02:00
defs + = test_cflags
2021-01-01 06:29:03 +09:00
parallel = tuple . length ( ) > 7 ? tuple [ 7 ] : true
2017-04-17 19:25:00 -04:00
timeout = 30
2017-04-07 00:19:09 -04:00
2022-01-11 10:21:23 +01:00
# FIXME: Use fs.stem() with meson >= 0.54.0
name = '@0@' . format ( sources [ 0 ] ) . split ( '/' ) [ - 1 ] . split ( '.' ) [ 0 ]
2017-04-17 19:25:00 -04:00
if type . startswith ( 'timeout=' )
timeout = type . split ( '=' ) [ 1 ] . to_int ( )
type = ''
endif
2018-09-12 16:52:08 +02:00
2022-07-03 13:44:05 +02:00
suite = fs . name ( fs . parent ( '@0@' . format ( sources [ 0 ] ) ) )
# FIXME: Use str.replace() with meson >= 0.58.0
suite = suite . split ( 'sd-' ) [ - 1 ]
2018-09-12 16:52:08 +02:00
if condition == '' or conf . get ( condition ) == 1
2017-04-17 19:25:00 -04:00
exe = executable (
name ,
sources ,
include_directories : incs ,
link_with : link_with ,
2019-02-24 22:49:38 +01:00
dependencies : [ versiondep ,
dependencies ] ,
2017-04-17 19:25:00 -04:00
c_args : defs ,
2018-09-12 16:52:08 +02:00
build_by_default : want_tests != 'false' ,
2022-06-01 08:23:02 +02:00
install_rpath : rootpkglibdir ,
2017-06-23 03:23:30 +02:00
install : install_tests ,
2022-01-21 14:28:23 +00:00
install_dir : testsdir / type ,
link_depends : runtest_env )
2017-04-08 01:55:38 -04:00
2017-04-17 19:25:00 -04:00
if type == 'manual'
message ( '@0@ is a manual test' . format ( name ) )
elif type == 'unsafe' and want_tests != 'unsafe'
message ( '@0@ is an unsafe test' . format ( name ) )
2018-09-12 16:52:08 +02:00
elif want_tests != 'false'
2017-04-17 19:25:00 -04:00
test ( name , exe ,
env : test_env ,
2022-07-03 13:44:05 +02:00
timeout : timeout ,
2022-09-19 23:40:34 +09:00
suite : suite ,
is_parallel : parallel )
2017-04-17 19:25:00 -04:00
endif
else
message ( 'Not compiling @0@ because @1@ is not true' . format ( name , condition ) )
endif
2017-04-07 00:19:09 -04:00
endforeach
2018-04-23 13:49:27 +02:00
exe = executable (
2017-04-17 19:25:00 -04:00
'test-libsystemd-sym' ,
test_libsystemd_sym_c ,
include_directories : includes ,
link_with : [ libsystemd ] ,
2018-09-12 21:47:56 +09:00
build_by_default : want_tests != 'false' ,
2017-04-17 19:25:00 -04:00
install : install_tests ,
install_dir : testsdir )
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'test-libsystemd-sym' , exe )
endif
2017-04-10 14:13:40 -04:00
2018-04-23 13:49:27 +02:00
exe = executable (
'test-libsystemd-static-sym' ,
test_libsystemd_sym_c ,
include_directories : includes ,
link_with : [ install_libsystemd_static ] ,
dependencies : [ threads ] , # threads is already included in dependencies on the library,
# but does not seem to get propagated. Add here as a work-around.
2018-09-12 21:47:56 +09:00
build_by_default : want_tests != 'false' and static_libsystemd_pic ,
2018-04-24 13:34:48 -07:00
install : install_tests and static_libsystemd_pic ,
2018-04-23 13:49:27 +02:00
install_dir : testsdir )
2018-09-12 11:08:49 +02:00
if want_tests != 'false' and static_libsystemd_pic
2018-04-23 13:49:27 +02:00
test ( 'test-libsystemd-static-sym' , exe )
endif
exe = executable (
2017-04-17 19:25:00 -04:00
'test-libudev-sym' ,
test_libudev_sym_c ,
2020-12-14 20:41:32 +09:00
include_directories : libudev_includes ,
2021-04-14 15:55:16 +02:00
c_args : [ '-Wno-deprecated-declarations' ] + test_cflags ,
2017-04-17 19:25:00 -04:00
link_with : [ libudev ] ,
2018-09-12 21:47:56 +09:00
build_by_default : want_tests != 'false' ,
2017-04-17 19:25:00 -04:00
install : install_tests ,
install_dir : testsdir )
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'test-libudev-sym' , exe )
endif
2018-04-23 13:49:27 +02:00
exe = executable (
'test-libudev-static-sym' ,
test_libudev_sym_c ,
2020-12-14 20:41:32 +09:00
include_directories : libudev_includes ,
2021-04-14 15:55:16 +02:00
c_args : [ '-Wno-deprecated-declarations' ] + test_cflags ,
2018-04-23 13:49:27 +02:00
link_with : [ install_libudev_static ] ,
2018-09-12 21:47:56 +09:00
build_by_default : want_tests != 'false' and static_libudev_pic ,
2018-04-24 13:34:48 -07:00
install : install_tests and static_libudev_pic ,
2018-04-23 13:49:27 +02:00
install_dir : testsdir )
2018-09-12 11:08:49 +02:00
if want_tests != 'false' and static_libudev_pic
2018-04-23 13:49:27 +02:00
test ( 'test-libudev-static-sym' , exe )
endif
2017-04-10 15:20:42 -04:00
2017-04-07 00:19:09 -04:00
############################################################
2017-04-04 23:03:47 -04:00
2018-01-13 19:51:07 -05:00
fuzzer_exes = [ ]
2020-12-02 13:49:24 +01:00
foreach tuple : fuzzers
sources = tuple [ 0 ]
2021-01-01 06:29:03 +09:00
link_with = tuple . length ( ) > 1 and tuple [ 1 ] . length ( ) > 0 ? tuple [ 1 ] : [ libshared ]
dependencies = tuple . length ( ) > 2 ? tuple [ 2 ] : [ ]
incs = tuple . length ( ) > 3 and tuple [ 3 ] . length ( ) > 0 ? tuple [ 3 ] : includes
defs = tuple . length ( ) > 4 ? tuple [ 4 ] : [ ]
2020-12-02 13:49:24 +01:00
link_args = [ ]
2018-01-13 19:51:07 -05:00
2020-12-02 13:49:24 +01:00
if want_ossfuzz
dependencies + = fuzzing_engine
elif want_libfuzzer
if fuzzing_engine . found ( )
2019-05-09 00:03:41 +02:00
dependencies + = fuzzing_engine
else
2020-12-02 13:49:24 +01:00
link_args + = [ '-fsanitize=fuzzer' ]
2019-05-09 00:03:41 +02:00
endif
2020-12-02 13:49:24 +01:00
else
sources + = 'src/fuzz/fuzz-main.c'
endif
2018-01-13 19:51:07 -05:00
2022-01-11 10:47:01 +01:00
# FIXME: Use fs.stem() with meson >= 0.54.0
name = '@0@' . format ( sources [ 0 ] ) . split ( '/' ) [ - 1 ] . split ( '.' ) [ 0 ]
2018-01-13 19:51:07 -05:00
2021-05-19 16:44:13 +02:00
exe = executable (
2020-12-02 13:49:24 +01:00
name ,
sources ,
include_directories : [ incs , include_directories ( 'src/fuzz' ) ] ,
link_with : link_with ,
dependencies : dependencies ,
2021-04-14 15:55:16 +02:00
c_args : defs + test_cflags ,
2020-12-02 13:49:24 +01:00
link_args : link_args ,
install : false ,
2021-05-19 16:44:13 +02:00
build_by_default : fuzzer_build )
fuzzer_exes + = exe
if want_tests != 'false'
# Run the fuzz regression tests without any sanitizers enabled.
# Additional invocations with sanitizers may be added below.
foreach p : fuzz_regression_tests
b = p . split ( '/' ) [ - 2 ]
c = p . split ( '/' ) [ - 1 ]
if b == name
test ( '@0@_@1@' . format ( b , c ) ,
exe ,
2022-05-02 11:12:34 +02:00
suite : 'fuzzers' ,
2021-07-27 19:32:35 +02:00
args : [ project_source_root / p ] )
2021-05-19 16:44:13 +02:00
endif
endforeach
endif
2020-12-02 13:49:24 +01:00
endforeach
2018-01-13 19:51:07 -05:00
2021-07-27 19:58:55 +02:00
alias_target ( 'fuzzers' , fuzzer_exes )
2018-01-13 19:51:07 -05:00
############################################################
2021-07-07 12:39:33 +02:00
subdir ( 'modprobe.d' )
2017-04-04 23:03:47 -04:00
subdir ( 'sysctl.d' )
subdir ( 'sysusers.d' )
subdir ( 'tmpfiles.d' )
2019-10-08 16:52:10 +02:00
subdir ( 'hwdb.d' )
subdir ( 'units' )
2017-11-23 13:23:42 +01:00
subdir ( 'presets' )
2017-04-04 23:03:47 -04:00
subdir ( 'network' )
subdir ( 'man' )
subdir ( 'shell-completion/bash' )
subdir ( 'shell-completion/zsh' )
2018-09-07 01:02:42 -07:00
subdir ( 'docs/sysvinit' )
subdir ( 'docs/var-log' )
2017-04-04 23:03:47 -04:00
install_subdir ( 'factory/etc' ,
install_dir : factorydir )
2021-12-23 11:01:07 +00:00
subdir ( 'factory/templates' )
2017-04-04 23:03:47 -04:00
2020-11-12 08:01:39 +01:00
if install_sysconfdir
install_data ( 'xorg/50-systemd-user.sh' ,
install_dir : xinitrcdir )
endif
2018-02-26 11:48:46 +01:00
install_data ( 'LICENSE.GPL2' ,
2017-04-04 23:03:47 -04:00
'LICENSE.LGPL2.1' ,
2018-02-26 11:48:46 +01:00
'NEWS' ,
'README' ,
2018-10-30 23:01:20 +05:30
'docs/CODING_STYLE.md' ,
2018-09-07 01:22:34 -07:00
'docs/DISTRO_PORTING.md' ,
2018-09-07 01:02:42 -07:00
'docs/ENVIRONMENT.md' ,
2020-01-15 13:45:04 +01:00
'docs/HACKING.md' ,
2018-09-07 01:02:42 -07:00
'docs/TRANSIENT-SETTINGS.md' ,
2018-09-07 01:44:49 -07:00
'docs/TRANSLATORS.md' ,
2018-09-07 01:02:42 -07:00
'docs/UIDS-GIDS.md' ,
2017-04-04 23:03:47 -04:00
install_dir : docdir )
2017-04-06 14:33:27 -04:00
2021-09-29 22:10:34 +01:00
install_subdir ( 'LICENSES' ,
install_dir : docdir )
2021-05-14 16:12:51 +02:00
meson . add_install_script ( 'sh' , '-c' , mkdir_p . format ( systemdstatedir ) )
meson . add_install_script ( 'sh' , '-c' , 'touch $DESTDIR@0@' . format ( prefixdir ) )
2017-04-09 23:55:05 -04:00
2017-04-06 14:33:27 -04:00
############################################################
2021-05-19 14:45:47 +01:00
# Ensure that changes to the docs/ directory do not break the
# basic Github pages build. But only run it in developer mode,
# as it might be fragile due to changes in the tooling, and it is
# not generally useful for users.
jekyll = find_program ( 'jekyll' , required : false )
if get_option ( 'mode' ) == 'developer' and want_tests != 'false' and jekyll . found ( )
test ( 'github-pages' ,
jekyll ,
2022-05-02 11:12:34 +02:00
suite : 'dist-check' ,
2021-05-19 14:45:47 +01:00
args : [ 'build' ,
2021-07-27 19:32:35 +02:00
'--source' , project_source_root / 'docs' ,
'--destination' , project_build_root / '_site' ] )
2021-05-19 14:45:47 +01:00
endif
############################################################
2020-05-07 13:54:10 +02:00
check_help = find_program ( 'tools/check-help.sh' )
2022-04-05 10:51:21 +02:00
check_version = find_program ( 'tools/check-version.sh' )
2017-04-13 11:52:05 -04:00
foreach exec : public_programs
2017-04-17 19:25:00 -04:00
name = exec . full_path ( ) . split ( '/' ) [ - 1 ]
2018-09-12 11:08:49 +02:00
if want_tests != 'false'
test ( 'check-help-' + name ,
2020-05-07 13:54:10 +02:00
check_help ,
2022-05-02 11:12:34 +02:00
suite : 'dist-check' ,
2022-01-21 14:28:23 +00:00
args : exec . full_path ( ) ,
depends : exec )
2022-04-05 10:51:21 +02:00
test ( 'check-version-' + name ,
check_version ,
2022-05-02 11:12:34 +02:00
suite : 'dist-check' ,
2022-04-05 10:51:21 +02:00
args : [ exec . full_path ( ) ,
meson . project_version ( ) ] ,
depends : exec )
2018-09-12 11:08:49 +02:00
endif
2017-04-13 11:52:05 -04:00
endforeach
############################################################
2019-05-07 20:46:36 +02:00
check_directives_sh = find_program ( 'tools/check-directives.sh' )
if want_tests != 'false'
test ( 'check-directives' ,
check_directives_sh ,
2022-05-02 11:12:34 +02:00
suite : 'dist-check' ,
2021-04-02 19:51:44 +02:00
args : [ project_source_root , project_build_root ] )
2019-05-07 20:46:36 +02:00
endif
############################################################
2018-03-14 14:27:04 +01:00
# Enable tests for all supported sanitizers
foreach tuple : sanitizers
sanitizer = tuple [ 0 ]
build = tuple [ 1 ]
2018-01-19 17:54:30 +11:00
2018-05-15 20:18:24 +09:00
if cc . has_link_argument ( '-fsanitize=@0@' . format ( sanitizer ) )
2018-03-14 14:27:04 +01:00
prev = ''
foreach p : fuzz_regression_tests
b = p . split ( '/' ) [ - 2 ]
c = p . split ( '/' ) [ - 1 ]
2018-01-19 17:54:30 +11:00
2018-03-14 14:27:04 +01:00
name = '@0@:@1@' . format ( b , sanitizer )
2018-01-19 17:54:30 +11:00
2018-03-14 14:27:04 +01:00
if name != prev
if want_tests == 'false'
message ( 'Not compiling @0@ because tests is set to false' . format ( name ) )
2020-11-13 15:22:07 +09:00
elif fuzz_tests
2018-03-14 14:27:04 +01:00
exe = custom_target (
name ,
output : name ,
depends : build ,
2021-05-14 14:16:17 +02:00
command : [ ln , '-fs' ,
2021-07-27 19:32:35 +02:00
build . full_path ( ) / b ,
2018-03-14 14:27:04 +01:00
'@OUTPUT@' ] ,
build_by_default : true )
else
2020-11-13 15:22:07 +09:00
message ( 'Not compiling @0@ because fuzz-tests is set to false' . format ( name ) )
2018-03-14 14:27:04 +01:00
endif
endif
prev = name
2020-11-13 15:22:07 +09:00
if fuzz_tests
2020-12-02 18:05:06 +09:00
test ( '@0@_@1@_@2@' . format ( b , c , sanitizer ) ,
2018-03-14 14:27:04 +01:00
env ,
2022-05-02 11:12:34 +02:00
suite : 'fuzz+san' ,
2020-05-20 11:33:12 +02:00
env : [ 'UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1' ] ,
timeout : 60 ,
2018-03-14 14:27:04 +01:00
args : [ exe . full_path ( ) ,
2021-07-27 19:32:35 +02:00
project_source_root / p ] )
2018-03-14 14:27:04 +01:00
endif
endforeach
2018-01-19 17:54:30 +11:00
endif
endforeach
2018-03-14 14:27:04 +01:00
2018-01-19 17:54:30 +11:00
############################################################
2017-07-03 12:42:29 -04:00
if git . found ( )
2017-04-17 19:25:00 -04:00
all_files = run_command (
2021-05-14 14:16:17 +02:00
env , '-u' , 'GIT_WORK_TREE' ,
git , '--git-dir=@0@/.git' . format ( project_source_root ) ,
2021-11-17 13:58:53 +01:00
'ls-files' , ':/*.[ch]' ,
check : false )
if all_files . returncode ( ) == 0
all_files = files ( all_files . stdout ( ) . split ( ) )
2021-01-08 20:27:48 +01:00
2021-11-17 13:58:53 +01:00
custom_target (
'tags' ,
output : 'tags' ,
command : [ env , 'etags' , '-o' , '@0@/TAGS' . format ( project_source_root ) ] + all_files )
run_target (
'ctags' ,
2022-01-16 06:06:15 +00:00
command : [ env , 'ctags' , '--tag-relative=never' , '-o' , '@0@/tags' . format ( project_source_root ) ] + all_files )
2021-11-17 13:58:53 +01:00
endif
2017-04-06 14:33:27 -04:00
endif
2017-04-15 00:16:23 -04:00
if git . found ( )
2020-05-07 13:54:10 +02:00
git_contrib_sh = find_program ( 'tools/git-contrib.sh' )
2017-04-17 19:48:20 -04:00
run_target (
2017-04-17 19:25:00 -04:00
'git-contrib' ,
2020-05-07 13:54:10 +02:00
command : [ git_contrib_sh ] )
2017-04-15 00:16:23 -04:00
endif
2017-04-24 19:28:05 -04:00
if git . found ( )
git_head = run_command (
2021-11-17 13:58:53 +01:00
git , '--git-dir=@0@/.git' . format ( project_source_root ) ,
'rev-parse' , 'HEAD' ,
check : false ) . stdout ( ) . strip ( )
2017-04-24 19:28:05 -04:00
git_head_short = run_command (
2021-11-17 13:58:53 +01:00
git , '--git-dir=@0@/.git' . format ( project_source_root ) ,
'rev-parse' , '--short=7' , 'HEAD' ,
check : false ) . stdout ( ) . strip ( )
2017-04-24 19:28:05 -04:00
run_target (
'git-snapshot' ,
2021-05-14 14:16:17 +02:00
command : [ git , 'archive' ,
2019-02-27 11:19:07 -05:00
'-o' , '@0@/systemd-@1@.tar.gz' . format ( project_source_root ,
2017-04-24 19:28:05 -04:00
git_head_short ) ,
'--prefix' , 'systemd-@0@/' . format ( git_head ) ,
'HEAD' ] )
endif
2017-04-27 20:54:52 -04:00
############################################################
2020-05-07 13:54:10 +02:00
check_api_docs_sh = find_program ( 'tools/check-api-docs.sh' )
2017-12-20 12:51:14 +01:00
run_target (
'check-api-docs' ,
depends : [ man , libsystemd , libudev ] ,
2020-05-07 13:54:10 +02:00
command : [ check_api_docs_sh , libsystemd . full_path ( ) , libudev . full_path ( ) ] )
2017-12-20 12:51:14 +01:00
2021-07-27 20:11:41 +02:00
alias_target ( 'update-dbus-docs' , update_dbus_docs )
alias_target ( 'update-man-rules' , update_man_rules )
2021-01-27 09:10:25 +01:00
2022-02-08 13:19:52 +00:00
if not meson . is_cross_build ( )
custom_target (
'export-dbus-interfaces' ,
2022-05-16 04:05:51 +09:00
output : fs . name ( dbus_interfaces_dir ) ,
2022-02-08 13:19:52 +00:00
install : dbus_interfaces_dir != 'no' ,
2022-05-16 04:05:51 +09:00
install_dir : fs . parent ( dbus_interfaces_dir ) ,
2022-02-08 13:19:52 +00:00
command : [ export_dbus_interfaces_py , '@OUTPUT@' , dbus_programs ] )
endif
2021-07-24 10:30:42 +03:00
2017-12-20 12:51:14 +01:00
############################################################
2017-04-27 20:54:52 -04:00
2021-11-17 13:58:53 +01:00
alt_time_epoch = run_command ( 'date' , '-Is' , '-u' , '-d' , '@@0@' . format ( time_epoch ) ,
check : true ) . stdout ( ) . strip ( )
2021-07-28 10:04:01 +02:00
summary ( {
'split /usr' : split_usr ,
'split bin-sbin' : split_bin ,
'prefix directory' : prefixdir ,
'rootprefix directory' : rootprefixdir ,
'sysconf directory' : sysconfdir ,
'include directory' : includedir ,
'lib directory' : libdir ,
'rootlib directory' : rootlibdir ,
'SysV init scripts' : sysvinit_path ,
'SysV rc?.d directories' : sysvrcnd_path ,
'PAM modules directory' : pamlibdir ,
'PAM configuration directory' : pamconfdir ,
'libcryptsetup plugins directory' : libcryptsetup_plugins_dir ,
'RPM macros directory' : rpmmacrosdir ,
'modprobe.d directory' : modprobedir ,
'D-Bus policy directory' : dbuspolicydir ,
'D-Bus session directory' : dbussessionservicedir ,
'D-Bus system directory' : dbussystemservicedir ,
2021-12-26 10:44:52 +09:00
'D-Bus interfaces directory' : dbus_interfaces_dir ,
2021-07-28 10:04:01 +02:00
'bash completions directory' : bashcompletiondir ,
'zsh completions directory' : zshcompletiondir ,
2021-12-14 18:03:06 +01:00
'private shared lib version tag' : shared_lib_tag ,
2021-07-28 10:04:01 +02:00
'extra start script' : get_option ( 'rc-local' ) ,
'debug shell' : '@0@ @ @1@' . format ( get_option ( 'debug-shell' ) ,
get_option ( 'debug-tty' ) ) ,
'system UIDs' : '<=@0@ (alloc >=@1@)' . format ( conf . get ( 'SYSTEM_UID_MAX' ) ,
conf . get ( 'SYSTEM_ALLOC_UID_MIN' ) ) ,
'system GIDs' : '<=@0@ (alloc >=@1@)' . format ( conf . get ( 'SYSTEM_GID_MAX' ) ,
conf . get ( 'SYSTEM_ALLOC_GID_MIN' ) ) ,
'dynamic UIDs' : '@0@…@1@' . format ( dynamic_uid_min , dynamic_uid_max ) ,
'container UID bases' : '@0@…@1@' . format ( container_uid_base_min , container_uid_base_max ) ,
'static UID/GID allocations' : ' ' . join ( static_ugids ) ,
'/dev/kvm access mode' : get_option ( 'dev-kvm-mode' ) ,
'render group access mode' : get_option ( 'group-render-mode' ) ,
'certificate root directory' : get_option ( 'certificate-root' ) ,
'support URL' : support_url ,
'nobody user name' : nobody_user ,
'nobody group name' : nobody_group ,
'fallback hostname' : get_option ( 'fallback-hostname' ) ,
2022-04-27 20:47:38 +09:00
'default compression method' : compression ,
2021-07-28 10:04:01 +02:00
'default DNSSEC mode' : default_dnssec ,
'default DNS-over-TLS mode' : default_dns_over_tls ,
'default mDNS mode' : default_mdns ,
'default LLMNR mode' : default_llmnr ,
'default DNS servers' : dns_servers . split ( ' ' ) ,
'default NTP servers' : ntp_servers . split ( ' ' ) ,
'default cgroup hierarchy' : default_hierarchy ,
'default net.naming-scheme value' : default_net_naming_scheme ,
'default KillUserProcesses value' : kill_user_processes ,
'default locale' : default_locale ,
2022-06-27 12:46:57 +09:00
'default nspawn locale' : nspawn_locale ,
2022-06-09 20:32:22 +02:00
'default status unit format' : status_unit_format_default ,
2021-07-28 10:04:01 +02:00
'default user $PATH' :
default_user_path != '' ? default_user_path : '(same as system services)' ,
'systemd service watchdog' : service_watchdog == '' ? 'disabled' : service_watchdog ,
'time epoch' : '@0@ (@1@)' . format ( time_epoch , alt_time_epoch ) } )
2017-04-27 20:54:52 -04:00
# TODO:
# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
found = [ ]
missing = [ ]
foreach tuple : [
2021-04-15 10:59:03 +02:00
# dependencies
[ 'ACL' ] ,
2017-04-27 20:54:52 -04:00
[ 'AUDIT' ] ,
[ 'AppArmor' ] ,
2021-04-15 10:59:03 +02:00
[ 'IMA' ] ,
[ 'PAM' ] ,
2017-04-27 20:54:52 -04:00
[ 'SECCOMP' ] ,
2021-04-15 10:59:03 +02:00
[ 'SELinux' ] ,
2017-04-27 20:54:52 -04:00
[ 'SMACK' ] ,
2021-04-15 10:59:03 +02:00
[ 'blkid' ] ,
[ 'elfutils' ] ,
[ 'gcrypt' ] ,
[ 'gnutls' ] ,
2020-11-13 17:08:15 -08:00
[ 'libbpf' ] ,
2021-04-15 10:59:03 +02:00
[ 'libcryptsetup' ] ,
2021-03-16 20:13:28 +01:00
[ 'libcryptsetup-plugins' ] ,
2021-04-15 10:59:03 +02:00
[ 'libcurl' ] ,
[ 'libfdisk' ] ,
[ 'libfido2' ] ,
[ 'libidn' ] ,
[ 'libidn2' ] ,
[ 'libiptc' ] ,
[ 'microhttpd' ] ,
[ 'openssl' ] ,
[ 'p11kit' ] ,
[ 'pcre2' ] ,
[ 'pwquality' ] ,
[ 'qrencode' ] ,
[ 'tpm2' ] ,
[ 'xkbcommon' ] ,
# compression libs
2020-04-12 01:09:05 +02:00
[ 'zstd' ] ,
2017-04-27 20:54:52 -04:00
[ 'lz4' ] ,
2021-04-15 10:59:03 +02:00
[ 'xz' ] ,
[ 'zlib' ] ,
2017-04-27 20:54:52 -04:00
[ 'bzip2' ] ,
2021-04-15 10:59:03 +02:00
# components
2017-04-27 20:54:52 -04:00
[ 'backlight' ] ,
2021-04-15 10:59:03 +02:00
[ 'binfmt' ] ,
2022-07-27 15:28:09 -06:00
[ 'bpf-framework' , conf . get ( 'BPF_FRAMEWORK' ) == 1 ] ,
2017-04-27 20:54:52 -04:00
[ 'coredump' ] ,
2021-04-15 10:59:03 +02:00
[ 'environment.d' ] ,
2017-04-27 20:54:52 -04:00
[ 'efi' ] ,
2021-11-08 13:04:45 +01:00
[ 'gnu-efi' ] ,
2021-04-15 10:59:03 +02:00
[ 'firstboot' ] ,
[ 'hibernate' ] ,
[ 'homed' ] ,
[ 'hostnamed' ] ,
[ 'hwdb' ] ,
[ 'importd' ] ,
[ 'initrd' ] ,
2022-03-31 11:17:10 +02:00
[ 'kernel-install' ] ,
2021-04-15 10:59:03 +02:00
[ 'localed' ] ,
2017-04-27 20:54:52 -04:00
[ 'logind' ] ,
[ 'machined' ] ,
[ 'networkd' ] ,
2018-08-07 18:10:53 +02:00
[ 'nss-myhostname' ] ,
[ 'nss-mymachines' ] ,
[ 'nss-resolve' ] ,
[ 'nss-systemd' ] ,
2021-04-15 10:59:03 +02:00
[ 'oomd' ] ,
[ 'portabled' ] ,
[ 'pstore' ] ,
[ 'quotacheck' ] ,
[ 'randomseed' ] ,
[ 'repart' ] ,
[ 'resolve' ] ,
[ 'rfkill' ] ,
[ 'sysext' ] ,
2022-07-27 15:28:09 -06:00
[ 'systemd-analyze' , conf . get ( 'ENABLE_ANALYZE' ) == 1 ] ,
2020-12-28 15:17:54 +01:00
[ 'sysupdate' ] ,
2021-04-15 10:59:03 +02:00
[ 'sysusers' ] ,
[ 'timedated' ] ,
[ 'timesyncd' ] ,
[ 'tmpfiles' ] ,
[ 'userdb' ] ,
[ 'vconsole' ] ,
[ 'xdg-autostart' ] ,
# optional features
[ 'idn' ] ,
[ 'polkit' ] ,
[ 'nscd' ] ,
2022-07-27 15:28:09 -06:00
[ 'legacy-pkla' , install_polkit_pkla ] ,
2021-04-15 10:59:03 +02:00
[ 'kmod' ] ,
[ 'dbus' ] ,
[ 'glib' ] ,
2017-04-27 20:54:52 -04:00
[ 'tpm' ] ,
2022-07-27 15:28:09 -06:00
[ 'man pages' , want_man ] ,
[ 'html pages' , want_html ] ,
[ 'man page indices' , want_man and have_lxml ] ,
2017-04-27 20:54:52 -04:00
[ 'SysV compat' ] ,
2021-04-15 10:59:03 +02:00
[ 'compat-mutable-uid-boundaries' ] ,
2017-04-27 20:54:52 -04:00
[ 'utmp' ] ,
[ 'ldconfig' ] ,
2022-07-27 15:28:09 -06:00
[ 'adm group' , get_option ( 'adm-group' ) ] ,
[ 'wheel group' , get_option ( 'wheel-group' ) ] ,
2017-05-09 14:02:37 +02:00
[ 'gshadow' ] ,
2017-04-27 20:54:52 -04:00
[ 'debug hashmap' ] ,
[ 'debug mmap cache' ] ,
2018-11-23 00:36:35 +09:00
[ 'debug siphash' ] ,
2022-07-27 15:28:09 -06:00
[ 'valgrind' , conf . get ( 'VALGRIND' ) == 1 ] ,
[ 'trace logging' , conf . get ( 'LOG_TRACE' ) == 1 ] ,
[ 'install tests' , install_tests ] ,
[ 'link-udev-shared' , get_option ( 'link-udev-shared' ) ] ,
[ 'link-systemctl-shared' , get_option ( 'link-systemctl-shared' ) ] ,
[ 'link-networkd-shared' , get_option ( 'link-networkd-shared' ) ] ,
[ 'link-timesyncd-shared' , get_option ( 'link-timesyncd-shared' ) ] ,
[ 'link-journalctl-shared' , get_option ( 'link-journalctl-shared' ) ] ,
[ 'link-boot-shared' , get_option ( 'link-boot-shared' ) ] ,
2020-03-23 12:25:19 -04:00
[ 'first-boot-full-preset' ] ,
2020-11-06 15:01:13 +01:00
[ 'fexecve' ] ,
2022-07-27 15:28:09 -06:00
[ 'standalone-binaries' , get_option ( 'standalone-binaries' ) ] ,
[ 'coverage' , get_option ( 'b_coverage' ) ] ,
2017-04-27 20:54:52 -04:00
]
2018-03-09 14:21:08 +01:00
if tuple . length ( ) > = 2
cond = tuple [ 1 ]
else
2017-04-27 20:54:52 -04:00
ident1 = 'HAVE_' + tuple [ 0 ] . underscorify ( ) . to_upper ( )
ident2 = 'ENABLE_' + tuple [ 0 ] . underscorify ( ) . to_upper ( )
2017-10-03 10:41:51 +02:00
cond = conf . get ( ident1 , 0 ) == 1 or conf . get ( ident2 , 0 ) == 1
2017-04-27 20:54:52 -04:00
endif
if cond
2018-07-31 09:44:11 +02:00
found + = tuple [ 0 ]
2017-04-27 20:54:52 -04:00
else
2018-07-31 09:44:11 +02:00
missing + = tuple [ 0 ]
2017-04-27 20:54:52 -04:00
endif
endforeach
2021-04-15 09:56:06 +02:00
if static_libsystemd == 'false'
missing + = 'static-libsystemd'
else
found + = 'static-libsystemd(@0@)' . format ( static_libsystemd )
endif
if static_libudev == 'false'
missing + = 'static-libudev'
else
found + = 'static-libudev(@0@)' . format ( static_libudev )
endif
2021-11-02 09:44:12 +01:00
if conf . get ( 'HAVE_OPENSSL_OR_GCRYPT' ) == 1 and conf . get ( 'PREFER_OPENSSL' ) == 1
found + = 'cryptolib(openssl)'
elif conf . get ( 'HAVE_OPENSSL_OR_GCRYPT' ) == 1
found + = 'cryptolib(gcrypt)'
else
missing + = 'cryptolib'
endif
2021-04-15 11:04:14 +02:00
if conf . get ( 'DNS_OVER_TLS_USE_GNUTLS' ) == 1
found + = 'DNS-over-TLS(gnutls)'
elif conf . get ( 'DNS_OVER_TLS_USE_OPENSSL' ) == 1
found + = 'DNS-over-TLS(openssl)'
else
missing + = 'DNS-over-TLS'
endif
2021-07-28 10:04:01 +02:00
summary ( {
'enabled' : ', ' . join ( found ) ,
'disabled' : ', ' . join ( missing ) } ,
section : 'Features' )
2017-11-28 21:46:53 +01:00
if rootprefixdir != rootprefix_default
2018-05-10 14:50:52 +09:00
warning ( '\n' +
'Note that the installation prefix was changed to "@0@".\n' . format ( rootprefixdir ) +
'systemd used fixed names for unit file directories and other paths, so anything\n' +
'except the default ("@0@") is strongly discouraged.' . format ( rootprefix_default ) )
2017-11-28 21:46:53 +01:00
endif