1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 project('systemd', 'c',
13 meson_version : '>= 0.53.2',
16 libsystemd_version = '0.32.0'
17 libudev_version = '1.7.2'
19 conf = configuration_data()
20 conf.set_quoted('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
21 conf.set('PROJECT_VERSION', meson.project_version(),
22 description : 'Numerical project version (used where a simple number is expected)')
24 # This is to be used instead of meson.source_root(), as the latter will return
25 # the wrong result when systemd is being built as a meson subproject
26 project_source_root = meson.current_source_dir()
27 project_build_root = meson.current_build_dir()
28 relative_source_path = run_command('realpath',
29 '--relative-to=@0@'.format(project_build_root),
31 check : true).stdout().strip()
32 conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
34 conf.set10('BUILD_MODE_DEVELOPER', get_option('mode') == 'developer',
35 description : 'tailor build to development or release builds')
37 want_ossfuzz = get_option('oss-fuzz')
38 want_libfuzzer = get_option('llvm-fuzz')
39 if want_ossfuzz and want_libfuzzer
40 error('only one of oss-fuzz or llvm-fuzz can be specified')
43 skip_deps = want_ossfuzz or want_libfuzzer
44 fuzzer_build = want_ossfuzz or want_libfuzzer
46 #####################################################################
48 # Try to install the git pre-commit hook
49 add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false)
50 if add_git_hook_sh.found()
51 git_hook = run_command(add_git_hook_sh, check : false)
52 if git_hook.returncode() == 0
53 message(git_hook.stdout().strip())
57 #####################################################################
60 if get_option('split-usr') == 'auto'
61 split_usr = not fs.is_symlink('/bin')
63 split_usr = get_option('split-usr') == 'true'
66 warning('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n'
67 + ' split-usr mode is going to be removed\n' +
68 '\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
70 conf.set10('HAVE_SPLIT_USR', split_usr,
71 description : '/usr/bin and /bin directories are separate')
73 if get_option('split-bin') == 'auto'
74 split_bin = not fs.is_symlink('/usr/sbin')
76 split_bin = get_option('split-bin') == 'true'
78 conf.set10('HAVE_SPLIT_BIN', split_bin,
79 description : 'bin and sbin directories are separate')
81 rootprefixdir = get_option('rootprefix')
82 # Unusual rootprefixdir values are used by some distros
83 # (see https://github.com/systemd/systemd/pull/7461).
84 rootprefix_default = split_usr ? '/' : '/usr'
85 if rootprefixdir == ''
86 rootprefixdir = rootprefix_default
88 rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
90 have_standalone_binaries = get_option('standalone-binaries')
92 sysvinit_path = get_option('sysvinit-path')
93 sysvrcnd_path = get_option('sysvrcnd-path')
94 conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',
95 description : 'SysV init scripts and rcN.d links are supported')
96 conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs'))
98 if get_option('hibernate') and not get_option('initrd')
99 error('hibernate depends on initrd')
102 conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
103 conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
104 conf.set('HIGH_RLIMIT_NOFILE', 512*1024)
106 # Meson ignores the preceding arguments when joining paths if an absolute
107 # component is encountered, so this should canonicalize various paths when they
108 # are absolute or relative.
109 prefixdir = get_option('prefix')
110 if not prefixdir.startswith('/')
111 error('Prefix is not absolute: "@0@"'.format(prefixdir))
113 if prefixdir != rootprefixdir and rootprefixdir != '/' and not prefixdir.strip('/').startswith(rootprefixdir.strip('/') + '/')
114 error('Prefix is not below root prefix (now rootprefix=@0@ prefix=@1@)'.format(
115 rootprefixdir, prefixdir))
118 bindir = prefixdir / get_option('bindir')
119 libdir = prefixdir / get_option('libdir')
120 sysconfdir = prefixdir / get_option('sysconfdir')
121 includedir = prefixdir / get_option('includedir')
122 datadir = prefixdir / get_option('datadir')
123 localstatedir = '/' / get_option('localstatedir')
125 rootbindir = rootprefixdir / 'bin'
126 rootsbindir = rootprefixdir / (split_bin ? 'sbin' : 'bin')
127 rootlibexecdir = rootprefixdir / 'lib/systemd'
129 rootlibdir = get_option('rootlibdir')
131 rootlibdir = rootprefixdir / libdir.split('/')[-1]
134 install_sysconfdir = get_option('install-sysconfdir') != 'false'
135 install_sysconfdir_samples = get_option('install-sysconfdir') == 'true'
136 # Dirs of external packages
137 pkgconfigdatadir = get_option('pkgconfigdatadir') != '' ? get_option('pkgconfigdatadir') : datadir / 'pkgconfig'
138 pkgconfiglibdir = get_option('pkgconfiglibdir') != '' ? get_option('pkgconfiglibdir') : libdir / 'pkgconfig'
139 polkitpolicydir = datadir / 'polkit-1/actions'
140 polkitrulesdir = datadir / 'polkit-1/rules.d'
141 polkitpkladir = localstatedir / 'lib/polkit-1/localauthority/10-vendor.d'
142 xinitrcdir = get_option('xinitrcdir') != '' ? get_option('xinitrcdir') : sysconfdir / 'X11/xinit/xinitrc.d'
143 rpmmacrosdir = get_option('rpmmacrosdir')
144 if rpmmacrosdir != 'no'
145 rpmmacrosdir = prefixdir / rpmmacrosdir
147 modprobedir = rootprefixdir / 'lib/modprobe.d'
150 pkgdatadir = datadir / 'systemd'
151 environmentdir = prefixdir / 'lib/environment.d'
152 pkgsysconfdir = sysconfdir / 'systemd'
153 userunitdir = prefixdir / 'lib/systemd/user'
154 userpresetdir = prefixdir / 'lib/systemd/user-preset'
155 tmpfilesdir = prefixdir / 'lib/tmpfiles.d'
156 sysusersdir = prefixdir / 'lib/sysusers.d'
157 sysctldir = prefixdir / 'lib/sysctl.d'
158 binfmtdir = prefixdir / 'lib/binfmt.d'
159 modulesloaddir = prefixdir / 'lib/modules-load.d'
160 networkdir = rootprefixdir / 'lib/systemd/network'
161 pkgincludedir = includedir / 'systemd'
162 systemgeneratordir = rootlibexecdir / 'system-generators'
163 usergeneratordir = prefixdir / 'lib/systemd/user-generators'
164 systemenvgeneratordir = prefixdir / 'lib/systemd/system-environment-generators'
165 userenvgeneratordir = prefixdir / 'lib/systemd/user-environment-generators'
166 systemshutdowndir = rootlibexecdir / 'system-shutdown'
167 systemsleepdir = rootlibexecdir / 'system-sleep'
168 systemunitdir = rootprefixdir / 'lib/systemd/system'
169 systempresetdir = rootprefixdir / 'lib/systemd/system-preset'
170 udevlibexecdir = rootprefixdir / 'lib/udev'
171 udevrulesdir = udevlibexecdir / 'rules.d'
172 udevhwdbdir = udevlibexecdir / 'hwdb.d'
173 catalogdir = prefixdir / 'lib/systemd/catalog'
174 kernelinstalldir = prefixdir / 'lib/kernel/install.d'
175 factorydir = datadir / 'factory'
176 bootlibdir = prefixdir / 'lib/systemd/boot/efi'
177 testsdir = prefixdir / 'lib/systemd/tests'
178 systemdstatedir = localstatedir / 'lib/systemd'
179 catalogstatedir = systemdstatedir / 'catalog'
180 randomseeddir = localstatedir / 'lib/systemd'
181 profiledir = rootlibexecdir / 'portable' / 'profile'
182 ntpservicelistdir = rootprefixdir / 'lib/systemd/ntp-units.d'
184 docdir = get_option('docdir')
186 docdir = datadir / 'doc/systemd'
189 dbuspolicydir = get_option('dbuspolicydir')
190 if dbuspolicydir == ''
191 dbuspolicydir = datadir / 'dbus-1/system.d'
194 dbussessionservicedir = get_option('dbussessionservicedir')
195 if dbussessionservicedir == ''
196 dbussessionservicedir = datadir / 'dbus-1/services'
199 dbussystemservicedir = get_option('dbussystemservicedir')
200 if dbussystemservicedir == ''
201 dbussystemservicedir = datadir / 'dbus-1/system-services'
204 pamlibdir = get_option('pamlibdir')
206 pamlibdir = rootlibdir / 'security'
209 pamconfdir = get_option('pamconfdir')
211 pamconfdir = prefixdir / 'lib/pam.d'
214 libcryptsetup_plugins_dir = get_option('libcryptsetup-plugins-dir')
215 if libcryptsetup_plugins_dir == ''
216 libcryptsetup_plugins_dir = rootlibdir / 'cryptsetup'
219 memory_accounting_default = get_option('memory-accounting-default')
220 status_unit_format_default = get_option('status-unit-format-default')
222 conf.set_quoted('BINFMT_DIR', binfmtdir)
223 conf.set_quoted('BOOTLIBDIR', bootlibdir)
224 conf.set_quoted('CATALOG_DATABASE', catalogstatedir / 'database')
225 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
226 conf.set_quoted('DOC_DIR', docdir)
227 conf.set_quoted('DOCUMENT_ROOT', pkgdatadir / 'gatewayd')
228 conf.set_quoted('ENVIRONMENT_DIR', environmentdir)
229 conf.set_quoted('INCLUDE_DIR', includedir)
230 conf.set_quoted('LIBDIR', libdir)
231 conf.set_quoted('MODPROBE_DIR', modprobedir)
232 conf.set_quoted('MODULESLOAD_DIR', modulesloaddir)
233 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
234 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir / 'pkttyagent')
235 conf.set_quoted('PREFIX', prefixdir)
236 conf.set_quoted('RANDOM_SEED', randomseeddir / 'random-seed')
237 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
238 conf.set_quoted('RC_LOCAL_PATH', get_option('rc-local'))
239 conf.set_quoted('ROOTBINDIR', rootbindir)
240 conf.set_quoted('ROOTLIBDIR', rootlibdir)
241 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
242 conf.set_quoted('ROOTPREFIX', rootprefixdir)
243 conf.set_quoted('ROOTPREFIX_NOSLASH', rootprefixdir_noslash)
244 conf.set_quoted('SYSCONF_DIR', sysconfdir)
245 conf.set_quoted('SYSCTL_DIR', sysctldir)
246 conf.set_quoted('SYSTEMCTL_BINARY_PATH', rootbindir / 'systemctl')
247 conf.set_quoted('SYSTEMD_BINARY_PATH', rootlibexecdir / 'systemd')
248 conf.set_quoted('SYSTEMD_CATALOG_DIR', catalogdir)
249 conf.set_quoted('SYSTEMD_CGROUPS_AGENT_PATH', rootlibexecdir / 'systemd-cgroups-agent')
250 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', rootlibexecdir / 'systemd-cryptsetup')
251 conf.set_quoted('SYSTEMD_EXPORT_PATH', rootlibexecdir / 'systemd-export')
252 conf.set_quoted('SYSTEMD_FSCK_PATH', rootlibexecdir / 'systemd-fsck')
253 conf.set_quoted('SYSTEMD_GROWFS_PATH', rootlibexecdir / 'systemd-growfs')
254 conf.set_quoted('SYSTEMD_HOMEWORK_PATH', rootlibexecdir / 'systemd-homework')
255 conf.set_quoted('SYSTEMD_IMPORT_FS_PATH', rootlibexecdir / 'systemd-import-fs')
256 conf.set_quoted('SYSTEMD_IMPORT_PATH', rootlibexecdir / 'systemd-import')
257 conf.set_quoted('SYSTEMD_INTEGRITYSETUP_PATH', rootlibexecdir / 'systemd-integritysetup')
258 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', pkgdatadir / 'kbd-model-map')
259 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', pkgdatadir / 'language-fallback-map')
260 conf.set_quoted('SYSTEMD_MAKEFS_PATH', rootlibexecdir / 'systemd-makefs')
261 conf.set_quoted('SYSTEMD_PULL_PATH', rootlibexecdir / 'systemd-pull')
262 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', rootlibexecdir / 'systemd-shutdown')
263 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', bindir / 'systemd-stdio-bridge')
264 conf.set_quoted('SYSTEMD_TEST_DATA', testsdir / 'testdata')
265 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', rootbindir / 'systemd-tty-ask-password-agent')
266 conf.set_quoted('SYSTEMD_UPDATE_HELPER_PATH', rootlibexecdir / 'systemd-update-helper')
267 conf.set_quoted('SYSTEMD_USERWORK_PATH', rootlibexecdir / 'systemd-userwork')
268 conf.set_quoted('SYSTEMD_VERITYSETUP_PATH', rootlibexecdir / 'systemd-veritysetup')
269 conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', pkgsysconfdir / 'system')
270 conf.set_quoted('SYSTEM_DATA_UNIT_DIR', systemunitdir)
271 conf.set_quoted('SYSTEM_ENV_GENERATOR_DIR', systemenvgeneratordir)
272 conf.set_quoted('SYSTEM_GENERATOR_DIR', systemgeneratordir)
273 conf.set_quoted('SYSTEM_PRESET_DIR', systempresetdir)
274 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
275 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
276 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
277 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
278 conf.set_quoted('SYSUSERS_DIR', sysusersdir)
279 conf.set_quoted('TMPFILES_DIR', tmpfilesdir)
280 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
281 conf.set_quoted('UDEV_HWDB_DIR', udevhwdbdir)
282 conf.set_quoted('UDEV_RULES_DIR', udevrulesdir)
283 conf.set_quoted('UPDATE_HELPER_USER_TIMEOUT', get_option('update-helper-user-timeout'))
284 conf.set_quoted('USER_CONFIG_UNIT_DIR', pkgsysconfdir / 'user')
285 conf.set_quoted('USER_DATA_UNIT_DIR', userunitdir)
286 conf.set_quoted('USER_ENV_GENERATOR_DIR', userenvgeneratordir)
287 conf.set_quoted('USER_GENERATOR_DIR', usergeneratordir)
288 conf.set_quoted('USER_KEYRING_PATH', pkgsysconfdir / 'import-pubring.gpg')
289 conf.set_quoted('USER_PRESET_DIR', userpresetdir)
290 conf.set_quoted('VENDOR_KEYRING_PATH', rootlibexecdir / 'import-pubring.gpg')
292 conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper())
293 conf.set10('ENABLE_URLIFY', get_option('urlify'))
294 conf.set10('ENABLE_FEXECVE', get_option('fexecve'))
295 conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default)
296 conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper())
297 conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format_default)
299 #####################################################################
301 cc = meson.get_compiler('c')
302 pkgconfig = import('pkgconfig')
303 check_compilation_sh = find_program('tools/check-compilation.sh')
304 meson_build_sh = find_program('tools/meson-build.sh')
306 want_tests = get_option('tests')
307 slow_tests = want_tests != 'false' and get_option('slow-tests')
308 fuzz_tests = want_tests != 'false' and get_option('fuzz-tests')
309 install_tests = get_option('install-tests')
311 if add_languages('cpp', required : fuzzer_build)
312 # Used only for tests
313 cxx = meson.get_compiler('cpp')
314 cxx_cmd = ' '.join(cxx.cmd_array())
320 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false)
321 if fuzzing_engine.found()
322 add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c')
323 elif cc.has_argument('-fsanitize=fuzzer-no-link')
324 add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c')
326 error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported')
329 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
332 # Those generate many false positives, and we do not want to change the code to
334 basic_disabled_warnings = [
335 '-Wno-format-signedness',
336 '-Wno-missing-field-initializers',
337 '-Wno-unused-parameter',
340 possible_common_cc_flags = [
344 '-Werror=implicit-function-declaration',
345 '-Werror=incompatible-pointer-types',
346 '-Werror=int-conversion',
348 '-Werror=override-init',
349 '-Werror=return-type',
350 '-Werror=shift-count-overflow',
351 '-Werror=shift-overflow=2',
354 '-Wimplicit-fallthrough=5',
357 '-Wmissing-include-dirs',
358 '-Wmissing-noreturn',
360 '-Wold-style-definition',
364 '-Wstrict-aliasing=2',
365 '-Wstrict-prototypes',
366 '-Wsuggest-attribute=noreturn',
370 # negative arguments are correctly detected starting with meson 0.46.
371 '-Wno-error=#warnings', # clang
372 '-Wno-string-plus-int', # clang
375 # Disable -Wmaybe-unitialized when compiling with -Os/-O1/-O3/etc. There are
376 # too many false positives with gcc >= 8. Effectively, we only test with -O0
377 # and -O2; this should be enough to catch most important cases without too much
378 # busywork. See https://github.com/systemd/systemd/pull/19226.
379 if cc.get_id() == 'gcc' and (not '02'.contains(get_option('optimization')) or
380 cc.version().version_compare('<10'))
381 possible_common_cc_flags += '-Wno-maybe-uninitialized'
384 # Disable -Wno-unused-result with gcc, see
385 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425.
386 if cc.get_id() == 'gcc'
387 possible_common_cc_flags += '-Wno-unused-result'
390 # --as-needed and --no-undefined are provided by meson by default,
391 # run 'meson configure' to see what is enabled
392 possible_link_flags = [
393 '-Wl,--fatal-warnings',
399 if get_option('b_sanitize') == 'none'
400 possible_link_flags += '-Wl,--warn-common'
403 if cc.get_id() == 'clang'
404 possible_common_cc_flags += [
405 '-Wno-typedef-redefinition',
406 '-Wno-gnu-variable-sized-type-not-at-end',
410 possible_cc_flags = possible_common_cc_flags + [
411 '-Werror=missing-declarations',
412 '-Werror=missing-prototypes',
413 '-fdiagnostics-show-option',
415 '-fno-strict-aliasing',
417 '-fstack-protector-strong',
418 '-fvisibility=hidden',
419 '--param=ssp-buffer-size=4',
422 if get_option('buildtype') != 'debug'
423 possible_cc_flags += [
424 '-ffunction-sections',
428 possible_link_flags += '-Wl,--gc-sections'
431 add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
432 add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
433 add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
435 have = cc.has_argument('-Wzero-length-bounds')
436 conf.set10('HAVE_ZERO_LENGTH_BOUNDS', have)
440 #include <inttypes.h>
441 typedef uint64_t usec_t;
442 usec_t now(clockid_t clock);
447 ''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing')
448 add_project_arguments('-Werror=shadow', language : 'c')
452 add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
455 cpp = ' '.join(cc.cmd_array()) + ' -E'
457 has_wstringop_truncation = cc.has_argument('-Wstringop-truncation')
459 #####################################################################
460 # compilation result tests
462 conf.set('_GNU_SOURCE', true)
463 conf.set('__SANE_USERSPACE_TYPES__', true)
464 conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation)
466 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
467 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
468 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
469 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
473 #include <sys/mount.h>
474 #include <sys/stat.h>
475 #include <linux/fs.h>
478 foreach decl : ['char16_t',
484 # We get -1 if the size cannot be determined
485 have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
487 if decl == 'struct statx'
489 want_linux_stat_h = false
491 have = cc.sizeof(decl,
492 prefix : decl_headers + '#include <linux/stat.h>',
493 args : '-D_GNU_SOURCE') > 0
494 want_linux_stat_h = have
498 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
501 conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
503 foreach ident : ['secure_getenv', '__secure_getenv']
504 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
508 ['memfd_create', '''#include <sys/mman.h>'''],
509 ['gettid', '''#include <sys/types.h>
510 #include <unistd.h>'''],
511 ['pivot_root', '''#include <stdlib.h>
512 #include <unistd.h>'''], # no known header declares pivot_root
513 ['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get
514 ['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set
515 ['name_to_handle_at', '''#include <sys/types.h>
516 #include <sys/stat.h>
517 #include <fcntl.h>'''],
518 ['setns', '''#include <sched.h>'''],
519 ['renameat2', '''#include <stdio.h>
520 #include <fcntl.h>'''],
521 ['kcmp', '''#include <linux/kcmp.h>'''],
522 ['keyctl', '''#include <sys/types.h>
523 #include <keyutils.h>'''],
524 ['copy_file_range', '''#include <sys/syscall.h>
525 #include <unistd.h>'''],
526 ['bpf', '''#include <sys/syscall.h>
527 #include <unistd.h>'''],
528 ['statx', '''#include <sys/types.h>
529 #include <sys/stat.h>
530 #include <unistd.h>'''],
531 ['explicit_bzero' , '''#include <string.h>'''],
532 ['reallocarray', '''#include <stdlib.h>'''],
533 ['set_mempolicy', '''#include <stdlib.h>
534 #include <unistd.h>'''],
535 ['get_mempolicy', '''#include <stdlib.h>
536 #include <unistd.h>'''],
537 ['pidfd_send_signal', '''#include <stdlib.h>
540 #include <sys/wait.h>'''],
541 ['pidfd_open', '''#include <stdlib.h>
544 #include <sys/wait.h>'''],
545 ['rt_sigqueueinfo', '''#include <stdlib.h>
548 #include <sys/wait.h>'''],
549 ['mallinfo', '''#include <malloc.h>'''],
550 ['mallinfo2', '''#include <malloc.h>'''],
551 ['execveat', '''#include <unistd.h>'''],
552 ['close_range', '''#include <unistd.h>'''],
553 ['epoll_pwait2', '''#include <sys/epoll.h>'''],
554 ['mount_setattr', '''#include <sys/mount.h>'''],
555 ['move_mount', '''#include <sys/mount.h>'''],
556 ['open_tree', '''#include <sys/mount.h>'''],
557 ['getdents64', '''#include <dirent.h>'''],
560 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
561 conf.set10('HAVE_' + ident[0].to_upper(), have)
564 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
565 conf.set10('USE_SYS_RANDOM_H', true)
566 conf.set10('HAVE_GETRANDOM', true)
568 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
569 conf.set10('USE_SYS_RANDOM_H', false)
570 conf.set10('HAVE_GETRANDOM', have)
573 #####################################################################
575 version_tag = get_option('version-tag')
577 vcs_data = configuration_data()
578 vcs_data.set('VCS_TAG', version_tag)
579 version_h = configure_file(configuration : vcs_data,
580 input : 'src/version/version.h.in',
581 output : 'version.h')
584 project_source_root + '/tools/meson-vcs-tag.sh',
586 meson.project_version()]
589 input : 'src/version/version.h.in',
590 output : 'version.h',
594 versiondep = declare_dependency(sources: version_h)
596 sh = find_program('sh')
597 echo = find_program('echo')
598 sed = find_program('sed')
599 awk = find_program('awk')
600 stat = find_program('stat')
601 ln = find_program('ln')
602 git = find_program('git', required : false)
603 env = find_program('env')
604 perl = find_program('perl', required : false)
605 rsync = find_program('rsync', required : false)
606 meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
607 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
609 mkdir_p = 'mkdir -p $DESTDIR/@0@'
610 splash_bmp = files('test/splash.bmp')
612 # If -Dxxx-path option is found, use that. Otherwise, check in $PATH,
613 # /usr/sbin, /sbin, and fall back to the default from middle column.
614 progs = [['quotaon', '/usr/sbin/quotaon' ],
615 ['quotacheck', '/usr/sbin/quotacheck' ],
616 ['kmod', '/usr/bin/kmod' ],
617 ['kexec', '/usr/sbin/kexec' ],
618 ['sulogin', '/usr/sbin/sulogin' ],
619 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
620 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
621 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
622 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
623 ['nologin', '/usr/sbin/nologin', ],
626 path = get_option(prog[0] + '-path')
628 message('Using @1@ for @0@'.format(prog[0], path))
630 exe = find_program(prog[0],
631 '/usr/sbin/' + prog[0],
634 path = exe.found() ? exe.path() : prog[1]
636 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
637 conf.set_quoted(name, path)
640 conf.set_quoted('TELINIT', get_option('telinit-path'))
642 if run_command(ln, '--relative', '--help', check : false).returncode() != 0
643 error('ln does not support --relative (added in coreutils 8.16)')
646 ############################################################
648 if run_command('python3', '-c', 'import jinja2', check : false).returncode() != 0
649 error('python3 jinja2 missing')
652 ############################################################
654 gperf = find_program('gperf')
656 gperf_test_format = '''
658 const char * in_word_set(const char *, @0@);
661 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
662 gperf_snippet = run_command(sh, '-c', gperf_snippet_format.format(gperf.path()),
664 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
665 if cc.compiles(gperf_test)
666 gperf_len_type = 'size_t'
668 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
669 if cc.compiles(gperf_test)
670 gperf_len_type = 'unsigned'
672 error('unable to determine gperf len type')
675 message('gperf len type is @0@'.format(gperf_len_type))
676 conf.set('GPERF_LEN_TYPE', gperf_len_type,
677 description : 'The type of gperf "len" parameter')
679 ############################################################
681 if not cc.has_header('sys/capability.h')
682 error('POSIX caps headers not found')
684 foreach header : ['crypt.h',
686 'linux/vm_sockets.h',
688 'valgrind/memcheck.h',
689 'valgrind/valgrind.h',
690 'linux/time_types.h',
694 conf.set10('HAVE_' + header.underscorify().to_upper(),
695 cc.has_header(header))
698 ############################################################
700 fallback_hostname = get_option('fallback-hostname')
701 if fallback_hostname == '' or fallback_hostname[0] == '.' or fallback_hostname[0] == '-'
702 error('Invalid fallback-hostname configuration')
703 # A more extensive test is done in test-hostname-util. Let's catch
704 # the most obvious errors here so we don't fail with an assert later.
706 conf.set_quoted('FALLBACK_HOSTNAME', fallback_hostname)
708 default_hierarchy = get_option('default-hierarchy')
709 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
710 description : 'default cgroup hierarchy as string')
711 if default_hierarchy == 'legacy'
712 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
713 elif default_hierarchy == 'hybrid'
714 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
716 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
719 extra_net_naming_schemes = []
720 extra_net_naming_map = []
721 foreach scheme: get_option('extra-net-naming-schemes').split(',')
723 name = scheme.split('=')[0]
724 value = scheme.split('=')[1]
725 NAME = name.underscorify().to_upper()
727 foreach field: value.split('+')
728 VALUE += 'NAMING_' + field.underscorify().to_upper()
730 extra_net_naming_schemes += 'NAMING_@0@ = @1@,'.format(NAME, '|'.join(VALUE))
731 extra_net_naming_map += '{ "@0@", NAMING_@1@ },'.format(name, NAME)
734 conf.set('EXTRA_NET_NAMING_SCHEMES', ' '.join(extra_net_naming_schemes))
735 conf.set('EXTRA_NET_NAMING_MAP', ' '.join(extra_net_naming_map))
737 default_net_naming_scheme = get_option('default-net-naming-scheme')
738 conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme)
739 if default_net_naming_scheme != 'latest'
740 conf.set('_DEFAULT_NET_NAMING_SCHEME_TEST',
741 'NAMING_' + default_net_naming_scheme.underscorify().to_upper())
744 time_epoch = get_option('time-epoch')
746 time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"', check : true).stdout().strip()
747 if time_epoch == '' and git.found() and fs.exists('.git')
748 # If we're in a git repository, use the creation time of the latest git tag.
749 latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags',
751 if latest_tag.returncode() == 0
752 time_epoch = run_command(
753 git, 'log', '--no-show-signature', '-1', '--format=%at',
754 latest_tag.stdout().strip(),
755 check : false).stdout()
760 time_epoch = run_command(stat, '-c', '%Y', NEWS,
761 check : true).stdout()
763 time_epoch = time_epoch.to_int()
765 conf.set('TIME_EPOCH', time_epoch)
767 conf.set('CLOCK_VALID_RANGE_USEC_MAX', get_option('clock-valid-range-usec-max'))
769 foreach tuple : [['system-alloc-uid-min', 'SYS_UID_MIN', 1], # Also see login.defs(5).
770 ['system-uid-max', 'SYS_UID_MAX', 999],
771 ['system-alloc-gid-min', 'SYS_GID_MIN', 1],
772 ['system-gid-max', 'SYS_GID_MAX', 999]]
773 v = get_option(tuple[0])
777 '/^\s*@0@\s+/ { uid=$2 } END { print uid }'.format(tuple[1]),
779 check : false).stdout().strip()
786 conf.set(tuple[0].underscorify().to_upper(), v)
788 if conf.get('SYSTEM_ALLOC_UID_MIN') >= conf.get('SYSTEM_UID_MAX')
789 error('Invalid uid allocation range')
791 if conf.get('SYSTEM_ALLOC_GID_MIN') >= conf.get('SYSTEM_GID_MAX')
792 error('Invalid gid allocation range')
795 dynamic_uid_min = get_option('dynamic-uid-min')
796 dynamic_uid_max = get_option('dynamic-uid-max')
797 conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
798 conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
800 container_uid_base_min = get_option('container-uid-base-min')
801 container_uid_base_max = get_option('container-uid-base-max')
802 conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
803 conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
805 nobody_user = get_option('nobody-user')
806 nobody_group = get_option('nobody-group')
808 if not meson.is_cross_build()
809 getent_result = run_command('getent', 'passwd', '65534', check : false)
810 if getent_result.returncode() == 0
811 name = getent_result.stdout().split(':')[0]
812 if name != nobody_user
814 '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) +
815 'Your build will result in an user table setup that is incompatible with the local system.')
818 id_result = run_command('id', '-u', nobody_user, check : false)
819 if id_result.returncode() == 0
820 id = id_result.stdout().to_int()
823 '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) +
824 'Your build will result in an user table setup that is incompatible with the local system.')
828 getent_result = run_command('getent', 'group', '65534', check : false)
829 if getent_result.returncode() == 0
830 name = getent_result.stdout().split(':')[0]
831 if name != nobody_group
833 '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) +
834 'Your build will result in an group table setup that is incompatible with the local system.')
837 id_result = run_command('id', '-g', nobody_group, check : false)
838 if id_result.returncode() == 0
839 id = id_result.stdout().to_int()
842 '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) +
843 'Your build will result in an group table setup that is incompatible with the local system.')
847 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
849 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
850 'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
853 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
854 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
857 foreach option : ['adm-gid',
874 'systemd-journal-gid',
875 'systemd-network-uid',
876 'systemd-resolve-uid',
877 'systemd-timesync-uid']
878 name = option.underscorify().to_upper()
879 val = get_option(option)
881 # Ensure provided GID argument is numeric, otherwise fall back to default assignment
882 conf.set(name, val >= 0 ? val : '-')
884 static_ugids += '@0@:@1@'.format(option, val)
888 conf.set10('ENABLE_ADM_GROUP', get_option('adm-group'))
889 conf.set10('ENABLE_WHEEL_GROUP', get_option('wheel-group'))
891 dev_kvm_mode = get_option('dev-kvm-mode')
892 conf.set_quoted('DEV_KVM_MODE', dev_kvm_mode) # FIXME: convert to 0o… notation
893 conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666')
894 group_render_mode = get_option('group-render-mode')
895 conf.set_quoted('GROUP_RENDER_MODE', group_render_mode)
896 conf.set10('GROUP_RENDER_UACCESS', group_render_mode != '0666')
898 kill_user_processes = get_option('default-kill-user-processes')
899 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
901 dns_servers = get_option('dns-servers')
902 conf.set_quoted('DNS_SERVERS', dns_servers)
904 ntp_servers = get_option('ntp-servers')
905 conf.set_quoted('NTP_SERVERS', ntp_servers)
907 default_locale = get_option('default-locale')
908 if default_locale == ''
909 if not meson.is_cross_build()
910 choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
911 default_locale = run_command(choose_default_locale_sh,
912 check : true).stdout().strip()
914 default_locale = 'C.UTF-8'
917 conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
919 localegen_path = get_option('localegen-path')
920 if localegen_path != ''
921 conf.set_quoted('LOCALEGEN_PATH', localegen_path)
923 conf.set10('HAVE_LOCALEGEN', localegen_path != '')
925 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
927 service_watchdog = get_option('service-watchdog')
928 watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog
929 conf.set_quoted('SERVICE_WATCHDOG', watchdog_value)
931 conf.set_quoted('SUSHELL', get_option('debug-shell'))
932 conf.set_quoted('DEBUGTTY', get_option('debug-tty'))
934 enable_debug_hashmap = false
935 enable_debug_mmap_cache = false
936 enable_debug_siphash = false
937 foreach name : get_option('debug-extra')
939 enable_debug_hashmap = true
940 elif name == 'mmap-cache'
941 enable_debug_mmap_cache = true
942 elif name == 'siphash'
943 enable_debug_siphash = true
945 message('unknown debug option "@0@", ignoring'.format(name))
948 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
949 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
950 conf.set10('ENABLE_DEBUG_SIPHASH', enable_debug_siphash)
952 conf.set10('VALGRIND', get_option('valgrind'))
953 conf.set10('LOG_TRACE', get_option('log-trace'))
955 default_user_path = get_option('user-path')
956 if default_user_path != ''
957 conf.set_quoted('DEFAULT_USER_PATH', default_user_path)
961 #####################################################################
963 threads = dependency('threads')
964 librt = cc.find_library('rt')
965 libm = cc.find_library('m')
966 libdl = cc.find_library('dl')
967 libcrypt = cc.find_library('crypt')
969 crypt_header = conf.get('HAVE_CRYPT_H') == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>'''
971 ['crypt_ra', crypt_header],
972 ['crypt_preferred_method', crypt_header],
973 ['crypt_gensalt_ra', crypt_header]]
975 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE',
976 dependencies : libcrypt)
977 conf.set10('HAVE_' + ident[0].to_upper(), have)
980 libcap = dependency('libcap', required : false)
981 if not libcap.found()
982 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
983 libcap = cc.find_library('cap')
986 want_bpf_framework = get_option('bpf-framework')
987 bpf_framework_required = want_bpf_framework == 'true'
989 libbpf = dependency('libbpf', required : bpf_framework_required, version : '>= 0.2')
990 conf.set10('HAVE_LIBBPF', libbpf.found())
992 if want_bpf_framework == 'false'
993 conf.set10('BPF_FRAMEWORK', 0)
995 # Support 'versioned' clang/llvm-strip binaries, as seen on Debian/Ubuntu
996 # (like clang-10/llvm-strip-10)
997 clang_bin = cc.get_id() == 'clang' ? cc.cmd_array()[0] : 'clang'
998 clang = find_program(clang_bin, required : bpf_framework_required)
1000 llvm_strip_bin = run_command(clang, '--print-prog-name', 'llvm-strip',
1001 check : true).stdout().strip()
1003 llvm_strip_bin = 'llvm-strip'
1005 llvm_strip = find_program(llvm_strip_bin, required : bpf_framework_required)
1007 # Debian installs this in /usr/sbin/ which is not in $PATH.
1008 # We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.
1009 bpftool = find_program('bpftool', '/usr/sbin/bpftool', required : bpf_framework_required)
1011 deps_found = libbpf.found() and clang.found() and llvm_strip.found() and bpftool.found()
1012 # Can build BPF program from source code in restricted C
1013 conf.set10('BPF_FRAMEWORK', deps_found)
1016 libmount = dependency('mount',
1017 version : fuzzer_build ? '>= 0' : '>= 2.30')
1019 want_libfdisk = get_option('fdisk')
1020 if want_libfdisk != 'false' and not skip_deps
1021 libfdisk = dependency('fdisk',
1022 version : '>= 2.33',
1023 required : want_libfdisk == 'true')
1024 have = libfdisk.found()
1029 conf.set10('HAVE_LIBFDISK', have)
1031 want_pwquality = get_option('pwquality')
1032 if want_pwquality != 'false' and not skip_deps
1033 libpwquality = dependency('pwquality', required : want_pwquality == 'true')
1034 have = libpwquality.found()
1039 conf.set10('HAVE_PWQUALITY', have)
1041 want_seccomp = get_option('seccomp')
1042 if want_seccomp != 'false' and not skip_deps
1043 libseccomp = dependency('libseccomp',
1044 version : '>= 2.3.1',
1045 required : want_seccomp == 'true')
1046 have = libseccomp.found()
1051 conf.set10('HAVE_SECCOMP', have)
1053 want_selinux = get_option('selinux')
1054 if want_selinux != 'false' and not skip_deps
1055 libselinux = dependency('libselinux',
1056 version : '>= 2.1.9',
1057 required : want_selinux == 'true')
1058 have = libselinux.found()
1063 conf.set10('HAVE_SELINUX', have)
1065 want_apparmor = get_option('apparmor')
1066 if want_apparmor != 'false' and not skip_deps
1067 libapparmor = dependency('libapparmor',
1068 version : '>= 2.13',
1069 required : want_apparmor == 'true')
1070 have = libapparmor.found()
1075 conf.set10('HAVE_APPARMOR', have)
1077 have = get_option('smack') and get_option('smack-run-label') != ''
1078 conf.set10('HAVE_SMACK_RUN_LABEL', have)
1080 conf.set_quoted('SMACK_RUN_LABEL', get_option('smack-run-label'))
1083 want_polkit = get_option('polkit')
1084 install_polkit = false
1085 install_polkit_pkla = false
1086 if want_polkit != 'false' and not skip_deps
1087 install_polkit = true
1089 libpolkit = dependency('polkit-gobject-1',
1091 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
1092 message('Old polkit detected, will install pkla files')
1093 install_polkit_pkla = true
1096 conf.set10('ENABLE_POLKIT', install_polkit)
1098 want_acl = get_option('acl')
1099 if want_acl != 'false' and not skip_deps
1100 libacl = cc.find_library('acl', required : want_acl == 'true')
1101 have = libacl.found()
1106 conf.set10('HAVE_ACL', have)
1108 want_audit = get_option('audit')
1109 if want_audit != 'false' and not skip_deps
1110 libaudit = dependency('audit', required : want_audit == 'true')
1111 have = libaudit.found()
1116 conf.set10('HAVE_AUDIT', have)
1118 want_blkid = get_option('blkid')
1119 if want_blkid != 'false' and not skip_deps
1120 libblkid = dependency('blkid', required : want_blkid == 'true')
1121 have = libblkid.found()
1123 conf.set10('HAVE_BLKID_PROBE_SET_HINT',
1124 have and cc.has_function('blkid_probe_set_hint', dependencies : libblkid))
1129 conf.set10('HAVE_BLKID', have)
1131 want_kmod = get_option('kmod')
1132 if want_kmod != 'false' and not skip_deps
1133 libkmod = dependency('libkmod',
1135 required : want_kmod == 'true')
1136 have = libkmod.found()
1141 conf.set10('HAVE_KMOD', have)
1143 want_pam = get_option('pam')
1144 if want_pam != 'false' and not skip_deps
1145 libpam = cc.find_library('pam', required : want_pam == 'true')
1146 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1147 have = libpam.found() and libpam_misc.found()
1153 conf.set10('HAVE_PAM', have)
1155 want_microhttpd = get_option('microhttpd')
1156 if want_microhttpd != 'false' and not skip_deps
1157 libmicrohttpd = dependency('libmicrohttpd',
1158 version : '>= 0.9.33',
1159 required : want_microhttpd == 'true')
1160 have = libmicrohttpd.found()
1165 conf.set10('HAVE_MICROHTTPD', have)
1167 want_libcryptsetup = get_option('libcryptsetup')
1168 want_libcryptsetup_plugins = get_option('libcryptsetup-plugins')
1170 if want_libcryptsetup_plugins == 'true' and want_libcryptsetup == 'false'
1171 error('libcryptsetup-plugins can not be requested without libcryptsetup')
1174 if want_libcryptsetup != 'false' and not skip_deps
1175 libcryptsetup = dependency('libcryptsetup',
1176 version : want_libcryptsetup_plugins == 'true' ? '>= 2.4.0' : '>= 2.0.1',
1177 required : want_libcryptsetup == 'true' or want_libcryptsetup_plugins == 'true')
1178 have = libcryptsetup.found()
1180 conf.set10('HAVE_CRYPT_SET_METADATA_SIZE',
1181 have and cc.has_function('crypt_set_metadata_size', dependencies : libcryptsetup))
1182 conf.set10('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY',
1183 have and cc.has_function('crypt_activate_by_signed_key', dependencies : libcryptsetup))
1184 conf.set10('HAVE_CRYPT_TOKEN_MAX',
1185 have and cc.has_function('crypt_token_max', dependencies : libcryptsetup))
1190 conf.set10('HAVE_LIBCRYPTSETUP', have)
1192 if want_libcryptsetup_plugins != 'false' and not skip_deps
1193 have = (cc.has_function('crypt_activate_by_token_pin', dependencies : libcryptsetup) and
1194 cc.has_function('crypt_token_external_path', dependencies : libcryptsetup))
1198 conf.set10('HAVE_LIBCRYPTSETUP_PLUGINS', have)
1200 want_libcurl = get_option('libcurl')
1201 if want_libcurl != 'false' and not skip_deps
1202 libcurl = dependency('libcurl',
1203 version : '>= 7.32.0',
1204 required : want_libcurl == 'true')
1205 have = libcurl.found()
1210 conf.set10('HAVE_LIBCURL', have)
1211 conf.set10('CURL_NO_OLDIES', conf.get('BUILD_MODE_DEVELOPER') == 1)
1213 want_libidn = get_option('libidn')
1214 want_libidn2 = get_option('libidn2')
1215 if want_libidn == 'true' and want_libidn2 == 'true'
1216 error('libidn and libidn2 cannot be requested simultaneously')
1219 if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps
1220 libidn = dependency('libidn2',
1221 required : want_libidn2 == 'true')
1222 have = libidn.found()
1227 conf.set10('HAVE_LIBIDN2', have)
1228 if not have and want_libidn != 'false' and not skip_deps
1229 # libidn is used for both libidn and libidn2 objects
1230 libidn = dependency('libidn',
1231 required : want_libidn == 'true')
1232 have = libidn.found()
1236 conf.set10('HAVE_LIBIDN', have)
1238 want_libiptc = get_option('libiptc')
1239 if want_libiptc != 'false' and not skip_deps
1240 libiptc = dependency('libiptc',
1241 required : want_libiptc == 'true')
1242 have = libiptc.found()
1247 conf.set10('HAVE_LIBIPTC', have)
1249 want_qrencode = get_option('qrencode')
1250 if want_qrencode != 'false' and not skip_deps
1251 libqrencode = dependency('libqrencode',
1253 required : want_qrencode == 'true')
1254 have = libqrencode.found()
1259 conf.set10('HAVE_QRENCODE', have)
1261 want_gcrypt = get_option('gcrypt')
1262 if want_gcrypt != 'false' and not skip_deps
1263 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1264 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1265 have = libgcrypt.found() and libgpg_error.found()
1270 # link to neither of the libs if one is not found
1274 conf.set10('HAVE_GCRYPT', have)
1276 want_gnutls = get_option('gnutls')
1277 if want_gnutls != 'false' and not skip_deps
1278 libgnutls = dependency('gnutls',
1279 version : '>= 3.1.4',
1280 required : want_gnutls == 'true')
1281 have = libgnutls.found()
1286 conf.set10('HAVE_GNUTLS', have)
1288 want_openssl = get_option('openssl')
1289 if want_openssl != 'false' and not skip_deps
1290 libopenssl = dependency('openssl',
1291 version : '>= 1.1.0',
1292 required : want_openssl == 'true')
1293 have = libopenssl.found()
1298 conf.set10('HAVE_OPENSSL', have)
1300 want_p11kit = get_option('p11kit')
1301 if want_p11kit != 'false' and not skip_deps
1302 libp11kit = dependency('p11-kit-1',
1303 version : '>= 0.23.3',
1304 required : want_p11kit == 'true')
1305 have = libp11kit.found()
1310 conf.set10('HAVE_P11KIT', have)
1312 want_libfido2 = get_option('libfido2')
1313 if want_libfido2 != 'false' and not skip_deps
1314 libfido2 = dependency('libfido2',
1315 required : want_libfido2 == 'true')
1316 have = libfido2.found()
1321 conf.set10('HAVE_LIBFIDO2', have)
1323 want_tpm2 = get_option('tpm2')
1324 if want_tpm2 != 'false' and not skip_deps
1325 tpm2 = dependency('tss2-esys tss2-rc tss2-mu',
1326 required : want_tpm2 == 'true')
1332 conf.set10('HAVE_TPM2', have)
1334 want_elfutils = get_option('elfutils')
1335 if want_elfutils != 'false' and not skip_deps
1336 libdw = dependency('libdw',
1337 required : want_elfutils == 'true')
1338 have = libdw.found()
1340 # New in elfutils 0.177
1341 conf.set10('HAVE_DWELF_ELF_E_MACHINE_STRING',
1342 have and cc.has_function('dwelf_elf_e_machine_string', dependencies : libdw))
1347 conf.set10('HAVE_ELFUTILS', have)
1349 want_zlib = get_option('zlib')
1350 if want_zlib != 'false' and not skip_deps
1351 libz = dependency('zlib',
1352 required : want_zlib == 'true')
1358 conf.set10('HAVE_ZLIB', have)
1360 want_bzip2 = get_option('bzip2')
1361 if want_bzip2 != 'false' and not skip_deps
1362 libbzip2 = cc.find_library('bz2',
1363 required : want_bzip2 == 'true')
1364 have = libbzip2.found()
1369 conf.set10('HAVE_BZIP2', have)
1371 want_xz = get_option('xz')
1372 if want_xz != 'false' and not skip_deps
1373 libxz = dependency('liblzma',
1374 required : want_xz == 'true')
1375 have_xz = libxz.found()
1380 conf.set10('HAVE_XZ', have_xz)
1382 want_lz4 = get_option('lz4')
1383 if want_lz4 != 'false' and not skip_deps
1384 liblz4 = dependency('liblz4',
1385 version : '>= 1.3.0',
1386 required : want_lz4 == 'true')
1387 have_lz4 = liblz4.found()
1392 conf.set10('HAVE_LZ4', have_lz4)
1394 want_zstd = get_option('zstd')
1395 if want_zstd != 'false' and not skip_deps
1396 libzstd = dependency('libzstd',
1397 required : want_zstd == 'true',
1398 version : '>= 1.4.0')
1399 have_zstd = libzstd.found()
1404 conf.set10('HAVE_ZSTD', have_zstd)
1406 conf.set10('HAVE_COMPRESSION', have_xz or have_lz4 or have_zstd)
1408 want_xkbcommon = get_option('xkbcommon')
1409 if want_xkbcommon != 'false' and not skip_deps
1410 libxkbcommon = dependency('xkbcommon',
1411 version : '>= 0.3.0',
1412 required : want_xkbcommon == 'true')
1413 have = libxkbcommon.found()
1418 conf.set10('HAVE_XKBCOMMON', have)
1420 want_pcre2 = get_option('pcre2')
1421 if want_pcre2 != 'false'
1422 libpcre2 = dependency('libpcre2-8',
1423 required : want_pcre2 == 'true')
1424 have = libpcre2.found()
1429 conf.set10('HAVE_PCRE2', have)
1431 want_glib = get_option('glib')
1432 if want_glib != 'false' and not skip_deps
1433 libglib = dependency('glib-2.0',
1434 version : '>= 2.22.0',
1435 required : want_glib == 'true')
1436 libgobject = dependency('gobject-2.0',
1437 version : '>= 2.22.0',
1438 required : want_glib == 'true')
1439 libgio = dependency('gio-2.0',
1440 required : want_glib == 'true')
1441 have = libglib.found() and libgobject.found() and libgio.found()
1448 conf.set10('HAVE_GLIB', have)
1450 want_dbus = get_option('dbus')
1451 if want_dbus != 'false' and not skip_deps
1452 libdbus = dependency('dbus-1',
1453 version : '>= 1.3.2',
1454 required : want_dbus == 'true')
1455 have = libdbus.found()
1460 conf.set10('HAVE_DBUS', have)
1462 # We support one or the other. If gcrypt is available, we assume it's there to
1463 # be used, and use it in preference.
1464 opt = get_option('cryptolib')
1465 if opt == 'openssl' and conf.get('HAVE_OPENSSL') == 0
1466 error('openssl requested as the default cryptolib, but not available')
1468 conf.set10('PREFER_OPENSSL',
1469 opt == 'openssl' or (opt == 'auto' and conf.get('HAVE_OPENSSL') == 1 and conf.get('HAVE_GCRYPT') == 0))
1470 conf.set10('HAVE_OPENSSL_OR_GCRYPT',
1471 conf.get('HAVE_OPENSSL') == 1 or conf.get('HAVE_GCRYPT') == 1)
1472 lib_openssl_or_gcrypt = conf.get('PREFER_OPENSSL') == 1 ? libopenssl : libgcrypt
1474 dns_over_tls = get_option('dns-over-tls')
1475 if dns_over_tls != 'false'
1476 if dns_over_tls == 'gnutls' and conf.get('PREFER_OPENSSL') == 1
1477 error('Sorry, -Ddns-over-tls=gnutls is not supported when openssl is used as the cryptolib')
1480 if dns_over_tls == 'openssl' or conf.get('PREFER_OPENSSL') == 1
1483 have_gnutls = (conf.get('HAVE_GNUTLS') == 1 and libgnutls.version().version_compare('>= 3.6.0'))
1484 if dns_over_tls == 'gnutls' and not have_gnutls
1485 error('DNS-over-TLS support was requested with gnutls, but dependencies are not available')
1488 if dns_over_tls == 'gnutls' or have_gnutls
1489 have_openssl = false
1491 have_openssl = conf.get('HAVE_OPENSSL') == 1
1492 if dns_over_tls != 'auto' and not have_openssl
1493 str = dns_over_tls == 'openssl' ? ' with openssl' : ''
1494 error('DNS-over-TLS support was requested@0@, but dependencies are not available'.format(str))
1497 have = have_gnutls or have_openssl
1501 have_openssl = false
1503 conf.set10('ENABLE_DNS_OVER_TLS', have)
1504 conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
1505 conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl)
1507 default_dns_over_tls = get_option('default-dns-over-tls')
1509 default_dns_over_tls = 'no'
1511 if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0
1512 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.')
1513 default_dns_over_tls = 'no'
1515 conf.set('DEFAULT_DNS_OVER_TLS_MODE',
1516 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper())
1517 conf.set_quoted('DEFAULT_DNS_OVER_TLS_MODE_STR', default_dns_over_tls)
1519 default_mdns = get_option('default-mdns')
1520 conf.set('DEFAULT_MDNS_MODE',
1521 'RESOLVE_SUPPORT_' + default_mdns.to_upper())
1522 conf.set_quoted('DEFAULT_MDNS_MODE_STR', default_mdns)
1524 default_llmnr = get_option('default-llmnr')
1525 conf.set('DEFAULT_LLMNR_MODE',
1526 'RESOLVE_SUPPORT_' + default_llmnr.to_upper())
1527 conf.set_quoted('DEFAULT_LLMNR_MODE_STR', default_llmnr)
1529 want_repart = get_option('repart')
1530 if want_repart != 'false'
1531 have = conf.get('HAVE_LIBFDISK') == 1
1532 if want_repart == 'true' and not have
1533 error('repart support was requested, but dependencies are not available')
1538 conf.set10('ENABLE_REPART', have)
1540 default_dnssec = get_option('default-dnssec')
1542 default_dnssec = 'no'
1544 if default_dnssec != 'no' and conf.get('HAVE_OPENSSL_OR_GCRYPT') == 0
1545 message('default-dnssec cannot be set to yes or allow-downgrade openssl and gcrypt are disabled. Setting default-dnssec to no.')
1546 default_dnssec = 'no'
1548 conf.set('DEFAULT_DNSSEC_MODE',
1549 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1550 conf.set_quoted('DEFAULT_DNSSEC_MODE_STR', default_dnssec)
1552 want_importd = get_option('importd')
1553 if want_importd != 'false'
1554 have = (conf.get('HAVE_LIBCURL') == 1 and
1555 conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 and
1556 conf.get('HAVE_ZLIB') == 1 and
1557 conf.get('HAVE_XZ') == 1)
1558 if want_importd == 'true' and not have
1559 error('importd support was requested, but dependencies are not available')
1564 conf.set10('ENABLE_IMPORTD', have)
1566 want_homed = get_option('homed')
1567 if want_homed != 'false'
1568 have = (conf.get('HAVE_OPENSSL') == 1 and
1569 conf.get('HAVE_LIBFDISK') == 1 and
1570 conf.get('HAVE_LIBCRYPTSETUP') == 1)
1571 if want_homed == 'true' and not have
1572 error('homed support was requested, but dependencies are not available')
1577 conf.set10('ENABLE_HOMED', have)
1579 have = have and conf.get('HAVE_PAM') == 1
1580 conf.set10('ENABLE_PAM_HOME', have)
1582 have = get_option('oomd')
1583 conf.set10('ENABLE_OOMD', have)
1585 want_remote = get_option('remote')
1586 if want_remote != 'false'
1587 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1588 conf.get('HAVE_LIBCURL') == 1]
1589 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1590 # it's possible to build one without the other. Complain only if
1591 # support was explicitly requested. The auxiliary files like sysusers
1592 # config should be installed when any of the programs are built.
1593 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1594 error('remote support was requested, but dependencies are not available')
1596 have = have_deps[0] or have_deps[1]
1600 conf.set10('ENABLE_REMOTE', have)
1602 foreach term : ['analyze',
1616 'compat-mutable-uid-boundaries',
1642 have = get_option(term)
1643 name = 'ENABLE_' + term.underscorify().to_upper()
1644 conf.set10(name, have)
1647 enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1
1649 foreach tuple : [['nss-mymachines', 'machined'],
1650 ['nss-resolve', 'resolve']]
1651 want = get_option(tuple[0])
1653 have = get_option(tuple[1])
1654 if want == 'true' and not have
1655 error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
1660 name = 'ENABLE_' + tuple[0].underscorify().to_upper()
1661 conf.set10(name, have)
1665 foreach term : ['ENABLE_NSS_MYHOSTNAME',
1666 'ENABLE_NSS_MYMACHINES',
1667 'ENABLE_NSS_RESOLVE',
1668 'ENABLE_NSS_SYSTEMD']
1669 if conf.get(term) == 1
1673 conf.set10('ENABLE_NSS', enable_nss)
1675 conf.set10('ENABLE_TIMEDATECTL', get_option('timedated') or get_option('timesyncd'))
1677 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
1679 #####################################################################
1681 subdir('src/fundamental')
1682 subdir('src/boot/efi')
1684 ############################################################
1686 generate_gperfs = find_program('tools/generate-gperfs.py')
1687 make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
1688 make_directive_index_py = find_program('tools/make-directive-index.py')
1689 make_man_index_py = find_program('tools/make-man-index.py')
1690 meson_render_jinja2 = find_program('tools/meson-render-jinja2.py')
1691 update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
1692 update_hwdb_sh = find_program('tools/update-hwdb.sh')
1693 update_hwdb_autosuspend_sh = find_program('tools/update-hwdb-autosuspend.sh')
1694 update_syscall_tables_sh = find_program('tools/update-syscall-tables.sh')
1695 xml_helper_py = find_program('tools/xml_helper.py')
1697 #####################################################################
1699 config_h = configure_file(
1700 output : 'config.h',
1701 configuration : conf)
1703 add_project_arguments('-include', 'config.h', language : 'c')
1705 ############################################################
1707 # binaries that have --help and are intended for use by humans,
1708 # usually, but not always, installed in /bin.
1709 public_programs = []
1714 basic_includes = include_directories(
1720 libsystemd_includes = [basic_includes, include_directories(
1721 'src/libsystemd/sd-bus',
1722 'src/libsystemd/sd-device',
1723 'src/libsystemd/sd-event',
1724 'src/libsystemd/sd-hwdb',
1725 'src/libsystemd/sd-id128',
1726 'src/libsystemd/sd-journal',
1727 'src/libsystemd/sd-netlink',
1728 'src/libsystemd/sd-network',
1729 'src/libsystemd/sd-resolve')]
1731 includes = [libsystemd_includes, include_directories('src/shared')]
1736 subdir('src/libsystemd')
1737 subdir('src/shared')
1739 subdir('src/libudev')
1740 subdir('src/cryptsetup/cryptsetup-tokens')
1742 libsystemd = shared_library(
1745 version : libsystemd_version,
1746 include_directories : libsystemd_includes,
1747 link_args : ['-shared',
1748 '-Wl,--version-script=' + libsystemd_sym_path],
1749 link_with : [libbasic,
1751 link_whole : [libsystemd_static],
1752 dependencies : [threads,
1757 link_depends : libsystemd_sym,
1759 install_dir : rootlibdir)
1761 install_libsystemd_static = static_library(
1765 basic_gcrypt_sources,
1766 fundamental_sources,
1768 include_directories : libsystemd_includes,
1769 build_by_default : static_libsystemd != 'false',
1770 install : static_libsystemd != 'false',
1771 install_dir : rootlibdir,
1772 pic : static_libsystemd_pic,
1773 dependencies : [threads,
1784 c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
1786 libudev = shared_library(
1789 version : libudev_version,
1790 include_directories : includes,
1791 link_args : ['-shared',
1792 '-Wl,--version-script=' + libudev_sym_path],
1793 link_with : [libsystemd_static, libshared_static],
1794 link_whole : libudev_basic,
1795 dependencies : [threads],
1796 link_depends : libudev_sym,
1798 install_dir : rootlibdir)
1800 install_libudev_static = static_library(
1803 fundamental_sources,
1808 include_directories : includes,
1809 build_by_default : static_libudev != 'false',
1810 install : static_libudev != 'false',
1811 install_dir : rootlibdir,
1812 link_depends : libudev_sym,
1813 dependencies : libshared_deps + [libmount],
1814 c_args : static_libudev_pic ? [] : ['-fno-PIC'],
1815 pic : static_libudev_pic)
1817 if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
1818 if conf.get('HAVE_TPM2') == 1
1819 cryptsetup_token_systemd_tpm2 = shared_library(
1820 'cryptsetup-token-systemd-tpm2',
1821 link_args : ['-shared',
1822 '-Wl,--version-script=' + cryptsetup_token_sym_path],
1823 dependencies : libshared_deps + [libcryptsetup, versiondep],
1824 link_with : [libshared],
1825 link_whole : [cryptsetup_token_systemd_tpm2_static],
1826 link_depends : cryptsetup_token_sym,
1827 install_rpath : rootlibexecdir,
1829 install_dir : libcryptsetup_plugins_dir)
1832 if conf.get('HAVE_LIBFIDO2') == 1
1833 cryptsetup_token_systemd_fido2 = shared_library(
1834 'cryptsetup-token-systemd-fido2',
1835 link_args : ['-shared',
1836 '-Wl,--version-script=' + cryptsetup_token_sym_path],
1837 dependencies : libshared_deps + [libcryptsetup, versiondep],
1838 link_with : [libshared],
1839 link_whole : [cryptsetup_token_systemd_fido2_static],
1840 link_depends : cryptsetup_token_sym,
1841 install_rpath : rootlibexecdir,
1843 install_dir : libcryptsetup_plugins_dir)
1846 if conf.get('HAVE_P11KIT') == 1
1847 cryptsetup_token_systemd_pkcs11 = shared_library(
1848 'cryptsetup-token-systemd-pkcs11',
1849 link_args : ['-shared',
1850 '-Wl,--version-script=' + cryptsetup_token_sym_path],
1851 dependencies : libshared_deps + [libcryptsetup, versiondep],
1852 link_with : [libshared],
1853 link_whole : [cryptsetup_token_systemd_pkcs11_static],
1854 link_depends : cryptsetup_token_sym,
1855 install_rpath : rootlibexecdir,
1857 install_dir : libcryptsetup_plugins_dir)
1861 ############################################################
1863 # systemd-analyze requires 'libcore'
1865 # systemd-journal-remote requires 'libjournal_core'
1866 subdir('src/journal')
1867 # systemd-networkd requires 'libsystemd_network'
1868 subdir('src/libsystemd-network')
1870 subdir('src/analyze')
1871 subdir('src/busctl')
1872 subdir('src/coredump')
1873 subdir('src/cryptenroll')
1874 subdir('src/cryptsetup')
1876 subdir('src/hostname')
1877 subdir('src/import')
1878 subdir('src/journal-remote')
1879 subdir('src/kernel-install')
1880 subdir('src/locale')
1882 subdir('src/machine')
1883 subdir('src/network')
1884 subdir('src/nspawn')
1886 subdir('src/partition')
1887 subdir('src/portable')
1888 subdir('src/pstore')
1889 subdir('src/resolve')
1891 subdir('src/shutdown')
1892 subdir('src/sysext')
1893 subdir('src/systemctl')
1894 subdir('src/timedate')
1895 subdir('src/timesync')
1896 subdir('src/tmpfiles')
1897 subdir('src/userdb')
1898 subdir('src/vconsole')
1899 subdir('src/xdg-autostart-generator')
1901 subdir('src/systemd')
1908 ############################################################
1910 # only static linking apart from libdl, to make sure that the
1911 # module is linked to all libraries that it uses.
1912 test_dlopen = executable(
1916 include_directories : includes,
1917 link_with : [libbasic],
1918 dependencies : [libdl],
1919 build_by_default : want_tests != 'false')
1921 foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
1922 ['systemd', 'ENABLE_NSS_SYSTEMD', ['nss-systemd.h', 'userdb-glue.c', 'userdb-glue.h']],
1923 ['mymachines', 'ENABLE_NSS_MYMACHINES'],
1924 ['resolve', 'ENABLE_NSS_RESOLVE', [], resolve_includes]]
1926 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1930 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1931 version_script_arg = project_source_root / sym
1933 sources = ['src/nss-@0@/nss-@0@.c'.format(module)]
1934 if tuple.length() > 2
1935 foreach s : tuple[2]
1936 sources += ['src/nss-@0@/@1@'.format(module, s)]
1940 incs = tuple.length() > 3 ? tuple[3] : includes
1942 nss = shared_library(
1947 include_directories : incs,
1948 # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1949 link_args : ['-Wl,-z,nodelete',
1951 '-Wl,--version-script=' + version_script_arg],
1952 link_with : [libsystemd_static,
1955 dependencies : [threads,
1959 install_dir : rootlibdir)
1961 # We cannot use shared_module because it does not support version suffix.
1962 # Unfortunately shared_library insists on creating the symlink…
1963 meson.add_install_script('sh', '-c',
1964 'rm $DESTDIR@0@/libnss_@1@.so'
1965 .format(rootlibdir, module))
1967 if want_tests != 'false'
1968 test('dlopen-nss_' + module,
1970 # path to dlopen must include a slash
1971 args : nss.full_path())
1976 ############################################################
1981 include_directories : includes,
1982 link_with : [libcore,
1984 dependencies : [versiondep,
1991 install_rpath : rootlibexecdir,
1993 install_dir : rootlibexecdir)
1995 meson.add_install_script(meson_make_symlink,
1996 rootlibexecdir / 'systemd',
1997 rootsbindir / 'init')
1999 public_programs += executable(
2001 systemd_analyze_sources,
2002 include_directories : core_includes,
2003 link_with : [libcore,
2005 dependencies : [versiondep,
2012 install_rpath : rootlibexecdir,
2013 install : conf.get('ENABLE_ANALYZE'))
2017 systemd_journald_sources,
2018 include_directories : includes,
2019 link_with : [libjournal_core,
2021 dependencies : [threads,
2026 install_rpath : rootlibexecdir,
2028 install_dir : rootlibexecdir)
2030 public_programs += executable(
2032 systemd_cat_sources,
2033 include_directories : includes,
2034 link_with : [libjournal_core,
2036 dependencies : [threads],
2037 install_rpath : rootlibexecdir,
2040 public_programs += executable(
2043 include_directories : includes,
2044 link_with : [libshared],
2045 dependencies : [threads,
2051 install_rpath : rootlibexecdir,
2053 install_dir : rootbindir)
2056 'systemd-getty-generator',
2057 'src/getty-generator/getty-generator.c',
2058 include_directories : includes,
2059 link_with : [libshared],
2060 install_rpath : rootlibexecdir,
2062 install_dir : systemgeneratordir)
2065 'systemd-debug-generator',
2066 'src/debug-generator/debug-generator.c',
2067 include_directories : includes,
2068 link_with : [libshared],
2069 install_rpath : rootlibexecdir,
2071 install_dir : systemgeneratordir)
2074 'systemd-run-generator',
2075 'src/run-generator/run-generator.c',
2076 include_directories : includes,
2077 link_with : [libshared],
2078 install_rpath : rootlibexecdir,
2080 install_dir : systemgeneratordir)
2083 'systemd-fstab-generator',
2084 'src/fstab-generator/fstab-generator.c',
2085 include_directories : includes,
2086 link_with : [libshared],
2087 install_rpath : rootlibexecdir,
2089 install_dir : systemgeneratordir)
2091 if conf.get('ENABLE_ENVIRONMENT_D') == 1
2093 '30-systemd-environment-d-generator',
2094 'src/environment-d-generator/environment-d-generator.c',
2095 include_directories : includes,
2096 link_with : [libshared],
2097 install_rpath : rootlibexecdir,
2099 install_dir : userenvgeneratordir)
2101 meson.add_install_script(meson_make_symlink,
2102 sysconfdir / 'environment',
2103 environmentdir / '99-environment.conf')
2106 if conf.get('ENABLE_HIBERNATE') == 1
2108 'systemd-hibernate-resume-generator',
2109 'src/hibernate-resume/hibernate-resume-generator.c',
2110 include_directories : includes,
2111 link_with : [libshared],
2112 install_rpath : rootlibexecdir,
2114 install_dir : systemgeneratordir)
2117 'systemd-hibernate-resume',
2118 'src/hibernate-resume/hibernate-resume.c',
2119 include_directories : includes,
2120 link_with : [libshared],
2121 install_rpath : rootlibexecdir,
2123 install_dir : rootlibexecdir)
2126 if conf.get('HAVE_BLKID') == 1
2128 'systemd-gpt-auto-generator',
2129 'src/gpt-auto-generator/gpt-auto-generator.c',
2130 include_directories : includes,
2131 link_with : [libshared],
2132 dependencies : libblkid,
2133 install_rpath : rootlibexecdir,
2135 install_dir : systemgeneratordir)
2137 public_programs += executable(
2139 'src/dissect/dissect.c',
2140 include_directories : includes,
2141 link_with : [libshared],
2142 install_rpath : rootlibexecdir,
2146 if conf.get('ENABLE_RESOLVE') == 1
2149 systemd_resolved_sources,
2150 include_directories : resolve_includes,
2151 link_with : [libshared,
2153 libsystemd_resolve_core],
2154 dependencies : systemd_resolved_dependencies,
2155 install_rpath : rootlibexecdir,
2157 install_dir : rootlibexecdir)
2159 public_programs += executable(
2162 include_directories : includes,
2163 link_with : [libshared,
2165 libsystemd_resolve_core],
2166 dependencies : [threads,
2167 lib_openssl_or_gcrypt,
2171 install_rpath : rootlibexecdir,
2174 meson.add_install_script(meson_make_symlink,
2175 bindir / 'resolvectl',
2176 rootsbindir / 'resolvconf')
2178 meson.add_install_script(meson_make_symlink,
2179 bindir / 'resolvectl',
2180 bindir / 'systemd-resolve')
2183 if conf.get('ENABLE_LOGIND') == 1
2186 systemd_logind_sources,
2187 include_directories : includes,
2188 link_with : [liblogind_core,
2190 dependencies : [threads,
2192 install_rpath : rootlibexecdir,
2194 install_dir : rootlibexecdir)
2196 public_programs += executable(
2199 include_directories : includes,
2200 link_with : [libshared],
2201 dependencies : [threads,
2205 install_rpath : rootlibexecdir,
2207 install_dir : rootbindir)
2209 public_programs += executable(
2211 'src/login/inhibit.c',
2212 include_directories : includes,
2213 link_with : [libshared],
2214 install_rpath : rootlibexecdir,
2216 install_dir : rootbindir)
2218 if conf.get('HAVE_PAM') == 1
2219 version_script_arg = project_source_root / pam_systemd_sym
2220 pam_systemd = shared_library(
2224 include_directories : includes,
2225 link_args : ['-shared',
2226 '-Wl,--version-script=' + version_script_arg],
2227 link_with : [libsystemd_static,
2229 dependencies : [threads,
2232 link_depends : pam_systemd_sym,
2234 install_dir : pamlibdir)
2236 if want_tests != 'false'
2237 test('dlopen-pam_systemd',
2239 # path to dlopen must include a slash
2240 args : pam_systemd.full_path())
2245 'systemd-user-runtime-dir',
2246 user_runtime_dir_sources,
2247 include_directories : includes,
2248 link_with : [libshared],
2249 install_rpath : rootlibexecdir,
2251 install_dir : rootlibexecdir)
2254 if conf.get('HAVE_PAM') == 1
2256 'systemd-user-sessions',
2257 'src/user-sessions/user-sessions.c',
2258 include_directories : includes,
2259 link_with : [libshared],
2260 install_rpath : rootlibexecdir,
2262 install_dir : rootlibexecdir)
2265 if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
2266 public_programs += executable(
2268 'src/boot/bootctl.c',
2269 include_directories : includes,
2270 link_with : [libshared],
2271 dependencies : [libblkid],
2272 install_rpath : rootlibexecdir,
2275 public_programs += executable(
2276 'systemd-bless-boot',
2277 'src/boot/bless-boot.c',
2278 include_directories : includes,
2279 link_with : [libshared],
2280 dependencies : [libblkid],
2281 install_rpath : rootlibexecdir,
2283 install_dir : rootlibexecdir)
2286 'systemd-bless-boot-generator',
2287 'src/boot/bless-boot-generator.c',
2288 include_directories : includes,
2289 link_with : [libshared],
2290 install_rpath : rootlibexecdir,
2292 install_dir : systemgeneratordir)
2296 'systemd-boot-check-no-failures',
2297 'src/boot/boot-check-no-failures.c',
2298 include_directories : includes,
2299 link_with : [libshared],
2300 dependencies : [libblkid],
2301 install_rpath : rootlibexecdir,
2303 install_dir : rootlibexecdir)
2305 public_programs += executable(
2306 'systemd-socket-activate',
2307 'src/activate/activate.c',
2308 include_directories : includes,
2309 link_with : [libshared],
2310 dependencies : [threads],
2311 install_rpath : rootlibexecdir,
2314 public_programs += executable(
2317 include_directories : includes,
2318 link_with : systemctl_link_with,
2319 dependencies : [threads,
2325 install_rpath : rootlibexecdir,
2327 install_dir : rootbindir)
2329 if conf.get('ENABLE_PORTABLED') == 1
2331 'systemd-portabled',
2332 systemd_portabled_sources,
2333 include_directories : includes,
2334 link_with : [libshared],
2335 dependencies : [threads, libselinux],
2336 install_rpath : rootlibexecdir,
2338 install_dir : rootlibexecdir)
2340 public_programs += executable(
2342 'src/portable/portablectl.c',
2343 include_directories : includes,
2344 link_with : [libshared],
2345 dependencies : [threads],
2346 install_rpath : rootlibexecdir,
2348 install_dir : rootbindir)
2351 if conf.get('ENABLE_SYSEXT') == 1
2352 public_programs += executable(
2354 systemd_sysext_sources,
2355 include_directories : includes,
2356 link_with : [libshared],
2357 install_rpath : rootlibexecdir,
2359 install_dir : rootbindir)
2362 if conf.get('ENABLE_USERDB') == 1
2365 systemd_userwork_sources,
2366 include_directories : includes,
2367 link_with : [libshared],
2368 dependencies : [threads],
2369 install_rpath : rootlibexecdir,
2371 install_dir : rootlibexecdir)
2375 systemd_userdbd_sources,
2376 include_directories : includes,
2377 link_with : [libshared],
2378 dependencies : [threads],
2379 install_rpath : rootlibexecdir,
2381 install_dir : rootlibexecdir)
2383 public_programs += executable(
2386 include_directories : includes,
2387 link_with : [libshared],
2388 dependencies : [threads],
2389 install_rpath : rootlibexecdir,
2391 install_dir : rootbindir)
2394 if conf.get('ENABLE_HOMED') == 1
2397 systemd_homework_sources,
2398 include_directories : includes,
2399 link_with : [libshared],
2400 dependencies : [threads,
2406 install_rpath : rootlibexecdir,
2408 install_dir : rootlibexecdir)
2412 systemd_homed_sources,
2413 include_directories : home_includes,
2414 link_with : [libshared],
2415 dependencies : [threads,
2419 install_rpath : rootlibexecdir,
2421 install_dir : rootlibexecdir)
2423 public_programs += executable(
2426 include_directories : includes,
2427 link_with : [libshared],
2428 dependencies : [threads,
2433 install_rpath : rootlibexecdir,
2435 install_dir : rootbindir)
2437 if conf.get('HAVE_PAM') == 1
2438 version_script_arg = project_source_root / pam_systemd_home_sym
2439 pam_systemd = shared_library(
2443 include_directories : includes,
2444 link_args : ['-shared',
2445 '-Wl,--version-script=' + version_script_arg],
2446 link_with : [libsystemd_static,
2448 dependencies : [threads,
2452 link_depends : pam_systemd_home_sym,
2454 install_dir : pamlibdir)
2458 foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
2459 (conf.get('HAVE_SYSV_COMPAT') == 1 ? ['runlevel', 'telinit'] : []))
2460 meson.add_install_script(meson_make_symlink,
2461 rootbindir / 'systemctl',
2462 rootsbindir / alias)
2465 meson.add_install_script(meson_make_symlink,
2466 rootbindir / 'udevadm',
2467 rootlibexecdir / 'systemd-udevd')
2469 if conf.get('ENABLE_BACKLIGHT') == 1
2471 'systemd-backlight',
2472 'src/backlight/backlight.c',
2473 include_directories : includes,
2474 link_with : [libshared],
2475 install_rpath : rootlibexecdir,
2477 install_dir : rootlibexecdir)
2480 if conf.get('ENABLE_RFKILL') == 1
2483 'src/rfkill/rfkill.c',
2484 include_directories : includes,
2485 link_with : [libshared],
2486 install_rpath : rootlibexecdir,
2488 install_dir : rootlibexecdir)
2492 'systemd-system-update-generator',
2493 'src/system-update-generator/system-update-generator.c',
2494 include_directories : includes,
2495 link_with : [libshared],
2496 install_rpath : rootlibexecdir,
2498 install_dir : systemgeneratordir)
2500 if conf.get('HAVE_LIBCRYPTSETUP') == 1
2502 'systemd-cryptsetup',
2503 systemd_cryptsetup_sources,
2504 include_directories : includes,
2505 link_with : [libshared],
2506 dependencies : [libcryptsetup,
2508 install_rpath : rootlibexecdir,
2510 install_dir : rootlibexecdir)
2513 'systemd-cryptsetup-generator',
2514 'src/cryptsetup/cryptsetup-generator.c',
2515 include_directories : includes,
2516 link_with : [libshared],
2517 install_rpath : rootlibexecdir,
2519 install_dir : systemgeneratordir)
2522 'systemd-veritysetup',
2523 'src/veritysetup/veritysetup.c',
2524 include_directories : includes,
2525 link_with : [libshared],
2526 dependencies : [libcryptsetup],
2527 install_rpath : rootlibexecdir,
2529 install_dir : rootlibexecdir)
2532 'systemd-veritysetup-generator',
2533 'src/veritysetup/veritysetup-generator.c',
2534 include_directories : includes,
2535 link_with : [libshared],
2536 install_rpath : rootlibexecdir,
2538 install_dir : systemgeneratordir)
2541 'systemd-cryptenroll',
2542 systemd_cryptenroll_sources,
2543 include_directories : includes,
2544 link_with : [libshared],
2545 dependencies : [libcryptsetup,
2549 install_rpath : rootlibexecdir,
2553 'systemd-integritysetup',
2554 ['src/integritysetup/integritysetup.c', 'src/integritysetup/integrity-util.c'],
2555 include_directories : includes,
2556 link_with : [libshared],
2557 dependencies : [libcryptsetup],
2558 install_rpath : rootlibexecdir,
2560 install_dir : rootlibexecdir)
2563 'systemd-integritysetup-generator',
2564 ['src/integritysetup/integritysetup-generator.c', 'src/integritysetup/integrity-util.c'],
2565 include_directories : includes,
2566 link_with : [libshared],
2567 install_rpath : rootlibexecdir,
2569 install_dir : systemgeneratordir)
2572 if conf.get('HAVE_SYSV_COMPAT') == 1
2574 'systemd-sysv-generator',
2575 'src/sysv-generator/sysv-generator.c',
2576 include_directories : includes,
2577 link_with : [libshared],
2578 install_rpath : rootlibexecdir,
2580 install_dir : systemgeneratordir)
2583 'systemd-rc-local-generator',
2584 'src/rc-local-generator/rc-local-generator.c',
2585 include_directories : includes,
2586 link_with : [libshared],
2587 install_rpath : rootlibexecdir,
2589 install_dir : systemgeneratordir)
2592 if conf.get('ENABLE_XDG_AUTOSTART') == 1
2594 'systemd-xdg-autostart-generator',
2595 systemd_xdg_autostart_generator_sources,
2596 include_directories : includes,
2597 link_with : [libshared],
2598 install_rpath : rootlibexecdir,
2600 install_dir : usergeneratordir)
2603 'systemd-xdg-autostart-condition',
2604 'src/xdg-autostart-generator/xdg-autostart-condition.c',
2605 include_directories : includes,
2606 link_with : [libshared],
2607 install_rpath : rootlibexecdir,
2609 install_dir : rootlibexecdir)
2612 if conf.get('ENABLE_HOSTNAMED') == 1
2614 'systemd-hostnamed',
2615 'src/hostname/hostnamed.c',
2616 include_directories : includes,
2617 link_with : [libshared],
2618 install_rpath : rootlibexecdir,
2620 install_dir : rootlibexecdir)
2622 public_programs += executable(
2624 'src/hostname/hostnamectl.c',
2625 include_directories : includes,
2626 link_with : [libshared],
2627 install_rpath : rootlibexecdir,
2631 if conf.get('ENABLE_LOCALED') == 1
2632 if conf.get('HAVE_XKBCOMMON') == 1
2633 # logind will load libxkbcommon.so dynamically on its own, but we still
2634 # need to specify where the headers are
2635 deps = [libdl, libxkbcommon.partial_dependency(compile_args: true)]
2642 systemd_localed_sources,
2643 include_directories : includes,
2644 link_with : [libshared],
2645 dependencies : deps,
2646 install_rpath : rootlibexecdir,
2648 install_dir : rootlibexecdir)
2650 public_programs += executable(
2653 include_directories : includes,
2654 link_with : [libshared],
2655 install_rpath : rootlibexecdir,
2659 if conf.get('ENABLE_TIMEDATED') == 1
2661 'systemd-timedated',
2662 'src/timedate/timedated.c',
2663 include_directories : includes,
2664 link_with : [libshared],
2665 install_rpath : rootlibexecdir,
2667 install_dir : rootlibexecdir)
2670 if conf.get('ENABLE_TIMEDATECTL') == 1
2671 public_programs += executable(
2673 'src/timedate/timedatectl.c',
2674 include_directories : includes,
2675 install_rpath : rootlibexecdir,
2676 link_with : [libshared],
2677 dependencies : [libm],
2681 if conf.get('ENABLE_TIMESYNCD') == 1
2683 'systemd-timesyncd',
2684 systemd_timesyncd_sources,
2685 include_directories : includes,
2686 link_with : [libtimesyncd_core],
2687 dependencies : [threads,
2689 install_rpath : rootlibexecdir,
2691 install_dir : rootlibexecdir)
2694 'systemd-time-wait-sync',
2695 'src/timesync/wait-sync.c',
2696 include_directories : includes,
2697 link_with : [libtimesyncd_core],
2698 install_rpath : rootlibexecdir,
2700 install_dir : rootlibexecdir)
2703 if conf.get('ENABLE_MACHINED') == 1
2706 systemd_machined_sources,
2707 include_directories : includes,
2708 link_with : [libmachine_core,
2710 install_rpath : rootlibexecdir,
2712 install_dir : rootlibexecdir)
2714 public_programs += executable(
2716 'src/machine/machinectl.c',
2717 include_directories : includes,
2718 link_with : [libshared],
2719 dependencies : [threads,
2723 install_rpath : rootlibexecdir,
2725 install_dir : rootbindir)
2728 if conf.get('ENABLE_IMPORTD') == 1
2731 systemd_importd_sources,
2732 include_directories : includes,
2733 link_with : [libshared],
2734 dependencies : [threads],
2735 install_rpath : rootlibexecdir,
2737 install_dir : rootlibexecdir)
2739 systemd_pull = executable(
2741 systemd_pull_sources,
2742 include_directories : includes,
2743 link_with : [libshared],
2744 dependencies : [versiondep,
2746 lib_openssl_or_gcrypt,
2750 install_rpath : rootlibexecdir,
2752 install_dir : rootlibexecdir)
2754 systemd_import = executable(
2756 systemd_import_sources,
2757 include_directories : includes,
2758 link_with : [libshared],
2759 dependencies : [libcurl,
2763 install_rpath : rootlibexecdir,
2765 install_dir : rootlibexecdir)
2767 systemd_import_fs = executable(
2768 'systemd-import-fs',
2769 systemd_import_fs_sources,
2770 include_directories : includes,
2771 link_with : [libshared],
2772 install_rpath : rootlibexecdir,
2774 install_dir : rootlibexecdir)
2776 systemd_export = executable(
2778 systemd_export_sources,
2779 include_directories : includes,
2780 link_with : [libshared],
2781 dependencies : [libcurl,
2785 install_rpath : rootlibexecdir,
2787 install_dir : rootlibexecdir)
2789 public_programs += [systemd_pull, systemd_import, systemd_import_fs, systemd_export]
2792 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2793 public_programs += executable(
2794 'systemd-journal-upload',
2795 systemd_journal_upload_sources,
2796 include_directories : includes,
2797 link_with : [libshared],
2798 dependencies : [versiondep,
2805 install_rpath : rootlibexecdir,
2807 install_dir : rootlibexecdir)
2810 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2811 public_programs += executable(
2812 'systemd-journal-remote',
2813 systemd_journal_remote_sources,
2814 include_directories : journal_includes,
2815 link_with : [libshared,
2816 libsystemd_journal_remote],
2817 dependencies : [threads,
2823 install_rpath : rootlibexecdir,
2825 install_dir : rootlibexecdir)
2827 public_programs += executable(
2828 'systemd-journal-gatewayd',
2829 systemd_journal_gatewayd_sources,
2830 include_directories : journal_includes,
2831 link_with : [libshared],
2832 dependencies : [threads,
2838 install_rpath : rootlibexecdir,
2840 install_dir : rootlibexecdir)
2843 if conf.get('ENABLE_COREDUMP') == 1
2846 systemd_coredump_sources,
2847 include_directories : includes,
2848 link_with : [libshared],
2849 dependencies : [threads,
2854 install_rpath : rootlibexecdir,
2856 install_dir : rootlibexecdir)
2858 public_programs += executable(
2860 coredumpctl_sources,
2861 include_directories : includes,
2862 link_with : [libshared],
2863 dependencies : [threads,
2867 install_rpath : rootlibexecdir,
2871 if conf.get('ENABLE_PSTORE') == 1
2874 systemd_pstore_sources,
2875 include_directories : includes,
2876 link_with : [libshared],
2877 dependencies : [threads,
2882 install_rpath : rootlibexecdir,
2884 install_dir : rootlibexecdir)
2887 if conf.get('ENABLE_OOMD') == 1
2888 executable('systemd-oomd',
2889 systemd_oomd_sources,
2890 include_directories : includes,
2891 link_with : [libshared],
2893 install_rpath : rootlibexecdir,
2895 install_dir : rootlibexecdir)
2897 public_programs += executable(
2900 include_directories : includes,
2901 link_with : [libshared],
2903 install_rpath : rootlibexecdir,
2905 install_dir : rootbindir)
2908 if conf.get('ENABLE_BINFMT') == 1
2909 public_programs += executable(
2911 'src/binfmt/binfmt.c',
2912 include_directories : includes,
2913 link_with : [libshared],
2914 install_rpath : rootlibexecdir,
2916 install_dir : rootlibexecdir)
2918 meson.add_install_script('sh', '-c',
2919 mkdir_p.format(binfmtdir))
2920 if install_sysconfdir
2921 meson.add_install_script('sh', '-c',
2922 mkdir_p.format(sysconfdir / 'binfmt.d'))
2926 if conf.get('ENABLE_REPART') == 1
2929 systemd_repart_sources,
2930 include_directories : includes,
2931 link_with : [libshared],
2932 dependencies : [threads,
2935 install_rpath : rootlibexecdir,
2937 install_dir : rootbindir)
2938 public_programs += exe
2940 if want_tests != 'false'
2943 args : exe.full_path())
2947 if conf.get('ENABLE_VCONSOLE') == 1
2949 'systemd-vconsole-setup',
2950 'src/vconsole/vconsole-setup.c',
2951 include_directories : includes,
2952 link_with : [libshared],
2953 install_rpath : rootlibexecdir,
2955 install_dir : rootlibexecdir)
2958 if conf.get('ENABLE_RANDOMSEED') == 1
2960 'systemd-random-seed',
2961 'src/random-seed/random-seed.c',
2962 include_directories : includes,
2963 link_with : [libshared],
2964 install_rpath : rootlibexecdir,
2966 install_dir : rootlibexecdir)
2969 if conf.get('ENABLE_FIRSTBOOT') == 1
2971 'systemd-firstboot',
2972 'src/firstboot/firstboot.c',
2973 include_directories : includes,
2974 link_with : [libshared],
2975 dependencies : [libcrypt],
2976 install_rpath : rootlibexecdir,
2978 install_dir : rootbindir)
2982 'systemd-remount-fs',
2983 'src/remount-fs/remount-fs.c',
2984 include_directories : includes,
2985 link_with : [libshared],
2986 install_rpath : rootlibexecdir,
2988 install_dir : rootlibexecdir)
2991 'systemd-machine-id-setup',
2992 'src/machine-id-setup/machine-id-setup-main.c',
2993 include_directories : includes,
2994 link_with : [libshared],
2995 install_rpath : rootlibexecdir,
2997 install_dir : rootbindir)
3002 include_directories : includes,
3003 link_with : [libshared],
3004 install_rpath : rootlibexecdir,
3006 install_dir : rootlibexecdir)
3008 executable('systemd-growfs',
3009 'src/partition/growfs.c',
3010 include_directories : includes,
3011 link_with : [libshared],
3012 install_rpath : rootlibexecdir,
3014 install_dir : rootlibexecdir)
3018 'src/partition/makefs.c',
3019 include_directories : includes,
3020 link_with : [libshared],
3021 install_rpath : rootlibexecdir,
3023 install_dir : rootlibexecdir)
3027 'src/sleep/sleep.c',
3028 include_directories : includes,
3029 link_with : [libshared],
3030 install_rpath : rootlibexecdir,
3032 install_dir : rootlibexecdir)
3034 if install_sysconfdir_samples
3035 install_data('src/sleep/sleep.conf',
3036 install_dir : pkgsysconfdir)
3039 public_programs += executable(
3041 'src/sysctl/sysctl.c',
3042 include_directories : includes,
3043 link_with : [libshared],
3044 install_rpath : rootlibexecdir,
3046 install_dir : rootlibexecdir)
3050 'src/ac-power/ac-power.c',
3051 include_directories : includes,
3052 link_with : [libshared],
3053 install_rpath : rootlibexecdir,
3055 install_dir : rootlibexecdir)
3057 public_programs += executable(
3058 'systemd-detect-virt',
3059 'src/detect-virt/detect-virt.c',
3060 include_directories : includes,
3061 link_with : [libshared],
3062 install_rpath : rootlibexecdir,
3065 public_programs += executable(
3067 'src/delta/delta.c',
3068 include_directories : includes,
3069 link_with : [libshared],
3070 install_rpath : rootlibexecdir,
3073 public_programs += executable(
3075 'src/escape/escape.c',
3076 include_directories : includes,
3077 link_with : [libshared],
3078 install_rpath : rootlibexecdir,
3080 install_dir : rootbindir)
3082 public_programs += executable(
3084 'src/notify/notify.c',
3085 include_directories : includes,
3086 link_with : [libshared],
3087 install_rpath : rootlibexecdir,
3089 install_dir : rootbindir)
3091 public_programs += executable(
3093 'src/creds/creds.c',
3094 include_directories : includes,
3095 link_with : [libshared],
3096 dependencies : [threads,
3098 install_rpath : rootlibexecdir,
3100 install_dir : rootbindir)
3103 'systemd-volatile-root',
3104 'src/volatile-root/volatile-root.c',
3105 include_directories : includes,
3106 link_with : [libshared],
3107 install_rpath : rootlibexecdir,
3108 install : conf.get('ENABLE_INITRD') == 1,
3109 install_dir : rootlibexecdir)
3112 'systemd-cgroups-agent',
3113 'src/cgroups-agent/cgroups-agent.c',
3114 include_directories : includes,
3115 link_with : [libshared],
3116 install_rpath : rootlibexecdir,
3118 install_dir : rootlibexecdir)
3120 public_programs += executable(
3122 'src/id128/id128.c',
3123 include_directories : includes,
3124 link_with : [libshared],
3125 install_rpath : rootlibexecdir,
3128 public_programs += executable(
3131 include_directories : includes,
3132 link_with : [libshared],
3133 install_rpath : rootlibexecdir,
3136 public_programs += executable(
3137 'systemd-ask-password',
3138 'src/ask-password/ask-password.c',
3139 include_directories : includes,
3140 link_with : [libshared],
3141 install_rpath : rootlibexecdir,
3143 install_dir : rootbindir)
3146 'systemd-reply-password',
3147 'src/reply-password/reply-password.c',
3148 include_directories : includes,
3149 link_with : [libshared],
3150 install_rpath : rootlibexecdir,
3152 install_dir : rootlibexecdir)
3154 public_programs += executable(
3155 'systemd-tty-ask-password-agent',
3156 'src/tty-ask-password-agent/tty-ask-password-agent.c',
3157 include_directories : includes,
3158 link_with : [libshared],
3159 install_rpath : rootlibexecdir,
3161 install_dir : rootbindir)
3163 public_programs += executable(
3166 include_directories : includes,
3167 link_with : [libshared],
3168 install_rpath : rootlibexecdir,
3171 public_programs += executable(
3173 'src/cgtop/cgtop.c',
3174 include_directories : includes,
3175 link_with : [libshared],
3176 install_rpath : rootlibexecdir,
3181 'src/initctl/initctl.c',
3182 include_directories : includes,
3183 link_with : [libshared],
3184 install_rpath : rootlibexecdir,
3185 install : (conf.get('HAVE_SYSV_COMPAT') == 1),
3186 install_dir : rootlibexecdir)
3188 public_programs += executable(
3190 'src/mount/mount-tool.c',
3191 include_directories : includes,
3192 link_with : [libshared],
3193 dependencies: [libmount],
3194 install_rpath : rootlibexecdir,
3197 meson.add_install_script(meson_make_symlink,
3198 'systemd-mount', bindir / 'systemd-umount')
3200 public_programs += executable(
3203 include_directories : includes,
3204 link_with : [libshared],
3205 install_rpath : rootlibexecdir,
3208 public_programs += executable(
3209 'systemd-stdio-bridge',
3210 'src/stdio-bridge/stdio-bridge.c',
3211 include_directories : includes,
3212 link_with : [libshared],
3213 dependencies : [versiondep],
3214 install_rpath : rootlibexecdir,
3217 public_programs += executable(
3220 include_directories : includes,
3221 link_with : [libshared],
3222 install_rpath : rootlibexecdir,
3228 'src/sysusers/sysusers.c',
3229 include_directories : includes,
3230 link_with : [libshared],
3231 install_rpath : rootlibexecdir,
3233 install_dir : rootbindir)
3234 public_programs += exe
3236 if want_tests != 'false'
3237 test('test-sysusers',
3239 # https://github.com/mesonbuild/meson/issues/2681
3240 args : exe.full_path())
3243 if have_standalone_binaries
3245 'systemd-sysusers.standalone',
3246 'src/sysusers/sysusers.c',
3247 include_directories : includes,
3248 c_args : '-DSTANDALONE',
3249 link_with : [libshared_static,
3254 install_dir : rootbindir)
3255 public_programs += exe
3257 if want_tests != 'false'
3258 test('test-sysusers.standalone',
3260 # https://github.com/mesonbuild/meson/issues/2681
3261 args : exe.full_path())
3266 if conf.get('ENABLE_TMPFILES') == 1
3269 systemd_tmpfiles_sources,
3270 include_directories : includes,
3271 link_with : [libshared],
3272 dependencies : [libacl],
3273 install_rpath : rootlibexecdir,
3275 install_dir : rootbindir)
3276 public_programs += exe
3278 if want_tests != 'false'
3279 test('test-systemd-tmpfiles',
3280 test_systemd_tmpfiles_py,
3281 # https://github.com/mesonbuild/meson/issues/2681
3282 args : exe.full_path())
3285 if have_standalone_binaries
3286 public_programs += executable(
3287 'systemd-tmpfiles.standalone',
3288 systemd_tmpfiles_sources,
3289 include_directories : includes,
3290 c_args : '-DSTANDALONE',
3291 link_with : [libshared_static,
3295 dependencies : [libacl],
3297 install_dir : rootbindir)
3301 if conf.get('ENABLE_HWDB') == 1
3302 systemd_hwdb = executable(
3305 include_directories : includes,
3306 link_with : udev_link_with,
3307 install_rpath : udev_rpath,
3309 install_dir : rootbindir)
3310 public_programs += systemd_hwdb
3312 if want_tests != 'false'
3315 args : [systemd_hwdb.full_path()],
3320 if conf.get('ENABLE_QUOTACHECK') == 1
3322 'systemd-quotacheck',
3323 'src/quotacheck/quotacheck.c',
3324 include_directories : includes,
3325 link_with : [libshared],
3326 install_rpath : rootlibexecdir,
3328 install_dir : rootlibexecdir)
3331 public_programs += executable(
3332 'systemd-socket-proxyd',
3333 'src/socket-proxy/socket-proxyd.c',
3334 include_directories : includes,
3335 link_with : [libshared],
3336 dependencies : [threads],
3337 install_rpath : rootlibexecdir,
3339 install_dir : rootlibexecdir)
3341 public_programs += executable(
3344 include_directories : includes,
3345 link_with : [libudevd_core],
3346 dependencies : [versiondep,
3352 install_rpath : udev_rpath,
3354 install_dir : rootbindir)
3358 systemd_shutdown_sources,
3359 include_directories : includes,
3360 link_with : [libshared],
3361 dependencies : [libmount],
3362 install_rpath : rootlibexecdir,
3364 install_dir : rootlibexecdir)
3367 'systemd-update-done',
3368 'src/update-done/update-done.c',
3369 include_directories : includes,
3370 link_with : [libshared],
3371 install_rpath : rootlibexecdir,
3373 install_dir : rootlibexecdir)
3376 'systemd-update-utmp',
3377 'src/update-utmp/update-utmp.c',
3378 include_directories : includes,
3379 link_with : [libshared],
3380 dependencies : [libaudit],
3381 install_rpath : rootlibexecdir,
3382 install : (conf.get('ENABLE_UTMP') == 1),
3383 install_dir : rootlibexecdir)
3385 if conf.get('HAVE_KMOD') == 1
3387 'systemd-modules-load',
3388 'src/modules-load/modules-load.c',
3389 include_directories : includes,
3390 link_with : [libshared],
3391 dependencies : [libkmod],
3392 install_rpath : rootlibexecdir,
3394 install_dir : rootlibexecdir)
3396 meson.add_install_script('sh', '-c',
3397 mkdir_p.format(modulesloaddir))
3398 if install_sysconfdir
3399 meson.add_install_script('sh', '-c',
3400 mkdir_p.format(sysconfdir / 'modules-load.d'))
3404 public_programs += executable(
3406 systemd_nspawn_sources,
3407 include_directories : includes,
3408 link_with : [libnspawn_core,
3410 dependencies : [libblkid,
3412 install_rpath : rootlibexecdir,
3415 if conf.get('ENABLE_NETWORKD') == 1
3418 systemd_networkd_sources,
3419 include_directories : network_includes,
3420 link_with : [libnetworkd_core,
3422 networkd_link_with],
3423 dependencies : [threads],
3424 install_rpath : rootlibexecdir,
3426 install_dir : rootlibexecdir)
3429 'systemd-networkd-wait-online',
3430 systemd_networkd_wait_online_sources,
3431 include_directories : includes,
3432 link_with : [networkd_link_with],
3433 install_rpath : rootlibexecdir,
3435 install_dir : rootlibexecdir)
3437 public_programs += executable(
3440 include_directories : libsystemd_network_includes,
3441 link_with : [libsystemd_network,
3442 networkd_link_with],
3443 install_rpath : rootlibexecdir,
3445 install_dir : rootbindir)
3448 'systemd-network-generator',
3449 network_generator_sources,
3450 include_directories : includes,
3451 link_with : [networkd_link_with],
3452 install_rpath : rootlibexecdir,
3454 install_dir : rootlibexecdir)
3456 if want_tests != 'false'
3457 test('test-network-generator-conversion',
3458 test_network_generator_conversion_sh,
3459 # https://github.com/mesonbuild/meson/issues/2681
3460 args : exe.full_path())
3465 'systemd-sulogin-shell',
3466 'src/sulogin-shell/sulogin-shell.c',
3467 include_directories : includes,
3468 link_with : [libshared],
3469 install_rpath : rootlibexecdir,
3471 install_dir : rootlibexecdir)
3473 ############################################################
3476 'systemd-runtest.env',
3477 output : 'systemd-runtest.env',
3478 command : [sh, '-c',
3479 '{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
3480 project_source_root / 'test',
3481 project_build_root / 'catalog')],
3482 build_by_default : true)
3484 test_cflags = ['-DTEST_CODE=1']
3485 # We intentionally do not do inline initializations with definitions for a
3486 # bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
3487 # use the variable unexpectedly. This triggers a lot of maybe-uninitialized
3488 # false positives when the combination of -O2 and -flto is used. Suppress them.
3489 if '-O2' in get_option('c_args') and '-flto=auto' in get_option('c_args')
3490 test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
3493 foreach tuple : tests
3495 link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
3496 dependencies = tuple.length() > 2 ? tuple[2] : []
3497 incs = tuple.length() > 3 and tuple[3].length() > 0 ? tuple[3] : includes
3498 condition = tuple.length() > 4 ? tuple[4] : ''
3499 type = tuple.length() > 5 ? tuple[5] : ''
3500 defs = tuple.length() > 6 ? tuple[6] : []
3502 parallel = tuple.length() > 7 ? tuple[7] : true
3505 name = sources[0].split('/')[-1].split('.')[0]
3506 if type.startswith('timeout=')
3507 timeout = type.split('=')[1].to_int()
3511 if condition == '' or conf.get(condition) == 1
3515 include_directories : incs,
3516 link_with : link_with,
3517 dependencies : [versiondep,
3520 build_by_default : want_tests != 'false',
3521 install_rpath : rootlibexecdir,
3522 install : install_tests,
3523 install_dir : testsdir / type)
3526 message('@0@ is a manual test'.format(name))
3527 elif type == 'unsafe' and want_tests != 'unsafe'
3528 message('@0@ is an unsafe test'.format(name))
3529 elif want_tests != 'false'
3535 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
3540 'test-libsystemd-sym',
3541 test_libsystemd_sym_c,
3542 include_directories : includes,
3543 link_with : [libsystemd],
3544 build_by_default : want_tests != 'false',
3545 install : install_tests,
3546 install_dir : testsdir)
3547 if want_tests != 'false'
3548 test('test-libsystemd-sym', exe)
3552 'test-libsystemd-static-sym',
3553 test_libsystemd_sym_c,
3554 include_directories : includes,
3555 link_with : [install_libsystemd_static],
3556 dependencies : [threads], # threads is already included in dependencies on the library,
3557 # but does not seem to get propagated. Add here as a work-around.
3558 build_by_default : want_tests != 'false' and static_libsystemd_pic,
3559 install : install_tests and static_libsystemd_pic,
3560 install_dir : testsdir)
3561 if want_tests != 'false' and static_libsystemd_pic
3562 test('test-libsystemd-static-sym', exe)
3568 include_directories : libudev_includes,
3569 c_args : ['-Wno-deprecated-declarations'] + test_cflags,
3570 link_with : [libudev],
3571 build_by_default : want_tests != 'false',
3572 install : install_tests,
3573 install_dir : testsdir)
3574 if want_tests != 'false'
3575 test('test-libudev-sym', exe)
3579 'test-libudev-static-sym',
3581 include_directories : libudev_includes,
3582 c_args : ['-Wno-deprecated-declarations'] + test_cflags,
3583 link_with : [install_libudev_static],
3584 build_by_default : want_tests != 'false' and static_libudev_pic,
3585 install : install_tests and static_libudev_pic,
3586 install_dir : testsdir)
3587 if want_tests != 'false' and static_libudev_pic
3588 test('test-libudev-static-sym', exe)
3591 ############################################################
3595 foreach tuple : fuzzers
3597 link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]
3598 dependencies = tuple.length() > 2 ? tuple[2] : []
3599 incs = tuple.length() > 3 and tuple[3].length() > 0 ? tuple[3] : includes
3600 defs = tuple.length() > 4 ? tuple[4] : []
3604 dependencies += fuzzing_engine
3606 if fuzzing_engine.found()
3607 dependencies += fuzzing_engine
3609 link_args += ['-fsanitize=fuzzer']
3612 sources += 'src/fuzz/fuzz-main.c'
3615 name = sources[0].split('/')[-1].split('.')[0]
3620 include_directories : [incs, include_directories('src/fuzz')],
3621 link_with : link_with,
3622 dependencies : dependencies,
3623 c_args : defs + test_cflags,
3624 link_args: link_args,
3626 build_by_default : fuzzer_build)
3629 if want_tests != 'false'
3630 # Run the fuzz regression tests without any sanitizers enabled.
3631 # Additional invocations with sanitizers may be added below.
3632 foreach p : fuzz_regression_tests
3633 b = p.split('/')[-2]
3634 c = p.split('/')[-1]
3637 test('@0@_@1@'.format(b, c),
3639 args : [project_source_root / p])
3645 alias_target('fuzzers', fuzzer_exes)
3647 ############################################################
3649 subdir('modprobe.d')
3651 subdir('sysusers.d')
3652 subdir('tmpfiles.d')
3658 subdir('shell-completion/bash')
3659 subdir('shell-completion/zsh')
3660 subdir('docs/sysvinit')
3661 subdir('docs/var-log')
3663 install_subdir('factory/etc',
3664 install_dir : factorydir)
3666 if install_sysconfdir
3667 install_data('xorg/50-systemd-user.sh',
3668 install_dir : xinitrcdir)
3670 install_data('LICENSE.GPL2',
3674 'docs/CODING_STYLE.md',
3675 'docs/DISTRO_PORTING.md',
3676 'docs/ENVIRONMENT.md',
3678 'docs/TRANSIENT-SETTINGS.md',
3679 'docs/TRANSLATORS.md',
3680 'docs/UIDS-GIDS.md',
3681 'docs/GVARIANT-SERIALIZATION.md',
3682 install_dir : docdir)
3684 install_subdir('LICENSES',
3685 install_dir : docdir)
3687 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
3688 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
3690 ############################################################
3692 # Ensure that changes to the docs/ directory do not break the
3693 # basic Github pages build. But only run it in developer mode,
3694 # as it might be fragile due to changes in the tooling, and it is
3695 # not generally useful for users.
3696 jekyll = find_program('jekyll', required : false)
3697 if get_option('mode') == 'developer' and want_tests != 'false' and jekyll.found()
3698 test('github-pages',
3701 '--source', project_source_root / 'docs',
3702 '--destination', project_build_root / '_site'])
3705 ############################################################
3707 check_help = find_program('tools/check-help.sh')
3709 foreach exec : public_programs
3710 name = exec.full_path().split('/')[-1]
3711 if want_tests != 'false'
3712 test('check-help-' + name,
3714 args : exec.full_path())
3718 ############################################################
3720 check_directives_sh = find_program('tools/check-directives.sh')
3722 if want_tests != 'false'
3723 test('check-directives',
3724 check_directives_sh,
3725 args : [project_source_root, project_build_root])
3728 ############################################################
3730 # Enable tests for all supported sanitizers
3731 foreach tuple : sanitizers
3732 sanitizer = tuple[0]
3735 if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer))
3737 foreach p : fuzz_regression_tests
3738 b = p.split('/')[-2]
3739 c = p.split('/')[-1]
3741 name = '@0@:@1@'.format(b, sanitizer)
3744 if want_tests == 'false'
3745 message('Not compiling @0@ because tests is set to false'.format(name))
3747 exe = custom_target(
3751 command : [ln, '-fs',
3752 build.full_path() / b,
3754 build_by_default : true)
3756 message('Not compiling @0@ because fuzz-tests is set to false'.format(name))
3762 test('@0@_@1@_@2@'.format(b, c, sanitizer),
3764 env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],
3766 args : [exe.full_path(),
3767 project_source_root / p])
3774 ############################################################
3777 all_files = run_command(
3778 env, '-u', 'GIT_WORK_TREE',
3779 git, '--git-dir=@0@/.git'.format(project_source_root),
3780 'ls-files', ':/*.[ch]',
3782 if all_files.returncode() == 0
3783 all_files = files(all_files.stdout().split())
3788 command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
3791 command : [env, 'ctags', '-o', '@0@/tags'.format(project_source_root)] + all_files)
3796 git_contrib_sh = find_program('tools/git-contrib.sh')
3799 command : [git_contrib_sh])
3803 git_head = run_command(
3804 git, '--git-dir=@0@/.git'.format(project_source_root),
3805 'rev-parse', 'HEAD',
3806 check : false).stdout().strip()
3807 git_head_short = run_command(
3808 git, '--git-dir=@0@/.git'.format(project_source_root),
3809 'rev-parse', '--short=7', 'HEAD',
3810 check : false).stdout().strip()
3814 command : [git, 'archive',
3815 '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root,
3817 '--prefix', 'systemd-@0@/'.format(git_head),
3821 ############################################################
3823 check_api_docs_sh = find_program('tools/check-api-docs.sh')
3826 depends : [man, libsystemd, libudev],
3827 command : [check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
3829 alias_target('update-dbus-docs', update_dbus_docs)
3830 alias_target('update-man-rules', update_man_rules)
3832 ############################################################
3834 alt_time_epoch = run_command('date', '-Is', '-u', '-d', '@@0@'.format(time_epoch),
3835 check : true).stdout().strip()
3838 'build mode' : get_option('mode'),
3839 'split /usr' : split_usr,
3840 'split bin-sbin' : split_bin,
3841 'prefix directory' : prefixdir,
3842 'rootprefix directory' : rootprefixdir,
3843 'sysconf directory' : sysconfdir,
3844 'include directory' : includedir,
3845 'lib directory' : libdir,
3846 'rootlib directory' : rootlibdir,
3847 'SysV init scripts' : sysvinit_path,
3848 'SysV rc?.d directories' : sysvrcnd_path,
3849 'PAM modules directory' : pamlibdir,
3850 'PAM configuration directory' : pamconfdir,
3851 'libcryptsetup plugins directory' : libcryptsetup_plugins_dir,
3852 'RPM macros directory' : rpmmacrosdir,
3853 'modprobe.d directory' : modprobedir,
3854 'D-Bus policy directory' : dbuspolicydir,
3855 'D-Bus session directory' : dbussessionservicedir,
3856 'D-Bus system directory' : dbussystemservicedir,
3857 'bash completions directory' : bashcompletiondir,
3858 'zsh completions directory' : zshcompletiondir,
3859 'extra start script' : get_option('rc-local'),
3860 'debug shell' : '@0@ @ @1@'.format(get_option('debug-shell'),
3861 get_option('debug-tty')),
3862 'system UIDs' : '<=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_UID_MAX'),
3863 conf.get('SYSTEM_ALLOC_UID_MIN')),
3864 'system GIDs' : '<=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_GID_MAX'),
3865 conf.get('SYSTEM_ALLOC_GID_MIN')),
3866 'dynamic UIDs' : '@0@…@1@'.format(dynamic_uid_min, dynamic_uid_max),
3867 'container UID bases' : '@0@…@1@'.format(container_uid_base_min, container_uid_base_max),
3868 'static UID/GID allocations' : ' '.join(static_ugids),
3869 '/dev/kvm access mode' : get_option('dev-kvm-mode'),
3870 'render group access mode' : get_option('group-render-mode'),
3871 'certificate root directory' : get_option('certificate-root'),
3872 'support URL' : support_url,
3873 'nobody user name' : nobody_user,
3874 'nobody group name' : nobody_group,
3875 'fallback hostname' : get_option('fallback-hostname'),
3876 'default DNSSEC mode' : default_dnssec,
3877 'default DNS-over-TLS mode' : default_dns_over_tls,
3878 'default mDNS mode' : default_mdns,
3879 'default LLMNR mode' : default_llmnr,
3880 'default DNS servers' : dns_servers.split(' '),
3881 'default NTP servers' : ntp_servers.split(' '),
3882 'default cgroup hierarchy' : default_hierarchy,
3883 'default net.naming-scheme value' : default_net_naming_scheme,
3884 'default KillUserProcesses value' : kill_user_processes,
3885 'default locale' : default_locale,
3886 'default user $PATH' :
3887 default_user_path != '' ? default_user_path : '(same as system services)',
3888 'systemd service watchdog' : service_watchdog == '' ? 'disabled' : service_watchdog,
3889 'time epoch' : '@0@ (@1@)'.format(time_epoch, alt_time_epoch)})
3892 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3893 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3894 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3896 if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_GNU_EFI') == 1
3898 'EFI machine type' : efi_arch[0],
3899 'EFI CC' : '@0@'.format(' '.join(efi_cc)),
3900 'EFI lds' : efi_lds,
3901 'EFI crt0' : efi_crt0,
3902 'EFI include directory' : efi_incdir},
3903 section : 'Extensible Firmware Interface')
3925 ['libcryptsetup-plugins'],
3951 ['bpf-framework', conf.get('BPF_FRAMEWORK') == 1],
3963 ['kernel-install', get_option('kernel-install')],
3981 ['systemd-analyze', conf.get('ENABLE_ANALYZE') == 1],
3994 ['legacy-pkla', install_polkit_pkla],
3999 ['man pages', want_man],
4000 ['html pages', want_html],
4001 ['man page indices', want_man and have_lxml],
4003 ['compat-mutable-uid-boundaries'],
4006 ['adm group', get_option('adm-group')],
4007 ['wheel group', get_option('wheel-group')],
4010 ['debug mmap cache'],
4012 ['valgrind', conf.get('VALGRIND') == 1],
4013 ['trace logging', conf.get('LOG_TRACE') == 1],
4014 ['install tests', install_tests],
4015 ['link-udev-shared', get_option('link-udev-shared')],
4016 ['link-systemctl-shared', get_option('link-systemctl-shared')],
4017 ['link-networkd-shared', get_option('link-networkd-shared')],
4018 ['link-timesyncd-shared', get_option('link-timesyncd-shared')],
4020 ['standalone-binaries', get_option('standalone-binaries')],
4023 if tuple.length() >= 2
4026 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
4027 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
4028 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
4037 if static_libsystemd == 'false'
4038 missing += 'static-libsystemd'
4040 found += 'static-libsystemd(@0@)'.format(static_libsystemd)
4043 if static_libudev == 'false'
4044 missing += 'static-libudev'
4046 found += 'static-libudev(@0@)'.format(static_libudev)
4049 if conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 and conf.get('PREFER_OPENSSL') == 1
4050 found += 'cryptolib(openssl)'
4051 elif conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1
4052 found += 'cryptolib(gcrypt)'
4054 missing += 'cryptolib'
4057 if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
4058 found += 'DNS-over-TLS(gnutls)'
4059 elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1
4060 found += 'DNS-over-TLS(openssl)'
4062 missing += 'DNS-over-TLS'
4066 'enabled' : ', '.join(found),
4067 'disabled' : ', '.join(missing)},
4068 section : 'Features')
4070 if rootprefixdir != rootprefix_default
4072 'Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
4073 'systemd used fixed names for unit file directories and other paths, so anything\n' +
4074 'except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))