X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=meson.build;h=209971cc100fa9b423d208f594d9aa7f491d9946;hb=ad300028858e34dfdd2b369ef808cdb588be924a;hp=54820d3f6a876ac510edca4e90400a70173c7933;hpb=d2b45da40a547ddc5e85a79a7798ca19bc43d25c;p=thirdparty%2Fsystemd.git diff --git a/meson.build b/meson.build index 54820d3f6a8..209971cc100 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1+ project('systemd', 'c', - version : '244', + version : '245', license : 'LGPLv2+', default_options: [ 'c_std=gnu99', @@ -13,19 +13,21 @@ project('systemd', 'c', meson_version : '>= 0.46', ) -libsystemd_version = '0.27.1' -libudev_version = '1.6.16' +libsystemd_version = '0.28.0' +libudev_version = '1.6.17' # We need the same data in two different formats, ugh! # Also, for hysterical reasons, we use different variable # names, sometimes. Not all variables are included in every # set. Ugh, ugh, ugh! conf = configuration_data() -conf.set('PROJECT_VERSION', meson.project_version()) +conf.set('PROJECT_VERSION', meson.project_version(), + description : 'Numerical project version (used where a simple number is expected)') substs = configuration_data() substs.set('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd') -substs.set('PROJECT_VERSION', meson.project_version()) +substs.set('PROJECT_VERSION', meson.project_version(), + description : 'Numerical project version (used where a simple number is expected)') # 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 @@ -37,20 +39,22 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path) want_ossfuzz = get_option('oss-fuzz') want_libfuzzer = get_option('llvm-fuzz') -want_fuzzbuzz = get_option('fuzzbuzz') -if want_ossfuzz + want_libfuzzer + want_fuzzbuzz > 1 - error('only one of oss-fuzz, llvm-fuzz or fuzzbuzz can be specified') +if want_ossfuzz + want_libfuzzer > 1 + error('only one of oss-fuzz or llvm-fuzz can be specified') endif skip_deps = want_ossfuzz or want_libfuzzer -fuzzer_build = want_ossfuzz or want_libfuzzer or want_fuzzbuzz +fuzzer_build = want_ossfuzz or want_libfuzzer ##################################################################### # Try to install the git pre-commit hook -git_hook = run_command(join_paths(project_source_root, 'tools/add-git-hook.sh')) -if git_hook.returncode() == 0 - message(git_hook.stdout().strip()) +add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false) +if add_git_hook_sh.found() + git_hook = run_command(add_git_hook_sh) + if git_hook.returncode() == 0 + message(git_hook.stdout().strip()) + endif endif ##################################################################### @@ -194,7 +198,7 @@ memory_accounting_default = get_option('memory-accounting-default') status_unit_format_default = get_option('status-unit-format-default') conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) -conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system')) +conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', join_paths(pkgsysconfdir, 'system')) conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) @@ -202,8 +206,8 @@ conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-loc conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper()) -conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user')) -conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) +conf.set_quoted('USER_CONFIG_UNIT_DIR', join_paths(pkgsysconfdir, 'user')) +conf.set_quoted('USER_DATA_UNIT_DIR', userunitdir) conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) @@ -212,7 +216,6 @@ conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlib conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs')) conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs')) conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) -conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep')) conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge')) @@ -220,10 +223,10 @@ conf.set_quoted('ROOTPREFIX', rootprefixdir) conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup')) -conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) -conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) -conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) -conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) +conf.set_quoted('SYSTEM_GENERATOR_DIR', systemgeneratordir) +conf.set_quoted('USER_GENERATOR_DIR', usergeneratordir) +conf.set_quoted('SYSTEM_ENV_GENERATOR_DIR', systemenvgeneratordir) +conf.set_quoted('USER_ENV_GENERATOR_DIR', userenvgeneratordir) conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map')) @@ -243,6 +246,7 @@ conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlib conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg')) conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg')) conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd')) +conf.set_quoted('SYSTEMD_HOMEWORK_PATH', join_paths(rootlibexecdir, 'systemd-homework')) conf.set_quoted('SYSTEMD_USERWORK_PATH', join_paths(rootlibexecdir, 'systemd-userwork')) conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default) conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no') @@ -320,8 +324,6 @@ if want_libfuzzer endif elif want_ossfuzz fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine') -elif want_fuzzbuzz - fuzzing_engine = meson.get_compiler('cpp').find_library(get_option('fuzzbuzz-engine'), dirs: get_option('fuzzbuzz-engine-dir')) endif # Those generate many false positives, and we do not want to change the code to @@ -448,9 +450,6 @@ conf.set('_GNU_SOURCE', true) conf.set('__SANE_USERSPACE_TYPES__', true) conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation) -conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include ')) -conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include ')) -conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include ')) conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include ')) conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include ')) conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include ')) @@ -884,6 +883,16 @@ else endif conf.set10('HAVE_LIBFDISK', have) +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) + want_seccomp = get_option('seccomp') if want_seccomp != 'false' and not skip_deps libseccomp = dependency('libseccomp', @@ -1011,6 +1020,9 @@ if want_libcryptsetup != 'false' and not skip_deps version : '>= 2.0.1', required : want_libcryptsetup == 'true') have = libcryptsetup.found() + + conf.set10('HAVE_CRYPT_SET_METADATA_SIZE', + have and cc.has_function('crypt_set_metadata_size', dependencies : libcryptsetup)) else have = false libcryptsetup = [] @@ -1290,6 +1302,16 @@ conf.set('DEFAULT_DNS_OVER_TLS_MODE', 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper()) substs.set('DEFAULT_DNS_OVER_TLS_MODE', default_dns_over_tls) +default_mdns = get_option('default-mdns') +conf.set('DEFAULT_MDNS_MODE', + 'RESOLVE_SUPPORT_' + default_mdns.to_upper()) +substs.set('DEFAULT_MDNS_MODE', default_mdns) + +default_llmnr = get_option('default-llmnr') +conf.set('DEFAULT_LLMNR_MODE', + 'RESOLVE_SUPPORT_' + default_llmnr.to_upper()) +substs.set('DEFAULT_LLMNR_MODE', default_llmnr) + want_repart = get_option('repart') if want_repart != 'false' have = (conf.get('HAVE_OPENSSL') == 1 and @@ -1316,6 +1338,22 @@ else endif conf.set10('ENABLE_IMPORTD', have) +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) + +have = have and conf.get('HAVE_PAM') == 1 +conf.set10('ENABLE_PAM_HOME', have) + want_remote = get_option('remote') if want_remote != 'false' have_deps = [conf.get('HAVE_MICROHTTPD') == 1, @@ -1564,6 +1602,7 @@ subdir('src/locale') subdir('src/machine') subdir('src/portable') subdir('src/userdb') +subdir('src/home') subdir('src/nspawn') subdir('src/resolve') subdir('src/timedate') @@ -1675,7 +1714,7 @@ exe = executable('systemd-analyze', libmount, libblkid], install_rpath : rootlibexecdir, - install : true) + install : get_option('analyze')) public_programs += exe executable('systemd-journald', @@ -2034,6 +2073,68 @@ if conf.get('ENABLE_USERDB') == 1 install_dir : rootbindir) endif +if conf.get('ENABLE_HOMED') == 1 + executable('systemd-homework', + systemd_homework_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcryptsetup, + libblkid, + libcrypt, + libopenssl, + libfdisk, + libp11kit], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + + executable('systemd-homed', + systemd_homed_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcrypt, + libopenssl, + libpwquality], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + + executable('homectl', + homectl_sources, + include_directories : includes, + link_with : [libshared], + dependencies : [threads, + libcrypt, + libopenssl, + libp11kit, + libpwquality], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootbindir) + + if conf.get('HAVE_PAM') == 1 + version_script_arg = join_paths(project_source_root, pam_systemd_home_sym) + pam_systemd = shared_library( + '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, + install_dir : pamlibdir) + endif +endif + foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit'] meson.add_install_script(meson_make_symlink, join_paths(rootbindir, 'systemctl'), @@ -2200,10 +2301,19 @@ if conf.get('ENABLE_TIMEDATECTL') == 1 endif if conf.get('ENABLE_TIMESYNCD') == 1 + if get_option('link-timesyncd-shared') + timesyncd_link_with = [libshared] + else + timesyncd_link_with = [libsystemd_static, + libshared_static, + libjournal_client, + libbasic_gcrypt] + endif + executable('systemd-timesyncd', systemd_timesyncd_sources, include_directories : includes, - link_with : [libshared], + link_with : [timesyncd_link_with], dependencies : [threads, libm], install_rpath : rootlibexecdir, @@ -2213,7 +2323,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1 executable('systemd-time-wait-sync', 'src/time-wait-sync/time-wait-sync.c', include_directories : includes, - link_with : [libshared], + link_with : [timesyncd_link_with], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) @@ -2406,7 +2516,7 @@ if conf.get('ENABLE_BINFMT') == 1 endif if conf.get('ENABLE_REPART') == 1 - executable('systemd-repart', + exe = executable('systemd-repart', systemd_repart_sources, include_directories : includes, link_with : [libshared], @@ -2418,6 +2528,12 @@ if conf.get('ENABLE_REPART') == 1 install_rpath : rootlibexecdir, install : true, install_dir : rootbindir) + + if want_tests != 'false' + test('test-repart', + test_repart_sh, + args : exe.full_path()) + endif endif if conf.get('ENABLE_VCONSOLE') == 1 @@ -2862,13 +2978,20 @@ if conf.get('ENABLE_NETWORKD') == 1 install_dir : rootbindir) public_programs += exe - executable('systemd-network-generator', + exe = executable('systemd-network-generator', network_generator_sources, include_directories : includes, link_with : [networkd_link_with], install_rpath : rootlibexecdir, install : true, install_dir : rootlibexecdir) + + if want_tests != 'false' + test('test-network-generator-conversion', + test_network_generator_conversion_sh, + # https://github.com/mesonbuild/meson/issues/2681 + args : exe.full_path()) + endif endif executable('systemd-sulogin-shell', @@ -2999,7 +3122,7 @@ foreach tuple : fuzzers incs = tuple.length() >= 5 ? tuple[4] : includes link_args = [] - if want_ossfuzz or want_fuzzbuzz + if want_ossfuzz dependencies += fuzzing_engine elif want_libfuzzer if fuzzing_engine.found() @@ -3011,10 +3134,6 @@ foreach tuple : fuzzers sources += 'src/fuzz/fuzz-main.c' endif - if want_fuzzbuzz - sources += 'src/fuzz/fuzzer-entry-point.c' - endif - name = sources[0].split('/')[-1].split('.')[0] fuzzer_exes += executable( @@ -3245,6 +3364,8 @@ status = [ 'default DNSSEC mode: @0@'.format(default_dnssec), 'default DNS-over-TLS mode: @0@'.format(default_dns_over_tls), + 'default mDNS mode: @0@'.format(default_mdns), + 'default LLMNR mode: @0@'.format(default_llmnr), 'default cgroup hierarchy: @0@'.format(default_hierarchy), 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme), 'default KillUserProcesses setting: @0@'.format(kill_user_processes), @@ -3279,8 +3400,8 @@ if conf.get('ENABLE_EFI') == 1 status += [ 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME), 'EFI CC @0@'.format(' '.join(efi_cc)), - 'EFI lib directory: @0@'.format(efi_libdir), - 'EFI lds directory: @0@'.format(efi_ldsdir), + 'EFI lds: @0@'.format(efi_lds), + 'EFI crt0: @0@'.format(efi_crt0), 'EFI include directory: @0@'.format(efi_incdir)] endif endif @@ -3291,6 +3412,8 @@ missing = [] foreach tuple : [ ['libcryptsetup'], ['PAM'], + ['pwquality'], + ['libfdisk'], ['p11kit'], ['AUDIT'], ['IMA'], @@ -3329,6 +3452,7 @@ foreach tuple : [ ['machined'], ['portabled'], ['userdb'], + ['homed'], ['importd'], ['hostnamed'], ['timedated'], @@ -3371,9 +3495,13 @@ foreach tuple : [ ['debug siphash'], ['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')], + ['kernel-install', get_option('kernel-install')], + ['systemd-analyze', get_option('analyze')], ] if tuple.length() >= 2