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