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 dns_servers = get_option('dns-servers')
607 conf.set_quoted('DNS_SERVERS', dns_servers)
608 substs.set('DNS_SERVERS', dns_servers)
610 ntp_servers = get_option('ntp-servers')
611 conf.set_quoted('NTP_SERVERS', ntp_servers)
612 substs.set('NTP_SERVERS', ntp_servers)
614 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
616 substs.set('SUSHELL', get_option('debug-shell'))
617 substs.set('DEBUGTTY', get_option('debug-tty'))
619 debug = get_option('debug')
621 foreach name : debug.split(',')
623 conf.set('ENABLE_DEBUG_HASHMAP', true)
624 elif name == 'mmap-cache'
625 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
627 message('unknown debug option "@0@", ignoring'.format(name))
632 #####################################################################
634 threads = dependency('threads')
635 librt = cc.find_library('rt')
636 libm = cc.find_library('m')
637 libdl = cc.find_library('dl')
638 libcrypt = cc.find_library('crypt')
640 libcap = dependency('libcap', required : false)
641 if not libcap.found()
642 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
643 libcap = cc.find_library('cap')
646 libmount = dependency('mount',
649 want_seccomp = get_option('seccomp')
650 if want_seccomp != 'false'
651 libseccomp = dependency('libseccomp',
652 version : '>= 2.3.1',
653 required : want_seccomp == 'true')
654 if libseccomp.found()
655 conf.set('HAVE_SECCOMP', true)
656 m4_defines += ['-DHAVE_SECCOMP']
662 want_selinux = get_option('selinux')
663 if want_selinux != 'false'
664 libselinux = dependency('libselinux',
665 version : '>= 2.1.9',
666 required : want_selinux == 'true')
667 if libselinux.found()
668 conf.set('HAVE_SELINUX', true)
669 m4_defines += ['-DHAVE_SELINUX']
675 want_apparmor = get_option('apparmor')
676 if want_apparmor != 'false'
677 libapparmor = dependency('libapparmor',
678 required : want_apparmor == 'true')
679 if libapparmor.found()
680 conf.set('HAVE_APPARMOR', true)
681 m4_defines += ['-DHAVE_APPARMOR']
687 smack_run_label = get_option('smack-run-label')
688 if smack_run_label != ''
689 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
690 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
693 want_polkit = get_option('polkit')
694 install_polkit = false
695 install_polkit_pkla = false
696 if want_polkit != 'false'
697 conf.set('ENABLE_POLKIT', true)
698 install_polkit = true
700 libpolkit = dependency('polkit-gobject-1',
702 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
703 message('Old polkit detected, will install pkla files')
704 install_polkit_pkla = true
708 want_acl = get_option('acl')
709 if want_acl != 'false'
710 libacl = cc.find_library('acl', required : want_acl == 'true')
712 conf.set('HAVE_ACL', true)
713 m4_defines += ['-DHAVE_ACL']
719 want_audit = get_option('audit')
720 if want_audit != 'false'
721 libaudit = dependency('audit', required : want_audit == 'true')
722 conf.set('HAVE_AUDIT', libaudit.found())
727 want_blkid = get_option('blkid')
728 if want_blkid != 'false'
729 libblkid = dependency('blkid', required : want_blkid == 'true')
730 conf.set('HAVE_BLKID', libblkid.found())
735 want_kmod = get_option('kmod')
736 if want_kmod != 'false'
737 libkmod = dependency('libkmod',
739 required : want_kmod == 'true')
740 conf.set('HAVE_KMOD', libkmod.found())
745 want_pam = get_option('pam')
746 if want_pam != 'false'
747 libpam = cc.find_library('pam', required : want_pam == 'true')
748 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
749 if libpam.found() and libpam_misc.found()
750 conf.set('HAVE_PAM', true)
751 m4_defines += ['-DHAVE_PAM']
758 want_microhttpd = get_option('microhttpd')
759 if want_microhttpd != 'false'
760 libmicrohttpd = dependency('libmicrohttpd',
761 version : '>= 0.9.33',
762 required : want_microhttpd == 'true')
763 if libmicrohttpd.found()
764 conf.set('HAVE_MICROHTTPD', true)
765 m4_defines += ['-DHAVE_MICROHTTPD']
771 want_libcryptsetup = get_option('libcryptsetup')
772 if want_libcryptsetup != 'false'
773 libcryptsetup = dependency('libcryptsetup',
774 version : '>= 1.6.0',
775 required : want_libcryptsetup == 'true')
776 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
781 want_libcurl = get_option('libcurl')
782 if want_libcurl != 'false'
783 libcurl = dependency('libcurl',
784 version : '>= 7.32.0',
785 required : want_libcurl == 'true')
787 conf.set('HAVE_LIBCURL', true)
788 m4_defines += ['-DHAVE_LIBCURL']
794 want_libidn = get_option('libidn')
795 want_libidn2 = get_option('libidn2')
796 if want_libidn == 'true' and want_libidn2 == 'true'
797 error('libidn and libidn2 cannot be requested simultaneously')
800 if want_libidn2 != 'false' and want_libidn != 'true'
801 libidn = dependency('libidn2',
802 required : want_libidn2 == 'true')
803 # libidn is used for both libidn and libidn2 objects
805 conf.set('HAVE_LIBIDN2', true)
806 m4_defines += ['-DHAVE_LIBIDN2']
811 if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
812 libidn = dependency('libidn',
813 required : want_libidn == 'true')
815 conf.set('HAVE_LIBIDN', true)
816 m4_defines += ['-DHAVE_LIBIDN']
820 want_libiptc = get_option('libiptc')
821 if want_libiptc != 'false'
822 libiptc = dependency('libiptc',
823 required : want_libiptc == 'true')
825 conf.set('HAVE_LIBIPTC', true)
826 m4_defines += ['-DHAVE_LIBIPTC']
832 want_qrencode = get_option('qrencode')
833 if want_qrencode != 'false'
834 libqrencode = dependency('libqrencode',
835 required : want_qrencode == 'true')
836 conf.set('HAVE_QRENCODE', libqrencode.found())
841 want_gnutls = get_option('gnutls')
842 if want_gnutls != 'false'
843 libgnutls = dependency('gnutls',
844 version : '>= 3.1.4',
845 required : want_gnutls == 'true')
846 conf.set('HAVE_GNUTLS', libgnutls.found())
851 want_elfutils = get_option('elfutils')
852 if want_elfutils != 'false'
853 libdw = dependency('libdw',
854 required : want_elfutils == 'true')
855 conf.set('HAVE_ELFUTILS', libdw.found())
860 want_zlib = get_option('zlib')
861 if want_zlib != 'false'
862 libz = dependency('zlib',
863 required : want_zlib == 'true')
864 conf.set('HAVE_ZLIB', libz.found())
869 want_bzip2 = get_option('bzip2')
870 if want_bzip2 != 'false'
871 libbzip2 = cc.find_library('bz2',
872 required : want_bzip2 == 'true')
873 conf.set('HAVE_BZIP2', libbzip2.found())
878 want_xz = get_option('xz')
879 if want_xz != 'false'
880 libxz = dependency('liblzma',
881 required : want_xz == 'true')
882 conf.set('HAVE_XZ', libxz.found())
887 want_lz4 = get_option('lz4')
888 if want_lz4 != 'false'
889 liblz4 = dependency('liblz4',
890 required : want_lz4 == 'true')
891 conf.set('HAVE_LZ4', liblz4.found())
896 want_glib = get_option('glib')
897 if want_glib != 'false'
898 libglib = dependency('glib-2.0',
899 version : '>= 2.22.0',
900 required : want_glib == 'true')
901 libgobject = dependency('gobject-2.0',
902 version : '>= 2.22.0',
903 required : want_glib == 'true')
904 libgio = dependency('gio-2.0',
905 required : want_glib == 'true')
906 have = libglib.found() and libgobject.found() and libgio.found()
907 conf.set('HAVE_GLIB', have)
914 want_xkbcommon = get_option('xkbcommon')
915 if want_xkbcommon != 'false'
916 libxkbcommon = dependency('xkbcommon',
917 version : '>= 0.3.0',
918 required : want_xkbcommon == 'true')
919 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
924 want_dbus = get_option('dbus')
925 if want_dbus != 'false'
926 libdbus = dependency('dbus-1',
927 version : '>= 1.3.2',
928 required : want_dbus == 'true')
929 conf.set('HAVE_DBUS', libdbus.found())
934 want_gcrypt = get_option('gcrypt')
935 if want_gcrypt != 'false'
936 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
937 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
939 have_deps = libgcrypt.found() and libgpg_error.found()
940 conf.set('HAVE_GCRYPT', have_deps)
942 # link to neither of the libs if one is not found
951 default_dnssec = get_option('default-dnssec')
952 if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
953 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
954 default_dnssec = 'no'
956 conf.set('DEFAULT_DNSSEC_MODE',
957 'DNSSEC_' + default_dnssec.underscorify().to_upper())
958 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
960 want_importd = get_option('importd')
961 if want_importd != 'false'
962 have_deps = (conf.get('HAVE_LIBCURL', false) and
963 conf.get('HAVE_ZLIB', false) and
964 conf.get('HAVE_BZIP2', false) and
965 conf.get('HAVE_XZ', false) and
966 conf.get('HAVE_GCRYPT', false))
967 conf.set('ENABLE_IMPORTD', have_deps)
968 if want_importd == 'true' and not have_deps
969 error('importd support was requested, but dependencies are not available')
973 want_remote = get_option('remote')
974 if want_remote != 'false'
975 have_deps = [conf.get('HAVE_MICROHTTPD', false),
976 conf.get('HAVE_LIBCURL', false)]
977 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
978 # it's possible to build one without the other. Complain only if
979 # support was explictly requested. The auxiliary files like sysusers
980 # config should be installed when any of the programs are built.
981 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
982 error('remote support was requested, but dependencies are not available')
984 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
987 foreach pair : [['utmp', 'HAVE_UTMP'],
988 ['hibernate', 'ENABLE_HIBERNATE'],
989 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
990 ['binfmt', 'ENABLE_BINFMT'],
991 ['coredump', 'ENABLE_COREDUMP'],
992 ['resolve', 'ENABLE_RESOLVED'],
993 ['logind', 'ENABLE_LOGIND'],
994 ['hostnamed', 'ENABLE_HOSTNAMED'],
995 ['localed', 'ENABLE_LOCALED'],
996 ['machined', 'ENABLE_MACHINED'],
997 ['networkd', 'ENABLE_NETWORKD'],
998 ['timedated', 'ENABLE_TIMEDATED'],
999 ['timesyncd', 'ENABLE_TIMESYNCD'],
1000 ['myhostname', 'HAVE_MYHOSTNAME'],
1001 ['firstboot', 'ENABLE_FIRSTBOOT'],
1002 ['randomseed', 'ENABLE_RANDOMSEED'],
1003 ['backlight', 'ENABLE_BACKLIGHT'],
1004 ['vconsole', 'ENABLE_VCONSOLE'],
1005 ['quotacheck', 'ENABLE_QUOTACHECK'],
1006 ['sysusers', 'ENABLE_SYSUSERS'],
1007 ['tmpfiles', 'ENABLE_TMPFILES'],
1008 ['hwdb', 'ENABLE_HWDB'],
1009 ['rfkill', 'ENABLE_RFKILL'],
1010 ['ldconfig', 'ENABLE_LDCONFIG'],
1011 ['efi', 'ENABLE_EFI'],
1012 ['tpm', 'SD_BOOT_LOG_TPM'],
1013 ['ima', 'HAVE_IMA'],
1014 ['smack', 'HAVE_SMACK'],
1015 ['gshadow', 'ENABLE_GSHADOW'],
1016 ['idn', 'ENABLE_IDN'],
1019 if get_option(pair[0])
1020 conf.set(pair[1], true)
1021 m4_defines += ['-D' + pair[1]]
1025 want_tests = get_option('tests')
1026 install_tests = get_option('install-tests')
1029 #####################################################################
1031 if get_option('efi')
1032 efi_arch = host_machine.cpu_family()
1034 if efi_arch == 'x86'
1035 EFI_MACHINE_TYPE_NAME = 'ia32'
1036 gnu_efi_arch = 'ia32'
1037 elif efi_arch == 'x86_64'
1038 EFI_MACHINE_TYPE_NAME = 'x64'
1039 gnu_efi_arch = 'x86_64'
1040 elif efi_arch == 'arm'
1041 EFI_MACHINE_TYPE_NAME = 'arm'
1042 gnu_efi_arch = 'arm'
1043 elif efi_arch == 'aarch64'
1044 EFI_MACHINE_TYPE_NAME = 'aa64'
1045 gnu_efi_arch = 'aarch64'
1047 EFI_MACHINE_TYPE_NAME = ''
1051 conf.set('ENABLE_EFI', true)
1052 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1054 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1057 #####################################################################
1059 config_h = configure_file(
1060 output : 'config.h',
1061 configuration : conf)
1063 includes = include_directories('src/basic',
1073 'src/libsystemd/sd-bus',
1074 'src/libsystemd/sd-device',
1075 'src/libsystemd/sd-hwdb',
1076 'src/libsystemd/sd-id128',
1077 'src/libsystemd/sd-netlink',
1078 'src/libsystemd/sd-network',
1079 'src/libsystemd-network',
1082 add_project_arguments('-include', 'config.h', language : 'c')
1084 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1085 'src/shared/gcrypt-util.c')
1089 subdir('src/systemd')
1091 subdir('src/libsystemd')
1092 subdir('src/libsystemd-network')
1093 subdir('src/journal')
1096 libjournal_core = static_library(
1098 libjournal_core_sources,
1100 include_directories : includes,
1103 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1104 libsystemd = shared_library(
1106 libsystemd_internal_sources,
1107 journal_internal_sources,
1109 include_directories : includes,
1110 link_args : ['-shared',
1111 '-Wl,--version-script=' + libsystemd_sym_path],
1112 link_with : [libbasic],
1113 dependencies : [threads,
1118 link_depends : libsystemd_sym,
1120 install_dir : rootlibdir)
1122 ############################################################
1124 # binaries that have --help and are intended for use by humans,
1125 # usually, but not always, installed in /bin.
1126 public_programs = []
1128 subdir('src/libudev')
1129 subdir('src/shared')
1132 subdir('src/network')
1134 subdir('src/analyze')
1135 subdir('src/journal-remote')
1136 subdir('src/coredump')
1137 subdir('src/hostname')
1138 subdir('src/import')
1139 subdir('src/kernel-install')
1140 subdir('src/locale')
1141 subdir('src/machine')
1142 subdir('src/nspawn')
1143 subdir('src/resolve')
1144 subdir('src/timedate')
1145 subdir('src/timesync')
1146 subdir('src/vconsole')
1147 subdir('src/sulogin-shell')
1148 subdir('src/boot/efi')
1153 ############################################################
1155 # only static linking apart from libdl, to make sure that the
1156 # module is linked to all libraries that it uses.
1157 test_dlopen = executable(
1160 include_directories : includes,
1161 link_with : [libbasic],
1162 dependencies : [libdl])
1164 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1166 ['mymachines', 'ENABLE_MACHINED'],
1167 ['resolve', 'ENABLE_RESOLVED']]
1169 condition = tuple[1] == '' or conf.get(tuple[1], false)
1173 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1174 version_script_arg = join_paths(meson.current_source_dir(), sym)
1176 nss = shared_library(
1178 'src/nss-@0@/nss-@0@.c'.format(module),
1180 include_directories : includes,
1181 link_args : ['-shared',
1182 '-Wl,--version-script=' + version_script_arg,
1184 link_with : [libsystemd_internal,
1186 dependencies : [threads,
1190 install_dir : rootlibdir)
1192 # We cannot use shared_module because it does not support version suffix.
1193 # Unfortunately shared_library insists on creating the symlink…
1194 meson.add_install_script('sh', '-c',
1195 'rm $DESTDIR@0@/libnss_@1@.so'
1196 .format(rootlibdir, module))
1198 test('dlopen-nss_' + module,
1200 args : [nss.full_path()]) # path to dlopen must include a slash
1204 ############################################################
1206 executable('systemd',
1208 include_directories : includes,
1209 link_with : [libcore,
1211 dependencies : [threads,
1217 install_rpath : rootlibexecdir,
1219 install_dir : rootlibexecdir)
1221 exe = executable('systemd-analyze',
1222 systemd_analyze_sources,
1223 include_directories : includes,
1224 link_with : [libcore,
1226 dependencies : [threads,
1232 install_rpath : rootlibexecdir,
1234 public_programs += [exe]
1236 executable('systemd-journald',
1237 systemd_journald_sources,
1238 include_directories : includes,
1239 link_with : [libjournal_core,
1241 dependencies : [threads,
1245 install_rpath : rootlibexecdir,
1247 install_dir : rootlibexecdir)
1249 exe = executable('systemd-cat',
1250 systemd_cat_sources,
1251 include_directories : includes,
1252 link_with : [libjournal_core,
1254 dependencies : [threads],
1255 install_rpath : rootlibexecdir,
1257 public_programs += [exe]
1259 exe = executable('journalctl',
1261 include_directories : includes,
1262 link_with : [libshared],
1263 dependencies : [threads,
1267 install_rpath : rootlibexecdir,
1269 install_dir : rootbindir)
1270 public_programs += [exe]
1272 executable('systemd-getty-generator',
1273 'src/getty-generator/getty-generator.c',
1274 include_directories : includes,
1275 link_with : [libshared],
1276 install_rpath : rootlibexecdir,
1278 install_dir : systemgeneratordir)
1280 executable('systemd-debug-generator',
1281 'src/debug-generator/debug-generator.c',
1282 include_directories : includes,
1283 link_with : [libshared],
1284 install_rpath : rootlibexecdir,
1286 install_dir : systemgeneratordir)
1288 executable('systemd-fstab-generator',
1289 'src/fstab-generator/fstab-generator.c',
1290 'src/core/mount-setup.c',
1291 include_directories : includes,
1292 link_with : [libshared],
1293 install_rpath : rootlibexecdir,
1295 install_dir : systemgeneratordir)
1297 if conf.get('ENABLE_ENVIRONMENT_D', false)
1298 executable('30-systemd-environment-d-generator',
1299 'src/environment-d-generator/environment-d-generator.c',
1300 include_directories : includes,
1301 link_with : [libshared],
1302 install_rpath : rootlibexecdir,
1304 install_dir : userenvgeneratordir)
1306 meson.add_install_script(meson_make_symlink,
1307 join_paths(sysconfdir, 'environment'),
1308 join_paths(environmentdir, '99-environment.conf'))
1311 if conf.get('ENABLE_HIBERNATE', false)
1312 executable('systemd-hibernate-resume-generator',
1313 'src/hibernate-resume/hibernate-resume-generator.c',
1314 include_directories : includes,
1315 link_with : [libshared],
1316 install_rpath : rootlibexecdir,
1318 install_dir : systemgeneratordir)
1320 executable('systemd-hibernate-resume',
1321 'src/hibernate-resume/hibernate-resume.c',
1322 include_directories : includes,
1323 link_with : [libshared],
1324 install_rpath : rootlibexecdir,
1326 install_dir : rootlibexecdir)
1329 if conf.get('HAVE_BLKID', false)
1330 executable('systemd-gpt-auto-generator',
1331 'src/gpt-auto-generator/gpt-auto-generator.c',
1332 'src/basic/blkid-util.h',
1333 include_directories : includes,
1334 link_with : [libshared],
1335 dependencies : libblkid,
1336 install_rpath : rootlibexecdir,
1338 install_dir : systemgeneratordir)
1340 exe = executable('systemd-dissect',
1341 'src/dissect/dissect.c',
1342 include_directories : includes,
1343 link_with : [libshared],
1344 install_rpath : rootlibexecdir,
1346 install_dir : rootlibexecdir)
1347 public_programs += [exe]
1350 if conf.get('ENABLE_RESOLVED', false)
1351 executable('systemd-resolved',
1352 systemd_resolved_sources,
1353 gcrypt_util_sources,
1354 include_directories : includes,
1355 link_with : [libshared],
1356 dependencies : [threads,
1361 install_rpath : rootlibexecdir,
1363 install_dir : rootlibexecdir)
1365 exe = executable('systemd-resolve',
1366 systemd_resolve_sources,
1367 gcrypt_util_sources,
1368 include_directories : includes,
1369 link_with : [libshared],
1370 dependencies : [threads,
1375 install_rpath : rootlibexecdir,
1377 public_programs += [exe]
1380 if conf.get('ENABLE_LOGIND', false)
1381 executable('systemd-logind',
1382 systemd_logind_sources,
1383 include_directories : includes,
1384 link_with : [liblogind_core,
1386 dependencies : [threads,
1388 install_rpath : rootlibexecdir,
1390 install_dir : rootlibexecdir)
1392 exe = executable('loginctl',
1394 include_directories : includes,
1395 link_with : [libshared],
1396 dependencies : [threads,
1399 install_rpath : rootlibexecdir,
1401 install_dir : rootbindir)
1402 public_programs += [exe]
1404 exe = executable('systemd-inhibit',
1405 'src/login/inhibit.c',
1406 include_directories : includes,
1407 link_with : [libshared],
1408 install_rpath : rootlibexecdir,
1410 install_dir : rootbindir)
1411 public_programs += [exe]
1413 if conf.get('HAVE_PAM', false)
1414 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1415 pam_systemd = shared_library(
1419 include_directories : includes,
1420 link_args : ['-shared',
1421 '-Wl,--version-script=' + version_script_arg],
1422 link_with : [libsystemd_internal,
1424 dependencies : [threads,
1427 link_depends : pam_systemd_sym,
1429 install_dir : pamlibdir)
1431 test('dlopen-pam_systemd',
1433 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1437 if conf.get('HAVE_PAM', false)
1438 executable('systemd-user-sessions',
1439 'src/user-sessions/user-sessions.c',
1440 include_directories : includes,
1441 link_with : [libshared],
1442 install_rpath : rootlibexecdir,
1444 install_dir : rootlibexecdir)
1447 if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1448 exe = executable('bootctl',
1449 'src/boot/bootctl.c',
1450 include_directories : includes,
1451 link_with : [libshared],
1452 dependencies : [libblkid],
1453 install_rpath : rootlibexecdir,
1455 public_programs += [exe]
1458 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1459 include_directories : includes,
1460 link_with : [libshared],
1461 dependencies : [threads],
1462 install_rpath : rootlibexecdir,
1464 public_programs += [exe]
1466 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1467 include_directories : includes,
1468 link_with : [libshared],
1469 dependencies : [threads,
1474 install_rpath : rootlibexecdir,
1476 install_dir : rootbindir)
1477 public_programs += [exe]
1479 if conf.get('ENABLE_BACKLIGHT', false)
1480 executable('systemd-backlight',
1481 'src/backlight/backlight.c',
1482 include_directories : includes,
1483 link_with : [libshared],
1484 install_rpath : rootlibexecdir,
1486 install_dir : rootlibexecdir)
1489 if conf.get('ENABLE_RFKILL', false)
1490 executable('systemd-rfkill',
1491 'src/rfkill/rfkill.c',
1492 include_directories : includes,
1493 link_with : [libshared],
1494 install_rpath : rootlibexecdir,
1496 install_dir : rootlibexecdir)
1499 executable('systemd-system-update-generator',
1500 'src/system-update-generator/system-update-generator.c',
1501 include_directories : includes,
1502 link_with : [libshared],
1503 install_rpath : rootlibexecdir,
1505 install_dir : systemgeneratordir)
1507 if conf.get('HAVE_LIBCRYPTSETUP', false)
1508 executable('systemd-cryptsetup',
1509 'src/cryptsetup/cryptsetup.c',
1510 include_directories : includes,
1511 link_with : [libshared],
1512 dependencies : [libcryptsetup],
1513 install_rpath : rootlibexecdir,
1515 install_dir : rootlibexecdir)
1517 executable('systemd-cryptsetup-generator',
1518 'src/cryptsetup/cryptsetup-generator.c',
1519 include_directories : includes,
1520 link_with : [libshared],
1521 dependencies : [libcryptsetup],
1522 install_rpath : rootlibexecdir,
1524 install_dir : systemgeneratordir)
1526 executable('systemd-veritysetup',
1527 'src/veritysetup/veritysetup.c',
1528 include_directories : includes,
1529 link_with : [libshared],
1530 dependencies : [libcryptsetup],
1531 install_rpath : rootlibexecdir,
1533 install_dir : rootlibexecdir)
1535 executable('systemd-veritysetup-generator',
1536 'src/veritysetup/veritysetup-generator.c',
1537 include_directories : includes,
1538 link_with : [libshared],
1539 dependencies : [libcryptsetup],
1540 install_rpath : rootlibexecdir,
1542 install_dir : systemgeneratordir)
1545 if conf.get('HAVE_SYSV_COMPAT', false)
1546 executable('systemd-sysv-generator',
1547 'src/sysv-generator/sysv-generator.c',
1548 include_directories : includes,
1549 link_with : [libshared],
1550 install_rpath : rootlibexecdir,
1552 install_dir : systemgeneratordir)
1554 executable('systemd-rc-local-generator',
1555 'src/rc-local-generator/rc-local-generator.c',
1556 include_directories : includes,
1557 link_with : [libshared],
1558 install_rpath : rootlibexecdir,
1560 install_dir : systemgeneratordir)
1563 if conf.get('ENABLE_HOSTNAMED', false)
1564 executable('systemd-hostnamed',
1565 'src/hostname/hostnamed.c',
1566 include_directories : includes,
1567 link_with : [libshared],
1568 install_rpath : rootlibexecdir,
1570 install_dir : rootlibexecdir)
1572 exe = executable('hostnamectl',
1573 'src/hostname/hostnamectl.c',
1574 include_directories : includes,
1575 link_with : [libshared],
1576 install_rpath : rootlibexecdir,
1578 public_programs += [exe]
1581 if conf.get('ENABLE_LOCALED', false)
1582 if conf.get('HAVE_XKBCOMMON', false)
1583 # logind will load libxkbcommon.so dynamically on its own
1589 executable('systemd-localed',
1590 systemd_localed_sources,
1591 include_directories : includes,
1592 link_with : [libshared],
1593 dependencies : deps,
1594 install_rpath : rootlibexecdir,
1596 install_dir : rootlibexecdir)
1598 exe = executable('localectl',
1600 include_directories : includes,
1601 link_with : [libshared],
1602 install_rpath : rootlibexecdir,
1604 public_programs += [exe]
1607 if conf.get('ENABLE_TIMEDATED', false)
1608 executable('systemd-timedated',
1609 'src/timedate/timedated.c',
1610 include_directories : includes,
1611 link_with : [libshared],
1612 install_rpath : rootlibexecdir,
1614 install_dir : rootlibexecdir)
1616 exe = executable('timedatectl',
1617 'src/timedate/timedatectl.c',
1618 include_directories : includes,
1619 install_rpath : rootlibexecdir,
1620 link_with : [libshared],
1622 public_programs += [exe]
1625 if conf.get('ENABLE_TIMESYNCD', false)
1626 executable('systemd-timesyncd',
1627 systemd_timesyncd_sources,
1628 include_directories : includes,
1629 link_with : [libshared],
1630 dependencies : [threads,
1632 install_rpath : rootlibexecdir,
1634 install_dir : rootlibexecdir)
1637 if conf.get('ENABLE_MACHINED', false)
1638 executable('systemd-machined',
1639 systemd_machined_sources,
1640 include_directories : includes,
1641 link_with : [libmachine_core,
1643 install_rpath : rootlibexecdir,
1645 install_dir : rootlibexecdir)
1647 exe = executable('machinectl',
1648 'src/machine/machinectl.c',
1649 include_directories : includes,
1650 link_with : [libshared],
1651 dependencies : [threads,
1654 install_rpath : rootlibexecdir,
1656 install_dir : rootbindir)
1657 public_programs += [exe]
1660 if conf.get('ENABLE_IMPORTD', false)
1661 executable('systemd-importd',
1662 systemd_importd_sources,
1663 include_directories : includes,
1664 link_with : [libshared],
1665 dependencies : [threads],
1666 install_rpath : rootlibexecdir,
1668 install_dir : rootlibexecdir)
1670 systemd_pull = executable('systemd-pull',
1671 systemd_pull_sources,
1672 include_directories : includes,
1673 link_with : [libshared],
1674 dependencies : [libcurl,
1679 install_rpath : rootlibexecdir,
1681 install_dir : rootlibexecdir)
1683 systemd_import = executable('systemd-import',
1684 systemd_import_sources,
1685 include_directories : includes,
1686 link_with : [libshared],
1687 dependencies : [libcurl,
1691 install_rpath : rootlibexecdir,
1693 install_dir : rootlibexecdir)
1695 systemd_export = executable('systemd-export',
1696 systemd_export_sources,
1697 include_directories : includes,
1698 link_with : [libshared],
1699 dependencies : [libcurl,
1703 install_rpath : rootlibexecdir,
1705 install_dir : rootlibexecdir)
1706 public_programs += [systemd_pull, systemd_import, systemd_export]
1709 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1710 exe = executable('systemd-journal-upload',
1711 systemd_journal_upload_sources,
1712 include_directories : includes,
1713 link_with : [libshared],
1714 dependencies : [threads,
1719 install_rpath : rootlibexecdir,
1721 install_dir : rootlibexecdir)
1722 public_programs += [exe]
1725 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1726 s_j_remote = executable('systemd-journal-remote',
1727 systemd_journal_remote_sources,
1728 include_directories : includes,
1729 link_with : [libshared],
1730 dependencies : [threads,
1735 install_rpath : rootlibexecdir,
1737 install_dir : rootlibexecdir)
1739 s_j_gatewayd = executable('systemd-journal-gatewayd',
1740 systemd_journal_gatewayd_sources,
1741 include_directories : includes,
1742 link_with : [libshared],
1743 dependencies : [threads,
1748 install_rpath : rootlibexecdir,
1750 install_dir : rootlibexecdir)
1751 public_programs += [s_j_remote, s_j_gatewayd]
1754 if conf.get('ENABLE_COREDUMP', false)
1755 executable('systemd-coredump',
1756 systemd_coredump_sources,
1757 include_directories : includes,
1758 link_with : [libshared],
1759 dependencies : [threads,
1764 install_rpath : rootlibexecdir,
1766 install_dir : rootlibexecdir)
1768 exe = executable('coredumpctl',
1769 coredumpctl_sources,
1770 include_directories : includes,
1771 link_with : [libshared],
1772 dependencies : [threads,
1775 install_rpath : rootlibexecdir,
1777 public_programs += [exe]
1780 if conf.get('ENABLE_BINFMT', false)
1781 exe = executable('systemd-binfmt',
1782 'src/binfmt/binfmt.c',
1783 include_directories : includes,
1784 link_with : [libshared],
1785 install_rpath : rootlibexecdir,
1787 install_dir : rootlibexecdir)
1788 public_programs += [exe]
1790 meson.add_install_script('sh', '-c',
1791 mkdir_p.format(binfmtdir))
1792 meson.add_install_script('sh', '-c',
1793 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1796 if conf.get('ENABLE_VCONSOLE', false)
1797 executable('systemd-vconsole-setup',
1798 'src/vconsole/vconsole-setup.c',
1799 include_directories : includes,
1800 link_with : [libshared],
1801 install_rpath : rootlibexecdir,
1803 install_dir : rootlibexecdir)
1806 if conf.get('ENABLE_RANDOMSEED', false)
1807 executable('systemd-random-seed',
1808 'src/random-seed/random-seed.c',
1809 include_directories : includes,
1810 link_with : [libshared],
1811 install_rpath : rootlibexecdir,
1813 install_dir : rootlibexecdir)
1816 if conf.get('ENABLE_FIRSTBOOT', false)
1817 executable('systemd-firstboot',
1818 'src/firstboot/firstboot.c',
1819 include_directories : includes,
1820 link_with : [libshared],
1821 dependencies : [libcrypt],
1822 install_rpath : rootlibexecdir,
1824 install_dir : rootbindir)
1827 executable('systemd-remount-fs',
1828 'src/remount-fs/remount-fs.c',
1829 'src/core/mount-setup.c',
1830 'src/core/mount-setup.h',
1831 include_directories : includes,
1832 link_with : [libshared],
1833 install_rpath : rootlibexecdir,
1835 install_dir : rootlibexecdir)
1837 executable('systemd-machine-id-setup',
1838 'src/machine-id-setup/machine-id-setup-main.c',
1839 'src/core/machine-id-setup.c',
1840 'src/core/machine-id-setup.h',
1841 include_directories : includes,
1842 link_with : [libshared],
1843 install_rpath : rootlibexecdir,
1845 install_dir : rootbindir)
1847 executable('systemd-fsck',
1849 include_directories : includes,
1850 link_with : [libshared],
1851 install_rpath : rootlibexecdir,
1853 install_dir : rootlibexecdir)
1855 executable('systemd-sleep',
1856 'src/sleep/sleep.c',
1857 include_directories : includes,
1858 link_with : [libshared],
1859 install_rpath : rootlibexecdir,
1861 install_dir : rootlibexecdir)
1863 exe = executable('systemd-sysctl',
1864 'src/sysctl/sysctl.c',
1865 include_directories : includes,
1866 link_with : [libshared],
1867 install_rpath : rootlibexecdir,
1869 install_dir : rootlibexecdir)
1870 public_programs += [exe]
1872 executable('systemd-ac-power',
1873 'src/ac-power/ac-power.c',
1874 include_directories : includes,
1875 link_with : [libshared],
1876 install_rpath : rootlibexecdir,
1878 install_dir : rootlibexecdir)
1880 exe = executable('systemd-detect-virt',
1881 'src/detect-virt/detect-virt.c',
1882 include_directories : includes,
1883 link_with : [libshared],
1884 install_rpath : rootlibexecdir,
1886 public_programs += [exe]
1888 exe = executable('systemd-delta',
1889 'src/delta/delta.c',
1890 include_directories : includes,
1891 link_with : [libshared],
1892 install_rpath : rootlibexecdir,
1894 public_programs += [exe]
1896 exe = executable('systemd-escape',
1897 'src/escape/escape.c',
1898 include_directories : includes,
1899 link_with : [libshared],
1900 install_rpath : rootlibexecdir,
1902 install_dir : rootbindir)
1903 public_programs += [exe]
1905 exe = executable('systemd-notify',
1906 'src/notify/notify.c',
1907 include_directories : includes,
1908 link_with : [libshared],
1909 install_rpath : rootlibexecdir,
1911 install_dir : rootbindir)
1912 public_programs += [exe]
1914 executable('systemd-volatile-root',
1915 'src/volatile-root/volatile-root.c',
1916 include_directories : includes,
1917 link_with : [libshared],
1918 install_rpath : rootlibexecdir,
1920 install_dir : rootlibexecdir)
1922 executable('systemd-cgroups-agent',
1923 'src/cgroups-agent/cgroups-agent.c',
1924 include_directories : includes,
1925 link_with : [libshared],
1926 install_rpath : rootlibexecdir,
1928 install_dir : rootlibexecdir)
1930 exe = executable('systemd-path',
1932 include_directories : includes,
1933 link_with : [libshared],
1934 install_rpath : rootlibexecdir,
1936 public_programs += [exe]
1938 exe = executable('systemd-ask-password',
1939 'src/ask-password/ask-password.c',
1940 include_directories : includes,
1941 link_with : [libshared],
1942 install_rpath : rootlibexecdir,
1944 install_dir : rootbindir)
1945 public_programs += [exe]
1947 executable('systemd-reply-password',
1948 'src/reply-password/reply-password.c',
1949 include_directories : includes,
1950 link_with : [libshared],
1951 install_rpath : rootlibexecdir,
1953 install_dir : rootlibexecdir)
1955 exe = executable('systemd-tty-ask-password-agent',
1956 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1957 include_directories : includes,
1958 link_with : [libshared],
1959 install_rpath : rootlibexecdir,
1961 install_dir : rootbindir)
1962 public_programs += [exe]
1964 exe = executable('systemd-cgls',
1966 include_directories : includes,
1967 link_with : [libshared],
1968 install_rpath : rootlibexecdir,
1970 public_programs += [exe]
1972 exe = executable('systemd-cgtop',
1973 'src/cgtop/cgtop.c',
1974 include_directories : includes,
1975 link_with : [libshared],
1976 install_rpath : rootlibexecdir,
1978 public_programs += [exe]
1980 executable('systemd-initctl',
1981 'src/initctl/initctl.c',
1982 include_directories : includes,
1983 link_with : [libshared],
1984 install_rpath : rootlibexecdir,
1986 install_dir : rootlibexecdir)
1988 exe = executable('systemd-mount',
1989 'src/mount/mount-tool.c',
1990 include_directories : includes,
1991 link_with : [libshared],
1992 install_rpath : rootlibexecdir,
1994 public_programs += [exe]
1996 meson.add_install_script(meson_make_symlink,
1997 'systemd-mount', join_paths(bindir, 'systemd-umount'))
1999 exe = executable('systemd-run',
2001 include_directories : includes,
2002 link_with : [libshared],
2003 install_rpath : rootlibexecdir,
2005 public_programs += [exe]
2007 exe = executable('systemd-stdio-bridge',
2008 'src/stdio-bridge/stdio-bridge.c',
2009 include_directories : includes,
2010 link_with : [libshared],
2011 install_rpath : rootlibexecdir,
2013 public_programs += [exe]
2015 exe = executable('busctl',
2016 'src/busctl/busctl.c',
2017 'src/busctl/busctl-introspect.c',
2018 'src/busctl/busctl-introspect.h',
2019 include_directories : includes,
2020 link_with : [libshared],
2021 install_rpath : rootlibexecdir,
2023 public_programs += [exe]
2025 if conf.get('ENABLE_SYSUSERS', false)
2026 exe = executable('systemd-sysusers',
2027 'src/sysusers/sysusers.c',
2028 include_directories : includes,
2029 link_with : [libshared],
2030 install_rpath : rootlibexecdir,
2032 install_dir : rootbindir)
2033 public_programs += [exe]
2036 if conf.get('ENABLE_TMPFILES', false)
2037 exe = executable('systemd-tmpfiles',
2038 'src/tmpfiles/tmpfiles.c',
2039 include_directories : includes,
2040 link_with : [libshared],
2041 dependencies : [libacl],
2042 install_rpath : rootlibexecdir,
2044 install_dir : rootbindir)
2045 public_programs += [exe]
2048 if conf.get('ENABLE_HWDB', false)
2049 exe = executable('systemd-hwdb',
2051 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2052 include_directories : includes,
2053 link_with : [libudev_internal],
2054 install_rpath : udev_rpath,
2056 install_dir : rootbindir)
2057 public_programs += [exe]
2060 if conf.get('ENABLE_QUOTACHECK', false)
2061 executable('systemd-quotacheck',
2062 'src/quotacheck/quotacheck.c',
2063 include_directories : includes,
2064 link_with : [libshared],
2065 install_rpath : rootlibexecdir,
2067 install_dir : rootlibexecdir)
2070 exe = executable('systemd-socket-proxyd',
2071 'src/socket-proxy/socket-proxyd.c',
2072 include_directories : includes,
2073 link_with : [libshared],
2074 dependencies : [threads],
2075 install_rpath : rootlibexecdir,
2077 install_dir : rootlibexecdir)
2078 public_programs += [exe]
2080 exe = executable('systemd-udevd',
2081 systemd_udevd_sources,
2082 include_directories : includes,
2083 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2084 link_with : [libudev_core,
2087 dependencies : [threads,
2092 install_rpath : udev_rpath,
2094 install_dir : rootlibexecdir)
2095 public_programs += [exe]
2097 exe = executable('udevadm',
2099 include_directories : includes,
2100 link_with : [libudev_core,
2103 dependencies : [threads,
2108 install_rpath : udev_rpath,
2110 install_dir : rootbindir)
2111 public_programs += [exe]
2113 executable('systemd-shutdown',
2114 systemd_shutdown_sources,
2115 include_directories : includes,
2116 link_with : [libshared],
2117 install_rpath : rootlibexecdir,
2119 install_dir : rootlibexecdir)
2121 executable('systemd-update-done',
2122 'src/update-done/update-done.c',
2123 include_directories : includes,
2124 link_with : [libshared],
2125 install_rpath : rootlibexecdir,
2127 install_dir : rootlibexecdir)
2129 executable('systemd-update-utmp',
2130 'src/update-utmp/update-utmp.c',
2131 include_directories : includes,
2132 link_with : [libshared],
2133 dependencies : [libaudit],
2134 install_rpath : rootlibexecdir,
2136 install_dir : rootlibexecdir)
2138 if conf.get('HAVE_KMOD', false)
2139 executable('systemd-modules-load',
2140 'src/modules-load/modules-load.c',
2141 include_directories : includes,
2142 link_with : [libshared],
2143 dependencies : [libkmod],
2144 install_rpath : rootlibexecdir,
2146 install_dir : rootlibexecdir)
2148 meson.add_install_script('sh', '-c',
2149 mkdir_p.format(modulesloaddir))
2150 meson.add_install_script('sh', '-c',
2151 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2154 exe = executable('systemd-nspawn',
2155 systemd_nspawn_sources,
2156 'src/core/mount-setup.c', # FIXME: use a variable?
2157 'src/core/mount-setup.h',
2158 'src/core/loopback-setup.c',
2159 'src/core/loopback-setup.h',
2160 include_directories : [includes, include_directories('src/nspawn')],
2161 link_with : [libshared],
2162 dependencies : [libacl,
2166 install_rpath : rootlibexecdir,
2168 public_programs += [exe]
2170 if conf.get('ENABLE_NETWORKD', false)
2171 executable('systemd-networkd',
2172 systemd_networkd_sources,
2173 include_directories : includes,
2174 link_with : [libnetworkd_core,
2178 install_rpath : rootlibexecdir,
2180 install_dir : rootlibexecdir)
2182 executable('systemd-networkd-wait-online',
2183 systemd_networkd_wait_online_sources,
2184 include_directories : includes,
2185 link_with : [libnetworkd_core,
2187 install_rpath : rootlibexecdir,
2189 install_dir : rootlibexecdir)
2192 exe = executable('networkctl',
2194 include_directories : includes,
2195 link_with : [libsystemd_network,
2197 install_rpath : rootlibexecdir,
2199 install_dir : rootbindir)
2200 public_programs += [exe]
2202 ############################################################
2204 foreach tuple : tests
2206 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2207 dependencies = tuple[2]
2208 condition = tuple.length() >= 4 ? tuple[3] : ''
2209 type = tuple.length() >= 5 ? tuple[4] : ''
2210 defs = tuple.length() >= 6 ? tuple[5] : []
2211 incs = tuple.length() >= 7 ? tuple[6] : includes
2214 name = sources[0].split('/')[-1].split('.')[0]
2215 if type.startswith('timeout=')
2216 timeout = type.split('=')[1].to_int()
2220 if condition == '' or conf.get(condition, false)
2221 install = install_tests and type == ''
2226 include_directories : incs,
2227 link_with : link_with,
2228 dependencies : dependencies,
2230 install_rpath : rootlibexecdir,
2232 install_dir : testsdir)
2235 message('@0@ is a manual test'.format(name))
2236 elif type == 'unsafe' and want_tests != 'unsafe'
2237 message('@0@ is an unsafe test'.format(name))
2244 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2248 test_libsystemd_sym = executable(
2249 'test-libsystemd-sym',
2250 test_libsystemd_sym_c,
2251 include_directories : includes,
2252 link_with : [libsystemd],
2253 install : install_tests,
2254 install_dir : testsdir)
2255 test('test-libsystemd-sym',
2256 test_libsystemd_sym)
2258 test_libudev_sym = executable(
2261 include_directories : includes,
2262 c_args : ['-Wno-deprecated-declarations'],
2263 link_with : [libudev],
2264 install : install_tests,
2265 install_dir : testsdir)
2266 test('test-libudev-sym',
2269 ############################################################
2271 make_directive_index_py = find_program('tools/make-directive-index.py')
2272 make_man_index_py = find_program('tools/make-man-index.py')
2273 xml_helper_py = find_program('tools/xml_helper.py')
2274 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2278 subdir('sysusers.d')
2279 subdir('tmpfiles.d')
2284 subdir('shell-completion/bash')
2285 subdir('shell-completion/zsh')
2286 subdir('docs/sysvinit')
2287 subdir('docs/var-log')
2289 # FIXME: figure out if the warning is true:
2290 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2291 install_subdir('factory/etc',
2292 install_dir : factorydir)
2295 install_data('xorg/50-systemd-user.sh',
2296 install_dir : xinitrcdir)
2297 install_data('system-preset/90-systemd.preset',
2298 install_dir : systempresetdir)
2299 install_data('README',
2306 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2307 install_dir : docdir)
2309 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2310 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2312 ############################################################
2314 meson_check_help = find_program('tools/meson-check-help.sh')
2316 foreach exec : public_programs
2317 name = exec.full_path().split('/')[-1]
2318 test('check-help-' + name,
2320 args : [exec.full_path()])
2323 ############################################################
2325 if git.found() and etags.found()
2326 all_files = run_command(
2328 ['--git-dir=@0@/.git'.format(meson.source_root()),
2331 all_files = files(all_files.stdout().split())
2336 command : [etags, '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
2340 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2343 command : [meson_git_contrib_sh])
2347 git_head = run_command(
2349 ['--git-dir=@0@/.git'.format(meson.source_root()),
2350 'rev-parse', 'HEAD']).stdout().strip()
2351 git_head_short = run_command(
2353 ['--git-dir=@0@/.git'.format(meson.source_root()),
2354 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2358 command : ['git', 'archive',
2359 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2361 '--prefix', 'systemd-@0@/'.format(git_head),
2365 ############################################################
2368 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2370 'prefix: @0@'.format(prefixdir),
2371 'rootprefix: @0@'.format(rootprefixdir),
2372 'sysconf dir: @0@'.format(sysconfdir),
2373 'includedir: @0@'.format(includedir),
2374 'lib dir: @0@'.format(libdir),
2375 'rootlib dir: @0@'.format(rootlibdir),
2376 'SysV init scripts: @0@'.format(sysvinit_path),
2377 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2378 'PAM modules dir: @0@'.format(pamlibdir),
2379 'PAM configuration dir: @0@'.format(pamconfdir),
2380 'RPM macros dir: @0@'.format(rpmmacrosdir),
2381 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2382 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2383 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2384 'bash completions dir: @0@'.format(bashcompletiondir),
2385 'zsh completions dir: @0@'.format(zshcompletiondir),
2386 'extra start script: @0@'.format(get_option('rc-local')),
2387 'extra stop script: @0@'.format(get_option('halt-local')),
2388 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2389 get_option('debug-tty')),
2390 'TTY GID: @0@'.format(tty_gid),
2391 'maximum system UID: @0@'.format(system_uid_max),
2392 'maximum system GID: @0@'.format(system_gid_max),
2393 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2394 'certificate root: @0@'.format(get_option('certificate-root')),
2395 'support URL: @0@'.format(support_url),
2396 'nobody user name: @0@'.format(get_option('nobody-user')),
2397 'nobody group name: @0@'.format(get_option('nobody-group')),
2398 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2400 'default DNSSEC mode: @0@'.format(default_dnssec),
2401 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2402 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2404 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2405 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2407 'default DNS servers: @0@'.format(alt_dns_servers),
2408 'default NTP servers: @0@'.format(alt_ntp_servers)]
2410 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2411 '@@0@'.format(time_epoch)).stdout().strip()
2413 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2416 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2417 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2418 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2420 if conf.get('ENABLE_EFI', false)
2422 'efi arch: @0@'.format(efi_arch)]
2426 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2427 'EFI CC @0@'.format(efi_cc),
2428 'EFI libdir: @0@'.format(efi_libdir),
2429 'EFI ldsdir: @0@'.format(efi_ldsdir),
2430 'EFI includedir: @0@'.format(efi_incdir)]
2482 ['legacy pkla', install_polkit_pkla],
2484 ['gnu-efi', have_gnu_efi],
2490 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2493 ['man pages', want_man],
2494 ['html pages', want_html],
2495 ['man page indices', want_man and have_lxml],
2496 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2501 ['adm group', get_option('adm-group')],
2502 ['wheel group', get_option('wheel-group')],
2505 ['debug mmap cache'],
2508 cond = tuple.get(1, '')
2510 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2511 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2512 cond = conf.get(ident1, false) or conf.get(ident2, false)
2517 missing += [tuple[0]]
2522 'enabled features: @0@'.format(', '.join(found)),
2523 'disabled features: @0@'.format(', '.join(missing))]
2524 message('\n '.join(status))