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', 1)
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', 1,
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 foreach arg : ['-Wundef',
229 '-Wmissing-include-dirs',
230 '-Wold-style-definition',
233 '-Wdeclaration-after-statement',
235 '-Wsuggest-attribute=noreturn',
236 '-Werror=missing-prototypes',
237 '-Werror=implicit-function-declaration',
238 '-Werror=missing-declarations',
239 '-Werror=return-type',
240 '-Werror=incompatible-pointer-types',
242 '-Wstrict-prototypes',
244 '-Wmissing-noreturn',
247 '-Wstrict-aliasing=2',
254 '-fdiagnostics-show-option',
255 '-fno-strict-aliasing',
256 '-fvisibility=hidden',
258 '-fstack-protector-strong',
260 '--param=ssp-buffer-size=4',
262 if cc.has_argument(arg)
263 add_project_arguments(arg, language : 'c')
267 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
268 # arguments, just emits a warnings. So test for the "positive" version instead.
269 foreach arg : ['unused-parameter',
270 'missing-field-initializers',
273 if cc.has_argument('-W' + arg)
274 add_project_arguments('-Wno-' + arg, language : 'c')
280 #include <inttypes.h>
281 typedef uint64_t usec_t;
282 usec_t now(clockid_t clock);
287 ', name : '-Werror=shadow with local shadowing')
288 add_project_arguments('-Werror=shadow', language : 'c')
291 if cc.get_id() == 'clang'
292 foreach arg : ['-Wno-typedef-redefinition',
293 '-Wno-gnu-variable-sized-type-not-at-end',
295 if cc.has_argument(arg,
296 name : '@0@ is supported'.format(arg))
297 add_project_arguments(arg, language : 'c')
302 link_test_c = files('tools/meson-link-test.c')
304 # --as-needed and --no-undefined are provided by meson by default,
305 # run mesonconf to see what is enabled
306 foreach arg : ['-Wl,-z,relro',
312 have = run_command(check_compilation_sh,
313 cc.cmd_array(), '-x', 'c', arg,
314 '-include', link_test_c).returncode() == 0
315 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
317 add_project_link_arguments(arg, language : 'c')
321 if get_option('buildtype') != 'debug'
322 foreach arg : ['-ffunction-sections',
324 if cc.has_argument(arg,
325 name : '@0@ is supported'.format(arg))
326 add_project_arguments(arg, language : 'c')
330 foreach arg : ['-Wl,--gc-sections']
331 have = run_command(check_compilation_sh,
332 cc.cmd_array(), '-x', 'c', arg,
333 '-include', link_test_c).returncode() == 0
334 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
336 add_project_link_arguments(arg, language : 'c')
341 cpp = ' '.join(cc.cmd_array()) + ' -E'
343 #####################################################################
344 # compilation result tests
346 conf.set('_GNU_SOURCE', 1)
347 conf.set('__SANE_USERSPACE_TYPES__', 1)
349 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
350 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
351 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
352 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
353 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
354 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
355 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
359 #include <linux/ethtool.h>
361 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
363 foreach decl : ['char16_t',
366 'struct ethtool_link_settings',
368 if cc.sizeof(decl, prefix : decl_headers) > 0
369 # We get -1 if the size cannot be determined
370 conf.set('HAVE_' + decl.underscorify().to_upper(), 1)
374 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
375 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
376 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
377 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
378 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
379 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
380 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
381 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
382 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
383 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
384 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
385 # if_tunnel.h is buggy and cannot be included on its own
386 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
387 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
388 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
389 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
390 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
391 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
392 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
393 ['NDA_IFINDEX', 'linux/neighbour.h'],
394 ['IFA_FLAGS', 'linux/if_addr.h'],
395 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
397 prefix = decl.length() > 2 ? decl[2] : ''
398 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
399 conf.set10('HAVE_DECL_' + decl[0], have)
403 foreach ident : ['secure_getenv', '__secure_getenv']
404 if not skip and cc.has_function(ident)
405 conf.set('HAVE_' + ident.to_upper(), 1)
411 ['memfd_create', '''#include <sys/memfd.h>'''],
412 ['gettid', '''#include <sys/types.h>'''],
413 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
414 ['name_to_handle_at', '''#define _GNU_SOURCE
415 #include <sys/types.h>
416 #include <sys/stat.h>
417 #include <fcntl.h>'''],
418 ['setns', '''#define _GNU_SOURCE
419 #include <sched.h>'''],
420 ['renameat2', '''#include <stdio.h>'''],
421 ['kcmp', '''#include <linux/kcmp.h>'''],
422 ['keyctl', '''#include <sys/types.h>
423 #include <keyutils.h>'''],
424 ['copy_file_range', '''#include <sys/syscall.h>
425 #include <unistd.h>'''],
426 ['explicit_bzero' , '''#include <string.h>'''],
429 have = cc.has_function(ident[0], prefix : ident[1])
430 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
433 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
434 conf.set('USE_SYS_RANDOM_H', 1)
435 conf.set10('HAVE_DECL_GETRANDOM', 1)
437 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
438 conf.set10('HAVE_DECL_GETRANDOM', have)
441 #####################################################################
443 sed = find_program('sed')
444 grep = find_program('grep')
445 awk = find_program('awk')
446 m4 = find_program('m4')
447 stat = find_program('stat')
448 git = find_program('git', required : false)
449 etags = find_program('etags', required : false)
451 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
452 mkdir_p = 'mkdir -p $DESTDIR/@0@'
453 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
454 splash_bmp = files('test/splash.bmp')
456 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
457 # /usr/sbin, /sbin, and fall back to the default from middle column.
458 progs = [['telinit', '/lib/sysvinit/telinit'],
459 ['quotaon', '/usr/sbin/quotaon' ],
460 ['quotacheck', '/usr/sbin/quotacheck' ],
461 ['kill', '/usr/bin/kill' ],
462 ['kmod', '/usr/bin/kmod' ],
463 ['kexec', '/usr/sbin/kexec' ],
464 ['sulogin', '/usr/sbin/sulogin' ],
465 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
466 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
467 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
468 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
471 path = get_option(prog[0] + '-path')
473 message('Using @1@ for @0@'.format(prog[0], path))
475 exe = find_program(prog[0],
476 '/usr/sbin/' + prog[0],
479 path = exe.found() ? exe.path() : prog[1]
481 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
482 conf.set_quoted(name, path)
483 substs.set(name, path)
486 if run_command('ln', '--relative', '--help').returncode() != 0
487 error('ln does not support --relative')
490 ############################################################
492 gperf = find_program('gperf')
494 gperf_test_format = '''
496 const char * in_word_set(const char *, @0@);
499 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
500 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
501 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
502 if cc.compiles(gperf_test)
503 gperf_len_type = 'size_t'
505 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
506 if cc.compiles(gperf_test)
507 gperf_len_type = 'unsigned'
509 error('unable to determine gperf len type')
512 message('gperf len type is @0@'.format(gperf_len_type))
513 conf.set('GPERF_LEN_TYPE', gperf_len_type,
514 description : 'The type of gperf "len" parameter')
516 ############################################################
518 if not cc.has_header('sys/capability.h')
519 error('POSIX caps headers not found')
521 foreach header : ['linux/btrfs.h',
523 'linux/vm_sockets.h',
524 'valgrind/memcheck.h',
525 'valgrind/valgrind.h',
527 if cc.has_header(header)
528 conf.set('HAVE_' + header.underscorify().to_upper(), 1)
532 ############################################################
534 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
536 default_hierarchy = get_option('default-hierarchy')
537 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
538 description : 'default cgroup hierarchy as string')
539 if default_hierarchy == 'legacy'
540 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
541 elif default_hierarchy == 'hybrid'
542 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
544 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
547 time_epoch = get_option('time-epoch')
550 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
552 time_epoch = time_epoch.to_int()
553 conf.set('TIME_EPOCH', time_epoch)
555 system_uid_max = get_option('system-uid-max')
556 if system_uid_max == ''
557 system_uid_max = run_command(
559 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
560 '/etc/login.defs').stdout()
562 system_uid_max = system_uid_max.to_int()
563 conf.set('SYSTEM_UID_MAX', system_uid_max)
564 substs.set('systemuidmax', system_uid_max)
565 message('maximum system UID is @0@'.format(system_uid_max))
567 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
568 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
570 system_gid_max = get_option('system-gid-max')
571 if system_gid_max == ''
572 system_gid_max = run_command(
574 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
575 '/etc/login.defs').stdout()
577 system_gid_max = system_gid_max.to_int()
578 conf.set('SYSTEM_GID_MAX', system_gid_max)
579 substs.set('systemgidmax', system_gid_max)
580 message('maximum system GID is @0@'.format(system_gid_max))
582 tty_gid = get_option('tty-gid')
583 conf.set('TTY_GID', tty_gid)
584 substs.set('TTY_GID', tty_gid)
586 if get_option('adm-group')
587 m4_defines += ['-DENABLE_ADM_GROUP']
590 if get_option('wheel-group')
591 m4_defines += ['-DENABLE_WHEEL_GROUP']
594 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
596 kill_user_processes = get_option('default-kill-user-processes')
597 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
598 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
600 default_dnssec = get_option('default-dnssec')
601 conf.set('DEFAULT_DNSSEC_MODE',
602 'DNSSEC_' + default_dnssec.underscorify().to_upper())
603 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
605 conf.set_quoted('DNS_SERVERS', get_option('dns-servers'))
606 substs.set('DNS_SERVERS', get_option('dns-servers'))
608 conf.set_quoted('NTP_SERVERS', get_option('ntp-servers'))
609 substs.set('NTP_SERVERS', get_option('ntp-servers'))
611 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
613 substs.set('SUSHELL', get_option('debug-shell'))
614 substs.set('DEBUGTTY', get_option('debug-tty'))
616 #####################################################################
618 threads = dependency('threads')
619 librt = cc.find_library('rt')
620 libm = cc.find_library('m')
621 libdl = cc.find_library('dl')
622 libcrypt = cc.find_library('crypt')
624 libcap = dependency('libcap', required : false)
625 if not libcap.found()
626 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
627 libcap = cc.find_library('cap')
630 libmount = dependency('mount',
633 want_seccomp = get_option('seccomp')
634 if want_seccomp != 'false'
635 libseccomp = dependency('libseccomp',
636 version : '>= 2.3.1',
637 required : want_seccomp == 'true')
638 if libseccomp.found()
639 conf.set('HAVE_SECCOMP', 1)
640 m4_defines += ['-DHAVE_SECCOMP']
646 want_selinux = get_option('selinux')
647 if want_selinux != 'false'
648 libselinux = dependency('libselinux',
649 version : '>= 2.1.9',
650 required : want_selinux == 'true')
651 if libselinux.found()
652 conf.set('HAVE_SELINUX', 1)
653 m4_defines += ['-DHAVE_SELINUX']
659 want_apparmor = get_option('apparmor')
660 if want_apparmor != 'false'
661 libapparmor = dependency('libapparmor',
662 required : want_apparmor == 'true')
663 if libapparmor.found()
664 conf.set('HAVE_APPARMOR', 1)
665 m4_defines += ['-DHAVE_APPARMOR']
671 smack_run_label = get_option('smack-run-label')
672 if smack_run_label != ''
673 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
674 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
677 want_polkit = get_option('polkit')
678 install_polkit = false
679 install_polkit_pkla = false
680 if want_polkit != 'false'
681 conf.set('ENABLE_POLKIT', 1)
682 install_polkit = true
684 libpolkit = dependency('polkit-gobject-1',
686 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
687 message('Old polkit detected, will install pkla files')
688 install_polkit_pkla = true
692 want_acl = get_option('acl')
693 if want_acl != 'false'
694 libacl = cc.find_library('acl', required : want_acl == 'true')
696 conf.set('HAVE_ACL', 1)
697 m4_defines += ['-DHAVE_ACL']
703 want_audit = get_option('audit')
704 if want_audit != 'false'
705 libaudit = dependency('audit', required : want_audit == 'true')
707 conf.set('HAVE_AUDIT', 1)
713 want_blkid = get_option('blkid')
714 if want_blkid != 'false'
715 libblkid = dependency('blkid', required : want_blkid == 'true')
717 conf.set('HAVE_BLKID', 1)
723 want_kmod = get_option('kmod')
724 if want_kmod != 'false'
725 libkmod = dependency('libkmod',
727 required : want_kmod == 'true')
729 conf.set('HAVE_KMOD', 1)
735 want_pam = get_option('pam')
736 if want_pam != 'false'
737 libpam = cc.find_library('pam', required : want_pam == 'true')
738 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
739 if libpam.found() and libpam_misc.found()
740 conf.set('HAVE_PAM', 1)
741 m4_defines += ['-DHAVE_PAM']
748 want_microhttpd = get_option('microhttpd')
749 if want_microhttpd != 'false'
750 libmicrohttpd = dependency('libmicrohttpd',
751 version : '>= 0.9.33',
752 required : want_microhttpd == 'true')
753 if libmicrohttpd.found()
754 conf.set('HAVE_MICROHTTPD', 1)
755 m4_defines += ['-DHAVE_MICROHTTPD']
761 want_libcryptsetup = get_option('libcryptsetup')
762 if want_libcryptsetup != 'false'
763 libcryptsetup = dependency('libcryptsetup',
764 version : '>= 1.6.0',
765 required : want_libcryptsetup == 'true')
766 if libcryptsetup.found()
767 conf.set('HAVE_LIBCRYPTSETUP', 1)
773 want_libcurl = get_option('libcurl')
774 if want_libcurl != 'false'
775 libcurl = dependency('libcurl',
776 version : '>= 7.32.0',
777 required : want_libcurl == 'true')
779 conf.set('HAVE_LIBCURL', 1)
780 m4_defines += ['-DHAVE_LIBCURL']
786 want_libidn = get_option('libidn')
787 if want_libidn != 'false'
788 libidn = dependency('libidn',
789 required : want_libidn == 'true')
791 conf.set('HAVE_LIBIDN', 1)
792 m4_defines += ['-DHAVE_LIBIDN']
798 want_libiptc = get_option('libiptc')
799 if want_libiptc != 'false'
800 libiptc = dependency('libiptc',
801 required : want_libiptc == 'true')
803 conf.set('HAVE_LIBIPTC', 1)
804 m4_defines += ['-DHAVE_LIBIPTC']
810 want_qrencode = get_option('qrencode')
811 if want_qrencode != 'false'
812 libqrencode = dependency('libqrencode',
813 required : want_qrencode == 'true')
814 if libqrencode.found()
815 conf.set('HAVE_QRENCODE', 1)
821 want_gnutls = get_option('gnutls')
822 if want_gnutls != 'false'
823 libgnutls = dependency('gnutls',
824 version : '>= 3.1.4',
825 required : want_gnutls == 'true')
827 conf.set('HAVE_GNUTLS', 1)
833 want_elfutils = get_option('elfutils')
834 if want_elfutils != 'false'
835 libdw = dependency('libdw',
836 required : want_elfutils == 'true')
838 conf.set('HAVE_ELFUTILS', 1)
844 want_zlib = get_option('zlib')
845 if want_zlib != 'false'
846 libz = dependency('zlib',
847 required : want_zlib == 'true')
849 conf.set('HAVE_ZLIB', 1)
855 want_bzip2 = get_option('bzip2')
856 if want_bzip2 != 'false'
857 libbzip2 = cc.find_library('bz2',
858 required : want_bzip2 == 'true')
860 conf.set('HAVE_BZIP2', 1)
866 want_xz = get_option('xz')
867 if want_xz != 'false'
868 libxz = dependency('liblzma',
869 required : want_xz == 'true')
871 conf.set('HAVE_XZ', 1)
877 want_lz4 = get_option('lz4')
878 if want_lz4 != 'false'
879 liblz4 = dependency('liblz4',
880 required : want_lz4 == 'true')
882 conf.set('HAVE_LZ4', 1)
888 want_glib = get_option('glib')
889 if want_glib != 'false'
890 libglib = dependency('glib-2.0',
891 version : '>= 2.22.0',
892 required : want_glib == 'true')
893 libgobject = dependency('gobject-2.0',
894 version : '>= 2.22.0',
895 required : want_glib == 'true')
896 libgio = dependency('gio-2.0',
897 required : want_glib == 'true')
898 if libglib.found() and libgobject.found() and libgio.found()
899 conf.set('HAVE_GLIB', 1)
907 want_xkbcommon = get_option('xkbcommon')
908 if want_xkbcommon != 'false'
909 libxkbcommon = dependency('xkbcommon',
910 version : '>= 0.3.0',
911 required : want_xkbcommon == 'true')
912 if libxkbcommon.found()
913 conf.set('HAVE_XKBCOMMON', 1)
919 want_dbus = get_option('dbus')
920 if want_dbus != 'false'
921 libdbus = dependency('dbus-1',
922 version : '>= 1.3.2',
923 required : want_dbus == 'true')
925 conf.set('HAVE_DBUS', 1)
931 want_gcrypt = get_option('gcrypt')
932 if want_gcrypt != 'false'
933 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
934 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
936 if libgcrypt.found() and libgpg_error.found()
937 conf.set('HAVE_GCRYPT', 1)
939 # link to neither of the libs if one is not found
948 want_importd = get_option('importd')
949 if want_importd != 'false'
950 have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and
951 conf.get('HAVE_ZLIB', 0) == 1 and
952 conf.get('HAVE_BZIP2', 0) == 1 and
953 conf.get('HAVE_XZ', 0) == 1 and
954 conf.get('HAVE_GCRYPT', 0) == 1)
956 conf.set('ENABLE_IMPORTD', 1)
957 elif want_importd == 'true'
958 error('importd support was requested, but dependencies are not available')
962 want_remote = get_option('remote')
963 if want_remote != 'false'
964 have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1,
965 conf.get('HAVE_LIBCURL', 0) == 1]
966 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
967 # it's possible to build one without the other. Complain only if
968 # support was explictly requested. The auxiliary files like sysusers
969 # config should be installed when any of the programs are built.
970 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
971 error('remote support was requested, but dependencies are not available')
973 if have_deps[0] or have_deps[1]
974 conf.set('ENABLE_REMOTE', 1)
978 foreach pair : [['utmp', 'HAVE_UTMP'],
979 ['hibernate', 'ENABLE_HIBERNATE'],
980 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
981 ['binfmt', 'ENABLE_BINFMT'],
982 ['coredump', 'ENABLE_COREDUMP'],
983 ['resolve', 'ENABLE_RESOLVED'],
984 ['logind', 'ENABLE_LOGIND'],
985 ['hostnamed', 'ENABLE_HOSTNAMED'],
986 ['localed', 'ENABLE_LOCALED'],
987 ['machined', 'ENABLE_MACHINED'],
988 ['networkd', 'ENABLE_NETWORKD'],
989 ['timedated', 'ENABLE_TIMEDATED'],
990 ['timesyncd', 'ENABLE_TIMESYNCD'],
991 ['myhostname', 'HAVE_MYHOSTNAME'],
992 ['firstboot', 'ENABLE_FIRSTBOOT'],
993 ['randomseed', 'ENABLE_RANDOMSEED'],
994 ['backlight', 'ENABLE_BACKLIGHT'],
995 ['vconsole', 'ENABLE_VCONSOLE'],
996 ['quotacheck', 'ENABLE_QUOTACHECK'],
997 ['sysusers', 'ENABLE_SYSUSERS'],
998 ['tmpfiles', 'ENABLE_TMPFILES'],
999 ['hwdb', 'ENABLE_HWDB'],
1000 ['rfkill', 'ENABLE_RFKILL'],
1001 ['ldconfig', 'ENABLE_LDCONFIG'],
1002 ['efi', 'ENABLE_EFI'],
1003 ['tpm', 'SD_BOOT_LOG_TPM'],
1004 ['ima', 'HAVE_IMA'],
1005 ['smack', 'HAVE_SMACK'],
1008 if get_option(pair[0])
1009 conf.set(pair[1], 1)
1010 m4_defines += ['-D' + pair[1]]
1014 want_tests = get_option('tests')
1015 install_tests = get_option('install-tests')
1018 #####################################################################
1020 if get_option('efi')
1021 efi_arch = host_machine.cpu_family()
1023 if efi_arch == 'x86'
1024 EFI_MACHINE_TYPE_NAME = 'ia32'
1025 gnu_efi_arch = 'ia32'
1026 elif efi_arch == 'x86_64'
1027 EFI_MACHINE_TYPE_NAME = 'x64'
1028 gnu_efi_arch = 'x86_64'
1029 elif efi_arch == 'arm'
1030 EFI_MACHINE_TYPE_NAME = 'arm'
1031 gnu_efi_arch = 'arm'
1032 elif efi_arch == 'aarch64'
1033 EFI_MACHINE_TYPE_NAME = 'aa64'
1034 gnu_efi_arch = 'aarch64'
1036 EFI_MACHINE_TYPE_NAME = ''
1040 conf.set('ENABLE_EFI', 1)
1041 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1043 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1046 #####################################################################
1048 config_h = configure_file(
1049 output : 'config.h',
1050 configuration : conf)
1052 includes = include_directories('src/basic',
1062 'src/libsystemd/sd-bus',
1063 'src/libsystemd/sd-device',
1064 'src/libsystemd/sd-hwdb',
1065 'src/libsystemd/sd-id128',
1066 'src/libsystemd/sd-netlink',
1067 'src/libsystemd/sd-network',
1068 'src/libsystemd-network',
1071 add_project_arguments('-include', 'config.h', language : 'c')
1073 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1074 'src/shared/gcrypt-util.c')
1078 subdir('src/systemd')
1080 subdir('src/libsystemd')
1081 subdir('src/libsystemd-network')
1082 subdir('src/journal')
1085 libjournal_core = static_library(
1087 libjournal_core_sources,
1089 include_directories : includes,
1092 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1093 libsystemd = shared_library(
1095 libsystemd_internal_sources,
1096 journal_internal_sources,
1098 include_directories : includes,
1099 link_args : ['-shared',
1100 '-Wl,--version-script=' + libsystemd_sym_path],
1101 link_with : [libbasic],
1102 dependencies : [threads,
1107 link_depends : libsystemd_sym,
1109 install_dir : rootlibdir)
1111 ############################################################
1113 # binaries that have --help and are intended for use by humans,
1114 # usually, but not always, installed in /bin.
1115 public_programs = []
1117 subdir('src/libudev')
1118 subdir('src/shared')
1121 subdir('src/network')
1123 subdir('src/analyze')
1124 subdir('src/journal-remote')
1125 subdir('src/coredump')
1126 subdir('src/hostname')
1127 subdir('src/import')
1128 subdir('src/kernel-install')
1129 subdir('src/locale')
1130 subdir('src/machine')
1131 subdir('src/nspawn')
1132 subdir('src/resolve')
1133 subdir('src/timedate')
1134 subdir('src/timesync')
1135 subdir('src/vconsole')
1136 subdir('src/sulogin-shell')
1137 subdir('src/boot/efi')
1142 ############################################################
1144 # only static linking apart from libdl, to make sure that the
1145 # module is linked to all libraries that it uses.
1146 test_dlopen = executable(
1149 include_directories : includes,
1150 link_with : [libbasic],
1151 dependencies : [libdl])
1153 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
1154 ['systemd', '', []],
1155 ['mymachines', 'ENABLE_MACHINED', []],
1156 ['resolve', 'ENABLE_RESOLVED', [libdl]]]
1158 condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1
1161 extra_deps = tuple[2]
1163 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1164 version_script_arg = join_paths(meson.current_source_dir(), sym)
1166 nss = shared_library(
1168 'src/nss-@0@/nss-@0@.c'.format(module),
1170 include_directories : includes,
1171 link_args : ['-shared',
1172 '-Wl,--version-script=' + version_script_arg,
1174 link_with : [libsystemd_internal,
1176 dependencies : [threads,
1177 librt] + extra_deps,
1180 install_dir : rootlibdir)
1182 # We cannot use shared_module because it does not support version suffix.
1183 # Unfortunately shared_library insists on creating the symlink…
1184 meson.add_install_script('sh', '-c',
1185 'rm $DESTDIR@0@/libnss_@1@.so'
1186 .format(rootlibdir, module))
1188 test('dlopen-nss_' + module,
1190 args : [nss.full_path()]) # path to dlopen must include a slash
1194 ############################################################
1196 executable('systemd',
1198 include_directories : includes,
1199 link_with : [libcore,
1201 dependencies : [threads,
1207 install_rpath : rootlibexecdir,
1209 install_dir : rootlibexecdir)
1211 exe = executable('systemd-analyze',
1212 systemd_analyze_sources,
1213 include_directories : includes,
1214 link_with : [libcore,
1216 dependencies : [threads,
1222 install_rpath : rootlibexecdir,
1224 public_programs += [exe]
1226 executable('systemd-journald',
1227 systemd_journald_sources,
1228 include_directories : includes,
1229 link_with : [libjournal_core,
1231 dependencies : [threads,
1235 install_rpath : rootlibexecdir,
1237 install_dir : rootlibexecdir)
1239 exe = executable('systemd-cat',
1240 systemd_cat_sources,
1241 include_directories : includes,
1242 link_with : [libjournal_core,
1244 dependencies : [threads],
1245 install_rpath : rootlibexecdir,
1247 public_programs += [exe]
1249 exe = executable('journalctl',
1251 include_directories : includes,
1252 link_with : [libshared],
1253 dependencies : [threads,
1257 install_rpath : rootlibexecdir,
1259 install_dir : rootbindir)
1260 public_programs += [exe]
1262 executable('systemd-getty-generator',
1263 'src/getty-generator/getty-generator.c',
1264 include_directories : includes,
1265 link_with : [libshared],
1266 install_rpath : rootlibexecdir,
1268 install_dir : systemgeneratordir)
1270 executable('systemd-debug-generator',
1271 'src/debug-generator/debug-generator.c',
1272 include_directories : includes,
1273 link_with : [libshared],
1274 install_rpath : rootlibexecdir,
1276 install_dir : systemgeneratordir)
1278 executable('systemd-fstab-generator',
1279 'src/fstab-generator/fstab-generator.c',
1280 'src/core/mount-setup.c',
1281 include_directories : includes,
1282 link_with : [libshared],
1283 install_rpath : rootlibexecdir,
1285 install_dir : systemgeneratordir)
1287 if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
1288 executable('30-systemd-environment-d-generator',
1289 'src/environment-d-generator/environment-d-generator.c',
1290 include_directories : includes,
1291 link_with : [libshared],
1292 install_rpath : rootlibexecdir,
1294 install_dir : userenvgeneratordir)
1296 meson.add_install_script(meson_make_symlink,
1297 join_paths(sysconfdir, 'environment'),
1298 join_paths(environmentdir, '99-environment.conf'))
1301 if conf.get('ENABLE_HIBERNATE', 0) == 1
1302 executable('systemd-hibernate-resume-generator',
1303 'src/hibernate-resume/hibernate-resume-generator.c',
1304 include_directories : includes,
1305 link_with : [libshared],
1306 install_rpath : rootlibexecdir,
1308 install_dir : systemgeneratordir)
1310 executable('systemd-hibernate-resume',
1311 'src/hibernate-resume/hibernate-resume.c',
1312 include_directories : includes,
1313 link_with : [libshared],
1314 install_rpath : rootlibexecdir,
1316 install_dir : rootlibexecdir)
1319 if conf.get('HAVE_BLKID', 0) == 1
1320 executable('systemd-gpt-auto-generator',
1321 'src/gpt-auto-generator/gpt-auto-generator.c',
1322 'src/basic/blkid-util.h',
1323 include_directories : includes,
1324 link_with : [libshared],
1325 dependencies : libblkid,
1326 install_rpath : rootlibexecdir,
1328 install_dir : systemgeneratordir)
1330 exe = executable('systemd-dissect',
1331 'src/dissect/dissect.c',
1332 include_directories : includes,
1333 link_with : [libshared],
1334 install_rpath : rootlibexecdir,
1336 install_dir : rootlibexecdir)
1337 public_programs += [exe]
1340 if conf.get('ENABLE_RESOLVED', 0) == 1
1341 executable('systemd-resolved',
1342 systemd_resolved_sources,
1343 gcrypt_util_sources,
1344 include_directories : includes,
1345 link_with : [libshared],
1346 dependencies : [threads,
1351 install_rpath : rootlibexecdir,
1353 install_dir : rootlibexecdir)
1355 exe = executable('systemd-resolve',
1356 systemd_resolve_sources,
1357 gcrypt_util_sources,
1358 include_directories : includes,
1359 link_with : [libshared],
1360 dependencies : [threads,
1365 install_rpath : rootlibexecdir,
1367 public_programs += [exe]
1370 if conf.get('ENABLE_LOGIND', 0) == 1
1371 executable('systemd-logind',
1372 systemd_logind_sources,
1373 include_directories : includes,
1374 link_with : [liblogind_core,
1376 dependencies : [threads,
1378 install_rpath : rootlibexecdir,
1380 install_dir : rootlibexecdir)
1382 exe = executable('loginctl',
1384 include_directories : includes,
1385 link_with : [libshared],
1386 dependencies : [threads,
1389 install_rpath : rootlibexecdir,
1391 install_dir : rootbindir)
1392 public_programs += [exe]
1394 exe = executable('systemd-inhibit',
1395 'src/login/inhibit.c',
1396 include_directories : includes,
1397 link_with : [libshared],
1398 install_rpath : rootlibexecdir,
1400 install_dir : rootbindir)
1401 public_programs += [exe]
1403 if conf.get('HAVE_PAM', 0) == 1
1404 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1405 pam_systemd = shared_library(
1409 include_directories : includes,
1410 link_args : ['-shared',
1411 '-Wl,--version-script=' + version_script_arg],
1412 link_with : [libsystemd_internal,
1414 dependencies : [threads,
1417 link_depends : pam_systemd_sym,
1419 install_dir : pamlibdir)
1421 test('dlopen-pam_systemd',
1423 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1427 if conf.get('HAVE_PAM', 0) == 1
1428 executable('systemd-user-sessions',
1429 'src/user-sessions/user-sessions.c',
1430 include_directories : includes,
1431 link_with : [libshared],
1432 install_rpath : rootlibexecdir,
1434 install_dir : rootlibexecdir)
1437 if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1
1438 exe = executable('bootctl',
1439 'src/boot/bootctl.c',
1440 include_directories : includes,
1441 link_with : [libshared],
1442 dependencies : [libblkid],
1443 install_rpath : rootlibexecdir,
1445 public_programs += [exe]
1448 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1449 include_directories : includes,
1450 link_with : [libshared],
1451 dependencies : [threads],
1452 install_rpath : rootlibexecdir,
1454 public_programs += [exe]
1456 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1457 include_directories : includes,
1458 link_with : [libshared],
1459 dependencies : [threads,
1464 install_rpath : rootlibexecdir,
1466 install_dir : rootbindir)
1467 public_programs += [exe]
1469 if conf.get('ENABLE_BACKLIGHT', 0) == 1
1470 executable('systemd-backlight',
1471 'src/backlight/backlight.c',
1472 include_directories : includes,
1473 link_with : [libshared],
1474 install_rpath : rootlibexecdir,
1476 install_dir : rootlibexecdir)
1479 if conf.get('ENABLE_RFKILL', 0) == 1
1480 executable('systemd-rfkill',
1481 'src/rfkill/rfkill.c',
1482 include_directories : includes,
1483 link_with : [libshared],
1484 install_rpath : rootlibexecdir,
1486 install_dir : rootlibexecdir)
1489 executable('systemd-system-update-generator',
1490 'src/system-update-generator/system-update-generator.c',
1491 include_directories : includes,
1492 link_with : [libshared],
1493 install_rpath : rootlibexecdir,
1495 install_dir : systemgeneratordir)
1497 if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
1498 executable('systemd-cryptsetup',
1499 'src/cryptsetup/cryptsetup.c',
1500 include_directories : includes,
1501 link_with : [libshared],
1502 dependencies : [libcryptsetup],
1503 install_rpath : rootlibexecdir,
1505 install_dir : rootlibexecdir)
1507 executable('systemd-cryptsetup-generator',
1508 'src/cryptsetup/cryptsetup-generator.c',
1509 include_directories : includes,
1510 link_with : [libshared],
1511 dependencies : [libcryptsetup],
1512 install_rpath : rootlibexecdir,
1514 install_dir : systemgeneratordir)
1516 executable('systemd-veritysetup',
1517 'src/veritysetup/veritysetup.c',
1518 include_directories : includes,
1519 link_with : [libshared],
1520 dependencies : [libcryptsetup],
1521 install_rpath : rootlibexecdir,
1523 install_dir : rootlibexecdir)
1525 executable('systemd-veritysetup-generator',
1526 'src/veritysetup/veritysetup-generator.c',
1527 include_directories : includes,
1528 link_with : [libshared],
1529 dependencies : [libcryptsetup],
1530 install_rpath : rootlibexecdir,
1532 install_dir : systemgeneratordir)
1535 if conf.get('HAVE_SYSV_COMPAT', 0) == 1
1536 executable('systemd-sysv-generator',
1537 'src/sysv-generator/sysv-generator.c',
1538 include_directories : includes,
1539 link_with : [libshared],
1540 install_rpath : rootlibexecdir,
1542 install_dir : systemgeneratordir)
1544 executable('systemd-rc-local-generator',
1545 'src/rc-local-generator/rc-local-generator.c',
1546 include_directories : includes,
1547 link_with : [libshared],
1548 install_rpath : rootlibexecdir,
1550 install_dir : systemgeneratordir)
1553 if conf.get('ENABLE_HOSTNAMED', 0) == 1
1554 executable('systemd-hostnamed',
1555 'src/hostname/hostnamed.c',
1556 include_directories : includes,
1557 link_with : [libshared],
1558 install_rpath : rootlibexecdir,
1560 install_dir : rootlibexecdir)
1562 exe = executable('hostnamectl',
1563 'src/hostname/hostnamectl.c',
1564 include_directories : includes,
1565 link_with : [libshared],
1566 install_rpath : rootlibexecdir,
1568 public_programs += [exe]
1571 if conf.get('ENABLE_LOCALED', 0) == 1
1572 if conf.get('HAVE_XKBCOMMON', 0) == 1
1573 # logind will load libxkbcommon.so dynamically on its own
1579 executable('systemd-localed',
1580 systemd_localed_sources,
1581 include_directories : includes,
1582 link_with : [libshared],
1583 dependencies : deps,
1584 install_rpath : rootlibexecdir,
1586 install_dir : rootlibexecdir)
1588 exe = executable('localectl',
1590 include_directories : includes,
1591 link_with : [libshared],
1592 install_rpath : rootlibexecdir,
1594 public_programs += [exe]
1597 if conf.get('ENABLE_TIMEDATED', 0) == 1
1598 executable('systemd-timedated',
1599 'src/timedate/timedated.c',
1600 include_directories : includes,
1601 link_with : [libshared],
1602 install_rpath : rootlibexecdir,
1604 install_dir : rootlibexecdir)
1606 exe = executable('timedatectl',
1607 'src/timedate/timedatectl.c',
1608 include_directories : includes,
1609 install_rpath : rootlibexecdir,
1610 link_with : [libshared],
1612 public_programs += [exe]
1615 if conf.get('ENABLE_TIMESYNCD', 0) == 1
1616 executable('systemd-timesyncd',
1617 systemd_timesyncd_sources,
1618 include_directories : includes,
1619 link_with : [libshared],
1620 dependencies : [threads,
1622 install_rpath : rootlibexecdir,
1624 install_dir : rootlibexecdir)
1627 if conf.get('ENABLE_MACHINED', 0) == 1
1628 executable('systemd-machined',
1629 systemd_machined_sources,
1630 include_directories : includes,
1631 link_with : [libmachine_core,
1633 install_rpath : rootlibexecdir,
1635 install_dir : rootlibexecdir)
1637 exe = executable('machinectl',
1638 'src/machine/machinectl.c',
1639 include_directories : includes,
1640 link_with : [libshared],
1641 dependencies : [threads,
1644 install_rpath : rootlibexecdir,
1646 install_dir : rootbindir)
1647 public_programs += [exe]
1650 if conf.get('ENABLE_IMPORTD', 0) == 1
1651 executable('systemd-importd',
1652 systemd_importd_sources,
1653 include_directories : includes,
1654 link_with : [libshared],
1655 dependencies : [threads],
1656 install_rpath : rootlibexecdir,
1658 install_dir : rootlibexecdir)
1660 systemd_pull = executable('systemd-pull',
1661 systemd_pull_sources,
1662 include_directories : includes,
1663 link_with : [libshared],
1664 dependencies : [libcurl,
1669 install_rpath : rootlibexecdir,
1671 install_dir : rootlibexecdir)
1673 systemd_import = executable('systemd-import',
1674 systemd_import_sources,
1675 include_directories : includes,
1676 link_with : [libshared],
1677 dependencies : [libcurl,
1681 install_rpath : rootlibexecdir,
1683 install_dir : rootlibexecdir)
1685 systemd_export = executable('systemd-export',
1686 systemd_export_sources,
1687 include_directories : includes,
1688 link_with : [libshared],
1689 dependencies : [libcurl,
1693 install_rpath : rootlibexecdir,
1695 install_dir : rootlibexecdir)
1696 public_programs += [systemd_pull, systemd_import, systemd_export]
1699 if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
1700 exe = executable('systemd-journal-upload',
1701 systemd_journal_upload_sources,
1702 include_directories : includes,
1703 link_with : [libshared],
1704 dependencies : [threads,
1709 install_rpath : rootlibexecdir,
1711 install_dir : rootlibexecdir)
1712 public_programs += [exe]
1715 if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
1716 s_j_remote = executable('systemd-journal-remote',
1717 systemd_journal_remote_sources,
1718 include_directories : includes,
1719 link_with : [libshared],
1720 dependencies : [threads,
1725 install_rpath : rootlibexecdir,
1727 install_dir : rootlibexecdir)
1729 s_j_gatewayd = executable('systemd-journal-gatewayd',
1730 systemd_journal_gatewayd_sources,
1731 include_directories : includes,
1732 link_with : [libshared],
1733 dependencies : [threads,
1738 install_rpath : rootlibexecdir,
1740 install_dir : rootlibexecdir)
1741 public_programs += [s_j_remote, s_j_gatewayd]
1744 if conf.get('ENABLE_COREDUMP', 0) == 1
1745 executable('systemd-coredump',
1746 systemd_coredump_sources,
1747 include_directories : includes,
1748 link_with : [libshared],
1749 dependencies : [threads,
1754 install_rpath : rootlibexecdir,
1756 install_dir : rootlibexecdir)
1758 exe = executable('coredumpctl',
1759 coredumpctl_sources,
1760 include_directories : includes,
1761 link_with : [libshared],
1762 dependencies : [threads,
1765 install_rpath : rootlibexecdir,
1767 public_programs += [exe]
1770 if conf.get('ENABLE_BINFMT', 0) == 1
1771 exe = executable('systemd-binfmt',
1772 'src/binfmt/binfmt.c',
1773 include_directories : includes,
1774 link_with : [libshared],
1775 install_rpath : rootlibexecdir,
1777 install_dir : rootlibexecdir)
1778 public_programs += [exe]
1780 meson.add_install_script('sh', '-c',
1781 mkdir_p.format(binfmtdir))
1782 meson.add_install_script('sh', '-c',
1783 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1786 if conf.get('ENABLE_VCONSOLE', 0) == 1
1787 executable('systemd-vconsole-setup',
1788 'src/vconsole/vconsole-setup.c',
1789 include_directories : includes,
1790 link_with : [libshared],
1791 install_rpath : rootlibexecdir,
1793 install_dir : rootlibexecdir)
1796 if conf.get('ENABLE_RANDOMSEED', 0) == 1
1797 executable('systemd-random-seed',
1798 'src/random-seed/random-seed.c',
1799 include_directories : includes,
1800 link_with : [libshared],
1801 install_rpath : rootlibexecdir,
1803 install_dir : rootlibexecdir)
1806 if conf.get('ENABLE_FIRSTBOOT', 0) == 1
1807 executable('systemd-firstboot',
1808 'src/firstboot/firstboot.c',
1809 include_directories : includes,
1810 link_with : [libshared],
1811 dependencies : [libcrypt],
1812 install_rpath : rootlibexecdir,
1814 install_dir : rootbindir)
1817 executable('systemd-remount-fs',
1818 'src/remount-fs/remount-fs.c',
1819 'src/core/mount-setup.c',
1820 'src/core/mount-setup.h',
1821 include_directories : includes,
1822 link_with : [libshared],
1823 install_rpath : rootlibexecdir,
1825 install_dir : rootlibexecdir)
1827 executable('systemd-machine-id-setup',
1828 'src/machine-id-setup/machine-id-setup-main.c',
1829 'src/core/machine-id-setup.c',
1830 'src/core/machine-id-setup.h',
1831 include_directories : includes,
1832 link_with : [libshared],
1833 install_rpath : rootlibexecdir,
1835 install_dir : rootbindir)
1837 executable('systemd-fsck',
1839 include_directories : includes,
1840 link_with : [libshared],
1841 install_rpath : rootlibexecdir,
1843 install_dir : rootlibexecdir)
1845 executable('systemd-sleep',
1846 'src/sleep/sleep.c',
1847 include_directories : includes,
1848 link_with : [libshared],
1849 install_rpath : rootlibexecdir,
1851 install_dir : rootlibexecdir)
1853 exe = executable('systemd-sysctl',
1854 'src/sysctl/sysctl.c',
1855 include_directories : includes,
1856 link_with : [libshared],
1857 install_rpath : rootlibexecdir,
1859 install_dir : rootlibexecdir)
1860 public_programs += [exe]
1862 executable('systemd-ac-power',
1863 'src/ac-power/ac-power.c',
1864 include_directories : includes,
1865 link_with : [libshared],
1866 install_rpath : rootlibexecdir,
1868 install_dir : rootlibexecdir)
1870 exe = executable('systemd-detect-virt',
1871 'src/detect-virt/detect-virt.c',
1872 include_directories : includes,
1873 link_with : [libshared],
1874 install_rpath : rootlibexecdir,
1876 public_programs += [exe]
1878 exe = executable('systemd-delta',
1879 'src/delta/delta.c',
1880 include_directories : includes,
1881 link_with : [libshared],
1882 install_rpath : rootlibexecdir,
1884 public_programs += [exe]
1886 exe = executable('systemd-escape',
1887 'src/escape/escape.c',
1888 include_directories : includes,
1889 link_with : [libshared],
1890 install_rpath : rootlibexecdir,
1892 install_dir : rootbindir)
1893 public_programs += [exe]
1895 exe = executable('systemd-notify',
1896 'src/notify/notify.c',
1897 include_directories : includes,
1898 link_with : [libshared],
1899 install_rpath : rootlibexecdir,
1901 install_dir : rootbindir)
1902 public_programs += [exe]
1904 executable('systemd-volatile-root',
1905 'src/volatile-root/volatile-root.c',
1906 include_directories : includes,
1907 link_with : [libshared],
1908 install_rpath : rootlibexecdir,
1910 install_dir : rootlibexecdir)
1912 executable('systemd-cgroups-agent',
1913 'src/cgroups-agent/cgroups-agent.c',
1914 include_directories : includes,
1915 link_with : [libshared],
1916 install_rpath : rootlibexecdir,
1918 install_dir : rootlibexecdir)
1920 exe = executable('systemd-path',
1922 include_directories : includes,
1923 link_with : [libshared],
1924 install_rpath : rootlibexecdir,
1926 public_programs += [exe]
1928 exe = executable('systemd-ask-password',
1929 'src/ask-password/ask-password.c',
1930 include_directories : includes,
1931 link_with : [libshared],
1932 install_rpath : rootlibexecdir,
1934 install_dir : rootbindir)
1935 public_programs += [exe]
1937 executable('systemd-reply-password',
1938 'src/reply-password/reply-password.c',
1939 include_directories : includes,
1940 link_with : [libshared],
1941 install_rpath : rootlibexecdir,
1943 install_dir : rootlibexecdir)
1945 exe = executable('systemd-tty-ask-password-agent',
1946 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1947 include_directories : includes,
1948 link_with : [libshared],
1949 install_rpath : rootlibexecdir,
1951 install_dir : rootbindir)
1952 public_programs += [exe]
1954 exe = executable('systemd-cgls',
1956 include_directories : includes,
1957 link_with : [libshared],
1958 install_rpath : rootlibexecdir,
1960 public_programs += [exe]
1962 exe = executable('systemd-cgtop',
1963 'src/cgtop/cgtop.c',
1964 include_directories : includes,
1965 link_with : [libshared],
1966 install_rpath : rootlibexecdir,
1968 public_programs += [exe]
1970 executable('systemd-initctl',
1971 'src/initctl/initctl.c',
1972 include_directories : includes,
1973 link_with : [libshared],
1974 install_rpath : rootlibexecdir,
1976 install_dir : rootlibexecdir)
1978 exe = executable('systemd-mount',
1979 'src/mount/mount-tool.c',
1980 include_directories : includes,
1981 link_with : [libshared],
1982 install_rpath : rootlibexecdir,
1984 public_programs += [exe]
1986 meson.add_install_script(meson_make_symlink,
1987 'systemd-mount', join_paths(bindir, 'systemd-umount'))
1989 exe = executable('systemd-run',
1991 include_directories : includes,
1992 link_with : [libshared],
1993 install_rpath : rootlibexecdir,
1995 public_programs += [exe]
1997 exe = executable('systemd-stdio-bridge',
1998 'src/stdio-bridge/stdio-bridge.c',
1999 include_directories : includes,
2000 link_with : [libshared],
2001 install_rpath : rootlibexecdir,
2003 public_programs += [exe]
2005 exe = executable('busctl',
2006 'src/busctl/busctl.c',
2007 'src/busctl/busctl-introspect.c',
2008 'src/busctl/busctl-introspect.h',
2009 include_directories : includes,
2010 link_with : [libshared],
2011 install_rpath : rootlibexecdir,
2013 public_programs += [exe]
2015 if conf.get('ENABLE_SYSUSERS', 0) == 1
2016 exe = executable('systemd-sysusers',
2017 'src/sysusers/sysusers.c',
2018 include_directories : includes,
2019 link_with : [libshared],
2020 install_rpath : rootlibexecdir,
2022 install_dir : rootbindir)
2023 public_programs += [exe]
2026 if conf.get('ENABLE_TMPFILES', 0) == 1
2027 exe = executable('systemd-tmpfiles',
2028 'src/tmpfiles/tmpfiles.c',
2029 include_directories : includes,
2030 link_with : [libshared],
2031 dependencies : [libacl],
2032 install_rpath : rootlibexecdir,
2034 install_dir : rootbindir)
2035 public_programs += [exe]
2038 if conf.get('ENABLE_HWDB', 0) == 1
2039 exe = executable('systemd-hwdb',
2041 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2042 include_directories : includes,
2043 link_with : [libudev_internal],
2044 install_rpath : udev_rpath,
2046 install_dir : rootbindir)
2047 public_programs += [exe]
2050 if conf.get('ENABLE_QUOTACHECK', 0) == 1
2051 executable('systemd-quotacheck',
2052 'src/quotacheck/quotacheck.c',
2053 include_directories : includes,
2054 link_with : [libshared],
2055 install_rpath : rootlibexecdir,
2057 install_dir : rootlibexecdir)
2060 exe = executable('systemd-socket-proxyd',
2061 'src/socket-proxy/socket-proxyd.c',
2062 include_directories : includes,
2063 link_with : [libshared],
2064 dependencies : [threads],
2065 install_rpath : rootlibexecdir,
2067 install_dir : rootlibexecdir)
2068 public_programs += [exe]
2070 exe = executable('systemd-udevd',
2071 systemd_udevd_sources,
2072 include_directories : includes,
2073 link_with : [libudev_core,
2076 dependencies : [threads,
2081 install_rpath : udev_rpath,
2083 install_dir : rootlibexecdir)
2084 public_programs += [exe]
2086 exe = executable('udevadm',
2088 include_directories : includes,
2089 link_with : [libudev_core,
2092 dependencies : [threads,
2097 install_rpath : udev_rpath,
2099 install_dir : rootbindir)
2100 public_programs += [exe]
2102 executable('systemd-shutdown',
2103 systemd_shutdown_sources,
2104 include_directories : includes,
2105 link_with : [libshared],
2106 install_rpath : rootlibexecdir,
2108 install_dir : rootlibexecdir)
2110 executable('systemd-update-done',
2111 'src/update-done/update-done.c',
2112 include_directories : includes,
2113 link_with : [libshared],
2114 install_rpath : rootlibexecdir,
2116 install_dir : rootlibexecdir)
2118 executable('systemd-update-utmp',
2119 'src/update-utmp/update-utmp.c',
2120 include_directories : includes,
2121 link_with : [libshared],
2122 dependencies : [libaudit],
2123 install_rpath : rootlibexecdir,
2125 install_dir : rootlibexecdir)
2127 if conf.get('HAVE_KMOD', 0) == 1
2128 executable('systemd-modules-load',
2129 'src/modules-load/modules-load.c',
2130 include_directories : includes,
2131 link_with : [libshared],
2132 dependencies : [libkmod],
2133 install_rpath : rootlibexecdir,
2135 install_dir : rootlibexecdir)
2137 meson.add_install_script('sh', '-c',
2138 mkdir_p.format(modulesloaddir))
2139 meson.add_install_script('sh', '-c',
2140 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2143 exe = executable('systemd-nspawn',
2144 systemd_nspawn_sources,
2145 'src/core/mount-setup.c', # FIXME: use a variable?
2146 'src/core/mount-setup.h',
2147 'src/core/loopback-setup.c',
2148 'src/core/loopback-setup.h',
2149 include_directories : [includes, include_directories('src/nspawn')],
2150 link_with : [libshared],
2151 dependencies : [libacl,
2155 install_rpath : rootlibexecdir,
2157 public_programs += [exe]
2159 if conf.get('ENABLE_NETWORKD', 0) == 1
2160 executable('systemd-networkd',
2161 systemd_networkd_sources,
2162 include_directories : includes,
2163 link_with : [libnetworkd_core,
2167 install_rpath : rootlibexecdir,
2169 install_dir : rootlibexecdir)
2171 executable('systemd-networkd-wait-online',
2172 systemd_networkd_wait_online_sources,
2173 include_directories : includes,
2174 link_with : [libnetworkd_core,
2176 install_rpath : rootlibexecdir,
2178 install_dir : rootlibexecdir)
2181 exe = executable('networkctl',
2183 include_directories : includes,
2184 link_with : [libsystemd_network,
2186 install_rpath : rootlibexecdir,
2188 install_dir : rootbindir)
2189 public_programs += [exe]
2191 ############################################################
2193 foreach tuple : tests
2195 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2196 dependencies = tuple[2]
2197 condition = tuple.length() >= 4 ? tuple[3] : ''
2198 type = tuple.length() >= 5 ? tuple[4] : ''
2199 defs = tuple.length() >= 6 ? tuple[5] : []
2200 incs = tuple.length() >= 7 ? tuple[6] : includes
2203 name = sources[0].split('/')[-1].split('.')[0]
2204 if type.startswith('timeout=')
2205 timeout = type.split('=')[1].to_int()
2209 if condition == '' or conf.get(condition, 0) == 1
2210 install = install_tests and type == ''
2215 include_directories : incs,
2216 link_with : link_with,
2217 dependencies : dependencies,
2219 install_rpath : rootlibexecdir,
2221 install_dir : testsdir)
2224 message('@0@ is a manual test'.format(name))
2225 elif type == 'unsafe' and want_tests != 'unsafe'
2226 message('@0@ is an unsafe test'.format(name))
2233 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2237 test_libsystemd_sym = executable(
2238 'test-libsystemd-sym',
2239 test_libsystemd_sym_c,
2240 include_directories : includes,
2241 link_with : [libsystemd],
2242 install : install_tests,
2243 install_dir : testsdir)
2244 test('test-libsystemd-sym',
2245 test_libsystemd_sym)
2247 test_libudev_sym = executable(
2250 include_directories : includes,
2251 c_args : ['-Wno-deprecated-declarations'],
2252 link_with : [libudev],
2253 install : install_tests,
2254 install_dir : testsdir)
2255 test('test-libudev-sym',
2258 ############################################################
2260 make_directive_index_py = find_program('tools/make-directive-index.py')
2261 make_man_index_py = find_program('tools/make-man-index.py')
2262 xml_helper_py = find_program('tools/xml_helper.py')
2263 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2267 subdir('sysusers.d')
2268 subdir('tmpfiles.d')
2273 subdir('shell-completion/bash')
2274 subdir('shell-completion/zsh')
2275 subdir('docs/sysvinit')
2276 subdir('docs/var-log')
2278 # FIXME: figure out if the warning is true:
2279 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2280 install_subdir('factory/etc',
2281 install_dir : factorydir)
2284 install_data('xorg/50-systemd-user.sh',
2285 install_dir : xinitrcdir)
2286 install_data('system-preset/90-systemd.preset',
2287 install_dir : systempresetdir)
2288 install_data('README',
2295 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2296 install_dir : docdir)
2298 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2299 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2301 ############################################################
2303 meson_check_help = find_program('tools/meson-check-help.sh')
2305 foreach exec : public_programs
2306 name = exec.full_path().split('/')[-1]
2307 test('check-help-' + name,
2309 args : [exec.full_path()])
2312 ############################################################
2314 if git.found() and etags.found()
2315 all_files = run_command(
2317 ['--git-dir=@0@/.git'.format(meson.source_root()),
2320 all_files = files(all_files.stdout().split())
2326 command : [etags, '-o', '@OUTPUT@'] + all_files)
2330 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2333 command : [meson_git_contrib_sh])
2337 git_head = run_command(
2339 ['--git-dir=@0@/.git'.format(meson.source_root()),
2340 'rev-parse', 'HEAD']).stdout().strip()
2341 git_head_short = run_command(
2343 ['--git-dir=@0@/.git'.format(meson.source_root()),
2344 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2348 command : ['git', 'archive',
2349 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2351 '--prefix', 'systemd-@0@/'.format(git_head),