1 project('systemd', 'c',
10 meson_version : '>= 0.40',
13 # We need the same data in three different formats, ugh!
14 # Also, for hysterical reasons, we use different variable
15 # names, sometimes. Not all variables are included in every
17 conf = configuration_data()
18 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
19 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
21 substs = configuration_data()
22 substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
23 substs.set('PACKAGE_VERSION', meson.project_version())
27 #####################################################################
29 rootprefixdir = get_option('rootprefix')
30 if get_option('split-usr')
31 conf.set('HAVE_SPLIT_USR', true)
32 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
34 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
37 sysvinit_path = get_option('sysvinit-path')
38 sysvrcnd_path = get_option('sysvrcnd-path')
39 if sysvinit_path != '' or sysvrcnd_path != ''
40 conf.set('HAVE_SYSV_COMPAT', true,
41 description : 'SysV init scripts and rcN.d links are supported')
42 m4_defines += ['-DHAVE_SYSV_COMPAT']
45 # join_paths ignore the preceding arguments if an absolute component is
46 # encountered, so this should canonicalize various paths when they are
47 # absolute or relative.
48 prefixdir = get_option('prefix')
49 if not prefixdir.startswith('/')
50 error('Prefix is not absolute: "@0@"'.format(prefixdir))
52 bindir = join_paths(prefixdir, get_option('bindir'))
53 libdir = join_paths(prefixdir, get_option('libdir'))
54 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
55 includedir = join_paths(prefixdir, get_option('includedir'))
56 datadir = join_paths(prefixdir, get_option('datadir'))
57 localstatedir = join_paths('/', get_option('localstatedir'))
59 rootbindir = join_paths(rootprefixdir, 'bin')
60 rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
62 rootlibdir = get_option('rootlibdir')
64 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
67 # Dirs of external packages
68 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
69 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
70 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
71 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
72 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
73 varlogdir = join_paths(localstatedir, 'log')
74 xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
75 rpmmacrosdir = get_option('rpmmacrosdir')
78 pkgdatadir = join_paths(datadir, 'systemd')
79 environmentdir = join_paths(prefixdir, 'lib/environment.d')
80 pkgsysconfdir = join_paths(sysconfdir, 'systemd')
81 userunitdir = join_paths(prefixdir, 'lib/systemd/user')
82 userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
83 tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
84 sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
85 sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
86 binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
87 modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
88 networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
89 pkgincludedir = join_paths(includedir, 'systemd')
90 systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
91 usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
92 systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
93 userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
94 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
95 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
96 systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
97 systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
98 udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
99 udevhomedir = udevlibexecdir
100 udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
101 udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
102 catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
103 kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
104 factorydir = join_paths(datadir, 'factory')
105 docdir = join_paths(datadir, 'doc/systemd')
106 bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
107 testsdir = join_paths(prefixdir, 'lib/systemd/tests')
108 systemdstatedir = join_paths(localstatedir, 'lib/systemd')
109 catalogstatedir = join_paths(systemdstatedir, 'catalog')
110 randomseeddir = join_paths(localstatedir, 'lib/systemd')
112 dbuspolicydir = get_option('dbuspolicydir')
113 if dbuspolicydir == ''
114 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
117 dbussessionservicedir = get_option('dbussessionservicedir')
118 if dbussessionservicedir == ''
119 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
122 dbussystemservicedir = get_option('dbussystemservicedir')
123 if dbussystemservicedir == ''
124 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
127 pamlibdir = get_option('pamlibdir')
129 pamlibdir = join_paths(rootlibdir, 'security')
132 pamconfdir = get_option('pamconfdir')
134 pamconfdir = join_paths(sysconfdir, 'pam.d')
137 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
138 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
139 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
140 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
141 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
142 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
143 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
144 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
145 conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
146 conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
147 conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
148 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
149 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
150 conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
151 conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
152 conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
153 conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
154 conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
155 conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
156 conf.set_quoted('ROOTPREFIX', rootprefixdir)
157 conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
158 conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
159 conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
160 conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
161 conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
162 conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
163 conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
164 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
165 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
166 conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
167 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
168 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
169 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
170 conf.set_quoted('LIBDIR', libdir)
171 conf.set_quoted('ROOTLIBDIR', rootlibdir)
172 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
173 conf.set_quoted('BOOTLIBDIR', bootlibdir)
174 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
175 conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
176 conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
177 conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
178 conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
179 conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
181 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
182 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
184 substs.set('prefix', prefixdir)
185 substs.set('exec_prefix', prefixdir)
186 substs.set('libdir', libdir)
187 substs.set('rootlibdir', rootlibdir)
188 substs.set('includedir', includedir)
189 substs.set('pkgsysconfdir', pkgsysconfdir)
190 substs.set('bindir', bindir)
191 substs.set('rootbindir', rootbindir)
192 substs.set('rootlibexecdir', rootlibexecdir)
193 substs.set('systemunitdir', systemunitdir)
194 substs.set('userunitdir', userunitdir)
195 substs.set('systempresetdir', systempresetdir)
196 substs.set('userpresetdir', userpresetdir)
197 substs.set('udevhwdbdir', udevhwdbdir)
198 substs.set('udevrulesdir', udevrulesdir)
199 substs.set('udevlibexecdir', udevlibexecdir)
200 substs.set('catalogdir', catalogdir)
201 substs.set('tmpfilesdir', tmpfilesdir)
202 substs.set('sysusersdir', sysusersdir)
203 substs.set('sysctldir', sysctldir)
204 substs.set('binfmtdir', binfmtdir)
205 substs.set('modulesloaddir', modulesloaddir)
206 substs.set('systemgeneratordir', systemgeneratordir)
207 substs.set('usergeneratordir', usergeneratordir)
208 substs.set('systemenvgeneratordir', systemenvgeneratordir)
209 substs.set('userenvgeneratordir', userenvgeneratordir)
210 substs.set('systemshutdowndir', systemshutdowndir)
211 substs.set('systemsleepdir', systemsleepdir)
212 substs.set('VARLOGDIR', varlogdir)
213 substs.set('CERTIFICATEROOT', get_option('certificate-root'))
214 substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
215 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
216 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
217 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
218 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
219 substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
221 #####################################################################
223 cc = meson.get_compiler('c')
224 pkgconfig = import('pkgconfig')
225 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
227 cxx = find_program('c++', required : false)
229 # Used only for tests
233 foreach arg : ['-Wextra',
236 '-Wmissing-include-dirs',
237 '-Wold-style-definition',
240 '-Wdeclaration-after-statement',
242 '-Wsuggest-attribute=noreturn',
243 '-Werror=missing-prototypes',
244 '-Werror=implicit-function-declaration',
245 '-Werror=missing-declarations',
246 '-Werror=return-type',
247 '-Werror=incompatible-pointer-types',
249 '-Wstrict-prototypes',
251 '-Wmissing-noreturn',
254 '-Wstrict-aliasing=2',
261 '-fdiagnostics-show-option',
262 '-fno-strict-aliasing',
263 '-fvisibility=hidden',
265 '-fstack-protector-strong',
267 '--param=ssp-buffer-size=4',
269 if cc.has_argument(arg)
270 add_project_arguments(arg, language : 'c')
274 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
275 # arguments, just emits a warnings. So test for the "positive" version instead.
276 foreach arg : ['unused-parameter',
277 'missing-field-initializers',
280 if cc.has_argument('-W' + arg)
281 add_project_arguments('-Wno-' + arg, language : 'c')
287 #include <inttypes.h>
288 typedef uint64_t usec_t;
289 usec_t now(clockid_t clock);
294 ', name : '-Werror=shadow with local shadowing')
295 add_project_arguments('-Werror=shadow', language : 'c')
298 if cc.get_id() == 'clang'
299 foreach arg : ['-Wno-typedef-redefinition',
300 '-Wno-gnu-variable-sized-type-not-at-end',
302 if cc.has_argument(arg,
303 name : '@0@ is supported'.format(arg))
304 add_project_arguments(arg, language : 'c')
309 link_test_c = files('tools/meson-link-test.c')
311 # --as-needed and --no-undefined are provided by meson by default,
312 # run mesonconf to see what is enabled
313 foreach arg : ['-Wl,-z,relro',
318 have = run_command(check_compilation_sh,
319 cc.cmd_array(), '-x', 'c', arg,
320 '-include', link_test_c).returncode() == 0
321 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
323 add_project_link_arguments(arg, language : 'c')
327 if get_option('buildtype') != 'debug'
328 foreach arg : ['-ffunction-sections',
330 if cc.has_argument(arg,
331 name : '@0@ is supported'.format(arg))
332 add_project_arguments(arg, language : 'c')
336 foreach arg : ['-Wl,--gc-sections']
337 have = run_command(check_compilation_sh,
338 cc.cmd_array(), '-x', 'c', arg,
339 '-include', link_test_c).returncode() == 0
340 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
342 add_project_link_arguments(arg, language : 'c')
347 cpp = ' '.join(cc.cmd_array()) + ' -E'
349 #####################################################################
350 # compilation result tests
352 conf.set('_GNU_SOURCE', true)
353 conf.set('__SANE_USERSPACE_TYPES__', true)
355 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
356 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
357 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
358 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
359 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
360 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
361 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
365 #include <linux/ethtool.h>
367 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
369 foreach decl : ['char16_t',
372 'struct ethtool_link_settings',
375 # We get -1 if the size cannot be determined
376 have = cc.sizeof(decl, prefix : decl_headers) > 0
377 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
380 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
381 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
382 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
383 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
384 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
385 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
386 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
387 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
388 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
389 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
390 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
391 # if_tunnel.h is buggy and cannot be included on its own
392 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
393 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
394 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
395 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
396 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
397 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
398 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
399 ['NDA_IFINDEX', 'linux/neighbour.h'],
400 ['IFA_FLAGS', 'linux/if_addr.h'],
401 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
403 prefix = decl.length() > 2 ? decl[2] : ''
404 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
405 conf.set10('HAVE_DECL_' + decl[0], have)
409 foreach ident : ['secure_getenv', '__secure_getenv']
410 if not skip and cc.has_function(ident)
411 conf.set('HAVE_' + ident.to_upper(), true)
417 ['memfd_create', '''#include <sys/memfd.h>'''],
418 ['gettid', '''#include <sys/types.h>'''],
419 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
420 ['name_to_handle_at', '''#define _GNU_SOURCE
421 #include <sys/types.h>
422 #include <sys/stat.h>
423 #include <fcntl.h>'''],
424 ['setns', '''#define _GNU_SOURCE
425 #include <sched.h>'''],
426 ['renameat2', '''#include <stdio.h>'''],
427 ['kcmp', '''#include <linux/kcmp.h>'''],
428 ['keyctl', '''#include <sys/types.h>
429 #include <keyutils.h>'''],
430 ['copy_file_range', '''#include <sys/syscall.h>
431 #include <unistd.h>'''],
432 ['explicit_bzero' , '''#include <string.h>'''],
435 have = cc.has_function(ident[0], prefix : ident[1])
436 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
439 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
440 conf.set('USE_SYS_RANDOM_H', true)
441 conf.set10('HAVE_DECL_GETRANDOM', true)
443 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
444 conf.set10('HAVE_DECL_GETRANDOM', have)
447 #####################################################################
449 sed = find_program('sed')
450 grep = find_program('grep')
451 awk = find_program('awk')
452 m4 = find_program('m4')
453 stat = find_program('stat')
454 git = find_program('git', required : false)
456 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
457 mkdir_p = 'mkdir -p $DESTDIR/@0@'
458 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
459 splash_bmp = files('test/splash.bmp')
461 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
462 # /usr/sbin, /sbin, and fall back to the default from middle column.
463 progs = [['telinit', '/lib/sysvinit/telinit'],
464 ['quotaon', '/usr/sbin/quotaon' ],
465 ['quotacheck', '/usr/sbin/quotacheck' ],
466 ['kill', '/usr/bin/kill' ],
467 ['kmod', '/usr/bin/kmod' ],
468 ['kexec', '/usr/sbin/kexec' ],
469 ['sulogin', '/usr/sbin/sulogin' ],
470 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
471 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
472 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
473 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
476 path = get_option(prog[0] + '-path')
478 message('Using @1@ for @0@'.format(prog[0], path))
480 exe = find_program(prog[0],
481 '/usr/sbin/' + prog[0],
484 path = exe.found() ? exe.path() : prog[1]
486 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
487 conf.set_quoted(name, path)
488 substs.set(name, path)
491 if run_command('ln', '--relative', '--help').returncode() != 0
492 error('ln does not support --relative')
495 ############################################################
497 gperf = find_program('gperf')
499 gperf_test_format = '''
501 const char * in_word_set(const char *, @0@);
504 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
505 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
506 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
507 if cc.compiles(gperf_test)
508 gperf_len_type = 'size_t'
510 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
511 if cc.compiles(gperf_test)
512 gperf_len_type = 'unsigned'
514 error('unable to determine gperf len type')
517 message('gperf len type is @0@'.format(gperf_len_type))
518 conf.set('GPERF_LEN_TYPE', gperf_len_type,
519 description : 'The type of gperf "len" parameter')
521 ############################################################
523 if not cc.has_header('sys/capability.h')
524 error('POSIX caps headers not found')
526 foreach header : ['linux/btrfs.h',
528 'linux/vm_sockets.h',
529 'valgrind/memcheck.h',
530 'valgrind/valgrind.h',
533 conf.set('HAVE_' + header.underscorify().to_upper(),
534 cc.has_header(header))
537 ############################################################
539 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
540 conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
541 gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
543 default_hierarchy = get_option('default-hierarchy')
544 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
545 description : 'default cgroup hierarchy as string')
546 if default_hierarchy == 'legacy'
547 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
548 elif default_hierarchy == 'hybrid'
549 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
551 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
554 time_epoch = get_option('time-epoch')
557 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
559 time_epoch = time_epoch.to_int()
560 conf.set('TIME_EPOCH', time_epoch)
562 system_uid_max = get_option('system-uid-max')
563 if system_uid_max == ''
564 system_uid_max = run_command(
566 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
567 '/etc/login.defs').stdout()
569 system_uid_max = system_uid_max.to_int()
570 conf.set('SYSTEM_UID_MAX', system_uid_max)
571 substs.set('systemuidmax', system_uid_max)
572 message('maximum system UID is @0@'.format(system_uid_max))
574 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
575 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
577 system_gid_max = get_option('system-gid-max')
578 if system_gid_max == ''
579 system_gid_max = run_command(
581 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
582 '/etc/login.defs').stdout()
584 system_gid_max = system_gid_max.to_int()
585 conf.set('SYSTEM_GID_MAX', system_gid_max)
586 substs.set('systemgidmax', system_gid_max)
587 message('maximum system GID is @0@'.format(system_gid_max))
589 tty_gid = get_option('tty-gid')
590 conf.set('TTY_GID', tty_gid)
591 substs.set('TTY_GID', tty_gid)
593 if get_option('adm-group')
594 m4_defines += ['-DENABLE_ADM_GROUP']
597 if get_option('wheel-group')
598 m4_defines += ['-DENABLE_WHEEL_GROUP']
601 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
603 kill_user_processes = get_option('default-kill-user-processes')
604 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
605 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
607 dns_servers = get_option('dns-servers')
608 conf.set_quoted('DNS_SERVERS', dns_servers)
609 substs.set('DNS_SERVERS', dns_servers)
611 ntp_servers = get_option('ntp-servers')
612 conf.set_quoted('NTP_SERVERS', ntp_servers)
613 substs.set('NTP_SERVERS', ntp_servers)
615 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
617 substs.set('SUSHELL', get_option('debug-shell'))
618 substs.set('DEBUGTTY', get_option('debug-tty'))
620 debug = get_option('debug')
622 foreach name : debug.split(',')
624 conf.set('ENABLE_DEBUG_HASHMAP', true)
625 elif name == 'mmap-cache'
626 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
628 message('unknown debug option "@0@", ignoring'.format(name))
633 #####################################################################
635 threads = dependency('threads')
636 librt = cc.find_library('rt')
637 libm = cc.find_library('m')
638 libdl = cc.find_library('dl')
639 libcrypt = cc.find_library('crypt')
641 libcap = dependency('libcap', required : false)
642 if not libcap.found()
643 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
644 libcap = cc.find_library('cap')
647 libmount = dependency('mount',
650 want_seccomp = get_option('seccomp')
651 if want_seccomp != 'false'
652 libseccomp = dependency('libseccomp',
653 version : '>= 2.3.1',
654 required : want_seccomp == 'true')
655 if libseccomp.found()
656 conf.set('HAVE_SECCOMP', true)
657 m4_defines += ['-DHAVE_SECCOMP']
663 want_selinux = get_option('selinux')
664 if want_selinux != 'false'
665 libselinux = dependency('libselinux',
666 version : '>= 2.1.9',
667 required : want_selinux == 'true')
668 if libselinux.found()
669 conf.set('HAVE_SELINUX', true)
670 m4_defines += ['-DHAVE_SELINUX']
676 want_apparmor = get_option('apparmor')
677 if want_apparmor != 'false'
678 libapparmor = dependency('libapparmor',
679 required : want_apparmor == 'true')
680 if libapparmor.found()
681 conf.set('HAVE_APPARMOR', true)
682 m4_defines += ['-DHAVE_APPARMOR']
688 smack_run_label = get_option('smack-run-label')
689 if smack_run_label != ''
690 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
691 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
694 want_polkit = get_option('polkit')
695 install_polkit = false
696 install_polkit_pkla = false
697 if want_polkit != 'false'
698 conf.set('ENABLE_POLKIT', true)
699 install_polkit = true
701 libpolkit = dependency('polkit-gobject-1',
703 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
704 message('Old polkit detected, will install pkla files')
705 install_polkit_pkla = true
709 want_acl = get_option('acl')
710 if want_acl != 'false'
711 libacl = cc.find_library('acl', required : want_acl == 'true')
713 conf.set('HAVE_ACL', true)
714 m4_defines += ['-DHAVE_ACL']
720 want_audit = get_option('audit')
721 if want_audit != 'false'
722 libaudit = dependency('audit', required : want_audit == 'true')
723 conf.set('HAVE_AUDIT', libaudit.found())
728 want_blkid = get_option('blkid')
729 if want_blkid != 'false'
730 libblkid = dependency('blkid', required : want_blkid == 'true')
731 conf.set('HAVE_BLKID', libblkid.found())
736 want_kmod = get_option('kmod')
737 if want_kmod != 'false'
738 libkmod = dependency('libkmod',
740 required : want_kmod == 'true')
741 conf.set('HAVE_KMOD', libkmod.found())
746 want_pam = get_option('pam')
747 if want_pam != 'false'
748 libpam = cc.find_library('pam', required : want_pam == 'true')
749 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
750 if libpam.found() and libpam_misc.found()
751 conf.set('HAVE_PAM', true)
752 m4_defines += ['-DHAVE_PAM']
759 want_microhttpd = get_option('microhttpd')
760 if want_microhttpd != 'false'
761 libmicrohttpd = dependency('libmicrohttpd',
762 version : '>= 0.9.33',
763 required : want_microhttpd == 'true')
764 if libmicrohttpd.found()
765 conf.set('HAVE_MICROHTTPD', true)
766 m4_defines += ['-DHAVE_MICROHTTPD']
772 want_libcryptsetup = get_option('libcryptsetup')
773 if want_libcryptsetup != 'false'
774 libcryptsetup = dependency('libcryptsetup',
775 version : '>= 1.6.0',
776 required : want_libcryptsetup == 'true')
777 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
782 want_libcurl = get_option('libcurl')
783 if want_libcurl != 'false'
784 libcurl = dependency('libcurl',
785 version : '>= 7.32.0',
786 required : want_libcurl == 'true')
788 conf.set('HAVE_LIBCURL', true)
789 m4_defines += ['-DHAVE_LIBCURL']
795 want_libidn = get_option('libidn')
796 want_libidn2 = get_option('libidn2')
797 if want_libidn == 'true' and want_libidn2 == 'true'
798 error('libidn and libidn2 cannot be requested simultaneously')
801 if want_libidn != 'false' and want_libidn2 != 'true'
802 libidn = dependency('libidn',
803 required : want_libidn == 'true')
805 conf.set('HAVE_LIBIDN', true)
806 m4_defines += ['-DHAVE_LIBIDN']
811 if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
812 # libidn is used for both libidn and libidn2 objects
813 libidn = dependency('libidn2',
814 required : want_libidn2 == 'true')
816 conf.set('HAVE_LIBIDN2', true)
817 m4_defines += ['-DHAVE_LIBIDN2']
821 want_libiptc = get_option('libiptc')
822 if want_libiptc != 'false'
823 libiptc = dependency('libiptc',
824 required : want_libiptc == 'true')
826 conf.set('HAVE_LIBIPTC', true)
827 m4_defines += ['-DHAVE_LIBIPTC']
833 want_qrencode = get_option('qrencode')
834 if want_qrencode != 'false'
835 libqrencode = dependency('libqrencode',
836 required : want_qrencode == 'true')
837 conf.set('HAVE_QRENCODE', libqrencode.found())
842 want_gnutls = get_option('gnutls')
843 if want_gnutls != 'false'
844 libgnutls = dependency('gnutls',
845 version : '>= 3.1.4',
846 required : want_gnutls == 'true')
847 conf.set('HAVE_GNUTLS', libgnutls.found())
852 want_elfutils = get_option('elfutils')
853 if want_elfutils != 'false'
854 libdw = dependency('libdw',
855 required : want_elfutils == 'true')
856 conf.set('HAVE_ELFUTILS', libdw.found())
861 want_zlib = get_option('zlib')
862 if want_zlib != 'false'
863 libz = dependency('zlib',
864 required : want_zlib == 'true')
865 conf.set('HAVE_ZLIB', libz.found())
870 want_bzip2 = get_option('bzip2')
871 if want_bzip2 != 'false'
872 libbzip2 = cc.find_library('bz2',
873 required : want_bzip2 == 'true')
874 conf.set('HAVE_BZIP2', libbzip2.found())
879 want_xz = get_option('xz')
880 if want_xz != 'false'
881 libxz = dependency('liblzma',
882 required : want_xz == 'true')
883 conf.set('HAVE_XZ', libxz.found())
888 want_lz4 = get_option('lz4')
889 if want_lz4 != 'false'
890 liblz4 = dependency('liblz4',
891 required : want_lz4 == 'true')
892 conf.set('HAVE_LZ4', liblz4.found())
897 want_glib = get_option('glib')
898 if want_glib != 'false'
899 libglib = dependency('glib-2.0',
900 version : '>= 2.22.0',
901 required : want_glib == 'true')
902 libgobject = dependency('gobject-2.0',
903 version : '>= 2.22.0',
904 required : want_glib == 'true')
905 libgio = dependency('gio-2.0',
906 required : want_glib == 'true')
907 have = libglib.found() and libgobject.found() and libgio.found()
908 conf.set('HAVE_GLIB', have)
915 want_xkbcommon = get_option('xkbcommon')
916 if want_xkbcommon != 'false'
917 libxkbcommon = dependency('xkbcommon',
918 version : '>= 0.3.0',
919 required : want_xkbcommon == 'true')
920 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
925 want_dbus = get_option('dbus')
926 if want_dbus != 'false'
927 libdbus = dependency('dbus-1',
928 version : '>= 1.3.2',
929 required : want_dbus == 'true')
930 conf.set('HAVE_DBUS', libdbus.found())
935 want_gcrypt = get_option('gcrypt')
936 if want_gcrypt != 'false'
937 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
938 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
940 have_deps = libgcrypt.found() and libgpg_error.found()
941 conf.set('HAVE_GCRYPT', have_deps)
943 # link to neither of the libs if one is not found
952 default_dnssec = get_option('default-dnssec')
953 if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
954 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
955 default_dnssec = 'no'
957 conf.set('DEFAULT_DNSSEC_MODE',
958 'DNSSEC_' + default_dnssec.underscorify().to_upper())
959 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
961 want_importd = get_option('importd')
962 if want_importd != 'false'
963 have_deps = (conf.get('HAVE_LIBCURL', false) and
964 conf.get('HAVE_ZLIB', false) and
965 conf.get('HAVE_BZIP2', false) and
966 conf.get('HAVE_XZ', false) and
967 conf.get('HAVE_GCRYPT', false))
968 conf.set('ENABLE_IMPORTD', have_deps)
969 if want_importd == 'true' and not have_deps
970 error('importd support was requested, but dependencies are not available')
974 want_remote = get_option('remote')
975 if want_remote != 'false'
976 have_deps = [conf.get('HAVE_MICROHTTPD', false),
977 conf.get('HAVE_LIBCURL', false)]
978 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
979 # it's possible to build one without the other. Complain only if
980 # support was explictly requested. The auxiliary files like sysusers
981 # config should be installed when any of the programs are built.
982 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
983 error('remote support was requested, but dependencies are not available')
985 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
988 foreach pair : [['utmp', 'HAVE_UTMP'],
989 ['hibernate', 'ENABLE_HIBERNATE'],
990 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
991 ['binfmt', 'ENABLE_BINFMT'],
992 ['coredump', 'ENABLE_COREDUMP'],
993 ['resolve', 'ENABLE_RESOLVED'],
994 ['logind', 'ENABLE_LOGIND'],
995 ['hostnamed', 'ENABLE_HOSTNAMED'],
996 ['localed', 'ENABLE_LOCALED'],
997 ['machined', 'ENABLE_MACHINED'],
998 ['networkd', 'ENABLE_NETWORKD'],
999 ['timedated', 'ENABLE_TIMEDATED'],
1000 ['timesyncd', 'ENABLE_TIMESYNCD'],
1001 ['myhostname', 'HAVE_MYHOSTNAME'],
1002 ['firstboot', 'ENABLE_FIRSTBOOT'],
1003 ['randomseed', 'ENABLE_RANDOMSEED'],
1004 ['backlight', 'ENABLE_BACKLIGHT'],
1005 ['vconsole', 'ENABLE_VCONSOLE'],
1006 ['quotacheck', 'ENABLE_QUOTACHECK'],
1007 ['sysusers', 'ENABLE_SYSUSERS'],
1008 ['tmpfiles', 'ENABLE_TMPFILES'],
1009 ['hwdb', 'ENABLE_HWDB'],
1010 ['rfkill', 'ENABLE_RFKILL'],
1011 ['ldconfig', 'ENABLE_LDCONFIG'],
1012 ['efi', 'ENABLE_EFI'],
1013 ['tpm', 'ENABLE_TPM'],
1014 ['ima', 'HAVE_IMA'],
1015 ['smack', 'HAVE_SMACK'],
1016 ['gshadow', 'ENABLE_GSHADOW'],
1017 ['idn', 'ENABLE_IDN'],
1018 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
1021 if get_option(pair[0])
1022 conf.set(pair[1], true)
1023 m4_defines += ['-D' + pair[1]]
1027 want_tests = get_option('tests')
1028 install_tests = get_option('install-tests')
1031 #####################################################################
1033 if get_option('efi')
1034 efi_arch = host_machine.cpu_family()
1036 if efi_arch == 'x86'
1037 EFI_MACHINE_TYPE_NAME = 'ia32'
1038 gnu_efi_arch = 'ia32'
1039 elif efi_arch == 'x86_64'
1040 EFI_MACHINE_TYPE_NAME = 'x64'
1041 gnu_efi_arch = 'x86_64'
1042 elif efi_arch == 'arm'
1043 EFI_MACHINE_TYPE_NAME = 'arm'
1044 gnu_efi_arch = 'arm'
1045 elif efi_arch == 'aarch64'
1046 EFI_MACHINE_TYPE_NAME = 'aa64'
1047 gnu_efi_arch = 'aarch64'
1049 EFI_MACHINE_TYPE_NAME = ''
1053 conf.set('ENABLE_EFI', true)
1054 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1056 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1059 #####################################################################
1061 config_h = configure_file(
1062 output : 'config.h',
1063 configuration : conf)
1065 includes = include_directories('src/basic',
1075 'src/libsystemd/sd-bus',
1076 'src/libsystemd/sd-device',
1077 'src/libsystemd/sd-hwdb',
1078 'src/libsystemd/sd-id128',
1079 'src/libsystemd/sd-netlink',
1080 'src/libsystemd/sd-network',
1081 'src/libsystemd-network',
1084 add_project_arguments('-include', 'config.h', language : 'c')
1086 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1087 'src/shared/gcrypt-util.c')
1091 subdir('src/systemd')
1093 subdir('src/libsystemd')
1094 subdir('src/libsystemd-network')
1095 subdir('src/journal')
1098 libjournal_core = static_library(
1100 libjournal_core_sources,
1102 include_directories : includes,
1105 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1106 libsystemd = shared_library(
1108 libsystemd_internal_sources,
1109 journal_internal_sources,
1111 include_directories : includes,
1112 link_args : ['-shared',
1113 '-Wl,--version-script=' + libsystemd_sym_path],
1114 link_with : [libbasic],
1115 dependencies : [threads,
1120 link_depends : libsystemd_sym,
1122 install_dir : rootlibdir)
1124 ############################################################
1126 # binaries that have --help and are intended for use by humans,
1127 # usually, but not always, installed in /bin.
1128 public_programs = []
1130 subdir('src/libudev')
1131 subdir('src/shared')
1134 subdir('src/network')
1136 subdir('src/analyze')
1137 subdir('src/journal-remote')
1138 subdir('src/coredump')
1139 subdir('src/hostname')
1140 subdir('src/import')
1141 subdir('src/kernel-install')
1142 subdir('src/locale')
1143 subdir('src/machine')
1144 subdir('src/nspawn')
1145 subdir('src/resolve')
1146 subdir('src/timedate')
1147 subdir('src/timesync')
1148 subdir('src/vconsole')
1149 subdir('src/sulogin-shell')
1150 subdir('src/boot/efi')
1155 ############################################################
1157 # only static linking apart from libdl, to make sure that the
1158 # module is linked to all libraries that it uses.
1159 test_dlopen = executable(
1162 include_directories : includes,
1163 link_with : [libbasic],
1164 dependencies : [libdl])
1166 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1167 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1168 ['mymachines', 'ENABLE_MACHINED'],
1169 ['resolve', 'ENABLE_RESOLVED']]
1171 condition = tuple[1] == '' or conf.get(tuple[1], false)
1175 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1176 version_script_arg = join_paths(meson.current_source_dir(), sym)
1178 nss = shared_library(
1180 'src/nss-@0@/nss-@0@.c'.format(module),
1182 include_directories : includes,
1183 link_args : ['-shared',
1184 '-Wl,--version-script=' + version_script_arg,
1186 link_with : [libsystemd_internal,
1188 dependencies : [threads,
1192 install_dir : rootlibdir)
1194 # We cannot use shared_module because it does not support version suffix.
1195 # Unfortunately shared_library insists on creating the symlink…
1196 meson.add_install_script('sh', '-c',
1197 'rm $DESTDIR@0@/libnss_@1@.so'
1198 .format(rootlibdir, module))
1200 test('dlopen-nss_' + module,
1202 args : [nss.full_path()]) # path to dlopen must include a slash
1206 ############################################################
1208 executable('systemd',
1210 include_directories : includes,
1211 link_with : [libcore,
1213 dependencies : [threads,
1219 install_rpath : rootlibexecdir,
1221 install_dir : rootlibexecdir)
1223 exe = executable('systemd-analyze',
1224 systemd_analyze_sources,
1225 include_directories : includes,
1226 link_with : [libcore,
1228 dependencies : [threads,
1234 install_rpath : rootlibexecdir,
1236 public_programs += [exe]
1238 executable('systemd-journald',
1239 systemd_journald_sources,
1240 include_directories : includes,
1241 link_with : [libjournal_core,
1243 dependencies : [threads,
1247 install_rpath : rootlibexecdir,
1249 install_dir : rootlibexecdir)
1251 exe = executable('systemd-cat',
1252 systemd_cat_sources,
1253 include_directories : includes,
1254 link_with : [libjournal_core,
1256 dependencies : [threads],
1257 install_rpath : rootlibexecdir,
1259 public_programs += [exe]
1261 exe = executable('journalctl',
1263 include_directories : includes,
1264 link_with : [libshared],
1265 dependencies : [threads,
1269 install_rpath : rootlibexecdir,
1271 install_dir : rootbindir)
1272 public_programs += [exe]
1274 executable('systemd-getty-generator',
1275 'src/getty-generator/getty-generator.c',
1276 include_directories : includes,
1277 link_with : [libshared],
1278 install_rpath : rootlibexecdir,
1280 install_dir : systemgeneratordir)
1282 executable('systemd-debug-generator',
1283 'src/debug-generator/debug-generator.c',
1284 include_directories : includes,
1285 link_with : [libshared],
1286 install_rpath : rootlibexecdir,
1288 install_dir : systemgeneratordir)
1290 executable('systemd-fstab-generator',
1291 'src/fstab-generator/fstab-generator.c',
1292 'src/core/mount-setup.c',
1293 include_directories : includes,
1294 link_with : [libshared],
1295 install_rpath : rootlibexecdir,
1297 install_dir : systemgeneratordir)
1299 if conf.get('ENABLE_ENVIRONMENT_D', false)
1300 executable('30-systemd-environment-d-generator',
1301 'src/environment-d-generator/environment-d-generator.c',
1302 include_directories : includes,
1303 link_with : [libshared],
1304 install_rpath : rootlibexecdir,
1306 install_dir : userenvgeneratordir)
1308 meson.add_install_script(meson_make_symlink,
1309 join_paths(sysconfdir, 'environment'),
1310 join_paths(environmentdir, '99-environment.conf'))
1313 if conf.get('ENABLE_HIBERNATE', false)
1314 executable('systemd-hibernate-resume-generator',
1315 'src/hibernate-resume/hibernate-resume-generator.c',
1316 include_directories : includes,
1317 link_with : [libshared],
1318 install_rpath : rootlibexecdir,
1320 install_dir : systemgeneratordir)
1322 executable('systemd-hibernate-resume',
1323 'src/hibernate-resume/hibernate-resume.c',
1324 include_directories : includes,
1325 link_with : [libshared],
1326 install_rpath : rootlibexecdir,
1328 install_dir : rootlibexecdir)
1331 if conf.get('HAVE_BLKID', false)
1332 executable('systemd-gpt-auto-generator',
1333 'src/gpt-auto-generator/gpt-auto-generator.c',
1334 'src/basic/blkid-util.h',
1335 include_directories : includes,
1336 link_with : [libshared],
1337 dependencies : libblkid,
1338 install_rpath : rootlibexecdir,
1340 install_dir : systemgeneratordir)
1342 exe = executable('systemd-dissect',
1343 'src/dissect/dissect.c',
1344 include_directories : includes,
1345 link_with : [libshared],
1346 install_rpath : rootlibexecdir,
1348 install_dir : rootlibexecdir)
1349 public_programs += [exe]
1352 if conf.get('ENABLE_RESOLVED', false)
1353 executable('systemd-resolved',
1354 systemd_resolved_sources,
1355 gcrypt_util_sources,
1356 include_directories : includes,
1357 link_with : [libshared],
1358 dependencies : [threads,
1363 install_rpath : rootlibexecdir,
1365 install_dir : rootlibexecdir)
1367 exe = executable('systemd-resolve',
1368 systemd_resolve_sources,
1369 gcrypt_util_sources,
1370 include_directories : includes,
1371 link_with : [libshared],
1372 dependencies : [threads,
1377 install_rpath : rootlibexecdir,
1379 public_programs += [exe]
1382 if conf.get('ENABLE_LOGIND', false)
1383 executable('systemd-logind',
1384 systemd_logind_sources,
1385 include_directories : includes,
1386 link_with : [liblogind_core,
1388 dependencies : [threads,
1390 install_rpath : rootlibexecdir,
1392 install_dir : rootlibexecdir)
1394 exe = executable('loginctl',
1396 include_directories : includes,
1397 link_with : [libshared],
1398 dependencies : [threads,
1401 install_rpath : rootlibexecdir,
1403 install_dir : rootbindir)
1404 public_programs += [exe]
1406 exe = executable('systemd-inhibit',
1407 'src/login/inhibit.c',
1408 include_directories : includes,
1409 link_with : [libshared],
1410 install_rpath : rootlibexecdir,
1412 install_dir : rootbindir)
1413 public_programs += [exe]
1415 if conf.get('HAVE_PAM', false)
1416 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1417 pam_systemd = shared_library(
1421 include_directories : includes,
1422 link_args : ['-shared',
1423 '-Wl,--version-script=' + version_script_arg],
1424 link_with : [libsystemd_internal,
1426 dependencies : [threads,
1429 link_depends : pam_systemd_sym,
1431 install_dir : pamlibdir)
1433 test('dlopen-pam_systemd',
1435 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1439 if conf.get('HAVE_PAM', false)
1440 executable('systemd-user-sessions',
1441 'src/user-sessions/user-sessions.c',
1442 include_directories : includes,
1443 link_with : [libshared],
1444 install_rpath : rootlibexecdir,
1446 install_dir : rootlibexecdir)
1449 if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1450 exe = executable('bootctl',
1451 'src/boot/bootctl.c',
1452 include_directories : includes,
1453 link_with : [libshared],
1454 dependencies : [libblkid],
1455 install_rpath : rootlibexecdir,
1457 public_programs += [exe]
1460 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1461 include_directories : includes,
1462 link_with : [libshared],
1463 dependencies : [threads],
1464 install_rpath : rootlibexecdir,
1466 public_programs += [exe]
1468 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1469 include_directories : includes,
1470 link_with : [libshared],
1471 dependencies : [threads,
1476 install_rpath : rootlibexecdir,
1478 install_dir : rootbindir)
1479 public_programs += [exe]
1481 if conf.get('ENABLE_BACKLIGHT', false)
1482 executable('systemd-backlight',
1483 'src/backlight/backlight.c',
1484 include_directories : includes,
1485 link_with : [libshared],
1486 install_rpath : rootlibexecdir,
1488 install_dir : rootlibexecdir)
1491 if conf.get('ENABLE_RFKILL', false)
1492 executable('systemd-rfkill',
1493 'src/rfkill/rfkill.c',
1494 include_directories : includes,
1495 link_with : [libshared],
1496 install_rpath : rootlibexecdir,
1498 install_dir : rootlibexecdir)
1501 executable('systemd-system-update-generator',
1502 'src/system-update-generator/system-update-generator.c',
1503 include_directories : includes,
1504 link_with : [libshared],
1505 install_rpath : rootlibexecdir,
1507 install_dir : systemgeneratordir)
1509 if conf.get('HAVE_LIBCRYPTSETUP', false)
1510 executable('systemd-cryptsetup',
1511 'src/cryptsetup/cryptsetup.c',
1512 include_directories : includes,
1513 link_with : [libshared],
1514 dependencies : [libcryptsetup],
1515 install_rpath : rootlibexecdir,
1517 install_dir : rootlibexecdir)
1519 executable('systemd-cryptsetup-generator',
1520 'src/cryptsetup/cryptsetup-generator.c',
1521 include_directories : includes,
1522 link_with : [libshared],
1523 dependencies : [libcryptsetup],
1524 install_rpath : rootlibexecdir,
1526 install_dir : systemgeneratordir)
1528 executable('systemd-veritysetup',
1529 'src/veritysetup/veritysetup.c',
1530 include_directories : includes,
1531 link_with : [libshared],
1532 dependencies : [libcryptsetup],
1533 install_rpath : rootlibexecdir,
1535 install_dir : rootlibexecdir)
1537 executable('systemd-veritysetup-generator',
1538 'src/veritysetup/veritysetup-generator.c',
1539 include_directories : includes,
1540 link_with : [libshared],
1541 dependencies : [libcryptsetup],
1542 install_rpath : rootlibexecdir,
1544 install_dir : systemgeneratordir)
1547 if conf.get('HAVE_SYSV_COMPAT', false)
1548 executable('systemd-sysv-generator',
1549 'src/sysv-generator/sysv-generator.c',
1550 include_directories : includes,
1551 link_with : [libshared],
1552 install_rpath : rootlibexecdir,
1554 install_dir : systemgeneratordir)
1556 executable('systemd-rc-local-generator',
1557 'src/rc-local-generator/rc-local-generator.c',
1558 include_directories : includes,
1559 link_with : [libshared],
1560 install_rpath : rootlibexecdir,
1562 install_dir : systemgeneratordir)
1565 if conf.get('ENABLE_HOSTNAMED', false)
1566 executable('systemd-hostnamed',
1567 'src/hostname/hostnamed.c',
1568 include_directories : includes,
1569 link_with : [libshared],
1570 install_rpath : rootlibexecdir,
1572 install_dir : rootlibexecdir)
1574 exe = executable('hostnamectl',
1575 'src/hostname/hostnamectl.c',
1576 include_directories : includes,
1577 link_with : [libshared],
1578 install_rpath : rootlibexecdir,
1580 public_programs += [exe]
1583 if conf.get('ENABLE_LOCALED', false)
1584 if conf.get('HAVE_XKBCOMMON', false)
1585 # logind will load libxkbcommon.so dynamically on its own
1591 executable('systemd-localed',
1592 systemd_localed_sources,
1593 include_directories : includes,
1594 link_with : [libshared],
1595 dependencies : deps,
1596 install_rpath : rootlibexecdir,
1598 install_dir : rootlibexecdir)
1600 exe = executable('localectl',
1602 include_directories : includes,
1603 link_with : [libshared],
1604 install_rpath : rootlibexecdir,
1606 public_programs += [exe]
1609 if conf.get('ENABLE_TIMEDATED', false)
1610 executable('systemd-timedated',
1611 'src/timedate/timedated.c',
1612 include_directories : includes,
1613 link_with : [libshared],
1614 install_rpath : rootlibexecdir,
1616 install_dir : rootlibexecdir)
1618 exe = executable('timedatectl',
1619 'src/timedate/timedatectl.c',
1620 include_directories : includes,
1621 install_rpath : rootlibexecdir,
1622 link_with : [libshared],
1624 public_programs += [exe]
1627 if conf.get('ENABLE_TIMESYNCD', false)
1628 executable('systemd-timesyncd',
1629 systemd_timesyncd_sources,
1630 include_directories : includes,
1631 link_with : [libshared],
1632 dependencies : [threads,
1634 install_rpath : rootlibexecdir,
1636 install_dir : rootlibexecdir)
1639 if conf.get('ENABLE_MACHINED', false)
1640 executable('systemd-machined',
1641 systemd_machined_sources,
1642 include_directories : includes,
1643 link_with : [libmachine_core,
1645 install_rpath : rootlibexecdir,
1647 install_dir : rootlibexecdir)
1649 exe = executable('machinectl',
1650 'src/machine/machinectl.c',
1651 include_directories : includes,
1652 link_with : [libshared],
1653 dependencies : [threads,
1656 install_rpath : rootlibexecdir,
1658 install_dir : rootbindir)
1659 public_programs += [exe]
1662 if conf.get('ENABLE_IMPORTD', false)
1663 executable('systemd-importd',
1664 systemd_importd_sources,
1665 include_directories : includes,
1666 link_with : [libshared],
1667 dependencies : [threads],
1668 install_rpath : rootlibexecdir,
1670 install_dir : rootlibexecdir)
1672 systemd_pull = executable('systemd-pull',
1673 systemd_pull_sources,
1674 include_directories : includes,
1675 link_with : [libshared],
1676 dependencies : [libcurl,
1681 install_rpath : rootlibexecdir,
1683 install_dir : rootlibexecdir)
1685 systemd_import = executable('systemd-import',
1686 systemd_import_sources,
1687 include_directories : includes,
1688 link_with : [libshared],
1689 dependencies : [libcurl,
1693 install_rpath : rootlibexecdir,
1695 install_dir : rootlibexecdir)
1697 systemd_export = executable('systemd-export',
1698 systemd_export_sources,
1699 include_directories : includes,
1700 link_with : [libshared],
1701 dependencies : [libcurl,
1705 install_rpath : rootlibexecdir,
1707 install_dir : rootlibexecdir)
1708 public_programs += [systemd_pull, systemd_import, systemd_export]
1711 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1712 exe = executable('systemd-journal-upload',
1713 systemd_journal_upload_sources,
1714 include_directories : includes,
1715 link_with : [libshared],
1716 dependencies : [threads,
1721 install_rpath : rootlibexecdir,
1723 install_dir : rootlibexecdir)
1724 public_programs += [exe]
1727 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1728 s_j_remote = executable('systemd-journal-remote',
1729 systemd_journal_remote_sources,
1730 include_directories : includes,
1731 link_with : [libshared],
1732 dependencies : [threads,
1737 install_rpath : rootlibexecdir,
1739 install_dir : rootlibexecdir)
1741 s_j_gatewayd = executable('systemd-journal-gatewayd',
1742 systemd_journal_gatewayd_sources,
1743 include_directories : includes,
1744 link_with : [libshared],
1745 dependencies : [threads,
1750 install_rpath : rootlibexecdir,
1752 install_dir : rootlibexecdir)
1753 public_programs += [s_j_remote, s_j_gatewayd]
1756 if conf.get('ENABLE_COREDUMP', false)
1757 executable('systemd-coredump',
1758 systemd_coredump_sources,
1759 include_directories : includes,
1760 link_with : [libshared],
1761 dependencies : [threads,
1766 install_rpath : rootlibexecdir,
1768 install_dir : rootlibexecdir)
1770 exe = executable('coredumpctl',
1771 coredumpctl_sources,
1772 include_directories : includes,
1773 link_with : [libshared],
1774 dependencies : [threads,
1777 install_rpath : rootlibexecdir,
1779 public_programs += [exe]
1782 if conf.get('ENABLE_BINFMT', false)
1783 exe = executable('systemd-binfmt',
1784 'src/binfmt/binfmt.c',
1785 include_directories : includes,
1786 link_with : [libshared],
1787 install_rpath : rootlibexecdir,
1789 install_dir : rootlibexecdir)
1790 public_programs += [exe]
1792 meson.add_install_script('sh', '-c',
1793 mkdir_p.format(binfmtdir))
1794 meson.add_install_script('sh', '-c',
1795 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1798 if conf.get('ENABLE_VCONSOLE', false)
1799 executable('systemd-vconsole-setup',
1800 'src/vconsole/vconsole-setup.c',
1801 include_directories : includes,
1802 link_with : [libshared],
1803 install_rpath : rootlibexecdir,
1805 install_dir : rootlibexecdir)
1808 if conf.get('ENABLE_RANDOMSEED', false)
1809 executable('systemd-random-seed',
1810 'src/random-seed/random-seed.c',
1811 include_directories : includes,
1812 link_with : [libshared],
1813 install_rpath : rootlibexecdir,
1815 install_dir : rootlibexecdir)
1818 if conf.get('ENABLE_FIRSTBOOT', false)
1819 executable('systemd-firstboot',
1820 'src/firstboot/firstboot.c',
1821 include_directories : includes,
1822 link_with : [libshared],
1823 dependencies : [libcrypt],
1824 install_rpath : rootlibexecdir,
1826 install_dir : rootbindir)
1829 executable('systemd-remount-fs',
1830 'src/remount-fs/remount-fs.c',
1831 'src/core/mount-setup.c',
1832 'src/core/mount-setup.h',
1833 include_directories : includes,
1834 link_with : [libshared],
1835 install_rpath : rootlibexecdir,
1837 install_dir : rootlibexecdir)
1839 executable('systemd-machine-id-setup',
1840 'src/machine-id-setup/machine-id-setup-main.c',
1841 'src/core/machine-id-setup.c',
1842 'src/core/machine-id-setup.h',
1843 include_directories : includes,
1844 link_with : [libshared],
1845 install_rpath : rootlibexecdir,
1847 install_dir : rootbindir)
1849 executable('systemd-fsck',
1851 include_directories : includes,
1852 link_with : [libshared],
1853 install_rpath : rootlibexecdir,
1855 install_dir : rootlibexecdir)
1857 executable('systemd-sleep',
1858 'src/sleep/sleep.c',
1859 include_directories : includes,
1860 link_with : [libshared],
1861 install_rpath : rootlibexecdir,
1863 install_dir : rootlibexecdir)
1865 exe = executable('systemd-sysctl',
1866 'src/sysctl/sysctl.c',
1867 include_directories : includes,
1868 link_with : [libshared],
1869 install_rpath : rootlibexecdir,
1871 install_dir : rootlibexecdir)
1872 public_programs += [exe]
1874 executable('systemd-ac-power',
1875 'src/ac-power/ac-power.c',
1876 include_directories : includes,
1877 link_with : [libshared],
1878 install_rpath : rootlibexecdir,
1880 install_dir : rootlibexecdir)
1882 exe = executable('systemd-detect-virt',
1883 'src/detect-virt/detect-virt.c',
1884 include_directories : includes,
1885 link_with : [libshared],
1886 install_rpath : rootlibexecdir,
1888 public_programs += [exe]
1890 exe = executable('systemd-delta',
1891 'src/delta/delta.c',
1892 include_directories : includes,
1893 link_with : [libshared],
1894 install_rpath : rootlibexecdir,
1896 public_programs += [exe]
1898 exe = executable('systemd-escape',
1899 'src/escape/escape.c',
1900 include_directories : includes,
1901 link_with : [libshared],
1902 install_rpath : rootlibexecdir,
1904 install_dir : rootbindir)
1905 public_programs += [exe]
1907 exe = executable('systemd-notify',
1908 'src/notify/notify.c',
1909 include_directories : includes,
1910 link_with : [libshared],
1911 install_rpath : rootlibexecdir,
1913 install_dir : rootbindir)
1914 public_programs += [exe]
1916 executable('systemd-volatile-root',
1917 'src/volatile-root/volatile-root.c',
1918 include_directories : includes,
1919 link_with : [libshared],
1920 install_rpath : rootlibexecdir,
1922 install_dir : rootlibexecdir)
1924 executable('systemd-cgroups-agent',
1925 'src/cgroups-agent/cgroups-agent.c',
1926 include_directories : includes,
1927 link_with : [libshared],
1928 install_rpath : rootlibexecdir,
1930 install_dir : rootlibexecdir)
1932 exe = executable('systemd-path',
1934 include_directories : includes,
1935 link_with : [libshared],
1936 install_rpath : rootlibexecdir,
1938 public_programs += [exe]
1940 exe = executable('systemd-ask-password',
1941 'src/ask-password/ask-password.c',
1942 include_directories : includes,
1943 link_with : [libshared],
1944 install_rpath : rootlibexecdir,
1946 install_dir : rootbindir)
1947 public_programs += [exe]
1949 executable('systemd-reply-password',
1950 'src/reply-password/reply-password.c',
1951 include_directories : includes,
1952 link_with : [libshared],
1953 install_rpath : rootlibexecdir,
1955 install_dir : rootlibexecdir)
1957 exe = executable('systemd-tty-ask-password-agent',
1958 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1959 include_directories : includes,
1960 link_with : [libshared],
1961 install_rpath : rootlibexecdir,
1963 install_dir : rootbindir)
1964 public_programs += [exe]
1966 exe = executable('systemd-cgls',
1968 include_directories : includes,
1969 link_with : [libshared],
1970 install_rpath : rootlibexecdir,
1972 public_programs += [exe]
1974 exe = executable('systemd-cgtop',
1975 'src/cgtop/cgtop.c',
1976 include_directories : includes,
1977 link_with : [libshared],
1978 install_rpath : rootlibexecdir,
1980 public_programs += [exe]
1982 executable('systemd-initctl',
1983 'src/initctl/initctl.c',
1984 include_directories : includes,
1985 link_with : [libshared],
1986 install_rpath : rootlibexecdir,
1988 install_dir : rootlibexecdir)
1990 exe = executable('systemd-mount',
1991 'src/mount/mount-tool.c',
1992 include_directories : includes,
1993 link_with : [libshared],
1994 install_rpath : rootlibexecdir,
1996 public_programs += [exe]
1998 meson.add_install_script(meson_make_symlink,
1999 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2001 exe = executable('systemd-run',
2003 include_directories : includes,
2004 link_with : [libshared],
2005 install_rpath : rootlibexecdir,
2007 public_programs += [exe]
2009 exe = executable('systemd-stdio-bridge',
2010 'src/stdio-bridge/stdio-bridge.c',
2011 include_directories : includes,
2012 link_with : [libshared],
2013 install_rpath : rootlibexecdir,
2015 public_programs += [exe]
2017 exe = executable('busctl',
2018 'src/busctl/busctl.c',
2019 'src/busctl/busctl-introspect.c',
2020 'src/busctl/busctl-introspect.h',
2021 include_directories : includes,
2022 link_with : [libshared],
2023 install_rpath : rootlibexecdir,
2025 public_programs += [exe]
2027 if conf.get('ENABLE_SYSUSERS', false)
2028 exe = executable('systemd-sysusers',
2029 'src/sysusers/sysusers.c',
2030 include_directories : includes,
2031 link_with : [libshared],
2032 install_rpath : rootlibexecdir,
2034 install_dir : rootbindir)
2035 public_programs += [exe]
2038 if conf.get('ENABLE_TMPFILES', false)
2039 exe = executable('systemd-tmpfiles',
2040 'src/tmpfiles/tmpfiles.c',
2041 include_directories : includes,
2042 link_with : [libshared],
2043 dependencies : [libacl],
2044 install_rpath : rootlibexecdir,
2046 install_dir : rootbindir)
2047 public_programs += [exe]
2050 if conf.get('ENABLE_HWDB', false)
2051 exe = executable('systemd-hwdb',
2053 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2054 include_directories : includes,
2055 link_with : [libudev_internal],
2056 install_rpath : udev_rpath,
2058 install_dir : rootbindir)
2059 public_programs += [exe]
2062 if conf.get('ENABLE_QUOTACHECK', false)
2063 executable('systemd-quotacheck',
2064 'src/quotacheck/quotacheck.c',
2065 include_directories : includes,
2066 link_with : [libshared],
2067 install_rpath : rootlibexecdir,
2069 install_dir : rootlibexecdir)
2072 exe = executable('systemd-socket-proxyd',
2073 'src/socket-proxy/socket-proxyd.c',
2074 include_directories : includes,
2075 link_with : [libshared],
2076 dependencies : [threads],
2077 install_rpath : rootlibexecdir,
2079 install_dir : rootlibexecdir)
2080 public_programs += [exe]
2082 exe = executable('systemd-udevd',
2083 systemd_udevd_sources,
2084 include_directories : includes,
2085 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2086 link_with : [libudev_core,
2089 dependencies : [threads,
2094 install_rpath : udev_rpath,
2096 install_dir : rootlibexecdir)
2097 public_programs += [exe]
2099 exe = executable('udevadm',
2101 include_directories : includes,
2102 link_with : [libudev_core,
2105 dependencies : [threads,
2110 install_rpath : udev_rpath,
2112 install_dir : rootbindir)
2113 public_programs += [exe]
2115 executable('systemd-shutdown',
2116 systemd_shutdown_sources,
2117 include_directories : includes,
2118 link_with : [libshared],
2119 install_rpath : rootlibexecdir,
2121 install_dir : rootlibexecdir)
2123 executable('systemd-update-done',
2124 'src/update-done/update-done.c',
2125 include_directories : includes,
2126 link_with : [libshared],
2127 install_rpath : rootlibexecdir,
2129 install_dir : rootlibexecdir)
2131 executable('systemd-update-utmp',
2132 'src/update-utmp/update-utmp.c',
2133 include_directories : includes,
2134 link_with : [libshared],
2135 dependencies : [libaudit],
2136 install_rpath : rootlibexecdir,
2138 install_dir : rootlibexecdir)
2140 if conf.get('HAVE_KMOD', false)
2141 executable('systemd-modules-load',
2142 'src/modules-load/modules-load.c',
2143 include_directories : includes,
2144 link_with : [libshared],
2145 dependencies : [libkmod],
2146 install_rpath : rootlibexecdir,
2148 install_dir : rootlibexecdir)
2150 meson.add_install_script('sh', '-c',
2151 mkdir_p.format(modulesloaddir))
2152 meson.add_install_script('sh', '-c',
2153 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2156 exe = executable('systemd-nspawn',
2157 systemd_nspawn_sources,
2158 'src/core/mount-setup.c', # FIXME: use a variable?
2159 'src/core/mount-setup.h',
2160 'src/core/loopback-setup.c',
2161 'src/core/loopback-setup.h',
2162 include_directories : [includes, include_directories('src/nspawn')],
2163 link_with : [libshared],
2164 dependencies : [libacl,
2168 install_rpath : rootlibexecdir,
2170 public_programs += [exe]
2172 if conf.get('ENABLE_NETWORKD', false)
2173 executable('systemd-networkd',
2174 systemd_networkd_sources,
2175 include_directories : includes,
2176 link_with : [libnetworkd_core,
2180 dependencies : [threads],
2181 install_rpath : rootlibexecdir,
2183 install_dir : rootlibexecdir)
2185 executable('systemd-networkd-wait-online',
2186 systemd_networkd_wait_online_sources,
2187 include_directories : includes,
2188 link_with : [libnetworkd_core,
2190 install_rpath : rootlibexecdir,
2192 install_dir : rootlibexecdir)
2195 exe = executable('networkctl',
2197 include_directories : includes,
2198 link_with : [libsystemd_network,
2200 install_rpath : rootlibexecdir,
2202 install_dir : rootbindir)
2203 public_programs += [exe]
2205 ############################################################
2207 foreach tuple : tests
2209 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2210 dependencies = tuple[2]
2211 condition = tuple.length() >= 4 ? tuple[3] : ''
2212 type = tuple.length() >= 5 ? tuple[4] : ''
2213 defs = tuple.length() >= 6 ? tuple[5] : []
2214 incs = tuple.length() >= 7 ? tuple[6] : includes
2217 name = sources[0].split('/')[-1].split('.')[0]
2218 if type.startswith('timeout=')
2219 timeout = type.split('=')[1].to_int()
2223 if condition == '' or conf.get(condition, false)
2227 include_directories : incs,
2228 link_with : link_with,
2229 dependencies : dependencies,
2231 install_rpath : rootlibexecdir,
2232 install : install_tests,
2233 install_dir : join_paths(testsdir, type))
2236 message('@0@ is a manual test'.format(name))
2237 elif type == 'unsafe' and want_tests != 'unsafe'
2238 message('@0@ is an unsafe test'.format(name))
2245 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2249 test_libsystemd_sym = executable(
2250 'test-libsystemd-sym',
2251 test_libsystemd_sym_c,
2252 include_directories : includes,
2253 link_with : [libsystemd],
2254 install : install_tests,
2255 install_dir : testsdir)
2256 test('test-libsystemd-sym',
2257 test_libsystemd_sym)
2259 test_libudev_sym = executable(
2262 include_directories : includes,
2263 c_args : ['-Wno-deprecated-declarations'],
2264 link_with : [libudev],
2265 install : install_tests,
2266 install_dir : testsdir)
2267 test('test-libudev-sym',
2270 ############################################################
2272 make_directive_index_py = find_program('tools/make-directive-index.py')
2273 make_man_index_py = find_program('tools/make-man-index.py')
2274 xml_helper_py = find_program('tools/xml_helper.py')
2275 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2279 subdir('sysusers.d')
2280 subdir('tmpfiles.d')
2285 subdir('shell-completion/bash')
2286 subdir('shell-completion/zsh')
2287 subdir('docs/sysvinit')
2288 subdir('docs/var-log')
2290 # FIXME: figure out if the warning is true:
2291 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2292 install_subdir('factory/etc',
2293 install_dir : factorydir)
2296 install_data('xorg/50-systemd-user.sh',
2297 install_dir : xinitrcdir)
2298 install_data('system-preset/90-systemd.preset',
2299 install_dir : systempresetdir)
2300 install_data('README',
2307 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2308 install_dir : docdir)
2310 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2311 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2313 ############################################################
2315 meson_check_help = find_program('tools/meson-check-help.sh')
2317 foreach exec : public_programs
2318 name = exec.full_path().split('/')[-1]
2319 test('check-help-' + name,
2321 args : [exec.full_path()])
2324 ############################################################
2327 all_files = run_command(
2329 ['--git-dir=@0@/.git'.format(meson.source_root()),
2332 all_files = files(all_files.stdout().split())
2337 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
2341 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
2345 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2348 command : [meson_git_contrib_sh])
2352 git_head = run_command(
2354 ['--git-dir=@0@/.git'.format(meson.source_root()),
2355 'rev-parse', 'HEAD']).stdout().strip()
2356 git_head_short = run_command(
2358 ['--git-dir=@0@/.git'.format(meson.source_root()),
2359 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2363 command : ['git', 'archive',
2364 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2366 '--prefix', 'systemd-@0@/'.format(git_head),
2370 ############################################################
2373 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2375 'prefix: @0@'.format(prefixdir),
2376 'rootprefix: @0@'.format(rootprefixdir),
2377 'sysconf dir: @0@'.format(sysconfdir),
2378 'includedir: @0@'.format(includedir),
2379 'lib dir: @0@'.format(libdir),
2380 'rootlib dir: @0@'.format(rootlibdir),
2381 'SysV init scripts: @0@'.format(sysvinit_path),
2382 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2383 'PAM modules dir: @0@'.format(pamlibdir),
2384 'PAM configuration dir: @0@'.format(pamconfdir),
2385 'RPM macros dir: @0@'.format(rpmmacrosdir),
2386 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2387 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2388 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2389 'bash completions dir: @0@'.format(bashcompletiondir),
2390 'zsh completions dir: @0@'.format(zshcompletiondir),
2391 'extra start script: @0@'.format(get_option('rc-local')),
2392 'extra stop script: @0@'.format(get_option('halt-local')),
2393 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2394 get_option('debug-tty')),
2395 'TTY GID: @0@'.format(tty_gid),
2396 'maximum system UID: @0@'.format(system_uid_max),
2397 'maximum system GID: @0@'.format(system_gid_max),
2398 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2399 'certificate root: @0@'.format(get_option('certificate-root')),
2400 'support URL: @0@'.format(support_url),
2401 'nobody user name: @0@'.format(get_option('nobody-user')),
2402 'nobody group name: @0@'.format(get_option('nobody-group')),
2403 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2404 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2406 'default DNSSEC mode: @0@'.format(default_dnssec),
2407 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2408 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2410 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2411 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2413 'default DNS servers: @0@'.format(alt_dns_servers),
2414 'default NTP servers: @0@'.format(alt_ntp_servers)]
2416 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2417 '@@0@'.format(time_epoch)).stdout().strip()
2419 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2422 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2423 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2424 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2426 if conf.get('ENABLE_EFI', false)
2428 'efi arch: @0@'.format(efi_arch)]
2432 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2433 'EFI CC @0@'.format(efi_cc),
2434 'EFI libdir: @0@'.format(efi_libdir),
2435 'EFI ldsdir: @0@'.format(efi_ldsdir),
2436 'EFI includedir: @0@'.format(efi_incdir)]
2489 ['legacy pkla', install_polkit_pkla],
2491 ['gnu-efi', have_gnu_efi],
2497 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2500 ['man pages', want_man],
2501 ['html pages', want_html],
2502 ['man page indices', want_man and have_lxml],
2503 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2508 ['adm group', get_option('adm-group')],
2509 ['wheel group', get_option('wheel-group')],
2512 ['debug mmap cache'],
2515 cond = tuple.get(1, '')
2517 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2518 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2519 cond = conf.get(ident1, false) or conf.get(ident2, false)
2524 missing += [tuple[0]]
2529 'enabled features: @0@'.format(', '.join(found)),
2530 'disabled features: @0@'.format(', '.join(missing))]
2531 message('\n '.join(status))