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',
317 have = run_command(check_compilation_sh,
318 cc.cmd_array(), '-x', 'c', arg,
319 '-include', link_test_c).returncode() == 0
320 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
322 add_project_link_arguments(arg, language : 'c')
326 if get_option('buildtype') != 'debug'
327 foreach arg : ['-ffunction-sections',
329 if cc.has_argument(arg,
330 name : '@0@ is supported'.format(arg))
331 add_project_arguments(arg, language : 'c')
335 foreach arg : ['-Wl,--gc-sections']
336 have = run_command(check_compilation_sh,
337 cc.cmd_array(), '-x', 'c', arg,
338 '-include', link_test_c).returncode() == 0
339 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
341 add_project_link_arguments(arg, language : 'c')
346 cpp = ' '.join(cc.cmd_array()) + ' -E'
348 #####################################################################
349 # compilation result tests
351 conf.set('_GNU_SOURCE', true)
352 conf.set('__SANE_USERSPACE_TYPES__', true)
354 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
355 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
356 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
357 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
358 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
359 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
360 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
364 #include <linux/ethtool.h>
366 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
368 foreach decl : ['char16_t',
371 'struct ethtool_link_settings',
374 # We get -1 if the size cannot be determined
375 have = cc.sizeof(decl, prefix : decl_headers) > 0
376 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
379 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
380 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
381 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
382 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
383 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
384 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
385 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
386 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
387 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
388 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
389 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
390 # if_tunnel.h is buggy and cannot be included on its own
391 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
392 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
393 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
394 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
395 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
396 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
397 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
398 ['NDA_IFINDEX', 'linux/neighbour.h'],
399 ['IFA_FLAGS', 'linux/if_addr.h'],
400 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
402 prefix = decl.length() > 2 ? decl[2] : ''
403 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
404 conf.set10('HAVE_DECL_' + decl[0], have)
408 foreach ident : ['secure_getenv', '__secure_getenv']
409 if not skip and cc.has_function(ident)
410 conf.set('HAVE_' + ident.to_upper(), true)
416 ['memfd_create', '''#include <sys/memfd.h>'''],
417 ['gettid', '''#include <sys/types.h>'''],
418 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
419 ['name_to_handle_at', '''#define _GNU_SOURCE
420 #include <sys/types.h>
421 #include <sys/stat.h>
422 #include <fcntl.h>'''],
423 ['setns', '''#define _GNU_SOURCE
424 #include <sched.h>'''],
425 ['renameat2', '''#include <stdio.h>'''],
426 ['kcmp', '''#include <linux/kcmp.h>'''],
427 ['keyctl', '''#include <sys/types.h>
428 #include <keyutils.h>'''],
429 ['copy_file_range', '''#include <sys/syscall.h>
430 #include <unistd.h>'''],
431 ['explicit_bzero' , '''#include <string.h>'''],
434 have = cc.has_function(ident[0], prefix : ident[1])
435 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
438 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
439 conf.set('USE_SYS_RANDOM_H', true)
440 conf.set10('HAVE_DECL_GETRANDOM', true)
442 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
443 conf.set10('HAVE_DECL_GETRANDOM', have)
446 #####################################################################
448 sed = find_program('sed')
449 grep = find_program('grep')
450 awk = find_program('awk')
451 m4 = find_program('m4')
452 stat = find_program('stat')
453 git = find_program('git', required : false)
455 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
456 mkdir_p = 'mkdir -p $DESTDIR/@0@'
457 test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
458 splash_bmp = files('test/splash.bmp')
460 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
461 # /usr/sbin, /sbin, and fall back to the default from middle column.
462 progs = [['telinit', '/lib/sysvinit/telinit'],
463 ['quotaon', '/usr/sbin/quotaon' ],
464 ['quotacheck', '/usr/sbin/quotacheck' ],
465 ['kill', '/usr/bin/kill' ],
466 ['kmod', '/usr/bin/kmod' ],
467 ['kexec', '/usr/sbin/kexec' ],
468 ['sulogin', '/usr/sbin/sulogin' ],
469 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
470 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
471 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
472 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
475 path = get_option(prog[0] + '-path')
477 message('Using @1@ for @0@'.format(prog[0], path))
479 exe = find_program(prog[0],
480 '/usr/sbin/' + prog[0],
483 path = exe.found() ? exe.path() : prog[1]
485 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
486 conf.set_quoted(name, path)
487 substs.set(name, path)
490 if run_command('ln', '--relative', '--help').returncode() != 0
491 error('ln does not support --relative')
494 ############################################################
496 gperf = find_program('gperf')
498 gperf_test_format = '''
500 const char * in_word_set(const char *, @0@);
503 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
504 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
505 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
506 if cc.compiles(gperf_test)
507 gperf_len_type = 'size_t'
509 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
510 if cc.compiles(gperf_test)
511 gperf_len_type = 'unsigned'
513 error('unable to determine gperf len type')
516 message('gperf len type is @0@'.format(gperf_len_type))
517 conf.set('GPERF_LEN_TYPE', gperf_len_type,
518 description : 'The type of gperf "len" parameter')
520 ############################################################
522 if not cc.has_header('sys/capability.h')
523 error('POSIX caps headers not found')
525 foreach header : ['linux/btrfs.h',
527 'linux/vm_sockets.h',
528 'valgrind/memcheck.h',
529 'valgrind/valgrind.h',
532 conf.set('HAVE_' + header.underscorify().to_upper(),
533 cc.has_header(header))
536 ############################################################
538 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
540 default_hierarchy = get_option('default-hierarchy')
541 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
542 description : 'default cgroup hierarchy as string')
543 if default_hierarchy == 'legacy'
544 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
545 elif default_hierarchy == 'hybrid'
546 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
548 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
551 time_epoch = get_option('time-epoch')
554 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
556 time_epoch = time_epoch.to_int()
557 conf.set('TIME_EPOCH', time_epoch)
559 system_uid_max = get_option('system-uid-max')
560 if system_uid_max == ''
561 system_uid_max = run_command(
563 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
564 '/etc/login.defs').stdout()
566 system_uid_max = system_uid_max.to_int()
567 conf.set('SYSTEM_UID_MAX', system_uid_max)
568 substs.set('systemuidmax', system_uid_max)
569 message('maximum system UID is @0@'.format(system_uid_max))
571 conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
572 conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
574 system_gid_max = get_option('system-gid-max')
575 if system_gid_max == ''
576 system_gid_max = run_command(
578 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
579 '/etc/login.defs').stdout()
581 system_gid_max = system_gid_max.to_int()
582 conf.set('SYSTEM_GID_MAX', system_gid_max)
583 substs.set('systemgidmax', system_gid_max)
584 message('maximum system GID is @0@'.format(system_gid_max))
586 tty_gid = get_option('tty-gid')
587 conf.set('TTY_GID', tty_gid)
588 substs.set('TTY_GID', tty_gid)
590 if get_option('adm-group')
591 m4_defines += ['-DENABLE_ADM_GROUP']
594 if get_option('wheel-group')
595 m4_defines += ['-DENABLE_WHEEL_GROUP']
598 substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
600 kill_user_processes = get_option('default-kill-user-processes')
601 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
602 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
604 dns_servers = get_option('dns-servers')
605 conf.set_quoted('DNS_SERVERS', dns_servers)
606 substs.set('DNS_SERVERS', dns_servers)
608 ntp_servers = get_option('ntp-servers')
609 conf.set_quoted('NTP_SERVERS', ntp_servers)
610 substs.set('NTP_SERVERS', ntp_servers)
612 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
614 substs.set('SUSHELL', get_option('debug-shell'))
615 substs.set('DEBUGTTY', get_option('debug-tty'))
617 debug = get_option('debug')
619 foreach name : debug.split(',')
621 conf.set('ENABLE_DEBUG_HASHMAP', true)
622 elif name == 'mmap-cache'
623 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
625 message('unknown debug option "@0@", ignoring'.format(name))
630 #####################################################################
632 threads = dependency('threads')
633 librt = cc.find_library('rt')
634 libm = cc.find_library('m')
635 libdl = cc.find_library('dl')
636 libcrypt = cc.find_library('crypt')
638 libcap = dependency('libcap', required : false)
639 if not libcap.found()
640 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
641 libcap = cc.find_library('cap')
644 libmount = dependency('mount',
647 want_seccomp = get_option('seccomp')
648 if want_seccomp != 'false'
649 libseccomp = dependency('libseccomp',
650 version : '>= 2.3.1',
651 required : want_seccomp == 'true')
652 if libseccomp.found()
653 conf.set('HAVE_SECCOMP', true)
654 m4_defines += ['-DHAVE_SECCOMP']
660 want_selinux = get_option('selinux')
661 if want_selinux != 'false'
662 libselinux = dependency('libselinux',
663 version : '>= 2.1.9',
664 required : want_selinux == 'true')
665 if libselinux.found()
666 conf.set('HAVE_SELINUX', true)
667 m4_defines += ['-DHAVE_SELINUX']
673 want_apparmor = get_option('apparmor')
674 if want_apparmor != 'false'
675 libapparmor = dependency('libapparmor',
676 required : want_apparmor == 'true')
677 if libapparmor.found()
678 conf.set('HAVE_APPARMOR', true)
679 m4_defines += ['-DHAVE_APPARMOR']
685 smack_run_label = get_option('smack-run-label')
686 if smack_run_label != ''
687 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
688 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
691 want_polkit = get_option('polkit')
692 install_polkit = false
693 install_polkit_pkla = false
694 if want_polkit != 'false'
695 conf.set('ENABLE_POLKIT', true)
696 install_polkit = true
698 libpolkit = dependency('polkit-gobject-1',
700 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
701 message('Old polkit detected, will install pkla files')
702 install_polkit_pkla = true
706 want_acl = get_option('acl')
707 if want_acl != 'false'
708 libacl = cc.find_library('acl', required : want_acl == 'true')
710 conf.set('HAVE_ACL', true)
711 m4_defines += ['-DHAVE_ACL']
717 want_audit = get_option('audit')
718 if want_audit != 'false'
719 libaudit = dependency('audit', required : want_audit == 'true')
720 conf.set('HAVE_AUDIT', libaudit.found())
725 want_blkid = get_option('blkid')
726 if want_blkid != 'false'
727 libblkid = dependency('blkid', required : want_blkid == 'true')
728 conf.set('HAVE_BLKID', libblkid.found())
733 want_kmod = get_option('kmod')
734 if want_kmod != 'false'
735 libkmod = dependency('libkmod',
737 required : want_kmod == 'true')
738 conf.set('HAVE_KMOD', libkmod.found())
743 want_pam = get_option('pam')
744 if want_pam != 'false'
745 libpam = cc.find_library('pam', required : want_pam == 'true')
746 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
747 if libpam.found() and libpam_misc.found()
748 conf.set('HAVE_PAM', true)
749 m4_defines += ['-DHAVE_PAM']
756 want_microhttpd = get_option('microhttpd')
757 if want_microhttpd != 'false'
758 libmicrohttpd = dependency('libmicrohttpd',
759 version : '>= 0.9.33',
760 required : want_microhttpd == 'true')
761 if libmicrohttpd.found()
762 conf.set('HAVE_MICROHTTPD', true)
763 m4_defines += ['-DHAVE_MICROHTTPD']
769 want_libcryptsetup = get_option('libcryptsetup')
770 if want_libcryptsetup != 'false'
771 libcryptsetup = dependency('libcryptsetup',
772 version : '>= 1.6.0',
773 required : want_libcryptsetup == 'true')
774 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
779 want_libcurl = get_option('libcurl')
780 if want_libcurl != 'false'
781 libcurl = dependency('libcurl',
782 version : '>= 7.32.0',
783 required : want_libcurl == 'true')
785 conf.set('HAVE_LIBCURL', true)
786 m4_defines += ['-DHAVE_LIBCURL']
792 want_libidn = get_option('libidn')
793 want_libidn2 = get_option('libidn2')
794 if want_libidn == 'true' and want_libidn2 == 'true'
795 error('libidn and libidn2 cannot be requested simultaneously')
798 if want_libidn2 != 'false' and want_libidn != 'true'
799 libidn = dependency('libidn2',
800 required : want_libidn2 == 'true')
801 # libidn is used for both libidn and libidn2 objects
803 conf.set('HAVE_LIBIDN2', true)
804 m4_defines += ['-DHAVE_LIBIDN2']
809 if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
810 libidn = dependency('libidn',
811 required : want_libidn == 'true')
813 conf.set('HAVE_LIBIDN', true)
814 m4_defines += ['-DHAVE_LIBIDN']
818 want_libiptc = get_option('libiptc')
819 if want_libiptc != 'false'
820 libiptc = dependency('libiptc',
821 required : want_libiptc == 'true')
823 conf.set('HAVE_LIBIPTC', true)
824 m4_defines += ['-DHAVE_LIBIPTC']
830 want_qrencode = get_option('qrencode')
831 if want_qrencode != 'false'
832 libqrencode = dependency('libqrencode',
833 required : want_qrencode == 'true')
834 conf.set('HAVE_QRENCODE', libqrencode.found())
839 want_gnutls = get_option('gnutls')
840 if want_gnutls != 'false'
841 libgnutls = dependency('gnutls',
842 version : '>= 3.1.4',
843 required : want_gnutls == 'true')
844 conf.set('HAVE_GNUTLS', libgnutls.found())
849 want_elfutils = get_option('elfutils')
850 if want_elfutils != 'false'
851 libdw = dependency('libdw',
852 required : want_elfutils == 'true')
853 conf.set('HAVE_ELFUTILS', libdw.found())
858 want_zlib = get_option('zlib')
859 if want_zlib != 'false'
860 libz = dependency('zlib',
861 required : want_zlib == 'true')
862 conf.set('HAVE_ZLIB', libz.found())
867 want_bzip2 = get_option('bzip2')
868 if want_bzip2 != 'false'
869 libbzip2 = cc.find_library('bz2',
870 required : want_bzip2 == 'true')
871 conf.set('HAVE_BZIP2', libbzip2.found())
876 want_xz = get_option('xz')
877 if want_xz != 'false'
878 libxz = dependency('liblzma',
879 required : want_xz == 'true')
880 conf.set('HAVE_XZ', libxz.found())
885 want_lz4 = get_option('lz4')
886 if want_lz4 != 'false'
887 liblz4 = dependency('liblz4',
888 required : want_lz4 == 'true')
889 conf.set('HAVE_LZ4', liblz4.found())
894 want_glib = get_option('glib')
895 if want_glib != 'false'
896 libglib = dependency('glib-2.0',
897 version : '>= 2.22.0',
898 required : want_glib == 'true')
899 libgobject = dependency('gobject-2.0',
900 version : '>= 2.22.0',
901 required : want_glib == 'true')
902 libgio = dependency('gio-2.0',
903 required : want_glib == 'true')
904 have = libglib.found() and libgobject.found() and libgio.found()
905 conf.set('HAVE_GLIB', have)
912 want_xkbcommon = get_option('xkbcommon')
913 if want_xkbcommon != 'false'
914 libxkbcommon = dependency('xkbcommon',
915 version : '>= 0.3.0',
916 required : want_xkbcommon == 'true')
917 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
922 want_dbus = get_option('dbus')
923 if want_dbus != 'false'
924 libdbus = dependency('dbus-1',
925 version : '>= 1.3.2',
926 required : want_dbus == 'true')
927 conf.set('HAVE_DBUS', libdbus.found())
932 want_gcrypt = get_option('gcrypt')
933 if want_gcrypt != 'false'
934 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
935 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
937 have_deps = libgcrypt.found() and libgpg_error.found()
938 conf.set('HAVE_GCRYPT', have_deps)
940 # link to neither of the libs if one is not found
949 default_dnssec = get_option('default-dnssec')
950 if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
951 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
952 default_dnssec = 'no'
954 conf.set('DEFAULT_DNSSEC_MODE',
955 'DNSSEC_' + default_dnssec.underscorify().to_upper())
956 substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
958 want_importd = get_option('importd')
959 if want_importd != 'false'
960 have_deps = (conf.get('HAVE_LIBCURL', false) and
961 conf.get('HAVE_ZLIB', false) and
962 conf.get('HAVE_BZIP2', false) and
963 conf.get('HAVE_XZ', false) and
964 conf.get('HAVE_GCRYPT', false))
965 conf.set('ENABLE_IMPORTD', have_deps)
966 if want_importd == 'true' and not have_deps
967 error('importd support was requested, but dependencies are not available')
971 want_remote = get_option('remote')
972 if want_remote != 'false'
973 have_deps = [conf.get('HAVE_MICROHTTPD', false),
974 conf.get('HAVE_LIBCURL', false)]
975 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
976 # it's possible to build one without the other. Complain only if
977 # support was explictly requested. The auxiliary files like sysusers
978 # config should be installed when any of the programs are built.
979 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
980 error('remote support was requested, but dependencies are not available')
982 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
985 foreach pair : [['utmp', 'HAVE_UTMP'],
986 ['hibernate', 'ENABLE_HIBERNATE'],
987 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
988 ['binfmt', 'ENABLE_BINFMT'],
989 ['coredump', 'ENABLE_COREDUMP'],
990 ['resolve', 'ENABLE_RESOLVED'],
991 ['logind', 'ENABLE_LOGIND'],
992 ['hostnamed', 'ENABLE_HOSTNAMED'],
993 ['localed', 'ENABLE_LOCALED'],
994 ['machined', 'ENABLE_MACHINED'],
995 ['networkd', 'ENABLE_NETWORKD'],
996 ['timedated', 'ENABLE_TIMEDATED'],
997 ['timesyncd', 'ENABLE_TIMESYNCD'],
998 ['myhostname', 'HAVE_MYHOSTNAME'],
999 ['firstboot', 'ENABLE_FIRSTBOOT'],
1000 ['randomseed', 'ENABLE_RANDOMSEED'],
1001 ['backlight', 'ENABLE_BACKLIGHT'],
1002 ['vconsole', 'ENABLE_VCONSOLE'],
1003 ['quotacheck', 'ENABLE_QUOTACHECK'],
1004 ['sysusers', 'ENABLE_SYSUSERS'],
1005 ['tmpfiles', 'ENABLE_TMPFILES'],
1006 ['hwdb', 'ENABLE_HWDB'],
1007 ['rfkill', 'ENABLE_RFKILL'],
1008 ['ldconfig', 'ENABLE_LDCONFIG'],
1009 ['efi', 'ENABLE_EFI'],
1010 ['tpm', 'SD_BOOT_LOG_TPM'],
1011 ['ima', 'HAVE_IMA'],
1012 ['smack', 'HAVE_SMACK'],
1013 ['gshadow', 'ENABLE_GSHADOW'],
1014 ['idn', 'ENABLE_IDN'],
1015 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
1018 if get_option(pair[0])
1019 conf.set(pair[1], true)
1020 m4_defines += ['-D' + pair[1]]
1024 want_tests = get_option('tests')
1025 install_tests = get_option('install-tests')
1028 #####################################################################
1030 if get_option('efi')
1031 efi_arch = host_machine.cpu_family()
1033 if efi_arch == 'x86'
1034 EFI_MACHINE_TYPE_NAME = 'ia32'
1035 gnu_efi_arch = 'ia32'
1036 elif efi_arch == 'x86_64'
1037 EFI_MACHINE_TYPE_NAME = 'x64'
1038 gnu_efi_arch = 'x86_64'
1039 elif efi_arch == 'arm'
1040 EFI_MACHINE_TYPE_NAME = 'arm'
1041 gnu_efi_arch = 'arm'
1042 elif efi_arch == 'aarch64'
1043 EFI_MACHINE_TYPE_NAME = 'aa64'
1044 gnu_efi_arch = 'aarch64'
1046 EFI_MACHINE_TYPE_NAME = ''
1050 conf.set('ENABLE_EFI', true)
1051 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1053 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1056 #####################################################################
1058 config_h = configure_file(
1059 output : 'config.h',
1060 configuration : conf)
1062 includes = include_directories('src/basic',
1072 'src/libsystemd/sd-bus',
1073 'src/libsystemd/sd-device',
1074 'src/libsystemd/sd-hwdb',
1075 'src/libsystemd/sd-id128',
1076 'src/libsystemd/sd-netlink',
1077 'src/libsystemd/sd-network',
1078 'src/libsystemd-network',
1081 add_project_arguments('-include', 'config.h', language : 'c')
1083 gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1084 'src/shared/gcrypt-util.c')
1088 subdir('src/systemd')
1090 subdir('src/libsystemd')
1091 subdir('src/libsystemd-network')
1092 subdir('src/journal')
1095 libjournal_core = static_library(
1097 libjournal_core_sources,
1099 include_directories : includes,
1102 libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1103 libsystemd = shared_library(
1105 libsystemd_internal_sources,
1106 journal_internal_sources,
1108 include_directories : includes,
1109 link_args : ['-shared',
1110 '-Wl,--version-script=' + libsystemd_sym_path],
1111 link_with : [libbasic],
1112 dependencies : [threads,
1117 link_depends : libsystemd_sym,
1119 install_dir : rootlibdir)
1121 ############################################################
1123 # binaries that have --help and are intended for use by humans,
1124 # usually, but not always, installed in /bin.
1125 public_programs = []
1127 subdir('src/libudev')
1128 subdir('src/shared')
1131 subdir('src/network')
1133 subdir('src/analyze')
1134 subdir('src/journal-remote')
1135 subdir('src/coredump')
1136 subdir('src/hostname')
1137 subdir('src/import')
1138 subdir('src/kernel-install')
1139 subdir('src/locale')
1140 subdir('src/machine')
1141 subdir('src/nspawn')
1142 subdir('src/resolve')
1143 subdir('src/timedate')
1144 subdir('src/timesync')
1145 subdir('src/vconsole')
1146 subdir('src/sulogin-shell')
1147 subdir('src/boot/efi')
1152 ############################################################
1154 # only static linking apart from libdl, to make sure that the
1155 # module is linked to all libraries that it uses.
1156 test_dlopen = executable(
1159 include_directories : includes,
1160 link_with : [libbasic],
1161 dependencies : [libdl])
1163 foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1164 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1165 ['mymachines', 'ENABLE_MACHINED'],
1166 ['resolve', 'ENABLE_RESOLVED']]
1168 condition = tuple[1] == '' or conf.get(tuple[1], false)
1172 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1173 version_script_arg = join_paths(meson.current_source_dir(), sym)
1175 nss = shared_library(
1177 'src/nss-@0@/nss-@0@.c'.format(module),
1179 include_directories : includes,
1180 link_args : ['-shared',
1181 '-Wl,--version-script=' + version_script_arg,
1183 link_with : [libsystemd_internal,
1185 dependencies : [threads,
1189 install_dir : rootlibdir)
1191 # We cannot use shared_module because it does not support version suffix.
1192 # Unfortunately shared_library insists on creating the symlink…
1193 meson.add_install_script('sh', '-c',
1194 'rm $DESTDIR@0@/libnss_@1@.so'
1195 .format(rootlibdir, module))
1197 test('dlopen-nss_' + module,
1199 args : [nss.full_path()]) # path to dlopen must include a slash
1203 ############################################################
1205 executable('systemd',
1207 include_directories : includes,
1208 link_with : [libcore,
1210 dependencies : [threads,
1216 install_rpath : rootlibexecdir,
1218 install_dir : rootlibexecdir)
1220 exe = executable('systemd-analyze',
1221 systemd_analyze_sources,
1222 include_directories : includes,
1223 link_with : [libcore,
1225 dependencies : [threads,
1231 install_rpath : rootlibexecdir,
1233 public_programs += [exe]
1235 executable('systemd-journald',
1236 systemd_journald_sources,
1237 include_directories : includes,
1238 link_with : [libjournal_core,
1240 dependencies : [threads,
1244 install_rpath : rootlibexecdir,
1246 install_dir : rootlibexecdir)
1248 exe = executable('systemd-cat',
1249 systemd_cat_sources,
1250 include_directories : includes,
1251 link_with : [libjournal_core,
1253 dependencies : [threads],
1254 install_rpath : rootlibexecdir,
1256 public_programs += [exe]
1258 exe = executable('journalctl',
1260 include_directories : includes,
1261 link_with : [libshared],
1262 dependencies : [threads,
1266 install_rpath : rootlibexecdir,
1268 install_dir : rootbindir)
1269 public_programs += [exe]
1271 executable('systemd-getty-generator',
1272 'src/getty-generator/getty-generator.c',
1273 include_directories : includes,
1274 link_with : [libshared],
1275 install_rpath : rootlibexecdir,
1277 install_dir : systemgeneratordir)
1279 executable('systemd-debug-generator',
1280 'src/debug-generator/debug-generator.c',
1281 include_directories : includes,
1282 link_with : [libshared],
1283 install_rpath : rootlibexecdir,
1285 install_dir : systemgeneratordir)
1287 executable('systemd-fstab-generator',
1288 'src/fstab-generator/fstab-generator.c',
1289 'src/core/mount-setup.c',
1290 include_directories : includes,
1291 link_with : [libshared],
1292 install_rpath : rootlibexecdir,
1294 install_dir : systemgeneratordir)
1296 if conf.get('ENABLE_ENVIRONMENT_D', false)
1297 executable('30-systemd-environment-d-generator',
1298 'src/environment-d-generator/environment-d-generator.c',
1299 include_directories : includes,
1300 link_with : [libshared],
1301 install_rpath : rootlibexecdir,
1303 install_dir : userenvgeneratordir)
1305 meson.add_install_script(meson_make_symlink,
1306 join_paths(sysconfdir, 'environment'),
1307 join_paths(environmentdir, '99-environment.conf'))
1310 if conf.get('ENABLE_HIBERNATE', false)
1311 executable('systemd-hibernate-resume-generator',
1312 'src/hibernate-resume/hibernate-resume-generator.c',
1313 include_directories : includes,
1314 link_with : [libshared],
1315 install_rpath : rootlibexecdir,
1317 install_dir : systemgeneratordir)
1319 executable('systemd-hibernate-resume',
1320 'src/hibernate-resume/hibernate-resume.c',
1321 include_directories : includes,
1322 link_with : [libshared],
1323 install_rpath : rootlibexecdir,
1325 install_dir : rootlibexecdir)
1328 if conf.get('HAVE_BLKID', false)
1329 executable('systemd-gpt-auto-generator',
1330 'src/gpt-auto-generator/gpt-auto-generator.c',
1331 'src/basic/blkid-util.h',
1332 include_directories : includes,
1333 link_with : [libshared],
1334 dependencies : libblkid,
1335 install_rpath : rootlibexecdir,
1337 install_dir : systemgeneratordir)
1339 exe = executable('systemd-dissect',
1340 'src/dissect/dissect.c',
1341 include_directories : includes,
1342 link_with : [libshared],
1343 install_rpath : rootlibexecdir,
1345 install_dir : rootlibexecdir)
1346 public_programs += [exe]
1349 if conf.get('ENABLE_RESOLVED', false)
1350 executable('systemd-resolved',
1351 systemd_resolved_sources,
1352 gcrypt_util_sources,
1353 include_directories : includes,
1354 link_with : [libshared],
1355 dependencies : [threads,
1360 install_rpath : rootlibexecdir,
1362 install_dir : rootlibexecdir)
1364 exe = executable('systemd-resolve',
1365 systemd_resolve_sources,
1366 gcrypt_util_sources,
1367 include_directories : includes,
1368 link_with : [libshared],
1369 dependencies : [threads,
1374 install_rpath : rootlibexecdir,
1376 public_programs += [exe]
1379 if conf.get('ENABLE_LOGIND', false)
1380 executable('systemd-logind',
1381 systemd_logind_sources,
1382 include_directories : includes,
1383 link_with : [liblogind_core,
1385 dependencies : [threads,
1387 install_rpath : rootlibexecdir,
1389 install_dir : rootlibexecdir)
1391 exe = executable('loginctl',
1393 include_directories : includes,
1394 link_with : [libshared],
1395 dependencies : [threads,
1398 install_rpath : rootlibexecdir,
1400 install_dir : rootbindir)
1401 public_programs += [exe]
1403 exe = executable('systemd-inhibit',
1404 'src/login/inhibit.c',
1405 include_directories : includes,
1406 link_with : [libshared],
1407 install_rpath : rootlibexecdir,
1409 install_dir : rootbindir)
1410 public_programs += [exe]
1412 if conf.get('HAVE_PAM', false)
1413 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1414 pam_systemd = shared_library(
1418 include_directories : includes,
1419 link_args : ['-shared',
1420 '-Wl,--version-script=' + version_script_arg],
1421 link_with : [libsystemd_internal,
1423 dependencies : [threads,
1426 link_depends : pam_systemd_sym,
1428 install_dir : pamlibdir)
1430 test('dlopen-pam_systemd',
1432 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1436 if conf.get('HAVE_PAM', false)
1437 executable('systemd-user-sessions',
1438 'src/user-sessions/user-sessions.c',
1439 include_directories : includes,
1440 link_with : [libshared],
1441 install_rpath : rootlibexecdir,
1443 install_dir : rootlibexecdir)
1446 if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1447 exe = executable('bootctl',
1448 'src/boot/bootctl.c',
1449 include_directories : includes,
1450 link_with : [libshared],
1451 dependencies : [libblkid],
1452 install_rpath : rootlibexecdir,
1454 public_programs += [exe]
1457 exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1458 include_directories : includes,
1459 link_with : [libshared],
1460 dependencies : [threads],
1461 install_rpath : rootlibexecdir,
1463 public_programs += [exe]
1465 exe = executable('systemctl', 'src/systemctl/systemctl.c',
1466 include_directories : includes,
1467 link_with : [libshared],
1468 dependencies : [threads,
1473 install_rpath : rootlibexecdir,
1475 install_dir : rootbindir)
1476 public_programs += [exe]
1478 if conf.get('ENABLE_BACKLIGHT', false)
1479 executable('systemd-backlight',
1480 'src/backlight/backlight.c',
1481 include_directories : includes,
1482 link_with : [libshared],
1483 install_rpath : rootlibexecdir,
1485 install_dir : rootlibexecdir)
1488 if conf.get('ENABLE_RFKILL', false)
1489 executable('systemd-rfkill',
1490 'src/rfkill/rfkill.c',
1491 include_directories : includes,
1492 link_with : [libshared],
1493 install_rpath : rootlibexecdir,
1495 install_dir : rootlibexecdir)
1498 executable('systemd-system-update-generator',
1499 'src/system-update-generator/system-update-generator.c',
1500 include_directories : includes,
1501 link_with : [libshared],
1502 install_rpath : rootlibexecdir,
1504 install_dir : systemgeneratordir)
1506 if conf.get('HAVE_LIBCRYPTSETUP', false)
1507 executable('systemd-cryptsetup',
1508 'src/cryptsetup/cryptsetup.c',
1509 include_directories : includes,
1510 link_with : [libshared],
1511 dependencies : [libcryptsetup],
1512 install_rpath : rootlibexecdir,
1514 install_dir : rootlibexecdir)
1516 executable('systemd-cryptsetup-generator',
1517 'src/cryptsetup/cryptsetup-generator.c',
1518 include_directories : includes,
1519 link_with : [libshared],
1520 dependencies : [libcryptsetup],
1521 install_rpath : rootlibexecdir,
1523 install_dir : systemgeneratordir)
1525 executable('systemd-veritysetup',
1526 'src/veritysetup/veritysetup.c',
1527 include_directories : includes,
1528 link_with : [libshared],
1529 dependencies : [libcryptsetup],
1530 install_rpath : rootlibexecdir,
1532 install_dir : rootlibexecdir)
1534 executable('systemd-veritysetup-generator',
1535 'src/veritysetup/veritysetup-generator.c',
1536 include_directories : includes,
1537 link_with : [libshared],
1538 dependencies : [libcryptsetup],
1539 install_rpath : rootlibexecdir,
1541 install_dir : systemgeneratordir)
1544 if conf.get('HAVE_SYSV_COMPAT', false)
1545 executable('systemd-sysv-generator',
1546 'src/sysv-generator/sysv-generator.c',
1547 include_directories : includes,
1548 link_with : [libshared],
1549 install_rpath : rootlibexecdir,
1551 install_dir : systemgeneratordir)
1553 executable('systemd-rc-local-generator',
1554 'src/rc-local-generator/rc-local-generator.c',
1555 include_directories : includes,
1556 link_with : [libshared],
1557 install_rpath : rootlibexecdir,
1559 install_dir : systemgeneratordir)
1562 if conf.get('ENABLE_HOSTNAMED', false)
1563 executable('systemd-hostnamed',
1564 'src/hostname/hostnamed.c',
1565 include_directories : includes,
1566 link_with : [libshared],
1567 install_rpath : rootlibexecdir,
1569 install_dir : rootlibexecdir)
1571 exe = executable('hostnamectl',
1572 'src/hostname/hostnamectl.c',
1573 include_directories : includes,
1574 link_with : [libshared],
1575 install_rpath : rootlibexecdir,
1577 public_programs += [exe]
1580 if conf.get('ENABLE_LOCALED', false)
1581 if conf.get('HAVE_XKBCOMMON', false)
1582 # logind will load libxkbcommon.so dynamically on its own
1588 executable('systemd-localed',
1589 systemd_localed_sources,
1590 include_directories : includes,
1591 link_with : [libshared],
1592 dependencies : deps,
1593 install_rpath : rootlibexecdir,
1595 install_dir : rootlibexecdir)
1597 exe = executable('localectl',
1599 include_directories : includes,
1600 link_with : [libshared],
1601 install_rpath : rootlibexecdir,
1603 public_programs += [exe]
1606 if conf.get('ENABLE_TIMEDATED', false)
1607 executable('systemd-timedated',
1608 'src/timedate/timedated.c',
1609 include_directories : includes,
1610 link_with : [libshared],
1611 install_rpath : rootlibexecdir,
1613 install_dir : rootlibexecdir)
1615 exe = executable('timedatectl',
1616 'src/timedate/timedatectl.c',
1617 include_directories : includes,
1618 install_rpath : rootlibexecdir,
1619 link_with : [libshared],
1621 public_programs += [exe]
1624 if conf.get('ENABLE_TIMESYNCD', false)
1625 executable('systemd-timesyncd',
1626 systemd_timesyncd_sources,
1627 include_directories : includes,
1628 link_with : [libshared],
1629 dependencies : [threads,
1631 install_rpath : rootlibexecdir,
1633 install_dir : rootlibexecdir)
1636 if conf.get('ENABLE_MACHINED', false)
1637 executable('systemd-machined',
1638 systemd_machined_sources,
1639 include_directories : includes,
1640 link_with : [libmachine_core,
1642 install_rpath : rootlibexecdir,
1644 install_dir : rootlibexecdir)
1646 exe = executable('machinectl',
1647 'src/machine/machinectl.c',
1648 include_directories : includes,
1649 link_with : [libshared],
1650 dependencies : [threads,
1653 install_rpath : rootlibexecdir,
1655 install_dir : rootbindir)
1656 public_programs += [exe]
1659 if conf.get('ENABLE_IMPORTD', false)
1660 executable('systemd-importd',
1661 systemd_importd_sources,
1662 include_directories : includes,
1663 link_with : [libshared],
1664 dependencies : [threads],
1665 install_rpath : rootlibexecdir,
1667 install_dir : rootlibexecdir)
1669 systemd_pull = executable('systemd-pull',
1670 systemd_pull_sources,
1671 include_directories : includes,
1672 link_with : [libshared],
1673 dependencies : [libcurl,
1678 install_rpath : rootlibexecdir,
1680 install_dir : rootlibexecdir)
1682 systemd_import = executable('systemd-import',
1683 systemd_import_sources,
1684 include_directories : includes,
1685 link_with : [libshared],
1686 dependencies : [libcurl,
1690 install_rpath : rootlibexecdir,
1692 install_dir : rootlibexecdir)
1694 systemd_export = executable('systemd-export',
1695 systemd_export_sources,
1696 include_directories : includes,
1697 link_with : [libshared],
1698 dependencies : [libcurl,
1702 install_rpath : rootlibexecdir,
1704 install_dir : rootlibexecdir)
1705 public_programs += [systemd_pull, systemd_import, systemd_export]
1708 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1709 exe = executable('systemd-journal-upload',
1710 systemd_journal_upload_sources,
1711 include_directories : includes,
1712 link_with : [libshared],
1713 dependencies : [threads,
1718 install_rpath : rootlibexecdir,
1720 install_dir : rootlibexecdir)
1721 public_programs += [exe]
1724 if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1725 s_j_remote = executable('systemd-journal-remote',
1726 systemd_journal_remote_sources,
1727 include_directories : includes,
1728 link_with : [libshared],
1729 dependencies : [threads,
1734 install_rpath : rootlibexecdir,
1736 install_dir : rootlibexecdir)
1738 s_j_gatewayd = executable('systemd-journal-gatewayd',
1739 systemd_journal_gatewayd_sources,
1740 include_directories : includes,
1741 link_with : [libshared],
1742 dependencies : [threads,
1747 install_rpath : rootlibexecdir,
1749 install_dir : rootlibexecdir)
1750 public_programs += [s_j_remote, s_j_gatewayd]
1753 if conf.get('ENABLE_COREDUMP', false)
1754 executable('systemd-coredump',
1755 systemd_coredump_sources,
1756 include_directories : includes,
1757 link_with : [libshared],
1758 dependencies : [threads,
1763 install_rpath : rootlibexecdir,
1765 install_dir : rootlibexecdir)
1767 exe = executable('coredumpctl',
1768 coredumpctl_sources,
1769 include_directories : includes,
1770 link_with : [libshared],
1771 dependencies : [threads,
1774 install_rpath : rootlibexecdir,
1776 public_programs += [exe]
1779 if conf.get('ENABLE_BINFMT', false)
1780 exe = executable('systemd-binfmt',
1781 'src/binfmt/binfmt.c',
1782 include_directories : includes,
1783 link_with : [libshared],
1784 install_rpath : rootlibexecdir,
1786 install_dir : rootlibexecdir)
1787 public_programs += [exe]
1789 meson.add_install_script('sh', '-c',
1790 mkdir_p.format(binfmtdir))
1791 meson.add_install_script('sh', '-c',
1792 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1795 if conf.get('ENABLE_VCONSOLE', false)
1796 executable('systemd-vconsole-setup',
1797 'src/vconsole/vconsole-setup.c',
1798 include_directories : includes,
1799 link_with : [libshared],
1800 install_rpath : rootlibexecdir,
1802 install_dir : rootlibexecdir)
1805 if conf.get('ENABLE_RANDOMSEED', false)
1806 executable('systemd-random-seed',
1807 'src/random-seed/random-seed.c',
1808 include_directories : includes,
1809 link_with : [libshared],
1810 install_rpath : rootlibexecdir,
1812 install_dir : rootlibexecdir)
1815 if conf.get('ENABLE_FIRSTBOOT', false)
1816 executable('systemd-firstboot',
1817 'src/firstboot/firstboot.c',
1818 include_directories : includes,
1819 link_with : [libshared],
1820 dependencies : [libcrypt],
1821 install_rpath : rootlibexecdir,
1823 install_dir : rootbindir)
1826 executable('systemd-remount-fs',
1827 'src/remount-fs/remount-fs.c',
1828 'src/core/mount-setup.c',
1829 'src/core/mount-setup.h',
1830 include_directories : includes,
1831 link_with : [libshared],
1832 install_rpath : rootlibexecdir,
1834 install_dir : rootlibexecdir)
1836 executable('systemd-machine-id-setup',
1837 'src/machine-id-setup/machine-id-setup-main.c',
1838 'src/core/machine-id-setup.c',
1839 'src/core/machine-id-setup.h',
1840 include_directories : includes,
1841 link_with : [libshared],
1842 install_rpath : rootlibexecdir,
1844 install_dir : rootbindir)
1846 executable('systemd-fsck',
1848 include_directories : includes,
1849 link_with : [libshared],
1850 install_rpath : rootlibexecdir,
1852 install_dir : rootlibexecdir)
1854 executable('systemd-sleep',
1855 'src/sleep/sleep.c',
1856 include_directories : includes,
1857 link_with : [libshared],
1858 install_rpath : rootlibexecdir,
1860 install_dir : rootlibexecdir)
1862 exe = executable('systemd-sysctl',
1863 'src/sysctl/sysctl.c',
1864 include_directories : includes,
1865 link_with : [libshared],
1866 install_rpath : rootlibexecdir,
1868 install_dir : rootlibexecdir)
1869 public_programs += [exe]
1871 executable('systemd-ac-power',
1872 'src/ac-power/ac-power.c',
1873 include_directories : includes,
1874 link_with : [libshared],
1875 install_rpath : rootlibexecdir,
1877 install_dir : rootlibexecdir)
1879 exe = executable('systemd-detect-virt',
1880 'src/detect-virt/detect-virt.c',
1881 include_directories : includes,
1882 link_with : [libshared],
1883 install_rpath : rootlibexecdir,
1885 public_programs += [exe]
1887 exe = executable('systemd-delta',
1888 'src/delta/delta.c',
1889 include_directories : includes,
1890 link_with : [libshared],
1891 install_rpath : rootlibexecdir,
1893 public_programs += [exe]
1895 exe = executable('systemd-escape',
1896 'src/escape/escape.c',
1897 include_directories : includes,
1898 link_with : [libshared],
1899 install_rpath : rootlibexecdir,
1901 install_dir : rootbindir)
1902 public_programs += [exe]
1904 exe = executable('systemd-notify',
1905 'src/notify/notify.c',
1906 include_directories : includes,
1907 link_with : [libshared],
1908 install_rpath : rootlibexecdir,
1910 install_dir : rootbindir)
1911 public_programs += [exe]
1913 executable('systemd-volatile-root',
1914 'src/volatile-root/volatile-root.c',
1915 include_directories : includes,
1916 link_with : [libshared],
1917 install_rpath : rootlibexecdir,
1919 install_dir : rootlibexecdir)
1921 executable('systemd-cgroups-agent',
1922 'src/cgroups-agent/cgroups-agent.c',
1923 include_directories : includes,
1924 link_with : [libshared],
1925 install_rpath : rootlibexecdir,
1927 install_dir : rootlibexecdir)
1929 exe = executable('systemd-path',
1931 include_directories : includes,
1932 link_with : [libshared],
1933 install_rpath : rootlibexecdir,
1935 public_programs += [exe]
1937 exe = executable('systemd-ask-password',
1938 'src/ask-password/ask-password.c',
1939 include_directories : includes,
1940 link_with : [libshared],
1941 install_rpath : rootlibexecdir,
1943 install_dir : rootbindir)
1944 public_programs += [exe]
1946 executable('systemd-reply-password',
1947 'src/reply-password/reply-password.c',
1948 include_directories : includes,
1949 link_with : [libshared],
1950 install_rpath : rootlibexecdir,
1952 install_dir : rootlibexecdir)
1954 exe = executable('systemd-tty-ask-password-agent',
1955 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1956 include_directories : includes,
1957 link_with : [libshared],
1958 install_rpath : rootlibexecdir,
1960 install_dir : rootbindir)
1961 public_programs += [exe]
1963 exe = executable('systemd-cgls',
1965 include_directories : includes,
1966 link_with : [libshared],
1967 install_rpath : rootlibexecdir,
1969 public_programs += [exe]
1971 exe = executable('systemd-cgtop',
1972 'src/cgtop/cgtop.c',
1973 include_directories : includes,
1974 link_with : [libshared],
1975 install_rpath : rootlibexecdir,
1977 public_programs += [exe]
1979 executable('systemd-initctl',
1980 'src/initctl/initctl.c',
1981 include_directories : includes,
1982 link_with : [libshared],
1983 install_rpath : rootlibexecdir,
1985 install_dir : rootlibexecdir)
1987 exe = executable('systemd-mount',
1988 'src/mount/mount-tool.c',
1989 include_directories : includes,
1990 link_with : [libshared],
1991 install_rpath : rootlibexecdir,
1993 public_programs += [exe]
1995 meson.add_install_script(meson_make_symlink,
1996 'systemd-mount', join_paths(bindir, 'systemd-umount'))
1998 exe = executable('systemd-run',
2000 include_directories : includes,
2001 link_with : [libshared],
2002 install_rpath : rootlibexecdir,
2004 public_programs += [exe]
2006 exe = executable('systemd-stdio-bridge',
2007 'src/stdio-bridge/stdio-bridge.c',
2008 include_directories : includes,
2009 link_with : [libshared],
2010 install_rpath : rootlibexecdir,
2012 public_programs += [exe]
2014 exe = executable('busctl',
2015 'src/busctl/busctl.c',
2016 'src/busctl/busctl-introspect.c',
2017 'src/busctl/busctl-introspect.h',
2018 include_directories : includes,
2019 link_with : [libshared],
2020 install_rpath : rootlibexecdir,
2022 public_programs += [exe]
2024 if conf.get('ENABLE_SYSUSERS', false)
2025 exe = executable('systemd-sysusers',
2026 'src/sysusers/sysusers.c',
2027 include_directories : includes,
2028 link_with : [libshared],
2029 install_rpath : rootlibexecdir,
2031 install_dir : rootbindir)
2032 public_programs += [exe]
2035 if conf.get('ENABLE_TMPFILES', false)
2036 exe = executable('systemd-tmpfiles',
2037 'src/tmpfiles/tmpfiles.c',
2038 include_directories : includes,
2039 link_with : [libshared],
2040 dependencies : [libacl],
2041 install_rpath : rootlibexecdir,
2043 install_dir : rootbindir)
2044 public_programs += [exe]
2047 if conf.get('ENABLE_HWDB', false)
2048 exe = executable('systemd-hwdb',
2050 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2051 include_directories : includes,
2052 link_with : [libudev_internal],
2053 install_rpath : udev_rpath,
2055 install_dir : rootbindir)
2056 public_programs += [exe]
2059 if conf.get('ENABLE_QUOTACHECK', false)
2060 executable('systemd-quotacheck',
2061 'src/quotacheck/quotacheck.c',
2062 include_directories : includes,
2063 link_with : [libshared],
2064 install_rpath : rootlibexecdir,
2066 install_dir : rootlibexecdir)
2069 exe = executable('systemd-socket-proxyd',
2070 'src/socket-proxy/socket-proxyd.c',
2071 include_directories : includes,
2072 link_with : [libshared],
2073 dependencies : [threads],
2074 install_rpath : rootlibexecdir,
2076 install_dir : rootlibexecdir)
2077 public_programs += [exe]
2079 exe = executable('systemd-udevd',
2080 systemd_udevd_sources,
2081 include_directories : includes,
2082 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2083 link_with : [libudev_core,
2086 dependencies : [threads,
2091 install_rpath : udev_rpath,
2093 install_dir : rootlibexecdir)
2094 public_programs += [exe]
2096 exe = executable('udevadm',
2098 include_directories : includes,
2099 link_with : [libudev_core,
2102 dependencies : [threads,
2107 install_rpath : udev_rpath,
2109 install_dir : rootbindir)
2110 public_programs += [exe]
2112 executable('systemd-shutdown',
2113 systemd_shutdown_sources,
2114 include_directories : includes,
2115 link_with : [libshared],
2116 install_rpath : rootlibexecdir,
2118 install_dir : rootlibexecdir)
2120 executable('systemd-update-done',
2121 'src/update-done/update-done.c',
2122 include_directories : includes,
2123 link_with : [libshared],
2124 install_rpath : rootlibexecdir,
2126 install_dir : rootlibexecdir)
2128 executable('systemd-update-utmp',
2129 'src/update-utmp/update-utmp.c',
2130 include_directories : includes,
2131 link_with : [libshared],
2132 dependencies : [libaudit],
2133 install_rpath : rootlibexecdir,
2135 install_dir : rootlibexecdir)
2137 if conf.get('HAVE_KMOD', false)
2138 executable('systemd-modules-load',
2139 'src/modules-load/modules-load.c',
2140 include_directories : includes,
2141 link_with : [libshared],
2142 dependencies : [libkmod],
2143 install_rpath : rootlibexecdir,
2145 install_dir : rootlibexecdir)
2147 meson.add_install_script('sh', '-c',
2148 mkdir_p.format(modulesloaddir))
2149 meson.add_install_script('sh', '-c',
2150 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2153 exe = executable('systemd-nspawn',
2154 systemd_nspawn_sources,
2155 'src/core/mount-setup.c', # FIXME: use a variable?
2156 'src/core/mount-setup.h',
2157 'src/core/loopback-setup.c',
2158 'src/core/loopback-setup.h',
2159 include_directories : [includes, include_directories('src/nspawn')],
2160 link_with : [libshared],
2161 dependencies : [libacl,
2165 install_rpath : rootlibexecdir,
2167 public_programs += [exe]
2169 if conf.get('ENABLE_NETWORKD', false)
2170 executable('systemd-networkd',
2171 systemd_networkd_sources,
2172 include_directories : includes,
2173 link_with : [libnetworkd_core,
2177 dependencies : [threads],
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)
2224 include_directories : incs,
2225 link_with : link_with,
2226 dependencies : dependencies,
2228 install_rpath : rootlibexecdir,
2229 install : install_tests,
2230 install_dir : join_paths(testsdir, type))
2233 message('@0@ is a manual test'.format(name))
2234 elif type == 'unsafe' and want_tests != 'unsafe'
2235 message('@0@ is an unsafe test'.format(name))
2242 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2246 test_libsystemd_sym = executable(
2247 'test-libsystemd-sym',
2248 test_libsystemd_sym_c,
2249 include_directories : includes,
2250 link_with : [libsystemd],
2251 install : install_tests,
2252 install_dir : testsdir)
2253 test('test-libsystemd-sym',
2254 test_libsystemd_sym)
2256 test_libudev_sym = executable(
2259 include_directories : includes,
2260 c_args : ['-Wno-deprecated-declarations'],
2261 link_with : [libudev],
2262 install : install_tests,
2263 install_dir : testsdir)
2264 test('test-libudev-sym',
2267 ############################################################
2269 make_directive_index_py = find_program('tools/make-directive-index.py')
2270 make_man_index_py = find_program('tools/make-man-index.py')
2271 xml_helper_py = find_program('tools/xml_helper.py')
2272 hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2276 subdir('sysusers.d')
2277 subdir('tmpfiles.d')
2282 subdir('shell-completion/bash')
2283 subdir('shell-completion/zsh')
2284 subdir('docs/sysvinit')
2285 subdir('docs/var-log')
2287 # FIXME: figure out if the warning is true:
2288 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2289 install_subdir('factory/etc',
2290 install_dir : factorydir)
2293 install_data('xorg/50-systemd-user.sh',
2294 install_dir : xinitrcdir)
2295 install_data('system-preset/90-systemd.preset',
2296 install_dir : systempresetdir)
2297 install_data('README',
2304 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2305 install_dir : docdir)
2307 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2308 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2310 ############################################################
2312 meson_check_help = find_program('tools/meson-check-help.sh')
2314 foreach exec : public_programs
2315 name = exec.full_path().split('/')[-1]
2316 test('check-help-' + name,
2318 args : [exec.full_path()])
2321 ############################################################
2324 all_files = run_command(
2326 ['--git-dir=@0@/.git'.format(meson.source_root()),
2329 all_files = files(all_files.stdout().split())
2334 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
2338 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
2342 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2345 command : [meson_git_contrib_sh])
2349 git_head = run_command(
2351 ['--git-dir=@0@/.git'.format(meson.source_root()),
2352 'rev-parse', 'HEAD']).stdout().strip()
2353 git_head_short = run_command(
2355 ['--git-dir=@0@/.git'.format(meson.source_root()),
2356 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2360 command : ['git', 'archive',
2361 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2363 '--prefix', 'systemd-@0@/'.format(git_head),
2367 ############################################################
2370 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2372 'prefix: @0@'.format(prefixdir),
2373 'rootprefix: @0@'.format(rootprefixdir),
2374 'sysconf dir: @0@'.format(sysconfdir),
2375 'includedir: @0@'.format(includedir),
2376 'lib dir: @0@'.format(libdir),
2377 'rootlib dir: @0@'.format(rootlibdir),
2378 'SysV init scripts: @0@'.format(sysvinit_path),
2379 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2380 'PAM modules dir: @0@'.format(pamlibdir),
2381 'PAM configuration dir: @0@'.format(pamconfdir),
2382 'RPM macros dir: @0@'.format(rpmmacrosdir),
2383 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2384 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2385 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2386 'bash completions dir: @0@'.format(bashcompletiondir),
2387 'zsh completions dir: @0@'.format(zshcompletiondir),
2388 'extra start script: @0@'.format(get_option('rc-local')),
2389 'extra stop script: @0@'.format(get_option('halt-local')),
2390 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2391 get_option('debug-tty')),
2392 'TTY GID: @0@'.format(tty_gid),
2393 'maximum system UID: @0@'.format(system_uid_max),
2394 'maximum system GID: @0@'.format(system_gid_max),
2395 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2396 'certificate root: @0@'.format(get_option('certificate-root')),
2397 'support URL: @0@'.format(support_url),
2398 'nobody user name: @0@'.format(get_option('nobody-user')),
2399 'nobody group name: @0@'.format(get_option('nobody-group')),
2400 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2402 'default DNSSEC mode: @0@'.format(default_dnssec),
2403 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2404 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2406 alt_dns_servers = '\n '.join(dns_servers.split(' '))
2407 alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2409 'default DNS servers: @0@'.format(alt_dns_servers),
2410 'default NTP servers: @0@'.format(alt_ntp_servers)]
2412 alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2413 '@@0@'.format(time_epoch)).stdout().strip()
2415 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2418 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2419 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2420 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2422 if conf.get('ENABLE_EFI', false)
2424 'efi arch: @0@'.format(efi_arch)]
2428 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2429 'EFI CC @0@'.format(efi_cc),
2430 'EFI libdir: @0@'.format(efi_libdir),
2431 'EFI ldsdir: @0@'.format(efi_ldsdir),
2432 'EFI includedir: @0@'.format(efi_incdir)]
2485 ['legacy pkla', install_polkit_pkla],
2487 ['gnu-efi', have_gnu_efi],
2493 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2496 ['man pages', want_man],
2497 ['html pages', want_html],
2498 ['man page indices', want_man and have_lxml],
2499 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2504 ['adm group', get_option('adm-group')],
2505 ['wheel group', get_option('wheel-group')],
2508 ['debug mmap cache'],
2511 cond = tuple.get(1, '')
2513 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2514 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2515 cond = conf.get(ident1, false) or conf.get(ident2, false)
2520 missing += [tuple[0]]
2525 'enabled features: @0@'.format(', '.join(found)),
2526 'disabled features: @0@'.format(', '.join(missing))]
2527 message('\n '.join(status))