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