1 project('systemd', 'c',
10 meson_version : '>= 0.40',
13 libsystemd_version = '0.19.1'
14 libudev_version = '1.6.7'
16 # We need the same data in three different formats, ugh!
17 # Also, for hysterical reasons, we use different variable
18 # names, sometimes. Not all variables are included in every
20 conf = configuration_data()
21 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
22 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
24 substs = configuration_data()
25 substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
26 substs.set('PACKAGE_VERSION', meson.project_version())
30 #####################################################################
32 # Try to install the git pre-commit hook
33 git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
34 if git_hook.returncode() == 0
35 message(git_hook.stdout().strip())
38 #####################################################################
40 conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
41 rootprefixdir = get_option('split-usr') ? '/' : '/usr'
43 sysvinit_path = get_option('sysvinit-path')
44 sysvrcnd_path = get_option('sysvrcnd-path')
45 have = sysvinit_path != '' or sysvrcnd_path != ''
46 conf.set10('HAVE_SYSV_COMPAT', have,
47 description : 'SysV init scripts and rcN.d links are supported')
48 m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
50 # join_paths ignore the preceding arguments if an absolute component is
51 # encountered, so this should canonicalize various paths when they are
52 # absolute or relative.
53 prefixdir = get_option('prefix')
54 if not prefixdir.startswith('/')
55 error('Prefix is not absolute: "@0@"'.format(prefixdir))
57 bindir = join_paths(prefixdir, get_option('bindir'))
58 libdir = join_paths(prefixdir, get_option('libdir'))
59 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
60 includedir = join_paths(prefixdir, get_option('includedir'))
61 datadir = join_paths(prefixdir, get_option('datadir'))
62 localstatedir = join_paths('/', get_option('localstatedir'))
64 rootbindir = join_paths(rootprefixdir, 'bin')
65 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
67 rootlibdir = get_option('rootlibdir')
69 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
72 # Dirs of external packages
73 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
74 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
75 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
76 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
77 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
78 varlogdir = join_paths(localstatedir, 'log')
79 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
80 rpmmacrosdir = join_paths(prefixdir, get_option('rpmmacrosdir'))
81 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
84 pkgdatadir = join_paths(datadir, 'systemd')
85 environmentdir = join_paths(prefixdir, 'lib/environment.d')
86 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
87 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
88 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
89 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
90 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
91 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
92 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
93 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
94 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
95 pkgincludedir = join_paths(includedir, 'systemd')
96 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
97 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
98 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
99 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
100 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
101 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
102 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
103 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
104 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
105 udevhomedir = udevlibexecdir
106 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
107 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
108 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
109 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
110 factorydir = join_paths(datadir, 'factory')
111 docdir = join_paths(datadir, 'doc/systemd')
112 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
113 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
114 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
115 catalogstatedir = join_paths(systemdstatedir, 'catalog')
116 randomseeddir = join_paths(localstatedir, 'lib/systemd')
118 dbuspolicydir = get_option('dbuspolicydir')
119 if dbuspolicydir == ''
120 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
123 dbussessionservicedir = get_option('dbussessionservicedir')
124 if dbussessionservicedir == ''
125 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
128 dbussystemservicedir = get_option('dbussystemservicedir')
129 if dbussystemservicedir == ''
130 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
133 pamlibdir = get_option('pamlibdir')
135 pamlibdir = join_paths(rootlibdir, 'security')
138 pamconfdir = get_option('pamconfdir')
140 pamconfdir = join_paths(sysconfdir, 'pam.d')
143 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
144 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
145 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
146 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
147 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
148 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
149 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
150 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
151 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
152 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
153 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
154 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
155 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
156 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
157 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
158 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
159 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
160 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
161 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
162 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
163 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
164 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
165 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
166 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
167 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
168 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
169 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
170 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
171 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
172 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
173 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
174 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
175 conf.set_quoted('LIBDIR', libdir)
176 conf.set_quoted('ROOTLIBDIR', rootlibdir)
177 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
178 conf.set_quoted('BOOTLIBDIR', bootlibdir)
179 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
180 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
181 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
182 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
183 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
184 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
186 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
187 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
189 substs.set('prefix', prefixdir)
190 substs.set('exec_prefix', prefixdir)
191 substs.set('libdir', libdir)
192 substs.set('rootlibdir', rootlibdir)
193 substs.set('includedir', includedir)
194 substs.set('pkgsysconfdir', pkgsysconfdir)
195 substs.set('bindir', bindir)
196 substs.set('rootbindir', rootbindir)
197 substs.set('rootlibexecdir', rootlibexecdir)
198 substs.set('systemunitdir', systemunitdir)
199 substs.set('userunitdir', userunitdir)
200 substs.set('systempresetdir', systempresetdir)
201 substs.set('userpresetdir', userpresetdir)
202 substs.set('udevhwdbdir', udevhwdbdir)
203 substs.set('udevrulesdir', udevrulesdir)
204 substs.set('udevlibexecdir', udevlibexecdir)
205 substs.set('catalogdir', catalogdir)
206 substs.set('tmpfilesdir', tmpfilesdir)
207 substs.set('sysusersdir', sysusersdir)
208 substs.set('sysctldir', sysctldir)
209 substs.set('binfmtdir', binfmtdir)
210 substs.set('modulesloaddir', modulesloaddir)
211 substs.set('systemgeneratordir', systemgeneratordir)
212 substs.set('usergeneratordir', usergeneratordir)
213 substs.set('systemenvgeneratordir', systemenvgeneratordir)
214 substs.set('userenvgeneratordir', userenvgeneratordir)
215 substs.set('systemshutdowndir', systemshutdowndir)
216 substs.set('systemsleepdir', systemsleepdir)
217 substs.set('VARLOGDIR', varlogdir)
218 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
219 substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
220 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
221 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
222 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
223 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
224 substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
226 #####################################################################
228 cc = meson.get_compiler('c')
229 pkgconfig = import('pkgconfig')
230 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
232 cxx = find_program('c++', required : false)
234 # Used only for tests
238 foreach arg : ['-Wextra',
241 '-Wmissing-include-dirs',
242 '-Wold-style-definition',
245 '-Wdeclaration-after-statement',
247 '-Wsuggest-attribute=noreturn',
248 '-Werror=missing-prototypes',
249 '-Werror=implicit-function-declaration',
250 '-Werror=missing-declarations',
251 '-Werror=return-type',
252 '-Werror=incompatible-pointer-types',
254 '-Wstrict-prototypes',
256 '-Wmissing-noreturn',
259 '-Wstrict-aliasing=2',
266 '-fdiagnostics-show-option',
267 '-fno-strict-aliasing',
268 '-fvisibility=hidden',
270 '-fstack-protector-strong',
272 '--param=ssp-buffer-size=4',
274 if cc.has_argument(arg)
275 add_project_arguments(arg, language : 'c')
279 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
280 # arguments, just emits a warnings. So test for the "positive" version instead.
281 foreach arg : ['unused-parameter',
282 'missing-field-initializers',
285 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
287 if cc.has_argument('-W' + arg)
288 add_project_arguments('-Wno-' + arg, language : 'c')
294 #include <inttypes.h>
295 typedef uint64_t usec_t;
296 usec_t now(clockid_t clock);
301 ', name : '-Werror=shadow with local shadowing')
302 add_project_arguments('-Werror=shadow', language : 'c')
305 if cc.get_id() == 'clang'
306 foreach arg : ['-Wno-typedef-redefinition',
307 '-Wno-gnu-variable-sized-type-not-at-end',
309 if cc.has_argument(arg,
310 name : '@0@ is supported'.format(arg))
311 add_project_arguments(arg, language : 'c')
316 link_test_c = files('tools/meson-link-test.c')
318 # --as-needed and --no-undefined are provided by meson by default,
319 # run mesonconf to see what is enabled
320 foreach arg : ['-Wl,-z,relro',
325 have = run_command(check_compilation_sh,
326 cc.cmd_array(), '-x', 'c', arg,
327 '-include', link_test_c).returncode() == 0
328 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
330 add_project_link_arguments(arg, language : 'c')
334 if get_option('buildtype') != 'debug'
335 foreach arg : ['-ffunction-sections',
337 if cc.has_argument(arg,
338 name : '@0@ is supported'.format(arg))
339 add_project_arguments(arg, language : 'c')
343 foreach arg : ['-Wl,--gc-sections']
344 have = run_command(check_compilation_sh,
345 cc.cmd_array(), '-x', 'c', arg,
346 '-include', link_test_c).returncode() == 0
347 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
349 add_project_link_arguments(arg, language : 'c')
354 cpp = ' '.join(cc.cmd_array()) + ' -E'
356 #####################################################################
357 # compilation result tests
359 conf.set('_GNU_SOURCE', true)
360 conf.set('__SANE_USERSPACE_TYPES__', true)
362 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
363 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
364 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
365 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
366 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
367 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
368 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
372 #include <linux/ethtool.h>
373 #include <linux/fib_rules.h>
375 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
377 foreach decl : ['char16_t',
380 'struct ethtool_link_settings',
381 'struct fib_rule_uid_range',
384 # We get -1 if the size cannot be determined
385 have = cc.sizeof(decl, prefix : decl_headers) > 0
386 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
389 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
390 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
391 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
392 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
393 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
394 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
395 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
396 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
397 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
398 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
399 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
400 # if_tunnel.h is buggy and cannot be included on its own
401 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
402 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
403 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
404 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
405 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
406 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
407 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
408 ['NDA_IFINDEX', 'linux/neighbour.h'],
409 ['IFA_FLAGS', 'linux/if_addr.h'],
410 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
411 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
413 prefix = decl.length() > 2 ? decl[2] : ''
414 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
415 conf.set10('HAVE_' + decl[0], have)
418 foreach ident : ['secure_getenv', '__secure_getenv']
419 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
423 ['memfd_create', '''#include <sys/memfd.h>'''],
424 ['gettid', '''#include <sys/types.h>'''],
425 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
426 ['name_to_handle_at', '''#define _GNU_SOURCE
427 #include <sys/types.h>
428 #include <sys/stat.h>
429 #include <fcntl.h>'''],
430 ['setns', '''#define _GNU_SOURCE
431 #include <sched.h>'''],
432 ['renameat2', '''#include <stdio.h>'''],
433 ['kcmp', '''#include <linux/kcmp.h>'''],
434 ['keyctl', '''#include <sys/types.h>
435 #include <keyutils.h>'''],
436 ['copy_file_range', '''#include <sys/syscall.h>
437 #include <unistd.h>'''],
438 ['bpf', '''#include <sys/syscall.h>
439 #include <unistd.h>'''],
440 ['explicit_bzero' , '''#include <string.h>'''],
443 have = cc.has_function(ident[0], prefix : ident[1])
444 conf.set10('HAVE_' + ident[0].to_upper(), have)
447 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
448 conf.set10('USE_SYS_RANDOM_H', true)
449 conf.set10('HAVE_GETRANDOM', true)
451 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
452 conf.set10('USE_SYS_RANDOM_H', false)
453 conf.set10('HAVE_GETRANDOM', have)
456 #####################################################################
458 sed = find_program('sed')
459 awk = find_program('awk')
460 m4 = find_program('m4')
461 stat = find_program('stat')
462 git = find_program('git', required : false)
464 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
465 mkdir_p = 'mkdir -p $DESTDIR/@0@'
466 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
467 splash_bmp = files('test/splash.bmp')
469 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
470 # /usr/sbin, /sbin, and fall back to the default from middle column.
471 progs = [['telinit', '/lib/sysvinit/telinit'],
472 ['quotaon', '/usr/sbin/quotaon' ],
473 ['quotacheck', '/usr/sbin/quotacheck' ],
474 ['kill', '/usr/bin/kill' ],
475 ['kmod', '/usr/bin/kmod' ],
476 ['kexec', '/usr/sbin/kexec' ],
477 ['sulogin', '/usr/sbin/sulogin' ],
478 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
479 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
480 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
481 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
484 path = get_option(prog[0] + '-path')
486 message('Using @1@ for @0@'.format(prog[0], path))
488 exe = find_program(prog[0],
489 '/usr/sbin/' + prog[0],
492 path = exe.found() ? exe.path() : prog[1]
494 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
495 conf.set_quoted(name, path)
496 substs.set(name, path)
499 if run_command('ln', '--relative', '--help').returncode() != 0
500 error('ln does not support --relative')
503 ############################################################
505 gperf = find_program('gperf')
507 gperf_test_format = '''
509 const char * in_word_set(const char *, @0@);
512 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
513 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
514 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
515 if cc.compiles(gperf_test)
516 gperf_len_type = 'size_t'
518 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
519 if cc.compiles(gperf_test)
520 gperf_len_type = 'unsigned'
522 error('unable to determine gperf len type')
525 message('gperf len type is @0@'.format(gperf_len_type))
526 conf.set('GPERF_LEN_TYPE', gperf_len_type,
527 description : 'The type of gperf "len" parameter')
529 ############################################################
531 if not cc.has_header('sys/capability.h')
532 error('POSIX caps headers not found')
534 foreach header : ['linux/btrfs.h',
536 'linux/vm_sockets.h',
538 'valgrind/memcheck.h',
539 'valgrind/valgrind.h',
542 conf.set10('HAVE_' + header.underscorify().to_upper(),
543 cc.has_header(header))
546 ############################################################
548 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
549 conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
550 gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
552 default_hierarchy = get_option('default-hierarchy')
553 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
554 description : 'default cgroup hierarchy as string')
555 if default_hierarchy == 'legacy'
556 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
557 elif default_hierarchy == 'hybrid'
558 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
560 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
563 time_epoch = get_option('time-epoch')
566 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
568 time_epoch = time_epoch.to_int()
569 conf.set('TIME_EPOCH', time_epoch)
571 system_uid_max = get_option('system-uid-max')
572 if system_uid_max == ''
573 system_uid_max = run_command(
575 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
576 '/etc/login.defs').stdout()
578 system_uid_max = system_uid_max.to_int()
579 conf.set('SYSTEM_UID_MAX', system_uid_max)
580 substs.set('systemuidmax', system_uid_max)
581 message('maximum system UID is @0@'.format(system_uid_max))
583 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
584 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
586 system_gid_max = get_option('system-gid-max')
587 if system_gid_max == ''
588 system_gid_max = run_command(
590 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
591 '/etc/login.defs').stdout()
593 system_gid_max = system_gid_max.to_int()
594 conf.set('SYSTEM_GID_MAX', system_gid_max)
595 substs.set('systemgidmax', system_gid_max)
596 message('maximum system GID is @0@'.format(system_gid_max))
598 tty_gid = get_option('tty-gid')
599 conf.set('TTY_GID', tty_gid)
600 substs.set('TTY_GID', tty_gid)
602 if get_option('adm-group')
603 m4_defines += ['-DENABLE_ADM_GROUP']
606 if get_option('wheel-group')
607 m4_defines += ['-DENABLE_WHEEL_GROUP']
610 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
611 substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
613 kill_user_processes = get_option('default-kill-user-processes')
614 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
615 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
617 dns_servers = get_option('dns-servers')
618 conf.set_quoted('DNS_SERVERS', dns_servers)
619 substs.set('DNS_SERVERS', dns_servers)
621 ntp_servers = get_option('ntp-servers')
622 conf.set_quoted('NTP_SERVERS', ntp_servers)
623 substs.set('NTP_SERVERS', ntp_servers)
625 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
627 substs.set('SUSHELL', get_option('debug-shell'))
628 substs.set('DEBUGTTY', get_option('debug-tty'))
630 debug = get_option('debug')
631 enable_debug_hashmap = false
632 enable_debug_mmap_cache = false
634 foreach name : debug.split(',')
636 enable_debug_hashmap = true
637 elif name == 'mmap-cache'
638 enable_debug_mmap_cache = true
640 message('unknown debug option "@0@", ignoring'.format(name))
644 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
645 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
647 #####################################################################
649 threads = dependency('threads')
650 librt = cc.find_library('rt')
651 libm = cc.find_library('m')
652 libdl = cc.find_library('dl')
653 libcrypt = cc.find_library('crypt')
655 libcap = dependency('libcap', required : false)
656 if not libcap.found()
657 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
658 libcap = cc.find_library('cap')
661 libmount = dependency('mount',
664 want_seccomp = get_option('seccomp')
665 if want_seccomp != 'false'
666 libseccomp = dependency('libseccomp',
667 version : '>= 2.3.1',
668 required : want_seccomp == 'true')
669 have = libseccomp.found()
674 conf.set10('HAVE_SECCOMP', have)
675 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
677 want_selinux = get_option('selinux')
678 if want_selinux != 'false'
679 libselinux = dependency('libselinux',
680 version : '>= 2.1.9',
681 required : want_selinux == 'true')
682 have = libselinux.found()
687 conf.set10('HAVE_SELINUX', have)
688 m4_defines += have ? ['-DHAVE_SELINUX'] : []
690 want_apparmor = get_option('apparmor')
691 if want_apparmor != 'false'
692 libapparmor = dependency('libapparmor',
693 required : want_apparmor == 'true')
694 have = libapparmor.found()
699 conf.set10('HAVE_APPARMOR', have)
700 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
702 smack_run_label = get_option('smack-run-label')
703 if smack_run_label != ''
704 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
705 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
708 want_polkit = get_option('polkit')
709 install_polkit = false
710 install_polkit_pkla = false
711 if want_polkit != 'false'
712 install_polkit = true
714 libpolkit = dependency('polkit-gobject-1',
716 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
717 message('Old polkit detected, will install pkla files')
718 install_polkit_pkla = true
721 conf.set10('ENABLE_POLKIT', install_polkit)
723 want_acl = get_option('acl')
724 if want_acl != 'false'
725 libacl = cc.find_library('acl', required : want_acl == 'true')
726 have = libacl.found()
731 conf.set10('HAVE_ACL', have)
732 m4_defines += have ? ['-DHAVE_ACL'] : []
734 want_audit = get_option('audit')
735 if want_audit != 'false'
736 libaudit = dependency('audit', required : want_audit == 'true')
737 have = libaudit.found()
742 conf.set10('HAVE_AUDIT', have)
744 want_blkid = get_option('blkid')
745 if want_blkid != 'false'
746 libblkid = dependency('blkid', required : want_blkid == 'true')
747 have = libblkid.found()
752 conf.set10('HAVE_BLKID', have)
754 want_kmod = get_option('kmod')
755 if want_kmod != 'false'
756 libkmod = dependency('libkmod',
758 required : want_kmod == 'true')
759 have = libkmod.found()
764 conf.set10('HAVE_KMOD', have)
766 want_pam = get_option('pam')
767 if want_pam != 'false'
768 libpam = cc.find_library('pam', required : want_pam == 'true')
769 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
770 have = libpam.found() and libpam_misc.found()
776 conf.set10('HAVE_PAM', have)
777 m4_defines += have ? ['-DHAVE_PAM'] : []
779 want_microhttpd = get_option('microhttpd')
780 if want_microhttpd != 'false'
781 libmicrohttpd = dependency('libmicrohttpd',
782 version : '>= 0.9.33',
783 required : want_microhttpd == 'true')
784 have = libmicrohttpd.found()
789 conf.set10('HAVE_MICROHTTPD', have)
790 m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
792 want_libcryptsetup = get_option('libcryptsetup')
793 if want_libcryptsetup != 'false'
794 libcryptsetup = dependency('libcryptsetup',
795 version : '>= 1.6.0',
796 required : want_libcryptsetup == 'true')
797 have = libcryptsetup.found()
802 conf.set10('HAVE_LIBCRYPTSETUP', have)
804 want_libcurl = get_option('libcurl')
805 if want_libcurl != 'false'
806 libcurl = dependency('libcurl',
807 version : '>= 7.32.0',
808 required : want_libcurl == 'true')
809 have = libcurl.found()
814 conf.set10('HAVE_LIBCURL', have)
815 m4_defines += have ? ['-DHAVE_LIBCURL'] : []
817 want_libidn = get_option('libidn')
818 want_libidn2 = get_option('libidn2')
819 if want_libidn == 'true' and want_libidn2 == 'true'
820 error('libidn and libidn2 cannot be requested simultaneously')
823 if want_libidn != 'false' and want_libidn2 != 'true'
824 libidn = dependency('libidn',
825 required : want_libidn == 'true')
826 have = libidn.found()
831 conf.set10('HAVE_LIBIDN', have)
832 m4_defines += have ? ['-DHAVE_LIBIDN'] : []
833 if not have and want_libidn2 != 'false'
834 # libidn is used for both libidn and libidn2 objects
835 libidn = dependency('libidn2',
836 required : want_libidn2 == 'true')
837 have = libidn.found()
841 conf.set10('HAVE_LIBIDN2', have)
842 m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
844 want_libiptc = get_option('libiptc')
845 if want_libiptc != 'false'
846 libiptc = dependency('libiptc',
847 required : want_libiptc == 'true')
848 have = libiptc.found()
853 conf.set10('HAVE_LIBIPTC', have)
854 m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
856 want_qrencode = get_option('qrencode')
857 if want_qrencode != 'false'
858 libqrencode = dependency('libqrencode',
859 required : want_qrencode == 'true')
860 have = libqrencode.found()
865 conf.set10('HAVE_QRENCODE', have)
867 want_gcrypt = get_option('gcrypt')
868 if want_gcrypt != 'false'
869 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
870 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
871 have = libgcrypt.found() and libgpg_error.found()
876 # link to neither of the libs if one is not found
880 conf.set10('HAVE_GCRYPT', have)
882 want_gnutls = get_option('gnutls')
883 if want_gnutls != 'false'
884 libgnutls = dependency('gnutls',
885 version : '>= 3.1.4',
886 required : want_gnutls == 'true')
887 have = libgnutls.found()
892 conf.set10('HAVE_GNUTLS', have)
894 want_elfutils = get_option('elfutils')
895 if want_elfutils != 'false'
896 libdw = dependency('libdw',
897 required : want_elfutils == 'true')
903 conf.set10('HAVE_ELFUTILS', have)
905 want_zlib = get_option('zlib')
906 if want_zlib != 'false'
907 libz = dependency('zlib',
908 required : want_zlib == 'true')
914 conf.set10('HAVE_ZLIB', have)
916 want_bzip2 = get_option('bzip2')
917 if want_bzip2 != 'false'
918 libbzip2 = cc.find_library('bz2',
919 required : want_bzip2 == 'true')
920 have = libbzip2.found()
925 conf.set10('HAVE_BZIP2', have)
927 want_xz = get_option('xz')
928 if want_xz != 'false'
929 libxz = dependency('liblzma',
930 required : want_xz == 'true')
936 conf.set10('HAVE_XZ', have)
938 want_lz4 = get_option('lz4')
939 if want_lz4 != 'false'
940 liblz4 = dependency('liblz4',
941 required : want_lz4 == 'true')
942 have = liblz4.found()
947 conf.set10('HAVE_LZ4', have)
949 want_xkbcommon = get_option('xkbcommon')
950 if want_xkbcommon != 'false'
951 libxkbcommon = dependency('xkbcommon',
952 version : '>= 0.3.0',
953 required : want_xkbcommon == 'true')
954 have = libxkbcommon.found()
959 conf.set10('HAVE_XKBCOMMON', have)
961 want_glib = get_option('glib')
962 if want_glib != 'false'
963 libglib = dependency('glib-2.0',
964 version : '>= 2.22.0',
965 required : want_glib == 'true')
966 libgobject = dependency('gobject-2.0',
967 version : '>= 2.22.0',
968 required : want_glib == 'true')
969 libgio = dependency('gio-2.0',
970 required : want_glib == 'true')
971 have = libglib.found() and libgobject.found() and libgio.found()
978 conf.set10('HAVE_GLIB', have)
980 want_dbus = get_option('dbus')
981 if want_dbus != 'false'
982 libdbus = dependency('dbus-1',
983 version : '>= 1.3.2',
984 required : want_dbus == 'true')
985 have = libdbus.found()
990 conf.set10('HAVE_DBUS', have)
992 default_dnssec = get_option('default-dnssec')
993 if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
994 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
995 default_dnssec = 'no'
997 conf.set('DEFAULT_DNSSEC_MODE',
998 'DNSSEC_' + default_dnssec.underscorify().to_upper())
999 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1001 want_importd = get_option('importd')
1002 if want_importd != 'false'
1003 have = (conf.get('HAVE_LIBCURL') == 1 and
1004 conf.get('HAVE_ZLIB') == 1 and
1005 conf.get('HAVE_BZIP2') == 1 and
1006 conf.get('HAVE_XZ') == 1 and
1007 conf.get('HAVE_GCRYPT') == 1)
1008 if want_importd == 'true' and not have
1009 error('importd support was requested, but dependencies are not available')
1014 conf.set10('ENABLE_IMPORTD', have)
1016 want_remote = get_option('remote')
1017 if want_remote != 'false'
1018 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1019 conf.get('HAVE_LIBCURL') == 1]
1020 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1021 # it's possible to build one without the other. Complain only if
1022 # support was explictly requested. The auxiliary files like sysusers
1023 # config should be installed when any of the programs are built.
1024 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1025 error('remote support was requested, but dependencies are not available')
1027 have = have_deps[0] or have_deps[1]
1031 conf.set10('ENABLE_REMOTE', have)
1033 foreach term : ['utmp',
1064 have = get_option(term)
1065 name = 'ENABLE_' + term.underscorify().to_upper()
1066 conf.set10(name, have)
1067 m4_defines += have ? ['-D' + name] : []
1070 want_tests = get_option('tests')
1071 install_tests = get_option('install-tests')
1074 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1076 #####################################################################
1078 if get_option('efi')
1079 efi_arch = host_machine.cpu_family()
1081 if efi_arch == 'x86'
1082 EFI_MACHINE_TYPE_NAME = 'ia32'
1083 gnu_efi_arch = 'ia32'
1084 elif efi_arch == 'x86_64'
1085 EFI_MACHINE_TYPE_NAME = 'x64'
1086 gnu_efi_arch = 'x86_64'
1087 elif efi_arch == 'arm'
1088 EFI_MACHINE_TYPE_NAME = 'arm'
1089 gnu_efi_arch = 'arm'
1090 elif efi_arch == 'aarch64'
1091 EFI_MACHINE_TYPE_NAME = 'aa64'
1092 gnu_efi_arch = 'aarch64'
1094 EFI_MACHINE_TYPE_NAME = ''
1099 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1101 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1105 conf.set10('ENABLE_EFI', have)
1107 #####################################################################
1109 config_h = configure_file(
1110 output : 'config.h',
1111 configuration : conf)
1113 includes = include_directories('src/basic',
1123 'src/libsystemd/sd-bus',
1124 'src/libsystemd/sd-device',
1125 'src/libsystemd/sd-hwdb',
1126 'src/libsystemd/sd-id128',
1127 'src/libsystemd/sd-netlink',
1128 'src/libsystemd/sd-network',
1129 'src/libsystemd-network',
1133 add_project_arguments('-include', 'config.h', language : 'c')
1135 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1136 'src/shared/gcrypt-util.c')
1140 subdir('src/systemd')
1142 subdir('src/libsystemd')
1143 subdir('src/libsystemd-network')
1144 subdir('src/journal')
1147 libjournal_core = static_library(
1149 libjournal_core_sources,
1151 include_directories : includes,
1154 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1155 libsystemd = shared_library(
1157 libsystemd_internal_sources,
1158 journal_internal_sources,
1159 version : libsystemd_version,
1160 include_directories : includes,
1161 link_args : ['-shared',
1162 '-Wl,--version-script=' + libsystemd_sym_path],
1163 link_with : [libbasic],
1164 dependencies : [threads,
1169 link_depends : libsystemd_sym,
1171 install_dir : rootlibdir)
1173 ############################################################
1175 # binaries that have --help and are intended for use by humans,
1176 # usually, but not always, installed in /bin.
1177 public_programs = []
1179 subdir('src/libudev')
1180 subdir('src/shared')
1183 subdir('src/network')
1185 subdir('src/analyze')
1186 subdir('src/journal-remote')
1187 subdir('src/coredump')
1188 subdir('src/hostname')
1189 subdir('src/import')
1190 subdir('src/kernel-install')
1191 subdir('src/locale')
1192 subdir('src/machine')
1193 subdir('src/nspawn')
1194 subdir('src/resolve')
1195 subdir('src/timedate')
1196 subdir('src/timesync')
1197 subdir('src/vconsole')
1198 subdir('src/sulogin-shell')
1199 subdir('src/boot/efi')
1204 ############################################################
1206 # only static linking apart from libdl, to make sure that the
1207 # module is linked to all libraries that it uses.
1208 test_dlopen = executable(
1211 include_directories : includes,
1212 link_with : [libbasic],
1213 dependencies : [libdl])
1215 foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1216 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1217 ['mymachines', 'ENABLE_MACHINED'],
1218 ['resolve', 'ENABLE_RESOLVE']]
1220 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1224 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1225 version_script_arg = join_paths(meson.current_source_dir(), sym)
1227 nss = shared_library(
1229 'src/nss-@0@/nss-@0@.c'.format(module),
1231 include_directories : includes,
1232 link_args : ['-shared',
1233 '-Wl,--version-script=' + version_script_arg,
1235 link_with : [libsystemd_internal,
1237 dependencies : [threads,
1241 install_dir : rootlibdir)
1243 # We cannot use shared_module because it does not support version suffix.
1244 # Unfortunately shared_library insists on creating the symlink…
1245 meson.add_install_script('sh', '-c',
1246 'rm $DESTDIR@0@/libnss_@1@.so'
1247 .format(rootlibdir, module))
1249 test('dlopen-nss_' + module,
1251 args : [nss.full_path()]) # path to dlopen must include a slash
1255 ############################################################
1257 executable('systemd',
1259 include_directories : includes,
1260 link_with : [libcore,
1262 dependencies : [threads,
1268 install_rpath : rootlibexecdir,
1270 install_dir : rootlibexecdir)
1272 exe = executable('systemd-analyze',
1273 systemd_analyze_sources,
1274 include_directories : includes,
1275 link_with : [libcore,
1277 dependencies : [threads,
1283 install_rpath : rootlibexecdir,
1285 public_programs += [exe]
1287 executable('systemd-journald',
1288 systemd_journald_sources,
1289 include_directories : includes,
1290 link_with : [libjournal_core,
1292 dependencies : [threads,
1296 install_rpath : rootlibexecdir,
1298 install_dir : rootlibexecdir)
1300 exe = executable('systemd-cat',
1301 systemd_cat_sources,
1302 include_directories : includes,
1303 link_with : [libjournal_core,
1305 dependencies : [threads],
1306 install_rpath : rootlibexecdir,
1308 public_programs += [exe]
1310 exe = executable('journalctl',
1312 include_directories : includes,
1313 link_with : [libshared],
1314 dependencies : [threads,
1318 install_rpath : rootlibexecdir,
1320 install_dir : rootbindir)
1321 public_programs += [exe]
1323 executable('systemd-getty-generator',
1324 'src/getty-generator/getty-generator.c',
1325 include_directories : includes,
1326 link_with : [libshared],
1327 install_rpath : rootlibexecdir,
1329 install_dir : systemgeneratordir)
1331 executable('systemd-debug-generator',
1332 'src/debug-generator/debug-generator.c',
1333 include_directories : includes,
1334 link_with : [libshared],
1335 install_rpath : rootlibexecdir,
1337 install_dir : systemgeneratordir)
1339 executable('systemd-fstab-generator',
1340 'src/fstab-generator/fstab-generator.c',
1341 'src/core/mount-setup.c',
1342 include_directories : includes,
1343 link_with : [libshared],
1344 install_rpath : rootlibexecdir,
1346 install_dir : systemgeneratordir)
1348 if conf.get('ENABLE_ENVIRONMENT_D') == 1
1349 executable('30-systemd-environment-d-generator',
1350 'src/environment-d-generator/environment-d-generator.c',
1351 include_directories : includes,
1352 link_with : [libshared],
1353 install_rpath : rootlibexecdir,
1355 install_dir : userenvgeneratordir)
1357 meson.add_install_script(meson_make_symlink,
1358 join_paths(sysconfdir, 'environment'),
1359 join_paths(environmentdir, '99-environment.conf'))
1362 if conf.get('ENABLE_HIBERNATE') == 1
1363 executable('systemd-hibernate-resume-generator',
1364 'src/hibernate-resume/hibernate-resume-generator.c',
1365 include_directories : includes,
1366 link_with : [libshared],
1367 install_rpath : rootlibexecdir,
1369 install_dir : systemgeneratordir)
1371 executable('systemd-hibernate-resume',
1372 'src/hibernate-resume/hibernate-resume.c',
1373 include_directories : includes,
1374 link_with : [libshared],
1375 install_rpath : rootlibexecdir,
1377 install_dir : rootlibexecdir)
1380 if conf.get('HAVE_BLKID') == 1
1381 executable('systemd-gpt-auto-generator',
1382 'src/gpt-auto-generator/gpt-auto-generator.c',
1383 'src/basic/blkid-util.h',
1384 include_directories : includes,
1385 link_with : [libshared],
1386 dependencies : libblkid,
1387 install_rpath : rootlibexecdir,
1389 install_dir : systemgeneratordir)
1391 exe = executable('systemd-dissect',
1392 'src/dissect/dissect.c',
1393 include_directories : includes,
1394 link_with : [libshared],
1395 install_rpath : rootlibexecdir,
1397 install_dir : rootlibexecdir)
1398 public_programs += [exe]
1401 if conf.get('ENABLE_RESOLVE') == 1
1402 executable('systemd-resolved',
1403 systemd_resolved_sources,
1404 gcrypt_util_sources,
1405 include_directories : includes,
1406 link_with : [libshared],
1407 dependencies : [threads,
1412 install_rpath : rootlibexecdir,
1414 install_dir : rootlibexecdir)
1416 exe = executable('systemd-resolve',
1417 systemd_resolve_sources,
1418 gcrypt_util_sources,
1419 include_directories : includes,
1420 link_with : [libshared],
1421 dependencies : [threads,
1426 install_rpath : rootlibexecdir,
1428 public_programs += [exe]
1431 if conf.get('ENABLE_LOGIND') == 1
1432 executable('systemd-logind',
1433 systemd_logind_sources,
1434 include_directories : includes,
1435 link_with : [liblogind_core,
1437 dependencies : [threads,
1439 install_rpath : rootlibexecdir,
1441 install_dir : rootlibexecdir)
1443 exe = executable('loginctl',
1445 include_directories : includes,
1446 link_with : [libshared],
1447 dependencies : [threads,
1450 install_rpath : rootlibexecdir,
1452 install_dir : rootbindir)
1453 public_programs += [exe]
1455 exe = executable('systemd-inhibit',
1456 'src/login/inhibit.c',
1457 include_directories : includes,
1458 link_with : [libshared],
1459 install_rpath : rootlibexecdir,
1461 install_dir : rootbindir)
1462 public_programs += [exe]
1464 if conf.get('HAVE_PAM') == 1
1465 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1466 pam_systemd = shared_library(
1470 include_directories : includes,
1471 link_args : ['-shared',
1472 '-Wl,--version-script=' + version_script_arg],
1473 link_with : [libsystemd_internal,
1475 dependencies : [threads,
1478 link_depends : pam_systemd_sym,
1480 install_dir : pamlibdir)
1482 test('dlopen-pam_systemd',
1484 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1488 if conf.get('HAVE_PAM') == 1
1489 executable('systemd-user-sessions',
1490 'src/user-sessions/user-sessions.c',
1491 include_directories : includes,
1492 link_with : [libshared],
1493 install_rpath : rootlibexecdir,
1495 install_dir : rootlibexecdir)
1498 if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1499 exe = executable('bootctl',
1500 'src/boot/bootctl.c',
1501 include_directories : includes,
1502 link_with : [libshared],
1503 dependencies : [libblkid],
1504 install_rpath : rootlibexecdir,
1506 public_programs += [exe]
1509 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1510 include_directories : includes,
1511 link_with : [libshared],
1512 dependencies : [threads],
1513 install_rpath : rootlibexecdir,
1515 public_programs += [exe]
1517 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1518 include_directories : includes,
1519 link_with : [libshared],
1520 dependencies : [threads,
1525 install_rpath : rootlibexecdir,
1527 install_dir : rootbindir)
1528 public_programs += [exe]
1530 if conf.get('ENABLE_BACKLIGHT') == 1
1531 executable('systemd-backlight',
1532 'src/backlight/backlight.c',
1533 include_directories : includes,
1534 link_with : [libshared],
1535 install_rpath : rootlibexecdir,
1537 install_dir : rootlibexecdir)
1540 if conf.get('ENABLE_RFKILL') == 1
1541 executable('systemd-rfkill',
1542 'src/rfkill/rfkill.c',
1543 include_directories : includes,
1544 link_with : [libshared],
1545 install_rpath : rootlibexecdir,
1547 install_dir : rootlibexecdir)
1550 executable('systemd-system-update-generator',
1551 'src/system-update-generator/system-update-generator.c',
1552 include_directories : includes,
1553 link_with : [libshared],
1554 install_rpath : rootlibexecdir,
1556 install_dir : systemgeneratordir)
1558 if conf.get('HAVE_LIBCRYPTSETUP') == 1
1559 executable('systemd-cryptsetup',
1560 'src/cryptsetup/cryptsetup.c',
1561 include_directories : includes,
1562 link_with : [libshared],
1563 dependencies : [libcryptsetup],
1564 install_rpath : rootlibexecdir,
1566 install_dir : rootlibexecdir)
1568 executable('systemd-cryptsetup-generator',
1569 'src/cryptsetup/cryptsetup-generator.c',
1570 include_directories : includes,
1571 link_with : [libshared],
1572 dependencies : [libcryptsetup],
1573 install_rpath : rootlibexecdir,
1575 install_dir : systemgeneratordir)
1577 executable('systemd-veritysetup',
1578 'src/veritysetup/veritysetup.c',
1579 include_directories : includes,
1580 link_with : [libshared],
1581 dependencies : [libcryptsetup],
1582 install_rpath : rootlibexecdir,
1584 install_dir : rootlibexecdir)
1586 executable('systemd-veritysetup-generator',
1587 'src/veritysetup/veritysetup-generator.c',
1588 include_directories : includes,
1589 link_with : [libshared],
1590 dependencies : [libcryptsetup],
1591 install_rpath : rootlibexecdir,
1593 install_dir : systemgeneratordir)
1596 if conf.get('HAVE_SYSV_COMPAT') == 1
1597 executable('systemd-sysv-generator',
1598 'src/sysv-generator/sysv-generator.c',
1599 include_directories : includes,
1600 link_with : [libshared],
1601 install_rpath : rootlibexecdir,
1603 install_dir : systemgeneratordir)
1605 executable('systemd-rc-local-generator',
1606 'src/rc-local-generator/rc-local-generator.c',
1607 include_directories : includes,
1608 link_with : [libshared],
1609 install_rpath : rootlibexecdir,
1611 install_dir : systemgeneratordir)
1614 if conf.get('ENABLE_HOSTNAMED') == 1
1615 executable('systemd-hostnamed',
1616 'src/hostname/hostnamed.c',
1617 include_directories : includes,
1618 link_with : [libshared],
1619 install_rpath : rootlibexecdir,
1621 install_dir : rootlibexecdir)
1623 exe = executable('hostnamectl',
1624 'src/hostname/hostnamectl.c',
1625 include_directories : includes,
1626 link_with : [libshared],
1627 install_rpath : rootlibexecdir,
1629 public_programs += [exe]
1632 if conf.get('ENABLE_LOCALED') == 1
1633 if conf.get('HAVE_XKBCOMMON') == 1
1634 # logind will load libxkbcommon.so dynamically on its own
1640 executable('systemd-localed',
1641 systemd_localed_sources,
1642 include_directories : includes,
1643 link_with : [libshared],
1644 dependencies : deps,
1645 install_rpath : rootlibexecdir,
1647 install_dir : rootlibexecdir)
1649 exe = executable('localectl',
1651 include_directories : includes,
1652 link_with : [libshared],
1653 install_rpath : rootlibexecdir,
1655 public_programs += [exe]
1658 if conf.get('ENABLE_TIMEDATED') == 1
1659 executable('systemd-timedated',
1660 'src/timedate/timedated.c',
1661 include_directories : includes,
1662 link_with : [libshared],
1663 install_rpath : rootlibexecdir,
1665 install_dir : rootlibexecdir)
1667 exe = executable('timedatectl',
1668 'src/timedate/timedatectl.c',
1669 include_directories : includes,
1670 install_rpath : rootlibexecdir,
1671 link_with : [libshared],
1673 public_programs += [exe]
1676 if conf.get('ENABLE_TIMESYNCD') == 1
1677 executable('systemd-timesyncd',
1678 systemd_timesyncd_sources,
1679 include_directories : includes,
1680 link_with : [libshared],
1681 dependencies : [threads,
1683 install_rpath : rootlibexecdir,
1685 install_dir : rootlibexecdir)
1688 if conf.get('ENABLE_MACHINED') == 1
1689 executable('systemd-machined',
1690 systemd_machined_sources,
1691 include_directories : includes,
1692 link_with : [libmachine_core,
1694 install_rpath : rootlibexecdir,
1696 install_dir : rootlibexecdir)
1698 exe = executable('machinectl',
1699 'src/machine/machinectl.c',
1700 include_directories : includes,
1701 link_with : [libshared],
1702 dependencies : [threads,
1705 install_rpath : rootlibexecdir,
1707 install_dir : rootbindir)
1708 public_programs += [exe]
1711 if conf.get('ENABLE_IMPORTD') == 1
1712 executable('systemd-importd',
1713 systemd_importd_sources,
1714 include_directories : includes,
1715 link_with : [libshared],
1716 dependencies : [threads],
1717 install_rpath : rootlibexecdir,
1719 install_dir : rootlibexecdir)
1721 systemd_pull = executable('systemd-pull',
1722 systemd_pull_sources,
1723 include_directories : includes,
1724 link_with : [libshared],
1725 dependencies : [libcurl,
1730 install_rpath : rootlibexecdir,
1732 install_dir : rootlibexecdir)
1734 systemd_import = executable('systemd-import',
1735 systemd_import_sources,
1736 include_directories : includes,
1737 link_with : [libshared],
1738 dependencies : [libcurl,
1742 install_rpath : rootlibexecdir,
1744 install_dir : rootlibexecdir)
1746 systemd_export = executable('systemd-export',
1747 systemd_export_sources,
1748 include_directories : includes,
1749 link_with : [libshared],
1750 dependencies : [libcurl,
1754 install_rpath : rootlibexecdir,
1756 install_dir : rootlibexecdir)
1757 public_programs += [systemd_pull, systemd_import, systemd_export]
1760 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
1761 exe = executable('systemd-journal-upload',
1762 systemd_journal_upload_sources,
1763 include_directories : includes,
1764 link_with : [libshared],
1765 dependencies : [threads,
1770 install_rpath : rootlibexecdir,
1772 install_dir : rootlibexecdir)
1773 public_programs += [exe]
1776 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
1777 s_j_remote = executable('systemd-journal-remote',
1778 systemd_journal_remote_sources,
1779 include_directories : includes,
1780 link_with : [libshared],
1781 dependencies : [threads,
1786 install_rpath : rootlibexecdir,
1788 install_dir : rootlibexecdir)
1790 s_j_gatewayd = executable('systemd-journal-gatewayd',
1791 systemd_journal_gatewayd_sources,
1792 include_directories : includes,
1793 link_with : [libshared],
1794 dependencies : [threads,
1799 install_rpath : rootlibexecdir,
1801 install_dir : rootlibexecdir)
1802 public_programs += [s_j_remote, s_j_gatewayd]
1805 if conf.get('ENABLE_COREDUMP') == 1
1806 executable('systemd-coredump',
1807 systemd_coredump_sources,
1808 include_directories : includes,
1809 link_with : [libshared],
1810 dependencies : [threads,
1815 install_rpath : rootlibexecdir,
1817 install_dir : rootlibexecdir)
1819 exe = executable('coredumpctl',
1820 coredumpctl_sources,
1821 include_directories : includes,
1822 link_with : [libshared],
1823 dependencies : [threads,
1826 install_rpath : rootlibexecdir,
1828 public_programs += [exe]
1831 if conf.get('ENABLE_BINFMT') == 1
1832 exe = executable('systemd-binfmt',
1833 'src/binfmt/binfmt.c',
1834 include_directories : includes,
1835 link_with : [libshared],
1836 install_rpath : rootlibexecdir,
1838 install_dir : rootlibexecdir)
1839 public_programs += [exe]
1841 meson.add_install_script('sh', '-c',
1842 mkdir_p.format(binfmtdir))
1843 meson.add_install_script('sh', '-c',
1844 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1847 if conf.get('ENABLE_VCONSOLE') == 1
1848 executable('systemd-vconsole-setup',
1849 'src/vconsole/vconsole-setup.c',
1850 include_directories : includes,
1851 link_with : [libshared],
1852 install_rpath : rootlibexecdir,
1854 install_dir : rootlibexecdir)
1857 if conf.get('ENABLE_RANDOMSEED') == 1
1858 executable('systemd-random-seed',
1859 'src/random-seed/random-seed.c',
1860 include_directories : includes,
1861 link_with : [libshared],
1862 install_rpath : rootlibexecdir,
1864 install_dir : rootlibexecdir)
1867 if conf.get('ENABLE_FIRSTBOOT') == 1
1868 executable('systemd-firstboot',
1869 'src/firstboot/firstboot.c',
1870 include_directories : includes,
1871 link_with : [libshared],
1872 dependencies : [libcrypt],
1873 install_rpath : rootlibexecdir,
1875 install_dir : rootbindir)
1878 executable('systemd-remount-fs',
1879 'src/remount-fs/remount-fs.c',
1880 'src/core/mount-setup.c',
1881 'src/core/mount-setup.h',
1882 include_directories : includes,
1883 link_with : [libshared],
1884 install_rpath : rootlibexecdir,
1886 install_dir : rootlibexecdir)
1888 executable('systemd-machine-id-setup',
1889 'src/machine-id-setup/machine-id-setup-main.c',
1890 'src/core/machine-id-setup.c',
1891 'src/core/machine-id-setup.h',
1892 include_directories : includes,
1893 link_with : [libshared],
1894 install_rpath : rootlibexecdir,
1896 install_dir : rootbindir)
1898 executable('systemd-fsck',
1900 include_directories : includes,
1901 link_with : [libshared],
1902 install_rpath : rootlibexecdir,
1904 install_dir : rootlibexecdir)
1906 executable('systemd-sleep',
1907 'src/sleep/sleep.c',
1908 include_directories : includes,
1909 link_with : [libshared],
1910 install_rpath : rootlibexecdir,
1912 install_dir : rootlibexecdir)
1914 exe = executable('systemd-sysctl',
1915 'src/sysctl/sysctl.c',
1916 include_directories : includes,
1917 link_with : [libshared],
1918 install_rpath : rootlibexecdir,
1920 install_dir : rootlibexecdir)
1921 public_programs += [exe]
1923 executable('systemd-ac-power',
1924 'src/ac-power/ac-power.c',
1925 include_directories : includes,
1926 link_with : [libshared],
1927 install_rpath : rootlibexecdir,
1929 install_dir : rootlibexecdir)
1931 exe = executable('systemd-detect-virt',
1932 'src/detect-virt/detect-virt.c',
1933 include_directories : includes,
1934 link_with : [libshared],
1935 install_rpath : rootlibexecdir,
1937 public_programs += [exe]
1939 exe = executable('systemd-delta',
1940 'src/delta/delta.c',
1941 include_directories : includes,
1942 link_with : [libshared],
1943 install_rpath : rootlibexecdir,
1945 public_programs += [exe]
1947 exe = executable('systemd-escape',
1948 'src/escape/escape.c',
1949 include_directories : includes,
1950 link_with : [libshared],
1951 install_rpath : rootlibexecdir,
1953 install_dir : rootbindir)
1954 public_programs += [exe]
1956 exe = executable('systemd-notify',
1957 'src/notify/notify.c',
1958 include_directories : includes,
1959 link_with : [libshared],
1960 install_rpath : rootlibexecdir,
1962 install_dir : rootbindir)
1963 public_programs += [exe]
1965 executable('systemd-volatile-root',
1966 'src/volatile-root/volatile-root.c',
1967 include_directories : includes,
1968 link_with : [libshared],
1969 install_rpath : rootlibexecdir,
1971 install_dir : rootlibexecdir)
1973 executable('systemd-cgroups-agent',
1974 'src/cgroups-agent/cgroups-agent.c',
1975 include_directories : includes,
1976 link_with : [libshared],
1977 install_rpath : rootlibexecdir,
1979 install_dir : rootlibexecdir)
1981 exe = executable('systemd-path',
1983 include_directories : includes,
1984 link_with : [libshared],
1985 install_rpath : rootlibexecdir,
1987 public_programs += [exe]
1989 exe = executable('systemd-ask-password',
1990 'src/ask-password/ask-password.c',
1991 include_directories : includes,
1992 link_with : [libshared],
1993 install_rpath : rootlibexecdir,
1995 install_dir : rootbindir)
1996 public_programs += [exe]
1998 executable('systemd-reply-password',
1999 'src/reply-password/reply-password.c',
2000 include_directories : includes,
2001 link_with : [libshared],
2002 install_rpath : rootlibexecdir,
2004 install_dir : rootlibexecdir)
2006 exe = executable('systemd-tty-ask-password-agent',
2007 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2008 include_directories : includes,
2009 link_with : [libshared],
2010 install_rpath : rootlibexecdir,
2012 install_dir : rootbindir)
2013 public_programs += [exe]
2015 exe = executable('systemd-cgls',
2017 include_directories : includes,
2018 link_with : [libshared],
2019 install_rpath : rootlibexecdir,
2021 public_programs += [exe]
2023 exe = executable('systemd-cgtop',
2024 'src/cgtop/cgtop.c',
2025 include_directories : includes,
2026 link_with : [libshared],
2027 install_rpath : rootlibexecdir,
2029 public_programs += [exe]
2031 executable('systemd-initctl',
2032 'src/initctl/initctl.c',
2033 include_directories : includes,
2034 link_with : [libshared],
2035 install_rpath : rootlibexecdir,
2037 install_dir : rootlibexecdir)
2039 exe = executable('systemd-mount',
2040 'src/mount/mount-tool.c',
2041 include_directories : includes,
2042 link_with : [libshared],
2043 install_rpath : rootlibexecdir,
2045 public_programs += [exe]
2047 meson.add_install_script(meson_make_symlink,
2048 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2050 exe = executable('systemd-run',
2052 include_directories : includes,
2053 link_with : [libshared],
2054 install_rpath : rootlibexecdir,
2056 public_programs += [exe]
2058 exe = executable('systemd-stdio-bridge',
2059 'src/stdio-bridge/stdio-bridge.c',
2060 include_directories : includes,
2061 link_with : [libshared],
2062 install_rpath : rootlibexecdir,
2064 public_programs += [exe]
2066 exe = executable('busctl',
2067 'src/busctl/busctl.c',
2068 'src/busctl/busctl-introspect.c',
2069 'src/busctl/busctl-introspect.h',
2070 include_directories : includes,
2071 link_with : [libshared],
2072 install_rpath : rootlibexecdir,
2074 public_programs += [exe]
2076 if conf.get('ENABLE_SYSUSERS') == 1
2077 exe = executable('systemd-sysusers',
2078 'src/sysusers/sysusers.c',
2079 include_directories : includes,
2080 link_with : [libshared],
2081 install_rpath : rootlibexecdir,
2083 install_dir : rootbindir)
2084 public_programs += [exe]
2087 if conf.get('ENABLE_TMPFILES') == 1
2088 exe = executable('systemd-tmpfiles',
2089 'src/tmpfiles/tmpfiles.c',
2090 include_directories : includes,
2091 link_with : [libshared],
2092 dependencies : [libacl],
2093 install_rpath : rootlibexecdir,
2095 install_dir : rootbindir)
2096 public_programs += [exe]
2099 if conf.get('ENABLE_HWDB') == 1
2100 exe = executable('systemd-hwdb',
2102 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2103 include_directories : includes,
2104 link_with : [libudev_internal],
2105 install_rpath : udev_rpath,
2107 install_dir : rootbindir)
2108 public_programs += [exe]
2111 if conf.get('ENABLE_QUOTACHECK') == 1
2112 executable('systemd-quotacheck',
2113 'src/quotacheck/quotacheck.c',
2114 include_directories : includes,
2115 link_with : [libshared],
2116 install_rpath : rootlibexecdir,
2118 install_dir : rootlibexecdir)
2121 exe = executable('systemd-socket-proxyd',
2122 'src/socket-proxy/socket-proxyd.c',
2123 include_directories : includes,
2124 link_with : [libshared],
2125 dependencies : [threads],
2126 install_rpath : rootlibexecdir,
2128 install_dir : rootlibexecdir)
2129 public_programs += [exe]
2131 exe = executable('systemd-udevd',
2132 systemd_udevd_sources,
2133 include_directories : includes,
2134 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2135 link_with : [libudev_core,
2138 dependencies : [threads,
2143 install_rpath : udev_rpath,
2145 install_dir : rootlibexecdir)
2146 public_programs += [exe]
2148 exe = executable('udevadm',
2150 include_directories : includes,
2151 link_with : [libudev_core,
2154 dependencies : [threads,
2159 install_rpath : udev_rpath,
2161 install_dir : rootbindir)
2162 public_programs += [exe]
2164 executable('systemd-shutdown',
2165 systemd_shutdown_sources,
2166 include_directories : includes,
2167 link_with : [libshared],
2168 install_rpath : rootlibexecdir,
2170 install_dir : rootlibexecdir)
2172 executable('systemd-update-done',
2173 'src/update-done/update-done.c',
2174 include_directories : includes,
2175 link_with : [libshared],
2176 install_rpath : rootlibexecdir,
2178 install_dir : rootlibexecdir)
2180 executable('systemd-update-utmp',
2181 'src/update-utmp/update-utmp.c',
2182 include_directories : includes,
2183 link_with : [libshared],
2184 dependencies : [libaudit],
2185 install_rpath : rootlibexecdir,
2187 install_dir : rootlibexecdir)
2189 if conf.get('HAVE_KMOD') == 1
2190 executable('systemd-modules-load',
2191 'src/modules-load/modules-load.c',
2192 include_directories : includes,
2193 link_with : [libshared],
2194 dependencies : [libkmod],
2195 install_rpath : rootlibexecdir,
2197 install_dir : rootlibexecdir)
2199 meson.add_install_script('sh', '-c',
2200 mkdir_p.format(modulesloaddir))
2201 meson.add_install_script('sh', '-c',
2202 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2205 exe = executable('systemd-nspawn',
2206 systemd_nspawn_sources,
2207 'src/core/mount-setup.c', # FIXME: use a variable?
2208 'src/core/mount-setup.h',
2209 'src/core/loopback-setup.c',
2210 'src/core/loopback-setup.h',
2211 include_directories : [includes, include_directories('src/nspawn')],
2212 link_with : [libshared],
2213 dependencies : [libacl,
2217 install_rpath : rootlibexecdir,
2219 public_programs += [exe]
2221 if conf.get('ENABLE_NETWORKD') == 1
2222 executable('systemd-networkd',
2223 systemd_networkd_sources,
2224 include_directories : includes,
2225 link_with : [libnetworkd_core,
2229 dependencies : [threads],
2230 install_rpath : rootlibexecdir,
2232 install_dir : rootlibexecdir)
2234 executable('systemd-networkd-wait-online',
2235 systemd_networkd_wait_online_sources,
2236 include_directories : includes,
2237 link_with : [libnetworkd_core,
2239 install_rpath : rootlibexecdir,
2241 install_dir : rootlibexecdir)
2243 exe = executable('networkctl',
2245 include_directories : includes,
2246 link_with : [libsystemd_network,
2248 install_rpath : rootlibexecdir,
2250 install_dir : rootbindir)
2251 public_programs += [exe]
2253 ############################################################
2255 foreach tuple : tests
2257 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2258 dependencies = tuple[2]
2259 condition = tuple.length() >= 4 ? tuple[3] : ''
2260 type = tuple.length() >= 5 ? tuple[4] : ''
2261 defs = tuple.length() >= 6 ? tuple[5] : []
2262 incs = tuple.length() >= 7 ? tuple[6] : includes
2265 name = sources[0].split('/')[-1].split('.')[0]
2266 if type.startswith('timeout=')
2267 timeout = type.split('=')[1].to_int()
2271 if condition == '' or conf.get(condition) == 1
2275 include_directories : incs,
2276 link_with : link_with,
2277 dependencies : dependencies,
2279 install_rpath : rootlibexecdir,
2280 install : install_tests,
2281 install_dir : join_paths(testsdir, type))
2284 message('@0@ is a manual test'.format(name))
2285 elif type == 'unsafe' and want_tests != 'unsafe'
2286 message('@0@ is an unsafe test'.format(name))
2293 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2297 test_libsystemd_sym = executable(
2298 'test-libsystemd-sym',
2299 test_libsystemd_sym_c,
2300 include_directories : includes,
2301 link_with : [libsystemd],
2302 install : install_tests,
2303 install_dir : testsdir)
2304 test('test-libsystemd-sym',
2305 test_libsystemd_sym)
2307 test_libudev_sym = executable(
2310 include_directories : includes,
2311 c_args : ['-Wno-deprecated-declarations'],
2312 link_with : [libudev],
2313 install : install_tests,
2314 install_dir : testsdir)
2315 test('test-libudev-sym',
2318 ############################################################
2320 make_directive_index_py = find_program('tools/make-directive-index.py')
2321 make_man_index_py = find_program('tools/make-man-index.py')
2322 xml_helper_py = find_program('tools/xml_helper.py')
2323 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2327 subdir('sysusers.d')
2328 subdir('tmpfiles.d')
2333 subdir('shell-completion/bash')
2334 subdir('shell-completion/zsh')
2335 subdir('docs/sysvinit')
2336 subdir('docs/var-log')
2338 # FIXME: figure out if the warning is true:
2339 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2340 install_subdir('factory/etc',
2341 install_dir : factorydir)
2344 install_data('xorg/50-systemd-user.sh',
2345 install_dir : xinitrcdir)
2346 install_data('system-preset/90-systemd.preset',
2347 install_dir : systempresetdir)
2348 install_data('modprobe.d/systemd.conf',
2349 install_dir : modprobedir)
2350 install_data('README',
2357 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2358 install_dir : docdir)
2360 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2361 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2363 ############################################################
2365 meson_check_help = find_program('tools/meson-check-help.sh')
2367 foreach exec : public_programs
2368 name = exec.full_path().split('/')[-1]
2369 test('check-help-' + name,
2371 args : [exec.full_path()])
2374 ############################################################
2377 all_files = run_command(
2379 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2382 all_files = files(all_files.stdout().split())
2387 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2391 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2395 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2398 command : [meson_git_contrib_sh])
2402 git_head = run_command(
2404 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2405 'rev-parse', 'HEAD']).stdout().strip()
2406 git_head_short = run_command(
2408 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2409 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2413 command : ['git', 'archive',
2414 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2416 '--prefix', 'systemd-@0@/'.format(git_head),
2420 ############################################################
2423 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2425 'prefix: @0@'.format(prefixdir),
2426 'rootprefix: @0@'.format(rootprefixdir),
2427 'sysconf dir: @0@'.format(sysconfdir),
2428 'includedir: @0@'.format(includedir),
2429 'lib dir: @0@'.format(libdir),
2430 'rootlib dir: @0@'.format(rootlibdir),
2431 'SysV init scripts: @0@'.format(sysvinit_path),
2432 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2433 'PAM modules dir: @0@'.format(pamlibdir),
2434 'PAM configuration dir: @0@'.format(pamconfdir),
2435 'RPM macros dir: @0@'.format(rpmmacrosdir),
2436 'modprobe.d dir: @0@'.format(modprobedir),
2437 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2438 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2439 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2440 'bash completions dir: @0@'.format(bashcompletiondir),
2441 'zsh completions dir: @0@'.format(zshcompletiondir),
2442 'extra start script: @0@'.format(get_option('rc-local')),
2443 'extra stop script: @0@'.format(get_option('halt-local')),
2444 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2445 get_option('debug-tty')),
2446 'TTY GID: @0@'.format(tty_gid),
2447 'maximum system UID: @0@'.format(system_uid_max),
2448 'maximum system GID: @0@'.format(system_gid_max),
2449 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2450 'render group access mode: @0@'.format(get_option('group-render-mode')),
2451 'certificate root: @0@'.format(get_option('certificate-root')),
2452 'support URL: @0@'.format(support_url),
2453 'nobody user name: @0@'.format(get_option('nobody-user')),
2454 'nobody group name: @0@'.format(get_option('nobody-group')),
2455 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2456 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2458 'default DNSSEC mode: @0@'.format(default_dnssec),
2459 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2460 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2462 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2463 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2465 'default DNS servers: @0@'.format(alt_dns_servers),
2466 'default NTP servers: @0@'.format(alt_ntp_servers)]
2468 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2469 '@@0@'.format(time_epoch)).stdout().strip()
2471 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2474 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2475 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2476 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2478 if conf.get('ENABLE_EFI') == 1
2480 'efi arch: @0@'.format(efi_arch)]
2484 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2485 'EFI CC @0@'.format(efi_cc),
2486 'EFI libdir: @0@'.format(efi_libdir),
2487 'EFI ldsdir: @0@'.format(efi_ldsdir),
2488 'EFI includedir: @0@'.format(efi_incdir)]
2541 ['legacy pkla', install_polkit_pkla],
2543 ['gnu-efi', have_gnu_efi],
2549 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
2552 ['man pages', want_man],
2553 ['html pages', want_html],
2554 ['man page indices', want_man and have_lxml],
2555 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
2560 ['adm group', get_option('adm-group')],
2561 ['wheel group', get_option('wheel-group')],
2564 ['debug mmap cache'],
2567 cond = tuple.get(1, '')
2569 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2570 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2571 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
2576 missing += [tuple[0]]
2582 'enabled features: @0@'.format(', '.join(found)),
2584 'disabled features: @0@'.format(', '.join(missing)),
2586 message('\n '.join(status))