X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=meson.build;h=ccea9457209b7e82f9f46f135c1109ed82100325;hb=f98c25850fa5eaad815d7ea2cf51f5795ab43d42;hp=554e67e5dd0c1f571eedec9d9ad0c5019f8f0d63;hpb=29088d374ebd5f9c210e4cc8f04155f0292295de;p=thirdparty%2Fsystemd.git diff --git a/meson.build b/meson.build index 554e67e5dd0..ccea9457209 100644 --- a/meson.build +++ b/meson.build @@ -27,6 +27,13 @@ substs = configuration_data() substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd') substs.set('PACKAGE_VERSION', meson.project_version()) +want_ossfuzz = get_option('oss-fuzz') +want_libfuzzer = get_option('llvm-fuzz') +if want_ossfuzz and want_libfuzzer + error('only one of oss-fuzz and llvm-fuzz can be specified') +endif +fuzzer_build = want_ossfuzz or want_libfuzzer + ##################################################################### # Try to install the git pre-commit hook @@ -66,6 +73,10 @@ sysvrcnd_path = get_option('sysvrcnd-path') conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '', description : 'SysV init scripts and rcN.d links are supported') +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')) +conf.set('HIGH_RLIMIT_NOFILE', 256*1024) + # join_paths ignore the preceding arguments if an absolute component is # encountered, so this should canonicalize various paths when they are # absolute or relative. @@ -220,7 +231,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('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'true' : 'false') +conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default) conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no') substs.set('prefix', prefixdir) @@ -262,6 +273,7 @@ substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no') +substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE')) ##################################################################### @@ -274,22 +286,18 @@ want_tests = get_option('tests') slow_tests = want_tests != 'false' and get_option('slow-tests') install_tests = get_option('install-tests') -cxx = find_program('c++', required : false) +cxx = find_program('c++', required : fuzzer_build) if cxx.found() # Used only for tests add_languages('cpp') + cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array()) +else + cxx_cmd = '' endif -want_ossfuzz = get_option('oss-fuzz') -want_libfuzzer = get_option('llvm-fuzz') -fuzzer_build = want_ossfuzz or want_libfuzzer -if want_ossfuzz and want_libfuzzer - error('only one of oss-fuzz and llvm-fuzz can be specified') -endif if want_libfuzzer fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer') -endif -if want_ossfuzz +elif want_ossfuzz fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine') endif @@ -447,7 +455,7 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'], ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'], ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], - ['IFLA_BOND_AD_INFO', 'linux/if_link.h'], + ['IFLA_BOND_AD_ACTOR_SYSTEM', 'linux/if_link.h'], ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'], ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], ['IFLA_VXLAN_GPE', 'linux/if_link.h'], @@ -468,7 +476,6 @@ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'], ['FOU_ATTR_REMCSUM_NOPARTIAL', 'linux/fou.h'], ['FOU_CMD_GET', 'linux/fou.h'], - ['FOU_ENCAP_GUE', 'linux/fou.h'], ] prefix = decl.length() > 2 ? decl[2] : '' have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) @@ -600,6 +607,7 @@ if not cc.has_header('sys/capability.h') endif foreach header : ['crypt.h', 'linux/btrfs.h', + 'linux/fou.h', 'linux/memfd.h', 'linux/vm_sockets.h', 'sys/auxv.h', @@ -1084,6 +1092,7 @@ conf.set10('HAVE_XZ', have) want_lz4 = get_option('lz4') if want_lz4 != 'false' and not fuzzer_build liblz4 = dependency('liblz4', + version : '>= 1.3.0', required : want_lz4 == 'true') have = liblz4.found() else @@ -1179,7 +1188,9 @@ if dns_over_tls != 'false' endif have = have_gnutls or have_openssl else - have = have_gnutls = have_openssl = false + have = false + have_gnutls = false + have_openssl = false endif conf.set10('ENABLE_DNS_OVER_TLS', have) conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls) @@ -1352,6 +1363,7 @@ includes = include_directories('src/basic', 'src/core', 'src/libsystemd/sd-bus', 'src/libsystemd/sd-device', + 'src/libsystemd/sd-event', 'src/libsystemd/sd-hwdb', 'src/libsystemd/sd-id128', 'src/libsystemd/sd-netlink', @@ -1380,7 +1392,7 @@ libjournal_core = static_library( libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) libsystemd = shared_library( 'systemd', - 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug + disable_mempool_c, version : libsystemd_version, include_directories : includes, link_args : ['-shared', @@ -1406,6 +1418,7 @@ install_libsystemd_static = static_library( journal_client_sources, basic_sources, basic_gcrypt_sources, + disable_mempool_c, include_directories : includes, build_by_default : static_libsystemd != 'false', install : static_libsystemd != 'false', @@ -1462,6 +1475,7 @@ subdir('test') test_dlopen = executable( 'test-dlopen', test_dlopen_c, + disable_mempool_c, include_directories : includes, link_with : [libbasic], dependencies : [libdl], @@ -1482,6 +1496,7 @@ foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'], nss = shared_library( 'nss_' + module, 'src/nss-@0@/nss-@0@.c'.format(module), + disable_mempool_c, version : '2', include_directories : includes, # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned @@ -1756,15 +1771,15 @@ if conf.get('ENABLE_LOGIND') == 1 args : pam_systemd.full_path()) endif endif -endif -executable('systemd-user-runtime-dir', - user_runtime_dir_sources, - include_directories : includes, - link_with : [libshared, liblogind_core], - install_rpath : rootlibexecdir, - install : true, - install_dir : rootlibexecdir) + executable('systemd-user-runtime-dir', + user_runtime_dir_sources, + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) +endif if conf.get('HAVE_PAM') == 1 executable('systemd-user-sessions', @@ -1785,8 +1800,34 @@ if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1 install_rpath : rootlibexecdir, install : true) public_programs += exe + + executable('systemd-bless-boot', + 'src/boot/bless-boot.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libblkid], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + + executable('systemd-bless-boot-generator', + 'src/boot/bless-boot-generator.c', + include_directories : includes, + link_with : [libshared], + install_rpath : rootlibexecdir, + install : true, + install_dir : systemgeneratordir) endif +executable('systemd-boot-check-no-failures', + 'src/boot/boot-check-no-failures.c', + include_directories : includes, + link_with : [libshared], + dependencies : [libblkid], + install_rpath : rootlibexecdir, + install : true, + install_dir : rootlibexecdir) + exe = executable('systemd-socket-activate', 'src/activate/activate.c', include_directories : includes, link_with : [libshared], @@ -1834,7 +1875,7 @@ if conf.get('ENABLE_PORTABLED') == 1 dependencies : [threads], install_rpath : rootlibexecdir, install : true, - install_dir : rootlibexecdir) + install_dir : rootbindir) public_programs += exe endif @@ -2730,6 +2771,7 @@ endif fuzzer_exes = [] +if get_option('tests') != 'false' foreach tuple : fuzzers sources = tuple[0] link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] @@ -2754,6 +2796,7 @@ foreach tuple : fuzzers c_args : defs, install : false) endforeach +endif run_target('fuzzers', depends : fuzzer_exes, @@ -2779,12 +2822,9 @@ subdir('shell-completion/zsh') subdir('docs/sysvinit') subdir('docs/var-log') -# FIXME: figure out if the warning is true: -# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir install_subdir('factory/etc', install_dir : factorydir) - install_data('xorg/50-systemd-user.sh', install_dir : xinitrcdir) install_data('modprobe.d/systemd.conf', @@ -2793,10 +2833,10 @@ install_data('LICENSE.GPL2', 'LICENSE.LGPL2.1', 'NEWS', 'README', - 'docs/CODING_STYLE', + 'docs/CODING_STYLE.md', 'docs/DISTRO_PORTING.md', 'docs/ENVIRONMENT.md', - 'docs/HACKING', + 'docs/HACKING.md', 'docs/TRANSIENT-SETTINGS.md', 'docs/TRANSLATORS.md', 'docs/UIDS-GIDS.md', @@ -2981,6 +3021,10 @@ alt_time_epoch = run_command('date', '-Is', '-u', '-d', status += [ 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)] +status += [ + 'static libsystemd: @0@'.format(static_libsystemd), + 'static libudev: @0@'.format(static_libudev)] + # TODO: # CFLAGS: ${OUR_CFLAGS} ${CFLAGS} # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} @@ -3080,6 +3124,8 @@ foreach tuple : [ ['debug mmap cache'], ['valgrind', conf.get('VALGRIND') == 1], ['trace logging', conf.get('LOG_TRACE') == 1], + ['link-udev-shared', get_option('link-udev-shared')], + ['link-systemctl-shared', get_option('link-systemctl-shared')], ] if tuple.length() >= 2