1 project('elogind', '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://github.com/elogind/elogind')
23 substs.set('PACKAGE_VERSION', meson.project_version())
27 #####################################################################
28 #if 0 /// elogind does not need this
29 # # Try to install the git pre-commit hook
30 # git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
31 # if git_hook.returncode() == 0
32 # message(git_hook.stdout().strip())
35 # elogind Note: We use precompiler masks for two reasons:
36 # 1) The masking is consistent with the sources
37 # 2) The git patch creator we use for preparing upstream patches
38 # manipulates commits to not take those masks out. Therefore
39 # it can be used to add commits updating the meson files, too.
42 #####################################################################
44 rootprefixdir = get_option('rootprefix')
45 if get_option('split-usr')
46 conf.set('HAVE_SPLIT_USR', true)
47 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
49 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
52 #if 0 /// UNNEEDED by elogind
53 # sysvinit_path = get_option('sysvinit-path')
54 # sysvrcnd_path = get_option('sysvrcnd-path')
55 # if sysvinit_path != '' or sysvrcnd_path != ''
56 # conf.set('HAVE_SYSV_COMPAT', true,
57 # description : 'SysV init scripts and rcN.d links are supported')
58 # m4_defines += ['-DHAVE_SYSV_COMPAT']
62 # join_paths ignore the preceding arguments if an absolute component is
63 # encountered, so this should canonicalize various paths when they are
64 # absolute or relative.
65 prefixdir = get_option('prefix')
66 if not prefixdir.startswith('/')
67 error('Prefix is not absolute: "@0@"'.format(prefixdir))
69 bindir = join_paths(prefixdir, get_option('bindir'))
70 libdir = join_paths(prefixdir, get_option('libdir'))
71 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
72 includedir = join_paths(prefixdir, get_option('includedir'))
73 datadir = join_paths(prefixdir, get_option('datadir'))
74 localstatedir = join_paths('/', get_option('localstatedir'))
76 rootbindir = join_paths(rootprefixdir, 'bin')
77 #if 0 /// elogind has a different default
78 # rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
80 rootlibexecdir = get_option('rootlibexecdir')
81 rootlibexecdir = rootlibexecdir != '' ? rootlibexecdir : join_paths(rootprefixdir, 'lib/elogind')
84 rootlibdir = get_option('rootlibdir')
86 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
89 # Dirs of external packages
90 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
91 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
92 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
93 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
94 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
95 varlogdir = join_paths(localstatedir, 'log')
96 #if 0 /// UNNEEDED by elogind
97 # xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
98 # rpmmacrosdir = get_option('rpmmacrosdir')
99 # modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
103 #if 0 /// elogind has a bit different layout and does not need all of theses
104 # pkgdatadir = join_paths(datadir, 'systemd')
105 # environmentdir = join_paths(prefixdir, 'lib/environment.d')
106 # pkgsysconfdir = join_paths(sysconfdir, 'systemd')
107 # userunitdir = join_paths(prefixdir, 'lib/systemd/user')
108 # userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
109 # tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
110 # sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
111 # sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
112 # binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
113 # modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
114 # networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
115 # pkgincludedir = join_paths(includedir, 'systemd')
116 # systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
117 # usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
118 # systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
119 # userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
120 # systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
121 # systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
122 # systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
123 # systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
124 # udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
125 # udevhomedir = udevlibexecdir
126 # udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
127 # udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
128 # catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
129 # kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
130 # factorydir = join_paths(datadir, 'factory')
131 # docdir = join_paths(datadir, 'doc/systemd')
132 # bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
133 # testsdir = join_paths(prefixdir, 'lib/systemd/tests')
134 # systemdstatedir = join_paths(localstatedir, 'lib/systemd')
135 # catalogstatedir = join_paths(systemdstatedir, 'catalog')
136 # randomseeddir = join_paths(localstatedir, 'lib/systemd')
138 pkgdatadir = join_paths(datadir, 'elogind')
139 pkgsysconfdir = join_paths(sysconfdir, 'elogind')
140 pkgincludedir = join_paths(includedir, 'elogind/systemd')
141 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
142 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
144 # in elogind, udev is external and hus configurable
145 udevlibexecdir = get_option('udevbindir')
146 udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev')
147 udevrulesdir = get_option('udevrulesdir')
148 udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d')
149 udevhomedir = udevlibexecdir
150 factorydir = join_paths(datadir, 'factory')
151 docdir = '-'.join([join_paths(datadir, 'doc/elogind'),
152 meson.project_version()])
153 testsdir = join_paths(prefixdir, 'lib/elogind/tests')
154 systemdstatedir = join_paths(localstatedir, 'lib/elogind')
155 randomseeddir = join_paths(localstatedir, 'lib/elogind')
158 dbuspolicydir = get_option('dbuspolicydir')
159 if dbuspolicydir == ''
160 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
163 dbussessionservicedir = get_option('dbussessionservicedir')
164 if dbussessionservicedir == ''
165 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
168 dbussystemservicedir = get_option('dbussystemservicedir')
169 if dbussystemservicedir == ''
170 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
173 pamlibdir = get_option('pamlibdir')
175 pamlibdir = join_paths(rootlibdir, 'security')
178 pamconfdir = get_option('pamconfdir')
180 pamconfdir = join_paths(sysconfdir, 'pam.d')
183 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
184 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
185 #if 0 /// UNNEEDED by elogind
186 # conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
187 # conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
188 # conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
189 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
190 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
191 # conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
192 # conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
193 # conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
194 # conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
195 # conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
196 # conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
197 # conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
198 # conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
199 # conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
200 # conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
201 # conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
202 # conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
204 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'elogind-cgroups-agent'))
205 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'elogind'))
207 conf.set_quoted('ROOTPREFIX', rootprefixdir)
208 #if 0 /// UNNEEDED by elogind
209 # conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
210 # conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
211 # conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
212 # conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
213 # conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
214 # conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
215 # conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
217 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
218 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
219 #if 0 /// UNNEEDED by elogind
220 # conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
221 # conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
223 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
224 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
225 conf.set_quoted('LIBDIR', libdir)
226 conf.set_quoted('ROOTLIBDIR', rootlibdir)
227 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
228 #if 0 /// UNNEEDED by elogind
229 # conf.set_quoted('BOOTLIBDIR', bootlibdir)
230 # conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
231 # conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
232 # conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
233 # conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
234 # conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
235 # conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
238 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
239 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
241 substs.set('prefix', prefixdir)
242 substs.set('exec_prefix', prefixdir)
243 substs.set('libdir', libdir)
244 substs.set('rootlibdir', rootlibdir)
245 substs.set('includedir', includedir)
246 substs.set('pkgsysconfdir', pkgsysconfdir)
247 substs.set('bindir', bindir)
248 substs.set('rootbindir', rootbindir)
249 substs.set('rootlibexecdir', rootlibexecdir)
250 #if 0 /// UNNEEDED by elogind
251 # substs.set('systemunitdir', systemunitdir)
252 # substs.set('userunitdir', userunitdir)
253 # substs.set('systempresetdir', systempresetdir)
254 # substs.set('userpresetdir', userpresetdir)
255 # substs.set('udevhwdbdir', udevhwdbdir)
257 substs.set('udevrulesdir', udevrulesdir)
258 substs.set('udevlibexecdir', udevlibexecdir)
259 #if 0 /// UNNEEDED by elogind
260 # substs.set('catalogdir', catalogdir)
261 # substs.set('tmpfilesdir', tmpfilesdir)
262 # substs.set('sysusersdir', sysusersdir)
263 # substs.set('sysctldir', sysctldir)
264 # substs.set('binfmtdir', binfmtdir)
265 # substs.set('modulesloaddir', modulesloaddir)
266 # substs.set('systemgeneratordir', systemgeneratordir)
267 # substs.set('usergeneratordir', usergeneratordir)
268 # substs.set('systemenvgeneratordir', systemenvgeneratordir)
269 # substs.set('userenvgeneratordir', userenvgeneratordir)
271 substs.set('systemshutdowndir', systemshutdowndir)
272 substs.set('systemsleepdir', systemsleepdir)
273 substs.set('VARLOGDIR', varlogdir)
274 #if 0 /// UNNEEDED by elogind
275 # substs.set('CERTIFICATEROOT', get_option('certificate-root'))
276 # substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
277 # substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
278 # substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
279 # substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
280 # substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
281 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
284 #####################################################################
286 cc = meson.get_compiler('c')
287 pkgconfig = import('pkgconfig')
288 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
290 cxx = find_program('c++', required : false)
292 # Used only for tests
296 foreach arg : ['-Wextra',
299 '-Wmissing-include-dirs',
300 '-Wold-style-definition',
303 '-Wdeclaration-after-statement',
305 '-Wsuggest-attribute=noreturn',
306 '-Werror=missing-prototypes',
307 '-Werror=implicit-function-declaration',
308 '-Werror=missing-declarations',
309 '-Werror=return-type',
310 '-Werror=incompatible-pointer-types',
312 '-Wstrict-prototypes',
314 '-Wmissing-noreturn',
317 '-Wstrict-aliasing=2',
324 '-fdiagnostics-show-option',
325 '-fno-strict-aliasing',
326 '-fvisibility=hidden',
328 '-fstack-protector-strong',
330 '--param=ssp-buffer-size=4',
332 if cc.has_argument(arg)
333 add_project_arguments(arg, language : 'c')
337 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
338 # arguments, just emits a warnings. So test for the "positive" version instead.
339 foreach arg : ['unused-parameter',
340 'missing-field-initializers',
343 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
345 if cc.has_argument('-W' + arg)
346 add_project_arguments('-Wno-' + arg, language : 'c')
352 #include <inttypes.h>
353 typedef uint64_t usec_t;
354 usec_t now(clockid_t clock);
359 ', name : '-Werror=shadow with local shadowing')
360 add_project_arguments('-Werror=shadow', language : 'c')
363 if cc.get_id() == 'clang'
364 foreach arg : ['-Wno-typedef-redefinition',
365 '-Wno-gnu-variable-sized-type-not-at-end',
367 if cc.has_argument(arg,
368 name : '@0@ is supported'.format(arg))
369 add_project_arguments(arg, language : 'c')
374 link_test_c = files('tools/meson-link-test.c')
376 # --as-needed and --no-undefined are provided by meson by default,
377 # run mesonconf to see what is enabled
378 foreach arg : ['-Wl,-z,relro',
383 have = run_command(check_compilation_sh,
384 cc.cmd_array(), '-x', 'c', arg,
385 '-include', link_test_c).returncode() == 0
386 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
388 add_project_link_arguments(arg, language : 'c')
392 if get_option('buildtype') != 'debug'
393 foreach arg : ['-ffunction-sections',
395 if cc.has_argument(arg,
396 name : '@0@ is supported'.format(arg))
397 add_project_arguments(arg, language : 'c')
401 foreach arg : ['-Wl,--gc-sections']
402 have = run_command(check_compilation_sh,
403 cc.cmd_array(), '-x', 'c', arg,
404 '-include', link_test_c).returncode() == 0
405 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
407 add_project_link_arguments(arg, language : 'c')
412 cpp = ' '.join(cc.cmd_array()) + ' -E'
414 #####################################################################
415 # compilation result tests
417 conf.set('_GNU_SOURCE', true)
418 conf.set('__SANE_USERSPACE_TYPES__', true)
420 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
421 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
422 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
423 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
424 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
425 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
426 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
430 #include <linux/ethtool.h>
432 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
434 foreach decl : ['char16_t',
437 'struct ethtool_link_settings',
438 'struct fib_rule_uid_range',
441 # We get -1 if the size cannot be determined
442 have = cc.sizeof(decl, prefix : decl_headers) > 0
443 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
446 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
447 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
448 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
449 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
450 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
451 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
452 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
453 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
454 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
455 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
456 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
457 # if_tunnel.h is buggy and cannot be included on its own
458 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
459 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
460 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
461 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
462 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
463 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
464 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
465 ['NDA_IFINDEX', 'linux/neighbour.h'],
466 ['IFA_FLAGS', 'linux/if_addr.h'],
467 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
468 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
470 prefix = decl.length() > 2 ? decl[2] : ''
471 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
472 conf.set10('HAVE_DECL_' + decl[0], have)
476 foreach ident : ['secure_getenv', '__secure_getenv']
477 if not skip and cc.has_function(ident)
478 conf.set('HAVE_' + ident.to_upper(), true)
484 ['memfd_create', '''#include <sys/memfd.h>'''],
485 ['gettid', '''#include <sys/types.h>'''],
486 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
487 ['name_to_handle_at', '''#define _GNU_SOURCE
488 #include <sys/types.h>
489 #include <sys/stat.h>
490 #include <fcntl.h>'''],
491 ['setns', '''#define _GNU_SOURCE
492 #include <sched.h>'''],
493 ['renameat2', '''#include <stdio.h>'''],
494 ['kcmp', '''#include <linux/kcmp.h>'''],
495 ['keyctl', '''#include <sys/types.h>
496 #include <keyutils.h>'''],
497 ['copy_file_range', '''#include <sys/syscall.h>
498 #include <unistd.h>'''],
499 ['bpf', '''#include <sys/syscall.h>
500 #include <unistd.h>'''],
501 ['explicit_bzero' , '''#include <string.h>'''],
504 have = cc.has_function(ident[0], prefix : ident[1])
505 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
508 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
509 conf.set('USE_SYS_RANDOM_H', true)
510 conf.set10('HAVE_DECL_GETRANDOM', true)
512 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
513 conf.set10('HAVE_DECL_GETRANDOM', have)
516 #####################################################################
518 sed = find_program('sed')
519 grep = find_program('grep')
520 awk = find_program('awk')
521 m4 = find_program('m4')
522 stat = find_program('stat')
523 git = find_program('git', required : false)
525 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
526 mkdir_p = 'mkdir -p $DESTDIR/@0@'
527 #if 0 /// unneeded by elogind
528 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
529 # splash_bmp = files('test/splash.bmp')
532 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
533 # /usr/sbin, /sbin, and fall back to the default from middle column.
534 #if 0 /// elogind has a bit different list and some adaptions
535 # progs = [['telinit', '/lib/sysvinit/telinit'],
536 # ['quotaon', '/usr/sbin/quotaon' ],
537 # ['quotacheck', '/usr/sbin/quotacheck' ],
538 # ['kill', '/usr/bin/kill' ],
539 # ['kmod', '/usr/bin/kmod' ],
540 # ['kexec', '/usr/sbin/kexec' ],
541 # ['sulogin', '/usr/sbin/sulogin' ],
542 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
543 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
544 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
545 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
548 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
549 ['reboot', '/sbin/reboot', 'REBOOT'],
550 ['halt', '/sbin/halt', 'HALT'],
554 path = get_option(prog[0] + '-path')
556 message('Using @1@ for @0@'.format(prog[0], path))
558 exe = find_program(prog[0],
559 '/usr/sbin/' + prog[0],
562 path = exe.found() ? exe.path() : prog[1]
564 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
565 conf.set_quoted(name, path)
566 substs.set(name, path)
569 if run_command('ln', '--relative', '--help').returncode() != 0
570 error('ln does not support --relative')
573 ############################################################
575 gperf = find_program('gperf')
577 gperf_test_format = '''
579 const char * in_word_set(const char *, @0@);
582 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
583 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
584 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
585 if cc.compiles(gperf_test)
586 gperf_len_type = 'size_t'
588 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
589 if cc.compiles(gperf_test)
590 gperf_len_type = 'unsigned'
592 error('unable to determine gperf len type')
595 message('gperf len type is @0@'.format(gperf_len_type))
596 conf.set('GPERF_LEN_TYPE', gperf_len_type,
597 description : 'The type of gperf "len" parameter')
599 ############################################################
601 if not cc.has_header('sys/capability.h')
602 error('POSIX caps headers not found')
604 foreach header : ['linux/btrfs.h',
606 'linux/vm_sockets.h',
607 'valgrind/memcheck.h',
608 'valgrind/valgrind.h',
611 conf.set('HAVE_' + header.underscorify().to_upper(),
612 cc.has_header(header))
615 ############################################################
617 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
618 #if 0 /// UNNEEDED by elogind
619 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
620 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
623 default_hierarchy = get_option('default-hierarchy')
624 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
625 description : 'default cgroup hierarchy as string')
626 if default_hierarchy == 'legacy'
627 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
628 elif default_hierarchy == 'hybrid'
629 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
631 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
634 #if 0 /// UNNEEDED by elogind
635 # time_epoch = get_option('time-epoch')
636 # if time_epoch == ''
637 # NEWS = files('NEWS')
638 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
640 # time_epoch = time_epoch.to_int()
641 # conf.set('TIME_EPOCH', time_epoch)
643 ############################################################
644 # elogind needs to know which cgroups controller to follow.
645 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
646 with_cgroupctrl = get_option('cgroup-controller')
647 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
648 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
649 elif with_cgroupctrl == 'none'
650 with_cgroupctrl = 'elogind'
653 # No controller now is a problem:
654 if with_cgroupctrl == ''
655 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
658 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
659 description : 'name of the cgroup controller to use')
660 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
661 '='.join(['name', with_cgroupctrl]))
662 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
663 '='.join(['name', with_cgroupctrl]))
664 ############################################################
667 system_uid_max = get_option('system-uid-max')
668 if system_uid_max == ''
669 system_uid_max = run_command(
671 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
672 '/etc/login.defs').stdout()
674 system_uid_max = system_uid_max.to_int()
675 conf.set('SYSTEM_UID_MAX', system_uid_max)
676 substs.set('systemuidmax', system_uid_max)
677 message('maximum system UID is @0@'.format(system_uid_max))
679 #if 0 /// UNNEEDED by elogind
680 # conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
681 # conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
684 system_gid_max = get_option('system-gid-max')
685 if system_gid_max == ''
686 system_gid_max = run_command(
688 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
689 '/etc/login.defs').stdout()
691 system_gid_max = system_gid_max.to_int()
692 conf.set('SYSTEM_GID_MAX', system_gid_max)
693 substs.set('systemgidmax', system_gid_max)
694 message('maximum system GID is @0@'.format(system_gid_max))
696 tty_gid = get_option('tty-gid')
697 conf.set('TTY_GID', tty_gid)
698 substs.set('TTY_GID', tty_gid)
700 #if 0 /// UNNEEDED by elogind
701 # if get_option('adm-group')
702 # m4_defines += ['-DENABLE_ADM_GROUP']
705 # if get_option('wheel-group')
706 # m4_defines += ['-DENABLE_WHEEL_GROUP']
709 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
712 kill_user_processes = get_option('default-kill-user-processes')
713 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
714 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
716 #if 0 /// UNNEEDED by elogind
717 # dns_servers = get_option('dns-servers')
718 # conf.set_quoted('DNS_SERVERS', dns_servers)
719 # substs.set('DNS_SERVERS', dns_servers)
721 # ntp_servers = get_option('ntp-servers')
722 # conf.set_quoted('NTP_SERVERS', ntp_servers)
723 # substs.set('NTP_SERVERS', ntp_servers)
726 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
728 #if 0 /// UNNEEDED by elogind
729 # substs.set('SUSHELL', get_option('debug-shell'))
730 # substs.set('DEBUGTTY', get_option('debug-tty'))
733 debug = get_option('debug')
735 foreach name : debug.split(',')
737 conf.set('ENABLE_DEBUG_HASHMAP', true)
738 elif name == 'mmap-cache'
739 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
740 #if 1 /// additional elogind debug mode
741 elif name == 'elogind'
742 conf.set('ENABLE_DEBUG_ELOGIND', true)
745 message('unknown debug option "@0@", ignoring'.format(name))
750 #####################################################################
752 threads = dependency('threads')
753 librt = cc.find_library('rt')
754 libm = cc.find_library('m')
755 libdl = cc.find_library('dl')
756 libcrypt = cc.find_library('crypt')
758 libcap = dependency('libcap', required : false)
759 if not libcap.found()
760 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
761 libcap = cc.find_library('cap')
764 #if 0 /// UNNEEDED by elogind
765 # libmount = dependency('mount',
766 # version : '>= 2.30')
768 # want_seccomp = get_option('seccomp')
769 # if want_seccomp != 'false'
770 # libseccomp = dependency('libseccomp',
771 # version : '>= 2.3.1',
772 # required : want_seccomp == 'true')
773 # if libseccomp.found()
774 # conf.set('HAVE_SECCOMP', true)
775 # m4_defines += ['-DHAVE_SECCOMP']
784 want_selinux = get_option('selinux')
785 if want_selinux != 'false'
786 libselinux = dependency('libselinux',
787 version : '>= 2.1.9',
788 required : want_selinux == 'true')
789 if libselinux.found()
790 conf.set('HAVE_SELINUX', true)
791 m4_defines += ['-DHAVE_SELINUX']
797 #if 0 /// UNNEEDED by elogind
798 # want_apparmor = get_option('apparmor')
799 # if want_apparmor != 'false'
800 # libapparmor = dependency('libapparmor',
801 # required : want_apparmor == 'true')
802 # if libapparmor.found()
803 # conf.set('HAVE_APPARMOR', true)
804 # m4_defines += ['-DHAVE_APPARMOR']
813 smack_run_label = get_option('smack-run-label')
814 if smack_run_label != ''
815 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
816 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
819 want_polkit = get_option('polkit')
820 install_polkit = false
821 install_polkit_pkla = false
822 if want_polkit != 'false'
823 conf.set('ENABLE_POLKIT', true)
824 install_polkit = true
826 libpolkit = dependency('polkit-gobject-1',
828 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
829 message('Old polkit detected, will install pkla files')
830 install_polkit_pkla = true
834 want_acl = get_option('acl')
835 if want_acl != 'false'
836 libacl = cc.find_library('acl', required : want_acl == 'true')
838 conf.set('HAVE_ACL', true)
839 m4_defines += ['-DHAVE_ACL']
845 want_audit = get_option('audit')
846 if want_audit != 'false'
847 libaudit = dependency('audit', required : want_audit == 'true')
848 conf.set('HAVE_AUDIT', libaudit.found())
853 #if 0 /// UNNEEDED by elogind
854 # want_blkid = get_option('blkid')
855 # if want_blkid != 'false'
856 # libblkid = dependency('blkid', required : want_blkid == 'true')
857 # conf.set('HAVE_BLKID', libblkid.found())
862 # want_kmod = get_option('kmod')
863 # if want_kmod != 'false'
864 # libkmod = dependency('libkmod',
866 # required : want_kmod == 'true')
867 # conf.set('HAVE_KMOD', libkmod.found())
876 want_pam = get_option('pam')
877 if want_pam != 'false'
878 libpam = cc.find_library('pam', required : want_pam == 'true')
879 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
880 if libpam.found() and libpam_misc.found()
881 conf.set('HAVE_PAM', true)
882 m4_defines += ['-DHAVE_PAM']
889 #if 0 /// UNNEEDED by elogind
890 # want_microhttpd = get_option('microhttpd')
891 # if want_microhttpd != 'false'
892 # libmicrohttpd = dependency('libmicrohttpd',
893 # version : '>= 0.9.33',
894 # required : want_microhttpd == 'true')
895 # if libmicrohttpd.found()
896 # conf.set('HAVE_MICROHTTPD', true)
897 # m4_defines += ['-DHAVE_MICROHTTPD']
903 # want_libcryptsetup = get_option('libcryptsetup')
904 # if want_libcryptsetup != 'false'
905 # libcryptsetup = dependency('libcryptsetup',
906 # version : '>= 1.6.0',
907 # required : want_libcryptsetup == 'true')
908 # conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
913 # want_libcurl = get_option('libcurl')
914 # if want_libcurl != 'false'
915 # libcurl = dependency('libcurl',
916 # version : '>= 7.32.0',
917 # required : want_libcurl == 'true')
919 # conf.set('HAVE_LIBCURL', true)
920 # m4_defines += ['-DHAVE_LIBCURL']
926 # want_libidn = get_option('libidn')
927 # want_libidn2 = get_option('libidn2')
928 # if want_libidn == 'true' and want_libidn2 == 'true'
929 # error('libidn and libidn2 cannot be requested simultaneously')
932 # if want_libidn != 'false' and want_libidn2 != 'true'
933 # libidn = dependency('libidn',
934 # required : want_libidn == 'true')
936 # conf.set('HAVE_LIBIDN', true)
937 # m4_defines += ['-DHAVE_LIBIDN']
942 # if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
943 # # libidn is used for both libidn and libidn2 objects
944 # libidn = dependency('libidn2',
945 # required : want_libidn2 == 'true')
947 # conf.set('HAVE_LIBIDN2', true)
948 # m4_defines += ['-DHAVE_LIBIDN2']
952 # want_libiptc = get_option('libiptc')
953 # if want_libiptc != 'false'
954 # libiptc = dependency('libiptc',
955 # required : want_libiptc == 'true')
957 # conf.set('HAVE_LIBIPTC', true)
958 # m4_defines += ['-DHAVE_LIBIPTC']
964 # want_qrencode = get_option('qrencode')
965 # if want_qrencode != 'false'
966 # libqrencode = dependency('libqrencode',
967 # required : want_qrencode == 'true')
968 # conf.set('HAVE_QRENCODE', libqrencode.found())
973 # want_gcrypt = get_option('gcrypt')
974 # if want_gcrypt != 'false'
975 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
976 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
978 # have_deps = libgcrypt.found() and libgpg_error.found()
979 # conf.set('HAVE_GCRYPT', have_deps)
981 # # link to neither of the libs if one is not found
990 # want_gnutls = get_option('gnutls')
991 # if want_gnutls != 'false'
992 # libgnutls = dependency('gnutls',
993 # version : '>= 3.1.4',
994 # required : want_gnutls == 'true')
995 # conf.set('HAVE_GNUTLS', libgnutls.found())
1000 # want_elfutils = get_option('elfutils')
1001 # if want_elfutils != 'false'
1002 # libdw = dependency('libdw',
1003 # required : want_elfutils == 'true')
1004 # conf.set('HAVE_ELFUTILS', libdw.found())
1009 # want_zlib = get_option('zlib')
1010 # if want_zlib != 'false'
1011 # libz = dependency('zlib',
1012 # required : want_zlib == 'true')
1013 # conf.set('HAVE_ZLIB', libz.found())
1018 # want_bzip2 = get_option('bzip2')
1019 # if want_bzip2 != 'false'
1020 # libbzip2 = cc.find_library('bz2',
1021 # required : want_bzip2 == 'true')
1022 # conf.set('HAVE_BZIP2', libbzip2.found())
1027 # want_xz = get_option('xz')
1028 # if want_xz != 'false'
1029 # libxz = dependency('liblzma',
1030 # required : want_xz == 'true')
1031 # conf.set('HAVE_XZ', libxz.found())
1036 # want_lz4 = get_option('lz4')
1037 # if want_lz4 != 'false'
1038 # liblz4 = dependency('liblz4',
1039 # required : want_lz4 == 'true')
1040 # conf.set('HAVE_LZ4', liblz4.found())
1045 # want_xkbcommon = get_option('xkbcommon')
1046 # if want_xkbcommon != 'false'
1047 # libxkbcommon = dependency('xkbcommon',
1048 # version : '>= 0.3.0',
1049 # required : want_xkbcommon == 'true')
1050 # conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
1072 want_glib = get_option('glib')
1073 if want_glib != 'false'
1074 libglib = dependency('glib-2.0',
1075 version : '>= 2.22.0',
1076 required : want_glib == 'true')
1077 libgobject = dependency('gobject-2.0',
1078 version : '>= 2.22.0',
1079 required : want_glib == 'true')
1080 libgio = dependency('gio-2.0',
1081 required : want_glib == 'true')
1082 have = libglib.found() and libgobject.found() and libgio.found()
1083 conf.set('HAVE_GLIB', have)
1090 want_dbus = get_option('dbus')
1091 if want_dbus != 'false'
1092 libdbus = dependency('dbus-1',
1093 version : '>= 1.3.2',
1094 required : want_dbus == 'true')
1095 conf.set('HAVE_DBUS', libdbus.found())
1100 #if 0 /// UNNEEDED by elogind
1101 # default_dnssec = get_option('default-dnssec')
1102 # if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
1103 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1104 # default_dnssec = 'no'
1106 # conf.set('DEFAULT_DNSSEC_MODE',
1107 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1108 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1110 # want_importd = get_option('importd')
1111 # if want_importd != 'false'
1112 # have_deps = (conf.get('HAVE_LIBCURL', false) and
1113 # conf.get('HAVE_ZLIB', false) and
1114 # conf.get('HAVE_BZIP2', false) and
1115 # conf.get('HAVE_XZ', false) and
1116 # conf.get('HAVE_GCRYPT', false))
1117 # conf.set('ENABLE_IMPORTD', have_deps)
1118 # if want_importd == 'true' and not have_deps
1119 # error('importd support was requested, but dependencies are not available')
1123 # want_remote = get_option('remote')
1124 # if want_remote != 'false'
1125 # have_deps = [conf.get('HAVE_MICROHTTPD', false),
1126 # conf.get('HAVE_LIBCURL', false)]
1127 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1128 # # it's possible to build one without the other. Complain only if
1129 # # support was explictly requested. The auxiliary files like sysusers
1130 # # config should be installed when any of the programs are built.
1131 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1132 # error('remote support was requested, but dependencies are not available')
1134 # conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
1138 foreach pair : [['utmp', 'HAVE_UTMP'],
1139 #if 0 /// UNNEEDED by elogind
1140 # ['hibernate', 'ENABLE_HIBERNATE'],
1141 # ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1142 # ['binfmt', 'ENABLE_BINFMT'],
1143 # ['coredump', 'ENABLE_COREDUMP'],
1144 # ['resolve', 'ENABLE_RESOLVED'],
1145 # ['logind', 'ENABLE_LOGIND'],
1146 # ['hostnamed', 'ENABLE_HOSTNAMED'],
1147 # ['localed', 'ENABLE_LOCALED'],
1148 # ['machined', 'ENABLE_MACHINED'],
1149 # ['networkd', 'ENABLE_NETWORKD'],
1150 # ['timedated', 'ENABLE_TIMEDATED'],
1151 # ['timesyncd', 'ENABLE_TIMESYNCD'],
1152 # ['myhostname', 'HAVE_MYHOSTNAME'],
1153 # ['firstboot', 'ENABLE_FIRSTBOOT'],
1154 # ['randomseed', 'ENABLE_RANDOMSEED'],
1155 # ['backlight', 'ENABLE_BACKLIGHT'],
1156 # ['vconsole', 'ENABLE_VCONSOLE'],
1157 # ['quotacheck', 'ENABLE_QUOTACHECK'],
1158 # ['sysusers', 'ENABLE_SYSUSERS'],
1159 # ['tmpfiles', 'ENABLE_TMPFILES'],
1160 # ['hwdb', 'ENABLE_HWDB'],
1161 # ['rfkill', 'ENABLE_RFKILL'],
1162 # ['ldconfig', 'ENABLE_LDCONFIG'],
1163 # ['efi', 'ENABLE_EFI'],
1164 # ['tpm', 'ENABLE_TPM'],
1165 # ['ima', 'HAVE_IMA'],
1167 ['smack', 'HAVE_SMACK'],
1168 #if 0 /// UNNEEDED by elogind
1169 # ['gshadow', 'ENABLE_GSHADOW'],
1170 # ['idn', 'ENABLE_IDN'],
1171 # ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
1175 if get_option(pair[0])
1176 conf.set(pair[1], true)
1177 m4_defines += ['-D' + pair[1]]
1181 want_tests = get_option('tests')
1182 install_tests = get_option('install-tests')
1185 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1187 #####################################################################
1189 #if 0 /// UNNEEDED by elogind
1190 # if get_option('efi')
1191 # efi_arch = host_machine.cpu_family()
1193 # if efi_arch == 'x86'
1194 # EFI_MACHINE_TYPE_NAME = 'ia32'
1195 # gnu_efi_arch = 'ia32'
1196 # elif efi_arch == 'x86_64'
1197 # EFI_MACHINE_TYPE_NAME = 'x64'
1198 # gnu_efi_arch = 'x86_64'
1199 # elif efi_arch == 'arm'
1200 # EFI_MACHINE_TYPE_NAME = 'arm'
1201 # gnu_efi_arch = 'arm'
1202 # elif efi_arch == 'aarch64'
1203 # EFI_MACHINE_TYPE_NAME = 'aa64'
1204 # gnu_efi_arch = 'aarch64'
1206 # EFI_MACHINE_TYPE_NAME = ''
1210 # conf.set('ENABLE_EFI', true)
1211 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1213 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1217 #####################################################################
1219 config_h = configure_file(
1220 output : 'config.h',
1221 configuration : conf)
1223 includes = include_directories('src/basic',
1226 #if 0 /// UNNEEDED by elogind
1232 #if 0 /// UNNEEDED by elogind
1237 #if 0 /// elogind has a different list
1238 # 'src/libsystemd/sd-bus',
1239 # 'src/libsystemd/sd-device',
1240 # 'src/libsystemd/sd-hwdb',
1241 # 'src/libsystemd/sd-id128',
1242 # 'src/libsystemd/sd-netlink',
1243 # 'src/libsystemd/sd-network',
1244 # 'src/libsystemd-network',
1246 'src/libelogind/sd-bus',
1247 'src/libelogind/sd-id128',
1254 add_project_arguments('-include', 'config.h', language : 'c')
1256 #if 0 /// UNNEEDED by elogind
1257 # gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1258 # 'src/shared/gcrypt-util.c')
1262 #if 0 /// UNNEEDED by elogind
1265 subdir('src/systemd')
1267 #if 0 /// UNNEEDED by elogind
1268 # subdir('src/libsystemd')
1269 # subdir('src/libsystemd-network')
1270 # subdir('src/journal')
1273 subdir('src/libelogind')
1275 subdir('src/update-utmp')
1279 #if 0 /// UNNEEDED by elogind
1280 # libjournal_core = static_library(
1282 # libjournal_core_sources,
1284 # include_directories : includes,
1287 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1288 # libsystemd = shared_library(
1290 # libsystemd_internal_sources,
1291 # journal_internal_sources,
1292 # version : '0.19.0',
1293 # include_directories : includes,
1294 # link_args : ['-shared',
1295 # '-Wl,--version-script=' + libsystemd_sym_path],
1296 # link_with : [libbasic],
1297 # dependencies : [threads,
1302 # link_depends : libsystemd_sym,
1304 # install_dir : rootlibdir)
1306 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1307 libelogind = shared_library(
1309 libelogind_internal_sources,
1311 include_directories : includes,
1312 link_args : ['-shared',
1313 '-Wl,--version-script=' + libelogind_sym_path],
1314 link_with : [libbasic],
1315 dependencies : [threads],
1316 link_depends : libelogind_sym,
1318 install_dir : rootlibdir)
1321 ############################################################
1323 # binaries that have --help and are intended for use by humans,
1324 # usually, but not always, installed in /bin.
1325 public_programs = []
1327 #if 0 /// UNNEEDED by elogind
1328 # subdir('src/libudev')
1330 # elogind depends on external libudev:
1331 libudev = dependency('libudev', required : true)
1333 subdir('src/shared')
1334 #if 0 /// UNNEEDED by elogind
1335 # subdir('src/core')
1336 # subdir('src/udev')
1337 # subdir('src/network')
1339 # subdir('src/analyze')
1340 # subdir('src/journal-remote')
1341 # subdir('src/coredump')
1342 # subdir('src/hostname')
1343 # subdir('src/import')
1344 # subdir('src/kernel-install')
1345 # subdir('src/locale')
1346 # subdir('src/machine')
1347 # subdir('src/nspawn')
1348 # subdir('src/resolve')
1349 # subdir('src/timedate')
1350 # subdir('src/timesync')
1351 # subdir('src/vconsole')
1352 # subdir('src/sulogin-shell')
1353 # subdir('src/boot/efi')
1357 #if 0 /// UNNEEDED in elogind
1361 ############################################################
1363 # only static linking apart from libdl, to make sure that the
1364 # module is linked to all libraries that it uses.
1365 #if 0 /// UNNEEDED by elogind
1366 # test_dlopen = executable(
1369 # include_directories : includes,
1370 # link_with : [libbasic],
1371 # dependencies : [libdl])
1373 # foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
1374 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1375 # ['mymachines', 'ENABLE_MACHINED'],
1376 # ['resolve', 'ENABLE_RESOLVED']]
1378 # condition = tuple[1] == '' or conf.get(tuple[1], false)
1382 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1383 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1385 # nss = shared_library(
1387 # 'src/nss-@0@/nss-@0@.c'.format(module),
1389 # include_directories : includes,
1390 # link_args : ['-shared',
1391 # '-Wl,--version-script=' + version_script_arg,
1392 # '-Wl,--undefined'],
1393 # link_with : [libsystemd_internal,
1395 # dependencies : [threads,
1397 # link_depends : sym,
1399 # install_dir : rootlibdir)
1401 # # We cannot use shared_module because it does not support version suffix.
1402 # # Unfortunately shared_library insists on creating the symlink…
1403 # meson.add_install_script('sh', '-c',
1404 # 'rm $DESTDIR@0@/libnss_@1@.so'
1405 # .format(rootlibdir, module))
1407 # test('dlopen-nss_' + module,
1409 # args : [nss.full_path()]) # path to dlopen must include a slash
1414 ############################################################
1416 #if 0 /// UNNEEDED by elogind
1417 # executable('systemd',
1419 # include_directories : includes,
1420 # link_with : [libcore,
1422 # dependencies : [threads,
1428 # install_rpath : rootlibexecdir,
1430 # install_dir : rootlibexecdir)
1432 # exe = executable('systemd-analyze',
1433 # systemd_analyze_sources,
1434 # include_directories : includes,
1435 # link_with : [libcore,
1437 # dependencies : [threads,
1443 # install_rpath : rootlibexecdir,
1445 # public_programs += [exe]
1447 # executable('systemd-journald',
1448 # systemd_journald_sources,
1449 # include_directories : includes,
1450 # link_with : [libjournal_core,
1452 # dependencies : [threads,
1456 # install_rpath : rootlibexecdir,
1458 # install_dir : rootlibexecdir)
1460 # exe = executable('systemd-cat',
1461 # systemd_cat_sources,
1462 # include_directories : includes,
1463 # link_with : [libjournal_core,
1465 # dependencies : [threads],
1466 # install_rpath : rootlibexecdir,
1468 # public_programs += [exe]
1470 # exe = executable('journalctl',
1471 # journalctl_sources,
1472 # include_directories : includes,
1473 # link_with : [libshared],
1474 # dependencies : [threads,
1478 # install_rpath : rootlibexecdir,
1480 # install_dir : rootbindir)
1481 # public_programs += [exe]
1483 # executable('systemd-getty-generator',
1484 # 'src/getty-generator/getty-generator.c',
1485 # include_directories : includes,
1486 # link_with : [libshared],
1487 # install_rpath : rootlibexecdir,
1489 # install_dir : systemgeneratordir)
1491 # executable('systemd-debug-generator',
1492 # 'src/debug-generator/debug-generator.c',
1493 # include_directories : includes,
1494 # link_with : [libshared],
1495 # install_rpath : rootlibexecdir,
1497 # install_dir : systemgeneratordir)
1499 # executable('systemd-fstab-generator',
1500 # 'src/fstab-generator/fstab-generator.c',
1501 # 'src/core/mount-setup.c',
1502 # include_directories : includes,
1503 # link_with : [libshared],
1504 # install_rpath : rootlibexecdir,
1506 # install_dir : systemgeneratordir)
1508 # if conf.get('ENABLE_ENVIRONMENT_D', false)
1509 # executable('30-systemd-environment-d-generator',
1510 # 'src/environment-d-generator/environment-d-generator.c',
1511 # include_directories : includes,
1512 # link_with : [libshared],
1513 # install_rpath : rootlibexecdir,
1515 # install_dir : userenvgeneratordir)
1517 # meson.add_install_script(meson_make_symlink,
1518 # join_paths(sysconfdir, 'environment'),
1519 # join_paths(environmentdir, '99-environment.conf'))
1522 # if conf.get('ENABLE_HIBERNATE', false)
1523 # executable('systemd-hibernate-resume-generator',
1524 # 'src/hibernate-resume/hibernate-resume-generator.c',
1525 # include_directories : includes,
1526 # link_with : [libshared],
1527 # install_rpath : rootlibexecdir,
1529 # install_dir : systemgeneratordir)
1531 # executable('systemd-hibernate-resume',
1532 # 'src/hibernate-resume/hibernate-resume.c',
1533 # include_directories : includes,
1534 # link_with : [libshared],
1535 # install_rpath : rootlibexecdir,
1537 # install_dir : rootlibexecdir)
1540 # if conf.get('HAVE_BLKID', false)
1541 # executable('systemd-gpt-auto-generator',
1542 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1543 # 'src/basic/blkid-util.h',
1544 # include_directories : includes,
1545 # link_with : [libshared],
1546 # dependencies : libblkid,
1547 # install_rpath : rootlibexecdir,
1549 # install_dir : systemgeneratordir)
1551 # exe = executable('systemd-dissect',
1552 # 'src/dissect/dissect.c',
1553 # include_directories : includes,
1554 # link_with : [libshared],
1555 # install_rpath : rootlibexecdir,
1557 # install_dir : rootlibexecdir)
1558 # public_programs += [exe]
1561 # if conf.get('ENABLE_RESOLVED', false)
1562 # executable('systemd-resolved',
1563 # systemd_resolved_sources,
1564 # gcrypt_util_sources,
1565 # include_directories : includes,
1566 # link_with : [libshared],
1567 # dependencies : [threads,
1572 # install_rpath : rootlibexecdir,
1574 # install_dir : rootlibexecdir)
1576 # exe = executable('systemd-resolve',
1577 # systemd_resolve_sources,
1578 # gcrypt_util_sources,
1579 # include_directories : includes,
1580 # link_with : [libshared],
1581 # dependencies : [threads,
1586 # install_rpath : rootlibexecdir,
1588 # public_programs += [exe]
1591 # if conf.get('ENABLE_LOGIND', false)
1592 # executable('systemd-logind',
1593 # systemd_logind_sources,
1594 # include_directories : includes,
1595 # link_with : [liblogind_core,
1597 # dependencies : [threads,
1599 # install_rpath : rootlibexecdir,
1601 # install_dir : rootlibexecdir)
1603 # exe = executable('loginctl',
1605 # include_directories : includes,
1606 # link_with : [libshared],
1607 # dependencies : [threads,
1610 # install_rpath : rootlibexecdir,
1612 # install_dir : rootbindir)
1613 # public_programs += [exe]
1615 # exe = executable('systemd-inhibit',
1616 # 'src/login/inhibit.c',
1617 # include_directories : includes,
1618 # link_with : [libshared],
1619 # install_rpath : rootlibexecdir,
1621 # install_dir : rootbindir)
1622 # public_programs += [exe]
1624 # if conf.get('HAVE_PAM', false)
1625 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1626 # pam_systemd = shared_library(
1630 # include_directories : includes,
1631 # link_args : ['-shared',
1632 # '-Wl,--version-script=' + version_script_arg],
1633 # link_with : [libsystemd_internal,
1634 # libshared_static],
1635 # dependencies : [threads,
1638 # link_depends : pam_systemd_sym,
1640 # install_dir : pamlibdir)
1642 # test('dlopen-pam_systemd',
1644 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1649 executable('elogind',
1651 include_directories : includes,
1652 link_with : [liblogind_core,
1654 dependencies : [threads,
1657 install_rpath : rootlibexecdir,
1659 install_dir : rootlibexecdir)
1661 exe = executable('loginctl',
1663 include_directories : includes,
1664 link_with : [libshared],
1665 dependencies : [threads,
1667 install_rpath : rootlibexecdir,
1669 install_dir : rootbindir)
1670 public_programs += [exe]
1672 exe = executable('elogind-inhibit',
1673 'src/login/inhibit.c',
1674 include_directories : includes,
1675 link_with : [libshared],
1676 dependencies : [threads],
1677 install_rpath : rootlibexecdir,
1679 install_dir : rootbindir)
1680 public_programs += [exe]
1682 if conf.get('HAVE_PAM', false)
1683 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1684 pam_elogind = shared_library(
1688 include_directories : includes,
1689 link_args : ['-shared',
1690 '-Wl,--version-script=' + version_script_arg],
1691 link_with : [libelogind,
1693 dependencies : [threads,
1696 link_depends : pam_elogind_sym,
1698 install_dir : pamlibdir)
1701 #if 0 /// UNNEEDED by elogind
1702 # executable('systemd-user-sessions',
1703 # 'src/user-sessions/user-sessions.c',
1704 # include_directories : includes,
1705 # link_with : [libshared],
1706 # install_rpath : rootlibexecdir,
1708 # install_dir : rootlibexecdir)
1711 # if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
1712 # exe = executable('bootctl',
1713 # 'src/boot/bootctl.c',
1714 # include_directories : includes,
1715 # link_with : [libshared],
1716 # dependencies : [libblkid],
1717 # install_rpath : rootlibexecdir,
1719 # public_programs += [exe]
1722 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1723 # include_directories : includes,
1724 # link_with : [libshared],
1725 # dependencies : [threads],
1726 # install_rpath : rootlibexecdir,
1728 # public_programs += [exe]
1730 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1731 # include_directories : includes,
1732 # link_with : [libshared],
1733 # dependencies : [threads,
1738 # install_rpath : rootlibexecdir,
1740 # install_dir : rootbindir)
1741 # public_programs += [exe]
1743 # if conf.get('ENABLE_BACKLIGHT', false)
1744 # executable('systemd-backlight',
1745 # 'src/backlight/backlight.c',
1746 # include_directories : includes,
1747 # link_with : [libshared],
1748 # install_rpath : rootlibexecdir,
1750 # install_dir : rootlibexecdir)
1753 # if conf.get('ENABLE_RFKILL', false)
1754 # executable('systemd-rfkill',
1755 # 'src/rfkill/rfkill.c',
1756 # include_directories : includes,
1757 # link_with : [libshared],
1758 # install_rpath : rootlibexecdir,
1760 # install_dir : rootlibexecdir)
1763 # executable('systemd-system-update-generator',
1764 # 'src/system-update-generator/system-update-generator.c',
1765 # include_directories : includes,
1766 # link_with : [libshared],
1767 # install_rpath : rootlibexecdir,
1769 # install_dir : systemgeneratordir)
1771 # if conf.get('HAVE_LIBCRYPTSETUP', false)
1772 # executable('systemd-cryptsetup',
1773 # 'src/cryptsetup/cryptsetup.c',
1774 # include_directories : includes,
1775 # link_with : [libshared],
1776 # dependencies : [libcryptsetup],
1777 # install_rpath : rootlibexecdir,
1779 # install_dir : rootlibexecdir)
1781 # executable('systemd-cryptsetup-generator',
1782 # 'src/cryptsetup/cryptsetup-generator.c',
1783 # include_directories : includes,
1784 # link_with : [libshared],
1785 # dependencies : [libcryptsetup],
1786 # install_rpath : rootlibexecdir,
1788 # install_dir : systemgeneratordir)
1790 # executable('systemd-veritysetup',
1791 # 'src/veritysetup/veritysetup.c',
1792 # include_directories : includes,
1793 # link_with : [libshared],
1794 # dependencies : [libcryptsetup],
1795 # install_rpath : rootlibexecdir,
1797 # install_dir : rootlibexecdir)
1799 # executable('systemd-veritysetup-generator',
1800 # 'src/veritysetup/veritysetup-generator.c',
1801 # include_directories : includes,
1802 # link_with : [libshared],
1803 # dependencies : [libcryptsetup],
1804 # install_rpath : rootlibexecdir,
1806 # install_dir : systemgeneratordir)
1809 # if conf.get('HAVE_SYSV_COMPAT', false)
1810 # executable('systemd-sysv-generator',
1811 # 'src/sysv-generator/sysv-generator.c',
1812 # include_directories : includes,
1813 # link_with : [libshared],
1814 # install_rpath : rootlibexecdir,
1816 # install_dir : systemgeneratordir)
1818 # executable('systemd-rc-local-generator',
1819 # 'src/rc-local-generator/rc-local-generator.c',
1820 # include_directories : includes,
1821 # link_with : [libshared],
1822 # install_rpath : rootlibexecdir,
1824 # install_dir : systemgeneratordir)
1827 # if conf.get('ENABLE_HOSTNAMED', false)
1828 # executable('systemd-hostnamed',
1829 # 'src/hostname/hostnamed.c',
1830 # include_directories : includes,
1831 # link_with : [libshared],
1832 # install_rpath : rootlibexecdir,
1834 # install_dir : rootlibexecdir)
1836 # exe = executable('hostnamectl',
1837 # 'src/hostname/hostnamectl.c',
1838 # include_directories : includes,
1839 # link_with : [libshared],
1840 # install_rpath : rootlibexecdir,
1842 # public_programs += [exe]
1845 # if conf.get('ENABLE_LOCALED', false)
1846 # if conf.get('HAVE_XKBCOMMON', false)
1847 # # logind will load libxkbcommon.so dynamically on its own
1853 # executable('systemd-localed',
1854 # systemd_localed_sources,
1855 # include_directories : includes,
1856 # link_with : [libshared],
1857 # dependencies : deps,
1858 # install_rpath : rootlibexecdir,
1860 # install_dir : rootlibexecdir)
1862 # exe = executable('localectl',
1863 # localectl_sources,
1864 # include_directories : includes,
1865 # link_with : [libshared],
1866 # install_rpath : rootlibexecdir,
1868 # public_programs += [exe]
1871 # if conf.get('ENABLE_TIMEDATED', false)
1872 # executable('systemd-timedated',
1873 # 'src/timedate/timedated.c',
1874 # include_directories : includes,
1875 # link_with : [libshared],
1876 # install_rpath : rootlibexecdir,
1878 # install_dir : rootlibexecdir)
1880 # exe = executable('timedatectl',
1881 # 'src/timedate/timedatectl.c',
1882 # include_directories : includes,
1883 # install_rpath : rootlibexecdir,
1884 # link_with : [libshared],
1886 # public_programs += [exe]
1889 # if conf.get('ENABLE_TIMESYNCD', false)
1890 # executable('systemd-timesyncd',
1891 # systemd_timesyncd_sources,
1892 # include_directories : includes,
1893 # link_with : [libshared],
1894 # dependencies : [threads,
1896 # install_rpath : rootlibexecdir,
1898 # install_dir : rootlibexecdir)
1901 # if conf.get('ENABLE_MACHINED', false)
1902 # executable('systemd-machined',
1903 # systemd_machined_sources,
1904 # include_directories : includes,
1905 # link_with : [libmachine_core,
1907 # install_rpath : rootlibexecdir,
1909 # install_dir : rootlibexecdir)
1911 # exe = executable('machinectl',
1912 # 'src/machine/machinectl.c',
1913 # include_directories : includes,
1914 # link_with : [libshared],
1915 # dependencies : [threads,
1918 # install_rpath : rootlibexecdir,
1920 # install_dir : rootbindir)
1921 # public_programs += [exe]
1924 # if conf.get('ENABLE_IMPORTD', false)
1925 # executable('systemd-importd',
1926 # systemd_importd_sources,
1927 # include_directories : includes,
1928 # link_with : [libshared],
1929 # dependencies : [threads],
1930 # install_rpath : rootlibexecdir,
1932 # install_dir : rootlibexecdir)
1934 # systemd_pull = executable('systemd-pull',
1935 # systemd_pull_sources,
1936 # include_directories : includes,
1937 # link_with : [libshared],
1938 # dependencies : [libcurl,
1943 # install_rpath : rootlibexecdir,
1945 # install_dir : rootlibexecdir)
1947 # systemd_import = executable('systemd-import',
1948 # systemd_import_sources,
1949 # include_directories : includes,
1950 # link_with : [libshared],
1951 # dependencies : [libcurl,
1955 # install_rpath : rootlibexecdir,
1957 # install_dir : rootlibexecdir)
1959 # systemd_export = executable('systemd-export',
1960 # systemd_export_sources,
1961 # include_directories : includes,
1962 # link_with : [libshared],
1963 # dependencies : [libcurl,
1967 # install_rpath : rootlibexecdir,
1969 # install_dir : rootlibexecdir)
1970 # public_programs += [systemd_pull, systemd_import, systemd_export]
1973 # if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
1974 # exe = executable('systemd-journal-upload',
1975 # systemd_journal_upload_sources,
1976 # include_directories : includes,
1977 # link_with : [libshared],
1978 # dependencies : [threads,
1983 # install_rpath : rootlibexecdir,
1985 # install_dir : rootlibexecdir)
1986 # public_programs += [exe]
1989 # if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
1990 # s_j_remote = executable('systemd-journal-remote',
1991 # systemd_journal_remote_sources,
1992 # include_directories : includes,
1993 # link_with : [libshared],
1994 # dependencies : [threads,
1999 # install_rpath : rootlibexecdir,
2001 # install_dir : rootlibexecdir)
2003 # s_j_gatewayd = executable('systemd-journal-gatewayd',
2004 # systemd_journal_gatewayd_sources,
2005 # include_directories : includes,
2006 # link_with : [libshared],
2007 # dependencies : [threads,
2012 # install_rpath : rootlibexecdir,
2014 # install_dir : rootlibexecdir)
2015 # public_programs += [s_j_remote, s_j_gatewayd]
2018 # if conf.get('ENABLE_COREDUMP', false)
2019 # executable('systemd-coredump',
2020 # systemd_coredump_sources,
2021 # include_directories : includes,
2022 # link_with : [libshared],
2023 # dependencies : [threads,
2028 # install_rpath : rootlibexecdir,
2030 # install_dir : rootlibexecdir)
2032 # exe = executable('coredumpctl',
2033 # coredumpctl_sources,
2034 # include_directories : includes,
2035 # link_with : [libshared],
2036 # dependencies : [threads,
2039 # install_rpath : rootlibexecdir,
2041 # public_programs += [exe]
2044 # if conf.get('ENABLE_BINFMT', false)
2045 # exe = executable('systemd-binfmt',
2046 # 'src/binfmt/binfmt.c',
2047 # include_directories : includes,
2048 # link_with : [libshared],
2049 # install_rpath : rootlibexecdir,
2051 # install_dir : rootlibexecdir)
2052 # public_programs += [exe]
2054 # meson.add_install_script('sh', '-c',
2055 # mkdir_p.format(binfmtdir))
2056 # meson.add_install_script('sh', '-c',
2057 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2060 # if conf.get('ENABLE_VCONSOLE', false)
2061 # executable('systemd-vconsole-setup',
2062 # 'src/vconsole/vconsole-setup.c',
2063 # include_directories : includes,
2064 # link_with : [libshared],
2065 # install_rpath : rootlibexecdir,
2067 # install_dir : rootlibexecdir)
2070 # if conf.get('ENABLE_RANDOMSEED', false)
2071 # executable('systemd-random-seed',
2072 # 'src/random-seed/random-seed.c',
2073 # include_directories : includes,
2074 # link_with : [libshared],
2075 # install_rpath : rootlibexecdir,
2077 # install_dir : rootlibexecdir)
2080 # if conf.get('ENABLE_FIRSTBOOT', false)
2081 # executable('systemd-firstboot',
2082 # 'src/firstboot/firstboot.c',
2083 # include_directories : includes,
2084 # link_with : [libshared],
2085 # dependencies : [libcrypt],
2086 # install_rpath : rootlibexecdir,
2088 # install_dir : rootbindir)
2091 # executable('systemd-remount-fs',
2092 # 'src/remount-fs/remount-fs.c',
2093 # 'src/core/mount-setup.c',
2094 # 'src/core/mount-setup.h',
2095 # include_directories : includes,
2096 # link_with : [libshared],
2097 # install_rpath : rootlibexecdir,
2099 # install_dir : rootlibexecdir)
2101 # executable('systemd-machine-id-setup',
2102 # 'src/machine-id-setup/machine-id-setup-main.c',
2103 # 'src/core/machine-id-setup.c',
2104 # 'src/core/machine-id-setup.h',
2105 # include_directories : includes,
2106 # link_with : [libshared],
2107 # install_rpath : rootlibexecdir,
2109 # install_dir : rootbindir)
2111 # executable('systemd-fsck',
2112 # 'src/fsck/fsck.c',
2113 # include_directories : includes,
2114 # link_with : [libshared],
2115 # install_rpath : rootlibexecdir,
2117 # install_dir : rootlibexecdir)
2119 # executable('systemd-sleep',
2120 # 'src/sleep/sleep.c',
2121 # include_directories : includes,
2122 # link_with : [libshared],
2123 # install_rpath : rootlibexecdir,
2125 # install_dir : rootlibexecdir)
2127 # exe = executable('systemd-sysctl',
2128 # 'src/sysctl/sysctl.c',
2129 # include_directories : includes,
2130 # link_with : [libshared],
2131 # install_rpath : rootlibexecdir,
2133 # install_dir : rootlibexecdir)
2134 # public_programs += [exe]
2136 # executable('systemd-ac-power',
2137 # 'src/ac-power/ac-power.c',
2138 # include_directories : includes,
2139 # link_with : [libshared],
2140 # install_rpath : rootlibexecdir,
2142 # install_dir : rootlibexecdir)
2144 # exe = executable('systemd-detect-virt',
2145 # 'src/detect-virt/detect-virt.c',
2146 # include_directories : includes,
2147 # link_with : [libshared],
2148 # install_rpath : rootlibexecdir,
2150 # public_programs += [exe]
2152 # exe = executable('systemd-delta',
2153 # 'src/delta/delta.c',
2154 # include_directories : includes,
2155 # link_with : [libshared],
2156 # install_rpath : rootlibexecdir,
2158 # public_programs += [exe]
2160 # exe = executable('systemd-escape',
2161 # 'src/escape/escape.c',
2162 # include_directories : includes,
2163 # link_with : [libshared],
2164 # install_rpath : rootlibexecdir,
2166 # install_dir : rootbindir)
2167 # public_programs += [exe]
2169 # exe = executable('systemd-notify',
2170 # 'src/notify/notify.c',
2171 # include_directories : includes,
2172 # link_with : [libshared],
2173 # install_rpath : rootlibexecdir,
2175 # install_dir : rootbindir)
2176 # public_programs += [exe]
2178 # executable('systemd-volatile-root',
2179 # 'src/volatile-root/volatile-root.c',
2180 # include_directories : includes,
2181 # link_with : [libshared],
2182 # install_rpath : rootlibexecdir,
2184 # install_dir : rootlibexecdir)
2186 # executable('systemd-cgroups-agent',
2187 # 'src/cgroups-agent/cgroups-agent.c',
2188 # include_directories : includes,
2189 # link_with : [libshared],
2190 # install_rpath : rootlibexecdir,
2192 # install_dir : rootlibexecdir)
2194 executable('elogind-cgroups-agent',
2195 'src/cgroups-agent/cgroups-agent.c',
2196 include_directories : includes,
2197 link_with : [libshared_static],
2198 install_rpath : rootlibexecdir,
2200 install_dir : rootlibexecdir)
2203 #if 0 /// UNNEEDED by elogind
2204 # exe = executable('systemd-path',
2205 # 'src/path/path.c',
2206 # include_directories : includes,
2207 # link_with : [libshared],
2208 # install_rpath : rootlibexecdir,
2210 # public_programs += [exe]
2212 # exe = executable('systemd-ask-password',
2213 # 'src/ask-password/ask-password.c',
2214 # include_directories : includes,
2215 # link_with : [libshared],
2216 # install_rpath : rootlibexecdir,
2218 # install_dir : rootbindir)
2219 # public_programs += [exe]
2221 # executable('systemd-reply-password',
2222 # 'src/reply-password/reply-password.c',
2223 # include_directories : includes,
2224 # link_with : [libshared],
2225 # install_rpath : rootlibexecdir,
2227 # install_dir : rootlibexecdir)
2229 # exe = executable('systemd-tty-ask-password-agent',
2230 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2231 # include_directories : includes,
2232 # link_with : [libshared],
2233 # install_rpath : rootlibexecdir,
2235 # install_dir : rootbindir)
2236 # public_programs += [exe]
2238 # exe = executable('systemd-cgls',
2239 # 'src/cgls/cgls.c',
2240 # include_directories : includes,
2241 # link_with : [libshared],
2242 # install_rpath : rootlibexecdir,
2244 # public_programs += [exe]
2246 # exe = executable('systemd-cgtop',
2247 # 'src/cgtop/cgtop.c',
2248 # include_directories : includes,
2249 # link_with : [libshared],
2250 # install_rpath : rootlibexecdir,
2252 # public_programs += [exe]
2254 # executable('systemd-initctl',
2255 # 'src/initctl/initctl.c',
2256 # include_directories : includes,
2257 # link_with : [libshared],
2258 # install_rpath : rootlibexecdir,
2260 # install_dir : rootlibexecdir)
2262 # exe = executable('systemd-mount',
2263 # 'src/mount/mount-tool.c',
2264 # include_directories : includes,
2265 # link_with : [libshared],
2266 # install_rpath : rootlibexecdir,
2268 # public_programs += [exe]
2270 # meson.add_install_script(meson_make_symlink,
2271 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2273 # exe = executable('systemd-run',
2275 # include_directories : includes,
2276 # link_with : [libshared],
2277 # install_rpath : rootlibexecdir,
2279 # public_programs += [exe]
2281 # exe = executable('systemd-stdio-bridge',
2282 # 'src/stdio-bridge/stdio-bridge.c',
2283 # include_directories : includes,
2284 # link_with : [libshared],
2285 # install_rpath : rootlibexecdir,
2287 # public_programs += [exe]
2289 # exe = executable('busctl',
2290 # 'src/busctl/busctl.c',
2291 # 'src/busctl/busctl-introspect.c',
2292 # 'src/busctl/busctl-introspect.h',
2293 # include_directories : includes,
2294 # link_with : [libshared],
2295 # install_rpath : rootlibexecdir,
2297 # public_programs += [exe]
2299 # if conf.get('ENABLE_SYSUSERS', false)
2300 # exe = executable('systemd-sysusers',
2301 # 'src/sysusers/sysusers.c',
2302 # include_directories : includes,
2303 # link_with : [libshared],
2304 # install_rpath : rootlibexecdir,
2306 # install_dir : rootbindir)
2307 # public_programs += [exe]
2310 # if conf.get('ENABLE_TMPFILES', false)
2311 # exe = executable('systemd-tmpfiles',
2312 # 'src/tmpfiles/tmpfiles.c',
2313 # include_directories : includes,
2314 # link_with : [libshared],
2315 # dependencies : [libacl],
2316 # install_rpath : rootlibexecdir,
2318 # install_dir : rootbindir)
2319 # public_programs += [exe]
2322 # if conf.get('ENABLE_HWDB', false)
2323 # exe = executable('systemd-hwdb',
2324 # 'src/hwdb/hwdb.c',
2325 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2326 # include_directories : includes,
2327 # link_with : [libudev_internal],
2328 # install_rpath : udev_rpath,
2330 # install_dir : rootbindir)
2331 # public_programs += [exe]
2334 # if conf.get('ENABLE_QUOTACHECK', false)
2335 # executable('systemd-quotacheck',
2336 # 'src/quotacheck/quotacheck.c',
2337 # include_directories : includes,
2338 # link_with : [libshared],
2339 # install_rpath : rootlibexecdir,
2341 # install_dir : rootlibexecdir)
2344 # exe = executable('systemd-socket-proxyd',
2345 # 'src/socket-proxy/socket-proxyd.c',
2346 # include_directories : includes,
2347 # link_with : [libshared],
2348 # dependencies : [threads],
2349 # install_rpath : rootlibexecdir,
2351 # install_dir : rootlibexecdir)
2352 # public_programs += [exe]
2354 # exe = executable('systemd-udevd',
2355 # systemd_udevd_sources,
2356 # include_directories : includes,
2357 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2358 # link_with : [libudev_core,
2359 # libsystemd_network,
2360 # libudev_internal],
2361 # dependencies : [threads,
2366 # install_rpath : udev_rpath,
2368 # install_dir : rootlibexecdir)
2369 # public_programs += [exe]
2371 # exe = executable('udevadm',
2373 # include_directories : includes,
2374 # link_with : [libudev_core,
2375 # libsystemd_network,
2376 # libudev_internal],
2377 # dependencies : [threads,
2382 # install_rpath : udev_rpath,
2384 # install_dir : rootbindir)
2385 # public_programs += [exe]
2387 # executable('systemd-shutdown',
2388 # systemd_shutdown_sources,
2389 # include_directories : includes,
2390 # link_with : [libshared],
2391 # install_rpath : rootlibexecdir,
2393 # install_dir : rootlibexecdir)
2395 # executable('systemd-update-done',
2396 # 'src/update-done/update-done.c',
2397 # include_directories : includes,
2398 # link_with : [libshared],
2399 # install_rpath : rootlibexecdir,
2401 # install_dir : rootlibexecdir)
2403 # executable('systemd-update-utmp',
2404 # 'src/update-utmp/update-utmp.c',
2405 # include_directories : includes,
2406 # link_with : [libshared],
2407 # dependencies : [libaudit],
2408 # install_rpath : rootlibexecdir,
2410 # install_dir : rootlibexecdir)
2412 # if conf.get('HAVE_KMOD', false)
2413 # executable('systemd-modules-load',
2414 # 'src/modules-load/modules-load.c',
2415 # include_directories : includes,
2416 # link_with : [libshared],
2417 # dependencies : [libkmod],
2418 # install_rpath : rootlibexecdir,
2420 # install_dir : rootlibexecdir)
2422 # meson.add_install_script('sh', '-c',
2423 # mkdir_p.format(modulesloaddir))
2424 # meson.add_install_script('sh', '-c',
2425 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2428 # exe = executable('systemd-nspawn',
2429 # systemd_nspawn_sources,
2430 # 'src/core/mount-setup.c', # FIXME: use a variable?
2431 # 'src/core/mount-setup.h',
2432 # 'src/core/loopback-setup.c',
2433 # 'src/core/loopback-setup.h',
2434 # include_directories : [includes, include_directories('src/nspawn')],
2435 # link_with : [libshared],
2436 # dependencies : [libacl,
2440 # install_rpath : rootlibexecdir,
2442 # public_programs += [exe]
2444 # if conf.get('ENABLE_NETWORKD', false)
2445 # executable('systemd-networkd',
2446 # systemd_networkd_sources,
2447 # include_directories : includes,
2448 # link_with : [libnetworkd_core,
2449 # libsystemd_network,
2452 # dependencies : [threads],
2453 # install_rpath : rootlibexecdir,
2455 # install_dir : rootlibexecdir)
2457 # executable('systemd-networkd-wait-online',
2458 # systemd_networkd_wait_online_sources,
2459 # include_directories : includes,
2460 # link_with : [libnetworkd_core,
2462 # install_rpath : rootlibexecdir,
2464 # install_dir : rootlibexecdir)
2466 # exe = executable('networkctl',
2467 # networkctl_sources,
2468 # include_directories : includes,
2469 # link_with : [libsystemd_network,
2471 # install_rpath : rootlibexecdir,
2473 # install_dir : rootbindir)
2474 # public_programs += [exe]
2477 ############################################################
2479 foreach tuple : tests
2481 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2482 dependencies = tuple[2]
2483 condition = tuple.length() >= 4 ? tuple[3] : ''
2484 type = tuple.length() >= 5 ? tuple[4] : ''
2485 defs = tuple.length() >= 6 ? tuple[5] : []
2486 incs = tuple.length() >= 7 ? tuple[6] : includes
2489 name = sources[0].split('/')[-1].split('.')[0]
2490 if type.startswith('timeout=')
2491 timeout = type.split('=')[1].to_int()
2495 if condition == '' or conf.get(condition, false)
2499 include_directories : incs,
2500 link_with : link_with,
2501 dependencies : dependencies,
2503 install_rpath : rootlibexecdir,
2504 install : install_tests,
2505 install_dir : join_paths(testsdir, type))
2508 message('@0@ is a manual test'.format(name))
2509 elif type == 'unsafe' and want_tests != 'unsafe'
2510 message('@0@ is an unsafe test'.format(name))
2517 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2521 #if 0 /// UNNEEDED by elogind
2522 # test_libsystemd_sym = executable(
2523 # 'test-libsystemd-sym',
2524 # test_libsystemd_sym_c,
2525 # include_directories : includes,
2526 # link_with : [libsystemd],
2527 # install : install_tests,
2528 # install_dir : testsdir)
2529 # test('test-libsystemd-sym',
2530 # test_libsystemd_sym)
2532 # test_libudev_sym = executable(
2533 # 'test-libudev-sym',
2534 # test_libudev_sym_c,
2535 # include_directories : includes,
2536 # c_args : ['-Wno-deprecated-declarations'],
2537 # link_with : [libudev],
2538 # install : install_tests,
2539 # install_dir : testsdir)
2540 # test('test-libudev-sym',
2543 test_libelogind_sym = executable(
2544 'test-libelogind-sym',
2545 test_libelogind_sym_c,
2546 include_directories : includes,
2547 link_with : [libelogind],
2548 install : install_tests,
2549 install_dir : testsdir)
2550 test('test-libelogind-sym',
2551 test_libelogind_sym)
2554 ############################################################
2556 make_directive_index_py = find_program('tools/make-directive-index.py')
2557 make_man_index_py = find_program('tools/make-man-index.py')
2558 xml_helper_py = find_program('tools/xml_helper.py')
2559 #if 0 /// UNNEEDED by elogind
2560 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2563 # subdir('sysctl.d')
2564 # subdir('sysusers.d')
2565 # subdir('tmpfiles.d')
2571 subdir('shell-completion/bash')
2572 subdir('shell-completion/zsh')
2573 #if 0 /// UNNEEDED by elogind
2574 # subdir('docs/sysvinit')
2575 # subdir('docs/var-log')
2578 # FIXME: figure out if the warning is true:
2579 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2580 install_subdir('factory/etc',
2581 install_dir : factorydir)
2584 #if 0 /// UNNEEDED by elogind
2585 # install_data('xorg/50-systemd-user.sh',
2586 # install_dir : xinitrcdir)
2587 # install_data('system-preset/90-systemd.preset',
2588 # install_dir : systempresetdir)
2589 # install_data('modprobe.d/systemd.conf',
2590 # install_dir : modprobedir)
2592 install_data('README',
2595 #if 0 /// UNNEEDED by elogind
2601 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2602 install_dir : docdir)
2604 meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2605 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2607 ############################################################
2609 meson_check_help = find_program('tools/meson-check-help.sh')
2611 foreach exec : public_programs
2612 name = exec.full_path().split('/')[-1]
2613 test('check-help-' + name,
2615 args : [exec.full_path()])
2618 ############################################################
2621 all_files = run_command(
2623 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2626 all_files = files(all_files.stdout().split())
2631 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2635 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2639 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2642 command : [meson_git_contrib_sh])
2646 git_head = run_command(
2648 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2649 'rev-parse', 'HEAD']).stdout().strip()
2650 git_head_short = run_command(
2652 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2653 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2657 command : ['git', 'archive',
2658 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2660 '--prefix', 'systemd-@0@/'.format(git_head),
2664 ############################################################
2667 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2669 'prefix: @0@'.format(prefixdir),
2670 'rootprefix: @0@'.format(rootprefixdir),
2671 'sysconf dir: @0@'.format(sysconfdir),
2672 'includedir: @0@'.format(includedir),
2673 'lib dir: @0@'.format(libdir),
2674 'rootlib dir: @0@'.format(rootlibdir),
2675 #if 0 /// UNSUPPORTED by elogind
2676 # 'SysV init scripts: @0@'.format(sysvinit_path),
2677 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2679 'rootexeclib dir: @0@'.format(rootlibexecdir),
2681 'PAM modules dir: @0@'.format(pamlibdir),
2682 'PAM configuration dir: @0@'.format(pamconfdir),
2683 #if 0 /// UNSUPPORTED by elogind
2684 # 'RPM macros dir: @0@'.format(rpmmacrosdir),
2685 # 'modprobe.d dir: @0@'.format(modprobedir),
2687 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2688 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2689 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2690 'bash completions dir: @0@'.format(bashcompletiondir),
2691 'zsh completions dir: @0@'.format(zshcompletiondir),
2692 #if 0 /// UNSUPPORTED by elogind
2693 # 'extra start script: @0@'.format(get_option('rc-local')),
2694 # 'extra stop script: @0@'.format(get_option('halt-local')),
2695 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2696 # get_option('debug-tty')),
2698 'TTY GID: @0@'.format(tty_gid),
2699 'maximum system UID: @0@'.format(system_uid_max),
2700 'maximum system GID: @0@'.format(system_gid_max),
2701 #if 0 /// UNSUPPORTED by elogind
2702 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2703 # 'certificate root: @0@'.format(get_option('certificate-root')),
2704 # 'support URL: @0@'.format(support_url),
2705 # 'nobody user name: @0@'.format(get_option('nobody-user')),
2706 # 'nobody group name: @0@'.format(get_option('nobody-group')),
2707 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2708 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2710 # 'default DNSSEC mode: @0@'.format(default_dnssec),
2711 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2713 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2715 #if 0 /// UNSUPPORTED by elogind
2716 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
2717 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2719 # 'default DNS servers: @0@'.format(alt_dns_servers),
2720 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
2722 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2723 # '@@0@'.format(time_epoch)).stdout().strip()
2725 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2729 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2730 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2731 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2733 #if 0 /// UNNEEDED by elogind
2734 # if conf.get('ENABLE_EFI', false)
2736 # 'efi arch: @0@'.format(efi_arch)]
2740 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2741 # 'EFI CC @0@'.format(efi_cc),
2742 # 'EFI libdir: @0@'.format(efi_libdir),
2743 # 'EFI ldsdir: @0@'.format(efi_ldsdir),
2744 # 'EFI includedir: @0@'.format(efi_incdir)]
2753 #if 0 /// UNNEEDED by elogind
2754 # ['libcryptsetup'],
2758 #if 0 /// UNNEEDED by elogind
2763 #if 0 /// UNNEEDED by elogind
2767 #if 0 /// UNNEEDED by elogind
2774 #if 0 /// UNNEEDED by elogind
2790 # ['environment.d'],
2808 ['legacy pkla', install_polkit_pkla],
2809 #if 0 /// UNNEEDED by elogind
2811 # ['gnu-efi', have_gnu_efi],
2818 #if 0 /// UNNEEDED by elogind
2819 # ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
2823 ['man pages', want_man],
2824 ['html pages', want_html],
2825 ['man page indices', want_man and have_lxml],
2826 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
2827 #if 0 /// UNNEEDED by elogind
2831 #if 0 /// UNNEEDED by elogind
2834 # ['adm group', get_option('adm-group')],
2835 # ['wheel group', get_option('wheel-group')],
2841 ['debug mmap cache'],
2844 cond = tuple.get(1, '')
2846 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2847 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2848 cond = conf.get(ident1, false) or conf.get(ident2, false)
2853 missing += [tuple[0]]
2859 'enabled features: @0@'.format(', '.join(found)),
2861 'disabled features: @0@'.format(', '.join(missing)),
2863 message('\n '.join(status))