]> git.ipfire.org Git - thirdparty/systemd.git/blob - meson.build
basic/env-util: modernization
[thirdparty/systemd.git] / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 project('systemd', 'c',
4 version : '247',
5 license : 'LGPLv2+',
6 default_options: [
7 'c_std=gnu99',
8 'prefix=/usr',
9 'sysconfdir=/etc',
10 'localstatedir=/var',
11 'warning_level=2',
12 ],
13 meson_version : '>= 0.46',
14 )
15
16 libsystemd_version = '0.30.0'
17 libudev_version = '1.7.0'
18
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
22 # set. Ugh, ugh, ugh!
23 conf = configuration_data()
24 conf.set('PROJECT_VERSION', meson.project_version(),
25 description : 'Numerical project version (used where a simple number is expected)')
26
27 substs = configuration_data()
28 substs.set('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
29 substs.set('PROJECT_VERSION', meson.project_version(),
30 description : 'Numerical project version (used where a simple number is expected)')
31
32 # This is to be used instead of meson.source_root(), as the latter will return
33 # the wrong result when systemd is being built as a meson subproject
34 project_source_root = meson.current_source_dir()
35 project_build_root = meson.current_build_dir()
36 relative_source_path = run_command('realpath',
37 '--relative-to=@0@'.format(project_build_root),
38 project_source_root).stdout().strip()
39 conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
40
41 conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(),
42 description : 'tailor build to development or release builds')
43
44 want_ossfuzz = get_option('oss-fuzz')
45 want_libfuzzer = get_option('llvm-fuzz')
46 if want_ossfuzz + want_libfuzzer > 1
47 error('only one of oss-fuzz or llvm-fuzz can be specified')
48 endif
49
50 skip_deps = want_ossfuzz or want_libfuzzer
51 fuzzer_build = want_ossfuzz or want_libfuzzer
52
53 #####################################################################
54
55 # Try to install the git pre-commit hook
56 add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false)
57 if add_git_hook_sh.found()
58 git_hook = run_command(add_git_hook_sh)
59 if git_hook.returncode() == 0
60 message(git_hook.stdout().strip())
61 endif
62 endif
63
64 #####################################################################
65
66 if get_option('split-usr') == 'auto'
67 split_usr = run_command('test', '-L', '/bin').returncode() != 0
68 else
69 split_usr = get_option('split-usr') == 'true'
70 endif
71 conf.set10('HAVE_SPLIT_USR', split_usr,
72 description : '/usr/bin and /bin directories are separate')
73
74 if get_option('split-bin') == 'auto'
75 split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
76 else
77 split_bin = get_option('split-bin') == 'true'
78 endif
79 conf.set10('HAVE_SPLIT_BIN', split_bin,
80 description : 'bin and sbin directories are separate')
81
82 rootprefixdir = get_option('rootprefix')
83 # Unusual rootprefixdir values are used by some distros
84 # (see https://github.com/systemd/systemd/pull/7461).
85 rootprefix_default = split_usr ? '/' : '/usr'
86 if rootprefixdir == ''
87 rootprefixdir = rootprefix_default
88 endif
89 rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
90
91 have_standalone_binaries = get_option('standalone-binaries')
92
93 sysvinit_path = get_option('sysvinit-path')
94 sysvrcnd_path = get_option('sysvrcnd-path')
95 conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',
96 description : 'SysV init scripts and rcN.d links are supported')
97
98 if get_option('hibernate') and not get_option('initrd')
99 error('hibernate depends on initrd')
100 endif
101
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)
105
106 # join_paths ignores the preceding arguments if an absolute component is
107 # encountered, so this should canonicalize various paths when they are
108 # absolute or relative.
109 prefixdir = get_option('prefix')
110 if not prefixdir.startswith('/')
111 error('Prefix is not absolute: "@0@"'.format(prefixdir))
112 endif
113 bindir = join_paths(prefixdir, get_option('bindir'))
114 libdir = join_paths(prefixdir, get_option('libdir'))
115 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
116 includedir = join_paths(prefixdir, get_option('includedir'))
117 datadir = join_paths(prefixdir, get_option('datadir'))
118 localstatedir = join_paths('/', get_option('localstatedir'))
119
120 rootbindir = join_paths(rootprefixdir, 'bin')
121 rootsbindir = join_paths(rootprefixdir, split_bin ? 'sbin' : 'bin')
122 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
123
124 rootlibdir = get_option('rootlibdir')
125 if rootlibdir == ''
126 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
127 endif
128
129 install_sysconfdir = get_option('install-sysconfdir') != 'false'
130 install_sysconfdir_samples = get_option('install-sysconfdir') == 'true'
131 # Dirs of external packages
132 pkgconfigdatadir = get_option('pkgconfigdatadir') == '' ? join_paths(datadir, 'pkgconfig') : get_option('pkgconfigdatadir')
133 pkgconfiglibdir = get_option('pkgconfiglibdir') == '' ? join_paths(libdir, 'pkgconfig') : get_option('pkgconfiglibdir')
134 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
135 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
136 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
137 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
138 rpmmacrosdir = get_option('rpmmacrosdir')
139 if rpmmacrosdir != 'no'
140 rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
141 endif
142 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
143
144 # Our own paths
145 pkgdatadir = join_paths(datadir, 'systemd')
146 environmentdir = join_paths(prefixdir, 'lib/environment.d')
147 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
148 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
149 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
150 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
151 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
152 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
153 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
154 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
155 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
156 pkgincludedir = join_paths(includedir, 'systemd')
157 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
158 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
159 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
160 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
161 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
162 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
163 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
164 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
165 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
166 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
167 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
168 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
169 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
170 factorydir = join_paths(datadir, 'factory')
171 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
172 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
173 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
174 catalogstatedir = join_paths(systemdstatedir, 'catalog')
175 randomseeddir = join_paths(localstatedir, 'lib/systemd')
176 profiledir = join_paths(rootlibexecdir, 'portable', 'profile')
177 ntpservicelistdir = join_paths(rootprefixdir, 'lib/systemd/ntp-units.d')
178
179 docdir = get_option('docdir')
180 if docdir == ''
181 docdir = join_paths(datadir, 'doc/systemd')
182 endif
183
184 dbuspolicydir = get_option('dbuspolicydir')
185 if dbuspolicydir == ''
186 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
187 endif
188
189 dbussessionservicedir = get_option('dbussessionservicedir')
190 if dbussessionservicedir == ''
191 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
192 endif
193
194 dbussystemservicedir = get_option('dbussystemservicedir')
195 if dbussystemservicedir == ''
196 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
197 endif
198
199 pamlibdir = get_option('pamlibdir')
200 if pamlibdir == ''
201 pamlibdir = join_paths(rootlibdir, 'security')
202 endif
203
204 pamconfdir = get_option('pamconfdir')
205 if pamconfdir == ''
206 pamconfdir = join_paths(prefixdir, 'lib/pam.d')
207 endif
208
209 memory_accounting_default = get_option('memory-accounting-default')
210 status_unit_format_default = get_option('status-unit-format-default')
211
212 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
213 conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', join_paths(pkgsysconfdir, 'system'))
214 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
215 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
216 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
217 conf.set_quoted('RC_LOCAL_PATH', get_option('rc-local'))
218
219 conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper())
220 conf.set10('ENABLE_FEXECVE', get_option('fexecve'))
221
222 conf.set_quoted('USER_CONFIG_UNIT_DIR', join_paths(pkgsysconfdir, 'user'))
223 conf.set_quoted('USER_DATA_UNIT_DIR', userunitdir)
224 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
225 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
226 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
227 conf.set_quoted('SYSTEMD_CGROUPS_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
228 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
229 conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
230 conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
231 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
232 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
233 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
234 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
235 conf.set_quoted('ROOTPREFIX', rootprefixdir)
236 conf.set_quoted('ROOTPREFIX_NOSLASH', rootprefixdir_noslash)
237 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
238 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
239 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
240 conf.set_quoted('SYSTEM_GENERATOR_DIR', systemgeneratordir)
241 conf.set_quoted('USER_GENERATOR_DIR', usergeneratordir)
242 conf.set_quoted('SYSTEM_ENV_GENERATOR_DIR', systemenvgeneratordir)
243 conf.set_quoted('USER_ENV_GENERATOR_DIR', userenvgeneratordir)
244 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
245 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
246 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
247 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
248 conf.set_quoted('SYSTEMD_TEST_DATA', join_paths(testsdir, 'testdata'))
249 conf.set_quoted('SYSTEMD_CATALOG_DIR', catalogdir)
250 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
251 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
252 conf.set_quoted('LIBDIR', libdir)
253 conf.set_quoted('ROOTLIBDIR', rootlibdir)
254 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
255 conf.set_quoted('BOOTLIBDIR', bootlibdir)
256 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
257 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
258 conf.set_quoted('SYSTEMD_IMPORT_FS_PATH', join_paths(rootlibexecdir, 'systemd-import-fs'))
259 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
260 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
261 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
262 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
263 conf.set_quoted('SYSTEMD_HOMEWORK_PATH', join_paths(rootlibexecdir, 'systemd-homework'))
264 conf.set_quoted('SYSTEMD_USERWORK_PATH', join_paths(rootlibexecdir, 'systemd-userwork'))
265 conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default)
266 conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
267 conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper())
268
269 substs.set('prefix', prefixdir)
270 substs.set('rootprefix', rootprefixdir)
271 substs.set('rootprefix_noslash', rootprefixdir_noslash)
272 substs.set('exec_prefix', prefixdir)
273 substs.set('libdir', libdir)
274 substs.set('rootlibdir', rootlibdir)
275 substs.set('includedir', includedir)
276 substs.set('sysconfdir', sysconfdir)
277 substs.set('bindir', bindir)
278 substs.set('rootbindir', rootbindir)
279 substs.set('rootlibexecdir', rootlibexecdir)
280 substs.set('systemunitdir', systemunitdir)
281 substs.set('userunitdir', userunitdir)
282 substs.set('systempresetdir', systempresetdir)
283 substs.set('userpresetdir', userpresetdir)
284 substs.set('udevhwdbdir', udevhwdbdir)
285 substs.set('udevrulesdir', udevrulesdir)
286 substs.set('udevlibexecdir', udevlibexecdir)
287 substs.set('environmentdir', environmentdir)
288 substs.set('catalogdir', catalogdir)
289 substs.set('tmpfilesdir', tmpfilesdir)
290 substs.set('sysusersdir', sysusersdir)
291 substs.set('sysctldir', sysctldir)
292 substs.set('binfmtdir', binfmtdir)
293 substs.set('modulesloaddir', modulesloaddir)
294 substs.set('modprobedir', modprobedir)
295 substs.set('systemgeneratordir', systemgeneratordir)
296 substs.set('usergeneratordir', usergeneratordir)
297 substs.set('systemenvgeneratordir', systemenvgeneratordir)
298 substs.set('userenvgeneratordir', userenvgeneratordir)
299 substs.set('systemshutdowndir', systemshutdowndir)
300 substs.set('systemsleepdir', systemsleepdir)
301 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
302 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
303 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
304 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
305 substs.set('SYSTEMD_TEST_DATA', join_paths(testsdir, 'testdata'))
306 substs.set('RC_LOCAL_PATH', get_option('rc-local'))
307 substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no')
308 substs.set('STATUS_UNIT_FORMAT_DEFAULT', status_unit_format_default)
309 substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE'))
310 substs.set('BUILD_ROOT', project_build_root)
311
312 #####################################################################
313
314 cc = meson.get_compiler('c')
315 pkgconfig = import('pkgconfig')
316 check_compilation_sh = find_program('tools/check-compilation.sh')
317 meson_build_sh = find_program('tools/meson-build.sh')
318
319 want_tests = get_option('tests')
320 slow_tests = want_tests != 'false' and get_option('slow-tests')
321 fuzz_tests = want_tests != 'false' and get_option('fuzz-tests')
322 install_tests = get_option('install-tests')
323
324 if add_languages('cpp', required : fuzzer_build)
325 # Used only for tests
326 cxx = meson.get_compiler('cpp')
327 cxx_cmd = ' '.join(cxx.cmd_array())
328 else
329 cxx_cmd = ''
330 endif
331
332 if want_libfuzzer
333 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false)
334 if fuzzing_engine.found()
335 add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c')
336 elif cc.has_argument('-fsanitize=fuzzer-no-link')
337 add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c')
338 else
339 error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported')
340 endif
341 elif want_ossfuzz
342 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
343 endif
344
345 # Those generate many false positives, and we do not want to change the code to
346 # avoid them.
347 basic_disabled_warnings = [
348 '-Wno-unused-parameter',
349 '-Wno-missing-field-initializers',
350 '-Wno-unused-result',
351 '-Wno-format-signedness',
352 ]
353
354 possible_cc_flags = [
355 '-Werror=undef',
356 '-Wlogical-op',
357 '-Wmissing-include-dirs',
358 '-Wold-style-definition',
359 '-Wpointer-arith',
360 '-Winit-self',
361 '-Wfloat-equal',
362 '-Wsuggest-attribute=noreturn',
363 '-Werror=missing-prototypes',
364 '-Werror=implicit-function-declaration',
365 '-Werror=missing-declarations',
366 '-Werror=return-type',
367 '-Werror=incompatible-pointer-types',
368 '-Werror=format=2',
369 '-Wstrict-prototypes',
370 '-Wredundant-decls',
371 '-Wmissing-noreturn',
372 '-Wimplicit-fallthrough=5',
373 '-Wshadow',
374 '-Wendif-labels',
375 '-Wstrict-aliasing=2',
376 '-Wwrite-strings',
377 '-Werror=overflow',
378 '-Werror=shift-count-overflow',
379 '-Werror=shift-overflow=2',
380 '-Wdate-time',
381 '-Wnested-externs',
382
383 # negative arguments are correctly detected starting with meson 0.46.
384 '-Wno-error=#warnings', # clang
385 '-Wno-string-plus-int', # clang
386
387 # Disable -Wmaybe-uninitialized, since it's noisy on gcc 8 with
388 # optimizations enabled, producing essentially false positives.
389 '-Wno-maybe-uninitialized',
390
391 '-ffast-math',
392 '-fno-common',
393 '-fdiagnostics-show-option',
394 '-fno-strict-aliasing',
395 '-fvisibility=hidden',
396 '-fstack-protector',
397 '-fstack-protector-strong',
398 '--param=ssp-buffer-size=4',
399 ]
400
401 # --as-needed and --no-undefined are provided by meson by default,
402 # run mesonconf to see what is enabled
403 possible_link_flags = [
404 '-Wl,-z,relro',
405 '-Wl,-z,now',
406 '-fstack-protector',
407 ]
408
409 if cc.get_id() == 'clang'
410 possible_cc_flags += [
411 '-Wno-typedef-redefinition',
412 '-Wno-gnu-variable-sized-type-not-at-end',
413 ]
414 endif
415
416 if get_option('buildtype') != 'debug'
417 possible_cc_flags += [
418 '-ffunction-sections',
419 '-fdata-sections',
420 ]
421
422 possible_link_flags += '-Wl,--gc-sections'
423 endif
424
425 add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
426 add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
427 add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
428
429 have = cc.has_argument('-Wzero-length-bounds')
430 conf.set10('HAVE_ZERO_LENGTH_BOUNDS', have)
431
432 if cc.compiles('''
433 #include <time.h>
434 #include <inttypes.h>
435 typedef uint64_t usec_t;
436 usec_t now(clockid_t clock);
437 int main(void) {
438 struct timespec now;
439 return 0;
440 }
441 ''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing')
442 add_project_arguments('-Werror=shadow', language : 'c')
443 endif
444
445 if cxx_cmd != ''
446 add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
447 endif
448
449 cpp = ' '.join(cc.cmd_array()) + ' -E'
450
451 has_wstringop_truncation = cc.has_argument('-Wstringop-truncation')
452
453 #####################################################################
454 # compilation result tests
455
456 conf.set('_GNU_SOURCE', true)
457 conf.set('__SANE_USERSPACE_TYPES__', true)
458 conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation)
459
460 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
461 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
462 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
463 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
464
465 decl_headers = '''
466 #include <uchar.h>
467 #include <sys/stat.h>
468 '''
469
470 foreach decl : ['char16_t',
471 'char32_t',
472 'struct statx',
473 ]
474
475 # We get -1 if the size cannot be determined
476 have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
477
478 if decl == 'struct statx'
479 if have
480 want_linux_stat_h = false
481 else
482 have = cc.sizeof(decl,
483 prefix : decl_headers + '#include <linux/stat.h>',
484 args : '-D_GNU_SOURCE') > 0
485 want_linux_stat_h = have
486 endif
487 endif
488
489 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
490 endforeach
491
492 conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
493
494 foreach ident : ['secure_getenv', '__secure_getenv']
495 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
496 endforeach
497
498 foreach ident : [
499 ['memfd_create', '''#include <sys/mman.h>'''],
500 ['gettid', '''#include <sys/types.h>
501 #include <unistd.h>'''],
502 ['pivot_root', '''#include <stdlib.h>
503 #include <unistd.h>'''], # no known header declares pivot_root
504 ['name_to_handle_at', '''#include <sys/types.h>
505 #include <sys/stat.h>
506 #include <fcntl.h>'''],
507 ['setns', '''#include <sched.h>'''],
508 ['renameat2', '''#include <stdio.h>
509 #include <fcntl.h>'''],
510 ['kcmp', '''#include <linux/kcmp.h>'''],
511 ['keyctl', '''#include <sys/types.h>
512 #include <keyutils.h>'''],
513 ['copy_file_range', '''#include <sys/syscall.h>
514 #include <unistd.h>'''],
515 ['bpf', '''#include <sys/syscall.h>
516 #include <unistd.h>'''],
517 ['statx', '''#include <sys/types.h>
518 #include <sys/stat.h>
519 #include <unistd.h>'''],
520 ['explicit_bzero' , '''#include <string.h>'''],
521 ['reallocarray', '''#include <stdlib.h>'''],
522 ['set_mempolicy', '''#include <stdlib.h>
523 #include <unistd.h>'''],
524 ['get_mempolicy', '''#include <stdlib.h>
525 #include <unistd.h>'''],
526 ['pidfd_send_signal', '''#include <stdlib.h>
527 #include <unistd.h>
528 #include <signal.h>
529 #include <sys/wait.h>'''],
530 ['pidfd_open', '''#include <stdlib.h>
531 #include <unistd.h>
532 #include <signal.h>
533 #include <sys/wait.h>'''],
534 ['rt_sigqueueinfo', '''#include <stdlib.h>
535 #include <unistd.h>
536 #include <signal.h>
537 #include <sys/wait.h>'''],
538 ['mallinfo', '''#include <malloc.h>'''],
539 ['execveat', '''#include <unistd.h>'''],
540 ['close_range', '''#include <unistd.h>'''],
541 ]
542
543 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
544 conf.set10('HAVE_' + ident[0].to_upper(), have)
545 endforeach
546
547 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
548 conf.set10('USE_SYS_RANDOM_H', true)
549 conf.set10('HAVE_GETRANDOM', true)
550 else
551 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
552 conf.set10('USE_SYS_RANDOM_H', false)
553 conf.set10('HAVE_GETRANDOM', have)
554 endif
555
556 #####################################################################
557
558 vcs_tagger = [project_source_root + '/tools/meson-vcs-tag.sh',
559 project_source_root,
560 get_option('version-tag'),
561 meson.project_version()]
562
563 version_h = vcs_tag(
564 input : 'src/version/version.h.in',
565 output : 'version.h',
566 command: vcs_tagger)
567
568 versiondep = declare_dependency(sources: version_h)
569
570 sed = find_program('sed')
571 awk = find_program('awk')
572 m4 = find_program('m4')
573 stat = find_program('stat')
574 git = find_program('git', required : false)
575 env = find_program('env')
576 perl = find_program('perl', required : false)
577
578 meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
579 mkdir_p = 'mkdir -p $DESTDIR/@0@'
580 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
581 splash_bmp = files('test/splash.bmp')
582
583 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
584 # /usr/sbin, /sbin, and fall back to the default from middle column.
585 progs = [['quotaon', '/usr/sbin/quotaon' ],
586 ['quotacheck', '/usr/sbin/quotacheck' ],
587 ['kmod', '/usr/bin/kmod' ],
588 ['kexec', '/usr/sbin/kexec' ],
589 ['sulogin', '/usr/sbin/sulogin' ],
590 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
591 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
592 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
593 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
594 ['nologin', '/usr/sbin/nologin', ],
595 ]
596 foreach prog : progs
597 path = get_option(prog[0] + '-path')
598 if path != ''
599 message('Using @1@ for @0@'.format(prog[0], path))
600 else
601 exe = find_program(prog[0],
602 '/usr/sbin/' + prog[0],
603 '/sbin/' + prog[0],
604 required: false)
605 path = exe.found() ? exe.path() : prog[1]
606 endif
607 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
608 conf.set_quoted(name, path)
609 substs.set(name, path)
610 endforeach
611
612 conf.set_quoted('TELINIT', get_option('telinit-path'))
613
614 if run_command('ln', '--relative', '--help').returncode() != 0
615 error('ln does not support --relative (added in coreutils 8.16)')
616 endif
617
618 ############################################################
619
620 gperf = find_program('gperf')
621
622 gperf_test_format = '''
623 #include <string.h>
624 const char * in_word_set(const char *, @0@);
625 @1@
626 '''
627 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
628 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
629 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
630 if cc.compiles(gperf_test)
631 gperf_len_type = 'size_t'
632 else
633 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
634 if cc.compiles(gperf_test)
635 gperf_len_type = 'unsigned'
636 else
637 error('unable to determine gperf len type')
638 endif
639 endif
640 message('gperf len type is @0@'.format(gperf_len_type))
641 conf.set('GPERF_LEN_TYPE', gperf_len_type,
642 description : 'The type of gperf "len" parameter')
643
644 ############################################################
645
646 if not cc.has_header('sys/capability.h')
647 error('POSIX caps headers not found')
648 endif
649 foreach header : ['crypt.h',
650 'linux/memfd.h',
651 'linux/vm_sockets.h',
652 'sys/auxv.h',
653 'valgrind/memcheck.h',
654 'valgrind/valgrind.h',
655 ]
656
657 conf.set10('HAVE_' + header.underscorify().to_upper(),
658 cc.has_header(header))
659 endforeach
660
661 ############################################################
662
663 fallback_hostname = get_option('fallback-hostname')
664 if fallback_hostname == '' or fallback_hostname[0] == '.' or fallback_hostname[0] == '-'
665 error('Invalid fallback-hostname configuration')
666 # A more extensive test is done in test-hostname-util. Let's catch
667 # the most obvious errors here so we don't fail with an assert later.
668 endif
669 conf.set_quoted('FALLBACK_HOSTNAME', fallback_hostname)
670
671 default_hierarchy = get_option('default-hierarchy')
672 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
673 description : 'default cgroup hierarchy as string')
674 if default_hierarchy == 'legacy'
675 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
676 elif default_hierarchy == 'hybrid'
677 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
678 else
679 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
680 endif
681
682 default_net_naming_scheme = get_option('default-net-naming-scheme')
683 conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme)
684
685 time_epoch = get_option('time-epoch')
686 if time_epoch == -1
687 time_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip()
688 if time_epoch == '' and git.found() and run_command('test', '-e', '.git').returncode() == 0
689 # If we're in a git repository, use the creation time of the latest git tag.
690 latest_tag = run_command('git', 'describe', '--abbrev=0', '--tags').stdout().strip()
691 time_epoch = run_command('git', 'log', '-1', '--format=%at', latest_tag).stdout()
692 endif
693 if time_epoch == ''
694 NEWS = files('NEWS')
695 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
696 endif
697 time_epoch = time_epoch.to_int()
698 endif
699 conf.set('TIME_EPOCH', time_epoch)
700
701 foreach tuple : [['system-alloc-uid-min', 'SYS_UID_MIN', 1], # Also see login.defs(5).
702 ['system-uid-max', 'SYS_UID_MAX', 999],
703 ['system-alloc-gid-min', 'SYS_GID_MIN', 1],
704 ['system-gid-max', 'SYS_GID_MAX', 999]]
705 v = get_option(tuple[0])
706 if v == -1
707 v = run_command(
708 awk,
709 '/^\s*@0@\s+/ { uid=$2 } END { print uid }'.format(tuple[1]),
710 '/etc/login.defs').stdout().strip()
711 if v == ''
712 v = tuple[2]
713 else
714 v = v.to_int()
715 endif
716 endif
717 conf.set(tuple[0].underscorify().to_upper(), v)
718 substs.set(tuple[0].underscorify().to_upper(), v)
719 endforeach
720 if conf.get('SYSTEM_ALLOC_UID_MIN') >= conf.get('SYSTEM_UID_MAX')
721 error('Invalid uid allocation range')
722 endif
723 if conf.get('SYSTEM_ALLOC_GID_MIN') >= conf.get('SYSTEM_GID_MAX')
724 error('Invalid gid allocation range')
725 endif
726
727 dynamic_uid_min = get_option('dynamic-uid-min')
728 dynamic_uid_max = get_option('dynamic-uid-max')
729 conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
730 conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
731 substs.set('dynamicuidmin', dynamic_uid_min)
732 substs.set('dynamicuidmax', dynamic_uid_max)
733
734 container_uid_base_min = get_option('container-uid-base-min')
735 container_uid_base_max = get_option('container-uid-base-max')
736 conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
737 conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
738 substs.set('containeruidbasemin', container_uid_base_min)
739 substs.set('containeruidbasemax', container_uid_base_max)
740
741 nobody_user = get_option('nobody-user')
742 nobody_group = get_option('nobody-group')
743
744 if not meson.is_cross_build()
745 getent_result = run_command('getent', 'passwd', '65534')
746 if getent_result.returncode() == 0
747 name = getent_result.stdout().split(':')[0]
748 if name != nobody_user
749 warning('\n' +
750 '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) +
751 'Your build will result in an user table setup that is incompatible with the local system.')
752 endif
753 endif
754 id_result = run_command('id', '-u', nobody_user)
755 if id_result.returncode() == 0
756 id = id_result.stdout().to_int()
757 if id != 65534
758 warning('\n' +
759 '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) +
760 'Your build will result in an user table setup that is incompatible with the local system.')
761 endif
762 endif
763
764 getent_result = run_command('getent', 'group', '65534')
765 if getent_result.returncode() == 0
766 name = getent_result.stdout().split(':')[0]
767 if name != nobody_group
768 warning('\n' +
769 '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) +
770 'Your build will result in an group table setup that is incompatible with the local system.')
771 endif
772 endif
773 id_result = run_command('id', '-g', nobody_group)
774 if id_result.returncode() == 0
775 id = id_result.stdout().to_int()
776 if id != 65534
777 warning('\n' +
778 '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) +
779 'Your build will result in an group table setup that is incompatible with the local system.')
780 endif
781 endif
782 endif
783 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
784 warning('\n' +
785 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
786 'Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
787 endif
788
789 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
790 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
791 substs.set('NOBODY_USER_NAME', nobody_user)
792 substs.set('NOBODY_GROUP_NAME', nobody_group)
793
794 tty_gid = get_option('tty-gid')
795 conf.set('TTY_GID', tty_gid)
796 substs.set('TTY_GID', tty_gid)
797
798 # Ensure provided GID argument is numeric, otherwise fall back to default assignment
799 users_gid = get_option('users-gid')
800 substs.set('USERS_GID', users_gid < 0 ? '-' : users_gid)
801
802 conf.set10('ENABLE_ADM_GROUP', get_option('adm-group'))
803 conf.set10('ENABLE_WHEEL_GROUP', get_option('wheel-group'))
804
805 dev_kvm_mode = get_option('dev-kvm-mode')
806 substs.set('DEV_KVM_MODE', dev_kvm_mode)
807 conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666')
808 group_render_mode = get_option('group-render-mode')
809 substs.set('GROUP_RENDER_MODE', group_render_mode)
810 conf.set10('GROUP_RENDER_UACCESS', group_render_mode != '0666')
811
812 kill_user_processes = get_option('default-kill-user-processes')
813 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
814 conf.set_quoted('KILL_USER_PROCESSES_YES_NO', kill_user_processes ? 'yes' : 'no')
815 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
816
817 dns_servers = get_option('dns-servers')
818 conf.set_quoted('DNS_SERVERS', dns_servers)
819 substs.set('DNS_SERVERS', dns_servers)
820
821 ntp_servers = get_option('ntp-servers')
822 conf.set_quoted('NTP_SERVERS', ntp_servers)
823 substs.set('NTP_SERVERS', ntp_servers)
824
825 default_locale = get_option('default-locale')
826 if default_locale == ''
827 if not meson.is_cross_build()
828 choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
829 default_locale = run_command(choose_default_locale_sh).stdout().strip()
830 else
831 default_locale = 'C.UTF-8'
832 endif
833 endif
834 conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
835
836 localegen_path = get_option('localegen-path')
837 have = false
838 if localegen_path != ''
839 conf.set_quoted('LOCALEGEN_PATH', localegen_path)
840 have = true
841 endif
842 conf.set10('HAVE_LOCALEGEN', have)
843
844 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
845
846 service_watchdog = get_option('service-watchdog')
847 watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog
848 substs.set('SERVICE_WATCHDOG', watchdog_value)
849
850 substs.set('SUSHELL', get_option('debug-shell'))
851 substs.set('DEBUGTTY', get_option('debug-tty'))
852 conf.set_quoted('DEBUGTTY', get_option('debug-tty'))
853
854 enable_debug_hashmap = false
855 enable_debug_mmap_cache = false
856 enable_debug_siphash = false
857 foreach name : get_option('debug-extra')
858 if name == 'hashmap'
859 enable_debug_hashmap = true
860 elif name == 'mmap-cache'
861 enable_debug_mmap_cache = true
862 elif name == 'siphash'
863 enable_debug_siphash = true
864 else
865 message('unknown debug option "@0@", ignoring'.format(name))
866 endif
867 endforeach
868 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
869 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
870 conf.set10('ENABLE_DEBUG_SIPHASH', enable_debug_siphash)
871
872 conf.set10('VALGRIND', get_option('valgrind'))
873 conf.set10('LOG_TRACE', get_option('log-trace'))
874
875 default_user_path = get_option('user-path')
876 if default_user_path != ''
877 conf.set_quoted('DEFAULT_USER_PATH', default_user_path)
878 default_user_path_display = default_user_path
879 else
880 # meson 0.49 fails when ?: is used in .format()
881 default_user_path_display = '(same as system services)'
882 endif
883
884
885 #####################################################################
886
887 threads = dependency('threads')
888 librt = cc.find_library('rt')
889 libm = cc.find_library('m')
890 libdl = cc.find_library('dl')
891 libcrypt = cc.find_library('crypt')
892
893 crypt_header = conf.get('HAVE_CRYPT_H') == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>'''
894 foreach ident : [
895 ['crypt_ra', crypt_header],
896 ['crypt_preferred_method', crypt_header],
897 ['crypt_gensalt_ra', crypt_header]]
898
899 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE',
900 dependencies : libcrypt)
901 conf.set10('HAVE_' + ident[0].to_upper(), have)
902 endforeach
903
904 libcap = dependency('libcap', required : false)
905 if not libcap.found()
906 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
907 libcap = cc.find_library('cap')
908 endif
909
910 libmount = dependency('mount',
911 version : fuzzer_build ? '>= 0' : '>= 2.30')
912
913 want_libfdisk = get_option('fdisk')
914 if want_libfdisk != 'false' and not skip_deps
915 libfdisk = dependency('fdisk',
916 version : '>= 2.33',
917 required : want_libfdisk == 'true')
918 have = libfdisk.found()
919 else
920 have = false
921 libfdisk = []
922 endif
923 conf.set10('HAVE_LIBFDISK', have)
924
925 want_pwquality = get_option('pwquality')
926 if want_pwquality != 'false' and not skip_deps
927 libpwquality = dependency('pwquality', required : want_pwquality == 'true')
928 have = libpwquality.found()
929 else
930 have = false
931 libpwquality = []
932 endif
933 conf.set10('HAVE_PWQUALITY', have)
934
935 want_seccomp = get_option('seccomp')
936 if want_seccomp != 'false' and not skip_deps
937 libseccomp = dependency('libseccomp',
938 version : '>= 2.3.1',
939 required : want_seccomp == 'true')
940 have = libseccomp.found()
941 else
942 have = false
943 libseccomp = []
944 endif
945 conf.set10('HAVE_SECCOMP', have)
946
947 want_selinux = get_option('selinux')
948 if want_selinux != 'false' and not skip_deps
949 libselinux = dependency('libselinux',
950 version : '>= 2.1.9',
951 required : want_selinux == 'true')
952 have = libselinux.found()
953 else
954 have = false
955 libselinux = []
956 endif
957 conf.set10('HAVE_SELINUX', have)
958
959 want_apparmor = get_option('apparmor')
960 if want_apparmor != 'false' and not skip_deps
961 libapparmor = dependency('libapparmor',
962 version : '>= 2.13',
963 required : want_apparmor == 'true')
964 have = libapparmor.found()
965 else
966 have = false
967 libapparmor = []
968 endif
969 conf.set10('HAVE_APPARMOR', have)
970
971 smack_run_label = get_option('smack-run-label')
972 if smack_run_label != ''
973 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
974 endif
975
976 want_polkit = get_option('polkit')
977 install_polkit = false
978 install_polkit_pkla = false
979 if want_polkit != 'false' and not skip_deps
980 install_polkit = true
981
982 libpolkit = dependency('polkit-gobject-1',
983 required : false)
984 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
985 message('Old polkit detected, will install pkla files')
986 install_polkit_pkla = true
987 endif
988 endif
989 conf.set10('ENABLE_POLKIT', install_polkit)
990
991 want_acl = get_option('acl')
992 if want_acl != 'false' and not skip_deps
993 libacl = cc.find_library('acl', required : want_acl == 'true')
994 have = libacl.found()
995 else
996 have = false
997 libacl = []
998 endif
999 conf.set10('HAVE_ACL', have)
1000
1001 want_audit = get_option('audit')
1002 if want_audit != 'false' and not skip_deps
1003 libaudit = dependency('audit', required : want_audit == 'true')
1004 have = libaudit.found()
1005 else
1006 have = false
1007 libaudit = []
1008 endif
1009 conf.set10('HAVE_AUDIT', have)
1010
1011 want_blkid = get_option('blkid')
1012 if want_blkid != 'false' and not skip_deps
1013 libblkid = dependency('blkid', required : want_blkid == 'true')
1014 have = libblkid.found()
1015
1016 conf.set10('HAVE_BLKID_PROBE_SET_HINT',
1017 have and cc.has_function('blkid_probe_set_hint', dependencies : libblkid))
1018 else
1019 have = false
1020 libblkid = []
1021 endif
1022 conf.set10('HAVE_BLKID', have)
1023
1024 want_kmod = get_option('kmod')
1025 if want_kmod != 'false' and not skip_deps
1026 libkmod = dependency('libkmod',
1027 version : '>= 15',
1028 required : want_kmod == 'true')
1029 have = libkmod.found()
1030 else
1031 have = false
1032 libkmod = []
1033 endif
1034 conf.set10('HAVE_KMOD', have)
1035
1036 want_pam = get_option('pam')
1037 if want_pam != 'false' and not skip_deps
1038 libpam = cc.find_library('pam', required : want_pam == 'true')
1039 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1040 have = libpam.found() and libpam_misc.found()
1041 else
1042 have = false
1043 libpam = []
1044 libpam_misc = []
1045 endif
1046 conf.set10('HAVE_PAM', have)
1047
1048 want_microhttpd = get_option('microhttpd')
1049 if want_microhttpd != 'false' and not skip_deps
1050 libmicrohttpd = dependency('libmicrohttpd',
1051 version : '>= 0.9.33',
1052 required : want_microhttpd == 'true')
1053 have = libmicrohttpd.found()
1054 else
1055 have = false
1056 libmicrohttpd = []
1057 endif
1058 conf.set10('HAVE_MICROHTTPD', have)
1059
1060 want_libcryptsetup = get_option('libcryptsetup')
1061 if want_libcryptsetup != 'false' and not skip_deps
1062 libcryptsetup = dependency('libcryptsetup',
1063 version : '>= 2.0.1',
1064 required : want_libcryptsetup == 'true')
1065 have = libcryptsetup.found()
1066
1067 conf.set10('HAVE_CRYPT_SET_METADATA_SIZE',
1068 have and cc.has_function('crypt_set_metadata_size', dependencies : libcryptsetup))
1069 conf.set10('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY',
1070 have and cc.has_function('crypt_activate_by_signed_key', dependencies : libcryptsetup))
1071 conf.set10('HAVE_CRYPT_TOKEN_MAX',
1072 have and cc.has_function('crypt_token_max', dependencies : libcryptsetup))
1073 else
1074 have = false
1075 libcryptsetup = []
1076 endif
1077 conf.set10('HAVE_LIBCRYPTSETUP', have)
1078
1079 want_libcurl = get_option('libcurl')
1080 if want_libcurl != 'false' and not skip_deps
1081 libcurl = dependency('libcurl',
1082 version : '>= 7.32.0',
1083 required : want_libcurl == 'true')
1084 have = libcurl.found()
1085 else
1086 have = false
1087 libcurl = []
1088 endif
1089 conf.set10('HAVE_LIBCURL', have)
1090 conf.set10('CURL_NO_OLDIES', get_option('mode') == 'developer')
1091
1092 want_libidn = get_option('libidn')
1093 want_libidn2 = get_option('libidn2')
1094 if want_libidn == 'true' and want_libidn2 == 'true'
1095 error('libidn and libidn2 cannot be requested simultaneously')
1096 endif
1097
1098 if want_libidn2 != 'false' and want_libidn != 'true' and not skip_deps
1099 libidn = dependency('libidn2',
1100 required : want_libidn2 == 'true')
1101 have = libidn.found()
1102 else
1103 have = false
1104 libidn = []
1105 endif
1106 conf.set10('HAVE_LIBIDN2', have)
1107 if not have and want_libidn != 'false' and not skip_deps
1108 # libidn is used for both libidn and libidn2 objects
1109 libidn = dependency('libidn',
1110 required : want_libidn == 'true')
1111 have = libidn.found()
1112 else
1113 have = false
1114 endif
1115 conf.set10('HAVE_LIBIDN', have)
1116
1117 want_libiptc = get_option('libiptc')
1118 if want_libiptc != 'false' and not skip_deps
1119 libiptc = dependency('libiptc',
1120 required : want_libiptc == 'true')
1121 have = libiptc.found()
1122 else
1123 have = false
1124 libiptc = []
1125 endif
1126 conf.set10('HAVE_LIBIPTC', have)
1127
1128 want_qrencode = get_option('qrencode')
1129 if want_qrencode != 'false' and not skip_deps
1130 libqrencode = dependency('libqrencode',
1131 version : '>= 4',
1132 required : want_qrencode == 'true')
1133 have = libqrencode.found()
1134 else
1135 have = false
1136 libqrencode = []
1137 endif
1138 conf.set10('HAVE_QRENCODE', have)
1139
1140 want_gcrypt = get_option('gcrypt')
1141 if want_gcrypt != 'false' and not skip_deps
1142 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1143 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1144 have = libgcrypt.found() and libgpg_error.found()
1145 else
1146 have = false
1147 endif
1148 if not have
1149 # link to neither of the libs if one is not found
1150 libgcrypt = []
1151 libgpg_error = []
1152 endif
1153 conf.set10('HAVE_GCRYPT', have)
1154
1155 want_gnutls = get_option('gnutls')
1156 if want_gnutls != 'false' and not skip_deps
1157 libgnutls = dependency('gnutls',
1158 version : '>= 3.1.4',
1159 required : want_gnutls == 'true')
1160 have = libgnutls.found()
1161 else
1162 have = false
1163 libgnutls = []
1164 endif
1165 conf.set10('HAVE_GNUTLS', have)
1166
1167 want_openssl = get_option('openssl')
1168 if want_openssl != 'false' and not skip_deps
1169 libopenssl = dependency('openssl',
1170 version : '>= 1.1.0',
1171 required : want_openssl == 'true')
1172 have = libopenssl.found()
1173 else
1174 have = false
1175 libopenssl = []
1176 endif
1177 conf.set10('HAVE_OPENSSL', have)
1178
1179 want_p11kit = get_option('p11kit')
1180 if want_p11kit != 'false' and not skip_deps
1181 libp11kit = dependency('p11-kit-1',
1182 version : '>= 0.23.3',
1183 required : want_p11kit == 'true')
1184 have = libp11kit.found()
1185 else
1186 have = false
1187 libp11kit = []
1188 endif
1189 conf.set10('HAVE_P11KIT', have)
1190
1191 want_libfido2 = get_option('libfido2')
1192 if want_libfido2 != 'false' and not skip_deps
1193 libfido2 = dependency('libfido2',
1194 required : want_libfido2 == 'true')
1195 have = libfido2.found()
1196 else
1197 have = false
1198 libfido2 = []
1199 endif
1200 conf.set10('HAVE_LIBFIDO2', have)
1201
1202 want_tpm2 = get_option('tpm2')
1203 if want_tpm2 != 'false' and not skip_deps
1204 tpm2 = dependency('tss2-esys tss2-rc tss2-mu',
1205 required : want_tpm2 == 'true')
1206 have = tpm2.found()
1207 else
1208 have = false
1209 tpm2 = []
1210 endif
1211 conf.set10('HAVE_TPM2', have)
1212
1213 want_elfutils = get_option('elfutils')
1214 if want_elfutils != 'false' and not skip_deps
1215 libdw = dependency('libdw',
1216 required : want_elfutils == 'true')
1217 have = libdw.found()
1218 else
1219 have = false
1220 libdw = []
1221 endif
1222 conf.set10('HAVE_ELFUTILS', have)
1223
1224 want_zlib = get_option('zlib')
1225 if want_zlib != 'false' and not skip_deps
1226 libz = dependency('zlib',
1227 required : want_zlib == 'true')
1228 have = libz.found()
1229 else
1230 have = false
1231 libz = []
1232 endif
1233 conf.set10('HAVE_ZLIB', have)
1234
1235 want_bzip2 = get_option('bzip2')
1236 if want_bzip2 != 'false' and not skip_deps
1237 libbzip2 = cc.find_library('bz2',
1238 required : want_bzip2 == 'true')
1239 have = libbzip2.found()
1240 else
1241 have = false
1242 libbzip2 = []
1243 endif
1244 conf.set10('HAVE_BZIP2', have)
1245
1246 want_xz = get_option('xz')
1247 if want_xz != 'false' and not skip_deps
1248 libxz = dependency('liblzma',
1249 required : want_xz == 'true')
1250 have_xz = libxz.found()
1251 else
1252 have_xz = false
1253 libxz = []
1254 endif
1255 conf.set10('HAVE_XZ', have_xz)
1256
1257 want_lz4 = get_option('lz4')
1258 if want_lz4 != 'false' and not skip_deps
1259 liblz4 = dependency('liblz4',
1260 version : '>= 1.3.0',
1261 required : want_lz4 == 'true')
1262 have_lz4 = liblz4.found()
1263 else
1264 have_lz4 = false
1265 liblz4 = []
1266 endif
1267 conf.set10('HAVE_LZ4', have_lz4)
1268
1269 want_zstd = get_option('zstd')
1270 if want_zstd != 'false' and not skip_deps
1271 libzstd = dependency('libzstd',
1272 required : want_zstd == 'true',
1273 version : '>= 1.4.0')
1274 have_zstd = libzstd.found()
1275 else
1276 have_zstd = false
1277 libzstd = []
1278 endif
1279 conf.set10('HAVE_ZSTD', have_zstd)
1280
1281 conf.set10('HAVE_COMPRESSION', have_xz or have_lz4 or have_zstd)
1282
1283 want_xkbcommon = get_option('xkbcommon')
1284 if want_xkbcommon != 'false' and not skip_deps
1285 libxkbcommon = dependency('xkbcommon',
1286 version : '>= 0.3.0',
1287 required : want_xkbcommon == 'true')
1288 have = libxkbcommon.found()
1289 else
1290 have = false
1291 libxkbcommon = []
1292 endif
1293 conf.set10('HAVE_XKBCOMMON', have)
1294
1295 want_pcre2 = get_option('pcre2')
1296 if want_pcre2 != 'false'
1297 libpcre2 = dependency('libpcre2-8',
1298 required : want_pcre2 == 'true')
1299 have = libpcre2.found()
1300 else
1301 have = false
1302 libpcre2 = []
1303 endif
1304 conf.set10('HAVE_PCRE2', have)
1305
1306 want_glib = get_option('glib')
1307 if want_glib != 'false' and not skip_deps
1308 libglib = dependency('glib-2.0',
1309 version : '>= 2.22.0',
1310 required : want_glib == 'true')
1311 libgobject = dependency('gobject-2.0',
1312 version : '>= 2.22.0',
1313 required : want_glib == 'true')
1314 libgio = dependency('gio-2.0',
1315 required : want_glib == 'true')
1316 have = libglib.found() and libgobject.found() and libgio.found()
1317 else
1318 have = false
1319 libglib = []
1320 libgobject = []
1321 libgio = []
1322 endif
1323 conf.set10('HAVE_GLIB', have)
1324
1325 want_dbus = get_option('dbus')
1326 if want_dbus != 'false' and not skip_deps
1327 libdbus = dependency('dbus-1',
1328 version : '>= 1.3.2',
1329 required : want_dbus == 'true')
1330 have = libdbus.found()
1331 else
1332 have = false
1333 libdbus = []
1334 endif
1335 conf.set10('HAVE_DBUS', have)
1336
1337 default_dnssec = get_option('default-dnssec')
1338 if skip_deps
1339 default_dnssec = 'no'
1340 endif
1341 if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1342 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1343 default_dnssec = 'no'
1344 endif
1345 conf.set('DEFAULT_DNSSEC_MODE',
1346 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1347 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1348
1349 dns_over_tls = get_option('dns-over-tls')
1350 if dns_over_tls != 'false'
1351 if dns_over_tls == 'openssl'
1352 have_gnutls = false
1353 else
1354 have_gnutls = (conf.get('HAVE_GNUTLS') == 1 and libgnutls.version().version_compare('>= 3.6.0'))
1355 if dns_over_tls == 'gnutls' and not have_gnutls
1356 error('DNS-over-TLS support was requested with gnutls, but dependencies are not available')
1357 endif
1358 endif
1359 if dns_over_tls == 'gnutls' or have_gnutls
1360 have_openssl = false
1361 else
1362 have_openssl = conf.get('HAVE_OPENSSL') == 1
1363 if dns_over_tls != 'auto' and not have_openssl
1364 str = dns_over_tls == 'openssl' ? ' with openssl' : ''
1365 error('DNS-over-TLS support was requested@0@, but dependencies are not available'.format(str))
1366 endif
1367 endif
1368 have = have_gnutls or have_openssl
1369 else
1370 have = false
1371 have_gnutls = false
1372 have_openssl = false
1373 endif
1374 conf.set10('ENABLE_DNS_OVER_TLS', have)
1375 conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
1376 conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl)
1377
1378 default_dns_over_tls = get_option('default-dns-over-tls')
1379 if skip_deps
1380 default_dns_over_tls = 'no'
1381 endif
1382 if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0
1383 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.')
1384 default_dns_over_tls = 'no'
1385 endif
1386 conf.set('DEFAULT_DNS_OVER_TLS_MODE',
1387 'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper())
1388 substs.set('DEFAULT_DNS_OVER_TLS_MODE', default_dns_over_tls)
1389
1390 default_mdns = get_option('default-mdns')
1391 conf.set('DEFAULT_MDNS_MODE',
1392 'RESOLVE_SUPPORT_' + default_mdns.to_upper())
1393 substs.set('DEFAULT_MDNS_MODE', default_mdns)
1394
1395 default_llmnr = get_option('default-llmnr')
1396 conf.set('DEFAULT_LLMNR_MODE',
1397 'RESOLVE_SUPPORT_' + default_llmnr.to_upper())
1398 substs.set('DEFAULT_LLMNR_MODE', default_llmnr)
1399
1400 want_repart = get_option('repart')
1401 if want_repart != 'false'
1402 have = (conf.get('HAVE_OPENSSL') == 1 and
1403 conf.get('HAVE_LIBFDISK') == 1)
1404 if want_repart == 'true' and not have
1405 error('repart support was requested, but dependencies are not available')
1406 endif
1407 else
1408 have = false
1409 endif
1410 conf.set10('ENABLE_REPART', have)
1411
1412 want_importd = get_option('importd')
1413 if want_importd != 'false'
1414 have = (conf.get('HAVE_LIBCURL') == 1 and
1415 conf.get('HAVE_ZLIB') == 1 and
1416 conf.get('HAVE_XZ') == 1 and
1417 conf.get('HAVE_GCRYPT') == 1)
1418 if want_importd == 'true' and not have
1419 error('importd support was requested, but dependencies are not available')
1420 endif
1421 else
1422 have = false
1423 endif
1424 conf.set10('ENABLE_IMPORTD', have)
1425
1426 want_homed = get_option('homed')
1427 if want_homed != 'false'
1428 have = (conf.get('HAVE_OPENSSL') == 1 and
1429 conf.get('HAVE_LIBFDISK') == 1 and
1430 conf.get('HAVE_LIBCRYPTSETUP') == 1)
1431 if want_homed == 'true' and not have
1432 error('homed support was requested, but dependencies are not available')
1433 endif
1434 else
1435 have = false
1436 endif
1437 conf.set10('ENABLE_HOMED', have)
1438
1439 have = have and conf.get('HAVE_PAM') == 1
1440 conf.set10('ENABLE_PAM_HOME', have)
1441
1442 have = get_option('oomd')
1443 if have == 'auto'
1444 have = get_option('mode') == 'developer'
1445 else
1446 have = have == 'true'
1447 if have and get_option('mode') != 'developer'
1448 warning('oomd is not ready for release mode (yet)')
1449 endif
1450 endif
1451 conf.set10('ENABLE_OOMD', have)
1452 substs.set10('ENABLE_OOMD', have)
1453
1454 want_remote = get_option('remote')
1455 if want_remote != 'false'
1456 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1457 conf.get('HAVE_LIBCURL') == 1]
1458 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1459 # it's possible to build one without the other. Complain only if
1460 # support was explicitly requested. The auxiliary files like sysusers
1461 # config should be installed when any of the programs are built.
1462 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1463 error('remote support was requested, but dependencies are not available')
1464 endif
1465 have = have_deps[0] or have_deps[1]
1466 else
1467 have = false
1468 endif
1469 conf.set10('ENABLE_REMOTE', have)
1470
1471 foreach term : ['analyze',
1472 'backlight',
1473 'binfmt',
1474 'coredump',
1475 'efi',
1476 'environment-d',
1477 'firstboot',
1478 'gshadow',
1479 'hibernate',
1480 'hostnamed',
1481 'hwdb',
1482 'idn',
1483 'ima',
1484 'initrd',
1485 'compat-mutable-uid-boundaries',
1486 'nscd',
1487 'ldconfig',
1488 'localed',
1489 'logind',
1490 'machined',
1491 'networkd',
1492 'nss-myhostname',
1493 'nss-systemd',
1494 'portabled',
1495 'pstore',
1496 'quotacheck',
1497 'randomseed',
1498 'resolve',
1499 'rfkill',
1500 'smack',
1501 'sysusers',
1502 'timedated',
1503 'timesyncd',
1504 'tmpfiles',
1505 'tpm',
1506 'userdb',
1507 'utmp',
1508 'vconsole',
1509 'xdg-autostart']
1510 have = get_option(term)
1511 name = 'ENABLE_' + term.underscorify().to_upper()
1512 conf.set10(name, have)
1513 substs.set10(name, have)
1514 endforeach
1515
1516 enable_sysusers = conf.get('ENABLE_SYSUSERS') == 1
1517
1518 foreach tuple : [['nss-mymachines', 'machined'],
1519 ['nss-resolve', 'resolve']]
1520 want = get_option(tuple[0])
1521 if want != 'false'
1522 have = get_option(tuple[1])
1523 if want == 'true' and not have
1524 error('@0@ is requested but @1@ is disabled'.format(tuple[0], tuple[1]))
1525 endif
1526 else
1527 have = false
1528 endif
1529 name = 'ENABLE_' + tuple[0].underscorify().to_upper()
1530 conf.set10(name, have)
1531 endforeach
1532
1533 enable_nss = false
1534 foreach term : ['ENABLE_NSS_MYHOSTNAME',
1535 'ENABLE_NSS_MYMACHINES',
1536 'ENABLE_NSS_RESOLVE',
1537 'ENABLE_NSS_SYSTEMD']
1538 if conf.get(term) == 1
1539 enable_nss = true
1540 endif
1541 endforeach
1542 conf.set10('ENABLE_NSS', enable_nss)
1543
1544 conf.set10('ENABLE_TIMEDATECTL', get_option('timedated') or get_option('timesyncd'))
1545
1546 tests = []
1547 fuzzers = []
1548
1549 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
1550
1551 #####################################################################
1552
1553 if get_option('efi')
1554 efi_arch = host_machine.cpu_family()
1555
1556 if efi_arch == 'x86'
1557 EFI_MACHINE_TYPE_NAME = 'ia32'
1558 gnu_efi_arch = 'ia32'
1559 elif efi_arch == 'x86_64'
1560 EFI_MACHINE_TYPE_NAME = 'x64'
1561 gnu_efi_arch = 'x86_64'
1562 elif efi_arch == 'arm'
1563 EFI_MACHINE_TYPE_NAME = 'arm'
1564 gnu_efi_arch = 'arm'
1565 elif efi_arch == 'aarch64'
1566 EFI_MACHINE_TYPE_NAME = 'aa64'
1567 gnu_efi_arch = 'aarch64'
1568 else
1569 EFI_MACHINE_TYPE_NAME = ''
1570 gnu_efi_arch = ''
1571 endif
1572
1573 have = true
1574 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1575
1576 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
1577 else
1578 have = false
1579 endif
1580 conf.set10('ENABLE_EFI', have)
1581
1582 #####################################################################
1583
1584 config_h = configure_file(
1585 output : 'config.h',
1586 configuration : conf)
1587
1588 meson_apply_m4 = find_program('tools/meson-apply-m4.sh')
1589
1590 includes = include_directories('src/basic',
1591 'src/boot',
1592 'src/core',
1593 'src/home',
1594 'src/journal',
1595 'src/journal-remote',
1596 'src/libsystemd-network',
1597 'src/libsystemd/sd-bus',
1598 'src/libsystemd/sd-device',
1599 'src/libsystemd/sd-event',
1600 'src/libsystemd/sd-hwdb',
1601 'src/libsystemd/sd-id128',
1602 'src/libsystemd/sd-netlink',
1603 'src/libsystemd/sd-network',
1604 'src/libsystemd/sd-resolve',
1605 'src/login',
1606 'src/nspawn',
1607 'src/resolve',
1608 'src/shared',
1609 'src/shutdown',
1610 'src/systemd',
1611 'src/time-wait-sync',
1612 'src/timesync',
1613 'src/udev',
1614 'src/xdg-autostart-generator',
1615 '.')
1616
1617 add_project_arguments('-include', 'config.h', language : 'c')
1618
1619 generate_gperfs = find_program('tools/generate-gperfs.py')
1620
1621 subdir('po')
1622 subdir('catalog')
1623 subdir('src/libudev')
1624 subdir('src/systemd')
1625 subdir('src/basic')
1626 subdir('src/libsystemd')
1627 subdir('src/libsystemd-network')
1628 subdir('src/journal')
1629 subdir('src/login')
1630
1631 libjournal_core = static_library(
1632 'journal-core',
1633 libjournal_core_sources,
1634 journald_gperf_c,
1635 include_directories : includes,
1636 install : false)
1637
1638 libsystemd_sym_path = '@0@/@1@'.format(project_source_root, libsystemd_sym)
1639 libsystemd = shared_library(
1640 'systemd',
1641 disable_mempool_c,
1642 version : libsystemd_version,
1643 include_directories : includes,
1644 link_args : ['-shared',
1645 '-Wl,--version-script=' + libsystemd_sym_path],
1646 link_with : [libbasic,
1647 libbasic_gcrypt],
1648 link_whole : [libsystemd_static,
1649 libjournal_client],
1650 dependencies : [threads,
1651 librt,
1652 libxz,
1653 libzstd,
1654 liblz4],
1655 link_depends : libsystemd_sym,
1656 install : true,
1657 install_dir : rootlibdir)
1658
1659 static_libsystemd = get_option('static-libsystemd')
1660 static_libsystemd_pic = static_libsystemd == 'true' or static_libsystemd == 'pic'
1661
1662 install_libsystemd_static = static_library(
1663 'systemd',
1664 libsystemd_sources,
1665 journal_client_sources,
1666 basic_sources,
1667 basic_gcrypt_sources,
1668 disable_mempool_c,
1669 include_directories : includes,
1670 build_by_default : static_libsystemd != 'false',
1671 install : static_libsystemd != 'false',
1672 install_dir : rootlibdir,
1673 pic : static_libsystemd == 'true' or static_libsystemd == 'pic',
1674 dependencies : [threads,
1675 librt,
1676 libxz,
1677 libzstd,
1678 liblz4,
1679 libcap,
1680 libblkid,
1681 libmount,
1682 libselinux,
1683 libgcrypt],
1684 c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
1685
1686 ############################################################
1687
1688 autosuspend_update_sh = find_program('tools/autosuspend-update.sh')
1689 hwdb_update_sh = find_program('tools/hwdb-update.sh')
1690 make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
1691 make_directive_index_py = find_program('tools/make-directive-index.py')
1692 make_man_index_py = find_program('tools/make-man-index.py')
1693 syscall_names_update_sh = find_program('tools/syscall-names-update.sh')
1694 xml_helper_py = find_program('tools/xml_helper.py')
1695 update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
1696
1697 ############################################################
1698
1699 # binaries that have --help and are intended for use by humans,
1700 # usually, but not always, installed in /bin.
1701 public_programs = []
1702
1703 subdir('src/shared')
1704 subdir('src/core')
1705 subdir('src/shutdown')
1706 subdir('src/udev')
1707 subdir('src/network')
1708
1709 subdir('src/analyze')
1710 subdir('src/journal-remote')
1711 subdir('src/coredump')
1712 subdir('src/pstore')
1713 subdir('src/oom')
1714 subdir('src/hostname')
1715 subdir('src/import')
1716 subdir('src/partition')
1717 subdir('src/kernel-install')
1718 subdir('src/locale')
1719 subdir('src/machine')
1720 subdir('src/portable')
1721 subdir('src/userdb')
1722 subdir('src/home')
1723 subdir('src/nspawn')
1724 subdir('src/resolve')
1725 subdir('src/timedate')
1726 subdir('src/timesync')
1727 subdir('src/tmpfiles')
1728 subdir('src/vconsole')
1729 subdir('src/boot/efi')
1730
1731 subdir('src/test')
1732 subdir('src/fuzz')
1733 subdir('rules.d')
1734 subdir('test')
1735
1736 ############################################################
1737
1738 # only static linking apart from libdl, to make sure that the
1739 # module is linked to all libraries that it uses.
1740 test_dlopen = executable(
1741 'test-dlopen',
1742 test_dlopen_c,
1743 disable_mempool_c,
1744 include_directories : includes,
1745 link_with : [libbasic],
1746 dependencies : [libdl],
1747 build_by_default : want_tests != 'false')
1748
1749 foreach tuple : [['myhostname', 'ENABLE_NSS_MYHOSTNAME'],
1750 ['systemd', 'ENABLE_NSS_SYSTEMD', 'src/nss-systemd/userdb-glue.c src/nss-systemd/userdb-glue.h src/nss-systemd/nss-systemd.h'],
1751 ['mymachines', 'ENABLE_NSS_MYMACHINES'],
1752 ['resolve', 'ENABLE_NSS_RESOLVE']]
1753
1754 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1755 if condition
1756 module = tuple[0]
1757
1758 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1759 version_script_arg = join_paths(project_source_root, sym)
1760
1761 sources = ['src/nss-@0@/nss-@0@.c'.format(module)]
1762 if tuple.length() > 2
1763 sources += tuple[2].split()
1764 endif
1765
1766 nss = shared_library(
1767 'nss_' + module,
1768 sources,
1769 disable_mempool_c,
1770 version : '2',
1771 include_directories : includes,
1772 # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1773 link_args : ['-Wl,-z,nodelete',
1774 '-shared',
1775 '-Wl,--version-script=' + version_script_arg],
1776 link_with : [libsystemd_static,
1777 libshared_static,
1778 libbasic],
1779 dependencies : [threads,
1780 librt],
1781 link_depends : sym,
1782 install : true,
1783 install_dir : rootlibdir)
1784
1785 # We cannot use shared_module because it does not support version suffix.
1786 # Unfortunately shared_library insists on creating the symlink…
1787 meson.add_install_script('sh', '-c',
1788 'rm $DESTDIR@0@/libnss_@1@.so'
1789 .format(rootlibdir, module))
1790
1791 if want_tests != 'false'
1792 test('dlopen-nss_' + module,
1793 test_dlopen,
1794 # path to dlopen must include a slash
1795 args : nss.full_path())
1796 endif
1797 endif
1798 endforeach
1799
1800 ############################################################
1801
1802 executable(
1803 'systemd',
1804 systemd_sources,
1805 include_directories : includes,
1806 link_with : [libcore,
1807 libshared],
1808 dependencies : [versiondep,
1809 threads,
1810 librt,
1811 libseccomp,
1812 libselinux,
1813 libmount,
1814 libblkid],
1815 install_rpath : rootlibexecdir,
1816 install : true,
1817 install_dir : rootlibexecdir)
1818
1819 meson.add_install_script(meson_make_symlink,
1820 join_paths(rootlibexecdir, 'systemd'),
1821 join_paths(rootsbindir, 'init'))
1822
1823 public_programs += executable(
1824 'systemd-analyze',
1825 systemd_analyze_sources,
1826 include_directories : includes,
1827 link_with : [libcore,
1828 libshared],
1829 dependencies : [versiondep,
1830 threads,
1831 librt,
1832 libseccomp,
1833 libselinux,
1834 libmount,
1835 libblkid],
1836 install_rpath : rootlibexecdir,
1837 install : conf.get('ENABLE_ANALYZE'))
1838
1839 executable(
1840 'systemd-journald',
1841 systemd_journald_sources,
1842 include_directories : includes,
1843 link_with : [libjournal_core,
1844 libshared],
1845 dependencies : [threads,
1846 libxz,
1847 liblz4,
1848 libselinux,
1849 libzstd],
1850 install_rpath : rootlibexecdir,
1851 install : true,
1852 install_dir : rootlibexecdir)
1853
1854 public_programs += executable(
1855 'systemd-cat',
1856 systemd_cat_sources,
1857 include_directories : includes,
1858 link_with : [libjournal_core,
1859 libshared],
1860 dependencies : [threads],
1861 install_rpath : rootlibexecdir,
1862 install : true)
1863
1864 public_programs += executable(
1865 'journalctl',
1866 journalctl_sources,
1867 include_directories : includes,
1868 link_with : [libshared],
1869 dependencies : [threads,
1870 libdl,
1871 libxz,
1872 liblz4,
1873 libzstd,
1874 libdl],
1875 install_rpath : rootlibexecdir,
1876 install : true,
1877 install_dir : rootbindir)
1878
1879 executable(
1880 'systemd-getty-generator',
1881 'src/getty-generator/getty-generator.c',
1882 include_directories : includes,
1883 link_with : [libshared],
1884 install_rpath : rootlibexecdir,
1885 install : true,
1886 install_dir : systemgeneratordir)
1887
1888 executable(
1889 'systemd-debug-generator',
1890 'src/debug-generator/debug-generator.c',
1891 include_directories : includes,
1892 link_with : [libshared],
1893 install_rpath : rootlibexecdir,
1894 install : true,
1895 install_dir : systemgeneratordir)
1896
1897 executable(
1898 'systemd-run-generator',
1899 'src/run-generator/run-generator.c',
1900 include_directories : includes,
1901 link_with : [libshared],
1902 install_rpath : rootlibexecdir,
1903 install : true,
1904 install_dir : systemgeneratordir)
1905
1906 executable(
1907 'systemd-fstab-generator',
1908 'src/fstab-generator/fstab-generator.c',
1909 include_directories : includes,
1910 link_with : [libcore_shared,
1911 libshared],
1912 install_rpath : rootlibexecdir,
1913 install : true,
1914 install_dir : systemgeneratordir)
1915
1916 if conf.get('ENABLE_ENVIRONMENT_D') == 1
1917 executable(
1918 '30-systemd-environment-d-generator',
1919 'src/environment-d-generator/environment-d-generator.c',
1920 include_directories : includes,
1921 link_with : [libshared],
1922 install_rpath : rootlibexecdir,
1923 install : true,
1924 install_dir : userenvgeneratordir)
1925
1926 meson.add_install_script(meson_make_symlink,
1927 join_paths(sysconfdir, 'environment'),
1928 join_paths(environmentdir, '99-environment.conf'))
1929 endif
1930
1931 if conf.get('ENABLE_HIBERNATE') == 1
1932 executable(
1933 'systemd-hibernate-resume-generator',
1934 'src/hibernate-resume/hibernate-resume-generator.c',
1935 include_directories : includes,
1936 link_with : [libshared],
1937 install_rpath : rootlibexecdir,
1938 install : true,
1939 install_dir : systemgeneratordir)
1940
1941 executable(
1942 'systemd-hibernate-resume',
1943 'src/hibernate-resume/hibernate-resume.c',
1944 include_directories : includes,
1945 link_with : [libshared],
1946 install_rpath : rootlibexecdir,
1947 install : true,
1948 install_dir : rootlibexecdir)
1949 endif
1950
1951 if conf.get('HAVE_BLKID') == 1
1952 executable(
1953 'systemd-gpt-auto-generator',
1954 'src/gpt-auto-generator/gpt-auto-generator.c',
1955 'src/shared/blkid-util.h',
1956 include_directories : includes,
1957 link_with : [libshared],
1958 dependencies : libblkid,
1959 install_rpath : rootlibexecdir,
1960 install : true,
1961 install_dir : systemgeneratordir)
1962
1963 public_programs += executable(
1964 'systemd-dissect',
1965 'src/dissect/dissect.c',
1966 include_directories : includes,
1967 link_with : [libshared],
1968 install_rpath : rootlibexecdir,
1969 install : true)
1970 endif
1971
1972 if conf.get('ENABLE_RESOLVE') == 1
1973 executable(
1974 'systemd-resolved',
1975 systemd_resolved_sources,
1976 include_directories : includes,
1977 link_with : [libshared,
1978 libbasic_gcrypt,
1979 libsystemd_resolve_core],
1980 dependencies : systemd_resolved_dependencies,
1981 install_rpath : rootlibexecdir,
1982 install : true,
1983 install_dir : rootlibexecdir)
1984
1985 public_programs += executable(
1986 'resolvectl',
1987 resolvectl_sources,
1988 include_directories : includes,
1989 link_with : [libshared,
1990 libbasic_gcrypt,
1991 libsystemd_resolve_core],
1992 dependencies : [threads,
1993 libgpg_error,
1994 libm,
1995 libidn],
1996 install_rpath : rootlibexecdir,
1997 install : true)
1998
1999 meson.add_install_script(meson_make_symlink,
2000 join_paths(bindir, 'resolvectl'),
2001 join_paths(rootsbindir, 'resolvconf'))
2002
2003 meson.add_install_script(meson_make_symlink,
2004 join_paths(bindir, 'resolvectl'),
2005 join_paths(bindir, 'systemd-resolve'))
2006 endif
2007
2008 if conf.get('ENABLE_LOGIND') == 1
2009 executable(
2010 'systemd-logind',
2011 systemd_logind_sources,
2012 include_directories : includes,
2013 link_with : [liblogind_core,
2014 libshared],
2015 dependencies : [threads,
2016 libacl],
2017 install_rpath : rootlibexecdir,
2018 install : true,
2019 install_dir : rootlibexecdir)
2020
2021 public_programs += executable(
2022 'loginctl',
2023 loginctl_sources,
2024 include_directories : includes,
2025 link_with : [libshared],
2026 dependencies : [threads,
2027 liblz4,
2028 libxz,
2029 libzstd],
2030 install_rpath : rootlibexecdir,
2031 install : true,
2032 install_dir : rootbindir)
2033
2034 public_programs += executable(
2035 'systemd-inhibit',
2036 'src/login/inhibit.c',
2037 include_directories : includes,
2038 link_with : [libshared],
2039 install_rpath : rootlibexecdir,
2040 install : true,
2041 install_dir : rootbindir)
2042
2043 if conf.get('HAVE_PAM') == 1
2044 version_script_arg = join_paths(project_source_root, pam_systemd_sym)
2045 pam_systemd = shared_library(
2046 'pam_systemd',
2047 pam_systemd_c,
2048 name_prefix : '',
2049 include_directories : includes,
2050 link_args : ['-shared',
2051 '-Wl,--version-script=' + version_script_arg],
2052 link_with : [libsystemd_static,
2053 libshared_static],
2054 dependencies : [threads,
2055 libpam,
2056 libpam_misc],
2057 link_depends : pam_systemd_sym,
2058 install : true,
2059 install_dir : pamlibdir)
2060
2061 if want_tests != 'false'
2062 test('dlopen-pam_systemd',
2063 test_dlopen,
2064 # path to dlopen must include a slash
2065 args : pam_systemd.full_path())
2066 endif
2067 endif
2068
2069 executable(
2070 'systemd-user-runtime-dir',
2071 user_runtime_dir_sources,
2072 include_directories : includes,
2073 link_with : [libshared],
2074 install_rpath : rootlibexecdir,
2075 install : true,
2076 install_dir : rootlibexecdir)
2077 endif
2078
2079 if conf.get('HAVE_PAM') == 1
2080 executable(
2081 'systemd-user-sessions',
2082 'src/user-sessions/user-sessions.c',
2083 include_directories : includes,
2084 link_with : [libshared],
2085 install_rpath : rootlibexecdir,
2086 install : true,
2087 install_dir : rootlibexecdir)
2088 endif
2089
2090 if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
2091 public_programs += executable(
2092 'bootctl',
2093 'src/boot/bootctl.c',
2094 include_directories : includes,
2095 link_with : [libshared],
2096 dependencies : [libblkid],
2097 install_rpath : rootlibexecdir,
2098 install : true)
2099
2100 public_programs += executable(
2101 'systemd-bless-boot',
2102 'src/boot/bless-boot.c',
2103 include_directories : includes,
2104 link_with : [libshared],
2105 dependencies : [libblkid],
2106 install_rpath : rootlibexecdir,
2107 install : true,
2108 install_dir : rootlibexecdir)
2109
2110 executable(
2111 'systemd-bless-boot-generator',
2112 'src/boot/bless-boot-generator.c',
2113 include_directories : includes,
2114 link_with : [libshared],
2115 install_rpath : rootlibexecdir,
2116 install : true,
2117 install_dir : systemgeneratordir)
2118 endif
2119
2120 executable(
2121 'systemd-boot-check-no-failures',
2122 'src/boot/boot-check-no-failures.c',
2123 include_directories : includes,
2124 link_with : [libshared],
2125 dependencies : [libblkid],
2126 install_rpath : rootlibexecdir,
2127 install : true,
2128 install_dir : rootlibexecdir)
2129
2130 public_programs += executable(
2131 'systemd-socket-activate',
2132 'src/activate/activate.c',
2133 include_directories : includes,
2134 link_with : [libshared],
2135 dependencies : [threads],
2136 install_rpath : rootlibexecdir,
2137 install : true)
2138
2139 if get_option('link-systemctl-shared')
2140 systemctl_link_with = [libshared]
2141 else
2142 systemctl_link_with = [libsystemd_static,
2143 libshared_static,
2144 libjournal_client,
2145 libbasic_gcrypt]
2146 endif
2147
2148 public_programs += executable(
2149 'systemctl',
2150 'src/systemctl/systemctl-add-dependency.c',
2151 'src/systemctl/systemctl-add-dependency.h',
2152 'src/systemctl/systemctl-cancel-job.c',
2153 'src/systemctl/systemctl-cancel-job.h',
2154 'src/systemctl/systemctl-clean-or-freeze.c',
2155 'src/systemctl/systemctl-clean-or-freeze.h',
2156 'src/systemctl/systemctl-compat-halt.c',
2157 'src/systemctl/systemctl-compat-halt.h',
2158 'src/systemctl/systemctl-compat-runlevel.c',
2159 'src/systemctl/systemctl-compat-runlevel.h',
2160 'src/systemctl/systemctl-compat-shutdown.c',
2161 'src/systemctl/systemctl-compat-shutdown.h',
2162 'src/systemctl/systemctl-compat-telinit.c',
2163 'src/systemctl/systemctl-compat-telinit.h',
2164 'src/systemctl/systemctl-daemon-reload.c',
2165 'src/systemctl/systemctl-daemon-reload.h',
2166 'src/systemctl/systemctl-edit.c',
2167 'src/systemctl/systemctl-edit.h',
2168 'src/systemctl/systemctl-enable.c',
2169 'src/systemctl/systemctl-enable.h',
2170 'src/systemctl/systemctl-is-active.c',
2171 'src/systemctl/systemctl-is-active.h',
2172 'src/systemctl/systemctl-is-enabled.c',
2173 'src/systemctl/systemctl-is-enabled.h',
2174 'src/systemctl/systemctl-is-system-running.c',
2175 'src/systemctl/systemctl-is-system-running.h',
2176 'src/systemctl/systemctl-kill.c',
2177 'src/systemctl/systemctl-kill.h',
2178 'src/systemctl/systemctl-list-dependencies.c',
2179 'src/systemctl/systemctl-list-dependencies.h',
2180 'src/systemctl/systemctl-list-jobs.c',
2181 'src/systemctl/systemctl-list-jobs.h',
2182 'src/systemctl/systemctl-list-machines.c',
2183 'src/systemctl/systemctl-list-machines.h',
2184 'src/systemctl/systemctl-list-unit-files.c',
2185 'src/systemctl/systemctl-list-unit-files.h',
2186 'src/systemctl/systemctl-list-units.c',
2187 'src/systemctl/systemctl-list-units.h',
2188 'src/systemctl/systemctl-log-setting.c',
2189 'src/systemctl/systemctl-log-setting.h',
2190 'src/systemctl/systemctl-logind.c',
2191 'src/systemctl/systemctl-logind.h',
2192 'src/systemctl/systemctl-preset-all.c',
2193 'src/systemctl/systemctl-preset-all.h',
2194 'src/systemctl/systemctl-reset-failed.c',
2195 'src/systemctl/systemctl-reset-failed.h',
2196 'src/systemctl/systemctl-service-watchdogs.c',
2197 'src/systemctl/systemctl-service-watchdogs.h',
2198 'src/systemctl/systemctl-set-default.c',
2199 'src/systemctl/systemctl-set-default.h',
2200 'src/systemctl/systemctl-set-environment.c',
2201 'src/systemctl/systemctl-set-environment.h',
2202 'src/systemctl/systemctl-set-property.c',
2203 'src/systemctl/systemctl-set-property.h',
2204 'src/systemctl/systemctl-show.c',
2205 'src/systemctl/systemctl-show.h',
2206 'src/systemctl/systemctl-start-special.c',
2207 'src/systemctl/systemctl-start-special.h',
2208 'src/systemctl/systemctl-start-unit.c',
2209 'src/systemctl/systemctl-start-unit.h',
2210 'src/systemctl/systemctl-switch-root.c',
2211 'src/systemctl/systemctl-switch-root.h',
2212 'src/systemctl/systemctl-sysv-compat.c',
2213 'src/systemctl/systemctl-sysv-compat.h',
2214 'src/systemctl/systemctl-trivial-method.c',
2215 'src/systemctl/systemctl-trivial-method.h',
2216 'src/systemctl/systemctl-util.c',
2217 'src/systemctl/systemctl-util.c',
2218 'src/systemctl/systemctl-util.h',
2219 'src/systemctl/systemctl.c',
2220 'src/systemctl/systemctl.h',
2221 include_directories : includes,
2222 link_with : systemctl_link_with,
2223 dependencies : [threads,
2224 libcap,
2225 libselinux,
2226 libxz,
2227 liblz4,
2228 libzstd],
2229 install_rpath : rootlibexecdir,
2230 install : true,
2231 install_dir : rootbindir)
2232
2233 if conf.get('ENABLE_PORTABLED') == 1
2234 executable(
2235 'systemd-portabled',
2236 systemd_portabled_sources,
2237 include_directories : includes,
2238 link_with : [libshared],
2239 dependencies : [threads],
2240 install_rpath : rootlibexecdir,
2241 install : true,
2242 install_dir : rootlibexecdir)
2243
2244 public_programs += executable(
2245 'portablectl',
2246 'src/portable/portablectl.c',
2247 include_directories : includes,
2248 link_with : [libshared],
2249 dependencies : [threads],
2250 install_rpath : rootlibexecdir,
2251 install : true,
2252 install_dir : rootbindir)
2253 endif
2254
2255 if conf.get('ENABLE_USERDB') == 1
2256 executable(
2257 'systemd-userwork',
2258 systemd_userwork_sources,
2259 include_directories : includes,
2260 link_with : [libshared],
2261 dependencies : [threads],
2262 install_rpath : rootlibexecdir,
2263 install : true,
2264 install_dir : rootlibexecdir)
2265
2266 executable(
2267 'systemd-userdbd',
2268 systemd_userdbd_sources,
2269 include_directories : includes,
2270 link_with : [libshared],
2271 dependencies : [threads],
2272 install_rpath : rootlibexecdir,
2273 install : true,
2274 install_dir : rootlibexecdir)
2275
2276 public_programs += executable(
2277 'userdbctl',
2278 userdbctl_sources,
2279 include_directories : includes,
2280 link_with : [libshared],
2281 dependencies : [threads],
2282 install_rpath : rootlibexecdir,
2283 install : true,
2284 install_dir : rootbindir)
2285 endif
2286
2287 if conf.get('ENABLE_HOMED') == 1
2288 executable(
2289 'systemd-homework',
2290 systemd_homework_sources,
2291 include_directories : includes,
2292 link_with : [libshared],
2293 dependencies : [threads,
2294 libcryptsetup,
2295 libblkid,
2296 libcrypt,
2297 libopenssl,
2298 libfdisk,
2299 libp11kit],
2300 install_rpath : rootlibexecdir,
2301 install : true,
2302 install_dir : rootlibexecdir)
2303
2304 executable(
2305 'systemd-homed',
2306 systemd_homed_sources,
2307 include_directories : includes,
2308 link_with : [libshared],
2309 dependencies : [threads,
2310 libcrypt,
2311 libopenssl],
2312 install_rpath : rootlibexecdir,
2313 install : true,
2314 install_dir : rootlibexecdir)
2315
2316 public_programs += executable(
2317 'homectl',
2318 homectl_sources,
2319 include_directories : includes,
2320 link_with : [libshared],
2321 dependencies : [threads,
2322 libcrypt,
2323 libopenssl,
2324 libp11kit,
2325 libdl],
2326 install_rpath : rootlibexecdir,
2327 install : true,
2328 install_dir : rootbindir)
2329
2330 if conf.get('HAVE_PAM') == 1
2331 version_script_arg = join_paths(project_source_root, pam_systemd_home_sym)
2332 pam_systemd = shared_library(
2333 'pam_systemd_home',
2334 pam_systemd_home_c,
2335 name_prefix : '',
2336 include_directories : includes,
2337 link_args : ['-shared',
2338 '-Wl,--version-script=' + version_script_arg],
2339 link_with : [libsystemd_static,
2340 libshared_static],
2341 dependencies : [threads,
2342 libpam,
2343 libpam_misc,
2344 libcrypt],
2345 link_depends : pam_systemd_home_sym,
2346 install : true,
2347 install_dir : pamlibdir)
2348 endif
2349 endif
2350
2351 foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
2352 (conf.get('HAVE_SYSV_COMPAT') == 1 ? ['runlevel', 'telinit'] : []))
2353 meson.add_install_script(meson_make_symlink,
2354 join_paths(rootbindir, 'systemctl'),
2355 join_paths(rootsbindir, alias))
2356 endforeach
2357
2358 meson.add_install_script(meson_make_symlink,
2359 join_paths(rootbindir, 'udevadm'),
2360 join_paths(rootlibexecdir, 'systemd-udevd'))
2361
2362 if conf.get('ENABLE_BACKLIGHT') == 1
2363 executable(
2364 'systemd-backlight',
2365 'src/backlight/backlight.c',
2366 include_directories : includes,
2367 link_with : [libshared],
2368 install_rpath : rootlibexecdir,
2369 install : true,
2370 install_dir : rootlibexecdir)
2371 endif
2372
2373 if conf.get('ENABLE_RFKILL') == 1
2374 executable(
2375 'systemd-rfkill',
2376 'src/rfkill/rfkill.c',
2377 include_directories : includes,
2378 link_with : [libshared],
2379 install_rpath : rootlibexecdir,
2380 install : true,
2381 install_dir : rootlibexecdir)
2382 endif
2383
2384 executable(
2385 'systemd-system-update-generator',
2386 'src/system-update-generator/system-update-generator.c',
2387 include_directories : includes,
2388 link_with : [libshared],
2389 install_rpath : rootlibexecdir,
2390 install : true,
2391 install_dir : systemgeneratordir)
2392
2393 if conf.get('HAVE_LIBCRYPTSETUP') == 1
2394 systemd_cryptsetup_sources = files('''
2395 src/cryptsetup/cryptsetup-fido2.h
2396 src/cryptsetup/cryptsetup-keyfile.c
2397 src/cryptsetup/cryptsetup-keyfile.h
2398 src/cryptsetup/cryptsetup-pkcs11.h
2399 src/cryptsetup/cryptsetup-tpm2.h
2400 src/cryptsetup/cryptsetup.c
2401 '''.split())
2402
2403 if conf.get('HAVE_P11KIT') == 1
2404 systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-pkcs11.c')
2405 endif
2406
2407 if conf.get('HAVE_LIBFIDO2') == 1
2408 systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-fido2.c')
2409 endif
2410
2411 if conf.get('HAVE_TPM2') == 1
2412 systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-tpm2.c')
2413 endif
2414
2415 executable(
2416 'systemd-cryptsetup',
2417 systemd_cryptsetup_sources,
2418 include_directories : includes,
2419 link_with : [libshared],
2420 dependencies : [libcryptsetup,
2421 libp11kit],
2422 install_rpath : rootlibexecdir,
2423 install : true,
2424 install_dir : rootlibexecdir)
2425
2426 executable(
2427 'systemd-cryptsetup-generator',
2428 'src/cryptsetup/cryptsetup-generator.c',
2429 include_directories : includes,
2430 link_with : [libshared],
2431 install_rpath : rootlibexecdir,
2432 install : true,
2433 install_dir : systemgeneratordir)
2434
2435 executable(
2436 'systemd-veritysetup',
2437 'src/veritysetup/veritysetup.c',
2438 include_directories : includes,
2439 link_with : [libshared],
2440 dependencies : [libcryptsetup],
2441 install_rpath : rootlibexecdir,
2442 install : true,
2443 install_dir : rootlibexecdir)
2444
2445 executable(
2446 'systemd-veritysetup-generator',
2447 'src/veritysetup/veritysetup-generator.c',
2448 include_directories : includes,
2449 link_with : [libshared],
2450 install_rpath : rootlibexecdir,
2451 install : true,
2452 install_dir : systemgeneratordir)
2453
2454 systemd_cryptenroll_sources = files('''
2455 src/cryptenroll/cryptenroll-fido2.h
2456 src/cryptenroll/cryptenroll-list.c
2457 src/cryptenroll/cryptenroll-list.h
2458 src/cryptenroll/cryptenroll-password.c
2459 src/cryptenroll/cryptenroll-password.h
2460 src/cryptenroll/cryptenroll-pkcs11.h
2461 src/cryptenroll/cryptenroll-recovery.c
2462 src/cryptenroll/cryptenroll-recovery.h
2463 src/cryptenroll/cryptenroll-tpm2.h
2464 src/cryptenroll/cryptenroll-wipe.c
2465 src/cryptenroll/cryptenroll-wipe.h
2466 src/cryptenroll/cryptenroll.c
2467 src/cryptenroll/cryptenroll.h
2468 '''.split())
2469
2470 if conf.get('HAVE_P11KIT') == 1 and conf.get('HAVE_OPENSSL') == 1
2471 systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-pkcs11.c')
2472 endif
2473
2474 if conf.get('HAVE_LIBFIDO2') == 1
2475 systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-fido2.c')
2476 endif
2477
2478 if conf.get('HAVE_TPM2') == 1
2479 systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-tpm2.c')
2480 endif
2481
2482 executable(
2483 'systemd-cryptenroll',
2484 systemd_cryptenroll_sources,
2485 include_directories : includes,
2486 link_with : [libshared],
2487 dependencies : [libcryptsetup,
2488 libdl,
2489 libopenssl,
2490 libp11kit],
2491 install_rpath : rootlibexecdir,
2492 install : true,
2493 install_dir : bindir)
2494 endif
2495
2496 if conf.get('HAVE_SYSV_COMPAT') == 1
2497 executable(
2498 'systemd-sysv-generator',
2499 'src/sysv-generator/sysv-generator.c',
2500 include_directories : includes,
2501 link_with : [libshared],
2502 install_rpath : rootlibexecdir,
2503 install : true,
2504 install_dir : systemgeneratordir)
2505
2506 executable(
2507 'systemd-rc-local-generator',
2508 'src/rc-local-generator/rc-local-generator.c',
2509 include_directories : includes,
2510 link_with : [libshared],
2511 install_rpath : rootlibexecdir,
2512 install : true,
2513 install_dir : systemgeneratordir)
2514 endif
2515
2516 if conf.get('ENABLE_XDG_AUTOSTART') == 1
2517 executable(
2518 'systemd-xdg-autostart-generator',
2519 'src/xdg-autostart-generator/xdg-autostart-generator.c',
2520 'src/xdg-autostart-generator/xdg-autostart-service.c',
2521 include_directories : includes,
2522 link_with : [libshared],
2523 install_rpath : rootlibexecdir,
2524 install : true,
2525 install_dir : usergeneratordir)
2526
2527 executable(
2528 'systemd-xdg-autostart-condition',
2529 'src/xdg-autostart-generator/xdg-autostart-condition.c',
2530 include_directories : includes,
2531 link_with : [libshared],
2532 install_rpath : rootlibexecdir,
2533 install : true,
2534 install_dir : rootlibexecdir)
2535 endif
2536
2537 if conf.get('ENABLE_HOSTNAMED') == 1
2538 executable(
2539 'systemd-hostnamed',
2540 'src/hostname/hostnamed.c',
2541 include_directories : includes,
2542 link_with : [libshared],
2543 install_rpath : rootlibexecdir,
2544 install : true,
2545 install_dir : rootlibexecdir)
2546
2547 public_programs += executable(
2548 'hostnamectl',
2549 'src/hostname/hostnamectl.c',
2550 include_directories : includes,
2551 link_with : [libshared],
2552 install_rpath : rootlibexecdir,
2553 install : true)
2554 endif
2555
2556 if conf.get('ENABLE_LOCALED') == 1
2557 if conf.get('HAVE_XKBCOMMON') == 1
2558 # logind will load libxkbcommon.so dynamically on its own
2559 deps = [libdl]
2560 else
2561 deps = []
2562 endif
2563
2564 executable(
2565 'systemd-localed',
2566 systemd_localed_sources,
2567 include_directories : includes,
2568 link_with : [libshared],
2569 dependencies : deps,
2570 install_rpath : rootlibexecdir,
2571 install : true,
2572 install_dir : rootlibexecdir)
2573
2574 public_programs += executable(
2575 'localectl',
2576 localectl_sources,
2577 include_directories : includes,
2578 link_with : [libshared],
2579 install_rpath : rootlibexecdir,
2580 install : true)
2581 endif
2582
2583 if conf.get('ENABLE_TIMEDATED') == 1
2584 executable(
2585 'systemd-timedated',
2586 'src/timedate/timedated.c',
2587 include_directories : includes,
2588 link_with : [libshared],
2589 install_rpath : rootlibexecdir,
2590 install : true,
2591 install_dir : rootlibexecdir)
2592 endif
2593
2594 if conf.get('ENABLE_TIMEDATECTL') == 1
2595 public_programs += executable(
2596 'timedatectl',
2597 'src/timedate/timedatectl.c',
2598 include_directories : includes,
2599 install_rpath : rootlibexecdir,
2600 link_with : [libshared],
2601 dependencies : [libm],
2602 install : true)
2603 endif
2604
2605 if conf.get('ENABLE_TIMESYNCD') == 1
2606 if get_option('link-timesyncd-shared')
2607 timesyncd_link_with = [libshared]
2608 else
2609 timesyncd_link_with = [libsystemd_static,
2610 libshared_static,
2611 libjournal_client,
2612 libbasic_gcrypt]
2613 endif
2614
2615 executable(
2616 'systemd-timesyncd',
2617 systemd_timesyncd_sources,
2618 include_directories : includes,
2619 link_with : [timesyncd_link_with],
2620 dependencies : [threads,
2621 libm],
2622 install_rpath : rootlibexecdir,
2623 install : true,
2624 install_dir : rootlibexecdir)
2625
2626 executable(
2627 'systemd-time-wait-sync',
2628 'src/time-wait-sync/time-wait-sync.c',
2629 include_directories : includes,
2630 link_with : [timesyncd_link_with],
2631 install_rpath : rootlibexecdir,
2632 install : true,
2633 install_dir : rootlibexecdir)
2634 endif
2635
2636 if conf.get('ENABLE_MACHINED') == 1
2637 executable(
2638 'systemd-machined',
2639 systemd_machined_sources,
2640 include_directories : includes,
2641 link_with : [libmachine_core,
2642 libshared],
2643 install_rpath : rootlibexecdir,
2644 install : true,
2645 install_dir : rootlibexecdir)
2646
2647 public_programs += executable(
2648 'machinectl',
2649 'src/machine/machinectl.c',
2650 include_directories : includes,
2651 link_with : [libshared],
2652 dependencies : [threads,
2653 libxz,
2654 liblz4,
2655 libzstd],
2656 install_rpath : rootlibexecdir,
2657 install : true,
2658 install_dir : rootbindir)
2659 endif
2660
2661 if conf.get('ENABLE_IMPORTD') == 1
2662 executable(
2663 'systemd-importd',
2664 systemd_importd_sources,
2665 include_directories : includes,
2666 link_with : [libshared],
2667 dependencies : [threads],
2668 install_rpath : rootlibexecdir,
2669 install : true,
2670 install_dir : rootlibexecdir)
2671
2672 systemd_pull = executable(
2673 'systemd-pull',
2674 systemd_pull_sources,
2675 include_directories : includes,
2676 link_with : [libshared],
2677 dependencies : [versiondep,
2678 libcurl,
2679 libz,
2680 libbzip2,
2681 libxz,
2682 libgcrypt],
2683 install_rpath : rootlibexecdir,
2684 install : true,
2685 install_dir : rootlibexecdir)
2686
2687 systemd_import = executable(
2688 'systemd-import',
2689 systemd_import_sources,
2690 include_directories : includes,
2691 link_with : [libshared],
2692 dependencies : [libcurl,
2693 libz,
2694 libbzip2,
2695 libxz],
2696 install_rpath : rootlibexecdir,
2697 install : true,
2698 install_dir : rootlibexecdir)
2699
2700 systemd_import_fs = executable(
2701 'systemd-import-fs',
2702 systemd_import_fs_sources,
2703 include_directories : includes,
2704 link_with : [libshared],
2705 install_rpath : rootlibexecdir,
2706 install : true,
2707 install_dir : rootlibexecdir)
2708
2709 systemd_export = executable(
2710 'systemd-export',
2711 systemd_export_sources,
2712 include_directories : includes,
2713 link_with : [libshared],
2714 dependencies : [libcurl,
2715 libz,
2716 libbzip2,
2717 libxz],
2718 install_rpath : rootlibexecdir,
2719 install : true,
2720 install_dir : rootlibexecdir)
2721
2722 public_programs += [systemd_pull, systemd_import, systemd_import_fs, systemd_export]
2723 endif
2724
2725 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2726 public_programs += executable(
2727 'systemd-journal-upload',
2728 systemd_journal_upload_sources,
2729 include_directories : includes,
2730 link_with : [libshared],
2731 dependencies : [versiondep,
2732 threads,
2733 libcurl,
2734 libgnutls,
2735 libxz,
2736 liblz4,
2737 libzstd],
2738 install_rpath : rootlibexecdir,
2739 install : true,
2740 install_dir : rootlibexecdir)
2741 endif
2742
2743 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2744 public_programs += executable(
2745 'systemd-journal-remote',
2746 systemd_journal_remote_sources,
2747 include_directories : includes,
2748 link_with : [libshared,
2749 libsystemd_journal_remote],
2750 dependencies : [threads,
2751 libmicrohttpd,
2752 libgnutls,
2753 libxz,
2754 liblz4,
2755 libzstd],
2756 install_rpath : rootlibexecdir,
2757 install : true,
2758 install_dir : rootlibexecdir)
2759
2760 public_programs += executable(
2761 'systemd-journal-gatewayd',
2762 systemd_journal_gatewayd_sources,
2763 include_directories : includes,
2764 link_with : [libshared],
2765 dependencies : [threads,
2766 libmicrohttpd,
2767 libgnutls,
2768 libxz,
2769 liblz4,
2770 libzstd],
2771 install_rpath : rootlibexecdir,
2772 install : true,
2773 install_dir : rootlibexecdir)
2774 endif
2775
2776 if conf.get('ENABLE_COREDUMP') == 1
2777 executable(
2778 'systemd-coredump',
2779 systemd_coredump_sources,
2780 include_directories : includes,
2781 link_with : [libshared],
2782 dependencies : [threads,
2783 libacl,
2784 libdw,
2785 libxz,
2786 liblz4,
2787 libzstd],
2788 install_rpath : rootlibexecdir,
2789 install : true,
2790 install_dir : rootlibexecdir)
2791
2792 public_programs += executable(
2793 'coredumpctl',
2794 coredumpctl_sources,
2795 include_directories : includes,
2796 link_with : [libshared],
2797 dependencies : [threads,
2798 libxz,
2799 liblz4,
2800 libzstd],
2801 install_rpath : rootlibexecdir,
2802 install : true)
2803 endif
2804
2805 if conf.get('ENABLE_PSTORE') == 1
2806 executable(
2807 'systemd-pstore',
2808 systemd_pstore_sources,
2809 include_directories : includes,
2810 link_with : [libshared],
2811 dependencies : [threads,
2812 libacl,
2813 libdw,
2814 libxz,
2815 liblz4,
2816 libzstd],
2817 install_rpath : rootlibexecdir,
2818 install : true,
2819 install_dir : rootlibexecdir)
2820 endif
2821
2822 if conf.get('ENABLE_OOMD') == 1
2823 executable('systemd-oomd',
2824 systemd_oomd_sources,
2825 include_directories : includes,
2826 link_with : [libshared],
2827 dependencies : [],
2828 install_rpath : rootlibexecdir,
2829 install : true,
2830 install_dir : rootlibexecdir)
2831
2832 public_programs += executable(
2833 'oomctl',
2834 oomctl_sources,
2835 include_directories : includes,
2836 link_with : [libshared],
2837 dependencies : [],
2838 install_rpath : rootlibexecdir,
2839 install : true,
2840 install_dir : rootbindir)
2841 endif
2842
2843 if conf.get('ENABLE_BINFMT') == 1
2844 public_programs += executable(
2845 'systemd-binfmt',
2846 'src/binfmt/binfmt.c',
2847 include_directories : includes,
2848 link_with : [libshared],
2849 install_rpath : rootlibexecdir,
2850 install : true,
2851 install_dir : rootlibexecdir)
2852
2853 meson.add_install_script('sh', '-c',
2854 mkdir_p.format(binfmtdir))
2855 if install_sysconfdir
2856 meson.add_install_script('sh', '-c',
2857 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2858 endif
2859 endif
2860
2861 if conf.get('ENABLE_REPART') == 1
2862 exe = executable(
2863 'systemd-repart',
2864 systemd_repart_sources,
2865 include_directories : includes,
2866 link_with : [libshared],
2867 dependencies : [threads,
2868 libblkid,
2869 libfdisk,
2870 libopenssl],
2871 install_rpath : rootlibexecdir,
2872 install : true,
2873 install_dir : rootbindir)
2874 public_programs += exe
2875
2876 if want_tests != 'false'
2877 test('test-repart',
2878 test_repart_sh,
2879 args : exe.full_path())
2880 endif
2881 endif
2882
2883 if conf.get('ENABLE_VCONSOLE') == 1
2884 executable(
2885 'systemd-vconsole-setup',
2886 'src/vconsole/vconsole-setup.c',
2887 include_directories : includes,
2888 link_with : [libshared],
2889 install_rpath : rootlibexecdir,
2890 install : true,
2891 install_dir : rootlibexecdir)
2892 endif
2893
2894 if conf.get('ENABLE_RANDOMSEED') == 1
2895 executable(
2896 'systemd-random-seed',
2897 'src/random-seed/random-seed.c',
2898 include_directories : includes,
2899 link_with : [libshared],
2900 install_rpath : rootlibexecdir,
2901 install : true,
2902 install_dir : rootlibexecdir)
2903 endif
2904
2905 if conf.get('ENABLE_FIRSTBOOT') == 1
2906 executable(
2907 'systemd-firstboot',
2908 'src/firstboot/firstboot.c',
2909 include_directories : includes,
2910 link_with : [libshared],
2911 dependencies : [libcrypt],
2912 install_rpath : rootlibexecdir,
2913 install : true,
2914 install_dir : rootbindir)
2915 endif
2916
2917 executable(
2918 'systemd-remount-fs',
2919 'src/remount-fs/remount-fs.c',
2920 include_directories : includes,
2921 link_with : [libcore_shared,
2922 libshared],
2923 install_rpath : rootlibexecdir,
2924 install : true,
2925 install_dir : rootlibexecdir)
2926
2927 executable(
2928 'systemd-machine-id-setup',
2929 'src/machine-id-setup/machine-id-setup-main.c',
2930 include_directories : includes,
2931 link_with : [libcore_shared,
2932 libshared],
2933 install_rpath : rootlibexecdir,
2934 install : true,
2935 install_dir : rootbindir)
2936
2937 executable(
2938 'systemd-fsck',
2939 'src/fsck/fsck.c',
2940 include_directories : includes,
2941 link_with : [libshared],
2942 install_rpath : rootlibexecdir,
2943 install : true,
2944 install_dir : rootlibexecdir)
2945
2946 executable('systemd-growfs',
2947 'src/partition/growfs.c',
2948 include_directories : includes,
2949 link_with : [libshared],
2950 install_rpath : rootlibexecdir,
2951 install : true,
2952 install_dir : rootlibexecdir)
2953
2954 executable(
2955 'systemd-makefs',
2956 'src/partition/makefs.c',
2957 include_directories : includes,
2958 link_with : [libshared],
2959 install_rpath : rootlibexecdir,
2960 install : true,
2961 install_dir : rootlibexecdir)
2962
2963 executable(
2964 'systemd-sleep',
2965 'src/sleep/sleep.c',
2966 include_directories : includes,
2967 link_with : [libshared],
2968 install_rpath : rootlibexecdir,
2969 install : true,
2970 install_dir : rootlibexecdir)
2971
2972 if install_sysconfdir_samples
2973 install_data('src/sleep/sleep.conf',
2974 install_dir : pkgsysconfdir)
2975 endif
2976
2977 public_programs += executable(
2978 'systemd-sysctl',
2979 'src/sysctl/sysctl.c',
2980 include_directories : includes,
2981 link_with : [libshared],
2982 install_rpath : rootlibexecdir,
2983 install : true,
2984 install_dir : rootlibexecdir)
2985
2986 executable(
2987 'systemd-ac-power',
2988 'src/ac-power/ac-power.c',
2989 include_directories : includes,
2990 link_with : [libshared],
2991 install_rpath : rootlibexecdir,
2992 install : true,
2993 install_dir : rootlibexecdir)
2994
2995 public_programs += executable(
2996 'systemd-detect-virt',
2997 'src/detect-virt/detect-virt.c',
2998 include_directories : includes,
2999 link_with : [libshared],
3000 install_rpath : rootlibexecdir,
3001 install : true)
3002
3003 public_programs += executable(
3004 'systemd-delta',
3005 'src/delta/delta.c',
3006 include_directories : includes,
3007 link_with : [libshared],
3008 install_rpath : rootlibexecdir,
3009 install : true)
3010
3011 public_programs += executable(
3012 'systemd-escape',
3013 'src/escape/escape.c',
3014 include_directories : includes,
3015 link_with : [libshared],
3016 install_rpath : rootlibexecdir,
3017 install : true,
3018 install_dir : rootbindir)
3019
3020 public_programs += executable(
3021 'systemd-notify',
3022 'src/notify/notify.c',
3023 include_directories : includes,
3024 link_with : [libshared],
3025 install_rpath : rootlibexecdir,
3026 install : true,
3027 install_dir : rootbindir)
3028
3029 executable(
3030 'systemd-volatile-root',
3031 'src/volatile-root/volatile-root.c',
3032 include_directories : includes,
3033 link_with : [libshared],
3034 install_rpath : rootlibexecdir,
3035 install : conf.get('ENABLE_INITRD') == 1,
3036 install_dir : rootlibexecdir)
3037
3038 executable(
3039 'systemd-cgroups-agent',
3040 'src/cgroups-agent/cgroups-agent.c',
3041 include_directories : includes,
3042 link_with : [libshared],
3043 install_rpath : rootlibexecdir,
3044 install : true,
3045 install_dir : rootlibexecdir)
3046
3047 public_programs += executable(
3048 'systemd-id128',
3049 'src/id128/id128.c',
3050 include_directories : includes,
3051 link_with : [libshared],
3052 install_rpath : rootlibexecdir,
3053 install : true)
3054
3055 public_programs += executable(
3056 'systemd-path',
3057 'src/path/path.c',
3058 include_directories : includes,
3059 link_with : [libshared],
3060 install_rpath : rootlibexecdir,
3061 install : true)
3062
3063 public_programs += executable(
3064 'systemd-ask-password',
3065 'src/ask-password/ask-password.c',
3066 include_directories : includes,
3067 link_with : [libshared],
3068 install_rpath : rootlibexecdir,
3069 install : true,
3070 install_dir : rootbindir)
3071
3072 executable(
3073 'systemd-reply-password',
3074 'src/reply-password/reply-password.c',
3075 include_directories : includes,
3076 link_with : [libshared],
3077 install_rpath : rootlibexecdir,
3078 install : true,
3079 install_dir : rootlibexecdir)
3080
3081 public_programs += executable(
3082 'systemd-tty-ask-password-agent',
3083 'src/tty-ask-password-agent/tty-ask-password-agent.c',
3084 include_directories : includes,
3085 link_with : [libshared],
3086 install_rpath : rootlibexecdir,
3087 install : true,
3088 install_dir : rootbindir)
3089
3090 public_programs += executable(
3091 'systemd-cgls',
3092 'src/cgls/cgls.c',
3093 include_directories : includes,
3094 link_with : [libshared],
3095 install_rpath : rootlibexecdir,
3096 install : true)
3097
3098 public_programs += executable(
3099 'systemd-cgtop',
3100 'src/cgtop/cgtop.c',
3101 include_directories : includes,
3102 link_with : [libshared],
3103 install_rpath : rootlibexecdir,
3104 install : true)
3105
3106 executable(
3107 'systemd-initctl',
3108 'src/initctl/initctl.c',
3109 include_directories : includes,
3110 link_with : [libshared],
3111 install_rpath : rootlibexecdir,
3112 install : (conf.get('HAVE_SYSV_COMPAT') == 1),
3113 install_dir : rootlibexecdir)
3114
3115 public_programs += executable(
3116 'systemd-mount',
3117 'src/mount/mount-tool.c',
3118 include_directories : includes,
3119 link_with : [libshared],
3120 dependencies: [libmount],
3121 install_rpath : rootlibexecdir,
3122 install : true)
3123
3124 meson.add_install_script(meson_make_symlink,
3125 'systemd-mount', join_paths(bindir, 'systemd-umount'))
3126
3127 public_programs += executable(
3128 'systemd-run',
3129 'src/run/run.c',
3130 include_directories : includes,
3131 link_with : [libshared],
3132 install_rpath : rootlibexecdir,
3133 install : true)
3134
3135 public_programs += executable(
3136 'systemd-stdio-bridge',
3137 'src/stdio-bridge/stdio-bridge.c',
3138 include_directories : includes,
3139 link_with : [libshared],
3140 dependencies : [versiondep],
3141 install_rpath : rootlibexecdir,
3142 install : true)
3143
3144 public_programs += executable(
3145 'busctl',
3146 'src/busctl/busctl.c',
3147 'src/busctl/busctl-introspect.c',
3148 'src/busctl/busctl-introspect.h',
3149 include_directories : includes,
3150 link_with : [libshared],
3151 install_rpath : rootlibexecdir,
3152 install : true)
3153
3154 if enable_sysusers
3155 exe = executable(
3156 'systemd-sysusers',
3157 'src/sysusers/sysusers.c',
3158 include_directories : includes,
3159 link_with : [libshared],
3160 install_rpath : rootlibexecdir,
3161 install : true,
3162 install_dir : rootbindir)
3163 public_programs += exe
3164
3165 if want_tests != 'false'
3166 test('test-sysusers',
3167 test_sysusers_sh,
3168 # https://github.com/mesonbuild/meson/issues/2681
3169 args : exe.full_path())
3170 endif
3171
3172 if have_standalone_binaries
3173 exe = executable(
3174 'systemd-sysusers.standalone',
3175 'src/sysusers/sysusers.c',
3176 include_directories : includes,
3177 c_args : '-DSTANDALONE',
3178 link_with : [libshared_static,
3179 libbasic,
3180 libbasic_gcrypt,
3181 libsystemd_static,
3182 libjournal_client],
3183 install : true,
3184 install_dir : rootbindir)
3185 public_programs += exe
3186
3187 if want_tests != 'false'
3188 test('test-sysusers.standalone',
3189 test_sysusers_sh,
3190 # https://github.com/mesonbuild/meson/issues/2681
3191 args : exe.full_path())
3192 endif
3193 endif
3194 endif
3195
3196 if conf.get('ENABLE_TMPFILES') == 1
3197 exe = executable(
3198 'systemd-tmpfiles',
3199 systemd_tmpfiles_sources,
3200 include_directories : includes,
3201 link_with : [libshared],
3202 dependencies : [libacl],
3203 install_rpath : rootlibexecdir,
3204 install : true,
3205 install_dir : rootbindir)
3206 public_programs += exe
3207
3208 if want_tests != 'false'
3209 test('test-systemd-tmpfiles',
3210 test_systemd_tmpfiles_py,
3211 # https://github.com/mesonbuild/meson/issues/2681
3212 args : exe.full_path())
3213 endif
3214
3215 if have_standalone_binaries
3216 public_programs += executable(
3217 'systemd-tmpfiles.standalone',
3218 systemd_tmpfiles_sources,
3219 include_directories : includes,
3220 c_args : '-DSTANDALONE',
3221 link_with : [libshared_static,
3222 libbasic,
3223 libbasic_gcrypt,
3224 libsystemd_static,
3225 libjournal_client],
3226 dependencies : [libacl],
3227 install : true,
3228 install_dir : rootbindir)
3229 endif
3230 endif
3231
3232 if conf.get('ENABLE_HWDB') == 1
3233 public_programs += executable(
3234 'systemd-hwdb',
3235 'src/hwdb/hwdb.c',
3236 'src/libsystemd/sd-hwdb/hwdb-internal.h',
3237 include_directories : includes,
3238 link_with : udev_link_with,
3239 install_rpath : udev_rpath,
3240 install : true,
3241 install_dir : rootbindir)
3242 endif
3243
3244 if conf.get('ENABLE_QUOTACHECK') == 1
3245 executable(
3246 'systemd-quotacheck',
3247 'src/quotacheck/quotacheck.c',
3248 include_directories : includes,
3249 link_with : [libshared],
3250 install_rpath : rootlibexecdir,
3251 install : true,
3252 install_dir : rootlibexecdir)
3253 endif
3254
3255 public_programs += executable(
3256 'systemd-socket-proxyd',
3257 'src/socket-proxy/socket-proxyd.c',
3258 include_directories : includes,
3259 link_with : [libshared],
3260 dependencies : [threads],
3261 install_rpath : rootlibexecdir,
3262 install : true,
3263 install_dir : rootlibexecdir)
3264
3265 public_programs += executable(
3266 'udevadm',
3267 udevadm_sources,
3268 c_args : '-DLOG_REALM=LOG_REALM_UDEV',
3269 include_directories : includes,
3270 link_with : [libudevd_core],
3271 dependencies : [versiondep,
3272 threads,
3273 libkmod,
3274 libidn,
3275 libacl,
3276 libblkid],
3277 install_rpath : udev_rpath,
3278 install : true,
3279 install_dir : rootbindir)
3280
3281 executable(
3282 'systemd-shutdown',
3283 systemd_shutdown_sources,
3284 include_directories : includes,
3285 link_with : [libcore_shared,
3286 libshared],
3287 dependencies : [libmount],
3288 install_rpath : rootlibexecdir,
3289 install : true,
3290 install_dir : rootlibexecdir)
3291
3292 executable(
3293 'systemd-update-done',
3294 'src/update-done/update-done.c',
3295 include_directories : includes,
3296 link_with : [libshared],
3297 install_rpath : rootlibexecdir,
3298 install : true,
3299 install_dir : rootlibexecdir)
3300
3301 executable(
3302 'systemd-update-utmp',
3303 'src/update-utmp/update-utmp.c',
3304 include_directories : includes,
3305 link_with : [libshared],
3306 dependencies : [libaudit],
3307 install_rpath : rootlibexecdir,
3308 install : (conf.get('ENABLE_UTMP') == 1),
3309 install_dir : rootlibexecdir)
3310
3311 if conf.get('HAVE_KMOD') == 1
3312 executable(
3313 'systemd-modules-load',
3314 'src/modules-load/modules-load.c',
3315 include_directories : includes,
3316 link_with : [libshared],
3317 dependencies : [libkmod],
3318 install_rpath : rootlibexecdir,
3319 install : true,
3320 install_dir : rootlibexecdir)
3321
3322 meson.add_install_script('sh', '-c',
3323 mkdir_p.format(modulesloaddir))
3324 if install_sysconfdir
3325 meson.add_install_script('sh', '-c',
3326 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
3327 endif
3328 endif
3329
3330 public_programs += executable(
3331 'systemd-nspawn',
3332 systemd_nspawn_sources,
3333 include_directories : includes,
3334 link_with : [libcore_shared,
3335 libnspawn_core,
3336 libshared],
3337 dependencies : [libblkid,
3338 libseccomp],
3339 install_rpath : rootlibexecdir,
3340 install : true)
3341
3342 if conf.get('ENABLE_NETWORKD') == 1
3343 executable(
3344 'systemd-networkd',
3345 systemd_networkd_sources,
3346 include_directories : network_include_dir,
3347 link_with : [libnetworkd_core,
3348 libsystemd_network,
3349 networkd_link_with],
3350 dependencies : [threads],
3351 install_rpath : rootlibexecdir,
3352 install : true,
3353 install_dir : rootlibexecdir)
3354
3355 executable(
3356 'systemd-networkd-wait-online',
3357 systemd_networkd_wait_online_sources,
3358 include_directories : includes,
3359 link_with : [libnetworkd_core,
3360 networkd_link_with],
3361 install_rpath : rootlibexecdir,
3362 install : true,
3363 install_dir : rootlibexecdir)
3364
3365 public_programs += executable(
3366 'networkctl',
3367 networkctl_sources,
3368 include_directories : includes,
3369 link_with : [libsystemd_network,
3370 networkd_link_with],
3371 install_rpath : rootlibexecdir,
3372 install : true,
3373 install_dir : rootbindir)
3374
3375 exe = executable(
3376 'systemd-network-generator',
3377 network_generator_sources,
3378 include_directories : includes,
3379 link_with : [networkd_link_with],
3380 install_rpath : rootlibexecdir,
3381 install : true,
3382 install_dir : rootlibexecdir)
3383
3384 if want_tests != 'false'
3385 test('test-network-generator-conversion',
3386 test_network_generator_conversion_sh,
3387 # https://github.com/mesonbuild/meson/issues/2681
3388 args : exe.full_path())
3389 endif
3390 endif
3391
3392 executable(
3393 'systemd-sulogin-shell',
3394 ['src/sulogin-shell/sulogin-shell.c'],
3395 include_directories : includes,
3396 link_with : [libshared],
3397 install_rpath : rootlibexecdir,
3398 install : true,
3399 install_dir : rootlibexecdir)
3400
3401 ############################################################
3402
3403 custom_target(
3404 'systemd-runtest.env',
3405 output : 'systemd-runtest.env',
3406 command : ['sh', '-c', '{ ' +
3407 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(project_source_root, 'test')) +
3408 'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(project_build_root, 'catalog')) +
3409 '} >@OUTPUT@'],
3410 build_by_default : true)
3411
3412 foreach tuple : tests
3413 sources = tuple[0]
3414 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
3415 dependencies = tuple[2]
3416 condition = tuple.length() >= 4 ? tuple[3] : ''
3417 type = tuple.length() >= 5 ? tuple[4] : ''
3418 defs = tuple.length() >= 6 ? tuple[5] : []
3419 incs = tuple.length() >= 7 ? tuple[6] : includes
3420 parallel = tuple.length() >= 8 ? tuple[7] : true
3421 timeout = 30
3422
3423 name = sources[0].split('/')[-1].split('.')[0]
3424 if type.startswith('timeout=')
3425 timeout = type.split('=')[1].to_int()
3426 type = ''
3427 endif
3428
3429 if condition == '' or conf.get(condition) == 1
3430 exe = executable(
3431 name,
3432 sources,
3433 include_directories : incs,
3434 link_with : link_with,
3435 dependencies : [versiondep,
3436 dependencies],
3437 c_args : defs,
3438 build_by_default : want_tests != 'false',
3439 install_rpath : rootlibexecdir,
3440 install : install_tests,
3441 install_dir : join_paths(testsdir, type))
3442
3443 if type == 'manual'
3444 message('@0@ is a manual test'.format(name))
3445 elif type == 'unsafe' and want_tests != 'unsafe'
3446 message('@0@ is an unsafe test'.format(name))
3447 elif want_tests != 'false'
3448 test(name, exe,
3449 env : test_env,
3450 timeout : timeout)
3451 endif
3452 else
3453 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
3454 endif
3455 endforeach
3456
3457 exe = executable(
3458 'test-libsystemd-sym',
3459 test_libsystemd_sym_c,
3460 include_directories : includes,
3461 link_with : [libsystemd],
3462 build_by_default : want_tests != 'false',
3463 install : install_tests,
3464 install_dir : testsdir)
3465 if want_tests != 'false'
3466 test('test-libsystemd-sym', exe)
3467 endif
3468
3469 exe = executable(
3470 'test-libsystemd-static-sym',
3471 test_libsystemd_sym_c,
3472 include_directories : includes,
3473 link_with : [install_libsystemd_static],
3474 dependencies : [threads], # threads is already included in dependencies on the library,
3475 # but does not seem to get propagated. Add here as a work-around.
3476 build_by_default : want_tests != 'false' and static_libsystemd_pic,
3477 install : install_tests and static_libsystemd_pic,
3478 install_dir : testsdir)
3479 if want_tests != 'false' and static_libsystemd_pic
3480 test('test-libsystemd-static-sym', exe)
3481 endif
3482
3483 exe = executable(
3484 'test-libudev-sym',
3485 test_libudev_sym_c,
3486 include_directories : libudev_includes,
3487 c_args : '-Wno-deprecated-declarations',
3488 link_with : [libudev],
3489 build_by_default : want_tests != 'false',
3490 install : install_tests,
3491 install_dir : testsdir)
3492 if want_tests != 'false'
3493 test('test-libudev-sym', exe)
3494 endif
3495
3496 exe = executable(
3497 'test-libudev-static-sym',
3498 test_libudev_sym_c,
3499 include_directories : libudev_includes,
3500 c_args : '-Wno-deprecated-declarations',
3501 link_with : [install_libudev_static],
3502 build_by_default : want_tests != 'false' and static_libudev_pic,
3503 install : install_tests and static_libudev_pic,
3504 install_dir : testsdir)
3505 if want_tests != 'false' and static_libudev_pic
3506 test('test-libudev-static-sym', exe)
3507 endif
3508
3509 ############################################################
3510
3511 fuzzer_exes = []
3512
3513 foreach tuple : fuzzers
3514 sources = tuple[0]
3515 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
3516 dependencies = tuple[2]
3517 defs = tuple.length() >= 4 ? tuple[3] : []
3518 incs = tuple.length() >= 5 ? tuple[4] : includes
3519 link_args = []
3520
3521 if want_ossfuzz
3522 dependencies += fuzzing_engine
3523 elif want_libfuzzer
3524 if fuzzing_engine.found()
3525 dependencies += fuzzing_engine
3526 else
3527 link_args += ['-fsanitize=fuzzer']
3528 endif
3529 else
3530 sources += 'src/fuzz/fuzz-main.c'
3531 endif
3532
3533 name = sources[0].split('/')[-1].split('.')[0]
3534
3535 fuzzer_exes += executable(
3536 name,
3537 sources,
3538 include_directories : [incs, include_directories('src/fuzz')],
3539 link_with : link_with,
3540 dependencies : dependencies,
3541 c_args : defs,
3542 link_args: link_args,
3543 install : false,
3544 build_by_default : fuzz_tests or fuzzer_build)
3545 endforeach
3546
3547 run_target(
3548 'fuzzers',
3549 depends : fuzzer_exes,
3550 command : ['true'])
3551
3552 ############################################################
3553
3554 subdir('sysctl.d')
3555 subdir('sysusers.d')
3556 subdir('tmpfiles.d')
3557 subdir('hwdb.d')
3558 subdir('units')
3559 subdir('presets')
3560 subdir('network')
3561 subdir('man')
3562 subdir('shell-completion/bash')
3563 subdir('shell-completion/zsh')
3564 subdir('docs/sysvinit')
3565 subdir('docs/var-log')
3566
3567 install_subdir('factory/etc',
3568 install_dir : factorydir)
3569
3570 if install_sysconfdir
3571 install_data('xorg/50-systemd-user.sh',
3572 install_dir : xinitrcdir)
3573 endif
3574 install_data('modprobe.d/systemd.conf',
3575 install_dir : modprobedir)
3576 install_data('LICENSE.GPL2',
3577 'LICENSE.LGPL2.1',
3578 'NEWS',
3579 'README',
3580 'docs/CODING_STYLE.md',
3581 'docs/DISTRO_PORTING.md',
3582 'docs/ENVIRONMENT.md',
3583 'docs/HACKING.md',
3584 'docs/TRANSIENT-SETTINGS.md',
3585 'docs/TRANSLATORS.md',
3586 'docs/UIDS-GIDS.md',
3587 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
3588 install_dir : docdir)
3589
3590 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
3591 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
3592
3593 ############################################################
3594
3595 check_help = find_program('tools/check-help.sh')
3596
3597 foreach exec : public_programs
3598 name = exec.full_path().split('/')[-1]
3599 if want_tests != 'false'
3600 test('check-help-' + name,
3601 check_help,
3602 args : exec.full_path())
3603 endif
3604 endforeach
3605
3606 ############################################################
3607
3608 check_directives_sh = find_program('tools/check-directives.sh')
3609
3610 if want_tests != 'false'
3611 test('check-directives',
3612 check_directives_sh,
3613 args : project_source_root)
3614 endif
3615
3616 ############################################################
3617
3618 # Enable tests for all supported sanitizers
3619 foreach tuple : sanitizers
3620 sanitizer = tuple[0]
3621 build = tuple[1]
3622
3623 if cc.has_link_argument('-fsanitize=@0@'.format(sanitizer))
3624 prev = ''
3625 foreach p : fuzz_regression_tests
3626 b = p.split('/')[-2]
3627 c = p.split('/')[-1]
3628
3629 name = '@0@:@1@'.format(b, sanitizer)
3630
3631 if name != prev
3632 if want_tests == 'false'
3633 message('Not compiling @0@ because tests is set to false'.format(name))
3634 elif fuzz_tests
3635 exe = custom_target(
3636 name,
3637 output : name,
3638 depends : build,
3639 command : [env, 'ln', '-fs',
3640 join_paths(build.full_path(), b),
3641 '@OUTPUT@'],
3642 build_by_default : true)
3643 else
3644 message('Not compiling @0@ because fuzz-tests is set to false'.format(name))
3645 endif
3646 endif
3647 prev = name
3648
3649 if fuzz_tests
3650 test('@0@_@1@_@2@'.format(b, c, sanitizer),
3651 env,
3652 env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],
3653 timeout : 60,
3654 args : [exe.full_path(),
3655 join_paths(project_source_root, p)])
3656 endif
3657 endforeach
3658 endif
3659 endforeach
3660
3661
3662 ############################################################
3663
3664 if git.found()
3665 all_files = run_command(
3666 'env', '-u', 'GIT_WORK_TREE',
3667 git,
3668 '--git-dir=@0@/.git'.format(project_source_root),
3669 'ls-files', ':/*.[ch]')
3670
3671 all_files = files(all_files.stdout().split())
3672
3673 custom_target(
3674 'tags',
3675 output : 'tags',
3676 command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
3677 run_target(
3678 'ctags',
3679 command : [env, 'ctags', '-o', '@0@/tags'.format(project_source_root)] + all_files)
3680 endif
3681
3682 if git.found()
3683 git_contrib_sh = find_program('tools/git-contrib.sh')
3684 run_target(
3685 'git-contrib',
3686 command : [git_contrib_sh])
3687 endif
3688
3689 if git.found()
3690 git_head = run_command(
3691 git,
3692 ['--git-dir=@0@/.git'.format(project_source_root),
3693 'rev-parse', 'HEAD']).stdout().strip()
3694 git_head_short = run_command(
3695 git,
3696 ['--git-dir=@0@/.git'.format(project_source_root),
3697 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
3698
3699 run_target(
3700 'git-snapshot',
3701 command : ['git', 'archive',
3702 '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root,
3703 git_head_short),
3704 '--prefix', 'systemd-@0@/'.format(git_head),
3705 'HEAD'])
3706 endif
3707
3708 ############################################################
3709
3710 check_api_docs_sh = find_program('tools/check-api-docs.sh')
3711 run_target(
3712 'check-api-docs',
3713 depends : [man, libsystemd, libudev],
3714 command : [check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
3715
3716 ############################################################
3717 watchdog_opt = service_watchdog == '' ? 'disabled' : service_watchdog
3718
3719 status = [
3720 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
3721
3722 'build mode: @0@'.format(get_option('mode')),
3723 'split /usr: @0@'.format(split_usr),
3724 'split bin-sbin: @0@'.format(split_bin),
3725 'prefix directory: @0@'.format(prefixdir),
3726 'rootprefix directory: @0@'.format(rootprefixdir),
3727 'sysconf directory: @0@'.format(sysconfdir),
3728 'include directory: @0@'.format(includedir),
3729 'lib directory: @0@'.format(libdir),
3730 'rootlib directory: @0@'.format(rootlibdir),
3731 'SysV init scripts: @0@'.format(sysvinit_path),
3732 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
3733 'PAM modules directory: @0@'.format(pamlibdir),
3734 'PAM configuration directory: @0@'.format(pamconfdir),
3735 'RPM macros directory: @0@'.format(rpmmacrosdir),
3736 'modprobe.d directory: @0@'.format(modprobedir),
3737 'D-Bus policy directory: @0@'.format(dbuspolicydir),
3738 'D-Bus session directory: @0@'.format(dbussessionservicedir),
3739 'D-Bus system directory: @0@'.format(dbussystemservicedir),
3740 'bash completions directory: @0@'.format(bashcompletiondir),
3741 'zsh completions directory: @0@'.format(zshcompletiondir),
3742 'extra start script: @0@'.format(get_option('rc-local')),
3743 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
3744 get_option('debug-tty')),
3745 'TTY GID: @0@'.format(tty_gid),
3746 'users GID: @0@'.format(substs.get('USERS_GID')),
3747 'system UIDs: <=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_UID_MAX'),
3748 conf.get('SYSTEM_ALLOC_UID_MIN')),
3749 'system GIDs: <=@0@ (alloc >=@1@)'.format(conf.get('SYSTEM_GID_MAX'),
3750 conf.get('SYSTEM_ALLOC_GID_MIN')),
3751 'dynamic UIDs: @0@–@1@'.format(dynamic_uid_min, dynamic_uid_max),
3752 'container UID bases: @0@–@1@'.format(container_uid_base_min, container_uid_base_max),
3753 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
3754 'render group access mode: @0@'.format(get_option('group-render-mode')),
3755 'certificate root directory: @0@'.format(get_option('certificate-root')),
3756 'support URL: @0@'.format(support_url),
3757 'nobody user name: @0@'.format(nobody_user),
3758 'nobody group name: @0@'.format(nobody_group),
3759 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
3760
3761 'default DNSSEC mode: @0@'.format(default_dnssec),
3762 'default DNS-over-TLS mode: @0@'.format(default_dns_over_tls),
3763 'default mDNS mode: @0@'.format(default_mdns),
3764 'default LLMNR mode: @0@'.format(default_llmnr),
3765 'default cgroup hierarchy: @0@'.format(default_hierarchy),
3766 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
3767 'default KillUserProcesses setting: @0@'.format(kill_user_processes),
3768 'default locale: @0@'.format(default_locale),
3769 'default user $PATH: @0@'.format(default_user_path_display),
3770 'systemd service watchdog: @0@'.format(watchdog_opt)]
3771
3772 alt_dns_servers = '\n '.join(dns_servers.split(' '))
3773 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
3774 status += [
3775 'default DNS servers: @0@'.format(alt_dns_servers),
3776 'default NTP servers: @0@'.format(alt_ntp_servers)]
3777
3778 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
3779 '@@0@'.format(time_epoch)).stdout().strip()
3780 status += [
3781 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
3782
3783 status += [
3784 'static libsystemd: @0@'.format(static_libsystemd),
3785 'static libudev: @0@'.format(static_libudev)]
3786
3787 # TODO:
3788 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3789 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3790 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3791
3792 if conf.get('ENABLE_EFI') == 1
3793 status += 'efi arch: @0@'.format(efi_arch)
3794
3795 if have_gnu_efi
3796 status += [
3797 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
3798 'EFI CC @0@'.format(' '.join(efi_cc)),
3799 'EFI lds: @0@'.format(efi_lds),
3800 'EFI crt0: @0@'.format(efi_crt0),
3801 'EFI include directory: @0@'.format(efi_incdir)]
3802 endif
3803 endif
3804
3805 found = []
3806 missing = []
3807
3808 foreach tuple : [
3809 ['libcryptsetup'],
3810 ['PAM'],
3811 ['pwquality'],
3812 ['libfdisk'],
3813 ['p11kit'],
3814 ['libfido2'],
3815 ['tpm2'],
3816 ['AUDIT'],
3817 ['IMA'],
3818 ['AppArmor'],
3819 ['SELinux'],
3820 ['SECCOMP'],
3821 ['SMACK'],
3822 ['zlib'],
3823 ['xz'],
3824 ['zstd'],
3825 ['lz4'],
3826 ['bzip2'],
3827 ['ACL'],
3828 ['gcrypt'],
3829 ['qrencode'],
3830 ['microhttpd'],
3831 ['gnutls'],
3832 ['openssl'],
3833 ['libcurl'],
3834 ['idn'],
3835 ['initrd'],
3836 ['compat-mutable-uid-boundaries'],
3837 ['nscd'],
3838 ['libidn2'],
3839 ['libidn'],
3840 ['libiptc'],
3841 ['elfutils'],
3842 ['binfmt'],
3843 ['repart'],
3844 ['vconsole'],
3845 ['quotacheck'],
3846 ['tmpfiles'],
3847 ['environment.d'],
3848 ['sysusers'],
3849 ['firstboot'],
3850 ['randomseed'],
3851 ['backlight'],
3852 ['rfkill'],
3853 ['xdg-autostart'],
3854 ['logind'],
3855 ['machined'],
3856 ['portabled'],
3857 ['userdb'],
3858 ['homed'],
3859 ['importd'],
3860 ['hostnamed'],
3861 ['timedated'],
3862 ['timesyncd'],
3863 ['localed'],
3864 ['networkd'],
3865 ['resolve'],
3866 ['DNS-over-TLS(gnutls)', conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1],
3867 ['DNS-over-TLS(openssl)', conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1],
3868 ['coredump'],
3869 ['pstore'],
3870 ['oomd'],
3871 ['polkit'],
3872 ['legacy pkla', install_polkit_pkla],
3873 ['efi'],
3874 ['gnu-efi', have_gnu_efi],
3875 ['kmod'],
3876 ['xkbcommon'],
3877 ['pcre2'],
3878 ['blkid'],
3879 ['dbus'],
3880 ['glib'],
3881 ['nss-myhostname'],
3882 ['nss-mymachines'],
3883 ['nss-resolve'],
3884 ['nss-systemd'],
3885 ['hwdb'],
3886 ['tpm'],
3887 ['man pages', want_man],
3888 ['html pages', want_html],
3889 ['man page indices', want_man and have_lxml],
3890 ['SysV compat'],
3891 ['utmp'],
3892 ['ldconfig'],
3893 ['hibernate'],
3894 ['adm group', get_option('adm-group')],
3895 ['wheel group', get_option('wheel-group')],
3896 ['gshadow'],
3897 ['debug hashmap'],
3898 ['debug mmap cache'],
3899 ['debug siphash'],
3900 ['valgrind', conf.get('VALGRIND') == 1],
3901 ['trace logging', conf.get('LOG_TRACE') == 1],
3902 ['install tests', install_tests],
3903 ['link-udev-shared', get_option('link-udev-shared')],
3904 ['link-systemctl-shared', get_option('link-systemctl-shared')],
3905 ['link-networkd-shared', get_option('link-networkd-shared')],
3906 ['link-timesyncd-shared', get_option('link-timesyncd-shared')],
3907 ['kernel-install', get_option('kernel-install')],
3908 ['systemd-analyze', conf.get('ENABLE_ANALYZE') == 1],
3909 ['fexecve'],
3910 ]
3911
3912 if tuple.length() >= 2
3913 cond = tuple[1]
3914 else
3915 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3916 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3917 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3918 endif
3919 if cond
3920 found += tuple[0]
3921 else
3922 missing += tuple[0]
3923 endif
3924 endforeach
3925
3926 status += [
3927 '',
3928 'enabled features: @0@'.format(', '.join(found)),
3929 '',
3930 'disabled features: @0@'.format(', '.join(missing)),
3931 '']
3932 message('\n '.join(status))
3933
3934 if rootprefixdir != rootprefix_default
3935 warning('\n' +
3936 'Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3937 'systemd used fixed names for unit file directories and other paths, so anything\n' +
3938 'except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
3939 endif