1 project('systemd', 'c',
10 meson_version : '>= 0.40',
13 libsystemd_version = '0.19.0'
14 libudev_version = '1.6.6'
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 rootprefixdir = get_option('rootprefix')
41 if get_option('split-usr')
42 conf.set('HAVE_SPLIT_USR', true)
43 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
45 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
48 sysvinit_path = get_option('sysvinit-path')
49 sysvrcnd_path = get_option('sysvrcnd-path')
50 if sysvinit_path != '' or sysvrcnd_path != ''
51 conf.set('HAVE_SYSV_COMPAT', true,
52 description : 'SysV init scripts and rcN.d links are supported')
53 m4_defines += ['-DHAVE_SYSV_COMPAT']
56 # join_paths ignore the preceding arguments if an absolute component is
57 # encountered, so this should canonicalize various paths when they are
58 # absolute or relative.
59 prefixdir = get_option('prefix')
60 if not prefixdir.startswith('/')
61 error('Prefix is not absolute: "@0@"'.format(prefixdir))
63 bindir = join_paths(prefixdir, get_option('bindir'))
64 libdir = join_paths(prefixdir, get_option('libdir'))
65 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
66 includedir = join_paths(prefixdir, get_option('includedir'))
67 datadir = join_paths(prefixdir, get_option('datadir'))
68 localstatedir = join_paths('/', get_option('localstatedir'))
70 rootbindir = join_paths(rootprefixdir, 'bin')
71 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
73 rootlibdir = get_option('rootlibdir')
75 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
78 # Dirs of external packages
79 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
80 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
81 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
82 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
83 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
84 varlogdir = join_paths(localstatedir, 'log')
85 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
86 rpmmacrosdir = get_option('rpmmacrosdir')
87 modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
90 pkgdatadir = join_paths(datadir, 'systemd')
91 environmentdir = join_paths(prefixdir, 'lib/environment.d')
92 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
93 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
94 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
95 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
96 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
97 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
98 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
99 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
100 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
101 pkgincludedir = join_paths(includedir, 'systemd')
102 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
103 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
104 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
105 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
106 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
107 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
108 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
109 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
110 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
111 udevhomedir = udevlibexecdir
112 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
113 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
114 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
115 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
116 factorydir = join_paths(datadir, 'factory')
117 docdir = join_paths(datadir, 'doc/systemd')
118 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
119 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
120 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
121 catalogstatedir = join_paths(systemdstatedir, 'catalog')
122 randomseeddir = join_paths(localstatedir, 'lib/systemd')
124 dbuspolicydir = get_option('dbuspolicydir')
125 if dbuspolicydir == ''
126 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
129 dbussessionservicedir = get_option('dbussessionservicedir')
130 if dbussessionservicedir == ''
131 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
134 dbussystemservicedir = get_option('dbussystemservicedir')
135 if dbussystemservicedir == ''
136 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
139 pamlibdir = get_option('pamlibdir')
141 pamlibdir = join_paths(rootlibdir, 'security')
144 pamconfdir = get_option('pamconfdir')
146 pamconfdir = join_paths(sysconfdir, 'pam.d')
149 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
150 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
151 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
152 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
153 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
154 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
155 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
156 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
157 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
158 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
159 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
160 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
161 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
162 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
163 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
164 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
165 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
166 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
167 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
168 conf.set_quoted('ROOTPREFIX', rootprefixdir)
169 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
170 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
171 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
172 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
173 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
174 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
175 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
176 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
177 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
178 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
179 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
180 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
181 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
182 conf.set_quoted('LIBDIR', libdir)
183 conf.set_quoted('ROOTLIBDIR', rootlibdir)
184 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
185 conf.set_quoted('BOOTLIBDIR', bootlibdir)
186 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
187 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
188 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
189 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
190 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
191 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
193 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
194 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
196 substs.set('prefix', prefixdir)
197 substs.set('exec_prefix', prefixdir)
198 substs.set('libdir', libdir)
199 substs.set('rootlibdir', rootlibdir)
200 substs.set('includedir', includedir)
201 substs.set('pkgsysconfdir', pkgsysconfdir)
202 substs.set('bindir', bindir)
203 substs.set('rootbindir', rootbindir)
204 substs.set('rootlibexecdir', rootlibexecdir)
205 substs.set('systemunitdir', systemunitdir)
206 substs.set('userunitdir', userunitdir)
207 substs.set('systempresetdir', systempresetdir)
208 substs.set('userpresetdir', userpresetdir)
209 substs.set('udevhwdbdir', udevhwdbdir)
210 substs.set('udevrulesdir', udevrulesdir)
211 substs.set('udevlibexecdir', udevlibexecdir)
212 substs.set('catalogdir', catalogdir)
213 substs.set('tmpfilesdir', tmpfilesdir)
214 substs.set('sysusersdir', sysusersdir)
215 substs.set('sysctldir', sysctldir)
216 substs.set('binfmtdir', binfmtdir)
217 substs.set('modulesloaddir', modulesloaddir)
218 substs.set('systemgeneratordir', systemgeneratordir)
219 substs.set('usergeneratordir', usergeneratordir)
220 substs.set('systemenvgeneratordir', systemenvgeneratordir)
221 substs.set('userenvgeneratordir', userenvgeneratordir)
222 substs.set('systemshutdowndir', systemshutdowndir)
223 substs.set('systemsleepdir', systemsleepdir)
224 substs.set('VARLOGDIR', varlogdir)
225 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
226 substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
227 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
228 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
229 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
230 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
231 substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
233 #####################################################################
235 cc = meson.get_compiler('c')
236 pkgconfig = import('pkgconfig')
237 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
239 cxx = find_program('c++', required : false)
241 # Used only for tests
245 foreach arg : ['-Wextra',
248 '-Wmissing-include-dirs',
249 '-Wold-style-definition',
252 '-Wdeclaration-after-statement',
254 '-Wsuggest-attribute=noreturn',
255 '-Werror=missing-prototypes',
256 '-Werror=implicit-function-declaration',
257 '-Werror=missing-declarations',
258 '-Werror=return-type',
259 '-Werror=incompatible-pointer-types',
261 '-Wstrict-prototypes',
263 '-Wmissing-noreturn',
266 '-Wstrict-aliasing=2',
273 '-fdiagnostics-show-option',
274 '-fno-strict-aliasing',
275 '-fvisibility=hidden',
277 '-fstack-protector-strong',
279 '--param=ssp-buffer-size=4',
281 if cc.has_argument(arg)
282 add_project_arguments(arg, language : 'c')
286 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
287 # arguments, just emits a warnings. So test for the "positive" version instead.
288 foreach arg : ['unused-parameter',
289 'missing-field-initializers',
292 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
294 if cc.has_argument('-W' + arg)
295 add_project_arguments('-Wno-' + arg, language : 'c')
301 #include <inttypes.h>
302 typedef uint64_t usec_t;
303 usec_t now(clockid_t clock);
308 ', name : '-Werror=shadow with local shadowing')
309 add_project_arguments('-Werror=shadow', language : 'c')
312 if cc.get_id() == 'clang'
313 foreach arg : ['-Wno-typedef-redefinition',
314 '-Wno-gnu-variable-sized-type-not-at-end',
316 if cc.has_argument(arg,
317 name : '@0@ is supported'.format(arg))
318 add_project_arguments(arg, language : 'c')
323 link_test_c = files('tools/meson-link-test.c')
325 # --as-needed and --no-undefined are provided by meson by default,
326 # run mesonconf to see what is enabled
327 foreach arg : ['-Wl,-z,relro',
332 have = run_command(check_compilation_sh,
333 cc.cmd_array(), '-x', 'c', arg,
334 '-include', link_test_c).returncode() == 0
335 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
337 add_project_link_arguments(arg, language : 'c')
341 if get_option('buildtype') != 'debug'
342 foreach arg : ['-ffunction-sections',
344 if cc.has_argument(arg,
345 name : '@0@ is supported'.format(arg))
346 add_project_arguments(arg, language : 'c')
350 foreach arg : ['-Wl,--gc-sections']
351 have = run_command(check_compilation_sh,
352 cc.cmd_array(), '-x', 'c', arg,
353 '-include', link_test_c).returncode() == 0
354 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
356 add_project_link_arguments(arg, language : 'c')
361 cpp = ' '.join(cc.cmd_array()) + ' -E'
363 #####################################################################
364 # compilation result tests
366 conf.set('_GNU_SOURCE', true)
367 conf.set('__SANE_USERSPACE_TYPES__', true)
369 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
370 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
371 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
372 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
373 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
374 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
375 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
379 #include <linux/ethtool.h>
380 #include <linux/fib_rules.h>
382 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
384 foreach decl : ['char16_t',
387 'struct ethtool_link_settings',
388 'struct fib_rule_uid_range',
391 # We get -1 if the size cannot be determined
392 have = cc.sizeof(decl, prefix : decl_headers) > 0
393 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
396 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
397 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
398 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
399 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
400 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
401 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
402 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
403 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
404 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
405 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
406 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
407 # if_tunnel.h is buggy and cannot be included on its own
408 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
409 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
410 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
411 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
412 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
413 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
414 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
415 ['NDA_IFINDEX', 'linux/neighbour.h'],
416 ['IFA_FLAGS', 'linux/if_addr.h'],
417 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
418 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
420 prefix = decl.length() > 2 ? decl[2] : ''
421 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
422 conf.set10('HAVE_' + decl[0], have)
426 foreach ident : ['secure_getenv', '__secure_getenv']
427 if not skip and cc.has_function(ident)
428 conf.set('HAVE_' + ident.to_upper(), true)
434 ['memfd_create', '''#include <sys/memfd.h>'''],
435 ['gettid', '''#include <sys/types.h>'''],
436 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
437 ['name_to_handle_at', '''#define _GNU_SOURCE
438 #include <sys/types.h>
439 #include <sys/stat.h>
440 #include <fcntl.h>'''],
441 ['setns', '''#define _GNU_SOURCE
442 #include <sched.h>'''],
443 ['renameat2', '''#include <stdio.h>'''],
444 ['kcmp', '''#include <linux/kcmp.h>'''],
445 ['keyctl', '''#include <sys/types.h>
446 #include <keyutils.h>'''],
447 ['copy_file_range', '''#include <sys/syscall.h>
448 #include <unistd.h>'''],
449 ['bpf', '''#include <sys/syscall.h>
450 #include <unistd.h>'''],
451 ['explicit_bzero' , '''#include <string.h>'''],
454 have = cc.has_function(ident[0], prefix : ident[1])
455 conf.set10('HAVE_' + ident[0].to_upper(), have)
458 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
459 conf.set('USE_SYS_RANDOM_H', true)
460 conf.set10('HAVE_GETRANDOM', true)
462 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
463 conf.set10('HAVE_GETRANDOM', have)
466 #####################################################################
468 sed = find_program('sed')
469 grep = find_program('grep')
470 awk = find_program('awk')
471 m4 = find_program('m4')
472 stat = find_program('stat')
473 git = find_program('git', required : false)
475 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
476 mkdir_p = 'mkdir -p $DESTDIR/@0@'
477 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
478 splash_bmp = files('test/splash.bmp')
480 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
481 # /usr/sbin, /sbin, and fall back to the default from middle column.
482 progs = [['telinit', '/lib/sysvinit/telinit'],
483 ['quotaon', '/usr/sbin/quotaon' ],
484 ['quotacheck', '/usr/sbin/quotacheck' ],
485 ['kill', '/usr/bin/kill' ],
486 ['kmod', '/usr/bin/kmod' ],
487 ['kexec', '/usr/sbin/kexec' ],
488 ['sulogin', '/usr/sbin/sulogin' ],
489 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
490 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
491 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
492 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
495 path = get_option(prog[0] + '-path')
497 message('Using @1@ for @0@'.format(prog[0], path))
499 exe = find_program(prog[0],
500 '/usr/sbin/' + prog[0],
503 path = exe.found() ? exe.path() : prog[1]
505 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
506 conf.set_quoted(name, path)
507 substs.set(name, path)
510 if run_command('ln', '--relative', '--help').returncode() != 0
511 error('ln does not support --relative')
514 ############################################################
516 gperf = find_program('gperf')
518 gperf_test_format = '''
520 const char * in_word_set(const char *, @0@);
523 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
524 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
525 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
526 if cc.compiles(gperf_test)
527 gperf_len_type = 'size_t'
529 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
530 if cc.compiles(gperf_test)
531 gperf_len_type = 'unsigned'
533 error('unable to determine gperf len type')
536 message('gperf len type is @0@'.format(gperf_len_type))
537 conf.set('GPERF_LEN_TYPE', gperf_len_type,
538 description : 'The type of gperf "len" parameter')
540 ############################################################
542 if not cc.has_header('sys/capability.h')
543 error('POSIX caps headers not found')
545 foreach header : ['linux/btrfs.h',
547 'linux/vm_sockets.h',
549 'valgrind/memcheck.h',
550 'valgrind/valgrind.h',
553 conf.set('HAVE_' + header.underscorify().to_upper(),
554 cc.has_header(header))
557 ############################################################
559 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
560 conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
561 gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
563 default_hierarchy = get_option('default-hierarchy')
564 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
565 description : 'default cgroup hierarchy as string')
566 if default_hierarchy == 'legacy'
567 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
568 elif default_hierarchy == 'hybrid'
569 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
571 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
574 time_epoch = get_option('time-epoch')
577 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
579 time_epoch = time_epoch.to_int()
580 conf.set('TIME_EPOCH', time_epoch)
582 system_uid_max = get_option('system-uid-max')
583 if system_uid_max == ''
584 system_uid_max = run_command(
586 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
587 '/etc/login.defs').stdout()
589 system_uid_max = system_uid_max.to_int()
590 conf.set('SYSTEM_UID_MAX', system_uid_max)
591 substs.set('systemuidmax', system_uid_max)
592 message('maximum system UID is @0@'.format(system_uid_max))
594 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
595 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
597 system_gid_max = get_option('system-gid-max')
598 if system_gid_max == ''
599 system_gid_max = run_command(
601 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
602 '/etc/login.defs').stdout()
604 system_gid_max = system_gid_max.to_int()
605 conf.set('SYSTEM_GID_MAX', system_gid_max)
606 substs.set('systemgidmax', system_gid_max)
607 message('maximum system GID is @0@'.format(system_gid_max))
609 tty_gid = get_option('tty-gid')
610 conf.set('TTY_GID', tty_gid)
611 substs.set('TTY_GID', tty_gid)
613 if get_option('adm-group')
614 m4_defines += ['-DENABLE_ADM_GROUP']
617 if get_option('wheel-group')
618 m4_defines += ['-DENABLE_WHEEL_GROUP']
621 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
623 kill_user_processes = get_option('default-kill-user-processes')
624 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
625 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
627 dns_servers = get_option('dns-servers')
628 conf.set_quoted('DNS_SERVERS', dns_servers)
629 substs.set('DNS_SERVERS', dns_servers)
631 ntp_servers = get_option('ntp-servers')
632 conf.set_quoted('NTP_SERVERS', ntp_servers)
633 substs.set('NTP_SERVERS', ntp_servers)
635 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
637 substs.set('SUSHELL', get_option('debug-shell'))
638 substs.set('DEBUGTTY', get_option('debug-tty'))
640 debug = get_option('debug')
642 foreach name : debug.split(',')
644 conf.set('ENABLE_DEBUG_HASHMAP', true)
645 elif name == 'mmap-cache'
646 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
648 message('unknown debug option "@0@", ignoring'.format(name))
653 #####################################################################
655 threads = dependency('threads')
656 librt = cc.find_library('rt')
657 libm = cc.find_library('m')
658 libdl = cc.find_library('dl')
659 libcrypt = cc.find_library('crypt')
661 libcap = dependency('libcap', required : false)
662 if not libcap.found()
663 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
664 libcap = cc.find_library('cap')
667 libmount = dependency('mount',
670 want_seccomp = get_option('seccomp')
671 if want_seccomp != 'false'
672 libseccomp = dependency('libseccomp',
673 version : '>= 2.3.1',
674 required : want_seccomp == 'true')
675 if libseccomp.found()
676 conf.set('HAVE_SECCOMP', true)
677 m4_defines += ['-DHAVE_SECCOMP']
683 want_selinux = get_option('selinux')
684 if want_selinux != 'false'
685 libselinux = dependency('libselinux',
686 version : '>= 2.1.9',
687 required : want_selinux == 'true')
688 if libselinux.found()
689 conf.set('HAVE_SELINUX', true)
690 m4_defines += ['-DHAVE_SELINUX']
696 want_apparmor = get_option('apparmor')
697 if want_apparmor != 'false'
698 libapparmor = dependency('libapparmor',
699 required : want_apparmor == 'true')
700 if libapparmor.found()
701 conf.set('HAVE_APPARMOR', true)
702 m4_defines += ['-DHAVE_APPARMOR']
708 smack_run_label = get_option('smack-run-label')
709 if smack_run_label != ''
710 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
711 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
714 want_polkit = get_option('polkit')
715 install_polkit = false
716 install_polkit_pkla = false
717 if want_polkit != 'false'
718 conf.set('ENABLE_POLKIT', true)
719 install_polkit = true
721 libpolkit = dependency('polkit-gobject-1',
723 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
724 message('Old polkit detected, will install pkla files')
725 install_polkit_pkla = true
729 want_acl = get_option('acl')
730 if want_acl != 'false'
731 libacl = cc.find_library('acl', required : want_acl == 'true')
733 conf.set('HAVE_ACL', true)
734 m4_defines += ['-DHAVE_ACL']
740 want_audit = get_option('audit')
741 if want_audit != 'false'
742 libaudit = dependency('audit', required : want_audit == 'true')
743 conf.set('HAVE_AUDIT', libaudit.found())
748 want_blkid = get_option('blkid')
749 if want_blkid != 'false'
750 libblkid = dependency('blkid', required : want_blkid == 'true')
751 conf.set('HAVE_BLKID', libblkid.found())
756 want_kmod = get_option('kmod')
757 if want_kmod != 'false'
758 libkmod = dependency('libkmod',
760 required : want_kmod == 'true')
761 conf.set('HAVE_KMOD', libkmod.found())
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 if libpam.found() and libpam_misc.found()
771 conf.set('HAVE_PAM', true)
772 m4_defines += ['-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 if libmicrohttpd.found()
785 conf.set('HAVE_MICROHTTPD', true)
786 m4_defines += ['-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 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
802 want_libcurl = get_option('libcurl')
803 if want_libcurl != 'false'
804 libcurl = dependency('libcurl',
805 version : '>= 7.32.0',
806 required : want_libcurl == 'true')
808 conf.set('HAVE_LIBCURL', true)
809 m4_defines += ['-DHAVE_LIBCURL']
815 want_libidn = get_option('libidn')
816 want_libidn2 = get_option('libidn2')
817 if want_libidn == 'true' and want_libidn2 == 'true'
818 error('libidn and libidn2 cannot be requested simultaneously')
821 if want_libidn != 'false' and want_libidn2 != 'true'
822 libidn = dependency('libidn',
823 required : want_libidn == 'true')
825 conf.set('HAVE_LIBIDN', true)
826 m4_defines += ['-DHAVE_LIBIDN']
831 if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
832 # libidn is used for both libidn and libidn2 objects
833 libidn = dependency('libidn2',
834 required : want_libidn2 == 'true')
836 conf.set('HAVE_LIBIDN2', true)
837 m4_defines += ['-DHAVE_LIBIDN2']
841 want_libiptc = get_option('libiptc')
842 if want_libiptc != 'false'
843 libiptc = dependency('libiptc',
844 required : want_libiptc == 'true')
846 conf.set('HAVE_LIBIPTC', true)
847 m4_defines += ['-DHAVE_LIBIPTC']
853 want_qrencode = get_option('qrencode')
854 if want_qrencode != 'false'
855 libqrencode = dependency('libqrencode',
856 required : want_qrencode == 'true')
857 conf.set('HAVE_QRENCODE', libqrencode.found())
862 want_gcrypt = get_option('gcrypt')
863 if want_gcrypt != 'false'
864 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
865 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
867 have_deps = libgcrypt.found() and libgpg_error.found()
868 conf.set('HAVE_GCRYPT', have_deps)
870 # link to neither of the libs if one is not found
879 want_gnutls = get_option('gnutls')
880 if want_gnutls != 'false'
881 libgnutls = dependency('gnutls',
882 version : '>= 3.1.4',
883 required : want_gnutls == 'true')
884 conf.set('HAVE_GNUTLS', libgnutls.found())
889 want_elfutils = get_option('elfutils')
890 if want_elfutils != 'false'
891 libdw = dependency('libdw',
892 required : want_elfutils == 'true')
893 conf.set('HAVE_ELFUTILS', libdw.found())
898 want_zlib = get_option('zlib')
899 if want_zlib != 'false'
900 libz = dependency('zlib',
901 required : want_zlib == 'true')
902 conf.set('HAVE_ZLIB', libz.found())
907 want_bzip2 = get_option('bzip2')
908 if want_bzip2 != 'false'
909 libbzip2 = cc.find_library('bz2',
910 required : want_bzip2 == 'true')
911 conf.set('HAVE_BZIP2', libbzip2.found())
916 want_xz = get_option('xz')
917 if want_xz != 'false'
918 libxz = dependency('liblzma',
919 required : want_xz == 'true')
920 conf.set('HAVE_XZ', libxz.found())
925 want_lz4 = get_option('lz4')
926 if want_lz4 != 'false'
927 liblz4 = dependency('liblz4',
928 required : want_lz4 == 'true')
929 conf.set('HAVE_LZ4', liblz4.found())
934 want_xkbcommon = get_option('xkbcommon')
935 if want_xkbcommon != 'false'
936 libxkbcommon = dependency('xkbcommon',
937 version : '>= 0.3.0',
938 required : want_xkbcommon == 'true')
939 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
944 want_glib = get_option('glib')
945 if want_glib != 'false'
946 libglib = dependency('glib-2.0',
947 version : '>= 2.22.0',
948 required : want_glib == 'true')
949 libgobject = dependency('gobject-2.0',
950 version : '>= 2.22.0',
951 required : want_glib == 'true')
952 libgio = dependency('gio-2.0',
953 required : want_glib == 'true')
954 have = libglib.found() and libgobject.found() and libgio.found()
955 conf.set('HAVE_GLIB', have)
962 want_dbus = get_option('dbus')
963 if want_dbus != 'false'
964 libdbus = dependency('dbus-1',
965 version : '>= 1.3.2',
966 required : want_dbus == 'true')
967 conf.set('HAVE_DBUS', libdbus.found())
972 default_dnssec = get_option('default-dnssec')
973 if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
974 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
975 default_dnssec = 'no'
977 conf.set('DEFAULT_DNSSEC_MODE',
978 'DNSSEC_' + default_dnssec.underscorify().to_upper())
979 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
981 want_importd = get_option('importd')
982 if want_importd != 'false'
983 have_deps = (conf.get('HAVE_LIBCURL', false) and
984 conf.get('HAVE_ZLIB', false) and
985 conf.get('HAVE_BZIP2', false) and
986 conf.get('HAVE_XZ', false) and
987 conf.get('HAVE_GCRYPT', false))
988 conf.set('ENABLE_IMPORTD', have_deps)
989 if want_importd == 'true' and not have_deps
990 error('importd support was requested, but dependencies are not available')
994 want_remote = get_option('remote')
995 if want_remote != 'false'
996 have_deps = [conf.get('HAVE_MICROHTTPD', false),
997 conf.get('HAVE_LIBCURL', false)]
998 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
999 # it's possible to build one without the other. Complain only if
1000 # support was explictly requested. The auxiliary files like sysusers
1001 # config should be installed when any of the programs are built.
1002 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1003 error('remote support was requested, but dependencies are not available')
1005 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
1008 foreach pair : [['utmp', 'HAVE_UTMP'],
1009 ['hibernate', 'ENABLE_HIBERNATE'],
1010 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1011 ['binfmt', 'ENABLE_BINFMT'],
1012 ['coredump', 'ENABLE_COREDUMP'],
1013 ['resolve', 'ENABLE_RESOLVED'],
1014 ['logind', 'ENABLE_LOGIND'],
1015 ['hostnamed', 'ENABLE_HOSTNAMED'],
1016 ['localed', 'ENABLE_LOCALED'],
1017 ['machined', 'ENABLE_MACHINED'],
1018 ['networkd', 'ENABLE_NETWORKD'],
1019 ['timedated', 'ENABLE_TIMEDATED'],
1020 ['timesyncd', 'ENABLE_TIMESYNCD'],
1021 ['myhostname', 'HAVE_MYHOSTNAME'],
1022 ['firstboot', 'ENABLE_FIRSTBOOT'],
1023 ['randomseed', 'ENABLE_RANDOMSEED'],
1024 ['backlight', 'ENABLE_BACKLIGHT'],
1025 ['vconsole', 'ENABLE_VCONSOLE'],
1026 ['quotacheck', 'ENABLE_QUOTACHECK'],
1027 ['sysusers', 'ENABLE_SYSUSERS'],
1028 ['tmpfiles', 'ENABLE_TMPFILES'],
1029 ['hwdb', 'ENABLE_HWDB'],
1030 ['rfkill', 'ENABLE_RFKILL'],
1031 ['ldconfig', 'ENABLE_LDCONFIG'],
1032 ['efi', 'ENABLE_EFI'],
1033 ['tpm', 'ENABLE_TPM'],
1034 ['ima', 'HAVE_IMA'],
1035 ['smack', 'HAVE_SMACK'],
1036 ['gshadow', 'ENABLE_GSHADOW'],
1037 ['idn', 'ENABLE_IDN'],
1038 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
1041 if get_option(pair[0])
1042 conf.set(pair[1], true)
1043 m4_defines += ['-D' + pair[1]]
1047 want_tests = get_option('tests')
1048 install_tests = get_option('install-tests')
1051 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1053 #####################################################################
1055 if get_option('efi')
1056 efi_arch = host_machine.cpu_family()
1058 if efi_arch == 'x86'
1059 EFI_MACHINE_TYPE_NAME = 'ia32'
1060 gnu_efi_arch = 'ia32'
1061 elif efi_arch == 'x86_64'
1062 EFI_MACHINE_TYPE_NAME = 'x64'
1063 gnu_efi_arch = 'x86_64'
1064 elif efi_arch == 'arm'
1065 EFI_MACHINE_TYPE_NAME = 'arm'
1066 gnu_efi_arch = 'arm'
1067 elif efi_arch == 'aarch64'
1068 EFI_MACHINE_TYPE_NAME = 'aa64'
1069 gnu_efi_arch = 'aarch64'
1071 EFI_MACHINE_TYPE_NAME = ''
1075 conf.set('ENABLE_EFI', true)
1076 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1078 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1081 #####################################################################
1083 config_h = configure_file(
1084 output : 'config.h',
1085 configuration : conf)
1087 includes = include_directories('src/basic',
1097 'src/libsystemd/sd-bus',
1098 'src/libsystemd/sd-device',
1099 'src/libsystemd/sd-hwdb',
1100 'src/libsystemd/sd-id128',
1101 'src/libsystemd/sd-netlink',
1102 'src/libsystemd/sd-network',
1103 'src/libsystemd-network',
1107 add_project_arguments('-include', 'config.h', language : 'c')
1109 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1110 'src/shared/gcrypt-util.c')
1114 subdir('src/systemd')
1116 subdir('src/libsystemd')
1117 subdir('src/libsystemd-network')
1118 subdir('src/journal')
1121 libjournal_core = static_library(
1123 libjournal_core_sources,
1125 include_directories : includes,
1128 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1129 libsystemd = shared_library(
1131 libsystemd_internal_sources,
1132 journal_internal_sources,
1133 version : libsystemd_version,
1134 include_directories : includes,
1135 link_args : ['-shared',
1136 '-Wl,--version-script=' + libsystemd_sym_path],
1137 link_with : [libbasic],
1138 dependencies : [threads,
1143 link_depends : libsystemd_sym,
1145 install_dir : rootlibdir)
1147 ############################################################
1149 # binaries that have --help and are intended for use by humans,
1150 # usually, but not always, installed in /bin.
1151 public_programs = []
1153 subdir('src/libudev')
1154 subdir('src/shared')
1157 subdir('src/network')
1159 subdir('src/analyze')
1160 subdir('src/journal-remote')
1161 subdir('src/coredump')
1162 subdir('src/hostname')
1163 subdir('src/import')
1164 subdir('src/kernel-install')
1165 subdir('src/locale')
1166 subdir('src/machine')
1167 subdir('src/nspawn')
1168 subdir('src/resolve')
1169 subdir('src/timedate')
1170 subdir('src/timesync')
1171 subdir('src/vconsole')
1172 subdir('src/sulogin-shell')
1173 subdir('src/boot/efi')
1178 ############################################################
1180 # only static linking apart from libdl, to make sure that the
1181 # module is linked to all libraries that it uses.
1182 test_dlopen = executable(
1185 include_directories : includes,
1186 link_with : [libbasic],
1187 dependencies : [libdl])
1189 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1190 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1191 ['mymachines', 'ENABLE_MACHINED'],
1192 ['resolve', 'ENABLE_RESOLVED']]
1194 condition = tuple[1] == '' or conf.get(tuple[1], false)
1198 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1199 version_script_arg = join_paths(meson.current_source_dir(), sym)
1201 nss = shared_library(
1203 'src/nss-@0@/nss-@0@.c'.format(module),
1205 include_directories : includes,
1206 link_args : ['-shared',
1207 '-Wl,--version-script=' + version_script_arg,
1209 link_with : [libsystemd_internal,
1211 dependencies : [threads,
1215 install_dir : rootlibdir)
1217 # We cannot use shared_module because it does not support version suffix.
1218 # Unfortunately shared_library insists on creating the symlink…
1219 meson.add_install_script('sh', '-c',
1220 'rm $DESTDIR@0@/libnss_@1@.so'
1221 .format(rootlibdir, module))
1223 test('dlopen-nss_' + module,
1225 args : [nss.full_path()]) # path to dlopen must include a slash
1229 ############################################################
1231 executable('systemd',
1233 include_directories : includes,
1234 link_with : [libcore,
1236 dependencies : [threads,
1242 install_rpath : rootlibexecdir,
1244 install_dir : rootlibexecdir)
1246 exe = executable('systemd-analyze',
1247 systemd_analyze_sources,
1248 include_directories : includes,
1249 link_with : [libcore,
1251 dependencies : [threads,
1257 install_rpath : rootlibexecdir,
1259 public_programs += [exe]
1261 executable('systemd-journald',
1262 systemd_journald_sources,
1263 include_directories : includes,
1264 link_with : [libjournal_core,
1266 dependencies : [threads,
1270 install_rpath : rootlibexecdir,
1272 install_dir : rootlibexecdir)
1274 exe = executable('systemd-cat',
1275 systemd_cat_sources,
1276 include_directories : includes,
1277 link_with : [libjournal_core,
1279 dependencies : [threads],
1280 install_rpath : rootlibexecdir,
1282 public_programs += [exe]
1284 exe = executable('journalctl',
1286 include_directories : includes,
1287 link_with : [libshared],
1288 dependencies : [threads,
1292 install_rpath : rootlibexecdir,
1294 install_dir : rootbindir)
1295 public_programs += [exe]
1297 executable('systemd-getty-generator',
1298 'src/getty-generator/getty-generator.c',
1299 include_directories : includes,
1300 link_with : [libshared],
1301 install_rpath : rootlibexecdir,
1303 install_dir : systemgeneratordir)
1305 executable('systemd-debug-generator',
1306 'src/debug-generator/debug-generator.c',
1307 include_directories : includes,
1308 link_with : [libshared],
1309 install_rpath : rootlibexecdir,
1311 install_dir : systemgeneratordir)
1313 executable('systemd-fstab-generator',
1314 'src/fstab-generator/fstab-generator.c',
1315 'src/core/mount-setup.c',
1316 include_directories : includes,
1317 link_with : [libshared],
1318 install_rpath : rootlibexecdir,
1320 install_dir : systemgeneratordir)
1322 if conf.get('ENABLE_ENVIRONMENT_D', false)
1323 executable('30-systemd-environment-d-generator',
1324 'src/environment-d-generator/environment-d-generator.c',
1325 include_directories : includes,
1326 link_with : [libshared],
1327 install_rpath : rootlibexecdir,
1329 install_dir : userenvgeneratordir)
1331 meson.add_install_script(meson_make_symlink,
1332 join_paths(sysconfdir, 'environment'),
1333 join_paths(environmentdir, '99-environment.conf'))
1336 if conf.get('ENABLE_HIBERNATE', false)
1337 executable('systemd-hibernate-resume-generator',
1338 'src/hibernate-resume/hibernate-resume-generator.c',
1339 include_directories : includes,
1340 link_with : [libshared],
1341 install_rpath : rootlibexecdir,
1343 install_dir : systemgeneratordir)
1345 executable('systemd-hibernate-resume',
1346 'src/hibernate-resume/hibernate-resume.c',
1347 include_directories : includes,
1348 link_with : [libshared],
1349 install_rpath : rootlibexecdir,
1351 install_dir : rootlibexecdir)
1354 if conf.get('HAVE_BLKID', false)
1355 executable('systemd-gpt-auto-generator',
1356 'src/gpt-auto-generator/gpt-auto-generator.c',
1357 'src/basic/blkid-util.h',
1358 include_directories : includes,
1359 link_with : [libshared],
1360 dependencies : libblkid,
1361 install_rpath : rootlibexecdir,
1363 install_dir : systemgeneratordir)
1365 exe = executable('systemd-dissect',
1366 'src/dissect/dissect.c',
1367 include_directories : includes,
1368 link_with : [libshared],
1369 install_rpath : rootlibexecdir,
1371 install_dir : rootlibexecdir)
1372 public_programs += [exe]
1375 if conf.get('ENABLE_RESOLVED', false)
1376 executable('systemd-resolved',
1377 systemd_resolved_sources,
1378 gcrypt_util_sources,
1379 include_directories : includes,
1380 link_with : [libshared],
1381 dependencies : [threads,
1386 install_rpath : rootlibexecdir,
1388 install_dir : rootlibexecdir)
1390 exe = executable('systemd-resolve',
1391 systemd_resolve_sources,
1392 gcrypt_util_sources,
1393 include_directories : includes,
1394 link_with : [libshared],
1395 dependencies : [threads,
1400 install_rpath : rootlibexecdir,
1402 public_programs += [exe]
1405 if conf.get('ENABLE_LOGIND', false)
1406 executable('systemd-logind',
1407 systemd_logind_sources,
1408 include_directories : includes,
1409 link_with : [liblogind_core,
1411 dependencies : [threads,
1413 install_rpath : rootlibexecdir,
1415 install_dir : rootlibexecdir)
1417 exe = executable('loginctl',
1419 include_directories : includes,
1420 link_with : [libshared],
1421 dependencies : [threads,
1424 install_rpath : rootlibexecdir,
1426 install_dir : rootbindir)
1427 public_programs += [exe]
1429 exe = executable('systemd-inhibit',
1430 'src/login/inhibit.c',
1431 include_directories : includes,
1432 link_with : [libshared],
1433 install_rpath : rootlibexecdir,
1435 install_dir : rootbindir)
1436 public_programs += [exe]
1438 if conf.get('HAVE_PAM', false)
1439 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1440 pam_systemd = shared_library(
1444 include_directories : includes,
1445 link_args : ['-shared',
1446 '-Wl,--version-script=' + version_script_arg],
1447 link_with : [libsystemd_internal,
1449 dependencies : [threads,
1452 link_depends : pam_systemd_sym,
1454 install_dir : pamlibdir)
1456 test('dlopen-pam_systemd',
1458 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1462 if conf.get('HAVE_PAM', false)
1463 executable('systemd-user-sessions',
1464 'src/user-sessions/user-sessions.c',
1465 include_directories : includes,
1466 link_with : [libshared],
1467 install_rpath : rootlibexecdir,
1469 install_dir : rootlibexecdir)
1472 if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1473 exe = executable('bootctl',
1474 'src/boot/bootctl.c',
1475 include_directories : includes,
1476 link_with : [libshared],
1477 dependencies : [libblkid],
1478 install_rpath : rootlibexecdir,
1480 public_programs += [exe]
1483 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1484 include_directories : includes,
1485 link_with : [libshared],
1486 dependencies : [threads],
1487 install_rpath : rootlibexecdir,
1489 public_programs += [exe]
1491 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1492 include_directories : includes,
1493 link_with : [libshared],
1494 dependencies : [threads,
1499 install_rpath : rootlibexecdir,
1501 install_dir : rootbindir)
1502 public_programs += [exe]
1504 if conf.get('ENABLE_BACKLIGHT', false)
1505 executable('systemd-backlight',
1506 'src/backlight/backlight.c',
1507 include_directories : includes,
1508 link_with : [libshared],
1509 install_rpath : rootlibexecdir,
1511 install_dir : rootlibexecdir)
1514 if conf.get('ENABLE_RFKILL', false)
1515 executable('systemd-rfkill',
1516 'src/rfkill/rfkill.c',
1517 include_directories : includes,
1518 link_with : [libshared],
1519 install_rpath : rootlibexecdir,
1521 install_dir : rootlibexecdir)
1524 executable('systemd-system-update-generator',
1525 'src/system-update-generator/system-update-generator.c',
1526 include_directories : includes,
1527 link_with : [libshared],
1528 install_rpath : rootlibexecdir,
1530 install_dir : systemgeneratordir)
1532 if conf.get('HAVE_LIBCRYPTSETUP', false)
1533 executable('systemd-cryptsetup',
1534 'src/cryptsetup/cryptsetup.c',
1535 include_directories : includes,
1536 link_with : [libshared],
1537 dependencies : [libcryptsetup],
1538 install_rpath : rootlibexecdir,
1540 install_dir : rootlibexecdir)
1542 executable('systemd-cryptsetup-generator',
1543 'src/cryptsetup/cryptsetup-generator.c',
1544 include_directories : includes,
1545 link_with : [libshared],
1546 dependencies : [libcryptsetup],
1547 install_rpath : rootlibexecdir,
1549 install_dir : systemgeneratordir)
1551 executable('systemd-veritysetup',
1552 'src/veritysetup/veritysetup.c',
1553 include_directories : includes,
1554 link_with : [libshared],
1555 dependencies : [libcryptsetup],
1556 install_rpath : rootlibexecdir,
1558 install_dir : rootlibexecdir)
1560 executable('systemd-veritysetup-generator',
1561 'src/veritysetup/veritysetup-generator.c',
1562 include_directories : includes,
1563 link_with : [libshared],
1564 dependencies : [libcryptsetup],
1565 install_rpath : rootlibexecdir,
1567 install_dir : systemgeneratordir)
1570 if conf.get('HAVE_SYSV_COMPAT', false)
1571 executable('systemd-sysv-generator',
1572 'src/sysv-generator/sysv-generator.c',
1573 include_directories : includes,
1574 link_with : [libshared],
1575 install_rpath : rootlibexecdir,
1577 install_dir : systemgeneratordir)
1579 executable('systemd-rc-local-generator',
1580 'src/rc-local-generator/rc-local-generator.c',
1581 include_directories : includes,
1582 link_with : [libshared],
1583 install_rpath : rootlibexecdir,
1585 install_dir : systemgeneratordir)
1588 if conf.get('ENABLE_HOSTNAMED', false)
1589 executable('systemd-hostnamed',
1590 'src/hostname/hostnamed.c',
1591 include_directories : includes,
1592 link_with : [libshared],
1593 install_rpath : rootlibexecdir,
1595 install_dir : rootlibexecdir)
1597 exe = executable('hostnamectl',
1598 'src/hostname/hostnamectl.c',
1599 include_directories : includes,
1600 link_with : [libshared],
1601 install_rpath : rootlibexecdir,
1603 public_programs += [exe]
1606 if conf.get('ENABLE_LOCALED', false)
1607 if conf.get('HAVE_XKBCOMMON', false)
1608 # logind will load libxkbcommon.so dynamically on its own
1614 executable('systemd-localed',
1615 systemd_localed_sources,
1616 include_directories : includes,
1617 link_with : [libshared],
1618 dependencies : deps,
1619 install_rpath : rootlibexecdir,
1621 install_dir : rootlibexecdir)
1623 exe = executable('localectl',
1625 include_directories : includes,
1626 link_with : [libshared],
1627 install_rpath : rootlibexecdir,
1629 public_programs += [exe]
1632 if conf.get('ENABLE_TIMEDATED', false)
1633 executable('systemd-timedated',
1634 'src/timedate/timedated.c',
1635 include_directories : includes,
1636 link_with : [libshared],
1637 install_rpath : rootlibexecdir,
1639 install_dir : rootlibexecdir)
1641 exe = executable('timedatectl',
1642 'src/timedate/timedatectl.c',
1643 include_directories : includes,
1644 install_rpath : rootlibexecdir,
1645 link_with : [libshared],
1647 public_programs += [exe]
1650 if conf.get('ENABLE_TIMESYNCD', false)
1651 executable('systemd-timesyncd',
1652 systemd_timesyncd_sources,
1653 include_directories : includes,
1654 link_with : [libshared],
1655 dependencies : [threads,
1657 install_rpath : rootlibexecdir,
1659 install_dir : rootlibexecdir)
1662 if conf.get('ENABLE_MACHINED', false)
1663 executable('systemd-machined',
1664 systemd_machined_sources,
1665 include_directories : includes,
1666 link_with : [libmachine_core,
1668 install_rpath : rootlibexecdir,
1670 install_dir : rootlibexecdir)
1672 exe = executable('machinectl',
1673 'src/machine/machinectl.c',
1674 include_directories : includes,
1675 link_with : [libshared],
1676 dependencies : [threads,
1679 install_rpath : rootlibexecdir,
1681 install_dir : rootbindir)
1682 public_programs += [exe]
1685 if conf.get('ENABLE_IMPORTD', false)
1686 executable('systemd-importd',
1687 systemd_importd_sources,
1688 include_directories : includes,
1689 link_with : [libshared],
1690 dependencies : [threads],
1691 install_rpath : rootlibexecdir,
1693 install_dir : rootlibexecdir)
1695 systemd_pull = executable('systemd-pull',
1696 systemd_pull_sources,
1697 include_directories : includes,
1698 link_with : [libshared],
1699 dependencies : [libcurl,
1704 install_rpath : rootlibexecdir,
1706 install_dir : rootlibexecdir)
1708 systemd_import = executable('systemd-import',
1709 systemd_import_sources,
1710 include_directories : includes,
1711 link_with : [libshared],
1712 dependencies : [libcurl,
1716 install_rpath : rootlibexecdir,
1718 install_dir : rootlibexecdir)
1720 systemd_export = executable('systemd-export',
1721 systemd_export_sources,
1722 include_directories : includes,
1723 link_with : [libshared],
1724 dependencies : [libcurl,
1728 install_rpath : rootlibexecdir,
1730 install_dir : rootlibexecdir)
1731 public_programs += [systemd_pull, systemd_import, systemd_export]
1734 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1735 exe = executable('systemd-journal-upload',
1736 systemd_journal_upload_sources,
1737 include_directories : includes,
1738 link_with : [libshared],
1739 dependencies : [threads,
1744 install_rpath : rootlibexecdir,
1746 install_dir : rootlibexecdir)
1747 public_programs += [exe]
1750 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1751 s_j_remote = executable('systemd-journal-remote',
1752 systemd_journal_remote_sources,
1753 include_directories : includes,
1754 link_with : [libshared],
1755 dependencies : [threads,
1760 install_rpath : rootlibexecdir,
1762 install_dir : rootlibexecdir)
1764 s_j_gatewayd = executable('systemd-journal-gatewayd',
1765 systemd_journal_gatewayd_sources,
1766 include_directories : includes,
1767 link_with : [libshared],
1768 dependencies : [threads,
1773 install_rpath : rootlibexecdir,
1775 install_dir : rootlibexecdir)
1776 public_programs += [s_j_remote, s_j_gatewayd]
1779 if conf.get('ENABLE_COREDUMP', false)
1780 executable('systemd-coredump',
1781 systemd_coredump_sources,
1782 include_directories : includes,
1783 link_with : [libshared],
1784 dependencies : [threads,
1789 install_rpath : rootlibexecdir,
1791 install_dir : rootlibexecdir)
1793 exe = executable('coredumpctl',
1794 coredumpctl_sources,
1795 include_directories : includes,
1796 link_with : [libshared],
1797 dependencies : [threads,
1800 install_rpath : rootlibexecdir,
1802 public_programs += [exe]
1805 if conf.get('ENABLE_BINFMT', false)
1806 exe = executable('systemd-binfmt',
1807 'src/binfmt/binfmt.c',
1808 include_directories : includes,
1809 link_with : [libshared],
1810 install_rpath : rootlibexecdir,
1812 install_dir : rootlibexecdir)
1813 public_programs += [exe]
1815 meson.add_install_script('sh', '-c',
1816 mkdir_p.format(binfmtdir))
1817 meson.add_install_script('sh', '-c',
1818 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1821 if conf.get('ENABLE_VCONSOLE', false)
1822 executable('systemd-vconsole-setup',
1823 'src/vconsole/vconsole-setup.c',
1824 include_directories : includes,
1825 link_with : [libshared],
1826 install_rpath : rootlibexecdir,
1828 install_dir : rootlibexecdir)
1831 if conf.get('ENABLE_RANDOMSEED', false)
1832 executable('systemd-random-seed',
1833 'src/random-seed/random-seed.c',
1834 include_directories : includes,
1835 link_with : [libshared],
1836 install_rpath : rootlibexecdir,
1838 install_dir : rootlibexecdir)
1841 if conf.get('ENABLE_FIRSTBOOT', false)
1842 executable('systemd-firstboot',
1843 'src/firstboot/firstboot.c',
1844 include_directories : includes,
1845 link_with : [libshared],
1846 dependencies : [libcrypt],
1847 install_rpath : rootlibexecdir,
1849 install_dir : rootbindir)
1852 executable('systemd-remount-fs',
1853 'src/remount-fs/remount-fs.c',
1854 'src/core/mount-setup.c',
1855 'src/core/mount-setup.h',
1856 include_directories : includes,
1857 link_with : [libshared],
1858 install_rpath : rootlibexecdir,
1860 install_dir : rootlibexecdir)
1862 executable('systemd-machine-id-setup',
1863 'src/machine-id-setup/machine-id-setup-main.c',
1864 'src/core/machine-id-setup.c',
1865 'src/core/machine-id-setup.h',
1866 include_directories : includes,
1867 link_with : [libshared],
1868 install_rpath : rootlibexecdir,
1870 install_dir : rootbindir)
1872 executable('systemd-fsck',
1874 include_directories : includes,
1875 link_with : [libshared],
1876 install_rpath : rootlibexecdir,
1878 install_dir : rootlibexecdir)
1880 executable('systemd-sleep',
1881 'src/sleep/sleep.c',
1882 include_directories : includes,
1883 link_with : [libshared],
1884 install_rpath : rootlibexecdir,
1886 install_dir : rootlibexecdir)
1888 exe = executable('systemd-sysctl',
1889 'src/sysctl/sysctl.c',
1890 include_directories : includes,
1891 link_with : [libshared],
1892 install_rpath : rootlibexecdir,
1894 install_dir : rootlibexecdir)
1895 public_programs += [exe]
1897 executable('systemd-ac-power',
1898 'src/ac-power/ac-power.c',
1899 include_directories : includes,
1900 link_with : [libshared],
1901 install_rpath : rootlibexecdir,
1903 install_dir : rootlibexecdir)
1905 exe = executable('systemd-detect-virt',
1906 'src/detect-virt/detect-virt.c',
1907 include_directories : includes,
1908 link_with : [libshared],
1909 install_rpath : rootlibexecdir,
1911 public_programs += [exe]
1913 exe = executable('systemd-delta',
1914 'src/delta/delta.c',
1915 include_directories : includes,
1916 link_with : [libshared],
1917 install_rpath : rootlibexecdir,
1919 public_programs += [exe]
1921 exe = executable('systemd-escape',
1922 'src/escape/escape.c',
1923 include_directories : includes,
1924 link_with : [libshared],
1925 install_rpath : rootlibexecdir,
1927 install_dir : rootbindir)
1928 public_programs += [exe]
1930 exe = executable('systemd-notify',
1931 'src/notify/notify.c',
1932 include_directories : includes,
1933 link_with : [libshared],
1934 install_rpath : rootlibexecdir,
1936 install_dir : rootbindir)
1937 public_programs += [exe]
1939 executable('systemd-volatile-root',
1940 'src/volatile-root/volatile-root.c',
1941 include_directories : includes,
1942 link_with : [libshared],
1943 install_rpath : rootlibexecdir,
1945 install_dir : rootlibexecdir)
1947 executable('systemd-cgroups-agent',
1948 'src/cgroups-agent/cgroups-agent.c',
1949 include_directories : includes,
1950 link_with : [libshared],
1951 install_rpath : rootlibexecdir,
1953 install_dir : rootlibexecdir)
1955 exe = executable('systemd-path',
1957 include_directories : includes,
1958 link_with : [libshared],
1959 install_rpath : rootlibexecdir,
1961 public_programs += [exe]
1963 exe = executable('systemd-ask-password',
1964 'src/ask-password/ask-password.c',
1965 include_directories : includes,
1966 link_with : [libshared],
1967 install_rpath : rootlibexecdir,
1969 install_dir : rootbindir)
1970 public_programs += [exe]
1972 executable('systemd-reply-password',
1973 'src/reply-password/reply-password.c',
1974 include_directories : includes,
1975 link_with : [libshared],
1976 install_rpath : rootlibexecdir,
1978 install_dir : rootlibexecdir)
1980 exe = executable('systemd-tty-ask-password-agent',
1981 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1982 include_directories : includes,
1983 link_with : [libshared],
1984 install_rpath : rootlibexecdir,
1986 install_dir : rootbindir)
1987 public_programs += [exe]
1989 exe = executable('systemd-cgls',
1991 include_directories : includes,
1992 link_with : [libshared],
1993 install_rpath : rootlibexecdir,
1995 public_programs += [exe]
1997 exe = executable('systemd-cgtop',
1998 'src/cgtop/cgtop.c',
1999 include_directories : includes,
2000 link_with : [libshared],
2001 install_rpath : rootlibexecdir,
2003 public_programs += [exe]
2005 executable('systemd-initctl',
2006 'src/initctl/initctl.c',
2007 include_directories : includes,
2008 link_with : [libshared],
2009 install_rpath : rootlibexecdir,
2011 install_dir : rootlibexecdir)
2013 exe = executable('systemd-mount',
2014 'src/mount/mount-tool.c',
2015 include_directories : includes,
2016 link_with : [libshared],
2017 install_rpath : rootlibexecdir,
2019 public_programs += [exe]
2021 meson.add_install_script(meson_make_symlink,
2022 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2024 exe = executable('systemd-run',
2026 include_directories : includes,
2027 link_with : [libshared],
2028 install_rpath : rootlibexecdir,
2030 public_programs += [exe]
2032 exe = executable('systemd-stdio-bridge',
2033 'src/stdio-bridge/stdio-bridge.c',
2034 include_directories : includes,
2035 link_with : [libshared],
2036 install_rpath : rootlibexecdir,
2038 public_programs += [exe]
2040 exe = executable('busctl',
2041 'src/busctl/busctl.c',
2042 'src/busctl/busctl-introspect.c',
2043 'src/busctl/busctl-introspect.h',
2044 include_directories : includes,
2045 link_with : [libshared],
2046 install_rpath : rootlibexecdir,
2048 public_programs += [exe]
2050 if conf.get('ENABLE_SYSUSERS', false)
2051 exe = executable('systemd-sysusers',
2052 'src/sysusers/sysusers.c',
2053 include_directories : includes,
2054 link_with : [libshared],
2055 install_rpath : rootlibexecdir,
2057 install_dir : rootbindir)
2058 public_programs += [exe]
2061 if conf.get('ENABLE_TMPFILES', false)
2062 exe = executable('systemd-tmpfiles',
2063 'src/tmpfiles/tmpfiles.c',
2064 include_directories : includes,
2065 link_with : [libshared],
2066 dependencies : [libacl],
2067 install_rpath : rootlibexecdir,
2069 install_dir : rootbindir)
2070 public_programs += [exe]
2073 if conf.get('ENABLE_HWDB', false)
2074 exe = executable('systemd-hwdb',
2076 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2077 include_directories : includes,
2078 link_with : [libudev_internal],
2079 install_rpath : udev_rpath,
2081 install_dir : rootbindir)
2082 public_programs += [exe]
2085 if conf.get('ENABLE_QUOTACHECK', false)
2086 executable('systemd-quotacheck',
2087 'src/quotacheck/quotacheck.c',
2088 include_directories : includes,
2089 link_with : [libshared],
2090 install_rpath : rootlibexecdir,
2092 install_dir : rootlibexecdir)
2095 exe = executable('systemd-socket-proxyd',
2096 'src/socket-proxy/socket-proxyd.c',
2097 include_directories : includes,
2098 link_with : [libshared],
2099 dependencies : [threads],
2100 install_rpath : rootlibexecdir,
2102 install_dir : rootlibexecdir)
2103 public_programs += [exe]
2105 exe = executable('systemd-udevd',
2106 systemd_udevd_sources,
2107 include_directories : includes,
2108 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2109 link_with : [libudev_core,
2112 dependencies : [threads,
2117 install_rpath : udev_rpath,
2119 install_dir : rootlibexecdir)
2120 public_programs += [exe]
2122 exe = executable('udevadm',
2124 include_directories : includes,
2125 link_with : [libudev_core,
2128 dependencies : [threads,
2133 install_rpath : udev_rpath,
2135 install_dir : rootbindir)
2136 public_programs += [exe]
2138 executable('systemd-shutdown',
2139 systemd_shutdown_sources,
2140 include_directories : includes,
2141 link_with : [libshared],
2142 install_rpath : rootlibexecdir,
2144 install_dir : rootlibexecdir)
2146 executable('systemd-update-done',
2147 'src/update-done/update-done.c',
2148 include_directories : includes,
2149 link_with : [libshared],
2150 install_rpath : rootlibexecdir,
2152 install_dir : rootlibexecdir)
2154 executable('systemd-update-utmp',
2155 'src/update-utmp/update-utmp.c',
2156 include_directories : includes,
2157 link_with : [libshared],
2158 dependencies : [libaudit],
2159 install_rpath : rootlibexecdir,
2161 install_dir : rootlibexecdir)
2163 if conf.get('HAVE_KMOD', false)
2164 executable('systemd-modules-load',
2165 'src/modules-load/modules-load.c',
2166 include_directories : includes,
2167 link_with : [libshared],
2168 dependencies : [libkmod],
2169 install_rpath : rootlibexecdir,
2171 install_dir : rootlibexecdir)
2173 meson.add_install_script('sh', '-c',
2174 mkdir_p.format(modulesloaddir))
2175 meson.add_install_script('sh', '-c',
2176 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2179 exe = executable('systemd-nspawn',
2180 systemd_nspawn_sources,
2181 'src/core/mount-setup.c', # FIXME: use a variable?
2182 'src/core/mount-setup.h',
2183 'src/core/loopback-setup.c',
2184 'src/core/loopback-setup.h',
2185 include_directories : [includes, include_directories('src/nspawn')],
2186 link_with : [libshared],
2187 dependencies : [libacl,
2191 install_rpath : rootlibexecdir,
2193 public_programs += [exe]
2195 if conf.get('ENABLE_NETWORKD', false)
2196 executable('systemd-networkd',
2197 systemd_networkd_sources,
2198 include_directories : includes,
2199 link_with : [libnetworkd_core,
2203 dependencies : [threads],
2204 install_rpath : rootlibexecdir,
2206 install_dir : rootlibexecdir)
2208 executable('systemd-networkd-wait-online',
2209 systemd_networkd_wait_online_sources,
2210 include_directories : includes,
2211 link_with : [libnetworkd_core,
2213 install_rpath : rootlibexecdir,
2215 install_dir : rootlibexecdir)
2217 exe = executable('networkctl',
2219 include_directories : includes,
2220 link_with : [libsystemd_network,
2222 install_rpath : rootlibexecdir,
2224 install_dir : rootbindir)
2225 public_programs += [exe]
2227 ############################################################
2229 foreach tuple : tests
2231 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2232 dependencies = tuple[2]
2233 condition = tuple.length() >= 4 ? tuple[3] : ''
2234 type = tuple.length() >= 5 ? tuple[4] : ''
2235 defs = tuple.length() >= 6 ? tuple[5] : []
2236 incs = tuple.length() >= 7 ? tuple[6] : includes
2239 name = sources[0].split('/')[-1].split('.')[0]
2240 if type.startswith('timeout=')
2241 timeout = type.split('=')[1].to_int()
2245 if condition == '' or conf.get(condition, false)
2249 include_directories : incs,
2250 link_with : link_with,
2251 dependencies : dependencies,
2253 install_rpath : rootlibexecdir,
2254 install : install_tests,
2255 install_dir : join_paths(testsdir, type))
2258 message('@0@ is a manual test'.format(name))
2259 elif type == 'unsafe' and want_tests != 'unsafe'
2260 message('@0@ is an unsafe test'.format(name))
2267 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2271 test_libsystemd_sym = executable(
2272 'test-libsystemd-sym',
2273 test_libsystemd_sym_c,
2274 include_directories : includes,
2275 link_with : [libsystemd],
2276 install : install_tests,
2277 install_dir : testsdir)
2278 test('test-libsystemd-sym',
2279 test_libsystemd_sym)
2281 test_libudev_sym = executable(
2284 include_directories : includes,
2285 c_args : ['-Wno-deprecated-declarations'],
2286 link_with : [libudev],
2287 install : install_tests,
2288 install_dir : testsdir)
2289 test('test-libudev-sym',
2292 ############################################################
2294 make_directive_index_py = find_program('tools/make-directive-index.py')
2295 make_man_index_py = find_program('tools/make-man-index.py')
2296 xml_helper_py = find_program('tools/xml_helper.py')
2297 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2301 subdir('sysusers.d')
2302 subdir('tmpfiles.d')
2307 subdir('shell-completion/bash')
2308 subdir('shell-completion/zsh')
2309 subdir('docs/sysvinit')
2310 subdir('docs/var-log')
2312 # FIXME: figure out if the warning is true:
2313 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2314 install_subdir('factory/etc',
2315 install_dir : factorydir)
2318 install_data('xorg/50-systemd-user.sh',
2319 install_dir : xinitrcdir)
2320 install_data('system-preset/90-systemd.preset',
2321 install_dir : systempresetdir)
2322 install_data('modprobe.d/systemd.conf',
2323 install_dir : modprobedir)
2324 install_data('README',
2331 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2332 install_dir : docdir)
2334 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2335 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2337 ############################################################
2339 meson_check_help = find_program('tools/meson-check-help.sh')
2341 foreach exec : public_programs
2342 name = exec.full_path().split('/')[-1]
2343 test('check-help-' + name,
2345 args : [exec.full_path()])
2348 ############################################################
2351 all_files = run_command(
2353 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2356 all_files = files(all_files.stdout().split())
2361 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2365 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2369 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2372 command : [meson_git_contrib_sh])
2376 git_head = run_command(
2378 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2379 'rev-parse', 'HEAD']).stdout().strip()
2380 git_head_short = run_command(
2382 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2383 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2387 command : ['git', 'archive',
2388 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2390 '--prefix', 'systemd-@0@/'.format(git_head),
2394 ############################################################
2397 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2399 'prefix: @0@'.format(prefixdir),
2400 'rootprefix: @0@'.format(rootprefixdir),
2401 'sysconf dir: @0@'.format(sysconfdir),
2402 'includedir: @0@'.format(includedir),
2403 'lib dir: @0@'.format(libdir),
2404 'rootlib dir: @0@'.format(rootlibdir),
2405 'SysV init scripts: @0@'.format(sysvinit_path),
2406 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2407 'PAM modules dir: @0@'.format(pamlibdir),
2408 'PAM configuration dir: @0@'.format(pamconfdir),
2409 'RPM macros dir: @0@'.format(rpmmacrosdir),
2410 'modprobe.d dir: @0@'.format(modprobedir),
2411 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2412 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2413 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2414 'bash completions dir: @0@'.format(bashcompletiondir),
2415 'zsh completions dir: @0@'.format(zshcompletiondir),
2416 'extra start script: @0@'.format(get_option('rc-local')),
2417 'extra stop script: @0@'.format(get_option('halt-local')),
2418 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2419 get_option('debug-tty')),
2420 'TTY GID: @0@'.format(tty_gid),
2421 'maximum system UID: @0@'.format(system_uid_max),
2422 'maximum system GID: @0@'.format(system_gid_max),
2423 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2424 'certificate root: @0@'.format(get_option('certificate-root')),
2425 'support URL: @0@'.format(support_url),
2426 'nobody user name: @0@'.format(get_option('nobody-user')),
2427 'nobody group name: @0@'.format(get_option('nobody-group')),
2428 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2429 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2431 'default DNSSEC mode: @0@'.format(default_dnssec),
2432 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2433 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2435 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2436 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2438 'default DNS servers: @0@'.format(alt_dns_servers),
2439 'default NTP servers: @0@'.format(alt_ntp_servers)]
2441 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2442 '@@0@'.format(time_epoch)).stdout().strip()
2444 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2447 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2448 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2449 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2451 if conf.get('ENABLE_EFI', false)
2453 'efi arch: @0@'.format(efi_arch)]
2457 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2458 'EFI CC @0@'.format(efi_cc),
2459 'EFI libdir: @0@'.format(efi_libdir),
2460 'EFI ldsdir: @0@'.format(efi_ldsdir),
2461 'EFI includedir: @0@'.format(efi_incdir)]
2514 ['legacy pkla', install_polkit_pkla],
2516 ['gnu-efi', have_gnu_efi],
2522 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2525 ['man pages', want_man],
2526 ['html pages', want_html],
2527 ['man page indices', want_man and have_lxml],
2528 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2533 ['adm group', get_option('adm-group')],
2534 ['wheel group', get_option('wheel-group')],
2537 ['debug mmap cache'],
2540 cond = tuple.get(1, '')
2542 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2543 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2544 cond = conf.get(ident1, false) or conf.get(ident2, false)
2549 missing += [tuple[0]]
2555 'enabled features: @0@'.format(', '.join(found)),
2557 'disabled features: @0@'.format(', '.join(missing)),
2559 message('\n '.join(status))