1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # elogind is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # elogind is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with elogind; If not, see <http://www.gnu.org/licenses/>.
18 project('elogind', 'c',
27 meson_version : '>= 0.41',
30 #if 0 /// UNNEEDED by elogind - libudev is external
31 # libsystemd_version = '0.21.0'
32 # libudev_version = '1.6.9'
34 libelogind_version = '0.20.0'
37 # We need the same data in three different formats, ugh!
38 # Also, for hysterical reasons, we use different variable
39 # names, sometimes. Not all variables are included in every
41 conf = configuration_data()
42 conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
43 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
45 substs = configuration_data()
46 #if 0 /// Set elogind Package PACKAGE_URL
47 # substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
49 substs.set('PACKAGE_URL', 'https://github.com/elogind/elogind')
51 substs.set('PACKAGE_VERSION', meson.project_version())
55 #####################################################################
56 #if 0 /// elogind does not need this
58 # # Try to install the git pre-commit hook
59 # git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
60 # if git_hook.returncode() == 0
61 # message(git_hook.stdout().strip())
64 # elogind Note: We use precompiler masks for two reasons:
65 # 1) The masking is consistent with the sources
66 # 2) The git patch creator we use for preparing upstream patches
67 # manipulates commits to not take those masks out. Therefore
68 # it can be used to add commits updating the meson files, too.
71 #####################################################################
73 split_usr = get_option('split-usr')
74 conf.set10('HAVE_SPLIT_USR', split_usr)
76 rootprefixdir = get_option('rootprefix')
77 # Unusual rootprefixdir values are used by some distros
78 # (see https://github.com/systemd/systemd/pull/7461).
79 rootprefix_default = get_option('split-usr') ? '/' : '/usr'
80 if rootprefixdir == ''
81 rootprefixdir = rootprefix_default
84 #if 0 /// UNNEEDED by elogind
85 # sysvinit_path = get_option('sysvinit-path')
86 # sysvrcnd_path = get_option('sysvrcnd-path')
87 # have = sysvinit_path != '' and sysvrcnd_path != ''
88 # conf.set10('HAVE_SYSV_COMPAT', have,
89 # description : 'SysV init scripts and rcN.d links are supported')
90 # m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
93 # join_paths ignore the preceding arguments if an absolute component is
94 # encountered, so this should canonicalize various paths when they are
95 # absolute or relative.
96 prefixdir = get_option('prefix')
97 if not prefixdir.startswith('/')
98 error('Prefix is not absolute: "@0@"'.format(prefixdir))
100 bindir = join_paths(prefixdir, get_option('bindir'))
101 libdir = join_paths(prefixdir, get_option('libdir'))
102 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
103 includedir = join_paths(prefixdir, get_option('includedir'))
104 datadir = join_paths(prefixdir, get_option('datadir'))
105 localstatedir = join_paths('/', get_option('localstatedir'))
107 rootbindir = join_paths(rootprefixdir, 'bin')
108 #if 0 /// elogind has a different default
109 # rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
111 rootlibexecdir = get_option('rootlibexecdir')
112 rootlibexecdir = rootlibexecdir != '' ? rootlibexecdir : join_paths(rootprefixdir, 'lib/elogind')
115 rootlibdir = get_option('rootlibdir')
117 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
120 # Dirs of external packages
121 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
122 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
123 polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
124 polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
125 polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
126 varlogdir = join_paths(localstatedir, 'log')
127 #if 0 /// UNNEEDED by elogind
128 # xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
129 # rpmmacrosdir = get_option('rpmmacrosdir')
130 # if rpmmacrosdir != 'no'
131 # rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
134 modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
137 #if 0 /// elogind has a bit different layout and does not need all of theses
138 # pkgdatadir = join_paths(datadir, 'systemd')
139 # environmentdir = join_paths(prefixdir, 'lib/environment.d')
140 # pkgsysconfdir = join_paths(sysconfdir, 'systemd')
141 # userunitdir = join_paths(prefixdir, 'lib/systemd/user')
142 # userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
143 # tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
144 # sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
145 # sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
146 # binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
147 # modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
148 # networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
149 # pkgincludedir = join_paths(includedir, 'systemd')
150 # systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
151 # usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
152 # systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
153 # userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
154 # systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
155 # systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
156 # systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
157 # systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
158 # udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
159 # udevhomedir = udevlibexecdir
160 # udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
161 # udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
162 # catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
163 # kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
164 # factorydir = join_paths(datadir, 'factory')
165 # bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
166 # testsdir = join_paths(prefixdir, 'lib/systemd/tests')
167 # systemdstatedir = join_paths(localstatedir, 'lib/systemd')
168 # catalogstatedir = join_paths(systemdstatedir, 'catalog')
169 # randomseeddir = join_paths(localstatedir, 'lib/systemd')
171 # docdir = join_paths(datadir, 'doc/systemd')
174 pkgdatadir = join_paths(datadir, 'elogind')
175 pkgsysconfdir = join_paths(sysconfdir, 'elogind')
176 pkgincludedir = join_paths(includedir, 'elogind/systemd')
177 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
178 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
180 # in elogind, udev is external and thus configurable
181 udevlibexecdir = get_option('udevbindir')
182 udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev')
183 udevrulesdir = get_option('udevrulesdir')
184 udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d')
185 udevhomedir = udevlibexecdir
186 factorydir = join_paths(datadir, 'factory')
187 docdir = get_option('docdir')
188 docdir = docdir != '' ? docdir: '-'.join([join_paths(datadir, 'doc/elogind'),
189 meson.project_version()])
190 testsdir = join_paths(prefixdir, 'lib/elogind/tests')
191 randomseeddir = join_paths(localstatedir, 'lib/elogind')
194 dbuspolicydir = get_option('dbuspolicydir')
195 if dbuspolicydir == ''
196 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
199 dbussessionservicedir = get_option('dbussessionservicedir')
200 if dbussessionservicedir == ''
201 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
204 dbussystemservicedir = get_option('dbussystemservicedir')
205 if dbussystemservicedir == ''
206 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
209 pamlibdir = get_option('pamlibdir')
211 pamlibdir = join_paths(rootlibdir, 'security')
214 pamconfdir = get_option('pamconfdir')
216 pamconfdir = join_paths(sysconfdir, 'pam.d')
219 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
220 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
221 #if 0 /// UNNEEDED by elogind
222 # conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
223 # conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
224 # conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
225 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
226 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
227 # conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
228 # conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
229 # conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
230 # conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
231 # conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
232 # conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
233 # conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
234 # conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
235 # conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
236 # conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
237 # conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
238 # conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
239 # conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
240 # conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
242 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'elogind-cgroups-agent'))
243 conf.set_quoted('ELOGIND_UACCESS_COMMAND_PATH', join_paths(rootlibexecdir, 'elogind-uaccess-command'))
244 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'elogind'))
246 conf.set_quoted('ROOTPREFIX', rootprefixdir)
247 #if 0 /// UNNEEDED by elogind
248 # conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
249 # conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
250 # conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
251 # conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
252 # conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
253 # conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
254 # conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
256 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
257 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
258 #if 0 /// UNNEEDED by elogind
259 # conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
260 # conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
262 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
263 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
264 conf.set_quoted('LIBDIR', libdir)
265 conf.set_quoted('ROOTLIBDIR', rootlibdir)
266 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
267 #if 0 /// UNNEEDED by elogind
268 # conf.set_quoted('BOOTLIBDIR', bootlibdir)
269 # conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
270 # conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
271 # conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
272 # conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
273 # conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
274 # conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
277 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
278 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
280 substs.set('prefix', prefixdir)
281 substs.set('exec_prefix', prefixdir)
282 substs.set('libdir', libdir)
283 substs.set('rootlibdir', rootlibdir)
284 substs.set('includedir', includedir)
285 substs.set('pkgsysconfdir', pkgsysconfdir)
286 substs.set('bindir', bindir)
287 substs.set('rootbindir', rootbindir)
288 substs.set('rootlibexecdir', rootlibexecdir)
289 #if 0 /// UNNEEDED by elogind
290 # substs.set('systemunitdir', systemunitdir)
291 # substs.set('userunitdir', userunitdir)
292 # substs.set('systempresetdir', systempresetdir)
293 # substs.set('userpresetdir', userpresetdir)
294 # substs.set('udevhwdbdir', udevhwdbdir)
296 substs.set('udevrulesdir', udevrulesdir)
297 substs.set('udevlibexecdir', udevlibexecdir)
298 #if 0 /// UNNEEDED by elogind
299 # substs.set('catalogdir', catalogdir)
300 # substs.set('tmpfilesdir', tmpfilesdir)
301 # substs.set('sysusersdir', sysusersdir)
302 # substs.set('sysctldir', sysctldir)
303 # substs.set('binfmtdir', binfmtdir)
304 # substs.set('modulesloaddir', modulesloaddir)
305 # substs.set('systemgeneratordir', systemgeneratordir)
306 # substs.set('usergeneratordir', usergeneratordir)
307 # substs.set('systemenvgeneratordir', systemenvgeneratordir)
308 # substs.set('userenvgeneratordir', userenvgeneratordir)
310 substs.set('systemshutdowndir', systemshutdowndir)
311 substs.set('systemsleepdir', systemsleepdir)
312 substs.set('VARLOGDIR', varlogdir)
313 #if 0 /// UNNEEDED by elogind
314 # substs.set('CERTIFICATEROOT', get_option('certificate-root'))
315 # substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
316 # substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
317 # substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
318 # substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
319 # substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
320 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
323 #####################################################################
325 cc = meson.get_compiler('c')
326 pkgconfig = import('pkgconfig')
327 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
328 meson_build_sh = find_program('tools/meson-build.sh')
330 if get_option('tests') != 'false'
331 cxx = find_program('c++', required : false)
333 # Used only for tests
338 want_ossfuzz = get_option('oss-fuzz')
339 want_libfuzzer = get_option('llvm-fuzz')
340 fuzzer_build = want_ossfuzz or want_libfuzzer
341 if want_ossfuzz and want_libfuzzer
342 error('only one of oss-fuzz and llvm-fuzz can be specified')
345 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
348 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
351 foreach arg : ['-Wextra',
354 '-Wmissing-include-dirs',
355 '-Wold-style-definition',
358 '-Wdeclaration-after-statement',
360 '-Wsuggest-attribute=noreturn',
361 '-Werror=missing-prototypes',
362 '-Werror=implicit-function-declaration',
363 '-Werror=missing-declarations',
364 '-Werror=return-type',
365 '-Werror=incompatible-pointer-types',
367 '-Wstrict-prototypes',
369 '-Wmissing-noreturn',
370 '-Wimplicit-fallthrough=5',
373 '-Wstrict-aliasing=2',
380 '-fdiagnostics-show-option',
381 '-fno-strict-aliasing',
382 '-fvisibility=hidden',
384 '-fstack-protector-strong',
385 '--param=ssp-buffer-size=4',
387 if cc.has_argument(arg)
388 add_project_arguments(arg, language : 'c')
392 # the oss-fuzz fuzzers are not built with -fPIE, so don't
393 # enable it when we are linking against them
395 if cc.has_argument('-fPIE')
396 add_project_arguments('-fPIE', language : 'c')
400 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
401 # arguments, just emits a warnings. So test for the "positive" version instead.
402 foreach arg : ['unused-parameter',
403 'missing-field-initializers',
406 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
408 if cc.has_argument('-W' + arg)
409 add_project_arguments('-Wno-' + arg, language : 'c')
415 #include <inttypes.h>
416 typedef uint64_t usec_t;
417 usec_t now(clockid_t clock);
422 ', name : '-Werror=shadow with local shadowing')
423 add_project_arguments('-Werror=shadow', language : 'c')
426 if cc.get_id() == 'clang'
427 foreach arg : ['-Wno-typedef-redefinition',
428 '-Wno-gnu-variable-sized-type-not-at-end',
430 if cc.has_argument(arg,
431 name : '@0@ is supported'.format(arg))
432 add_project_arguments(arg, language : 'c')
437 link_test_c = files('tools/meson-link-test.c')
439 # --as-needed and --no-undefined are provided by meson by default,
440 # run mesonconf to see what is enabled
441 foreach arg : ['-Wl,-z,relro',
446 have = run_command(check_compilation_sh,
447 cc.cmd_array(), '-x', 'c', arg,
448 '-include', link_test_c).returncode() == 0
449 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
450 if have and (arg != '-pie' or not fuzzer_build)
451 add_project_link_arguments(arg, language : 'c')
455 # Check if various sanitizers are supported
457 foreach arg : ['address']
459 have = run_command(check_compilation_sh,
460 cc.cmd_array(), '-x', 'c',
461 '-fsanitize=@0@'.format(arg),
462 '-include', link_test_c).returncode() == 0
463 message('@0@ sanitizer supported: @1@'.format(arg, have ? 'yes' : 'no'))
469 if get_option('buildtype') != 'debug'
470 foreach arg : ['-ffunction-sections',
472 if cc.has_argument(arg,
473 name : '@0@ is supported'.format(arg))
474 add_project_arguments(arg, language : 'c')
478 foreach arg : ['-Wl,--gc-sections']
479 have = run_command(check_compilation_sh,
480 cc.cmd_array(), '-x', 'c', arg,
481 '-include', link_test_c).returncode() == 0
482 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
484 add_project_link_arguments(arg, language : 'c')
489 cpp = ' '.join(cc.cmd_array()) + ' -E'
491 #####################################################################
492 # compilation result tests
494 conf.set('_GNU_SOURCE', true)
495 conf.set('__SANE_USERSPACE_TYPES__', true)
497 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
498 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
499 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
500 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
501 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
502 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
503 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
507 #include <linux/ethtool.h>
508 #include <linux/fib_rules.h>
510 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
512 foreach decl : ['char16_t',
515 'struct ethtool_link_settings',
516 'struct fib_rule_uid_range',
519 # We get -1 if the size cannot be determined
520 have = cc.sizeof(decl, prefix : decl_headers) > 0
521 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
524 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
525 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
526 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
527 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
528 ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'],
529 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
530 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
531 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
532 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
533 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
534 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
535 # if_tunnel.h is buggy and cannot be included on its own
536 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
537 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
538 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
539 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
540 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
541 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
542 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
543 ['IPVLAN_F_PRIVATE', 'linux/if_link.h'],
544 ['NDA_IFINDEX', 'linux/neighbour.h'],
545 ['IFA_FLAGS', 'linux/if_addr.h'],
546 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
547 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
548 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
550 prefix = decl.length() > 2 ? decl[2] : ''
551 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
552 conf.set10('HAVE_' + decl[0], have)
555 foreach ident : ['secure_getenv', '__secure_getenv']
556 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
560 ['memfd_create', '''#include <sys/mman.h>'''],
561 ['gettid', '''#include <sys/types.h>
562 // #include <unistd.h>'''],
563 ['pivot_root', '''#include <stdlib.h>
564 #include <unistd.h>'''], # no known header declares pivot_root
565 ['name_to_handle_at', '''#include <sys/types.h>
566 #include <sys/stat.h>
567 #include <fcntl.h>'''],
568 ['setns', '''#include <sched.h>'''],
569 ['renameat2', '''#include <stdio.h>
570 // #include <fcntl.h>'''],
571 ['kcmp', '''#include <linux/kcmp.h>'''],
572 ['keyctl', '''#include <sys/types.h>
573 #include <keyutils.h>'''],
574 ['copy_file_range', '''#include <sys/syscall.h>
575 #include <unistd.h>'''],
576 ['bpf', '''#include <sys/syscall.h>
577 #include <unistd.h>'''],
578 ['explicit_bzero' , '''#include <string.h>'''],
581 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
582 conf.set10('HAVE_' + ident[0].to_upper(), have)
585 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
586 conf.set10('USE_SYS_RANDOM_H', true)
587 conf.set10('HAVE_GETRANDOM', true)
589 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
590 conf.set10('USE_SYS_RANDOM_H', false)
591 conf.set10('HAVE_GETRANDOM', have)
594 #####################################################################
596 sed = find_program('sed')
597 awk = find_program('awk')
598 m4 = find_program('m4')
599 stat = find_program('stat')
600 git = find_program('git', required : false)
601 env = find_program('env')
603 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
604 #if 1 /// Needed by elogind
605 meson_symlink_headers = meson.source_root() + '/tools/meson-symlink_headers.sh'
607 mkdir_p = 'mkdir -p $DESTDIR/@0@'
608 #if 0 /// unneeded by elogind
609 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
610 # splash_bmp = files('test/splash.bmp')
613 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
614 # /usr/sbin, /sbin, and fall back to the default from middle column.
615 #if 0 /// elogind has a bit different list and some adaptions
616 # progs = [['quotaon', '/usr/sbin/quotaon' ],
617 # ['quotacheck', '/usr/sbin/quotacheck' ],
618 # ['kill', '/usr/bin/kill' ],
619 # ['kmod', '/usr/bin/kmod' ],
620 # ['kexec', '/usr/sbin/kexec' ],
621 # ['sulogin', '/usr/sbin/sulogin' ],
622 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
623 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
624 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
625 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
628 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
629 ['reboot', '/sbin/reboot', 'REBOOT'],
630 ['halt', '/sbin/halt', 'HALT'],
634 path = get_option(prog[0] + '-path')
636 message('Using @1@ for @0@'.format(prog[0], path))
638 exe = find_program(prog[0],
639 '/usr/sbin/' + prog[0],
642 path = exe.found() ? exe.path() : prog[1]
644 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
645 conf.set_quoted(name, path)
646 substs.set(name, path)
649 conf.set_quoted('TELINIT', get_option('telinit-path'))
651 if run_command('ln', '--relative', '--help').returncode() != 0
652 error('ln does not support --relative')
655 ############################################################
657 gperf = find_program('gperf')
659 gperf_test_format = '''
661 const char * in_word_set(const char *, @0@);
664 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
665 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
666 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
667 if cc.compiles(gperf_test)
668 gperf_len_type = 'size_t'
670 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
671 if cc.compiles(gperf_test)
672 gperf_len_type = 'unsigned'
674 error('unable to determine gperf len type')
677 message('gperf len type is @0@'.format(gperf_len_type))
678 conf.set('GPERF_LEN_TYPE', gperf_len_type,
679 description : 'The type of gperf "len" parameter')
681 ############################################################
683 if not cc.has_header('sys/capability.h')
684 error('POSIX caps headers not found')
686 foreach header : ['crypt.h',
689 'linux/vm_sockets.h',
691 'valgrind/memcheck.h',
692 'valgrind/valgrind.h',
695 conf.set10('HAVE_' + header.underscorify().to_upper(),
696 cc.has_header(header))
699 ############################################################
701 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
702 #if 0 /// UNNEEDED by elogind
703 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
704 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
707 default_hierarchy = get_option('default-hierarchy')
708 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
709 description : 'default cgroup hierarchy as string')
710 if default_hierarchy == 'legacy'
711 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
712 elif default_hierarchy == 'hybrid'
713 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
715 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
718 #if 0 /// UNNEEDED by elogind
719 # time_epoch = get_option('time-epoch')
720 # if time_epoch == ''
721 # NEWS = files('NEWS')
722 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
724 # time_epoch = time_epoch.to_int()
725 # conf.set('TIME_EPOCH', time_epoch)
727 ############################################################
728 # elogind needs to know which cgroups controller to follow.
729 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
730 with_cgroupctrl = get_option('cgroup-controller')
731 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
732 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
733 elif with_cgroupctrl == 'none'
734 with_cgroupctrl = 'elogind'
737 # No controller now is a problem:
738 if with_cgroupctrl == ''
739 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
742 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
743 description : 'name of the cgroup controller to use')
744 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
745 '='.join(['name', with_cgroupctrl]))
746 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
747 '='.join(['name', with_cgroupctrl]))
748 ############################################################
751 system_uid_max = get_option('system-uid-max')
752 if system_uid_max == ''
753 system_uid_max = run_command(
755 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
756 '/etc/login.defs').stdout()
758 system_uid_max = system_uid_max.to_int()
759 conf.set('SYSTEM_UID_MAX', system_uid_max)
760 substs.set('systemuidmax', system_uid_max)
761 message('maximum system UID is @0@'.format(system_uid_max))
763 system_gid_max = get_option('system-gid-max')
764 if system_gid_max == ''
765 system_gid_max = run_command(
767 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
768 '/etc/login.defs').stdout()
770 system_gid_max = system_gid_max.to_int()
771 conf.set('SYSTEM_GID_MAX', system_gid_max)
772 substs.set('systemgidmax', system_gid_max)
773 message('maximum system GID is @0@'.format(system_gid_max))
775 #if 0 /// UNNEEDED by elogind
776 # dynamic_uid_min = get_option('dynamic-uid-min').to_int()
777 # dynamic_uid_max = get_option('dynamic-uid-max').to_int()
778 # conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
779 # conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
780 # substs.set('dynamicuidmin', dynamic_uid_min)
781 # substs.set('dynamicuidmax', dynamic_uid_max)
783 # container_uid_base_min = get_option('container-uid-base-min').to_int()
784 # container_uid_base_max = get_option('container-uid-base-max').to_int()
785 # conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
786 # conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
787 # substs.set('containeruidbasemin', container_uid_base_min)
788 # substs.set('containeruidbasemax', container_uid_base_max)
791 nobody_user = get_option('nobody-user')
792 nobody_group = get_option('nobody-group')
794 getent_result = run_command('getent', 'passwd', '65534')
795 if getent_result.returncode() == 0
796 name = getent_result.stdout().split(':')[0]
797 if name != nobody_user
798 message('WARNING:\n' +
799 ' The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
800 ' Your build will result in an user table setup that is incompatible with the local system.')
803 id_result = run_command('id', '-u', nobody_user)
804 if id_result.returncode() == 0
805 id = id_result.stdout().to_int()
807 message('WARNING:\n' +
808 ' The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
809 ' Your build will result in an user table setup that is incompatible with the local system.')
813 getent_result = run_command('getent', 'group', '65534')
814 if getent_result.returncode() == 0
815 name = getent_result.stdout().split(':')[0]
816 if name != nobody_group
817 message('WARNING:\n' +
818 ' The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
819 ' Your build will result in an group table setup that is incompatible with the local system.')
822 id_result = run_command('id', '-g', nobody_group)
823 if id_result.returncode() == 0
824 id = id_result.stdout().to_int()
826 message('WARNING:\n' +
827 ' The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
828 ' Your build will result in an group table setup that is incompatible with the local system.')
831 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
832 message('WARNING:\n' +
833 ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
834 ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
837 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
838 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
839 substs.set('NOBODY_USER_NAME', nobody_user)
840 substs.set('NOBODY_GROUP_NAME', nobody_group)
842 tty_gid = get_option('tty-gid')
843 conf.set('TTY_GID', tty_gid)
844 substs.set('TTY_GID', tty_gid)
846 #if 0 /// UNNEEDED by elogind
847 # # Ensure provided GID argument is numeric, otherwise fallback to default assignment
848 # if get_option('users-gid') != ''
849 # users_gid = get_option('users-gid').to_int()
853 # substs.set('USERS_GID', users_gid)
855 # if get_option('adm-group')
856 # m4_defines += ['-DENABLE_ADM_GROUP']
859 # if get_option('wheel-group')
860 # m4_defines += ['-DENABLE_WHEEL_GROUP']
863 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
864 # substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
867 kill_user_processes = get_option('default-kill-user-processes')
868 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
869 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
871 #if 0 /// UNNEEDED by elogind
872 # dns_servers = get_option('dns-servers')
873 # conf.set_quoted('DNS_SERVERS', dns_servers)
874 # substs.set('DNS_SERVERS', dns_servers)
876 # ntp_servers = get_option('ntp-servers')
877 # conf.set_quoted('NTP_SERVERS', ntp_servers)
878 # substs.set('NTP_SERVERS', ntp_servers)
881 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
883 #if 0 /// UNNEEDED by elogind
884 # substs.set('SUSHELL', get_option('debug-shell'))
885 # substs.set('DEBUGTTY', get_option('debug-tty'))
888 debug = get_option('debug')
889 enable_debug_hashmap = false
890 enable_debug_mmap_cache = false
891 #if 1 /// additional elogind debug mode
892 enable_debug_elogind = false
895 foreach name : debug.split(',')
897 enable_debug_hashmap = true
898 elif name == 'mmap-cache'
899 enable_debug_mmap_cache = true
900 #if 1 /// additional elogind debug mode
901 elif name == 'elogind'
902 enable_debug_elogind = true
905 message('unknown debug option "@0@", ignoring'.format(name))
909 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
910 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
911 #if 1 /// additional elogind debug mode
912 conf.set10('ENABLE_DEBUG_ELOGIND', enable_debug_elogind)
915 #####################################################################
917 threads = dependency('threads')
918 librt = cc.find_library('rt')
919 libm = cc.find_library('m')
920 libdl = cc.find_library('dl')
921 libcrypt = cc.find_library('crypt')
923 libcap = dependency('libcap', required : false)
924 if not libcap.found()
925 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
926 libcap = cc.find_library('cap')
929 #if 0 /// UNNEEDED by elogind
930 # libmount = dependency('mount',
931 # version : '>= 2.30',
932 # required : not fuzzer_build)
934 # want_seccomp = get_option('seccomp')
935 # if want_seccomp != 'false' and not fuzzer_build
936 # libseccomp = dependency('libseccomp',
937 # version : '>= 2.3.1',
938 # required : want_seccomp == 'true')
939 # have = libseccomp.found()
947 conf.set10('HAVE_SECCOMP', have)
948 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
950 want_selinux = get_option('selinux')
951 if want_selinux != 'false' and not fuzzer_build
952 libselinux = dependency('libselinux',
953 version : '>= 2.1.9',
954 required : want_selinux == 'true')
955 have = libselinux.found()
960 conf.set10('HAVE_SELINUX', have)
961 m4_defines += have ? ['-DHAVE_SELINUX'] : []
963 #if 0 /// UNNEEDED by elogind
964 # want_apparmor = get_option('apparmor')
965 # if want_apparmor != 'false' and not fuzzer_build
966 # libapparmor = dependency('libapparmor',
967 # required : want_apparmor == 'true')
968 # have = libapparmor.found()
976 conf.set10('HAVE_APPARMOR', have)
977 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
979 smack_run_label = get_option('smack-run-label')
980 if smack_run_label != ''
981 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
982 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
985 want_polkit = get_option('polkit')
986 install_polkit = false
987 install_polkit_pkla = false
988 if want_polkit != 'false' and not fuzzer_build
989 install_polkit = true
991 libpolkit = dependency('polkit-gobject-1',
993 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
994 message('Old polkit detected, will install pkla files')
995 install_polkit_pkla = true
998 conf.set10('ENABLE_POLKIT', install_polkit)
1000 want_acl = get_option('acl')
1001 if want_acl != 'false' and not fuzzer_build
1002 libacl = cc.find_library('acl', required : want_acl == 'true')
1003 have = libacl.found()
1008 conf.set10('HAVE_ACL', have)
1009 m4_defines += have ? ['-DHAVE_ACL'] : []
1011 want_audit = get_option('audit')
1012 if want_audit != 'false' and not fuzzer_build
1013 libaudit = dependency('audit', required : want_audit == 'true')
1014 have = libaudit.found()
1019 conf.set10('HAVE_AUDIT', have)
1021 #if 0 /// UNNEEDED by elogind
1022 # want_blkid = get_option('blkid')
1023 # if want_blkid != 'false' and not fuzzer_build
1024 # libblkid = dependency('blkid', required : want_blkid == 'true')
1025 # have = libblkid.found()
1030 # conf.set10('HAVE_BLKID', have)
1032 # want_kmod = get_option('kmod')
1033 # if want_kmod != 'false' and not fuzzer_build
1034 # libkmod = dependency('libkmod',
1035 # version : '>= 15',
1036 # required : want_kmod == 'true')
1037 # have = libkmod.found()
1042 # conf.set10('HAVE_KMOD', have)
1048 want_pam = get_option('pam')
1049 if want_pam != 'false' and not fuzzer_build
1050 libpam = cc.find_library('pam', required : want_pam == 'true')
1051 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1052 have = libpam.found() and libpam_misc.found()
1058 conf.set10('HAVE_PAM', have)
1059 m4_defines += have ? ['-DHAVE_PAM'] : []
1061 #if 0 /// UNNEEDED by elogind
1062 # want_microhttpd = get_option('microhttpd')
1063 # if want_microhttpd != 'false' and not fuzzer_build
1064 # libmicrohttpd = dependency('libmicrohttpd',
1065 # version : '>= 0.9.33',
1066 # required : want_microhttpd == 'true')
1067 # have = libmicrohttpd.found()
1070 # libmicrohttpd = []
1072 # conf.set10('HAVE_MICROHTTPD', have)
1073 # m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
1075 # want_libcryptsetup = get_option('libcryptsetup')
1076 # if want_libcryptsetup != 'false' and not fuzzer_build
1077 # libcryptsetup = dependency('libcryptsetup',
1078 # version : '>= 1.6.0',
1079 # required : want_libcryptsetup == 'true')
1080 # have = libcryptsetup.found()
1083 # libcryptsetup = []
1085 # conf.set10('HAVE_LIBCRYPTSETUP', have)
1087 # want_libcurl = get_option('libcurl')
1088 # if want_libcurl != 'false' and not fuzzer_build
1089 # libcurl = dependency('libcurl',
1090 # version : '>= 7.32.0',
1091 # required : want_libcurl == 'true')
1092 # have = libcurl.found()
1097 # conf.set10('HAVE_LIBCURL', have)
1098 # m4_defines += have ? ['-DHAVE_LIBCURL'] : []
1100 # want_libidn = get_option('libidn')
1101 # want_libidn2 = get_option('libidn2')
1102 # if want_libidn == 'true' and want_libidn2 == 'true'
1103 # error('libidn and libidn2 cannot be requested simultaneously')
1106 # if want_libidn != 'false' and want_libidn2 != 'true' and not fuzzer_build
1107 # libidn = dependency('libidn',
1108 # required : want_libidn == 'true')
1109 # have = libidn.found()
1114 # conf.set10('HAVE_LIBIDN', have)
1115 # m4_defines += have ? ['-DHAVE_LIBIDN'] : []
1116 # if not have and want_libidn2 != 'false' and not fuzzer_build
1117 # # libidn is used for both libidn and libidn2 objects
1118 # libidn = dependency('libidn2',
1119 # required : want_libidn2 == 'true')
1120 # have = libidn.found()
1124 # conf.set10('HAVE_LIBIDN2', have)
1125 # m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
1127 # want_libiptc = get_option('libiptc')
1128 # if want_libiptc != 'false' and not fuzzer_build
1129 # libiptc = dependency('libiptc',
1130 # required : want_libiptc == 'true')
1131 # have = libiptc.found()
1136 # conf.set10('HAVE_LIBIPTC', have)
1137 # m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
1139 # want_qrencode = get_option('qrencode')
1140 # if want_qrencode != 'false' and not fuzzer_build
1141 # libqrencode = dependency('libqrencode',
1142 # required : want_qrencode == 'true')
1143 # have = libqrencode.found()
1148 # conf.set10('HAVE_QRENCODE', have)
1150 # want_gcrypt = get_option('gcrypt')
1151 # if want_gcrypt != 'false' and not fuzzer_build
1152 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1153 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1154 # have = libgcrypt.found() and libgpg_error.found()
1159 # # link to neither of the libs if one is not found
1163 # conf.set10('HAVE_GCRYPT', have)
1165 # want_gnutls = get_option('gnutls')
1166 # if want_gnutls != 'false' and not fuzzer_build
1167 # libgnutls = dependency('gnutls',
1168 # version : '>= 3.1.4',
1169 # required : want_gnutls == 'true')
1170 # have = libgnutls.found()
1175 # conf.set10('HAVE_GNUTLS', have)
1177 # want_elfutils = get_option('elfutils')
1178 # if want_elfutils != 'false' and not fuzzer_build
1179 # libdw = dependency('libdw',
1180 # required : want_elfutils == 'true')
1181 # have = libdw.found()
1186 # conf.set10('HAVE_ELFUTILS', have)
1188 # want_zlib = get_option('zlib')
1189 # if want_zlib != 'false' and not fuzzer_build
1190 # libz = dependency('zlib',
1191 # required : want_zlib == 'true')
1192 # have = libz.found()
1197 # conf.set10('HAVE_ZLIB', have)
1199 # want_bzip2 = get_option('bzip2')
1200 # if want_bzip2 != 'false' and not fuzzer_build
1201 # libbzip2 = cc.find_library('bz2',
1202 # required : want_bzip2 == 'true')
1203 # have = libbzip2.found()
1208 # conf.set10('HAVE_BZIP2', have)
1210 # want_xz = get_option('xz')
1211 # if want_xz != 'false' and not fuzzer_build
1212 # libxz = dependency('liblzma',
1213 # required : want_xz == 'true')
1214 # have = libxz.found()
1219 # conf.set10('HAVE_XZ', have)
1221 # want_lz4 = get_option('lz4')
1222 # if want_lz4 != 'false' and not fuzzer_build
1223 # liblz4 = dependency('liblz4',
1224 # required : want_lz4 == 'true')
1225 # have = liblz4.found()
1230 # conf.set10('HAVE_LZ4', have)
1232 # want_xkbcommon = get_option('xkbcommon')
1233 # if want_xkbcommon != 'false' and not fuzzer_build
1234 # libxkbcommon = dependency('xkbcommon',
1235 # version : '>= 0.3.0',
1236 # required : want_xkbcommon == 'true')
1237 # have = libxkbcommon.found()
1259 conf.set10('HAVE_XKBCOMMON', have)
1261 want_pcre2 = get_option('pcre2')
1262 if want_pcre2 != 'false'
1263 libpcre2 = dependency('libpcre2-8',
1264 required : want_pcre2 == 'true')
1265 have = libpcre2.found()
1270 conf.set10('HAVE_PCRE2', have)
1272 want_glib = get_option('glib')
1273 if want_glib != 'false' and not fuzzer_build
1274 libglib = dependency('glib-2.0',
1275 version : '>= 2.22.0',
1276 required : want_glib == 'true')
1277 libgobject = dependency('gobject-2.0',
1278 version : '>= 2.22.0',
1279 required : want_glib == 'true')
1280 libgio = dependency('gio-2.0',
1281 required : want_glib == 'true')
1282 have = libglib.found() and libgobject.found() and libgio.found()
1289 conf.set10('HAVE_GLIB', have)
1291 want_dbus = get_option('dbus')
1292 if want_dbus != 'false' and not fuzzer_build
1293 libdbus = dependency('dbus-1',
1294 version : '>= 1.3.2',
1295 required : want_dbus == 'true')
1296 have = libdbus.found()
1301 conf.set10('HAVE_DBUS', have)
1303 #if 0 /// UNNEEDED by elogind
1304 # default_dnssec = get_option('default-dnssec')
1306 # default_dnssec = 'no'
1308 # if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1309 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1310 # default_dnssec = 'no'
1312 # conf.set('DEFAULT_DNSSEC_MODE',
1313 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1314 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1316 # want_importd = get_option('importd')
1317 # if want_importd != 'false'
1318 # have = (conf.get('HAVE_LIBCURL') == 1 and
1319 # conf.get('HAVE_ZLIB') == 1 and
1320 # conf.get('HAVE_BZIP2') == 1 and
1321 # conf.get('HAVE_XZ') == 1 and
1322 # conf.get('HAVE_GCRYPT') == 1)
1323 # if want_importd == 'true' and not have
1324 # error('importd support was requested, but dependencies are not available')
1329 # conf.set10('ENABLE_IMPORTD', have)
1331 # want_remote = get_option('remote')
1332 # if want_remote != 'false'
1333 # have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1334 # conf.get('HAVE_LIBCURL') == 1]
1335 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1336 # # it's possible to build one without the other. Complain only if
1337 # # support was explictly requested. The auxiliary files like sysusers
1338 # # config should be installed when any of the programs are built.
1339 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1340 # error('remote support was requested, but dependencies are not available')
1342 # have = have_deps[0] or have_deps[1]
1347 conf.set10('ENABLE_REMOTE', have)
1349 foreach term : ['utmp',
1350 #if 0 /// UNNEEDED by elogind
1384 have = get_option(term)
1385 name = 'ENABLE_' + term.underscorify().to_upper()
1386 conf.set10(name, have)
1387 m4_defines += have ? ['-D' + name] : []
1390 want_tests = get_option('tests')
1391 install_tests = get_option('install-tests')
1392 slow_tests = get_option('slow-tests')
1396 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
1398 #####################################################################
1400 #if 0 /// UNNEEDED by elogind
1401 # if get_option('efi')
1402 # efi_arch = host_machine.cpu_family()
1404 # if efi_arch == 'x86'
1405 # EFI_MACHINE_TYPE_NAME = 'ia32'
1406 # gnu_efi_arch = 'ia32'
1407 # elif efi_arch == 'x86_64'
1408 # EFI_MACHINE_TYPE_NAME = 'x64'
1409 # gnu_efi_arch = 'x86_64'
1410 # elif efi_arch == 'arm'
1411 # EFI_MACHINE_TYPE_NAME = 'arm'
1412 # gnu_efi_arch = 'arm'
1413 # elif efi_arch == 'aarch64'
1414 # EFI_MACHINE_TYPE_NAME = 'aa64'
1415 # gnu_efi_arch = 'aarch64'
1417 # EFI_MACHINE_TYPE_NAME = ''
1422 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1424 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1429 conf.set10('ENABLE_EFI', have)
1431 #####################################################################
1433 config_h = configure_file(
1434 output : 'config.h',
1435 configuration : conf)
1437 includes = include_directories('src/basic',
1440 #if 0 /// UNNEEDED by elogind
1446 #if 0 /// UNNEEDED by elogind
1451 #if 0 /// elogind has a different list
1452 # 'src/libsystemd/sd-bus',
1453 # 'src/libsystemd/sd-device',
1454 # 'src/libsystemd/sd-hwdb',
1455 # 'src/libsystemd/sd-id128',
1456 # 'src/libsystemd/sd-netlink',
1457 # 'src/libsystemd/sd-network',
1458 # 'src/libsystemd-network',
1461 'src/libelogind/sd-bus',
1462 'src/libelogind/sd-id128',
1467 add_project_arguments('-include', 'config.h', language : 'c')
1469 #if 0 /// UNNEEDED by elogind
1472 #if 0 /// UNNEEDED by elogind
1475 subdir('src/systemd')
1477 #if 0 /// UNNEEDED by elogind
1478 # subdir('src/libsystemd')
1479 # subdir('src/libsystemd-network')
1480 # subdir('src/journal')
1483 subdir('src/libelogind')
1485 subdir('src/update-utmp')
1489 #if 0 /// UNNEEDED by elogind
1490 # libjournal_core = static_library(
1492 # libjournal_core_sources,
1494 # include_directories : includes,
1497 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1498 # libsystemd = shared_library(
1500 # 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug
1501 # version : libsystemd_version,
1502 # include_directories : includes,
1503 # link_args : ['-shared',
1504 # '-Wl,--version-script=' + libsystemd_sym_path],
1505 # link_with : [libbasic,
1507 # link_whole : [libsystemd_static,
1508 # libjournal_client],
1509 # dependencies : [threads,
1513 # link_depends : libsystemd_sym,
1515 # install_dir : rootlibdir)
1517 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1518 libelogind = shared_library(
1520 libelogind_internal_sources,
1521 version : libelogind_version,
1522 include_directories : includes,
1523 link_args : ['-shared',
1524 '-Wl,--version-script=' + libelogind_sym_path],
1525 link_with : [libbasic],
1526 dependencies : [threads],
1527 link_depends : libelogind_sym,
1529 install_dir : rootlibdir)
1532 ############################################################
1534 # binaries that have --help and are intended for use by humans,
1535 # usually, but not always, installed in /bin.
1536 public_programs = []
1538 #if 0 /// UNNEEDED by elogind
1539 # subdir('src/libudev')
1541 # elogind depends on external libudev:
1542 libudev = dependency('libudev', required : true)
1544 subdir('src/shared')
1545 #if 0 /// UNNEEDED by elogind
1546 # subdir('src/core')
1547 # subdir('src/udev')
1548 # subdir('src/network')
1550 # subdir('src/analyze')
1551 # subdir('src/journal-remote')
1552 # subdir('src/coredump')
1553 # subdir('src/hostname')
1554 # subdir('src/import')
1555 # subdir('src/kernel-install')
1556 # subdir('src/locale')
1557 # subdir('src/machine')
1558 # subdir('src/nspawn')
1559 # subdir('src/resolve')
1560 # subdir('src/timedate')
1561 # subdir('src/timesync')
1562 # subdir('src/vconsole')
1563 # subdir('src/boot/efi')
1568 #if 0 /// UNNEEDED in elogind
1573 ############################################################
1575 # only static linking apart from libdl, to make sure that the
1576 # module is linked to all libraries that it uses.
1577 test_dlopen = executable(
1580 include_directories : includes,
1581 link_with : [libbasic],
1582 dependencies : [libdl])
1584 #if 0 /// UNNEEDED by elogind
1585 # foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1586 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1587 # ['mymachines', 'ENABLE_MACHINED'],
1588 # ['resolve', 'ENABLE_RESOLVE']]
1590 # condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1594 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1595 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1597 # nss = shared_library(
1599 # 'src/nss-@0@/nss-@0@.c'.format(module),
1601 # include_directories : includes,
1602 # # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1603 # link_args : ['-Wl,-z,nodelete',
1605 # '-Wl,--version-script=' + version_script_arg,
1606 # '-Wl,--undefined'],
1607 # link_with : [libsystemd_static,
1609 # dependencies : [threads,
1611 # link_depends : sym,
1613 # install_dir : rootlibdir)
1615 # # We cannot use shared_module because it does not support version suffix.
1616 # # Unfortunately shared_library insists on creating the symlink…
1617 # meson.add_install_script('sh', '-c',
1618 # 'rm $DESTDIR@0@/libnss_@1@.so'
1619 # .format(rootlibdir, module))
1621 # test('dlopen-nss_' + module,
1623 # args : [nss.full_path()]) # path to dlopen must include a slash
1628 ############################################################
1630 #if 0 /// UNNEEDED by elogind
1631 # executable('systemd',
1633 # include_directories : includes,
1634 # link_with : [libcore,
1636 # dependencies : [threads,
1642 # install_rpath : rootlibexecdir,
1644 # install_dir : rootlibexecdir)
1646 # exe = executable('systemd-analyze',
1647 # systemd_analyze_sources,
1648 # include_directories : includes,
1649 # link_with : [libcore,
1651 # dependencies : [threads,
1657 # install_rpath : rootlibexecdir,
1659 # public_programs += [exe]
1661 # executable('systemd-journald',
1662 # systemd_journald_sources,
1663 # include_directories : includes,
1664 # link_with : [libjournal_core,
1666 # dependencies : [threads,
1670 # install_rpath : rootlibexecdir,
1672 # install_dir : rootlibexecdir)
1674 # exe = executable('systemd-cat',
1675 # systemd_cat_sources,
1676 # include_directories : includes,
1677 # link_with : [libjournal_core,
1679 # dependencies : [threads],
1680 # install_rpath : rootlibexecdir,
1682 # public_programs += [exe]
1684 # exe = executable('journalctl',
1685 # journalctl_sources,
1686 # include_directories : includes,
1687 # link_with : [libshared],
1688 # dependencies : [threads,
1693 # install_rpath : rootlibexecdir,
1695 # install_dir : rootbindir)
1696 # public_programs += [exe]
1698 # executable('systemd-getty-generator',
1699 # 'src/getty-generator/getty-generator.c',
1700 # include_directories : includes,
1701 # link_with : [libshared],
1702 # install_rpath : rootlibexecdir,
1704 # install_dir : systemgeneratordir)
1706 # executable('systemd-debug-generator',
1707 # 'src/debug-generator/debug-generator.c',
1708 # include_directories : includes,
1709 # link_with : [libshared],
1710 # install_rpath : rootlibexecdir,
1712 # install_dir : systemgeneratordir)
1714 # executable('systemd-fstab-generator',
1715 # 'src/fstab-generator/fstab-generator.c',
1716 # 'src/core/mount-setup.c',
1717 # include_directories : includes,
1718 # link_with : [libshared],
1719 # install_rpath : rootlibexecdir,
1721 # install_dir : systemgeneratordir)
1723 # if conf.get('ENABLE_ENVIRONMENT_D') == 1
1724 # executable('30-systemd-environment-d-generator',
1725 # 'src/environment-d-generator/environment-d-generator.c',
1726 # include_directories : includes,
1727 # link_with : [libshared],
1728 # install_rpath : rootlibexecdir,
1730 # install_dir : userenvgeneratordir)
1732 # meson.add_install_script(meson_make_symlink,
1733 # join_paths(sysconfdir, 'environment'),
1734 # join_paths(environmentdir, '99-environment.conf'))
1737 # if conf.get('ENABLE_HIBERNATE') == 1
1738 # executable('systemd-hibernate-resume-generator',
1739 # 'src/hibernate-resume/hibernate-resume-generator.c',
1740 # include_directories : includes,
1741 # link_with : [libshared],
1742 # install_rpath : rootlibexecdir,
1744 # install_dir : systemgeneratordir)
1746 # executable('systemd-hibernate-resume',
1747 # 'src/hibernate-resume/hibernate-resume.c',
1748 # include_directories : includes,
1749 # link_with : [libshared],
1750 # install_rpath : rootlibexecdir,
1752 # install_dir : rootlibexecdir)
1755 # if conf.get('HAVE_BLKID') == 1
1756 # executable('systemd-gpt-auto-generator',
1757 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1758 # 'src/basic/blkid-util.h',
1759 # include_directories : includes,
1760 # link_with : [libshared],
1761 # dependencies : libblkid,
1762 # install_rpath : rootlibexecdir,
1764 # install_dir : systemgeneratordir)
1766 # exe = executable('systemd-dissect',
1767 # 'src/dissect/dissect.c',
1768 # include_directories : includes,
1769 # link_with : [libshared],
1770 # install_rpath : rootlibexecdir,
1772 # install_dir : rootlibexecdir)
1773 # public_programs += [exe]
1776 # if conf.get('ENABLE_RESOLVE') == 1
1777 # executable('systemd-resolved',
1778 # systemd_resolved_sources,
1779 # include_directories : includes,
1780 # link_with : [libshared,
1782 # libsystemd_resolve_core],
1783 # dependencies : [threads,
1787 # install_rpath : rootlibexecdir,
1789 # install_dir : rootlibexecdir)
1791 # exe = executable('systemd-resolve',
1792 # systemd_resolve_sources,
1793 # include_directories : includes,
1794 # link_with : [libshared,
1796 # libsystemd_resolve_core],
1797 # dependencies : [threads,
1801 # install_rpath : rootlibexecdir,
1803 # public_programs += [exe]
1806 # if conf.get('ENABLE_LOGIND') == 1
1807 # executable('systemd-logind',
1808 # systemd_logind_sources,
1809 # include_directories : includes,
1810 # link_with : [liblogind_core,
1812 # dependencies : [threads,
1814 # install_rpath : rootlibexecdir,
1816 # install_dir : rootlibexecdir)
1818 # exe = executable('loginctl',
1820 # include_directories : includes,
1821 # link_with : [libshared],
1822 # dependencies : [threads,
1825 # install_rpath : rootlibexecdir,
1827 # install_dir : rootbindir)
1828 # public_programs += [exe]
1830 # exe = executable('systemd-inhibit',
1831 # 'src/login/inhibit.c',
1832 # include_directories : includes,
1833 # link_with : [libshared],
1834 # install_rpath : rootlibexecdir,
1836 # install_dir : rootbindir)
1837 # public_programs += [exe]
1839 # if conf.get('HAVE_PAM') == 1
1840 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1841 # pam_systemd = shared_library(
1845 # include_directories : includes,
1846 # link_args : ['-shared',
1847 # '-Wl,--version-script=' + version_script_arg],
1848 # link_with : [libsystemd_static,
1849 # libshared_static],
1850 # dependencies : [threads,
1853 # link_depends : pam_systemd_sym,
1855 # install_dir : pamlibdir)
1857 # test('dlopen-pam_systemd',
1859 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1864 executable('elogind',
1866 include_directories : includes,
1867 link_with : [liblogind_core,
1869 dependencies : [threads,
1872 install_rpath : rootlibexecdir,
1874 install_dir : rootlibexecdir)
1876 exe = executable('loginctl',
1878 include_directories : includes,
1879 link_with : [libshared],
1880 dependencies : [threads,
1882 install_rpath : rootlibexecdir,
1884 install_dir : rootbindir)
1885 public_programs += [exe]
1887 exe = executable('elogind-inhibit',
1888 'src/login/inhibit.c',
1889 include_directories : includes,
1890 link_with : [libshared],
1891 dependencies : [threads],
1892 install_rpath : rootlibexecdir,
1894 install_dir : rootbindir)
1895 public_programs += [exe]
1897 if conf.get('HAVE_PAM') == 1
1898 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1899 pam_elogind = shared_library(
1903 include_directories : includes,
1904 link_args : ['-shared',
1905 '-Wl,--version-script=' + version_script_arg],
1906 link_with : [libelogind,
1908 dependencies : [threads,
1911 link_depends : pam_elogind_sym,
1913 install_dir : pamlibdir)
1915 test('dlopen-pam_elogind',
1917 args : [pam_elogind.full_path()]) # path to dlopen must include a slash
1920 #if 0 /// UNNEEDED by elogind
1921 # executable('systemd-user-sessions',
1922 # 'src/user-sessions/user-sessions.c',
1923 # include_directories : includes,
1924 # link_with : [libshared],
1925 # install_rpath : rootlibexecdir,
1927 # install_dir : rootlibexecdir)
1930 # if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1931 # exe = executable('bootctl',
1932 # 'src/boot/bootctl.c',
1933 # include_directories : includes,
1934 # link_with : [libshared],
1935 # dependencies : [libblkid],
1936 # install_rpath : rootlibexecdir,
1938 # public_programs += [exe]
1941 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1942 # include_directories : includes,
1943 # link_with : [libshared],
1944 # dependencies : [threads],
1945 # install_rpath : rootlibexecdir,
1947 # public_programs += [exe]
1949 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1950 # include_directories : includes,
1951 # link_with : [libshared],
1952 # dependencies : [threads,
1957 # install_rpath : rootlibexecdir,
1959 # install_dir : rootbindir)
1960 # public_programs += [exe]
1962 # if conf.get('ENABLE_BACKLIGHT') == 1
1963 # executable('systemd-backlight',
1964 # 'src/backlight/backlight.c',
1965 # include_directories : includes,
1966 # link_with : [libshared],
1967 # install_rpath : rootlibexecdir,
1969 # install_dir : rootlibexecdir)
1972 # if conf.get('ENABLE_RFKILL') == 1
1973 # executable('systemd-rfkill',
1974 # 'src/rfkill/rfkill.c',
1975 # include_directories : includes,
1976 # link_with : [libshared],
1977 # install_rpath : rootlibexecdir,
1979 # install_dir : rootlibexecdir)
1982 # executable('systemd-system-update-generator',
1983 # 'src/system-update-generator/system-update-generator.c',
1984 # include_directories : includes,
1985 # link_with : [libshared],
1986 # install_rpath : rootlibexecdir,
1988 # install_dir : systemgeneratordir)
1990 # if conf.get('HAVE_LIBCRYPTSETUP') == 1
1991 # executable('systemd-cryptsetup',
1992 # 'src/cryptsetup/cryptsetup.c',
1993 # include_directories : includes,
1994 # link_with : [libshared],
1995 # dependencies : [libcryptsetup],
1996 # install_rpath : rootlibexecdir,
1998 # install_dir : rootlibexecdir)
2000 # executable('systemd-cryptsetup-generator',
2001 # 'src/cryptsetup/cryptsetup-generator.c',
2002 # include_directories : includes,
2003 # link_with : [libshared],
2004 # dependencies : [libcryptsetup],
2005 # install_rpath : rootlibexecdir,
2007 # install_dir : systemgeneratordir)
2009 # executable('systemd-veritysetup',
2010 # 'src/veritysetup/veritysetup.c',
2011 # include_directories : includes,
2012 # link_with : [libshared],
2013 # dependencies : [libcryptsetup],
2014 # install_rpath : rootlibexecdir,
2016 # install_dir : rootlibexecdir)
2018 # executable('systemd-veritysetup-generator',
2019 # 'src/veritysetup/veritysetup-generator.c',
2020 # include_directories : includes,
2021 # link_with : [libshared],
2022 # dependencies : [libcryptsetup],
2023 # install_rpath : rootlibexecdir,
2025 # install_dir : systemgeneratordir)
2028 # if conf.get('HAVE_SYSV_COMPAT') == 1
2029 # executable('systemd-sysv-generator',
2030 # 'src/sysv-generator/sysv-generator.c',
2031 # include_directories : includes,
2032 # link_with : [libshared],
2033 # install_rpath : rootlibexecdir,
2035 # install_dir : systemgeneratordir)
2037 # executable('systemd-rc-local-generator',
2038 # 'src/rc-local-generator/rc-local-generator.c',
2039 # include_directories : includes,
2040 # link_with : [libshared],
2041 # install_rpath : rootlibexecdir,
2043 # install_dir : systemgeneratordir)
2046 # if conf.get('ENABLE_HOSTNAMED') == 1
2047 # executable('systemd-hostnamed',
2048 # 'src/hostname/hostnamed.c',
2049 # include_directories : includes,
2050 # link_with : [libshared],
2051 # install_rpath : rootlibexecdir,
2053 # install_dir : rootlibexecdir)
2055 # exe = executable('hostnamectl',
2056 # 'src/hostname/hostnamectl.c',
2057 # include_directories : includes,
2058 # link_with : [libshared],
2059 # install_rpath : rootlibexecdir,
2061 # public_programs += [exe]
2064 # if conf.get('ENABLE_LOCALED') == 1
2065 # if conf.get('HAVE_XKBCOMMON') == 1
2066 # # logind will load libxkbcommon.so dynamically on its own
2072 # executable('systemd-localed',
2073 # systemd_localed_sources,
2074 # include_directories : includes,
2075 # link_with : [libshared],
2076 # dependencies : deps,
2077 # install_rpath : rootlibexecdir,
2079 # install_dir : rootlibexecdir)
2081 # exe = executable('localectl',
2082 # localectl_sources,
2083 # include_directories : includes,
2084 # link_with : [libshared],
2085 # install_rpath : rootlibexecdir,
2087 # public_programs += [exe]
2090 # if conf.get('ENABLE_TIMEDATED') == 1
2091 # executable('systemd-timedated',
2092 # 'src/timedate/timedated.c',
2093 # include_directories : includes,
2094 # link_with : [libshared],
2095 # install_rpath : rootlibexecdir,
2097 # install_dir : rootlibexecdir)
2099 # exe = executable('timedatectl',
2100 # 'src/timedate/timedatectl.c',
2101 # include_directories : includes,
2102 # install_rpath : rootlibexecdir,
2103 # link_with : [libshared],
2105 # public_programs += [exe]
2108 # if conf.get('ENABLE_TIMESYNCD') == 1
2109 # executable('systemd-timesyncd',
2110 # systemd_timesyncd_sources,
2111 # include_directories : includes,
2112 # link_with : [libshared],
2113 # dependencies : [threads,
2115 # install_rpath : rootlibexecdir,
2117 # install_dir : rootlibexecdir)
2120 # if conf.get('ENABLE_MACHINED') == 1
2121 # executable('systemd-machined',
2122 # systemd_machined_sources,
2123 # include_directories : includes,
2124 # link_with : [libmachine_core,
2126 # install_rpath : rootlibexecdir,
2128 # install_dir : rootlibexecdir)
2130 # exe = executable('machinectl',
2131 # 'src/machine/machinectl.c',
2132 # include_directories : includes,
2133 # link_with : [libshared],
2134 # dependencies : [threads,
2137 # install_rpath : rootlibexecdir,
2139 # install_dir : rootbindir)
2140 # public_programs += [exe]
2143 # if conf.get('ENABLE_IMPORTD') == 1
2144 # executable('systemd-importd',
2145 # systemd_importd_sources,
2146 # include_directories : includes,
2147 # link_with : [libshared],
2148 # dependencies : [threads],
2149 # install_rpath : rootlibexecdir,
2151 # install_dir : rootlibexecdir)
2153 # systemd_pull = executable('systemd-pull',
2154 # systemd_pull_sources,
2155 # include_directories : includes,
2156 # link_with : [libshared],
2157 # dependencies : [libcurl,
2162 # install_rpath : rootlibexecdir,
2164 # install_dir : rootlibexecdir)
2166 # systemd_import = executable('systemd-import',
2167 # systemd_import_sources,
2168 # include_directories : includes,
2169 # link_with : [libshared],
2170 # dependencies : [libcurl,
2174 # install_rpath : rootlibexecdir,
2176 # install_dir : rootlibexecdir)
2178 # systemd_export = executable('systemd-export',
2179 # systemd_export_sources,
2180 # include_directories : includes,
2181 # link_with : [libshared],
2182 # dependencies : [libcurl,
2186 # install_rpath : rootlibexecdir,
2188 # install_dir : rootlibexecdir)
2189 # public_programs += [systemd_pull, systemd_import, systemd_export]
2192 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2193 # exe = executable('systemd-journal-upload',
2194 # systemd_journal_upload_sources,
2195 # include_directories : includes,
2196 # link_with : [libshared],
2197 # dependencies : [threads,
2202 # install_rpath : rootlibexecdir,
2204 # install_dir : rootlibexecdir)
2205 # public_programs += [exe]
2208 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2209 # s_j_remote = executable('systemd-journal-remote',
2210 # systemd_journal_remote_sources,
2211 # include_directories : includes,
2212 # link_with : [libshared],
2213 # dependencies : [threads,
2218 # install_rpath : rootlibexecdir,
2220 # install_dir : rootlibexecdir)
2222 # s_j_gatewayd = executable('systemd-journal-gatewayd',
2223 # systemd_journal_gatewayd_sources,
2224 # include_directories : includes,
2225 # link_with : [libshared],
2226 # dependencies : [threads,
2231 # install_rpath : rootlibexecdir,
2233 # install_dir : rootlibexecdir)
2234 # public_programs += [s_j_remote, s_j_gatewayd]
2237 # if conf.get('ENABLE_COREDUMP') == 1
2238 # executable('systemd-coredump',
2239 # systemd_coredump_sources,
2240 # include_directories : includes,
2241 # link_with : [libshared],
2242 # dependencies : [threads,
2247 # install_rpath : rootlibexecdir,
2249 # install_dir : rootlibexecdir)
2251 # exe = executable('coredumpctl',
2252 # coredumpctl_sources,
2253 # include_directories : includes,
2254 # link_with : [libshared],
2255 # dependencies : [threads,
2258 # install_rpath : rootlibexecdir,
2260 # public_programs += [exe]
2263 # if conf.get('ENABLE_BINFMT') == 1
2264 # exe = executable('systemd-binfmt',
2265 # 'src/binfmt/binfmt.c',
2266 # include_directories : includes,
2267 # link_with : [libshared],
2268 # install_rpath : rootlibexecdir,
2270 # install_dir : rootlibexecdir)
2271 # public_programs += [exe]
2273 # meson.add_install_script('sh', '-c',
2274 # mkdir_p.format(binfmtdir))
2275 # meson.add_install_script('sh', '-c',
2276 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2279 # if conf.get('ENABLE_VCONSOLE') == 1
2280 # executable('systemd-vconsole-setup',
2281 # 'src/vconsole/vconsole-setup.c',
2282 # include_directories : includes,
2283 # link_with : [libshared],
2284 # install_rpath : rootlibexecdir,
2286 # install_dir : rootlibexecdir)
2289 # if conf.get('ENABLE_RANDOMSEED') == 1
2290 # executable('systemd-random-seed',
2291 # 'src/random-seed/random-seed.c',
2292 # include_directories : includes,
2293 # link_with : [libshared],
2294 # install_rpath : rootlibexecdir,
2296 # install_dir : rootlibexecdir)
2299 # if conf.get('ENABLE_FIRSTBOOT') == 1
2300 # executable('systemd-firstboot',
2301 # 'src/firstboot/firstboot.c',
2302 # include_directories : includes,
2303 # link_with : [libshared],
2304 # dependencies : [libcrypt],
2305 # install_rpath : rootlibexecdir,
2307 # install_dir : rootbindir)
2310 # executable('systemd-remount-fs',
2311 # 'src/remount-fs/remount-fs.c',
2312 # 'src/core/mount-setup.c',
2313 # 'src/core/mount-setup.h',
2314 # include_directories : includes,
2315 # link_with : [libshared],
2316 # install_rpath : rootlibexecdir,
2318 # install_dir : rootlibexecdir)
2320 # executable('systemd-machine-id-setup',
2321 # 'src/machine-id-setup/machine-id-setup-main.c',
2322 # 'src/core/machine-id-setup.c',
2323 # 'src/core/machine-id-setup.h',
2324 # include_directories : includes,
2325 # link_with : [libshared],
2326 # install_rpath : rootlibexecdir,
2328 # install_dir : rootbindir)
2330 # executable('systemd-fsck',
2331 # 'src/fsck/fsck.c',
2332 # include_directories : includes,
2333 # link_with : [libshared],
2334 # install_rpath : rootlibexecdir,
2336 # install_dir : rootlibexecdir)
2338 # executable('elogind-growfs',
2339 # 'src/partition/growfs.c',
2340 # include_directories : includes,
2341 # link_with : [libshared],
2342 # dependencies : [libcryptsetup],
2343 # install_rpath : rootlibexecdir,
2345 # install_dir : rootlibexecdir)
2347 # executable('elogind-makefs',
2348 # 'src/partition/makefs.c',
2349 # include_directories : includes,
2350 # link_with : [libshared],
2351 # install_rpath : rootlibexecdir,
2353 # install_dir : rootlibexecdir)
2355 # executable('systemd-sleep',
2356 # 'src/sleep/sleep.c',
2357 # include_directories : includes,
2358 # link_with : [libshared],
2359 # install_rpath : rootlibexecdir,
2361 # install_dir : rootlibexecdir)
2363 # exe = executable('systemd-sysctl',
2364 # 'src/sysctl/sysctl.c',
2365 # include_directories : includes,
2366 # link_with : [libshared],
2367 # install_rpath : rootlibexecdir,
2369 # install_dir : rootlibexecdir)
2370 # public_programs += [exe]
2372 # executable('systemd-ac-power',
2373 # 'src/ac-power/ac-power.c',
2374 # include_directories : includes,
2375 # link_with : [libshared],
2376 # install_rpath : rootlibexecdir,
2378 # install_dir : rootlibexecdir)
2380 # exe = executable('systemd-detect-virt',
2381 # 'src/detect-virt/detect-virt.c',
2382 # include_directories : includes,
2383 # link_with : [libshared],
2384 # install_rpath : rootlibexecdir,
2386 # public_programs += [exe]
2388 # exe = executable('systemd-delta',
2389 # 'src/delta/delta.c',
2390 # include_directories : includes,
2391 # link_with : [libshared],
2392 # install_rpath : rootlibexecdir,
2394 # public_programs += [exe]
2396 # exe = executable('systemd-escape',
2397 # 'src/escape/escape.c',
2398 # include_directories : includes,
2399 # link_with : [libshared],
2400 # install_rpath : rootlibexecdir,
2402 # install_dir : rootbindir)
2403 # public_programs += [exe]
2405 # exe = executable('systemd-notify',
2406 # 'src/notify/notify.c',
2407 # include_directories : includes,
2408 # link_with : [libshared],
2409 # install_rpath : rootlibexecdir,
2411 # install_dir : rootbindir)
2412 # public_programs += [exe]
2414 # executable('systemd-volatile-root',
2415 # 'src/volatile-root/volatile-root.c',
2416 # include_directories : includes,
2417 # link_with : [libshared],
2418 # install_rpath : rootlibexecdir,
2420 # install_dir : rootlibexecdir)
2422 # executable('systemd-cgroups-agent',
2423 # 'src/cgroups-agent/cgroups-agent.c',
2424 # include_directories : includes,
2425 # link_with : [libshared],
2426 # install_rpath : rootlibexecdir,
2428 # install_dir : rootlibexecdir)
2430 executable('elogind-cgroups-agent',
2431 'src/cgroups-agent/cgroups-agent.c',
2432 include_directories : includes,
2433 link_with : [libshared_static],
2434 install_rpath : rootlibexecdir,
2436 install_dir : rootlibexecdir)
2439 #if 0 /// UNNEEDED by elogind
2440 # exe = executable('systemd-path',
2441 # 'src/path/path.c',
2442 # include_directories : includes,
2443 # link_with : [libshared],
2444 # install_rpath : rootlibexecdir,
2446 # public_programs += [exe]
2448 # exe = executable('systemd-ask-password',
2449 # 'src/ask-password/ask-password.c',
2450 # include_directories : includes,
2451 # link_with : [libshared],
2452 # install_rpath : rootlibexecdir,
2454 # install_dir : rootbindir)
2455 # public_programs += [exe]
2457 # executable('systemd-reply-password',
2458 # 'src/reply-password/reply-password.c',
2459 # include_directories : includes,
2460 # link_with : [libshared],
2461 # install_rpath : rootlibexecdir,
2463 # install_dir : rootlibexecdir)
2465 # exe = executable('systemd-tty-ask-password-agent',
2466 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2467 # include_directories : includes,
2468 # link_with : [libshared],
2469 # install_rpath : rootlibexecdir,
2471 # install_dir : rootbindir)
2472 # public_programs += [exe]
2474 # exe = executable('systemd-cgls',
2475 # 'src/cgls/cgls.c',
2476 # include_directories : includes,
2477 # link_with : [libshared],
2478 # install_rpath : rootlibexecdir,
2480 # public_programs += [exe]
2482 # exe = executable('systemd-cgtop',
2483 # 'src/cgtop/cgtop.c',
2484 # include_directories : includes,
2485 # link_with : [libshared],
2486 # install_rpath : rootlibexecdir,
2488 # public_programs += [exe]
2490 # executable('systemd-initctl',
2491 # 'src/initctl/initctl.c',
2492 # include_directories : includes,
2493 # link_with : [libshared],
2494 # install_rpath : rootlibexecdir,
2496 # install_dir : rootlibexecdir)
2498 # exe = executable('systemd-mount',
2499 # 'src/mount/mount-tool.c',
2500 # include_directories : includes,
2501 # link_with : [libshared],
2502 # install_rpath : rootlibexecdir,
2504 # public_programs += [exe]
2506 # meson.add_install_script(meson_make_symlink,
2507 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2509 # exe = executable('systemd-run',
2511 # include_directories : includes,
2512 # link_with : [libshared],
2513 # install_rpath : rootlibexecdir,
2515 # public_programs += [exe]
2517 # exe = executable('systemd-stdio-bridge',
2518 # 'src/stdio-bridge/stdio-bridge.c',
2519 # include_directories : includes,
2520 # link_with : [libshared],
2521 # install_rpath : rootlibexecdir,
2523 # public_programs += [exe]
2525 # exe = executable('busctl',
2526 # 'src/busctl/busctl.c',
2527 # 'src/busctl/busctl-introspect.c',
2528 # 'src/busctl/busctl-introspect.h',
2529 # include_directories : includes,
2530 # link_with : [libshared],
2531 # install_rpath : rootlibexecdir,
2533 # public_programs += [exe]
2535 # if conf.get('ENABLE_SYSUSERS') == 1
2536 # exe = executable('systemd-sysusers',
2537 # 'src/sysusers/sysusers.c',
2538 # include_directories : includes,
2539 # link_with : [libshared],
2540 # install_rpath : rootlibexecdir,
2542 # install_dir : rootbindir)
2543 # public_programs += [exe]
2546 # if conf.get('ENABLE_TMPFILES') == 1
2547 # exe = executable('systemd-tmpfiles',
2548 # 'src/tmpfiles/tmpfiles.c',
2549 # include_directories : includes,
2550 # link_with : [libshared],
2551 # dependencies : [libacl],
2552 # install_rpath : rootlibexecdir,
2554 # install_dir : rootbindir)
2555 # public_programs += [exe]
2557 # test('test-systemd-tmpfiles',
2558 # test_systemd_tmpfiles_py,
2559 # args : exe.full_path())
2560 # # https://github.com/mesonbuild/meson/issues/2681
2563 # if conf.get('ENABLE_HWDB') == 1
2564 # exe = executable('systemd-hwdb',
2565 # 'src/hwdb/hwdb.c',
2566 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2567 # include_directories : includes,
2568 # link_with : [libudev_static],
2569 # install_rpath : udev_rpath,
2571 # install_dir : rootbindir)
2572 # public_programs += [exe]
2575 # if conf.get('ENABLE_QUOTACHECK') == 1
2576 # executable('systemd-quotacheck',
2577 # 'src/quotacheck/quotacheck.c',
2578 # include_directories : includes,
2579 # link_with : [libshared],
2580 # install_rpath : rootlibexecdir,
2582 # install_dir : rootlibexecdir)
2585 # exe = executable('systemd-socket-proxyd',
2586 # 'src/socket-proxy/socket-proxyd.c',
2587 # include_directories : includes,
2588 # link_with : [libshared],
2589 # dependencies : [threads],
2590 # install_rpath : rootlibexecdir,
2592 # install_dir : rootlibexecdir)
2593 # public_programs += [exe]
2595 # exe = executable('systemd-udevd',
2596 # systemd_udevd_sources,
2597 # include_directories : includes,
2598 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2599 # link_with : [libudev_core,
2600 # libsystemd_network,
2602 # dependencies : [threads,
2607 # install_rpath : udev_rpath,
2609 # install_dir : rootlibexecdir)
2610 # public_programs += [exe]
2612 # exe = executable('udevadm',
2614 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2615 # include_directories : includes,
2616 # link_with : [libudev_core,
2617 # libsystemd_network,
2619 # dependencies : [threads,
2624 # install_rpath : udev_rpath,
2626 # install_dir : rootbindir)
2627 # public_programs += [exe]
2629 # executable('systemd-shutdown',
2630 # systemd_shutdown_sources,
2631 # include_directories : includes,
2632 # link_with : [libshared],
2633 # install_rpath : rootlibexecdir,
2635 # install_dir : rootlibexecdir)
2637 # executable('systemd-update-done',
2638 # 'src/update-done/update-done.c',
2639 # include_directories : includes,
2640 # link_with : [libshared],
2641 # install_rpath : rootlibexecdir,
2643 # install_dir : rootlibexecdir)
2645 # executable('systemd-update-utmp',
2646 # 'src/update-utmp/update-utmp.c',
2647 # include_directories : includes,
2648 # link_with : [libshared],
2649 # dependencies : [libaudit],
2650 # install_rpath : rootlibexecdir,
2652 # install_dir : rootlibexecdir)
2654 # if conf.get('HAVE_KMOD') == 1
2655 # executable('systemd-modules-load',
2656 # 'src/modules-load/modules-load.c',
2657 # include_directories : includes,
2658 # link_with : [libshared],
2659 # dependencies : [libkmod],
2660 # install_rpath : rootlibexecdir,
2662 # install_dir : rootlibexecdir)
2664 # meson.add_install_script('sh', '-c',
2665 # mkdir_p.format(modulesloaddir))
2666 # meson.add_install_script('sh', '-c',
2667 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2670 # exe = executable('systemd-nspawn',
2671 # systemd_nspawn_sources,
2672 # 'src/core/mount-setup.c', # FIXME: use a variable?
2673 # 'src/core/mount-setup.h',
2674 # 'src/core/loopback-setup.c',
2675 # 'src/core/loopback-setup.h',
2676 # include_directories : [includes, include_directories('src/nspawn')],
2677 # link_with : [libshared],
2678 # dependencies : [libacl,
2682 # install_rpath : rootlibexecdir,
2684 # public_programs += [exe]
2686 # if conf.get('ENABLE_NETWORKD') == 1
2687 # executable('systemd-networkd',
2688 # systemd_networkd_sources,
2689 # include_directories : includes,
2690 # link_with : [libnetworkd_core,
2691 # libsystemd_network,
2694 # dependencies : [threads],
2695 # install_rpath : rootlibexecdir,
2697 # install_dir : rootlibexecdir)
2699 # executable('systemd-networkd-wait-online',
2700 # systemd_networkd_wait_online_sources,
2701 # include_directories : includes,
2702 # link_with : [libnetworkd_core,
2704 # install_rpath : rootlibexecdir,
2706 # install_dir : rootlibexecdir)
2708 # exe = executable('networkctl',
2709 # networkctl_sources,
2710 # include_directories : includes,
2711 # link_with : [libsystemd_network,
2713 # install_rpath : rootlibexecdir,
2715 # install_dir : rootbindir)
2716 # public_programs += [exe]
2719 # executable('systemd-sulogin-shell',
2720 # ['src/sulogin-shell/sulogin-shell.c'],
2721 # include_directories : includes,
2722 # link_with : [libshared],
2723 # install_rpath : rootlibexecdir,
2725 # install_dir : rootlibexecdir)
2727 executable('elogind-uaccess-command',
2728 'src/uaccess-command/uaccess-command.c',
2729 include_directories : includes,
2730 link_with : [liblogind_core,
2732 dependencies: [libacl,
2734 install_rpath : rootlibexecdir,
2736 install_dir : rootlibexecdir)
2739 ############################################################
2741 foreach tuple : tests
2743 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2744 dependencies = tuple[2]
2745 condition = tuple.length() >= 4 ? tuple[3] : ''
2746 type = tuple.length() >= 5 ? tuple[4] : ''
2747 defs = tuple.length() >= 6 ? tuple[5] : []
2748 incs = tuple.length() >= 7 ? tuple[6] : includes
2751 name = sources[0].split('/')[-1].split('.')[0]
2752 if type.startswith('timeout=')
2753 timeout = type.split('=')[1].to_int()
2756 if want_tests == 'false'
2757 message('Not compiling @0@ because tests is set to false'.format(name))
2758 elif condition == '' or conf.get(condition) == 1
2762 include_directories : incs,
2763 link_with : link_with,
2764 dependencies : dependencies,
2766 install_rpath : rootlibexecdir,
2767 install : install_tests,
2768 install_dir : join_paths(testsdir, type))
2771 message('@0@ is a manual test'.format(name))
2772 elif type == 'unsafe' and want_tests != 'unsafe'
2773 message('@0@ is an unsafe test'.format(name))
2780 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2784 #if 0 /// UNNEEDED by elogind
2785 # test_libsystemd_sym = executable(
2786 # 'test-libsystemd-sym',
2787 # test_libsystemd_sym_c,
2788 # include_directories : includes,
2789 # link_with : [libsystemd],
2790 # install : install_tests,
2791 # install_dir : testsdir)
2792 # test('test-libsystemd-sym',
2793 # test_libsystemd_sym)
2795 # test_libudev_sym = executable(
2796 # 'test-libudev-sym',
2797 # test_libudev_sym_c,
2798 # include_directories : includes,
2799 # c_args : ['-Wno-deprecated-declarations'],
2800 # link_with : [libudev],
2801 # install : install_tests,
2802 # install_dir : testsdir)
2803 # test('test-libudev-sym',
2806 # ############################################################
2810 # foreach tuple : fuzzers
2811 # sources = tuple[0]
2812 # link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2813 # dependencies = tuple[2]
2814 # defs = tuple.length() >= 4 ? tuple[3] : []
2815 # incs = tuple.length() >= 5 ? tuple[4] : includes
2818 # dependencies += fuzzing_engine
2820 # sources += 'src/fuzz/fuzz-main.c'
2823 # name = sources[0].split('/')[-1].split('.')[0]
2825 # fuzzer_exes += executable(
2828 # include_directories : [incs, include_directories('src/fuzz')],
2829 # link_with : link_with,
2830 # dependencies : dependencies,
2835 # run_target('fuzzers',
2836 # depends : fuzzer_exes,
2837 # command : ['true'])
2839 # ############################################################
2842 test_libelogind_sym = executable(
2843 'test-libelogind-sym',
2844 test_libelogind_sym_c,
2845 include_directories : includes,
2846 link_with : [libelogind],
2847 install : install_tests,
2848 install_dir : testsdir)
2849 test('test-libelogind-sym',
2850 test_libelogind_sym)
2852 make_directive_index_py = find_program('tools/make-directive-index.py')
2853 make_man_index_py = find_program('tools/make-man-index.py')
2854 xml_helper_py = find_program('tools/xml_helper.py')
2855 #if 0 /// UNNEEDED by elogind
2856 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2859 # subdir('sysctl.d')
2860 # subdir('sysusers.d')
2861 # subdir('tmpfiles.d')
2867 subdir('shell-completion/bash')
2868 subdir('shell-completion/zsh')
2869 #if 0 /// UNNEEDED by elogind
2870 # subdir('docs/sysvinit')
2871 # subdir('docs/var-log')
2874 # FIXME: figure out if the warning is true:
2875 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2876 install_subdir('factory/etc',
2877 install_dir : factorydir)
2880 #if 0 /// UNNEEDED by elogind
2881 # install_data('xorg/50-systemd-user.sh',
2882 # install_dir : xinitrcdir)
2883 # install_data('modprobe.d/systemd.conf',
2884 # install_dir : modprobedir)
2886 install_data('README',
2889 #if 0 /// UNNEEDED by elogind
2895 'TRANSIENT-SETTINGS.md',
2897 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2898 install_dir : docdir)
2900 #if 0 /// UNNEEDED by elogind
2901 # meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2903 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2905 ############################################################
2907 meson_check_help = find_program('tools/meson-check-help.sh')
2909 foreach exec : public_programs
2910 name = exec.full_path().split('/')[-1]
2911 test('check-help-' + name,
2913 args : [exec.full_path()])
2916 ############################################################
2919 foreach p : fuzz_regression_tests
2920 a = p.split('/')[-3]
2921 b = p.split('/')[-2]
2922 c = p.split('/')[-1]
2925 build = sanitize_address
2927 error('unknown sanitizer @0@'.format(a))
2930 name = '@1@:@0@'.format(a, b)
2933 if want_tests == 'false'
2934 message('Not compiling @0@ because tests is set to false'.format(name))
2935 elif not sanitizers.contains(a)
2936 message('Not compiling @0@ because @1@ sanitizer is not available'.format(name, a))
2938 exe = custom_target(
2942 command : [env, 'ln', '-fs',
2943 join_paths(build.full_path(), b),
2945 build_by_default : true)
2947 message('Not compiling @0@ because slow-tests is set to false'.format(name))
2952 if want_tests != 'false' and slow_tests
2953 test(c, env, args : [exe.full_path(),
2954 join_paths(meson.source_root(),
2955 'test/fuzz-regressions',
2960 ############################################################
2963 all_files = run_command(
2965 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2968 all_files = files(all_files.stdout().split())
2973 command : [env, 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2977 command : [env, 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2980 #if 0 /// UNNEEDED by elogind
2982 # meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2985 # command : [meson_git_contrib_sh])
2990 git_head = run_command(
2992 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2993 'rev-parse', 'HEAD']).stdout().strip()
2994 git_head_short = run_command(
2996 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2997 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
3001 command : ['git', 'archive',
3002 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
3004 '--prefix', 'systemd-@0@/'.format(git_head),
3008 ############################################################
3010 meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
3013 depends : [man, libelogind, libudev],
3014 command : [meson_check_api_docs_sh, libelogind.full_path(), libudev.full_path()])
3016 ############################################################
3019 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
3021 #if 0 /// UNSUPPORTED by elogind
3022 # 'prefix directory: @0@'.format(prefixdir),
3023 # 'rootprefix directory: @0@'.format(rootprefixdir),
3024 # 'sysconf directory: @0@'.format(sysconfdir),
3025 # 'include directory: @0@'.format(includedir),
3026 # 'lib directory: @0@'.format(libdir),
3027 # 'rootlib directory: @0@'.format(rootlibdir),
3028 # 'SysV init scripts: @0@'.format(sysvinit_path),
3029 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
3031 'rootexeclib dir: @0@'.format(rootlibexecdir),
3033 #if 0 /// UNSUPPORTED by elogind
3034 # 'PAM modules directory: @0@'.format(pamlibdir),
3035 # 'PAM configuration directory: @0@'.format(pamconfdir),
3036 # 'RPM macros directory: @0@'.format(rpmmacrosdir),
3037 # 'modprobe.d directory: @0@'.format(modprobedir),
3038 # 'D-Bus policy directory: @0@'.format(dbuspolicydir),
3039 # 'D-Bus session directory: @0@'.format(dbussessionservicedir),
3040 # 'D-Bus system directory: @0@'.format(dbussystemservicedir),
3041 # 'bash completions directory: @0@'.format(bashcompletiondir),
3042 # 'zsh completions directory: @0@'.format(zshcompletiondir),
3043 # 'extra start script: @0@'.format(get_option('rc-local')),
3044 # 'extra stop script: @0@'.format(get_option('halt-local')),
3045 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
3046 # get_option('debug-tty')),
3048 'TTY GID: @0@'.format(tty_gid),
3049 #if 0 /// UNSUPPORTED by elogind
3050 # 'users GID: @0@'.format(users_gid),
3052 'maximum system UID: @0@'.format(system_uid_max),
3053 'maximum system GID: @0@'.format(system_gid_max),
3054 #if 0 /// UNSUPPORTED by elogind
3055 # 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
3056 # 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
3057 # 'minimum container UID base: @0@'.format(container_uid_base_min),
3058 # 'maximum container UID base: @0@'.format(container_uid_base_max),
3059 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
3060 # 'render group access mode: @0@'.format(get_option('group-render-mode')),
3061 # 'certificate root directory: @0@'.format(get_option('certificate-root')),
3062 # 'support URL: @0@'.format(support_url),
3063 # 'nobody user name: @0@'.format(nobody_user),
3064 # 'nobody group name: @0@'.format(nobody_group),
3065 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
3066 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
3068 # 'default DNSSEC mode: @0@'.format(default_dnssec),
3069 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
3071 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
3073 #if 0 /// UNSUPPORTED by elogind
3074 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
3075 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
3077 # 'default DNS servers: @0@'.format(alt_dns_servers),
3078 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
3080 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
3081 # '@@0@'.format(time_epoch)).stdout().strip()
3083 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
3087 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3088 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3089 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3091 #if 0 /// UNNEEDED by elogind
3092 # if conf.get('ENABLE_EFI') == 1
3094 # 'efi arch: @0@'.format(efi_arch)]
3098 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
3099 # 'EFI CC @0@'.format(efi_cc),
3100 # 'EFI lib directory: @0@'.format(efi_libdir),
3101 # 'EFI lds directory: @0@'.format(efi_ldsdir),
3102 # 'EFI include directory: @0@'.format(efi_incdir)]
3111 #if 0 /// UNNEEDED by elogind
3112 # ['libcryptsetup'],
3116 #if 0 /// UNNEEDED by elogind
3121 #if 0 /// UNNEEDED by elogind
3125 #if 0 /// UNNEEDED by elogind
3132 #if 0 /// UNNEEDED by elogind
3148 # ['environment.d'],
3166 ['legacy pkla', install_polkit_pkla],
3167 #if 0 /// UNNEEDED by elogind
3169 # ['gnu-efi', have_gnu_efi],
3177 #if 0 /// UNNEEDED by elogind
3178 # ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
3182 ['man pages', want_man],
3183 ['html pages', want_html],
3184 ['man page indices', want_man and have_lxml],
3185 #if 0 /// UNNEEDED by elogind
3186 # ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
3190 #if 0 /// UNNEEDED by elogind
3193 # ['adm group', get_option('adm-group')],
3194 # ['wheel group', get_option('wheel-group')],
3200 ['debug mmap cache'],
3203 cond = tuple.get(1, '')
3205 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3206 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3207 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3212 missing += [tuple[0]]
3218 'enabled features: @0@'.format(', '.join(found)),
3220 'disabled features: @0@'.format(', '.join(missing)),
3222 message('\n '.join(status))
3224 if rootprefixdir != rootprefix_default
3225 message('WARNING:\n' +
3226 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3227 ' elogind used fixed names for unit file directories and other paths, so anything\n' +
3228 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))