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 : ['-Wundef',
235 '-Wmissing-include-dirs',
236 '-Wold-style-definition',
239 '-Wdeclaration-after-statement',
241 '-Wsuggest-attribute=noreturn',
242 '-Werror=missing-prototypes',
243 '-Werror=implicit-function-declaration',
244 '-Werror=missing-declarations',
245 '-Werror=return-type',
246 '-Werror=incompatible-pointer-types',
248 '-Wstrict-prototypes',
250 '-Wmissing-noreturn',
253 '-Wstrict-aliasing=2',
260 '-fdiagnostics-show-option',
261 '-fno-strict-aliasing',
262 '-fvisibility=hidden',
264 '-fstack-protector-strong',
266 '--param=ssp-buffer-size=4',
268 if cc.has_argument(arg)
269 add_project_arguments(arg, language : 'c')
273 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
274 # arguments, just emits a warnings. So test for the "positive" version instead.
275 foreach arg : ['unused-parameter',
276 'missing-field-initializers',
279 if cc.has_argument('-W' + arg)
280 add_project_arguments('-Wno-' + arg, language : 'c')
286 #include <inttypes.h>
287 typedef uint64_t usec_t;
288 usec_t now(clockid_t clock);
293 ', name : '-Werror=shadow with local shadowing')
294 add_project_arguments('-Werror=shadow', language : 'c')
297 if cc.get_id() == 'clang'
298 foreach arg : ['-Wno-typedef-redefinition',
299 '-Wno-gnu-variable-sized-type-not-at-end',
301 if cc.has_argument(arg,
302 name : '@0@ is supported'.format(arg))
303 add_project_arguments(arg, language : 'c')
308 link_test_c = files('tools/meson-link-test.c')
310 # --as-needed and --no-undefined are provided by meson by default,
311 # run mesonconf to see what is enabled
312 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)
455 etags = find_program('etags', required : false)
457 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
458 mkdir_p = 'mkdir -p $DESTDIR/@0@'
459 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
460 splash_bmp = files('test/splash.bmp')
462 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
463 # /usr/sbin, /sbin, and fall back to the default from middle column.
464 progs = [['telinit', '/lib/sysvinit/telinit'],
465 ['quotaon', '/usr/sbin/quotaon' ],
466 ['quotacheck', '/usr/sbin/quotacheck' ],
467 ['kill', '/usr/bin/kill' ],
468 ['kmod', '/usr/bin/kmod' ],
469 ['kexec', '/usr/sbin/kexec' ],
470 ['sulogin', '/usr/sbin/sulogin' ],
471 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
472 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
473 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
474 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
477 path = get_option(prog[0] + '-path')
479 message('Using @1@ for @0@'.format(prog[0], path))
481 exe = find_program(prog[0],
482 '/usr/sbin/' + prog[0],
485 path = exe.found() ? exe.path() : prog[1]
487 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
488 conf.set_quoted(name, path)
489 substs.set(name, path)
492 if run_command('ln', '--relative', '--help').returncode() != 0
493 error('ln does not support --relative')
496 ############################################################
498 gperf = find_program('gperf')
500 gperf_test_format = '''
502 const char * in_word_set(const char *, @0@);
505 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
506 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
507 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
508 if cc.compiles(gperf_test)
509 gperf_len_type = 'size_t'
511 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
512 if cc.compiles(gperf_test)
513 gperf_len_type = 'unsigned'
515 error('unable to determine gperf len type')
518 message('gperf len type is @0@'.format(gperf_len_type))
519 conf.set('GPERF_LEN_TYPE', gperf_len_type,
520 description : 'The type of gperf "len" parameter')
522 ############################################################
524 if not cc.has_header('sys/capability.h')
525 error('POSIX caps headers not found')
527 foreach header : ['linux/btrfs.h',
529 'linux/vm_sockets.h',
530 'valgrind/memcheck.h',
531 'valgrind/valgrind.h',
534 conf.set('HAVE_' + header.underscorify().to_upper(),
535 cc.has_header(header))
538 ############################################################
540 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
542 default_hierarchy = get_option('default-hierarchy')
543 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
544 description : 'default cgroup hierarchy as string')
545 if default_hierarchy == 'legacy'
546 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
547 elif default_hierarchy == 'hybrid'
548 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
550 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
553 time_epoch = get_option('time-epoch')
556 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
558 time_epoch = time_epoch.to_int()
559 conf.set('TIME_EPOCH', time_epoch)
561 system_uid_max = get_option('system-uid-max')
562 if system_uid_max == ''
563 system_uid_max = run_command(
565 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
566 '/etc/login.defs').stdout()
568 system_uid_max = system_uid_max.to_int()
569 conf.set('SYSTEM_UID_MAX', system_uid_max)
570 substs.set('systemuidmax', system_uid_max)
571 message('maximum system UID is @0@'.format(system_uid_max))
573 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
574 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
576 system_gid_max = get_option('system-gid-max')
577 if system_gid_max == ''
578 system_gid_max = run_command(
580 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
581 '/etc/login.defs').stdout()
583 system_gid_max = system_gid_max.to_int()
584 conf.set('SYSTEM_GID_MAX', system_gid_max)
585 substs.set('systemgidmax', system_gid_max)
586 message('maximum system GID is @0@'.format(system_gid_max))
588 tty_gid = get_option('tty-gid')
589 conf.set('TTY_GID', tty_gid)
590 substs.set('TTY_GID', tty_gid)
592 if get_option('adm-group')
593 m4_defines += ['-DENABLE_ADM_GROUP']
596 if get_option('wheel-group')
597 m4_defines += ['-DENABLE_WHEEL_GROUP']
600 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
602 kill_user_processes = get_option('default-kill-user-processes')
603 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
604 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
606 default_dnssec = get_option('default-dnssec')
607 conf.set('DEFAULT_DNSSEC_MODE',
608 'DNSSEC_' + default_dnssec.underscorify().to_upper())
609 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
611 dns_servers = get_option('dns-servers')
612 conf.set_quoted('DNS_SERVERS', dns_servers)
613 substs.set('DNS_SERVERS', dns_servers)
615 ntp_servers = get_option('ntp-servers')
616 conf.set_quoted('NTP_SERVERS', ntp_servers)
617 substs.set('NTP_SERVERS', ntp_servers)
619 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
621 substs.set('SUSHELL', get_option('debug-shell'))
622 substs.set('DEBUGTTY', get_option('debug-tty'))
624 debug = get_option('debug')
626 foreach name : debug.split(',')
628 conf.set('ENABLE_DEBUG_HASHMAP', true)
629 elif name == 'mmap-cache'
630 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
632 message('unknown debug option "@0@", ignoring'.format(name))
637 #####################################################################
639 threads = dependency('threads')
640 librt = cc.find_library('rt')
641 libm = cc.find_library('m')
642 libdl = cc.find_library('dl')
643 libcrypt = cc.find_library('crypt')
645 libcap = dependency('libcap', required : false)
646 if not libcap.found()
647 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
648 libcap = cc.find_library('cap')
651 libmount = dependency('mount',
654 want_seccomp = get_option('seccomp')
655 if want_seccomp != 'false'
656 libseccomp = dependency('libseccomp',
657 version : '>= 2.3.1',
658 required : want_seccomp == 'true')
659 if libseccomp.found()
660 conf.set('HAVE_SECCOMP', true)
661 m4_defines += ['-DHAVE_SECCOMP']
667 want_selinux = get_option('selinux')
668 if want_selinux != 'false'
669 libselinux = dependency('libselinux',
670 version : '>= 2.1.9',
671 required : want_selinux == 'true')
672 if libselinux.found()
673 conf.set('HAVE_SELINUX', true)
674 m4_defines += ['-DHAVE_SELINUX']
680 want_apparmor = get_option('apparmor')
681 if want_apparmor != 'false'
682 libapparmor = dependency('libapparmor',
683 required : want_apparmor == 'true')
684 if libapparmor.found()
685 conf.set('HAVE_APPARMOR', true)
686 m4_defines += ['-DHAVE_APPARMOR']
692 smack_run_label = get_option('smack-run-label')
693 if smack_run_label != ''
694 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
695 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
698 want_polkit = get_option('polkit')
699 install_polkit = false
700 install_polkit_pkla = false
701 if want_polkit != 'false'
702 conf.set('ENABLE_POLKIT', true)
703 install_polkit = true
705 libpolkit = dependency('polkit-gobject-1',
707 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
708 message('Old polkit detected, will install pkla files')
709 install_polkit_pkla = true
713 want_acl = get_option('acl')
714 if want_acl != 'false'
715 libacl = cc.find_library('acl', required : want_acl == 'true')
717 conf.set('HAVE_ACL', true)
718 m4_defines += ['-DHAVE_ACL']
724 want_audit = get_option('audit')
725 if want_audit != 'false'
726 libaudit = dependency('audit', required : want_audit == 'true')
727 conf.set('HAVE_AUDIT', libaudit.found())
732 want_blkid = get_option('blkid')
733 if want_blkid != 'false'
734 libblkid = dependency('blkid', required : want_blkid == 'true')
735 conf.set('HAVE_BLKID', libblkid.found())
740 want_kmod = get_option('kmod')
741 if want_kmod != 'false'
742 libkmod = dependency('libkmod',
744 required : want_kmod == 'true')
745 conf.set('HAVE_KMOD', libkmod.found())
750 want_pam = get_option('pam')
751 if want_pam != 'false'
752 libpam = cc.find_library('pam', required : want_pam == 'true')
753 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
754 if libpam.found() and libpam_misc.found()
755 conf.set('HAVE_PAM', true)
756 m4_defines += ['-DHAVE_PAM']
763 want_microhttpd = get_option('microhttpd')
764 if want_microhttpd != 'false'
765 libmicrohttpd = dependency('libmicrohttpd',
766 version : '>= 0.9.33',
767 required : want_microhttpd == 'true')
768 if libmicrohttpd.found()
769 conf.set('HAVE_MICROHTTPD', true)
770 m4_defines += ['-DHAVE_MICROHTTPD']
776 want_libcryptsetup = get_option('libcryptsetup')
777 if want_libcryptsetup != 'false'
778 libcryptsetup = dependency('libcryptsetup',
779 version : '>= 1.6.0',
780 required : want_libcryptsetup == 'true')
781 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
786 want_libcurl = get_option('libcurl')
787 if want_libcurl != 'false'
788 libcurl = dependency('libcurl',
789 version : '>= 7.32.0',
790 required : want_libcurl == 'true')
792 conf.set('HAVE_LIBCURL', true)
793 m4_defines += ['-DHAVE_LIBCURL']
799 want_libidn = get_option('libidn')
800 want_libidn2 = get_option('libidn2')
801 if want_libidn == 'true' and want_libidn2 == 'true'
802 error('libidn and libidn2 cannot be requested simultaneously')
805 if want_libidn2 != 'false' and want_libidn != 'true'
806 libidn = dependency('libidn2',
807 required : want_libidn2 == 'true')
808 # libidn is used for both libidn and libidn2 objects
810 conf.set('HAVE_LIBIDN2', true)
811 m4_defines += ['-DHAVE_LIBIDN2']
816 if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
817 libidn = dependency('libidn',
818 required : want_libidn == 'true')
820 conf.set('HAVE_LIBIDN', true)
821 m4_defines += ['-DHAVE_LIBIDN']
825 want_libiptc = get_option('libiptc')
826 if want_libiptc != 'false'
827 libiptc = dependency('libiptc',
828 required : want_libiptc == 'true')
830 conf.set('HAVE_LIBIPTC', true)
831 m4_defines += ['-DHAVE_LIBIPTC']
837 want_qrencode = get_option('qrencode')
838 if want_qrencode != 'false'
839 libqrencode = dependency('libqrencode',
840 required : want_qrencode == 'true')
841 conf.set('HAVE_QRENCODE', libqrencode.found())
846 want_gnutls = get_option('gnutls')
847 if want_gnutls != 'false'
848 libgnutls = dependency('gnutls',
849 version : '>= 3.1.4',
850 required : want_gnutls == 'true')
851 conf.set('HAVE_GNUTLS', libgnutls.found())
856 want_elfutils = get_option('elfutils')
857 if want_elfutils != 'false'
858 libdw = dependency('libdw',
859 required : want_elfutils == 'true')
860 conf.set('HAVE_ELFUTILS', libdw.found())
865 want_zlib = get_option('zlib')
866 if want_zlib != 'false'
867 libz = dependency('zlib',
868 required : want_zlib == 'true')
869 conf.set('HAVE_ZLIB', libz.found())
874 want_bzip2 = get_option('bzip2')
875 if want_bzip2 != 'false'
876 libbzip2 = cc.find_library('bz2',
877 required : want_bzip2 == 'true')
878 conf.set('HAVE_BZIP2', libbzip2.found())
883 want_xz = get_option('xz')
884 if want_xz != 'false'
885 libxz = dependency('liblzma',
886 required : want_xz == 'true')
887 conf.set('HAVE_XZ', libxz.found())
892 want_lz4 = get_option('lz4')
893 if want_lz4 != 'false'
894 liblz4 = dependency('liblz4',
895 required : want_lz4 == 'true')
896 conf.set('HAVE_LZ4', liblz4.found())
901 want_glib = get_option('glib')
902 if want_glib != 'false'
903 libglib = dependency('glib-2.0',
904 version : '>= 2.22.0',
905 required : want_glib == 'true')
906 libgobject = dependency('gobject-2.0',
907 version : '>= 2.22.0',
908 required : want_glib == 'true')
909 libgio = dependency('gio-2.0',
910 required : want_glib == 'true')
911 have = libglib.found() and libgobject.found() and libgio.found()
912 conf.set('HAVE_GLIB', have)
919 want_xkbcommon = get_option('xkbcommon')
920 if want_xkbcommon != 'false'
921 libxkbcommon = dependency('xkbcommon',
922 version : '>= 0.3.0',
923 required : want_xkbcommon == 'true')
924 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
929 want_dbus = get_option('dbus')
930 if want_dbus != 'false'
931 libdbus = dependency('dbus-1',
932 version : '>= 1.3.2',
933 required : want_dbus == 'true')
934 conf.set('HAVE_DBUS', libdbus.found())
939 want_gcrypt = get_option('gcrypt')
940 if want_gcrypt != 'false'
941 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
942 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
944 have_deps = libgcrypt.found() and libgpg_error.found()
945 conf.set('HAVE_GCRYPT', have_deps)
947 # link to neither of the libs if one is not found
956 want_importd = get_option('importd')
957 if want_importd != 'false'
958 have_deps = (conf.get('HAVE_LIBCURL', false) and
959 conf.get('HAVE_ZLIB', false) and
960 conf.get('HAVE_BZIP2', false) and
961 conf.get('HAVE_XZ', false) and
962 conf.get('HAVE_GCRYPT', false))
963 conf.set('ENABLE_IMPORTD', have_deps)
964 if want_importd == 'true' and not have_deps
965 error('importd support was requested, but dependencies are not available')
969 want_remote = get_option('remote')
970 if want_remote != 'false'
971 have_deps = [conf.get('HAVE_MICROHTTPD', false),
972 conf.get('HAVE_LIBCURL', false)]
973 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
974 # it's possible to build one without the other. Complain only if
975 # support was explictly requested. The auxiliary files like sysusers
976 # config should be installed when any of the programs are built.
977 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
978 error('remote support was requested, but dependencies are not available')
980 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
983 foreach pair : [['utmp', 'HAVE_UTMP'],
984 ['hibernate', 'ENABLE_HIBERNATE'],
985 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
986 ['binfmt', 'ENABLE_BINFMT'],
987 ['coredump', 'ENABLE_COREDUMP'],
988 ['resolve', 'ENABLE_RESOLVED'],
989 ['logind', 'ENABLE_LOGIND'],
990 ['hostnamed', 'ENABLE_HOSTNAMED'],
991 ['localed', 'ENABLE_LOCALED'],
992 ['machined', 'ENABLE_MACHINED'],
993 ['networkd', 'ENABLE_NETWORKD'],
994 ['timedated', 'ENABLE_TIMEDATED'],
995 ['timesyncd', 'ENABLE_TIMESYNCD'],
996 ['myhostname', 'HAVE_MYHOSTNAME'],
997 ['firstboot', 'ENABLE_FIRSTBOOT'],
998 ['randomseed', 'ENABLE_RANDOMSEED'],
999 ['backlight', 'ENABLE_BACKLIGHT'],
1000 ['vconsole', 'ENABLE_VCONSOLE'],
1001 ['quotacheck', 'ENABLE_QUOTACHECK'],
1002 ['sysusers', 'ENABLE_SYSUSERS'],
1003 ['tmpfiles', 'ENABLE_TMPFILES'],
1004 ['hwdb', 'ENABLE_HWDB'],
1005 ['rfkill', 'ENABLE_RFKILL'],
1006 ['ldconfig', 'ENABLE_LDCONFIG'],
1007 ['efi', 'ENABLE_EFI'],
1008 ['tpm', 'SD_BOOT_LOG_TPM'],
1009 ['ima', 'HAVE_IMA'],
1010 ['smack', 'HAVE_SMACK'],
1011 ['gshadow', 'ENABLE_GSHADOW'],
1014 if get_option(pair[0])
1015 conf.set(pair[1], true)
1016 m4_defines += ['-D' + pair[1]]
1020 want_tests = get_option('tests')
1021 install_tests = get_option('install-tests')
1024 #####################################################################
1026 if get_option('efi')
1027 efi_arch = host_machine.cpu_family()
1029 if efi_arch == 'x86'
1030 EFI_MACHINE_TYPE_NAME = 'ia32'
1031 gnu_efi_arch = 'ia32'
1032 elif efi_arch == 'x86_64'
1033 EFI_MACHINE_TYPE_NAME = 'x64'
1034 gnu_efi_arch = 'x86_64'
1035 elif efi_arch == 'arm'
1036 EFI_MACHINE_TYPE_NAME = 'arm'
1037 gnu_efi_arch = 'arm'
1038 elif efi_arch == 'aarch64'
1039 EFI_MACHINE_TYPE_NAME = 'aa64'
1040 gnu_efi_arch = 'aarch64'
1042 EFI_MACHINE_TYPE_NAME = ''
1046 conf.set('ENABLE_EFI', true)
1047 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1049 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1052 #####################################################################
1054 config_h = configure_file(
1055 output : 'config.h',
1056 configuration : conf)
1058 includes = include_directories('src/basic',
1068 'src/libsystemd/sd-bus',
1069 'src/libsystemd/sd-device',
1070 'src/libsystemd/sd-hwdb',
1071 'src/libsystemd/sd-id128',
1072 'src/libsystemd/sd-netlink',
1073 'src/libsystemd/sd-network',
1074 'src/libsystemd-network',
1077 add_project_arguments('-include', 'config.h', language : 'c')
1079 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1080 'src/shared/gcrypt-util.c')
1084 subdir('src/systemd')
1086 subdir('src/libsystemd')
1087 subdir('src/libsystemd-network')
1088 subdir('src/journal')
1091 libjournal_core = static_library(
1093 libjournal_core_sources,
1095 include_directories : includes,
1098 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1099 libsystemd = shared_library(
1101 libsystemd_internal_sources,
1102 journal_internal_sources,
1104 include_directories : includes,
1105 link_args : ['-shared',
1106 '-Wl,--version-script=' + libsystemd_sym_path],
1107 link_with : [libbasic],
1108 dependencies : [threads,
1113 link_depends : libsystemd_sym,
1115 install_dir : rootlibdir)
1117 ############################################################
1119 # binaries that have --help and are intended for use by humans,
1120 # usually, but not always, installed in /bin.
1121 public_programs = []
1123 subdir('src/libudev')
1124 subdir('src/shared')
1127 subdir('src/network')
1129 subdir('src/analyze')
1130 subdir('src/journal-remote')
1131 subdir('src/coredump')
1132 subdir('src/hostname')
1133 subdir('src/import')
1134 subdir('src/kernel-install')
1135 subdir('src/locale')
1136 subdir('src/machine')
1137 subdir('src/nspawn')
1138 subdir('src/resolve')
1139 subdir('src/timedate')
1140 subdir('src/timesync')
1141 subdir('src/vconsole')
1142 subdir('src/sulogin-shell')
1143 subdir('src/boot/efi')
1148 ############################################################
1150 # only static linking apart from libdl, to make sure that the
1151 # module is linked to all libraries that it uses.
1152 test_dlopen = executable(
1155 include_directories : includes,
1156 link_with : [libbasic],
1157 dependencies : [libdl])
1159 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1161 ['mymachines', 'ENABLE_MACHINED'],
1162 ['resolve', 'ENABLE_RESOLVED']]
1164 condition = tuple[1] == '' or conf.get(tuple[1], false)
1168 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1169 version_script_arg = join_paths(meson.current_source_dir(), sym)
1171 nss = shared_library(
1173 'src/nss-@0@/nss-@0@.c'.format(module),
1175 include_directories : includes,
1176 link_args : ['-shared',
1177 '-Wl,--version-script=' + version_script_arg,
1179 link_with : [libsystemd_internal,
1181 dependencies : [threads,
1185 install_dir : rootlibdir)
1187 # We cannot use shared_module because it does not support version suffix.
1188 # Unfortunately shared_library insists on creating the symlink…
1189 meson.add_install_script('sh', '-c',
1190 'rm $DESTDIR@0@/libnss_@1@.so'
1191 .format(rootlibdir, module))
1193 test('dlopen-nss_' + module,
1195 args : [nss.full_path()]) # path to dlopen must include a slash
1199 ############################################################
1201 executable('systemd',
1203 include_directories : includes,
1204 link_with : [libcore,
1206 dependencies : [threads,
1212 install_rpath : rootlibexecdir,
1214 install_dir : rootlibexecdir)
1216 exe = executable('systemd-analyze',
1217 systemd_analyze_sources,
1218 include_directories : includes,
1219 link_with : [libcore,
1221 dependencies : [threads,
1227 install_rpath : rootlibexecdir,
1229 public_programs += [exe]
1231 executable('systemd-journald',
1232 systemd_journald_sources,
1233 include_directories : includes,
1234 link_with : [libjournal_core,
1236 dependencies : [threads,
1240 install_rpath : rootlibexecdir,
1242 install_dir : rootlibexecdir)
1244 exe = executable('systemd-cat',
1245 systemd_cat_sources,
1246 include_directories : includes,
1247 link_with : [libjournal_core,
1249 dependencies : [threads],
1250 install_rpath : rootlibexecdir,
1252 public_programs += [exe]
1254 exe = executable('journalctl',
1256 include_directories : includes,
1257 link_with : [libshared],
1258 dependencies : [threads,
1262 install_rpath : rootlibexecdir,
1264 install_dir : rootbindir)
1265 public_programs += [exe]
1267 executable('systemd-getty-generator',
1268 'src/getty-generator/getty-generator.c',
1269 include_directories : includes,
1270 link_with : [libshared],
1271 install_rpath : rootlibexecdir,
1273 install_dir : systemgeneratordir)
1275 executable('systemd-debug-generator',
1276 'src/debug-generator/debug-generator.c',
1277 include_directories : includes,
1278 link_with : [libshared],
1279 install_rpath : rootlibexecdir,
1281 install_dir : systemgeneratordir)
1283 executable('systemd-fstab-generator',
1284 'src/fstab-generator/fstab-generator.c',
1285 'src/core/mount-setup.c',
1286 include_directories : includes,
1287 link_with : [libshared],
1288 install_rpath : rootlibexecdir,
1290 install_dir : systemgeneratordir)
1292 if conf.get('ENABLE_ENVIRONMENT_D', false)
1293 executable('30-systemd-environment-d-generator',
1294 'src/environment-d-generator/environment-d-generator.c',
1295 include_directories : includes,
1296 link_with : [libshared],
1297 install_rpath : rootlibexecdir,
1299 install_dir : userenvgeneratordir)
1301 meson.add_install_script(meson_make_symlink,
1302 join_paths(sysconfdir, 'environment'),
1303 join_paths(environmentdir, '99-environment.conf'))
1306 if conf.get('ENABLE_HIBERNATE', false)
1307 executable('systemd-hibernate-resume-generator',
1308 'src/hibernate-resume/hibernate-resume-generator.c',
1309 include_directories : includes,
1310 link_with : [libshared],
1311 install_rpath : rootlibexecdir,
1313 install_dir : systemgeneratordir)
1315 executable('systemd-hibernate-resume',
1316 'src/hibernate-resume/hibernate-resume.c',
1317 include_directories : includes,
1318 link_with : [libshared],
1319 install_rpath : rootlibexecdir,
1321 install_dir : rootlibexecdir)
1324 if conf.get('HAVE_BLKID', false)
1325 executable('systemd-gpt-auto-generator',
1326 'src/gpt-auto-generator/gpt-auto-generator.c',
1327 'src/basic/blkid-util.h',
1328 include_directories : includes,
1329 link_with : [libshared],
1330 dependencies : libblkid,
1331 install_rpath : rootlibexecdir,
1333 install_dir : systemgeneratordir)
1335 exe = executable('systemd-dissect',
1336 'src/dissect/dissect.c',
1337 include_directories : includes,
1338 link_with : [libshared],
1339 install_rpath : rootlibexecdir,
1341 install_dir : rootlibexecdir)
1342 public_programs += [exe]
1345 if conf.get('ENABLE_RESOLVED', false)
1346 executable('systemd-resolved',
1347 systemd_resolved_sources,
1348 gcrypt_util_sources,
1349 include_directories : includes,
1350 link_with : [libshared],
1351 dependencies : [threads,
1356 install_rpath : rootlibexecdir,
1358 install_dir : rootlibexecdir)
1360 exe = executable('systemd-resolve',
1361 systemd_resolve_sources,
1362 gcrypt_util_sources,
1363 include_directories : includes,
1364 link_with : [libshared],
1365 dependencies : [threads,
1370 install_rpath : rootlibexecdir,
1372 public_programs += [exe]
1375 if conf.get('ENABLE_LOGIND', false)
1376 executable('systemd-logind',
1377 systemd_logind_sources,
1378 include_directories : includes,
1379 link_with : [liblogind_core,
1381 dependencies : [threads,
1383 install_rpath : rootlibexecdir,
1385 install_dir : rootlibexecdir)
1387 exe = executable('loginctl',
1389 include_directories : includes,
1390 link_with : [libshared],
1391 dependencies : [threads,
1394 install_rpath : rootlibexecdir,
1396 install_dir : rootbindir)
1397 public_programs += [exe]
1399 exe = executable('systemd-inhibit',
1400 'src/login/inhibit.c',
1401 include_directories : includes,
1402 link_with : [libshared],
1403 install_rpath : rootlibexecdir,
1405 install_dir : rootbindir)
1406 public_programs += [exe]
1408 if conf.get('HAVE_PAM', false)
1409 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1410 pam_systemd = shared_library(
1414 include_directories : includes,
1415 link_args : ['-shared',
1416 '-Wl,--version-script=' + version_script_arg],
1417 link_with : [libsystemd_internal,
1419 dependencies : [threads,
1422 link_depends : pam_systemd_sym,
1424 install_dir : pamlibdir)
1426 test('dlopen-pam_systemd',
1428 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1432 if conf.get('HAVE_PAM', false)
1433 executable('systemd-user-sessions',
1434 'src/user-sessions/user-sessions.c',
1435 include_directories : includes,
1436 link_with : [libshared],
1437 install_rpath : rootlibexecdir,
1439 install_dir : rootlibexecdir)
1442 if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1443 exe = executable('bootctl',
1444 'src/boot/bootctl.c',
1445 include_directories : includes,
1446 link_with : [libshared],
1447 dependencies : [libblkid],
1448 install_rpath : rootlibexecdir,
1450 public_programs += [exe]
1453 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1454 include_directories : includes,
1455 link_with : [libshared],
1456 dependencies : [threads],
1457 install_rpath : rootlibexecdir,
1459 public_programs += [exe]
1461 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1462 include_directories : includes,
1463 link_with : [libshared],
1464 dependencies : [threads,
1469 install_rpath : rootlibexecdir,
1471 install_dir : rootbindir)
1472 public_programs += [exe]
1474 if conf.get('ENABLE_BACKLIGHT', false)
1475 executable('systemd-backlight',
1476 'src/backlight/backlight.c',
1477 include_directories : includes,
1478 link_with : [libshared],
1479 install_rpath : rootlibexecdir,
1481 install_dir : rootlibexecdir)
1484 if conf.get('ENABLE_RFKILL', false)
1485 executable('systemd-rfkill',
1486 'src/rfkill/rfkill.c',
1487 include_directories : includes,
1488 link_with : [libshared],
1489 install_rpath : rootlibexecdir,
1491 install_dir : rootlibexecdir)
1494 executable('systemd-system-update-generator',
1495 'src/system-update-generator/system-update-generator.c',
1496 include_directories : includes,
1497 link_with : [libshared],
1498 install_rpath : rootlibexecdir,
1500 install_dir : systemgeneratordir)
1502 if conf.get('HAVE_LIBCRYPTSETUP', false)
1503 executable('systemd-cryptsetup',
1504 'src/cryptsetup/cryptsetup.c',
1505 include_directories : includes,
1506 link_with : [libshared],
1507 dependencies : [libcryptsetup],
1508 install_rpath : rootlibexecdir,
1510 install_dir : rootlibexecdir)
1512 executable('systemd-cryptsetup-generator',
1513 'src/cryptsetup/cryptsetup-generator.c',
1514 include_directories : includes,
1515 link_with : [libshared],
1516 dependencies : [libcryptsetup],
1517 install_rpath : rootlibexecdir,
1519 install_dir : systemgeneratordir)
1521 executable('systemd-veritysetup',
1522 'src/veritysetup/veritysetup.c',
1523 include_directories : includes,
1524 link_with : [libshared],
1525 dependencies : [libcryptsetup],
1526 install_rpath : rootlibexecdir,
1528 install_dir : rootlibexecdir)
1530 executable('systemd-veritysetup-generator',
1531 'src/veritysetup/veritysetup-generator.c',
1532 include_directories : includes,
1533 link_with : [libshared],
1534 dependencies : [libcryptsetup],
1535 install_rpath : rootlibexecdir,
1537 install_dir : systemgeneratordir)
1540 if conf.get('HAVE_SYSV_COMPAT', false)
1541 executable('systemd-sysv-generator',
1542 'src/sysv-generator/sysv-generator.c',
1543 include_directories : includes,
1544 link_with : [libshared],
1545 install_rpath : rootlibexecdir,
1547 install_dir : systemgeneratordir)
1549 executable('systemd-rc-local-generator',
1550 'src/rc-local-generator/rc-local-generator.c',
1551 include_directories : includes,
1552 link_with : [libshared],
1553 install_rpath : rootlibexecdir,
1555 install_dir : systemgeneratordir)
1558 if conf.get('ENABLE_HOSTNAMED', false)
1559 executable('systemd-hostnamed',
1560 'src/hostname/hostnamed.c',
1561 include_directories : includes,
1562 link_with : [libshared],
1563 install_rpath : rootlibexecdir,
1565 install_dir : rootlibexecdir)
1567 exe = executable('hostnamectl',
1568 'src/hostname/hostnamectl.c',
1569 include_directories : includes,
1570 link_with : [libshared],
1571 install_rpath : rootlibexecdir,
1573 public_programs += [exe]
1576 if conf.get('ENABLE_LOCALED', false)
1577 if conf.get('HAVE_XKBCOMMON', false)
1578 # logind will load libxkbcommon.so dynamically on its own
1584 executable('systemd-localed',
1585 systemd_localed_sources,
1586 include_directories : includes,
1587 link_with : [libshared],
1588 dependencies : deps,
1589 install_rpath : rootlibexecdir,
1591 install_dir : rootlibexecdir)
1593 exe = executable('localectl',
1595 include_directories : includes,
1596 link_with : [libshared],
1597 install_rpath : rootlibexecdir,
1599 public_programs += [exe]
1602 if conf.get('ENABLE_TIMEDATED', false)
1603 executable('systemd-timedated',
1604 'src/timedate/timedated.c',
1605 include_directories : includes,
1606 link_with : [libshared],
1607 install_rpath : rootlibexecdir,
1609 install_dir : rootlibexecdir)
1611 exe = executable('timedatectl',
1612 'src/timedate/timedatectl.c',
1613 include_directories : includes,
1614 install_rpath : rootlibexecdir,
1615 link_with : [libshared],
1617 public_programs += [exe]
1620 if conf.get('ENABLE_TIMESYNCD', false)
1621 executable('systemd-timesyncd',
1622 systemd_timesyncd_sources,
1623 include_directories : includes,
1624 link_with : [libshared],
1625 dependencies : [threads,
1627 install_rpath : rootlibexecdir,
1629 install_dir : rootlibexecdir)
1632 if conf.get('ENABLE_MACHINED', false)
1633 executable('systemd-machined',
1634 systemd_machined_sources,
1635 include_directories : includes,
1636 link_with : [libmachine_core,
1638 install_rpath : rootlibexecdir,
1640 install_dir : rootlibexecdir)
1642 exe = executable('machinectl',
1643 'src/machine/machinectl.c',
1644 include_directories : includes,
1645 link_with : [libshared],
1646 dependencies : [threads,
1649 install_rpath : rootlibexecdir,
1651 install_dir : rootbindir)
1652 public_programs += [exe]
1655 if conf.get('ENABLE_IMPORTD', false)
1656 executable('systemd-importd',
1657 systemd_importd_sources,
1658 include_directories : includes,
1659 link_with : [libshared],
1660 dependencies : [threads],
1661 install_rpath : rootlibexecdir,
1663 install_dir : rootlibexecdir)
1665 systemd_pull = executable('systemd-pull',
1666 systemd_pull_sources,
1667 include_directories : includes,
1668 link_with : [libshared],
1669 dependencies : [libcurl,
1674 install_rpath : rootlibexecdir,
1676 install_dir : rootlibexecdir)
1678 systemd_import = executable('systemd-import',
1679 systemd_import_sources,
1680 include_directories : includes,
1681 link_with : [libshared],
1682 dependencies : [libcurl,
1686 install_rpath : rootlibexecdir,
1688 install_dir : rootlibexecdir)
1690 systemd_export = executable('systemd-export',
1691 systemd_export_sources,
1692 include_directories : includes,
1693 link_with : [libshared],
1694 dependencies : [libcurl,
1698 install_rpath : rootlibexecdir,
1700 install_dir : rootlibexecdir)
1701 public_programs += [systemd_pull, systemd_import, systemd_export]
1704 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1705 exe = executable('systemd-journal-upload',
1706 systemd_journal_upload_sources,
1707 include_directories : includes,
1708 link_with : [libshared],
1709 dependencies : [threads,
1714 install_rpath : rootlibexecdir,
1716 install_dir : rootlibexecdir)
1717 public_programs += [exe]
1720 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1721 s_j_remote = executable('systemd-journal-remote',
1722 systemd_journal_remote_sources,
1723 include_directories : includes,
1724 link_with : [libshared],
1725 dependencies : [threads,
1730 install_rpath : rootlibexecdir,
1732 install_dir : rootlibexecdir)
1734 s_j_gatewayd = executable('systemd-journal-gatewayd',
1735 systemd_journal_gatewayd_sources,
1736 include_directories : includes,
1737 link_with : [libshared],
1738 dependencies : [threads,
1743 install_rpath : rootlibexecdir,
1745 install_dir : rootlibexecdir)
1746 public_programs += [s_j_remote, s_j_gatewayd]
1749 if conf.get('ENABLE_COREDUMP', false)
1750 executable('systemd-coredump',
1751 systemd_coredump_sources,
1752 include_directories : includes,
1753 link_with : [libshared],
1754 dependencies : [threads,
1759 install_rpath : rootlibexecdir,
1761 install_dir : rootlibexecdir)
1763 exe = executable('coredumpctl',
1764 coredumpctl_sources,
1765 include_directories : includes,
1766 link_with : [libshared],
1767 dependencies : [threads,
1770 install_rpath : rootlibexecdir,
1772 public_programs += [exe]
1775 if conf.get('ENABLE_BINFMT', false)
1776 exe = executable('systemd-binfmt',
1777 'src/binfmt/binfmt.c',
1778 include_directories : includes,
1779 link_with : [libshared],
1780 install_rpath : rootlibexecdir,
1782 install_dir : rootlibexecdir)
1783 public_programs += [exe]
1785 meson.add_install_script('sh', '-c',
1786 mkdir_p.format(binfmtdir))
1787 meson.add_install_script('sh', '-c',
1788 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1791 if conf.get('ENABLE_VCONSOLE', false)
1792 executable('systemd-vconsole-setup',
1793 'src/vconsole/vconsole-setup.c',
1794 include_directories : includes,
1795 link_with : [libshared],
1796 install_rpath : rootlibexecdir,
1798 install_dir : rootlibexecdir)
1801 if conf.get('ENABLE_RANDOMSEED', false)
1802 executable('systemd-random-seed',
1803 'src/random-seed/random-seed.c',
1804 include_directories : includes,
1805 link_with : [libshared],
1806 install_rpath : rootlibexecdir,
1808 install_dir : rootlibexecdir)
1811 if conf.get('ENABLE_FIRSTBOOT', false)
1812 executable('systemd-firstboot',
1813 'src/firstboot/firstboot.c',
1814 include_directories : includes,
1815 link_with : [libshared],
1816 dependencies : [libcrypt],
1817 install_rpath : rootlibexecdir,
1819 install_dir : rootbindir)
1822 executable('systemd-remount-fs',
1823 'src/remount-fs/remount-fs.c',
1824 'src/core/mount-setup.c',
1825 'src/core/mount-setup.h',
1826 include_directories : includes,
1827 link_with : [libshared],
1828 install_rpath : rootlibexecdir,
1830 install_dir : rootlibexecdir)
1832 executable('systemd-machine-id-setup',
1833 'src/machine-id-setup/machine-id-setup-main.c',
1834 'src/core/machine-id-setup.c',
1835 'src/core/machine-id-setup.h',
1836 include_directories : includes,
1837 link_with : [libshared],
1838 install_rpath : rootlibexecdir,
1840 install_dir : rootbindir)
1842 executable('systemd-fsck',
1844 include_directories : includes,
1845 link_with : [libshared],
1846 install_rpath : rootlibexecdir,
1848 install_dir : rootlibexecdir)
1850 executable('systemd-sleep',
1851 'src/sleep/sleep.c',
1852 include_directories : includes,
1853 link_with : [libshared],
1854 install_rpath : rootlibexecdir,
1856 install_dir : rootlibexecdir)
1858 exe = executable('systemd-sysctl',
1859 'src/sysctl/sysctl.c',
1860 include_directories : includes,
1861 link_with : [libshared],
1862 install_rpath : rootlibexecdir,
1864 install_dir : rootlibexecdir)
1865 public_programs += [exe]
1867 executable('systemd-ac-power',
1868 'src/ac-power/ac-power.c',
1869 include_directories : includes,
1870 link_with : [libshared],
1871 install_rpath : rootlibexecdir,
1873 install_dir : rootlibexecdir)
1875 exe = executable('systemd-detect-virt',
1876 'src/detect-virt/detect-virt.c',
1877 include_directories : includes,
1878 link_with : [libshared],
1879 install_rpath : rootlibexecdir,
1881 public_programs += [exe]
1883 exe = executable('systemd-delta',
1884 'src/delta/delta.c',
1885 include_directories : includes,
1886 link_with : [libshared],
1887 install_rpath : rootlibexecdir,
1889 public_programs += [exe]
1891 exe = executable('systemd-escape',
1892 'src/escape/escape.c',
1893 include_directories : includes,
1894 link_with : [libshared],
1895 install_rpath : rootlibexecdir,
1897 install_dir : rootbindir)
1898 public_programs += [exe]
1900 exe = executable('systemd-notify',
1901 'src/notify/notify.c',
1902 include_directories : includes,
1903 link_with : [libshared],
1904 install_rpath : rootlibexecdir,
1906 install_dir : rootbindir)
1907 public_programs += [exe]
1909 executable('systemd-volatile-root',
1910 'src/volatile-root/volatile-root.c',
1911 include_directories : includes,
1912 link_with : [libshared],
1913 install_rpath : rootlibexecdir,
1915 install_dir : rootlibexecdir)
1917 executable('systemd-cgroups-agent',
1918 'src/cgroups-agent/cgroups-agent.c',
1919 include_directories : includes,
1920 link_with : [libshared],
1921 install_rpath : rootlibexecdir,
1923 install_dir : rootlibexecdir)
1925 exe = executable('systemd-path',
1927 include_directories : includes,
1928 link_with : [libshared],
1929 install_rpath : rootlibexecdir,
1931 public_programs += [exe]
1933 exe = executable('systemd-ask-password',
1934 'src/ask-password/ask-password.c',
1935 include_directories : includes,
1936 link_with : [libshared],
1937 install_rpath : rootlibexecdir,
1939 install_dir : rootbindir)
1940 public_programs += [exe]
1942 executable('systemd-reply-password',
1943 'src/reply-password/reply-password.c',
1944 include_directories : includes,
1945 link_with : [libshared],
1946 install_rpath : rootlibexecdir,
1948 install_dir : rootlibexecdir)
1950 exe = executable('systemd-tty-ask-password-agent',
1951 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1952 include_directories : includes,
1953 link_with : [libshared],
1954 install_rpath : rootlibexecdir,
1956 install_dir : rootbindir)
1957 public_programs += [exe]
1959 exe = executable('systemd-cgls',
1961 include_directories : includes,
1962 link_with : [libshared],
1963 install_rpath : rootlibexecdir,
1965 public_programs += [exe]
1967 exe = executable('systemd-cgtop',
1968 'src/cgtop/cgtop.c',
1969 include_directories : includes,
1970 link_with : [libshared],
1971 install_rpath : rootlibexecdir,
1973 public_programs += [exe]
1975 executable('systemd-initctl',
1976 'src/initctl/initctl.c',
1977 include_directories : includes,
1978 link_with : [libshared],
1979 install_rpath : rootlibexecdir,
1981 install_dir : rootlibexecdir)
1983 exe = executable('systemd-mount',
1984 'src/mount/mount-tool.c',
1985 include_directories : includes,
1986 link_with : [libshared],
1987 install_rpath : rootlibexecdir,
1989 public_programs += [exe]
1991 meson.add_install_script(meson_make_symlink,
1992 'systemd-mount', join_paths(bindir, 'systemd-umount'))
1994 exe = executable('systemd-run',
1996 include_directories : includes,
1997 link_with : [libshared],
1998 install_rpath : rootlibexecdir,
2000 public_programs += [exe]
2002 exe = executable('systemd-stdio-bridge',
2003 'src/stdio-bridge/stdio-bridge.c',
2004 include_directories : includes,
2005 link_with : [libshared],
2006 install_rpath : rootlibexecdir,
2008 public_programs += [exe]
2010 exe = executable('busctl',
2011 'src/busctl/busctl.c',
2012 'src/busctl/busctl-introspect.c',
2013 'src/busctl/busctl-introspect.h',
2014 include_directories : includes,
2015 link_with : [libshared],
2016 install_rpath : rootlibexecdir,
2018 public_programs += [exe]
2020 if conf.get('ENABLE_SYSUSERS', false)
2021 exe = executable('systemd-sysusers',
2022 'src/sysusers/sysusers.c',
2023 include_directories : includes,
2024 link_with : [libshared],
2025 install_rpath : rootlibexecdir,
2027 install_dir : rootbindir)
2028 public_programs += [exe]
2031 if conf.get('ENABLE_TMPFILES', false)
2032 exe = executable('systemd-tmpfiles',
2033 'src/tmpfiles/tmpfiles.c',
2034 include_directories : includes,
2035 link_with : [libshared],
2036 dependencies : [libacl],
2037 install_rpath : rootlibexecdir,
2039 install_dir : rootbindir)
2040 public_programs += [exe]
2043 if conf.get('ENABLE_HWDB', false)
2044 exe = executable('systemd-hwdb',
2046 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2047 include_directories : includes,
2048 link_with : [libudev_internal],
2049 install_rpath : udev_rpath,
2051 install_dir : rootbindir)
2052 public_programs += [exe]
2055 if conf.get('ENABLE_QUOTACHECK', false)
2056 executable('systemd-quotacheck',
2057 'src/quotacheck/quotacheck.c',
2058 include_directories : includes,
2059 link_with : [libshared],
2060 install_rpath : rootlibexecdir,
2062 install_dir : rootlibexecdir)
2065 exe = executable('systemd-socket-proxyd',
2066 'src/socket-proxy/socket-proxyd.c',
2067 include_directories : includes,
2068 link_with : [libshared],
2069 dependencies : [threads],
2070 install_rpath : rootlibexecdir,
2072 install_dir : rootlibexecdir)
2073 public_programs += [exe]
2075 exe = executable('systemd-udevd',
2076 systemd_udevd_sources,
2077 include_directories : includes,
2078 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2079 link_with : [libudev_core,
2082 dependencies : [threads,
2087 install_rpath : udev_rpath,
2089 install_dir : rootlibexecdir)
2090 public_programs += [exe]
2092 exe = executable('udevadm',
2094 include_directories : includes,
2095 link_with : [libudev_core,
2098 dependencies : [threads,
2103 install_rpath : udev_rpath,
2105 install_dir : rootbindir)
2106 public_programs += [exe]
2108 executable('systemd-shutdown',
2109 systemd_shutdown_sources,
2110 include_directories : includes,
2111 link_with : [libshared],
2112 install_rpath : rootlibexecdir,
2114 install_dir : rootlibexecdir)
2116 executable('systemd-update-done',
2117 'src/update-done/update-done.c',
2118 include_directories : includes,
2119 link_with : [libshared],
2120 install_rpath : rootlibexecdir,
2122 install_dir : rootlibexecdir)
2124 executable('systemd-update-utmp',
2125 'src/update-utmp/update-utmp.c',
2126 include_directories : includes,
2127 link_with : [libshared],
2128 dependencies : [libaudit],
2129 install_rpath : rootlibexecdir,
2131 install_dir : rootlibexecdir)
2133 if conf.get('HAVE_KMOD', false)
2134 executable('systemd-modules-load',
2135 'src/modules-load/modules-load.c',
2136 include_directories : includes,
2137 link_with : [libshared],
2138 dependencies : [libkmod],
2139 install_rpath : rootlibexecdir,
2141 install_dir : rootlibexecdir)
2143 meson.add_install_script('sh', '-c',
2144 mkdir_p.format(modulesloaddir))
2145 meson.add_install_script('sh', '-c',
2146 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2149 exe = executable('systemd-nspawn',
2150 systemd_nspawn_sources,
2151 'src/core/mount-setup.c', # FIXME: use a variable?
2152 'src/core/mount-setup.h',
2153 'src/core/loopback-setup.c',
2154 'src/core/loopback-setup.h',
2155 include_directories : [includes, include_directories('src/nspawn')],
2156 link_with : [libshared],
2157 dependencies : [libacl,
2161 install_rpath : rootlibexecdir,
2163 public_programs += [exe]
2165 if conf.get('ENABLE_NETWORKD', false)
2166 executable('systemd-networkd',
2167 systemd_networkd_sources,
2168 include_directories : includes,
2169 link_with : [libnetworkd_core,
2173 install_rpath : rootlibexecdir,
2175 install_dir : rootlibexecdir)
2177 executable('systemd-networkd-wait-online',
2178 systemd_networkd_wait_online_sources,
2179 include_directories : includes,
2180 link_with : [libnetworkd_core,
2182 install_rpath : rootlibexecdir,
2184 install_dir : rootlibexecdir)
2187 exe = executable('networkctl',
2189 include_directories : includes,
2190 link_with : [libsystemd_network,
2192 install_rpath : rootlibexecdir,
2194 install_dir : rootbindir)
2195 public_programs += [exe]
2197 ############################################################
2199 foreach tuple : tests
2201 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2202 dependencies = tuple[2]
2203 condition = tuple.length() >= 4 ? tuple[3] : ''
2204 type = tuple.length() >= 5 ? tuple[4] : ''
2205 defs = tuple.length() >= 6 ? tuple[5] : []
2206 incs = tuple.length() >= 7 ? tuple[6] : includes
2209 name = sources[0].split('/')[-1].split('.')[0]
2210 if type.startswith('timeout=')
2211 timeout = type.split('=')[1].to_int()
2215 if condition == '' or conf.get(condition, false)
2216 install = install_tests and type == ''
2221 include_directories : incs,
2222 link_with : link_with,
2223 dependencies : dependencies,
2225 install_rpath : rootlibexecdir,
2227 install_dir : testsdir)
2230 message('@0@ is a manual test'.format(name))
2231 elif type == 'unsafe' and want_tests != 'unsafe'
2232 message('@0@ is an unsafe test'.format(name))
2239 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2243 test_libsystemd_sym = executable(
2244 'test-libsystemd-sym',
2245 test_libsystemd_sym_c,
2246 include_directories : includes,
2247 link_with : [libsystemd],
2248 install : install_tests,
2249 install_dir : testsdir)
2250 test('test-libsystemd-sym',
2251 test_libsystemd_sym)
2253 test_libudev_sym = executable(
2256 include_directories : includes,
2257 c_args : ['-Wno-deprecated-declarations'],
2258 link_with : [libudev],
2259 install : install_tests,
2260 install_dir : testsdir)
2261 test('test-libudev-sym',
2264 ############################################################
2266 make_directive_index_py = find_program('tools/make-directive-index.py')
2267 make_man_index_py = find_program('tools/make-man-index.py')
2268 xml_helper_py = find_program('tools/xml_helper.py')
2269 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2273 subdir('sysusers.d')
2274 subdir('tmpfiles.d')
2279 subdir('shell-completion/bash')
2280 subdir('shell-completion/zsh')
2281 subdir('docs/sysvinit')
2282 subdir('docs/var-log')
2284 # FIXME: figure out if the warning is true:
2285 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2286 install_subdir('factory/etc',
2287 install_dir : factorydir)
2290 install_data('xorg/50-systemd-user.sh',
2291 install_dir : xinitrcdir)
2292 install_data('system-preset/90-systemd.preset',
2293 install_dir : systempresetdir)
2294 install_data('README',
2301 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2302 install_dir : docdir)
2304 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2305 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2307 ############################################################
2309 meson_check_help = find_program('tools/meson-check-help.sh')
2311 foreach exec : public_programs
2312 name = exec.full_path().split('/')[-1]
2313 test('check-help-' + name,
2315 args : [exec.full_path()])
2318 ############################################################
2320 if git.found() and etags.found()
2321 all_files = run_command(
2323 ['--git-dir=@0@/.git'.format(meson.source_root()),
2326 all_files = files(all_files.stdout().split())
2332 command : [etags, '-o', '@OUTPUT@'] + all_files)
2336 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2339 command : [meson_git_contrib_sh])
2343 git_head = run_command(
2345 ['--git-dir=@0@/.git'.format(meson.source_root()),
2346 'rev-parse', 'HEAD']).stdout().strip()
2347 git_head_short = run_command(
2349 ['--git-dir=@0@/.git'.format(meson.source_root()),
2350 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2354 command : ['git', 'archive',
2355 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2357 '--prefix', 'systemd-@0@/'.format(git_head),
2361 ############################################################
2364 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2366 'prefix: @0@'.format(prefixdir),
2367 'rootprefix: @0@'.format(rootprefixdir),
2368 'sysconf dir: @0@'.format(sysconfdir),
2369 'includedir: @0@'.format(includedir),
2370 'lib dir: @0@'.format(libdir),
2371 'rootlib dir: @0@'.format(rootlibdir),
2372 'SysV init scripts: @0@'.format(sysvinit_path),
2373 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2374 'PAM modules dir: @0@'.format(pamlibdir),
2375 'PAM configuration dir: @0@'.format(pamconfdir),
2376 'RPM macros dir: @0@'.format(rpmmacrosdir),
2377 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2378 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2379 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2380 'bash completions dir: @0@'.format(bashcompletiondir),
2381 'zsh completions dir: @0@'.format(zshcompletiondir),
2382 'extra start script: @0@'.format(get_option('rc-local')),
2383 'extra stop script: @0@'.format(get_option('halt-local')),
2384 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2385 get_option('debug-tty')),
2386 'TTY GID: @0@'.format(tty_gid),
2387 'maximum system UID: @0@'.format(system_uid_max),
2388 'maximum system GID: @0@'.format(system_gid_max),
2389 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2390 'certificate root: @0@'.format(get_option('certificate-root')),
2391 'support URL: @0@'.format(support_url),
2392 'nobody user name: @0@'.format(get_option('nobody-user')),
2393 'nobody group name: @0@'.format(get_option('nobody-group')),
2394 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2396 'default DNSSEC mode: @0@'.format(default_dnssec),
2397 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2398 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2400 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2401 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2403 'default DNS servers: @0@'.format(alt_dns_servers),
2404 'default NTP servers: @0@'.format(alt_ntp_servers)]
2406 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2407 '@@0@'.format(time_epoch)).stdout().strip()
2409 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2412 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2413 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2414 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2416 if conf.get('ENABLE_EFI', false)
2418 'efi arch: @0@'.format(efi_arch)]
2422 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2423 'EFI CC @0@'.format(efi_cc),
2424 'EFI libdir: @0@'.format(efi_libdir),
2425 'EFI ldsdir: @0@'.format(efi_ldsdir),
2426 'EFI includedir: @0@'.format(efi_incdir)]
2477 ['legacy pkla', install_polkit_pkla],
2479 ['gnu-efi', have_gnu_efi],
2485 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2488 ['man pages', want_man],
2489 ['html pages', want_html],
2490 ['man page indices', want_man and have_lxml],
2491 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2496 ['adm group', get_option('adm-group')],
2497 ['wheel group', get_option('wheel-group')],
2500 ['debug mmap cache'],
2503 cond = tuple.get(1, '')
2505 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2506 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2507 cond = conf.get(ident1, false) or conf.get(ident2, false)
2512 missing += [tuple[0]]
2517 'enabled features: @0@'.format(', '.join(found)),
2518 'disabled features: @0@'.format(', '.join(missing))]
2519 message('\n '.join(status))