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