1 # SPDX-License-Identifier: LGPL-2.1+
3 project('systemd', 'c',
13 meson_version : '>= 0.46',
16 libsystemd_version = '0.27.1'
17 libudev_version = '1.6.16'
19 # We need the same data in two different formats, ugh!
20 # Also, for hysterical reasons, we use different variable
21 # names, sometimes. Not all variables are included in every
23 conf = configuration_data()
24 conf.set('PROJECT_VERSION', meson.project_version())
26 substs = configuration_data()
27 substs.set('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
28 substs.set('PROJECT_VERSION', meson.project_version())
30 # This is to be used instead of meson.source_root(), as the latter will return
31 # the wrong result when systemd is being built as a meson subproject
32 project_source_root = meson.current_source_dir()
33 #relative_source_path = run_command('realpath',
34 # '--relative-to=@0@'.format(meson.current_build_dir()),
35 # project_source_root).stdout().strip()
36 relative_source_path = '..'
37 conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
39 want_ossfuzz = get_option('oss-fuzz')
40 want_libfuzzer = get_option('llvm-fuzz')
41 want_fuzzbuzz = get_option('fuzzbuzz')
42 if want_ossfuzz + want_libfuzzer + want_fuzzbuzz > 1
43 error('only one of oss-fuzz, llvm-fuzz or fuzzbuzz can be specified')
46 skip_deps = want_ossfuzz or want_libfuzzer
47 fuzzer_build = want_ossfuzz or want_libfuzzer or want_fuzzbuzz
49 #####################################################################
51 # Try to install the git pre-commit hook
52 git_hook = run_command(join_paths(project_source_root, 'tools/add-git-hook.sh'))
53 if git_hook.returncode() == 0
54 message(git_hook.stdout().strip())
57 #####################################################################
59 if get_option('split-usr') == 'auto'
60 split_usr = run_command('test', '-L', '/bin').returncode() != 0
62 split_usr = get_option('split-usr') == 'true'
64 conf.set10('HAVE_SPLIT_USR', split_usr,
65 description : '/usr/bin and /bin directories are separate')
67 if get_option('split-bin') == 'auto'
68 split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
70 split_bin = get_option('split-bin') == 'true'
72 conf.set10('HAVE_SPLIT_BIN', split_bin,
73 description : 'bin and sbin directories are separate')
75 rootprefixdir = get_option('rootprefix')
76 # Unusual rootprefixdir values are used by some distros
77 # (see https://github.com/systemd/systemd/pull/7461).
78 rootprefix_default = split_usr ? '/' : '/usr'
79 if rootprefixdir == ''
80 rootprefixdir = rootprefix_default
82 rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
84 sysvinit_path = get_option('sysvinit-path')
85 sysvrcnd_path = get_option('sysvrcnd-path')
86 conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',
87 description : 'SysV init scripts and rcN.d links are supported')
89 conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
90 conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
91 conf.set('HIGH_RLIMIT_NOFILE', 512*1024)
93 # join_paths ignores the preceding arguments if an absolute component is
94 # encountered, so this should canonicalize various paths when they are
95 # absolute or relative.
96 prefixdir = get_option('prefix')
97 if not prefixdir.startswith('/')
98 error('Prefix is not absolute: "@0@"'.format(prefixdir))
100 bindir = join_paths(prefixdir, get_option('bindir'))
101 libdir = join_paths(prefixdir, get_option('libdir'))
102 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
103 includedir = join_paths(prefixdir, get_option('includedir'))
104 datadir = join_paths(prefixdir, get_option('datadir'))
105 localstatedir = join_paths('/', get_option('localstatedir'))
107 rootbindir = join_paths(rootprefixdir, 'bin')
108 rootsbindir = join_paths(rootprefixdir, split_bin ? 'sbin' : 'bin')
109 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
111 rootlibdir = get_option('rootlibdir')
113 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
116 # Dirs of external packages
117 pkgconfigdatadir = get_option('pkgconfigdatadir') == '' ? join_paths(datadir, 'pkgconfig') : get_option('pkgconfigdatadir')
118 pkgconfiglibdir = get_option('pkgconfiglibdir') == '' ? join_paths(libdir, 'pkgconfig') : get_option('pkgconfiglibdir')
119 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
120 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
121 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
122 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
123 rpmmacrosdir = get_option('rpmmacrosdir')
124 if rpmmacrosdir != 'no'
125 rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
127 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
130 pkgdatadir = join_paths(datadir, 'systemd')
131 environmentdir = join_paths(prefixdir, 'lib/environment.d')
132 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
133 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
134 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
135 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
136 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
137 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
138 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
139 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
140 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
141 pkgincludedir = join_paths(includedir, 'systemd')
142 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
143 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
144 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
145 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
146 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
147 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
148 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
149 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
150 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
151 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
152 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
153 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
154 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
155 factorydir = join_paths(datadir, 'factory')
156 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
157 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
158 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
159 catalogstatedir = join_paths(systemdstatedir, 'catalog')
160 randomseeddir = join_paths(localstatedir, 'lib/systemd')
161 profiledir = join_paths(rootlibexecdir, 'portable', 'profile')
162 ntpservicelistdir = join_paths(rootprefixdir, 'lib/systemd/ntp-units.d')
164 docdir = get_option('docdir')
166 docdir = join_paths(datadir, 'doc/systemd')
169 dbuspolicydir = get_option('dbuspolicydir')
170 if dbuspolicydir == ''
171 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
174 dbussessionservicedir = get_option('dbussessionservicedir')
175 if dbussessionservicedir == ''
176 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
179 dbussystemservicedir = get_option('dbussystemservicedir')
180 if dbussystemservicedir == ''
181 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
184 pamlibdir = get_option('pamlibdir')
186 pamlibdir = join_paths(rootlibdir, 'security')
189 pamconfdir = get_option('pamconfdir')
191 pamconfdir = join_paths(sysconfdir, 'pam.d')
194 memory_accounting_default = get_option('memory-accounting-default')
195 status_unit_format_default = get_option('status-unit-format-default')
197 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
198 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
199 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
200 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
201 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
202 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
204 conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper())
206 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
207 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
208 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
209 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
210 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
211 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
212 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
213 conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
214 conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
215 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
216 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
217 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
218 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
219 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
220 conf.set_quoted('ROOTPREFIX', rootprefixdir)
221 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
222 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
223 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
224 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
225 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
226 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
227 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
228 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
229 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
230 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
231 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
232 conf.set_quoted('SYSTEMD_TEST_DATA', join_paths(testsdir, 'testdata'))
233 conf.set_quoted('SYSTEMD_CATALOG_DIR', catalogdir)
234 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
235 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
236 conf.set_quoted('LIBDIR', libdir)
237 conf.set_quoted('ROOTLIBDIR', rootlibdir)
238 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
239 conf.set_quoted('BOOTLIBDIR', bootlibdir)
240 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
241 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
242 conf.set_quoted('SYSTEMD_IMPORT_FS_PATH', join_paths(rootlibexecdir, 'systemd-import-fs'))
243 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
244 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
245 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
246 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
247 conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default)
248 conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
249 conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper())
251 substs.set('prefix', prefixdir)
252 substs.set('rootprefix', rootprefixdir)
253 substs.set('rootprefix_noslash', rootprefixdir_noslash)
254 substs.set('exec_prefix', prefixdir)
255 substs.set('libdir', libdir)
256 substs.set('rootlibdir', rootlibdir)
257 substs.set('includedir', includedir)
258 substs.set('sysconfdir', sysconfdir)
259 substs.set('bindir', bindir)
260 substs.set('rootbindir', rootbindir)
261 substs.set('rootlibexecdir', rootlibexecdir)
262 substs.set('systemunitdir', systemunitdir)
263 substs.set('userunitdir', userunitdir)
264 substs.set('systempresetdir', systempresetdir)
265 substs.set('userpresetdir', userpresetdir)
266 substs.set('udevhwdbdir', udevhwdbdir)
267 substs.set('udevrulesdir', udevrulesdir)
268 substs.set('udevlibexecdir', udevlibexecdir)
269 substs.set('environmentdir', environmentdir)
270 substs.set('catalogdir', catalogdir)
271 substs.set('tmpfilesdir', tmpfilesdir)
272 substs.set('sysusersdir', sysusersdir)
273 substs.set('sysctldir', sysctldir)
274 substs.set('binfmtdir', binfmtdir)
275 substs.set('modulesloaddir', modulesloaddir)
276 substs.set('modprobedir', modprobedir)
277 substs.set('systemgeneratordir', systemgeneratordir)
278 substs.set('usergeneratordir', usergeneratordir)
279 substs.set('systemenvgeneratordir', systemenvgeneratordir)
280 substs.set('userenvgeneratordir', userenvgeneratordir)
281 substs.set('systemshutdowndir', systemshutdowndir)
282 substs.set('systemsleepdir', systemsleepdir)
283 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
284 substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
285 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
286 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
287 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
288 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
289 substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no')
290 substs.set('STATUS_UNIT_FORMAT_DEFAULT', status_unit_format_default)
291 substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE'))
292 substs.set('BUILD_ROOT', meson.current_build_dir())
294 #####################################################################
296 cc = meson.get_compiler('c')
297 pkgconfig = import('pkgconfig')
298 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
299 meson_build_sh = find_program('tools/meson-build.sh')
301 want_tests = get_option('tests')
302 slow_tests = want_tests != 'false' and get_option('slow-tests')
303 install_tests = get_option('install-tests')
305 if add_languages('cpp', required : fuzzer_build)
306 # Used only for tests
307 cxx = meson.get_compiler('cpp')
308 cxx_cmd = ' '.join(cxx.cmd_array())
314 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false)
315 if fuzzing_engine.found()
316 add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c')
317 elif cc.has_argument('-fsanitize=fuzzer-no-link')
318 add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c')
320 error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported')
323 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
325 fuzzing_engine = meson.get_compiler('cpp').find_library(get_option('fuzzbuzz-engine'), dirs: get_option('fuzzbuzz-engine-dir'))
328 # Those generate many false positives, and we do not want to change the code to
330 basic_disabled_warnings = [
331 '-Wno-unused-parameter',
332 '-Wno-missing-field-initializers',
333 '-Wno-unused-result',
334 '-Wno-format-signedness',
336 if get_option('b_ndebug') == 'true'
337 # With asserts disabled with get a bunch of warnings about variables which
338 # are used only in the asserts. This is not useful at all, so let's just silence
340 basic_disabled_warnings += [
341 '-Wno-unused-variable',
342 '-Wno-unused-but-set-variable',
346 possible_cc_flags = [
349 '-Wmissing-include-dirs',
350 '-Wold-style-definition',
354 '-Wsuggest-attribute=noreturn',
355 '-Werror=missing-prototypes',
356 '-Werror=implicit-function-declaration',
357 '-Werror=missing-declarations',
358 '-Werror=return-type',
359 '-Werror=incompatible-pointer-types',
361 '-Wstrict-prototypes',
363 '-Wmissing-noreturn',
364 '-Wimplicit-fallthrough=5',
367 '-Wstrict-aliasing=2',
370 '-Werror=shift-count-overflow',
371 '-Werror=shift-overflow=2',
375 # negative arguments are correctly detected starting with meson 0.46.
376 '-Wno-error=#warnings', # clang
377 '-Wno-string-plus-int', # clang
379 # work-around for gcc 7.1 turning this on on its own.
380 '-Wno-error=nonnull',
382 # Disable -Wmaybe-uninitialized, since it's noisy on gcc 8 with
383 # optimizations enabled, producing essentially false positives.
384 '-Wno-maybe-uninitialized',
388 '-fdiagnostics-show-option',
389 '-fno-strict-aliasing',
390 '-fvisibility=hidden',
392 '-fstack-protector-strong',
393 '--param=ssp-buffer-size=4',
396 # --as-needed and --no-undefined are provided by meson by default,
397 # run mesonconf to see what is enabled
398 possible_link_flags = [
404 if cc.get_id() == 'clang'
405 possible_cc_flags += [
406 '-Wno-typedef-redefinition',
407 '-Wno-gnu-variable-sized-type-not-at-end',
411 if get_option('buildtype') != 'debug'
412 possible_cc_flags += [
413 '-ffunction-sections',
417 possible_link_flags += '-Wl,--gc-sections'
420 add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
421 add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
422 add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
426 #include <inttypes.h>
427 typedef uint64_t usec_t;
428 usec_t now(clockid_t clock);
433 ''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing')
434 add_project_arguments('-Werror=shadow', language : 'c')
438 add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
441 cpp = ' '.join(cc.cmd_array()) + ' -E'
443 has_wstringop_truncation = cc.has_argument('-Wstringop-truncation')
445 #####################################################################
446 # compilation result tests
448 conf.set('_GNU_SOURCE', true)
449 conf.set('__SANE_USERSPACE_TYPES__', true)
450 conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation)
452 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
453 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
454 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
455 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
456 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
457 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
458 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
462 #include <sys/stat.h>
465 foreach decl : ['char16_t',
470 # We get -1 if the size cannot be determined
471 have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
473 if decl == 'struct statx'
475 want_linux_stat_h = false
477 have = cc.sizeof(decl,
478 prefix : decl_headers + '#include <linux/stat.h>',
479 args : '-D_GNU_SOURCE') > 0
480 want_linux_stat_h = have
484 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
487 conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
489 foreach ident : ['secure_getenv', '__secure_getenv']
490 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
494 ['memfd_create', '''#include <sys/mman.h>'''],
495 ['gettid', '''#include <sys/types.h>
496 #include <unistd.h>'''],
497 ['pivot_root', '''#include <stdlib.h>
498 #include <unistd.h>'''], # no known header declares pivot_root
499 ['name_to_handle_at', '''#include <sys/types.h>
500 #include <sys/stat.h>
501 #include <fcntl.h>'''],
502 ['setns', '''#include <sched.h>'''],
503 ['renameat2', '''#include <stdio.h>
504 #include <fcntl.h>'''],
505 ['kcmp', '''#include <linux/kcmp.h>'''],
506 ['keyctl', '''#include <sys/types.h>
507 #include <keyutils.h>'''],
508 ['copy_file_range', '''#include <sys/syscall.h>
509 #include <unistd.h>'''],
510 ['bpf', '''#include <sys/syscall.h>
511 #include <unistd.h>'''],
512 ['statx', '''#include <sys/types.h>
513 #include <sys/stat.h>
514 #include <unistd.h>'''],
515 ['explicit_bzero' , '''#include <string.h>'''],
516 ['reallocarray', '''#include <malloc.h>'''],
517 ['set_mempolicy', '''#include <stdlib.h>
518 #include <unistd.h>'''],
519 ['get_mempolicy', '''#include <stdlib.h>
520 #include <unistd.h>'''],
523 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
524 conf.set10('HAVE_' + ident[0].to_upper(), have)
527 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
528 conf.set10('USE_SYS_RANDOM_H', true)
529 conf.set10('HAVE_GETRANDOM', true)
531 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
532 conf.set10('USE_SYS_RANDOM_H', false)
533 conf.set10('HAVE_GETRANDOM', have)
536 #####################################################################
538 vcs_tagger = [project_source_root + '/tools/meson-vcs-tag.sh',
540 get_option('version-tag'),
541 meson.project_version()]
544 input : 'src/version/version.h.in',
545 output : 'version.h',
548 versiondep = declare_dependency(sources: version_h)
550 sed = find_program('sed')
551 awk = find_program('awk')
552 m4 = find_program('m4')
553 stat = find_program('stat')
554 git = find_program('git', required : false)
555 env = find_program('env')
556 perl = find_program('perl', required : false)
558 meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
559 mkdir_p = 'mkdir -p $DESTDIR/@0@'
560 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
561 splash_bmp = files('test/splash.bmp')
563 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
564 # /usr/sbin, /sbin, and fall back to the default from middle column.
565 progs = [['quotaon', '/usr/sbin/quotaon' ],
566 ['quotacheck', '/usr/sbin/quotacheck' ],
567 ['kmod', '/usr/bin/kmod' ],
568 ['kexec', '/usr/sbin/kexec' ],
569 ['sulogin', '/usr/sbin/sulogin' ],
570 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
571 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
572 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
573 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
574 ['nologin', '/usr/sbin/nologin', ],
577 path = get_option(prog[0] + '-path')
579 message('Using @1@ for @0@'.format(prog[0], path))
581 exe = find_program(prog[0],
582 '/usr/sbin/' + prog[0],
585 path = exe.found() ? exe.path() : prog[1]
587 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
588 conf.set_quoted(name, path)
589 substs.set(name, path)
592 conf.set_quoted('TELINIT', get_option('telinit-path'))
594 #if run_command('ln', '--relative', '--help').returncode() != 0
595 # error('ln does not support --relative (added in coreutils 8.16)')
598 ############################################################
600 gperf = find_program('gperf')
602 gperf_test_format = '''
604 const char * in_word_set(const char *, @0@);
607 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
608 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
609 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
610 if cc.compiles(gperf_test)
611 gperf_len_type = 'size_t'
613 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
614 if cc.compiles(gperf_test)
615 gperf_len_type = 'unsigned'
617 error('unable to determine gperf len type')
620 message('gperf len type is @0@'.format(gperf_len_type))
621 conf.set('GPERF_LEN_TYPE', gperf_len_type,
622 description : 'The type of gperf "len" parameter')
624 ############################################################
626 if not cc.has_header('sys/capability.h')
627 error('POSIX caps headers not found')
629 foreach header : ['crypt.h',
631 'linux/vm_sockets.h',
633 'valgrind/memcheck.h',
634 'valgrind/valgrind.h',
637 conf.set10('HAVE_' + header.underscorify().to_upper(),
638 cc.has_header(header))
641 ############################################################
643 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
644 conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
645 gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
647 default_hierarchy = get_option('default-hierarchy')
648 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
649 description : 'default cgroup hierarchy as string')
650 if default_hierarchy == 'legacy'
651 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
652 elif default_hierarchy == 'hybrid'
653 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
655 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
658 default_net_naming_scheme = get_option('default-net-naming-scheme')
659 conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme)
661 time_epoch = get_option('time-epoch')
664 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int()
666 conf.set('TIME_EPOCH', time_epoch)
668 system_uid_max = get_option('system-uid-max')
669 if system_uid_max == -1
670 system_uid_max = run_command(
672 '/^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
673 '/etc/login.defs').stdout().strip()
674 if system_uid_max == ''
677 system_uid_max = system_uid_max.to_int()
680 conf.set('SYSTEM_UID_MAX', system_uid_max)
681 substs.set('systemuidmax', system_uid_max)
683 system_gid_max = get_option('system-gid-max')
684 if system_gid_max == -1
685 system_gid_max = run_command(
687 '/^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
688 '/etc/login.defs').stdout().strip()
689 if system_gid_max == ''
692 system_gid_max = system_gid_max.to_int()
695 conf.set('SYSTEM_GID_MAX', system_gid_max)
696 substs.set('systemgidmax', system_gid_max)
698 dynamic_uid_min = get_option('dynamic-uid-min')
699 dynamic_uid_max = get_option('dynamic-uid-max')
700 conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
701 conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
702 substs.set('dynamicuidmin', dynamic_uid_min)
703 substs.set('dynamicuidmax', dynamic_uid_max)
705 container_uid_base_min = get_option('container-uid-base-min')
706 container_uid_base_max = get_option('container-uid-base-max')
707 conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
708 conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
709 substs.set('containeruidbasemin', container_uid_base_min)
710 substs.set('containeruidbasemax', container_uid_base_max)
712 nobody_user = get_option('nobody-user')
713 nobody_group = get_option('nobody-group')
715 if not meson.is_cross_build()
716 getent_result = run_command('getent', 'passwd', '65534')
717 if getent_result.returncode() == 0
718 name = getent_result.stdout().split(':')[0]
719 if name != nobody_user
721 '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) +
722 'Your build will result in an user table setup that is incompatible with the local system.')
725 id_result = run_command('id', '-u', nobody_user)
726 if id_result.returncode() == 0
727 id = id_result.stdout().to_int()
730 '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) +
731 'Your build will result in an user table setup that is incompatible with the local system.')
735 getent_result = run_command('getent', 'group', '65534')
736 if getent_result.returncode() == 0
737 name = getent_result.stdout().split(':')[0]
738 if name != nobody_group
740 '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) +
741 'Your build will result in an group table setup that is incompatible with the local system.')
744 id_result = run_command('id', '-g', nobody_group)
745 if id_result.returncode() == 0
746 id = id_result.stdout().to_int()
749 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
750 'Your build will result in an group table setup that is incompatible with the local system.')
754 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
756 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
757 'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
760 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
761 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
762 substs.set('NOBODY_USER_NAME', nobody_user)
763 substs.set('NOBODY_GROUP_NAME', nobody_group)
765 tty_gid = get_option('tty-gid')
766 conf.set('TTY_GID', tty_gid)
767 substs.set('TTY_GID', tty_gid)
769 # Ensure provided GID argument is numeric, otherwise fallback to default assignment
770 users_gid = get_option('users-gid')
771 substs.set('USERS_GID', users_gid < 0 ? '-' : users_gid)
773 conf.set10('ENABLE_ADM_GROUP', get_option('adm-group'))
774 conf.set10('ENABLE_WHEEL_GROUP', get_option('wheel-group'))
776 dev_kvm_mode = get_option('dev-kvm-mode')
777 substs.set('DEV_KVM_MODE', dev_kvm_mode)
778 conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666')
779 group_render_mode = get_option('group-render-mode')
780 substs.set('GROUP_RENDER_MODE', group_render_mode)
781 conf.set10('GROUP_RENDER_UACCESS', group_render_mode != '0666')
783 kill_user_processes = get_option('default-kill-user-processes')
784 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
785 conf.set_quoted('KILL_USER_PROCESSES_YES_NO', kill_user_processes ? 'yes' : 'no')
786 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
788 dns_servers = get_option('dns-servers')
789 conf.set_quoted('DNS_SERVERS', dns_servers)
790 substs.set('DNS_SERVERS', dns_servers)
792 ntp_servers = get_option('ntp-servers')
793 conf.set_quoted('NTP_SERVERS', ntp_servers)
794 substs.set('NTP_SERVERS', ntp_servers)
796 default_locale = get_option('default-locale')
797 if default_locale == ''
798 if not meson.is_cross_build()
799 choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
800 default_locale = run_command(choose_default_locale_sh).stdout().strip()
802 default_locale = 'C.UTF-8'
805 conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
807 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
809 service_watchdog = get_option('service-watchdog')
810 watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog
811 substs.set('SERVICE_WATCHDOG', watchdog_value)
813 substs.set('SUSHELL', get_option('debug-shell'))
814 substs.set('DEBUGTTY', get_option('debug-tty'))
815 conf.set_quoted('DEBUGTTY', get_option('debug-tty'))
817 enable_debug_hashmap = false
818 enable_debug_mmap_cache = false
819 enable_debug_siphash = false
820 foreach name : get_option('debug-extra')
822 enable_debug_hashmap = true
823 elif name == 'mmap-cache'
824 enable_debug_mmap_cache = true
825 elif name == 'siphash'
826 enable_debug_siphash = true
828 message('unknown debug option "@0@", ignoring'.format(name))
831 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
832 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
833 conf.set10('ENABLE_DEBUG_SIPHASH', enable_debug_siphash)
835 conf.set10('VALGRIND', get_option('valgrind'))
836 conf.set10('LOG_TRACE', get_option('log-trace'))
838 default_user_path = get_option('user-path')
839 if default_user_path != ''
840 conf.set_quoted('DEFAULT_USER_PATH', default_user_path)
841 default_user_path_display = default_user_path
843 # meson 0.49 fails when ?: is used in .format()
844 default_user_path_display = '(same as system services)'
848 #####################################################################
850 threads = dependency('threads')
851 librt = cc.find_library('rt')
852 libm = cc.find_library('m')
853 libdl = cc.find_library('dl')
854 libcrypt = cc.find_library('crypt')
856 libcap = dependency('libcap', required : false)
857 if not libcap.found()
858 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
859 libcap = cc.find_library('cap')
862 libmount = dependency('mount',
863 version : fuzzer_build ? '>= 0' : '>= 2.30')
865 want_seccomp = get_option('seccomp')
866 if want_seccomp != 'false' and not skip_deps
867 libseccomp = dependency('libseccomp',
868 version : '>= 2.3.1',
869 required : want_seccomp == 'true')
870 have = libseccomp.found()
875 conf.set10('HAVE_SECCOMP', have)
877 want_selinux = get_option('selinux')
878 if want_selinux != 'false' and not skip_deps
879 libselinux = dependency('libselinux',
880 version : '>= 2.1.9',
881 required : want_selinux == 'true')
882 have = libselinux.found()
887 conf.set10('HAVE_SELINUX', have)
889 want_apparmor = get_option('apparmor')
890 if want_apparmor != 'false' and not skip_deps
891 libapparmor = dependency('libapparmor',
892 required : want_apparmor == 'true')
893 have = libapparmor.found()
898 conf.set10('HAVE_APPARMOR', have)
900 smack_run_label = get_option('smack-run-label')
901 if smack_run_label != ''
902 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
905 want_polkit = get_option('polkit')
906 install_polkit = false
907 install_polkit_pkla = false
908 if want_polkit != 'false' and not skip_deps
909 install_polkit = true
911 libpolkit = dependency('polkit-gobject-1',
913 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
914 message('Old polkit detected, will install pkla files')
915 install_polkit_pkla = true
918 conf.set10('ENABLE_POLKIT', install_polkit)
920 want_acl = get_option('acl')
921 if want_acl != 'false' and not skip_deps
922 libacl = cc.find_library('acl', required : want_acl == 'true')
923 have = libacl.found()
928 conf.set10('HAVE_ACL', have)
930 want_audit = get_option('audit')
931 if want_audit != 'false' and not skip_deps
932 libaudit = dependency('audit', required : want_audit == 'true')
933 have = libaudit.found()
938 conf.set10('HAVE_AUDIT', have)
940 want_blkid = get_option('blkid')
941 if want_blkid != 'false' and not skip_deps
942 libblkid = dependency('blkid', required : want_blkid == 'true')
943 have = libblkid.found()
948 conf.set10('HAVE_BLKID', have)
950 want_kmod = get_option('kmod')
951 if want_kmod != 'false' and not skip_deps
952 libkmod = dependency('libkmod',
954 required : want_kmod == 'true')
955 have = libkmod.found()
960 conf.set10('HAVE_KMOD', have)
962 want_pam = get_option('pam')
963 if want_pam != 'false' and not skip_deps
964 libpam = cc.find_library('pam', required : want_pam == 'true')
965 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
966 have = libpam.found() and libpam_misc.found()
972 conf.set10('HAVE_PAM', have)
974 want_microhttpd = get_option('microhttpd')
975 if want_microhttpd != 'false' and not skip_deps
976 libmicrohttpd = dependency('libmicrohttpd',
977 version : '>= 0.9.33',
978 required : want_microhttpd == 'true')
979 have = libmicrohttpd.found()
984 conf.set10('HAVE_MICROHTTPD', have)
986 want_libcryptsetup = get_option('libcryptsetup')
987 if want_libcryptsetup != 'false' and not skip_deps
988 libcryptsetup = dependency('libcryptsetup',
989 version : '>= 2.0.1',
990 required : want_libcryptsetup == 'true')
991 have = libcryptsetup.found()
996 conf.set10('HAVE_LIBCRYPTSETUP', have)
998 want_libcurl = get_option('libcurl')
999 if want_libcurl != 'false' and not skip_deps
1000 libcurl = dependency('libcurl',
1001 version : '>= 7.32.0',
1002 required : want_libcurl == 'true')
1003 have = libcurl.found()
1008 conf.set10('HAVE_LIBCURL', have)
1010 want_libidn = get_option('libidn')
1011 want_libidn2 = get_option('libidn2')
1012 if want_libidn == 'true' and want_libidn2 == 'true'
1013 error('libidn and libidn2 cannot be requested simultaneously')
1016 if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps
1017 libidn = dependency('libidn2',
1018 required : want_libidn2 == 'true')
1019 have = libidn.found()
1024 conf.set10('HAVE_LIBIDN2', have)
1025 if not have and want_libidn != 'false' and not skip_deps
1026 # libidn is used for both libidn and libidn2 objects
1027 libidn = dependency('libidn',
1028 required : want_libidn == 'true')
1029 have = libidn.found()
1033 conf.set10('HAVE_LIBIDN', have)
1035 want_libiptc = get_option('libiptc')
1036 if want_libiptc != 'false' and not skip_deps
1037 libiptc = dependency('libiptc',
1038 required : want_libiptc == 'true')
1039 have = libiptc.found()
1044 conf.set10('HAVE_LIBIPTC', have)
1046 want_qrencode = get_option('qrencode')
1047 if want_qrencode != 'false' and not skip_deps
1048 libqrencode = dependency('libqrencode',
1049 required : want_qrencode == 'true')
1050 have = libqrencode.found()
1055 conf.set10('HAVE_QRENCODE', have)
1057 want_gcrypt = get_option('gcrypt')
1058 if want_gcrypt != 'false' and not skip_deps
1059 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1060 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1061 have = libgcrypt.found() and libgpg_error.found()
1066 # link to neither of the libs if one is not found
1070 conf.set10('HAVE_GCRYPT', have)
1072 want_gnutls = get_option('gnutls')
1073 if want_gnutls != 'false' and not skip_deps
1074 libgnutls = dependency('gnutls',
1075 version : '>= 3.1.4',
1076 required : want_gnutls == 'true')
1077 have = libgnutls.found()
1082 conf.set10('HAVE_GNUTLS', have)
1084 want_openssl = get_option('openssl')
1085 if want_openssl != 'false' and not skip_deps
1086 libopenssl = dependency('openssl',
1087 version : '>= 1.1.0',
1088 required : want_openssl == 'true')
1089 have = libopenssl.found()
1094 conf.set10('HAVE_OPENSSL', have)
1096 want_elfutils = get_option('elfutils')
1097 if want_elfutils != 'false' and not skip_deps
1098 libdw = dependency('libdw',
1099 required : want_elfutils == 'true')
1100 have = libdw.found()
1105 conf.set10('HAVE_ELFUTILS', have)
1107 want_zlib = get_option('zlib')
1108 if want_zlib != 'false' and not skip_deps
1109 libz = dependency('zlib',
1110 required : want_zlib == 'true')
1116 conf.set10('HAVE_ZLIB', have)
1118 want_bzip2 = get_option('bzip2')
1119 if want_bzip2 != 'false' and not skip_deps
1120 libbzip2 = cc.find_library('bz2',
1121 required : want_bzip2 == 'true')
1122 have = libbzip2.found()
1127 conf.set10('HAVE_BZIP2', have)
1129 want_xz = get_option('xz')
1130 if want_xz != 'false' and not skip_deps
1131 libxz = dependency('liblzma',
1132 required : want_xz == 'true')
1133 have = libxz.found()
1138 conf.set10('HAVE_XZ', have)
1140 want_lz4 = get_option('lz4')
1141 if want_lz4 != 'false' and not skip_deps
1142 liblz4 = dependency('liblz4',
1143 version : '>= 1.3.0',
1144 required : want_lz4 == 'true')
1145 have = liblz4.found()
1150 conf.set10('HAVE_LZ4', have)
1152 want_xkbcommon = get_option('xkbcommon')
1153 if want_xkbcommon != 'false' and not skip_deps
1154 libxkbcommon = dependency('xkbcommon',
1155 version : '>= 0.3.0',
1156 required : want_xkbcommon == 'true')
1157 have = libxkbcommon.found()
1162 conf.set10('HAVE_XKBCOMMON', have)
1164 want_pcre2 = get_option('pcre2')
1165 if want_pcre2 != 'false'
1166 libpcre2 = dependency('libpcre2-8',
1167 required : want_pcre2 == 'true')
1168 have = libpcre2.found()
1173 conf.set10('HAVE_PCRE2', have)
1175 want_glib = get_option('glib')
1176 if want_glib != 'false' and not skip_deps
1177 libglib = dependency('glib-2.0',
1178 version : '>= 2.22.0',
1179 required : want_glib == 'true')
1180 libgobject = dependency('gobject-2.0',
1181 version : '>= 2.22.0',
1182 required : want_glib == 'true')
1183 libgio = dependency('gio-2.0',
1184 required : want_glib == 'true')
1185 have = libglib.found() and libgobject.found() and libgio.found()
1192 conf.set10('HAVE_GLIB', have)
1194 want_dbus = get_option('dbus')
1195 if want_dbus != 'false' and not skip_deps
1196 libdbus = dependency('dbus-1',
1197 version : '>= 1.3.2',
1198 required : want_dbus == 'true')
1199 have = libdbus.found()
1204 conf.set10('HAVE_DBUS', have)
1206 default_dnssec = get_option('default-dnssec')
1208 default_dnssec = 'no'
1210 if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1211 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1212 default_dnssec = 'no'
1214 conf.set('DEFAULT_DNSSEC_MODE',
1215 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1216 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1218 dns_over_tls = get_option('dns-over-tls')
1219 if dns_over_tls != 'false'
1220 if dns_over_tls == 'openssl'
1223 have_gnutls = (conf.get('HAVE_GNUTLS') == 1 and libgnutls.version().version_compare('>= 3.6.0'))
1224 if dns_over_tls == 'gnutls' and not have_gnutls
1225 error('DNS-over-TLS support was requested with gnutls, but dependencies are not available')
1228 if dns_over_tls == 'gnutls' or have_gnutls
1229 have_openssl = false
1231 have_openssl = conf.get('HAVE_OPENSSL') == 1
1232 if dns_over_tls != 'auto' and not have_openssl
1233 str = dns_over_tls == 'openssl' ? ' with openssl' : ''
1234 error('DNS-over-TLS support was requested@0@, but dependencies are not available'.format(str))
1237 have = have_gnutls or have_openssl
1241 have_openssl = false
1243 conf.set10('ENABLE_DNS_OVER_TLS', have)
1244 conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
1245 conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl)
1247 default_dns_over_tls = get_option('default-dns-over-tls')
1249 default_dns_over_tls = 'no'
1251 if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0
1252 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.')
1253 default_dns_over_tls = 'no'
1255 conf.set('DEFAULT_DNS_OVER_TLS_MODE',
1256 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper())
1257 substs.set('DEFAULT_DNS_OVER_TLS_MODE', default_dns_over_tls)
1259 want_importd = get_option('importd')
1260 if want_importd != 'false'
1261 have = (conf.get('HAVE_LIBCURL') == 1 and
1262 conf.get('HAVE_ZLIB') == 1 and
1263 conf.get('HAVE_XZ') == 1 and
1264 conf.get('HAVE_GCRYPT') == 1)
1265 if want_importd == 'true' and not have
1266 error('importd support was requested, but dependencies are not available')
1271 conf.set10('ENABLE_IMPORTD', have)
1273 want_remote = get_option('remote')
1274 if want_remote != 'false'
1275 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1276 conf.get('HAVE_LIBCURL') == 1]
1277 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1278 # it's possible to build one without the other. Complain only if
1279 # support was explicitly requested. The auxiliary files like sysusers
1280 # config should be installed when any of the programs are built.
1281 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1282 error('remote support was requested, but dependencies are not available')
1284 have = have_deps[0] or have_deps[1]
1288 conf.set10('ENABLE_REMOTE', have)
1290 foreach term : ['utmp',
1324 have = get_option(term)
1325 name = 'ENABLE_' + term.underscorify().to_upper()
1326 conf.set10(name, have)
1329 foreach tuple : [['nss-mymachines', 'machined'],
1330 ['nss-resolve', 'resolve']]
1331 want = get_option(tuple[0])
1333 have = get_option(tuple[1])
1334 if want == 'true' and not have
1335 error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
1340 name = 'ENABLE_' + tuple[0].underscorify().to_upper()
1341 conf.set10(name, have)
1345 foreach term : ['ENABLE_NSS_MYHOSTNAME',
1346 'ENABLE_NSS_MYMACHINES',
1347 'ENABLE_NSS_RESOLVE',
1348 'ENABLE_NSS_SYSTEMD']
1349 if conf.get(term) == 1
1353 conf.set10('ENABLE_NSS', enable_nss)
1355 conf.set10('ENABLE_TIMEDATECTL', get_option('timedated') or get_option('timesyncd'))
1360 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
1362 #####################################################################
1364 if get_option('efi')
1365 efi_arch = host_machine.cpu_family()
1367 if efi_arch == 'x86'
1368 EFI_MACHINE_TYPE_NAME = 'ia32'
1369 gnu_efi_arch = 'ia32'
1370 elif efi_arch == 'x86_64'
1371 EFI_MACHINE_TYPE_NAME = 'x64'
1372 gnu_efi_arch = 'x86_64'
1373 elif efi_arch == 'arm'
1374 EFI_MACHINE_TYPE_NAME = 'arm'
1375 gnu_efi_arch = 'arm'
1376 elif efi_arch == 'aarch64'
1377 EFI_MACHINE_TYPE_NAME = 'aa64'
1378 gnu_efi_arch = 'aarch64'
1380 EFI_MACHINE_TYPE_NAME = ''
1385 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1387 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
1391 conf.set10('ENABLE_EFI', have)
1393 #####################################################################
1395 config_h = configure_file(
1396 output : 'config.h',
1397 configuration : conf)
1399 meson_apply_m4 = find_program('tools/meson-apply-m4.sh')
1401 includes = include_directories('src/basic',
1406 'src/journal-remote',
1410 'src/time-wait-sync',
1416 'src/libsystemd/sd-bus',
1417 'src/libsystemd/sd-device',
1418 'src/libsystemd/sd-event',
1419 'src/libsystemd/sd-hwdb',
1420 'src/libsystemd/sd-id128',
1421 'src/libsystemd/sd-netlink',
1422 'src/libsystemd/sd-network',
1423 'src/libsystemd/sd-resolve',
1424 'src/libsystemd-network',
1427 add_project_arguments('-include', 'config.h', language : 'c')
1429 generate_gperfs = find_program('tools/generate-gperfs.py')
1433 subdir('src/systemd')
1435 subdir('src/libsystemd')
1436 subdir('src/libsystemd-network')
1437 subdir('src/journal')
1440 libjournal_core = static_library(
1442 libjournal_core_sources,
1444 include_directories : includes,
1447 libsystemd_sym_path = '@0@/@1@'.format(project_source_root, libsystemd_sym)
1448 libsystemd = shared_library(
1451 version : libsystemd_version,
1452 include_directories : includes,
1453 link_args : ['-shared',
1454 '-Wl,--version-script=' + libsystemd_sym_path],
1455 link_with : [libbasic,
1457 link_whole : [libsystemd_static,
1459 dependencies : [threads,
1463 link_depends : libsystemd_sym,
1465 install_dir : rootlibdir)
1467 static_libsystemd = get_option('static-libsystemd')
1468 static_libsystemd_pic = static_libsystemd == 'true' or static_libsystemd == 'pic'
1470 install_libsystemd_static = static_library(
1473 journal_client_sources,
1475 basic_gcrypt_sources,
1477 include_directories : includes,
1478 build_by_default : static_libsystemd != 'false',
1479 install : static_libsystemd != 'false',
1480 install_dir : rootlibdir,
1481 pic : static_libsystemd == 'true' or static_libsystemd == 'pic',
1482 dependencies : [threads,
1491 c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
1493 #Generate autosuspend rules
1494 make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
1496 ############################################################
1498 # binaries that have --help and are intended for use by humans,
1499 # usually, but not always, installed in /bin.
1500 public_programs = []
1502 subdir('src/libudev')
1503 subdir('src/shared')
1505 subdir('src/shutdown')
1507 subdir('src/network')
1509 subdir('src/analyze')
1510 subdir('src/journal-remote')
1511 subdir('src/coredump')
1512 subdir('src/pstore')
1513 subdir('src/hostname')
1514 subdir('src/import')
1515 subdir('src/kernel-install')
1516 subdir('src/locale')
1517 subdir('src/machine')
1518 subdir('src/portable')
1519 subdir('src/nspawn')
1520 subdir('src/resolve')
1521 subdir('src/timedate')
1522 subdir('src/timesync')
1523 subdir('src/vconsole')
1524 subdir('src/boot/efi')
1531 ############################################################
1533 # only static linking apart from libdl, to make sure that the
1534 # module is linked to all libraries that it uses.
1535 test_dlopen = executable(
1539 include_directories : includes,
1540 link_with : [libbasic],
1541 dependencies : [libdl],
1542 build_by_default : want_tests != 'false')
1544 foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
1545 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1546 ['mymachines', 'ENABLE_NSS_MYMACHINES'],
1547 ['resolve', 'ENABLE_NSS_RESOLVE']]
1549 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1553 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1554 version_script_arg = join_paths(project_source_root, sym)
1556 nss = shared_library(
1558 'src/nss-@0@/nss-@0@.c'.format(module),
1561 include_directories : includes,
1562 # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1563 link_args : ['-Wl,-z,nodelete',
1565 '-Wl,--version-script=' + version_script_arg],
1566 link_with : [libsystemd_static,
1569 dependencies : [threads,
1573 install_dir : rootlibdir)
1575 # We cannot use shared_module because it does not support version suffix.
1576 # Unfortunately shared_library insists on creating the symlink…
1577 meson.add_install_script('sh', '-c',
1578 'rm $DESTDIR@0@/libnss_@1@.so'
1579 .format(rootlibdir, module))
1581 if want_tests != 'false'
1582 test('dlopen-nss_' + module,
1584 # path to dlopen must include a slash
1585 args : nss.full_path())
1590 ############################################################
1592 executable('systemd',
1594 include_directories : includes,
1595 link_with : [libcore,
1597 dependencies : [versiondep,
1604 install_rpath : rootlibexecdir,
1606 install_dir : rootlibexecdir)
1608 meson.add_install_script(meson_make_symlink,
1609 join_paths(rootlibexecdir, 'systemd'),
1610 join_paths(rootsbindir, 'init'))
1612 exe = executable('systemd-analyze',
1613 systemd_analyze_sources,
1614 include_directories : includes,
1615 link_with : [libcore,
1617 dependencies : [versiondep,
1624 install_rpath : rootlibexecdir,
1626 public_programs += exe
1628 executable('systemd-journald',
1629 systemd_journald_sources,
1630 include_directories : includes,
1631 link_with : [libjournal_core,
1633 dependencies : [threads,
1637 install_rpath : rootlibexecdir,
1639 install_dir : rootlibexecdir)
1641 exe = executable('systemd-cat',
1642 systemd_cat_sources,
1643 include_directories : includes,
1644 link_with : [libjournal_core,
1646 dependencies : [threads],
1647 install_rpath : rootlibexecdir,
1649 public_programs += exe
1651 exe = executable('journalctl',
1653 include_directories : includes,
1654 link_with : [libshared],
1655 dependencies : [threads,
1660 install_rpath : rootlibexecdir,
1662 install_dir : rootbindir)
1663 public_programs += exe
1665 executable('systemd-getty-generator',
1666 'src/getty-generator/getty-generator.c',
1667 include_directories : includes,
1668 link_with : [libshared],
1669 install_rpath : rootlibexecdir,
1671 install_dir : systemgeneratordir)
1673 executable('systemd-debug-generator',
1674 'src/debug-generator/debug-generator.c',
1675 include_directories : includes,
1676 link_with : [libshared],
1677 install_rpath : rootlibexecdir,
1679 install_dir : systemgeneratordir)
1681 executable('systemd-run-generator',
1682 'src/run-generator/run-generator.c',
1683 include_directories : includes,
1684 link_with : [libshared],
1685 install_rpath : rootlibexecdir,
1687 install_dir : systemgeneratordir)
1689 executable('systemd-fstab-generator',
1690 'src/fstab-generator/fstab-generator.c',
1691 include_directories : includes,
1692 link_with : [libcore_shared,
1694 install_rpath : rootlibexecdir,
1696 install_dir : systemgeneratordir)
1698 if conf.get('ENABLE_ENVIRONMENT_D') == 1
1699 executable('30-systemd-environment-d-generator',
1700 'src/environment-d-generator/environment-d-generator.c',
1701 include_directories : includes,
1702 link_with : [libshared],
1703 install_rpath : rootlibexecdir,
1705 install_dir : userenvgeneratordir)
1707 meson.add_install_script(meson_make_symlink,
1708 join_paths(sysconfdir, 'environment'),
1709 join_paths(environmentdir, '99-environment.conf'))
1712 if conf.get('ENABLE_HIBERNATE') == 1
1713 executable('systemd-hibernate-resume-generator',
1714 'src/hibernate-resume/hibernate-resume-generator.c',
1715 include_directories : includes,
1716 link_with : [libshared],
1717 install_rpath : rootlibexecdir,
1719 install_dir : systemgeneratordir)
1721 executable('systemd-hibernate-resume',
1722 'src/hibernate-resume/hibernate-resume.c',
1723 include_directories : includes,
1724 link_with : [libshared],
1725 install_rpath : rootlibexecdir,
1727 install_dir : rootlibexecdir)
1730 if conf.get('HAVE_BLKID') == 1
1731 executable('systemd-gpt-auto-generator',
1732 'src/gpt-auto-generator/gpt-auto-generator.c',
1733 'src/shared/blkid-util.h',
1734 include_directories : includes,
1735 link_with : [libshared],
1736 dependencies : libblkid,
1737 install_rpath : rootlibexecdir,
1739 install_dir : systemgeneratordir)
1741 exe = executable('systemd-dissect',
1742 'src/dissect/dissect.c',
1743 include_directories : includes,
1744 link_with : [libshared],
1745 install_rpath : rootlibexecdir,
1747 install_dir : rootlibexecdir)
1748 public_programs += exe
1751 if conf.get('ENABLE_RESOLVE') == 1
1752 executable('systemd-resolved',
1753 systemd_resolved_sources,
1754 include_directories : includes,
1755 link_with : [libshared,
1757 libsystemd_resolve_core],
1758 dependencies : systemd_resolved_dependencies,
1759 install_rpath : rootlibexecdir,
1761 install_dir : rootlibexecdir)
1763 exe = executable('resolvectl',
1765 include_directories : includes,
1766 link_with : [libshared,
1768 libsystemd_resolve_core],
1769 dependencies : [threads,
1773 install_rpath : rootlibexecdir,
1775 public_programs += exe
1777 meson.add_install_script(meson_make_symlink,
1778 join_paths(bindir, 'resolvectl'),
1779 join_paths(rootsbindir, 'resolvconf'))
1781 meson.add_install_script(meson_make_symlink,
1782 join_paths(bindir, 'resolvectl'),
1783 join_paths(bindir, 'systemd-resolve'))
1786 if conf.get('ENABLE_LOGIND') == 1
1787 executable('systemd-logind',
1788 systemd_logind_sources,
1789 include_directories : includes,
1790 link_with : [liblogind_core,
1792 dependencies : [threads,
1794 install_rpath : rootlibexecdir,
1796 install_dir : rootlibexecdir)
1798 exe = executable('loginctl',
1800 include_directories : includes,
1801 link_with : [libshared],
1802 dependencies : [threads,
1805 install_rpath : rootlibexecdir,
1807 install_dir : rootbindir)
1808 public_programs += exe
1810 exe = executable('systemd-inhibit',
1811 'src/login/inhibit.c',
1812 include_directories : includes,
1813 link_with : [libshared],
1814 install_rpath : rootlibexecdir,
1816 install_dir : rootbindir)
1817 public_programs += exe
1819 if conf.get('HAVE_PAM') == 1
1820 version_script_arg = join_paths(project_source_root, pam_systemd_sym)
1821 pam_systemd = shared_library(
1825 include_directories : includes,
1826 link_args : ['-shared',
1827 '-Wl,--version-script=' + version_script_arg],
1828 link_with : [libsystemd_static,
1830 dependencies : [threads,
1833 link_depends : pam_systemd_sym,
1835 install_dir : pamlibdir)
1837 if want_tests != 'false'
1838 test('dlopen-pam_systemd',
1840 # path to dlopen must include a slash
1841 args : pam_systemd.full_path())
1845 executable('systemd-user-runtime-dir',
1846 user_runtime_dir_sources,
1847 include_directories : includes,
1848 link_with : [libshared],
1849 install_rpath : rootlibexecdir,
1851 install_dir : rootlibexecdir)
1854 if conf.get('HAVE_PAM') == 1
1855 executable('systemd-user-sessions',
1856 'src/user-sessions/user-sessions.c',
1857 include_directories : includes,
1858 link_with : [libshared],
1859 install_rpath : rootlibexecdir,
1861 install_dir : rootlibexecdir)
1864 if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1865 exe = executable('bootctl',
1866 'src/boot/bootctl.c',
1867 include_directories : includes,
1868 link_with : [libshared],
1869 dependencies : [libblkid],
1870 install_rpath : rootlibexecdir,
1872 public_programs += exe
1874 executable('systemd-bless-boot',
1875 'src/boot/bless-boot.c',
1876 include_directories : includes,
1877 link_with : [libshared],
1878 dependencies : [libblkid],
1879 install_rpath : rootlibexecdir,
1881 install_dir : rootlibexecdir)
1883 executable('systemd-bless-boot-generator',
1884 'src/boot/bless-boot-generator.c',
1885 include_directories : includes,
1886 link_with : [libshared],
1887 install_rpath : rootlibexecdir,
1889 install_dir : systemgeneratordir)
1892 executable('systemd-boot-check-no-failures',
1893 'src/boot/boot-check-no-failures.c',
1894 include_directories : includes,
1895 link_with : [libshared],
1896 dependencies : [libblkid],
1897 install_rpath : rootlibexecdir,
1899 install_dir : rootlibexecdir)
1901 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1902 include_directories : includes,
1903 link_with : [libshared],
1904 dependencies : [threads],
1905 install_rpath : rootlibexecdir,
1907 public_programs += exe
1910 if get_option('link-systemctl-shared')
1911 systemctl_link_with = [libshared]
1913 systemctl_link_with = [libsystemd_static,
1919 exe = executable('systemctl',
1920 'src/systemctl/systemctl.c',
1921 'src/systemctl/sysv-compat.h',
1922 'src/systemctl/sysv-compat.c',
1923 include_directories : includes,
1924 link_with : systemctl_link_with,
1925 dependencies : [threads,
1930 install_rpath : rootlibexecdir,
1932 install_dir : rootbindir)
1933 public_programs += exe
1935 if conf.get('ENABLE_PORTABLED') == 1
1936 executable('systemd-portabled',
1937 systemd_portabled_sources,
1938 include_directories : includes,
1939 link_with : [libshared],
1940 dependencies : [threads],
1941 install_rpath : rootlibexecdir,
1943 install_dir : rootlibexecdir)
1945 exe = executable('portablectl', 'src/portable/portablectl.c',
1946 include_directories : includes,
1947 link_with : [libshared],
1948 dependencies : [threads],
1949 install_rpath : rootlibexecdir,
1951 install_dir : rootbindir)
1952 public_programs += exe
1955 foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit']
1956 meson.add_install_script(meson_make_symlink,
1957 join_paths(rootbindir, 'systemctl'),
1958 join_paths(rootsbindir, alias))
1961 if conf.get('ENABLE_BACKLIGHT') == 1
1962 executable('systemd-backlight',
1963 'src/backlight/backlight.c',
1964 include_directories : includes,
1965 link_with : [libshared],
1966 install_rpath : rootlibexecdir,
1968 install_dir : rootlibexecdir)
1971 if conf.get('ENABLE_RFKILL') == 1
1972 executable('systemd-rfkill',
1973 'src/rfkill/rfkill.c',
1974 include_directories : includes,
1975 link_with : [libshared],
1976 install_rpath : rootlibexecdir,
1978 install_dir : rootlibexecdir)
1981 executable('systemd-system-update-generator',
1982 'src/system-update-generator/system-update-generator.c',
1983 include_directories : includes,
1984 link_with : [libshared],
1985 install_rpath : rootlibexecdir,
1987 install_dir : systemgeneratordir)
1989 if conf.get('HAVE_LIBCRYPTSETUP') == 1
1990 executable('systemd-cryptsetup',
1991 'src/cryptsetup/cryptsetup.c',
1992 include_directories : includes,
1993 link_with : [libshared],
1994 dependencies : [libcryptsetup],
1995 install_rpath : rootlibexecdir,
1997 install_dir : rootlibexecdir)
1999 executable('systemd-cryptsetup-generator',
2000 'src/cryptsetup/cryptsetup-generator.c',
2001 include_directories : includes,
2002 link_with : [libshared],
2003 dependencies : [libcryptsetup],
2004 install_rpath : rootlibexecdir,
2006 install_dir : systemgeneratordir)
2008 executable('systemd-veritysetup',
2009 'src/veritysetup/veritysetup.c',
2010 include_directories : includes,
2011 link_with : [libshared],
2012 dependencies : [libcryptsetup],
2013 install_rpath : rootlibexecdir,
2015 install_dir : rootlibexecdir)
2017 executable('systemd-veritysetup-generator',
2018 'src/veritysetup/veritysetup-generator.c',
2019 include_directories : includes,
2020 link_with : [libshared],
2021 dependencies : [libcryptsetup],
2022 install_rpath : rootlibexecdir,
2024 install_dir : systemgeneratordir)
2027 if conf.get('HAVE_SYSV_COMPAT') == 1
2028 executable('systemd-sysv-generator',
2029 'src/sysv-generator/sysv-generator.c',
2030 include_directories : includes,
2031 link_with : [libshared],
2032 install_rpath : rootlibexecdir,
2034 install_dir : systemgeneratordir)
2036 executable('systemd-rc-local-generator',
2037 'src/rc-local-generator/rc-local-generator.c',
2038 include_directories : includes,
2039 link_with : [libshared],
2040 install_rpath : rootlibexecdir,
2042 install_dir : systemgeneratordir)
2045 if conf.get('ENABLE_HOSTNAMED') == 1
2046 executable('systemd-hostnamed',
2047 'src/hostname/hostnamed.c',
2048 include_directories : includes,
2049 link_with : [libshared],
2050 install_rpath : rootlibexecdir,
2052 install_dir : rootlibexecdir)
2054 exe = executable('hostnamectl',
2055 'src/hostname/hostnamectl.c',
2056 include_directories : includes,
2057 link_with : [libshared],
2058 install_rpath : rootlibexecdir,
2060 public_programs += exe
2063 if conf.get('ENABLE_LOCALED') == 1
2064 if conf.get('HAVE_XKBCOMMON') == 1
2065 # logind will load libxkbcommon.so dynamically on its own
2071 executable('systemd-localed',
2072 systemd_localed_sources,
2073 include_directories : includes,
2074 link_with : [libshared],
2075 dependencies : deps,
2076 install_rpath : rootlibexecdir,
2078 install_dir : rootlibexecdir)
2080 exe = executable('localectl',
2082 include_directories : includes,
2083 link_with : [libshared],
2084 install_rpath : rootlibexecdir,
2086 public_programs += exe
2089 if conf.get('ENABLE_TIMEDATED') == 1
2090 executable('systemd-timedated',
2091 'src/timedate/timedated.c',
2092 include_directories : includes,
2093 link_with : [libshared],
2094 install_rpath : rootlibexecdir,
2096 install_dir : rootlibexecdir)
2099 if conf.get('ENABLE_TIMEDATECTL') == 1
2100 exe = executable('timedatectl',
2101 'src/timedate/timedatectl.c',
2102 include_directories : includes,
2103 install_rpath : rootlibexecdir,
2104 link_with : [libshared],
2105 dependencies : [libm],
2107 public_programs += exe
2110 if conf.get('ENABLE_TIMESYNCD') == 1
2111 executable('systemd-timesyncd',
2112 systemd_timesyncd_sources,
2113 include_directories : includes,
2114 link_with : [libshared],
2115 dependencies : [threads,
2117 install_rpath : rootlibexecdir,
2119 install_dir : rootlibexecdir)
2121 executable('systemd-time-wait-sync',
2122 'src/time-wait-sync/time-wait-sync.c',
2123 include_directories : includes,
2124 link_with : [libshared],
2125 install_rpath : rootlibexecdir,
2127 install_dir : rootlibexecdir)
2130 if conf.get('ENABLE_MACHINED') == 1
2131 executable('systemd-machined',
2132 systemd_machined_sources,
2133 include_directories : includes,
2134 link_with : [libmachine_core,
2136 install_rpath : rootlibexecdir,
2138 install_dir : rootlibexecdir)
2140 exe = executable('machinectl',
2141 'src/machine/machinectl.c',
2142 include_directories : includes,
2143 link_with : [libshared],
2144 dependencies : [threads,
2147 install_rpath : rootlibexecdir,
2149 install_dir : rootbindir)
2150 public_programs += exe
2153 if conf.get('ENABLE_IMPORTD') == 1
2154 executable('systemd-importd',
2155 systemd_importd_sources,
2156 include_directories : includes,
2157 link_with : [libshared],
2158 dependencies : [threads],
2159 install_rpath : rootlibexecdir,
2161 install_dir : rootlibexecdir)
2163 systemd_pull = executable('systemd-pull',
2164 systemd_pull_sources,
2165 include_directories : includes,
2166 link_with : [libshared],
2167 dependencies : [versiondep,
2173 install_rpath : rootlibexecdir,
2175 install_dir : rootlibexecdir)
2177 systemd_import = executable('systemd-import',
2178 systemd_import_sources,
2179 include_directories : includes,
2180 link_with : [libshared],
2181 dependencies : [libcurl,
2185 install_rpath : rootlibexecdir,
2187 install_dir : rootlibexecdir)
2189 systemd_import_fs = executable('systemd-import-fs',
2190 systemd_import_fs_sources,
2191 include_directories : includes,
2192 link_with : [libshared],
2193 install_rpath : rootlibexecdir,
2195 install_dir : rootlibexecdir)
2197 systemd_export = executable('systemd-export',
2198 systemd_export_sources,
2199 include_directories : includes,
2200 link_with : [libshared],
2201 dependencies : [libcurl,
2205 install_rpath : rootlibexecdir,
2207 install_dir : rootlibexecdir)
2209 public_programs += [systemd_pull, systemd_import, systemd_import_fs, systemd_export]
2212 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2213 exe = executable('systemd-journal-upload',
2214 systemd_journal_upload_sources,
2215 include_directories : includes,
2216 link_with : [libshared],
2217 dependencies : [versiondep,
2223 install_rpath : rootlibexecdir,
2225 install_dir : rootlibexecdir)
2226 public_programs += exe
2229 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2230 s_j_remote = executable('systemd-journal-remote',
2231 systemd_journal_remote_sources,
2232 include_directories : includes,
2233 link_with : [libshared,
2234 libsystemd_journal_remote],
2235 dependencies : [threads,
2240 install_rpath : rootlibexecdir,
2242 install_dir : rootlibexecdir)
2244 s_j_gatewayd = executable('systemd-journal-gatewayd',
2245 systemd_journal_gatewayd_sources,
2246 include_directories : includes,
2247 link_with : [libshared],
2248 dependencies : [threads,
2253 install_rpath : rootlibexecdir,
2255 install_dir : rootlibexecdir)
2256 public_programs += [s_j_remote, s_j_gatewayd]
2259 if conf.get('ENABLE_COREDUMP') == 1
2260 executable('systemd-coredump',
2261 systemd_coredump_sources,
2262 include_directories : includes,
2263 link_with : [libshared],
2264 dependencies : [threads,
2269 install_rpath : rootlibexecdir,
2271 install_dir : rootlibexecdir)
2273 exe = executable('coredumpctl',
2274 coredumpctl_sources,
2275 include_directories : includes,
2276 link_with : [libshared],
2277 dependencies : [threads,
2280 install_rpath : rootlibexecdir,
2282 public_programs += exe
2285 if conf.get('ENABLE_PSTORE') == 1
2286 executable('systemd-pstore',
2287 systemd_pstore_sources,
2288 include_directories : includes,
2289 link_with : [libshared],
2290 dependencies : [threads,
2295 install_rpath : rootlibexecdir,
2297 install_dir : rootlibexecdir)
2300 if conf.get('ENABLE_BINFMT') == 1
2301 exe = executable('systemd-binfmt',
2302 'src/binfmt/binfmt.c',
2303 include_directories : includes,
2304 link_with : [libshared],
2305 install_rpath : rootlibexecdir,
2307 install_dir : rootlibexecdir)
2308 public_programs += exe
2310 meson.add_install_script('sh', '-c',
2311 mkdir_p.format(binfmtdir))
2312 meson.add_install_script('sh', '-c',
2313 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2316 if conf.get('ENABLE_VCONSOLE') == 1
2317 executable('systemd-vconsole-setup',
2318 'src/vconsole/vconsole-setup.c',
2319 include_directories : includes,
2320 link_with : [libshared],
2321 install_rpath : rootlibexecdir,
2323 install_dir : rootlibexecdir)
2326 if conf.get('ENABLE_RANDOMSEED') == 1
2327 executable('systemd-random-seed',
2328 'src/random-seed/random-seed.c',
2329 include_directories : includes,
2330 link_with : [libshared],
2331 install_rpath : rootlibexecdir,
2333 install_dir : rootlibexecdir)
2336 if conf.get('ENABLE_FIRSTBOOT') == 1
2337 executable('systemd-firstboot',
2338 'src/firstboot/firstboot.c',
2339 include_directories : includes,
2340 link_with : [libshared],
2341 dependencies : [libcrypt],
2342 install_rpath : rootlibexecdir,
2344 install_dir : rootbindir)
2347 executable('systemd-remount-fs',
2348 'src/remount-fs/remount-fs.c',
2349 include_directories : includes,
2350 link_with : [libcore_shared,
2352 install_rpath : rootlibexecdir,
2354 install_dir : rootlibexecdir)
2356 executable('systemd-machine-id-setup',
2357 'src/machine-id-setup/machine-id-setup-main.c',
2358 include_directories : includes,
2359 link_with : [libcore_shared,
2361 install_rpath : rootlibexecdir,
2363 install_dir : rootbindir)
2365 executable('systemd-fsck',
2367 include_directories : includes,
2368 link_with : [libshared],
2369 install_rpath : rootlibexecdir,
2371 install_dir : rootlibexecdir)
2373 executable('systemd-growfs',
2374 'src/partition/growfs.c',
2375 include_directories : includes,
2376 link_with : [libshared],
2377 dependencies : [libcryptsetup],
2378 install_rpath : rootlibexecdir,
2380 install_dir : rootlibexecdir)
2382 executable('systemd-makefs',
2383 'src/partition/makefs.c',
2384 include_directories : includes,
2385 link_with : [libshared],
2386 install_rpath : rootlibexecdir,
2388 install_dir : rootlibexecdir)
2390 executable('systemd-sleep',
2391 'src/sleep/sleep.c',
2392 include_directories : includes,
2393 link_with : [libshared],
2394 install_rpath : rootlibexecdir,
2396 install_dir : rootlibexecdir)
2398 install_data('src/sleep/sleep.conf',
2399 install_dir : pkgsysconfdir)
2401 exe = executable('systemd-sysctl',
2402 'src/sysctl/sysctl.c',
2403 include_directories : includes,
2404 link_with : [libshared],
2405 install_rpath : rootlibexecdir,
2407 install_dir : rootlibexecdir)
2408 public_programs += exe
2410 executable('systemd-ac-power',
2411 'src/ac-power/ac-power.c',
2412 include_directories : includes,
2413 link_with : [libshared],
2414 install_rpath : rootlibexecdir,
2416 install_dir : rootlibexecdir)
2418 exe_name = 'systemd-dbus1-generator'
2419 exe = executable(exe_name,
2420 'src/dbus1-generator/dbus1-generator.c',
2421 include_directories : includes,
2422 link_with : [libshared],
2423 install_rpath : rootlibexecdir,
2425 install_dir : systemgeneratordir)
2426 meson.add_install_script(meson_make_symlink,
2427 join_paths(systemgeneratordir, exe_name),
2428 join_paths(usergeneratordir, exe_name))
2430 exe = executable('systemd-detect-virt',
2431 'src/detect-virt/detect-virt.c',
2432 include_directories : includes,
2433 link_with : [libshared],
2434 install_rpath : rootlibexecdir,
2436 public_programs += exe
2438 exe = executable('systemd-delta',
2439 'src/delta/delta.c',
2440 include_directories : includes,
2441 link_with : [libshared],
2442 install_rpath : rootlibexecdir,
2444 public_programs += exe
2446 exe = executable('systemd-escape',
2447 'src/escape/escape.c',
2448 include_directories : includes,
2449 link_with : [libshared],
2450 install_rpath : rootlibexecdir,
2452 install_dir : rootbindir)
2453 public_programs += exe
2455 exe = executable('systemd-notify',
2456 'src/notify/notify.c',
2457 include_directories : includes,
2458 link_with : [libshared],
2459 install_rpath : rootlibexecdir,
2461 install_dir : rootbindir)
2462 public_programs += exe
2464 executable('systemd-volatile-root',
2465 'src/volatile-root/volatile-root.c',
2466 include_directories : includes,
2467 link_with : [libshared],
2468 install_rpath : rootlibexecdir,
2470 install_dir : rootlibexecdir)
2472 executable('systemd-cgroups-agent',
2473 'src/cgroups-agent/cgroups-agent.c',
2474 include_directories : includes,
2475 link_with : [libshared],
2476 install_rpath : rootlibexecdir,
2478 install_dir : rootlibexecdir)
2480 exe = executable('systemd-id128',
2481 'src/id128/id128.c',
2482 include_directories : includes,
2483 link_with : [libshared],
2484 install_rpath : rootlibexecdir,
2486 public_programs += exe
2488 exe = executable('systemd-path',
2490 include_directories : includes,
2491 link_with : [libshared],
2492 install_rpath : rootlibexecdir,
2494 public_programs += exe
2496 exe = executable('systemd-ask-password',
2497 'src/ask-password/ask-password.c',
2498 include_directories : includes,
2499 link_with : [libshared],
2500 install_rpath : rootlibexecdir,
2502 install_dir : rootbindir)
2503 public_programs += exe
2505 executable('systemd-reply-password',
2506 'src/reply-password/reply-password.c',
2507 include_directories : includes,
2508 link_with : [libshared],
2509 install_rpath : rootlibexecdir,
2511 install_dir : rootlibexecdir)
2513 exe = executable('systemd-tty-ask-password-agent',
2514 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2515 include_directories : includes,
2516 link_with : [libshared],
2517 install_rpath : rootlibexecdir,
2519 install_dir : rootbindir)
2520 public_programs += exe
2522 exe = executable('systemd-cgls',
2524 include_directories : includes,
2525 link_with : [libshared],
2526 install_rpath : rootlibexecdir,
2528 public_programs += exe
2530 exe = executable('systemd-cgtop',
2531 'src/cgtop/cgtop.c',
2532 include_directories : includes,
2533 link_with : [libshared],
2534 install_rpath : rootlibexecdir,
2536 public_programs += exe
2538 executable('systemd-initctl',
2539 'src/initctl/initctl.c',
2540 include_directories : includes,
2541 link_with : [libshared],
2542 install_rpath : rootlibexecdir,
2544 install_dir : rootlibexecdir)
2546 exe = executable('systemd-mount',
2547 'src/mount/mount-tool.c',
2548 include_directories : includes,
2549 link_with : [libshared],
2550 dependencies: [libmount],
2551 install_rpath : rootlibexecdir,
2553 public_programs += exe
2555 meson.add_install_script(meson_make_symlink,
2556 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2558 exe = executable('systemd-run',
2560 include_directories : includes,
2561 link_with : [libshared],
2562 install_rpath : rootlibexecdir,
2564 public_programs += exe
2566 exe = executable('systemd-stdio-bridge',
2567 'src/stdio-bridge/stdio-bridge.c',
2568 include_directories : includes,
2569 link_with : [libshared],
2570 dependencies : [versiondep],
2571 install_rpath : rootlibexecdir,
2573 public_programs += exe
2575 exe = executable('busctl',
2576 'src/busctl/busctl.c',
2577 'src/busctl/busctl-introspect.c',
2578 'src/busctl/busctl-introspect.h',
2579 include_directories : includes,
2580 link_with : [libshared],
2581 install_rpath : rootlibexecdir,
2583 public_programs += exe
2585 if conf.get('ENABLE_SYSUSERS') == 1
2586 exe = executable('systemd-sysusers',
2587 'src/sysusers/sysusers.c',
2588 include_directories : includes,
2589 link_with : [libshared],
2590 install_rpath : rootlibexecdir,
2592 install_dir : rootbindir)
2593 public_programs += exe
2596 if conf.get('ENABLE_TMPFILES') == 1
2597 exe = executable('systemd-tmpfiles',
2598 'src/tmpfiles/tmpfiles.c',
2599 include_directories : includes,
2600 link_with : [libshared],
2601 dependencies : [libacl],
2602 install_rpath : rootlibexecdir,
2604 install_dir : rootbindir)
2605 public_programs += exe
2607 if want_tests != 'false'
2608 test('test-systemd-tmpfiles',
2609 test_systemd_tmpfiles_py,
2610 # https://github.com/mesonbuild/meson/issues/2681
2611 args : exe.full_path())
2615 if conf.get('ENABLE_HWDB') == 1
2616 exe = executable('systemd-hwdb',
2618 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2619 include_directories : includes,
2620 link_with : [libudev_static],
2621 install_rpath : udev_rpath,
2623 install_dir : rootbindir)
2624 public_programs += exe
2627 if conf.get('ENABLE_QUOTACHECK') == 1
2628 executable('systemd-quotacheck',
2629 'src/quotacheck/quotacheck.c',
2630 include_directories : includes,
2631 link_with : [libshared],
2632 install_rpath : rootlibexecdir,
2634 install_dir : rootlibexecdir)
2637 exe = executable('systemd-socket-proxyd',
2638 'src/socket-proxy/socket-proxyd.c',
2639 include_directories : includes,
2640 link_with : [libshared],
2641 dependencies : [threads],
2642 install_rpath : rootlibexecdir,
2644 install_dir : rootlibexecdir)
2645 public_programs += exe
2647 exe = executable('systemd-udevd',
2648 systemd_udevd_sources,
2649 include_directories : includes,
2650 c_args : '-DLOG_REALM=LOG_REALM_UDEV',
2651 link_with : [libudev_core,
2654 dependencies : [versiondep,
2660 install_rpath : udev_rpath,
2662 install_dir : rootlibexecdir)
2663 public_programs += exe
2665 exe = executable('udevadm',
2667 c_args : '-DLOG_REALM=LOG_REALM_UDEV',
2668 include_directories : includes,
2669 link_with : [libudev_core,
2672 dependencies : [versiondep,
2678 install_rpath : udev_rpath,
2680 install_dir : rootbindir)
2681 public_programs += exe
2683 executable('systemd-shutdown',
2684 systemd_shutdown_sources,
2685 include_directories : includes,
2686 link_with : [libcore_shared,
2688 dependencies : [libmount],
2689 install_rpath : rootlibexecdir,
2691 install_dir : rootlibexecdir)
2693 executable('systemd-update-done',
2694 'src/update-done/update-done.c',
2695 include_directories : includes,
2696 link_with : [libshared],
2697 install_rpath : rootlibexecdir,
2699 install_dir : rootlibexecdir)
2701 executable('systemd-update-utmp',
2702 'src/update-utmp/update-utmp.c',
2703 include_directories : includes,
2704 link_with : [libshared],
2705 dependencies : [libaudit],
2706 install_rpath : rootlibexecdir,
2708 install_dir : rootlibexecdir)
2710 if conf.get('HAVE_KMOD') == 1
2711 executable('systemd-modules-load',
2712 'src/modules-load/modules-load.c',
2713 include_directories : includes,
2714 link_with : [libshared],
2715 dependencies : [libkmod],
2716 install_rpath : rootlibexecdir,
2718 install_dir : rootlibexecdir)
2720 meson.add_install_script('sh', '-c',
2721 mkdir_p.format(modulesloaddir))
2722 meson.add_install_script('sh', '-c',
2723 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2726 exe = executable('systemd-nspawn',
2727 systemd_nspawn_sources,
2728 include_directories : includes,
2729 link_with : [libcore_shared,
2732 dependencies : [libblkid,
2734 install_rpath : rootlibexecdir,
2736 public_programs += exe
2738 if conf.get('ENABLE_NETWORKD') == 1
2739 executable('systemd-networkd',
2740 systemd_networkd_sources,
2741 include_directories : network_include_dir,
2742 link_with : [libnetworkd_core,
2746 dependencies : [threads],
2747 install_rpath : rootlibexecdir,
2749 install_dir : rootlibexecdir)
2751 executable('systemd-networkd-wait-online',
2752 systemd_networkd_wait_online_sources,
2753 include_directories : includes,
2754 link_with : [libnetworkd_core,
2756 install_rpath : rootlibexecdir,
2758 install_dir : rootlibexecdir)
2760 exe = executable('networkctl',
2762 include_directories : includes,
2763 link_with : [libsystemd_network,
2765 install_rpath : rootlibexecdir,
2767 install_dir : rootbindir)
2768 public_programs += exe
2770 executable('systemd-network-generator',
2771 network_generator_sources,
2772 include_directories : includes,
2773 link_with : [libshared],
2774 install_rpath : rootlibexecdir,
2776 install_dir : rootlibexecdir)
2779 executable('systemd-sulogin-shell',
2780 ['src/sulogin-shell/sulogin-shell.c'],
2781 include_directories : includes,
2782 link_with : [libshared],
2783 install_rpath : rootlibexecdir,
2785 install_dir : rootlibexecdir)
2787 ############################################################
2790 'systemd-runtest.env',
2791 output : 'systemd-runtest.env',
2792 command : ['sh', '-c', '{ ' +
2793 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(project_source_root, 'test')) +
2794 'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(meson.current_build_dir(), 'catalog')) +
2796 build_by_default : true)
2798 foreach tuple : tests
2800 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2801 dependencies = tuple[2]
2802 condition = tuple.length() >= 4 ? tuple[3] : ''
2803 type = tuple.length() >= 5 ? tuple[4] : ''
2804 defs = tuple.length() >= 6 ? tuple[5] : []
2805 incs = tuple.length() >= 7 ? tuple[6] : includes
2808 name = sources[0].split('/')[-1].split('.')[0]
2809 if type.startswith('timeout=')
2810 timeout = type.split('=')[1].to_int()
2814 if condition == '' or conf.get(condition) == 1
2818 include_directories : incs,
2819 link_with : link_with,
2820 dependencies : [versiondep,
2823 build_by_default : want_tests != 'false',
2824 install_rpath : rootlibexecdir,
2825 install : install_tests,
2826 install_dir : join_paths(testsdir, type))
2829 message('@0@ is a manual test'.format(name))
2830 elif type == 'unsafe' and want_tests != 'unsafe'
2831 message('@0@ is an unsafe test'.format(name))
2832 elif want_tests != 'false'
2838 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2843 'test-libsystemd-sym',
2844 test_libsystemd_sym_c,
2845 include_directories : includes,
2846 link_with : [libsystemd],
2847 build_by_default : want_tests != 'false',
2848 install : install_tests,
2849 install_dir : testsdir)
2850 if want_tests != 'false'
2851 test('test-libsystemd-sym', exe)
2855 'test-libsystemd-static-sym',
2856 test_libsystemd_sym_c,
2857 include_directories : includes,
2858 link_with : [install_libsystemd_static],
2859 dependencies : [threads], # threads is already included in dependencies on the library,
2860 # but does not seem to get propagated. Add here as a work-around.
2861 build_by_default : want_tests != 'false' and static_libsystemd_pic,
2862 install : install_tests and static_libsystemd_pic,
2863 install_dir : testsdir)
2864 if want_tests != 'false' and static_libsystemd_pic
2865 test('test-libsystemd-static-sym', exe)
2871 include_directories : includes,
2872 c_args : '-Wno-deprecated-declarations',
2873 link_with : [libudev],
2874 build_by_default : want_tests != 'false',
2875 install : install_tests,
2876 install_dir : testsdir)
2877 if want_tests != 'false'
2878 test('test-libudev-sym', exe)
2882 'test-libudev-static-sym',
2884 include_directories : includes,
2885 c_args : '-Wno-deprecated-declarations',
2886 link_with : [install_libudev_static],
2887 build_by_default : want_tests != 'false' and static_libudev_pic,
2888 install : install_tests and static_libudev_pic,
2889 install_dir : testsdir)
2890 if want_tests != 'false' and static_libudev_pic
2891 test('test-libudev-static-sym', exe)
2894 ############################################################
2898 if get_option('tests') != 'false'
2899 foreach tuple : fuzzers
2901 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2902 dependencies = tuple[2]
2903 defs = tuple.length() >= 4 ? tuple[3] : []
2904 incs = tuple.length() >= 5 ? tuple[4] : includes
2907 if want_ossfuzz or want_fuzzbuzz
2908 dependencies += fuzzing_engine
2910 if fuzzing_engine.found()
2911 dependencies += fuzzing_engine
2913 link_args += ['-fsanitize=fuzzer']
2916 sources += 'src/fuzz/fuzz-main.c'
2920 sources += 'src/fuzz/fuzzer-entry-point.c'
2923 name = sources[0].split('/')[-1].split('.')[0]
2925 fuzzer_exes += executable(
2928 include_directories : [incs, include_directories('src/fuzz')],
2929 link_with : link_with,
2930 dependencies : dependencies,
2932 link_args: link_args,
2937 run_target('fuzzers',
2938 depends : fuzzer_exes,
2941 ############################################################
2943 make_directive_index_py = find_program('tools/make-directive-index.py')
2944 make_man_index_py = find_program('tools/make-man-index.py')
2945 xml_helper_py = find_program('tools/xml_helper.py')
2946 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2947 autosuspend_update_sh = find_program('tools/meson-autosuspend-update.sh')
2950 subdir('sysusers.d')
2951 subdir('tmpfiles.d')
2957 subdir('shell-completion/bash')
2958 subdir('shell-completion/zsh')
2959 subdir('docs/sysvinit')
2960 subdir('docs/var-log')
2962 install_subdir('factory/etc',
2963 install_dir : factorydir)
2965 install_data('xorg/50-systemd-user.sh',
2966 install_dir : xinitrcdir)
2967 install_data('modprobe.d/systemd.conf',
2968 install_dir : modprobedir)
2969 install_data('LICENSE.GPL2',
2973 'docs/CODING_STYLE.md',
2974 'docs/DISTRO_PORTING.md',
2975 'docs/ENVIRONMENT.md',
2977 'docs/TRANSIENT-SETTINGS.md',
2978 'docs/TRANSLATORS.md',
2979 'docs/UIDS-GIDS.md',
2980 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2981 install_dir : docdir)
2983 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2984 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2986 ############################################################
2988 meson_check_help = find_program('tools/meson-check-help.sh')
2990 foreach exec : public_programs
2991 name = exec.full_path().split('/')[-1]
2992 if want_tests != 'false'
2993 test('check-help-' + name,
2995 args : exec.full_path())
2999 ############################################################
3001 check_directives_sh = find_program('tools/check-directives.sh')
3003 if want_tests != 'false'
3004 test('check-directives',
3005 check_directives_sh,
3006 args : project_source_root)
3009 ############################################################
3011 # Enable tests for all supported sanitizers
3012 foreach tuple : sanitizers
3013 sanitizer = tuple[0]
3016 if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer))
3018 foreach p : fuzz_regression_tests
3019 b = p.split('/')[-2]
3020 c = p.split('/')[-1]
3022 name = '@0@:@1@'.format(b, sanitizer)
3025 if want_tests == 'false'
3026 message('Not compiling @0@ because tests is set to false'.format(name))
3028 exe = custom_target(
3032 command : [env, 'ln', '-fs',
3033 join_paths(build.full_path(), b),
3035 build_by_default : true)
3037 message('Not compiling @0@ because slow-tests is set to false'.format(name))
3042 if want_tests != 'false' and slow_tests
3043 test('@0@:@1@:@2@'.format(b, c, sanitizer),
3045 args : [exe.full_path(),
3046 join_paths(project_source_root, p)])
3053 ############################################################
3056 all_files = run_command(
3058 ['--git-dir=@0@/.git'.format(project_source_root),
3061 all_files = files(all_files.stdout().split())
3066 command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
3069 command : [env, 'ctags', '-o', '@0@/tags'.format(project_source_root)] + all_files)
3073 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
3076 command : [meson_git_contrib_sh])
3080 git_head = run_command(
3082 ['--git-dir=@0@/.git'.format(project_source_root),
3083 'rev-parse', 'HEAD']).stdout().strip()
3084 git_head_short = run_command(
3086 ['--git-dir=@0@/.git'.format(project_source_root),
3087 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
3091 command : ['git', 'archive',
3092 '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root,
3094 '--prefix', 'systemd-@0@/'.format(git_head),
3098 ############################################################
3100 meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
3103 depends : [man, libsystemd, libudev],
3104 command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
3106 ############################################################
3107 watchdog_opt = service_watchdog == '' ? 'disabled' : service_watchdog
3110 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
3112 'split /usr: @0@'.format(split_usr),
3113 'split bin-sbin: @0@'.format(split_bin),
3114 'prefix directory: @0@'.format(prefixdir),
3115 'rootprefix directory: @0@'.format(rootprefixdir),
3116 'sysconf directory: @0@'.format(sysconfdir),
3117 'include directory: @0@'.format(includedir),
3118 'lib directory: @0@'.format(libdir),
3119 'rootlib directory: @0@'.format(rootlibdir),
3120 'SysV init scripts: @0@'.format(sysvinit_path),
3121 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
3122 'PAM modules directory: @0@'.format(pamlibdir),
3123 'PAM configuration directory: @0@'.format(pamconfdir),
3124 'RPM macros directory: @0@'.format(rpmmacrosdir),
3125 'modprobe.d directory: @0@'.format(modprobedir),
3126 'D-Bus policy directory: @0@'.format(dbuspolicydir),
3127 'D-Bus session directory: @0@'.format(dbussessionservicedir),
3128 'D-Bus system directory: @0@'.format(dbussystemservicedir),
3129 'bash completions directory: @0@'.format(bashcompletiondir),
3130 'zsh completions directory: @0@'.format(zshcompletiondir),
3131 'extra start script: @0@'.format(get_option('rc-local')),
3132 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
3133 get_option('debug-tty')),
3134 'TTY GID: @0@'.format(tty_gid),
3135 'users GID: @0@'.format(substs.get('USERS_GID')),
3136 'maximum system UID: @0@'.format(system_uid_max),
3137 'maximum system GID: @0@'.format(system_gid_max),
3138 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
3139 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
3140 'minimum container UID base: @0@'.format(container_uid_base_min),
3141 'maximum container UID base: @0@'.format(container_uid_base_max),
3142 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
3143 'render group access mode: @0@'.format(get_option('group-render-mode')),
3144 'certificate root directory: @0@'.format(get_option('certificate-root')),
3145 'support URL: @0@'.format(support_url),
3146 'nobody user name: @0@'.format(nobody_user),
3147 'nobody group name: @0@'.format(nobody_group),
3148 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
3149 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
3151 'default DNSSEC mode: @0@'.format(default_dnssec),
3152 'default DNS-over-TLS mode: @0@'.format(default_dns_over_tls),
3153 'default cgroup hierarchy: @0@'.format(default_hierarchy),
3154 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
3155 'default KillUserProcesses setting: @0@'.format(kill_user_processes),
3156 'default locale: @0@'.format(default_locale),
3157 'default user $PATH: @0@'.format(default_user_path_display),
3158 'systemd service watchdog: @0@'.format(watchdog_opt)]
3160 alt_dns_servers = '\n '.join(dns_servers.split(' '))
3161 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
3163 'default DNS servers: @0@'.format(alt_dns_servers),
3164 'default NTP servers: @0@'.format(alt_ntp_servers)]
3166 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
3167 '@@0@'.format(time_epoch)).stdout().strip()
3169 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
3172 'static libsystemd: @0@'.format(static_libsystemd),
3173 'static libudev: @0@'.format(static_libudev)]
3176 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3177 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3178 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3180 if conf.get('ENABLE_EFI') == 1
3181 status += 'efi arch: @0@'.format(efi_arch)
3185 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
3186 'EFI CC @0@'.format(' '.join(efi_cc)),
3187 'EFI lib directory: @0@'.format(efi_libdir),
3188 'EFI lds directory: @0@'.format(efi_ldsdir),
3189 'EFI include directory: @0@'.format(efi_incdir)]
3241 ['DNS-over-TLS(gnutls)', conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1],
3242 ['DNS-over-TLS(openssl)', conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1],
3246 ['legacy pkla', install_polkit_pkla],
3248 ['gnu-efi', have_gnu_efi],
3262 ['man pages', want_man],
3263 ['html pages', want_html],
3264 ['man page indices', want_man and have_lxml],
3269 ['adm group', get_option('adm-group')],
3270 ['wheel group', get_option('wheel-group')],
3273 ['debug mmap cache'],
3275 ['valgrind', conf.get('VALGRIND') == 1],
3276 ['trace logging', conf.get('LOG_TRACE') == 1],
3277 ['link-udev-shared', get_option('link-udev-shared')],
3278 ['link-systemctl-shared', get_option('link-systemctl-shared')],
3281 if tuple.length() >= 2
3284 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3285 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3286 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3297 'enabled features: @0@'.format(', '.join(found)),
3299 'disabled features: @0@'.format(', '.join(missing)),
3301 message('\n '.join(status))
3303 if rootprefixdir != rootprefix_default
3305 'Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3306 'systemd used fixed names for unit file directories and other paths, so anything\n' +
3307 'except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))