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.20.0'
32 # libudev_version = '1.6.8'
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 # docdir = join_paths(datadir, 'doc/systemd')
166 # bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
167 # testsdir = join_paths(prefixdir, 'lib/systemd/tests')
168 # systemdstatedir = join_paths(localstatedir, 'lib/systemd')
169 # catalogstatedir = join_paths(systemdstatedir, 'catalog')
170 # randomseeddir = join_paths(localstatedir, 'lib/systemd')
172 pkgdatadir = join_paths(datadir, 'elogind')
173 pkgsysconfdir = join_paths(sysconfdir, 'elogind')
174 pkgincludedir = join_paths(includedir, 'elogind/systemd')
175 systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
176 systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
178 # in elogind, udev is external and thus configurable
179 udevlibexecdir = get_option('udevbindir')
180 udevlibexecdir = udevlibexecdir != '' ? udevlibexecdir : join_paths(rootprefixdir, 'lib/udev')
181 udevrulesdir = get_option('udevrulesdir')
182 udevrulesdir = udevrulesdir != '' ? udevrulesdir : join_paths(udevlibexecdir, 'rules.d')
183 udevhomedir = udevlibexecdir
184 factorydir = join_paths(datadir, 'factory')
185 docdir = get_option('docdir')
186 docdir = docdir != '' ? docdir: '-'.join([join_paths(datadir, 'doc/elogind'),
187 meson.project_version()])
188 testsdir = join_paths(prefixdir, 'lib/elogind/tests')
189 randomseeddir = join_paths(localstatedir, 'lib/elogind')
192 dbuspolicydir = get_option('dbuspolicydir')
193 if dbuspolicydir == ''
194 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
197 dbussessionservicedir = get_option('dbussessionservicedir')
198 if dbussessionservicedir == ''
199 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
202 dbussystemservicedir = get_option('dbussystemservicedir')
203 if dbussystemservicedir == ''
204 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
207 pamlibdir = get_option('pamlibdir')
209 pamlibdir = join_paths(rootlibdir, 'security')
212 pamconfdir = get_option('pamconfdir')
214 pamconfdir = join_paths(sysconfdir, 'pam.d')
217 conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
218 conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
219 #if 0 /// UNNEEDED by elogind
220 # conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
221 # conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
222 # conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
223 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
224 # conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
225 # conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
226 # conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
227 # conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
228 # conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
229 # conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
230 # conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
231 # conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
232 # conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
233 # conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
234 # conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
235 # conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
236 # conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
237 # conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
238 # conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
240 conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'elogind-cgroups-agent'))
241 conf.set_quoted('ELOGIND_UACCESS_COMMAND_PATH', join_paths(rootlibexecdir, 'elogind-uaccess-command'))
242 conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'elogind'))
244 conf.set_quoted('ROOTPREFIX', rootprefixdir)
245 #if 0 /// UNNEEDED by elogind
246 # conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
247 # conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
248 # conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
249 # conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
250 # conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
251 # conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
252 # conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
254 conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
255 conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
256 #if 0 /// UNNEEDED by elogind
257 # conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
258 # conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
260 conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
261 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
262 conf.set_quoted('LIBDIR', libdir)
263 conf.set_quoted('ROOTLIBDIR', rootlibdir)
264 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
265 #if 0 /// UNNEEDED by elogind
266 # conf.set_quoted('BOOTLIBDIR', bootlibdir)
267 # conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
268 # conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
269 # conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
270 # conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
271 # conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
272 # conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
275 conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
276 conf.set_quoted('ABS_SRC_DIR', meson.source_root())
278 substs.set('prefix', prefixdir)
279 substs.set('exec_prefix', prefixdir)
280 substs.set('libdir', libdir)
281 substs.set('rootlibdir', rootlibdir)
282 substs.set('includedir', includedir)
283 substs.set('pkgsysconfdir', pkgsysconfdir)
284 substs.set('bindir', bindir)
285 substs.set('rootbindir', rootbindir)
286 substs.set('rootlibexecdir', rootlibexecdir)
287 #if 0 /// UNNEEDED by elogind
288 # substs.set('systemunitdir', systemunitdir)
289 # substs.set('userunitdir', userunitdir)
290 # substs.set('systempresetdir', systempresetdir)
291 # substs.set('userpresetdir', userpresetdir)
292 # substs.set('udevhwdbdir', udevhwdbdir)
294 substs.set('udevrulesdir', udevrulesdir)
295 substs.set('udevlibexecdir', udevlibexecdir)
296 #if 0 /// UNNEEDED by elogind
297 # substs.set('catalogdir', catalogdir)
298 # substs.set('tmpfilesdir', tmpfilesdir)
299 # substs.set('sysusersdir', sysusersdir)
300 # substs.set('sysctldir', sysctldir)
301 # substs.set('binfmtdir', binfmtdir)
302 # substs.set('modulesloaddir', modulesloaddir)
303 # substs.set('systemgeneratordir', systemgeneratordir)
304 # substs.set('usergeneratordir', usergeneratordir)
305 # substs.set('systemenvgeneratordir', systemenvgeneratordir)
306 # substs.set('userenvgeneratordir', userenvgeneratordir)
308 substs.set('systemshutdowndir', systemshutdowndir)
309 substs.set('systemsleepdir', systemsleepdir)
310 substs.set('VARLOGDIR', varlogdir)
311 #if 0 /// UNNEEDED by elogind
312 # substs.set('CERTIFICATEROOT', get_option('certificate-root'))
313 # substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
314 # substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
315 # substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
316 # substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
317 # substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
318 # substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
321 #####################################################################
323 cc = meson.get_compiler('c')
324 pkgconfig = import('pkgconfig')
325 check_compilation_sh = find_program('tools/meson-check-compilation.sh')
327 if get_option('tests') != 'false'
328 cxx = find_program('c++', required : false)
330 # Used only for tests
335 want_ossfuzz = get_option('oss-fuzz')
336 want_libfuzzer = get_option('llvm-fuzz')
337 fuzzer_build = want_ossfuzz or want_libfuzzer
338 if want_ossfuzz and want_libfuzzer
339 error('only one of oss-fuzz and llvm-fuzz can be specified')
342 fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
345 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
348 foreach arg : ['-Wextra',
351 '-Wmissing-include-dirs',
352 '-Wold-style-definition',
355 '-Wdeclaration-after-statement',
357 '-Wsuggest-attribute=noreturn',
358 '-Werror=missing-prototypes',
359 '-Werror=implicit-function-declaration',
360 '-Werror=missing-declarations',
361 '-Werror=return-type',
362 '-Werror=incompatible-pointer-types',
364 '-Wstrict-prototypes',
366 '-Wmissing-noreturn',
367 '-Wimplicit-fallthrough=5',
370 '-Wstrict-aliasing=2',
377 '-fdiagnostics-show-option',
378 '-fno-strict-aliasing',
379 '-fvisibility=hidden',
381 '-fstack-protector-strong',
382 '--param=ssp-buffer-size=4',
384 if cc.has_argument(arg)
385 add_project_arguments(arg, language : 'c')
389 # the oss-fuzz fuzzers are not built with -fPIE, so don't
390 # enable it when we are linking against them
392 if cc.has_argument('-fPIE')
393 add_project_arguments('-fPIE', language : 'c')
397 # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
398 # arguments, just emits a warnings. So test for the "positive" version instead.
399 foreach arg : ['unused-parameter',
400 'missing-field-initializers',
403 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
405 if cc.has_argument('-W' + arg)
406 add_project_arguments('-Wno-' + arg, language : 'c')
412 #include <inttypes.h>
413 typedef uint64_t usec_t;
414 usec_t now(clockid_t clock);
419 ', name : '-Werror=shadow with local shadowing')
420 add_project_arguments('-Werror=shadow', language : 'c')
423 if cc.get_id() == 'clang'
424 foreach arg : ['-Wno-typedef-redefinition',
425 '-Wno-gnu-variable-sized-type-not-at-end',
427 if cc.has_argument(arg,
428 name : '@0@ is supported'.format(arg))
429 add_project_arguments(arg, language : 'c')
434 link_test_c = files('tools/meson-link-test.c')
436 # --as-needed and --no-undefined are provided by meson by default,
437 # run mesonconf to see what is enabled
438 foreach arg : ['-Wl,-z,relro',
443 have = run_command(check_compilation_sh,
444 cc.cmd_array(), '-x', 'c', arg,
445 '-include', link_test_c).returncode() == 0
446 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
447 if have and (arg != '-pie' or not fuzzer_build)
448 add_project_link_arguments(arg, language : 'c')
452 if get_option('buildtype') != 'debug'
453 foreach arg : ['-ffunction-sections',
455 if cc.has_argument(arg,
456 name : '@0@ is supported'.format(arg))
457 add_project_arguments(arg, language : 'c')
461 foreach arg : ['-Wl,--gc-sections']
462 have = run_command(check_compilation_sh,
463 cc.cmd_array(), '-x', 'c', arg,
464 '-include', link_test_c).returncode() == 0
465 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
467 add_project_link_arguments(arg, language : 'c')
472 cpp = ' '.join(cc.cmd_array()) + ' -E'
474 #####################################################################
475 # compilation result tests
477 conf.set('_GNU_SOURCE', true)
478 conf.set('__SANE_USERSPACE_TYPES__', true)
480 conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
481 conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
482 conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
483 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
484 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
485 conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
486 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
490 #include <linux/ethtool.h>
491 #include <linux/fib_rules.h>
493 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
495 foreach decl : ['char16_t',
498 'struct ethtool_link_settings',
499 'struct fib_rule_uid_range',
502 # We get -1 if the size cannot be determined
503 have = cc.sizeof(decl, prefix : decl_headers) > 0
504 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
507 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
508 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
509 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
510 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
511 ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'],
512 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
513 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
514 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
515 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
516 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
517 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
518 # if_tunnel.h is buggy and cannot be included on its own
519 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
520 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
521 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
522 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
523 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
524 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
525 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
526 ['IPVLAN_F_PRIVATE', 'linux/if_link.h'],
527 ['NDA_IFINDEX', 'linux/neighbour.h'],
528 ['IFA_FLAGS', 'linux/if_addr.h'],
529 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
530 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
531 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
533 prefix = decl.length() > 2 ? decl[2] : ''
534 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
535 conf.set10('HAVE_' + decl[0], have)
538 foreach ident : ['secure_getenv', '__secure_getenv']
539 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
543 ['memfd_create', '''#include <sys/mman.h>'''],
544 ['gettid', '''#include <sys/types.h>
545 // #include <unistd.h>'''],
546 ['pivot_root', '''#include <stdlib.h>
547 #include <unistd.h>'''], # no known header declares pivot_root
548 ['name_to_handle_at', '''#include <sys/types.h>
549 #include <sys/stat.h>
550 #include <fcntl.h>'''],
551 ['setns', '''#include <sched.h>'''],
552 ['renameat2', '''#include <stdio.h>
553 // #include <fcntl.h>'''],
554 ['kcmp', '''#include <linux/kcmp.h>'''],
555 ['keyctl', '''#include <sys/types.h>
556 #include <keyutils.h>'''],
557 ['copy_file_range', '''#include <sys/syscall.h>
558 #include <unistd.h>'''],
559 ['bpf', '''#include <sys/syscall.h>
560 #include <unistd.h>'''],
561 ['explicit_bzero' , '''#include <string.h>'''],
564 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
565 conf.set10('HAVE_' + ident[0].to_upper(), have)
568 if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
569 conf.set10('USE_SYS_RANDOM_H', true)
570 conf.set10('HAVE_GETRANDOM', true)
572 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
573 conf.set10('USE_SYS_RANDOM_H', false)
574 conf.set10('HAVE_GETRANDOM', have)
577 #####################################################################
579 sed = find_program('sed')
580 awk = find_program('awk')
581 m4 = find_program('m4')
582 stat = find_program('stat')
583 git = find_program('git', required : false)
585 meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
586 #if 1 /// Needed by elogind
587 meson_symlink_headers = meson.source_root() + '/tools/meson-symlink_headers.sh'
589 mkdir_p = 'mkdir -p $DESTDIR/@0@'
590 #if 0 /// unneeded by elogind
591 # test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
592 # splash_bmp = files('test/splash.bmp')
595 # if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
596 # /usr/sbin, /sbin, and fall back to the default from middle column.
597 #if 0 /// elogind has a bit different list and some adaptions
598 # progs = [['quotaon', '/usr/sbin/quotaon' ],
599 # ['quotacheck', '/usr/sbin/quotacheck' ],
600 # ['kill', '/usr/bin/kill' ],
601 # ['kmod', '/usr/bin/kmod' ],
602 # ['kexec', '/usr/sbin/kexec' ],
603 # ['sulogin', '/usr/sbin/sulogin' ],
604 # ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
605 # ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
606 # ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
607 # ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
610 progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
611 ['reboot', '/sbin/reboot', 'REBOOT'],
612 ['halt', '/sbin/halt', 'HALT'],
616 path = get_option(prog[0] + '-path')
618 message('Using @1@ for @0@'.format(prog[0], path))
620 exe = find_program(prog[0],
621 '/usr/sbin/' + prog[0],
624 path = exe.found() ? exe.path() : prog[1]
626 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
627 conf.set_quoted(name, path)
628 substs.set(name, path)
631 conf.set_quoted('TELINIT', get_option('telinit-path'))
633 if run_command('ln', '--relative', '--help').returncode() != 0
634 error('ln does not support --relative')
637 ############################################################
639 gperf = find_program('gperf')
641 gperf_test_format = '''
643 const char * in_word_set(const char *, @0@);
646 gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
647 gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
648 gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
649 if cc.compiles(gperf_test)
650 gperf_len_type = 'size_t'
652 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
653 if cc.compiles(gperf_test)
654 gperf_len_type = 'unsigned'
656 error('unable to determine gperf len type')
659 message('gperf len type is @0@'.format(gperf_len_type))
660 conf.set('GPERF_LEN_TYPE', gperf_len_type,
661 description : 'The type of gperf "len" parameter')
663 ############################################################
665 if not cc.has_header('sys/capability.h')
666 error('POSIX caps headers not found')
668 foreach header : ['linux/btrfs.h',
670 'linux/vm_sockets.h',
672 'valgrind/memcheck.h',
673 'valgrind/valgrind.h',
676 conf.set10('HAVE_' + header.underscorify().to_upper(),
677 cc.has_header(header))
680 ############################################################
682 conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
683 #if 0 /// UNNEEDED by elogind
684 # conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
685 # gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
688 default_hierarchy = get_option('default-hierarchy')
689 conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
690 description : 'default cgroup hierarchy as string')
691 if default_hierarchy == 'legacy'
692 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
693 elif default_hierarchy == 'hybrid'
694 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
696 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
699 #if 0 /// UNNEEDED by elogind
700 # time_epoch = get_option('time-epoch')
701 # if time_epoch == ''
702 # NEWS = files('NEWS')
703 # time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
705 # time_epoch = time_epoch.to_int()
706 # conf.set('TIME_EPOCH', time_epoch)
708 ############################################################
709 # elogind needs to know which cgroups controller to follow.
710 get_cg_ctrl_sh = find_program('tools/meson-get-cg-controller.sh')
711 with_cgroupctrl = get_option('cgroup-controller')
712 if with_cgroupctrl == '' or with_cgroupctrl == 'auto'
713 with_cgroupctrl = run_command(get_cg_ctrl_sh, []).stdout().strip()
714 elif with_cgroupctrl == 'none'
715 with_cgroupctrl = 'elogind'
718 # No controller now is a problem:
719 if with_cgroupctrl == ''
720 error('Unable to determine cgroup controller, but cgroups support is mandatory!')
723 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER', '_'.join(['',with_cgroupctrl]),
724 description : 'name of the cgroup controller to use')
725 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_LEGACY',
726 '='.join(['name', with_cgroupctrl]))
727 conf.set_quoted('SYSTEMD_CGROUP_CONTROLLER_HYBRID',
728 '='.join(['name', with_cgroupctrl]))
729 ############################################################
732 system_uid_max = get_option('system-uid-max')
733 if system_uid_max == ''
734 system_uid_max = run_command(
736 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
737 '/etc/login.defs').stdout()
739 system_uid_max = system_uid_max.to_int()
740 conf.set('SYSTEM_UID_MAX', system_uid_max)
741 substs.set('systemuidmax', system_uid_max)
742 message('maximum system UID is @0@'.format(system_uid_max))
744 system_gid_max = get_option('system-gid-max')
745 if system_gid_max == ''
746 system_gid_max = run_command(
748 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
749 '/etc/login.defs').stdout()
751 system_gid_max = system_gid_max.to_int()
752 conf.set('SYSTEM_GID_MAX', system_gid_max)
753 substs.set('systemgidmax', system_gid_max)
754 message('maximum system GID is @0@'.format(system_gid_max))
756 #if 0 /// UNNEEDED by elogind
757 # dynamic_uid_min = get_option('dynamic-uid-min').to_int()
758 # dynamic_uid_max = get_option('dynamic-uid-max').to_int()
759 # conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
760 # conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
761 # substs.set('dynamicuidmin', dynamic_uid_min)
762 # substs.set('dynamicuidmax', dynamic_uid_max)
764 # container_uid_base_min = get_option('container-uid-base-min').to_int()
765 # container_uid_base_max = get_option('container-uid-base-max').to_int()
766 # conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
767 # conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
768 # substs.set('containeruidbasemin', container_uid_base_min)
769 # substs.set('containeruidbasemax', container_uid_base_max)
772 nobody_user = get_option('nobody-user')
773 nobody_group = get_option('nobody-group')
775 getent_result = run_command('getent', 'passwd', '65534')
776 if getent_result.returncode() == 0
777 name = getent_result.stdout().split(':')[0]
778 if name != nobody_user
779 message('WARNING:\n' +
780 ' 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) +
781 ' Your build will result in an user table setup that is incompatible with the local system.')
784 id_result = run_command('id', '-u', nobody_user)
785 if id_result.returncode() == 0
786 id = id_result.stdout().to_int()
788 message('WARNING:\n' +
789 ' 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) +
790 ' Your build will result in an user table setup that is incompatible with the local system.')
794 getent_result = run_command('getent', 'group', '65534')
795 if getent_result.returncode() == 0
796 name = getent_result.stdout().split(':')[0]
797 if name != nobody_group
798 message('WARNING:\n' +
799 ' 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) +
800 ' Your build will result in an group table setup that is incompatible with the local system.')
803 id_result = run_command('id', '-g', nobody_group)
804 if id_result.returncode() == 0
805 id = id_result.stdout().to_int()
807 message('WARNING:\n' +
808 ' 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) +
809 ' Your build will result in an group table setup that is incompatible with the local system.')
812 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
813 message('WARNING:\n' +
814 ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
815 ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
818 conf.set_quoted('NOBODY_USER_NAME', nobody_user)
819 conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
820 substs.set('NOBODY_USER_NAME', nobody_user)
821 substs.set('NOBODY_GROUP_NAME', nobody_group)
823 tty_gid = get_option('tty-gid')
824 conf.set('TTY_GID', tty_gid)
825 substs.set('TTY_GID', tty_gid)
827 #if 0 /// UNNEEDED by elogind
828 # # Ensure provided GID argument is numeric, otherwise fallback to default assignment
829 # if get_option('users-gid') != ''
830 # users_gid = get_option('users-gid').to_int()
834 # substs.set('USERS_GID', users_gid)
836 # if get_option('adm-group')
837 # m4_defines += ['-DENABLE_ADM_GROUP']
840 # if get_option('wheel-group')
841 # m4_defines += ['-DENABLE_WHEEL_GROUP']
844 # substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
845 # substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
848 kill_user_processes = get_option('default-kill-user-processes')
849 conf.set10('KILL_USER_PROCESSES', kill_user_processes)
850 substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
852 #if 0 /// UNNEEDED by elogind
853 # dns_servers = get_option('dns-servers')
854 # conf.set_quoted('DNS_SERVERS', dns_servers)
855 # substs.set('DNS_SERVERS', dns_servers)
857 # ntp_servers = get_option('ntp-servers')
858 # conf.set_quoted('NTP_SERVERS', ntp_servers)
859 # substs.set('NTP_SERVERS', ntp_servers)
862 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
864 #if 0 /// UNNEEDED by elogind
865 # substs.set('SUSHELL', get_option('debug-shell'))
866 # substs.set('DEBUGTTY', get_option('debug-tty'))
869 debug = get_option('debug')
870 enable_debug_hashmap = false
871 enable_debug_mmap_cache = false
872 #if 1 /// additional elogind debug mode
873 enable_debug_elogind = false
876 foreach name : debug.split(',')
878 enable_debug_hashmap = true
879 elif name == 'mmap-cache'
880 enable_debug_mmap_cache = true
881 #if 1 /// additional elogind debug mode
882 elif name == 'elogind'
883 enable_debug_elogind = true
886 message('unknown debug option "@0@", ignoring'.format(name))
890 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
891 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
892 #if 1 /// additional elogind debug mode
893 conf.set10('ENABLE_DEBUG_ELOGIND', enable_debug_elogind)
896 #####################################################################
898 threads = dependency('threads')
899 librt = cc.find_library('rt')
900 libm = cc.find_library('m')
901 libdl = cc.find_library('dl')
902 libcrypt = cc.find_library('crypt')
904 libcap = dependency('libcap', required : false)
905 if not libcap.found()
906 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
907 libcap = cc.find_library('cap')
910 #if 0 /// UNNEEDED by elogind
911 # libmount = dependency('mount',
912 # version : '>= 2.30',
913 # required : not fuzzer_build)
915 # want_seccomp = get_option('seccomp')
916 # if want_seccomp != 'false' and not fuzzer_build
917 # libseccomp = dependency('libseccomp',
918 # version : '>= 2.3.1',
919 # required : want_seccomp == 'true')
920 # have = libseccomp.found()
928 conf.set10('HAVE_SECCOMP', have)
929 m4_defines += have ? ['-DHAVE_SECCOMP'] : []
931 want_selinux = get_option('selinux')
932 if want_selinux != 'false' and not fuzzer_build
933 libselinux = dependency('libselinux',
934 version : '>= 2.1.9',
935 required : want_selinux == 'true')
936 have = libselinux.found()
941 conf.set10('HAVE_SELINUX', have)
942 m4_defines += have ? ['-DHAVE_SELINUX'] : []
944 #if 0 /// UNNEEDED by elogind
945 # want_apparmor = get_option('apparmor')
946 # if want_apparmor != 'false' and not fuzzer_build
947 # libapparmor = dependency('libapparmor',
948 # required : want_apparmor == 'true')
949 # have = libapparmor.found()
957 conf.set10('HAVE_APPARMOR', have)
958 m4_defines += have ? ['-DHAVE_APPARMOR'] : []
960 smack_run_label = get_option('smack-run-label')
961 if smack_run_label != ''
962 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
963 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
966 want_polkit = get_option('polkit')
967 install_polkit = false
968 install_polkit_pkla = false
969 if want_polkit != 'false' and not fuzzer_build
970 install_polkit = true
972 libpolkit = dependency('polkit-gobject-1',
974 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
975 message('Old polkit detected, will install pkla files')
976 install_polkit_pkla = true
979 conf.set10('ENABLE_POLKIT', install_polkit)
981 want_acl = get_option('acl')
982 if want_acl != 'false' and not fuzzer_build
983 libacl = cc.find_library('acl', required : want_acl == 'true')
984 have = libacl.found()
989 conf.set10('HAVE_ACL', have)
990 m4_defines += have ? ['-DHAVE_ACL'] : []
992 want_audit = get_option('audit')
993 if want_audit != 'false' and not fuzzer_build
994 libaudit = dependency('audit', required : want_audit == 'true')
995 have = libaudit.found()
1000 conf.set10('HAVE_AUDIT', have)
1002 #if 0 /// UNNEEDED by elogind
1003 # want_blkid = get_option('blkid')
1004 # if want_blkid != 'false' and not fuzzer_build
1005 # libblkid = dependency('blkid', required : want_blkid == 'true')
1006 # have = libblkid.found()
1011 # conf.set10('HAVE_BLKID', have)
1013 # want_kmod = get_option('kmod')
1014 # if want_kmod != 'false' and not fuzzer_build
1015 # libkmod = dependency('libkmod',
1016 # version : '>= 15',
1017 # required : want_kmod == 'true')
1018 # have = libkmod.found()
1023 # conf.set10('HAVE_KMOD', have)
1029 want_pam = get_option('pam')
1030 if want_pam != 'false' and not fuzzer_build
1031 libpam = cc.find_library('pam', required : want_pam == 'true')
1032 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
1033 have = libpam.found() and libpam_misc.found()
1039 conf.set10('HAVE_PAM', have)
1040 m4_defines += have ? ['-DHAVE_PAM'] : []
1042 #if 0 /// UNNEEDED by elogind
1043 # want_microhttpd = get_option('microhttpd')
1044 # if want_microhttpd != 'false' and not fuzzer_build
1045 # libmicrohttpd = dependency('libmicrohttpd',
1046 # version : '>= 0.9.33',
1047 # required : want_microhttpd == 'true')
1048 # have = libmicrohttpd.found()
1051 # libmicrohttpd = []
1053 # conf.set10('HAVE_MICROHTTPD', have)
1054 # m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
1056 # want_libcryptsetup = get_option('libcryptsetup')
1057 # if want_libcryptsetup != 'false' and not fuzzer_build
1058 # libcryptsetup = dependency('libcryptsetup',
1059 # version : '>= 1.6.0',
1060 # required : want_libcryptsetup == 'true')
1061 # have = libcryptsetup.found()
1064 # libcryptsetup = []
1066 # conf.set10('HAVE_LIBCRYPTSETUP', have)
1068 # want_libcurl = get_option('libcurl')
1069 # if want_libcurl != 'false' and not fuzzer_build
1070 # libcurl = dependency('libcurl',
1071 # version : '>= 7.32.0',
1072 # required : want_libcurl == 'true')
1073 # have = libcurl.found()
1078 # conf.set10('HAVE_LIBCURL', have)
1079 # m4_defines += have ? ['-DHAVE_LIBCURL'] : []
1081 # want_libidn = get_option('libidn')
1082 # want_libidn2 = get_option('libidn2')
1083 # if want_libidn == 'true' and want_libidn2 == 'true'
1084 # error('libidn and libidn2 cannot be requested simultaneously')
1087 # if want_libidn != 'false' and want_libidn2 != 'true' and not fuzzer_build
1088 # libidn = dependency('libidn',
1089 # required : want_libidn == 'true')
1090 # have = libidn.found()
1095 # conf.set10('HAVE_LIBIDN', have)
1096 # m4_defines += have ? ['-DHAVE_LIBIDN'] : []
1097 # if not have and want_libidn2 != 'false' and not fuzzer_build
1098 # # libidn is used for both libidn and libidn2 objects
1099 # libidn = dependency('libidn2',
1100 # required : want_libidn2 == 'true')
1101 # have = libidn.found()
1105 # conf.set10('HAVE_LIBIDN2', have)
1106 # m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
1108 # want_libiptc = get_option('libiptc')
1109 # if want_libiptc != 'false' and not fuzzer_build
1110 # libiptc = dependency('libiptc',
1111 # required : want_libiptc == 'true')
1112 # have = libiptc.found()
1117 # conf.set10('HAVE_LIBIPTC', have)
1118 # m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
1120 # want_qrencode = get_option('qrencode')
1121 # if want_qrencode != 'false' and not fuzzer_build
1122 # libqrencode = dependency('libqrencode',
1123 # required : want_qrencode == 'true')
1124 # have = libqrencode.found()
1129 # conf.set10('HAVE_QRENCODE', have)
1131 # want_gcrypt = get_option('gcrypt')
1132 # if want_gcrypt != 'false' and not fuzzer_build
1133 # libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
1134 # libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
1135 # have = libgcrypt.found() and libgpg_error.found()
1140 # # link to neither of the libs if one is not found
1144 # conf.set10('HAVE_GCRYPT', have)
1146 # want_gnutls = get_option('gnutls')
1147 # if want_gnutls != 'false' and not fuzzer_build
1148 # libgnutls = dependency('gnutls',
1149 # version : '>= 3.1.4',
1150 # required : want_gnutls == 'true')
1151 # have = libgnutls.found()
1156 # conf.set10('HAVE_GNUTLS', have)
1158 # want_elfutils = get_option('elfutils')
1159 # if want_elfutils != 'false' and not fuzzer_build
1160 # libdw = dependency('libdw',
1161 # required : want_elfutils == 'true')
1162 # have = libdw.found()
1167 # conf.set10('HAVE_ELFUTILS', have)
1169 # want_zlib = get_option('zlib')
1170 # if want_zlib != 'false' and not fuzzer_build
1171 # libz = dependency('zlib',
1172 # required : want_zlib == 'true')
1173 # have = libz.found()
1178 # conf.set10('HAVE_ZLIB', have)
1180 # want_bzip2 = get_option('bzip2')
1181 # if want_bzip2 != 'false' and not fuzzer_build
1182 # libbzip2 = cc.find_library('bz2',
1183 # required : want_bzip2 == 'true')
1184 # have = libbzip2.found()
1189 # conf.set10('HAVE_BZIP2', have)
1191 # want_xz = get_option('xz')
1192 # if want_xz != 'false' and not fuzzer_build
1193 # libxz = dependency('liblzma',
1194 # required : want_xz == 'true')
1195 # have = libxz.found()
1200 # conf.set10('HAVE_XZ', have)
1202 # want_lz4 = get_option('lz4')
1203 # if want_lz4 != 'false' and not fuzzer_build
1204 # liblz4 = dependency('liblz4',
1205 # required : want_lz4 == 'true')
1206 # have = liblz4.found()
1211 # conf.set10('HAVE_LZ4', have)
1213 # want_xkbcommon = get_option('xkbcommon')
1214 # if want_xkbcommon != 'false' and not fuzzer_build
1215 # libxkbcommon = dependency('xkbcommon',
1216 # version : '>= 0.3.0',
1217 # required : want_xkbcommon == 'true')
1218 # have = libxkbcommon.found()
1240 conf.set10('HAVE_XKBCOMMON', have)
1242 want_glib = get_option('glib')
1243 if want_glib != 'false' and not fuzzer_build
1244 libglib = dependency('glib-2.0',
1245 version : '>= 2.22.0',
1246 required : want_glib == 'true')
1247 libgobject = dependency('gobject-2.0',
1248 version : '>= 2.22.0',
1249 required : want_glib == 'true')
1250 libgio = dependency('gio-2.0',
1251 required : want_glib == 'true')
1252 have = libglib.found() and libgobject.found() and libgio.found()
1259 conf.set10('HAVE_GLIB', have)
1261 want_dbus = get_option('dbus')
1262 if want_dbus != 'false' and not fuzzer_build
1263 libdbus = dependency('dbus-1',
1264 version : '>= 1.3.2',
1265 required : want_dbus == 'true')
1266 have = libdbus.found()
1271 conf.set10('HAVE_DBUS', have)
1273 #if 0 /// UNNEEDED by elogind
1274 # default_dnssec = get_option('default-dnssec')
1276 # default_dnssec = 'no'
1278 # if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1279 # message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1280 # default_dnssec = 'no'
1282 # conf.set('DEFAULT_DNSSEC_MODE',
1283 # 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1284 # substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1286 # want_importd = get_option('importd')
1287 # if want_importd != 'false'
1288 # have = (conf.get('HAVE_LIBCURL') == 1 and
1289 # conf.get('HAVE_ZLIB') == 1 and
1290 # conf.get('HAVE_BZIP2') == 1 and
1291 # conf.get('HAVE_XZ') == 1 and
1292 # conf.get('HAVE_GCRYPT') == 1)
1293 # if want_importd == 'true' and not have
1294 # error('importd support was requested, but dependencies are not available')
1299 # conf.set10('ENABLE_IMPORTD', have)
1301 # want_remote = get_option('remote')
1302 # if want_remote != 'false'
1303 # have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1304 # conf.get('HAVE_LIBCURL') == 1]
1305 # # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1306 # # it's possible to build one without the other. Complain only if
1307 # # support was explictly requested. The auxiliary files like sysusers
1308 # # config should be installed when any of the programs are built.
1309 # if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1310 # error('remote support was requested, but dependencies are not available')
1312 # have = have_deps[0] or have_deps[1]
1317 conf.set10('ENABLE_REMOTE', have)
1319 foreach term : ['utmp',
1320 #if 0 /// UNNEEDED by elogind
1354 have = get_option(term)
1355 name = 'ENABLE_' + term.underscorify().to_upper()
1356 conf.set10(name, have)
1357 m4_defines += have ? ['-D' + name] : []
1360 want_tests = get_option('tests')
1361 install_tests = get_option('install-tests')
1365 conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1367 #####################################################################
1369 #if 0 /// UNNEEDED by elogind
1370 # if get_option('efi')
1371 # efi_arch = host_machine.cpu_family()
1373 # if efi_arch == 'x86'
1374 # EFI_MACHINE_TYPE_NAME = 'ia32'
1375 # gnu_efi_arch = 'ia32'
1376 # elif efi_arch == 'x86_64'
1377 # EFI_MACHINE_TYPE_NAME = 'x64'
1378 # gnu_efi_arch = 'x86_64'
1379 # elif efi_arch == 'arm'
1380 # EFI_MACHINE_TYPE_NAME = 'arm'
1381 # gnu_efi_arch = 'arm'
1382 # elif efi_arch == 'aarch64'
1383 # EFI_MACHINE_TYPE_NAME = 'aa64'
1384 # gnu_efi_arch = 'aarch64'
1386 # EFI_MACHINE_TYPE_NAME = ''
1391 # conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1393 # conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1398 conf.set10('ENABLE_EFI', have)
1400 #####################################################################
1402 config_h = configure_file(
1403 output : 'config.h',
1404 configuration : conf)
1406 includes = include_directories('src/basic',
1409 #if 0 /// UNNEEDED by elogind
1415 #if 0 /// UNNEEDED by elogind
1420 #if 0 /// elogind has a different list
1421 # 'src/libsystemd/sd-bus',
1422 # 'src/libsystemd/sd-device',
1423 # 'src/libsystemd/sd-hwdb',
1424 # 'src/libsystemd/sd-id128',
1425 # 'src/libsystemd/sd-netlink',
1426 # 'src/libsystemd/sd-network',
1427 # 'src/libsystemd-network',
1430 'src/libelogind/sd-bus',
1431 'src/libelogind/sd-id128',
1436 add_project_arguments('-include', 'config.h', language : 'c')
1438 #if 0 /// UNNEEDED by elogind
1441 #if 0 /// UNNEEDED by elogind
1444 subdir('src/systemd')
1446 #if 0 /// UNNEEDED by elogind
1447 # subdir('src/libsystemd')
1448 # subdir('src/libsystemd-network')
1449 # subdir('src/journal')
1452 subdir('src/libelogind')
1454 subdir('src/update-utmp')
1458 #if 0 /// UNNEEDED by elogind
1459 # libjournal_core = static_library(
1461 # libjournal_core_sources,
1463 # include_directories : includes,
1466 # libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1467 # libsystemd = shared_library(
1469 # 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug
1470 # version : libsystemd_version,
1471 # include_directories : includes,
1472 # link_args : ['-shared',
1473 # '-Wl,--version-script=' + libsystemd_sym_path],
1474 # link_with : [libbasic,
1476 # link_whole : [libsystemd_static,
1477 # libjournal_client],
1478 # dependencies : [threads,
1482 # link_depends : libsystemd_sym,
1484 # install_dir : rootlibdir)
1486 libelogind_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libelogind_sym)
1487 libelogind = shared_library(
1489 libelogind_internal_sources,
1490 version : libelogind_version,
1491 include_directories : includes,
1492 link_args : ['-shared',
1493 '-Wl,--version-script=' + libelogind_sym_path],
1494 link_with : [libbasic],
1495 dependencies : [threads],
1496 link_depends : libelogind_sym,
1498 install_dir : rootlibdir)
1501 ############################################################
1503 # binaries that have --help and are intended for use by humans,
1504 # usually, but not always, installed in /bin.
1505 public_programs = []
1507 #if 0 /// UNNEEDED by elogind
1508 # subdir('src/libudev')
1510 # elogind depends on external libudev:
1511 libudev = dependency('libudev', required : true)
1513 subdir('src/shared')
1514 #if 0 /// UNNEEDED by elogind
1515 # subdir('src/core')
1516 # subdir('src/udev')
1517 # subdir('src/network')
1519 # subdir('src/analyze')
1520 # subdir('src/journal-remote')
1521 # subdir('src/coredump')
1522 # subdir('src/hostname')
1523 # subdir('src/import')
1524 # subdir('src/kernel-install')
1525 # subdir('src/locale')
1526 # subdir('src/machine')
1527 # subdir('src/nspawn')
1528 # subdir('src/resolve')
1529 # subdir('src/timedate')
1530 # subdir('src/timesync')
1531 # subdir('src/vconsole')
1532 # subdir('src/boot/efi')
1537 #if 0 /// UNNEEDED in elogind
1542 ############################################################
1544 # only static linking apart from libdl, to make sure that the
1545 # module is linked to all libraries that it uses.
1546 test_dlopen = executable(
1549 include_directories : includes,
1550 link_with : [libbasic],
1551 dependencies : [libdl])
1553 #if 0 /// UNNEEDED by elogind
1554 # foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1555 # ['systemd', 'ENABLE_NSS_SYSTEMD'],
1556 # ['mymachines', 'ENABLE_MACHINED'],
1557 # ['resolve', 'ENABLE_RESOLVE']]
1559 # condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1563 # sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1564 # version_script_arg = join_paths(meson.current_source_dir(), sym)
1566 # nss = shared_library(
1568 # 'src/nss-@0@/nss-@0@.c'.format(module),
1570 # include_directories : includes,
1571 # # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1572 # link_args : ['-Wl,-z,nodelete',
1574 # '-Wl,--version-script=' + version_script_arg,
1575 # '-Wl,--undefined'],
1576 # link_with : [libsystemd_static,
1578 # dependencies : [threads,
1580 # link_depends : sym,
1582 # install_dir : rootlibdir)
1584 # # We cannot use shared_module because it does not support version suffix.
1585 # # Unfortunately shared_library insists on creating the symlink…
1586 # meson.add_install_script('sh', '-c',
1587 # 'rm $DESTDIR@0@/libnss_@1@.so'
1588 # .format(rootlibdir, module))
1590 # test('dlopen-nss_' + module,
1592 # args : [nss.full_path()]) # path to dlopen must include a slash
1597 ############################################################
1599 #if 0 /// UNNEEDED by elogind
1600 # executable('systemd',
1602 # include_directories : includes,
1603 # link_with : [libcore,
1605 # dependencies : [threads,
1611 # install_rpath : rootlibexecdir,
1613 # install_dir : rootlibexecdir)
1615 # exe = executable('systemd-analyze',
1616 # systemd_analyze_sources,
1617 # include_directories : includes,
1618 # link_with : [libcore,
1620 # dependencies : [threads,
1626 # install_rpath : rootlibexecdir,
1628 # public_programs += [exe]
1630 # executable('systemd-journald',
1631 # systemd_journald_sources,
1632 # include_directories : includes,
1633 # link_with : [libjournal_core,
1635 # dependencies : [threads,
1639 # install_rpath : rootlibexecdir,
1641 # install_dir : rootlibexecdir)
1643 # exe = executable('systemd-cat',
1644 # systemd_cat_sources,
1645 # include_directories : includes,
1646 # link_with : [libjournal_core,
1648 # dependencies : [threads],
1649 # install_rpath : rootlibexecdir,
1651 # public_programs += [exe]
1653 # exe = executable('journalctl',
1654 # journalctl_sources,
1655 # include_directories : includes,
1656 # link_with : [libshared],
1657 # dependencies : [threads,
1661 # install_rpath : rootlibexecdir,
1663 # install_dir : rootbindir)
1664 # public_programs += [exe]
1666 # executable('systemd-getty-generator',
1667 # 'src/getty-generator/getty-generator.c',
1668 # include_directories : includes,
1669 # link_with : [libshared],
1670 # install_rpath : rootlibexecdir,
1672 # install_dir : systemgeneratordir)
1674 # executable('systemd-debug-generator',
1675 # 'src/debug-generator/debug-generator.c',
1676 # include_directories : includes,
1677 # link_with : [libshared],
1678 # install_rpath : rootlibexecdir,
1680 # install_dir : systemgeneratordir)
1682 # executable('systemd-fstab-generator',
1683 # 'src/fstab-generator/fstab-generator.c',
1684 # 'src/core/mount-setup.c',
1685 # include_directories : includes,
1686 # link_with : [libshared],
1687 # install_rpath : rootlibexecdir,
1689 # install_dir : systemgeneratordir)
1691 # if conf.get('ENABLE_ENVIRONMENT_D') == 1
1692 # executable('30-systemd-environment-d-generator',
1693 # 'src/environment-d-generator/environment-d-generator.c',
1694 # include_directories : includes,
1695 # link_with : [libshared],
1696 # install_rpath : rootlibexecdir,
1698 # install_dir : userenvgeneratordir)
1700 # meson.add_install_script(meson_make_symlink,
1701 # join_paths(sysconfdir, 'environment'),
1702 # join_paths(environmentdir, '99-environment.conf'))
1705 # if conf.get('ENABLE_HIBERNATE') == 1
1706 # executable('systemd-hibernate-resume-generator',
1707 # 'src/hibernate-resume/hibernate-resume-generator.c',
1708 # include_directories : includes,
1709 # link_with : [libshared],
1710 # install_rpath : rootlibexecdir,
1712 # install_dir : systemgeneratordir)
1714 # executable('systemd-hibernate-resume',
1715 # 'src/hibernate-resume/hibernate-resume.c',
1716 # include_directories : includes,
1717 # link_with : [libshared],
1718 # install_rpath : rootlibexecdir,
1720 # install_dir : rootlibexecdir)
1723 # if conf.get('HAVE_BLKID') == 1
1724 # executable('systemd-gpt-auto-generator',
1725 # 'src/gpt-auto-generator/gpt-auto-generator.c',
1726 # 'src/basic/blkid-util.h',
1727 # include_directories : includes,
1728 # link_with : [libshared],
1729 # dependencies : libblkid,
1730 # install_rpath : rootlibexecdir,
1732 # install_dir : systemgeneratordir)
1734 # exe = executable('systemd-dissect',
1735 # 'src/dissect/dissect.c',
1736 # include_directories : includes,
1737 # link_with : [libshared],
1738 # install_rpath : rootlibexecdir,
1740 # install_dir : rootlibexecdir)
1741 # public_programs += [exe]
1744 # if conf.get('ENABLE_RESOLVE') == 1
1745 # executable('systemd-resolved',
1746 # systemd_resolved_sources,
1747 # include_directories : includes,
1748 # link_with : [libshared,
1750 # libsystemd_resolve_core],
1751 # dependencies : [threads,
1755 # install_rpath : rootlibexecdir,
1757 # install_dir : rootlibexecdir)
1759 # exe = executable('systemd-resolve',
1760 # systemd_resolve_sources,
1761 # include_directories : includes,
1762 # link_with : [libshared,
1764 # libsystemd_resolve_core],
1765 # dependencies : [threads,
1769 # install_rpath : rootlibexecdir,
1771 # public_programs += [exe]
1774 # if conf.get('ENABLE_LOGIND') == 1
1775 # executable('systemd-logind',
1776 # systemd_logind_sources,
1777 # include_directories : includes,
1778 # link_with : [liblogind_core,
1780 # dependencies : [threads,
1782 # install_rpath : rootlibexecdir,
1784 # install_dir : rootlibexecdir)
1786 # exe = executable('loginctl',
1788 # include_directories : includes,
1789 # link_with : [libshared],
1790 # dependencies : [threads,
1793 # install_rpath : rootlibexecdir,
1795 # install_dir : rootbindir)
1796 # public_programs += [exe]
1798 # exe = executable('systemd-inhibit',
1799 # 'src/login/inhibit.c',
1800 # include_directories : includes,
1801 # link_with : [libshared],
1802 # install_rpath : rootlibexecdir,
1804 # install_dir : rootbindir)
1805 # public_programs += [exe]
1807 # if conf.get('HAVE_PAM') == 1
1808 # version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1809 # pam_systemd = shared_library(
1813 # include_directories : includes,
1814 # link_args : ['-shared',
1815 # '-Wl,--version-script=' + version_script_arg],
1816 # link_with : [libsystemd_static,
1817 # libshared_static],
1818 # dependencies : [threads,
1821 # link_depends : pam_systemd_sym,
1823 # install_dir : pamlibdir)
1825 # test('dlopen-pam_systemd',
1827 # args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1832 executable('elogind',
1834 include_directories : includes,
1835 link_with : [liblogind_core,
1837 dependencies : [threads,
1840 install_rpath : rootlibexecdir,
1842 install_dir : rootlibexecdir)
1844 exe = executable('loginctl',
1846 include_directories : includes,
1847 link_with : [libshared],
1848 dependencies : [threads,
1850 install_rpath : rootlibexecdir,
1852 install_dir : rootbindir)
1853 public_programs += [exe]
1855 exe = executable('elogind-inhibit',
1856 'src/login/inhibit.c',
1857 include_directories : includes,
1858 link_with : [libshared],
1859 dependencies : [threads],
1860 install_rpath : rootlibexecdir,
1862 install_dir : rootbindir)
1863 public_programs += [exe]
1865 if conf.get('HAVE_PAM') == 1
1866 version_script_arg = join_paths(meson.current_source_dir(), pam_elogind_sym)
1867 pam_elogind = shared_library(
1871 include_directories : includes,
1872 link_args : ['-shared',
1873 '-Wl,--version-script=' + version_script_arg],
1874 link_with : [libelogind,
1876 dependencies : [threads,
1879 link_depends : pam_elogind_sym,
1881 install_dir : pamlibdir)
1883 test('dlopen-pam_elogind',
1885 args : [pam_elogind.full_path()]) # path to dlopen must include a slash
1888 #if 0 /// UNNEEDED by elogind
1889 # executable('systemd-user-sessions',
1890 # 'src/user-sessions/user-sessions.c',
1891 # include_directories : includes,
1892 # link_with : [libshared],
1893 # install_rpath : rootlibexecdir,
1895 # install_dir : rootlibexecdir)
1898 # if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1899 # exe = executable('bootctl',
1900 # 'src/boot/bootctl.c',
1901 # include_directories : includes,
1902 # link_with : [libshared],
1903 # dependencies : [libblkid],
1904 # install_rpath : rootlibexecdir,
1906 # public_programs += [exe]
1909 # exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1910 # include_directories : includes,
1911 # link_with : [libshared],
1912 # dependencies : [threads],
1913 # install_rpath : rootlibexecdir,
1915 # public_programs += [exe]
1917 # exe = executable('systemctl', 'src/systemctl/systemctl.c',
1918 # include_directories : includes,
1919 # link_with : [libshared],
1920 # dependencies : [threads,
1925 # install_rpath : rootlibexecdir,
1927 # install_dir : rootbindir)
1928 # public_programs += [exe]
1930 # if conf.get('ENABLE_BACKLIGHT') == 1
1931 # executable('systemd-backlight',
1932 # 'src/backlight/backlight.c',
1933 # include_directories : includes,
1934 # link_with : [libshared],
1935 # install_rpath : rootlibexecdir,
1937 # install_dir : rootlibexecdir)
1940 # if conf.get('ENABLE_RFKILL') == 1
1941 # executable('systemd-rfkill',
1942 # 'src/rfkill/rfkill.c',
1943 # include_directories : includes,
1944 # link_with : [libshared],
1945 # install_rpath : rootlibexecdir,
1947 # install_dir : rootlibexecdir)
1950 # executable('systemd-system-update-generator',
1951 # 'src/system-update-generator/system-update-generator.c',
1952 # include_directories : includes,
1953 # link_with : [libshared],
1954 # install_rpath : rootlibexecdir,
1956 # install_dir : systemgeneratordir)
1958 # if conf.get('HAVE_LIBCRYPTSETUP') == 1
1959 # executable('systemd-cryptsetup',
1960 # 'src/cryptsetup/cryptsetup.c',
1961 # include_directories : includes,
1962 # link_with : [libshared],
1963 # dependencies : [libcryptsetup],
1964 # install_rpath : rootlibexecdir,
1966 # install_dir : rootlibexecdir)
1968 # executable('systemd-cryptsetup-generator',
1969 # 'src/cryptsetup/cryptsetup-generator.c',
1970 # include_directories : includes,
1971 # link_with : [libshared],
1972 # dependencies : [libcryptsetup],
1973 # install_rpath : rootlibexecdir,
1975 # install_dir : systemgeneratordir)
1977 # executable('systemd-veritysetup',
1978 # 'src/veritysetup/veritysetup.c',
1979 # include_directories : includes,
1980 # link_with : [libshared],
1981 # dependencies : [libcryptsetup],
1982 # install_rpath : rootlibexecdir,
1984 # install_dir : rootlibexecdir)
1986 # executable('systemd-veritysetup-generator',
1987 # 'src/veritysetup/veritysetup-generator.c',
1988 # include_directories : includes,
1989 # link_with : [libshared],
1990 # dependencies : [libcryptsetup],
1991 # install_rpath : rootlibexecdir,
1993 # install_dir : systemgeneratordir)
1996 # if conf.get('HAVE_SYSV_COMPAT') == 1
1997 # executable('systemd-sysv-generator',
1998 # 'src/sysv-generator/sysv-generator.c',
1999 # include_directories : includes,
2000 # link_with : [libshared],
2001 # install_rpath : rootlibexecdir,
2003 # install_dir : systemgeneratordir)
2005 # executable('systemd-rc-local-generator',
2006 # 'src/rc-local-generator/rc-local-generator.c',
2007 # include_directories : includes,
2008 # link_with : [libshared],
2009 # install_rpath : rootlibexecdir,
2011 # install_dir : systemgeneratordir)
2014 # if conf.get('ENABLE_HOSTNAMED') == 1
2015 # executable('systemd-hostnamed',
2016 # 'src/hostname/hostnamed.c',
2017 # include_directories : includes,
2018 # link_with : [libshared],
2019 # install_rpath : rootlibexecdir,
2021 # install_dir : rootlibexecdir)
2023 # exe = executable('hostnamectl',
2024 # 'src/hostname/hostnamectl.c',
2025 # include_directories : includes,
2026 # link_with : [libshared],
2027 # install_rpath : rootlibexecdir,
2029 # public_programs += [exe]
2032 # if conf.get('ENABLE_LOCALED') == 1
2033 # if conf.get('HAVE_XKBCOMMON') == 1
2034 # # logind will load libxkbcommon.so dynamically on its own
2040 # executable('systemd-localed',
2041 # systemd_localed_sources,
2042 # include_directories : includes,
2043 # link_with : [libshared],
2044 # dependencies : deps,
2045 # install_rpath : rootlibexecdir,
2047 # install_dir : rootlibexecdir)
2049 # exe = executable('localectl',
2050 # localectl_sources,
2051 # include_directories : includes,
2052 # link_with : [libshared],
2053 # install_rpath : rootlibexecdir,
2055 # public_programs += [exe]
2058 # if conf.get('ENABLE_TIMEDATED') == 1
2059 # executable('systemd-timedated',
2060 # 'src/timedate/timedated.c',
2061 # include_directories : includes,
2062 # link_with : [libshared],
2063 # install_rpath : rootlibexecdir,
2065 # install_dir : rootlibexecdir)
2067 # exe = executable('timedatectl',
2068 # 'src/timedate/timedatectl.c',
2069 # include_directories : includes,
2070 # install_rpath : rootlibexecdir,
2071 # link_with : [libshared],
2073 # public_programs += [exe]
2076 # if conf.get('ENABLE_TIMESYNCD') == 1
2077 # executable('systemd-timesyncd',
2078 # systemd_timesyncd_sources,
2079 # include_directories : includes,
2080 # link_with : [libshared],
2081 # dependencies : [threads,
2083 # install_rpath : rootlibexecdir,
2085 # install_dir : rootlibexecdir)
2088 # if conf.get('ENABLE_MACHINED') == 1
2089 # executable('systemd-machined',
2090 # systemd_machined_sources,
2091 # include_directories : includes,
2092 # link_with : [libmachine_core,
2094 # install_rpath : rootlibexecdir,
2096 # install_dir : rootlibexecdir)
2098 # exe = executable('machinectl',
2099 # 'src/machine/machinectl.c',
2100 # include_directories : includes,
2101 # link_with : [libshared],
2102 # dependencies : [threads,
2105 # install_rpath : rootlibexecdir,
2107 # install_dir : rootbindir)
2108 # public_programs += [exe]
2111 # if conf.get('ENABLE_IMPORTD') == 1
2112 # executable('systemd-importd',
2113 # systemd_importd_sources,
2114 # include_directories : includes,
2115 # link_with : [libshared],
2116 # dependencies : [threads],
2117 # install_rpath : rootlibexecdir,
2119 # install_dir : rootlibexecdir)
2121 # systemd_pull = executable('systemd-pull',
2122 # systemd_pull_sources,
2123 # include_directories : includes,
2124 # link_with : [libshared],
2125 # dependencies : [libcurl,
2130 # install_rpath : rootlibexecdir,
2132 # install_dir : rootlibexecdir)
2134 # systemd_import = executable('systemd-import',
2135 # systemd_import_sources,
2136 # include_directories : includes,
2137 # link_with : [libshared],
2138 # dependencies : [libcurl,
2142 # install_rpath : rootlibexecdir,
2144 # install_dir : rootlibexecdir)
2146 # systemd_export = executable('systemd-export',
2147 # systemd_export_sources,
2148 # include_directories : includes,
2149 # link_with : [libshared],
2150 # dependencies : [libcurl,
2154 # install_rpath : rootlibexecdir,
2156 # install_dir : rootlibexecdir)
2157 # public_programs += [systemd_pull, systemd_import, systemd_export]
2160 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
2161 # exe = executable('systemd-journal-upload',
2162 # systemd_journal_upload_sources,
2163 # include_directories : includes,
2164 # link_with : [libshared],
2165 # dependencies : [threads,
2170 # install_rpath : rootlibexecdir,
2172 # install_dir : rootlibexecdir)
2173 # public_programs += [exe]
2176 # if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
2177 # s_j_remote = executable('systemd-journal-remote',
2178 # systemd_journal_remote_sources,
2179 # include_directories : includes,
2180 # link_with : [libshared],
2181 # dependencies : [threads,
2186 # install_rpath : rootlibexecdir,
2188 # install_dir : rootlibexecdir)
2190 # s_j_gatewayd = executable('systemd-journal-gatewayd',
2191 # systemd_journal_gatewayd_sources,
2192 # include_directories : includes,
2193 # link_with : [libshared],
2194 # dependencies : [threads,
2199 # install_rpath : rootlibexecdir,
2201 # install_dir : rootlibexecdir)
2202 # public_programs += [s_j_remote, s_j_gatewayd]
2205 # if conf.get('ENABLE_COREDUMP') == 1
2206 # executable('systemd-coredump',
2207 # systemd_coredump_sources,
2208 # include_directories : includes,
2209 # link_with : [libshared],
2210 # dependencies : [threads,
2215 # install_rpath : rootlibexecdir,
2217 # install_dir : rootlibexecdir)
2219 # exe = executable('coredumpctl',
2220 # coredumpctl_sources,
2221 # include_directories : includes,
2222 # link_with : [libshared],
2223 # dependencies : [threads,
2226 # install_rpath : rootlibexecdir,
2228 # public_programs += [exe]
2231 # if conf.get('ENABLE_BINFMT') == 1
2232 # exe = executable('systemd-binfmt',
2233 # 'src/binfmt/binfmt.c',
2234 # include_directories : includes,
2235 # link_with : [libshared],
2236 # install_rpath : rootlibexecdir,
2238 # install_dir : rootlibexecdir)
2239 # public_programs += [exe]
2241 # meson.add_install_script('sh', '-c',
2242 # mkdir_p.format(binfmtdir))
2243 # meson.add_install_script('sh', '-c',
2244 # mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
2247 # if conf.get('ENABLE_VCONSOLE') == 1
2248 # executable('systemd-vconsole-setup',
2249 # 'src/vconsole/vconsole-setup.c',
2250 # include_directories : includes,
2251 # link_with : [libshared],
2252 # install_rpath : rootlibexecdir,
2254 # install_dir : rootlibexecdir)
2257 # if conf.get('ENABLE_RANDOMSEED') == 1
2258 # executable('systemd-random-seed',
2259 # 'src/random-seed/random-seed.c',
2260 # include_directories : includes,
2261 # link_with : [libshared],
2262 # install_rpath : rootlibexecdir,
2264 # install_dir : rootlibexecdir)
2267 # if conf.get('ENABLE_FIRSTBOOT') == 1
2268 # executable('systemd-firstboot',
2269 # 'src/firstboot/firstboot.c',
2270 # include_directories : includes,
2271 # link_with : [libshared],
2272 # dependencies : [libcrypt],
2273 # install_rpath : rootlibexecdir,
2275 # install_dir : rootbindir)
2278 # executable('systemd-remount-fs',
2279 # 'src/remount-fs/remount-fs.c',
2280 # 'src/core/mount-setup.c',
2281 # 'src/core/mount-setup.h',
2282 # include_directories : includes,
2283 # link_with : [libshared],
2284 # install_rpath : rootlibexecdir,
2286 # install_dir : rootlibexecdir)
2288 # executable('systemd-machine-id-setup',
2289 # 'src/machine-id-setup/machine-id-setup-main.c',
2290 # 'src/core/machine-id-setup.c',
2291 # 'src/core/machine-id-setup.h',
2292 # include_directories : includes,
2293 # link_with : [libshared],
2294 # install_rpath : rootlibexecdir,
2296 # install_dir : rootbindir)
2298 # executable('systemd-fsck',
2299 # 'src/fsck/fsck.c',
2300 # include_directories : includes,
2301 # link_with : [libshared],
2302 # install_rpath : rootlibexecdir,
2304 # install_dir : rootlibexecdir)
2306 # executable('elogind-growfs',
2307 # 'src/partition/growfs.c',
2308 # include_directories : includes,
2309 # link_with : [libshared],
2310 # dependencies : [libcryptsetup],
2311 # install_rpath : rootlibexecdir,
2313 # install_dir : rootlibexecdir)
2315 # executable('elogind-makefs',
2316 # 'src/partition/makefs.c',
2317 # include_directories : includes,
2318 # link_with : [libshared],
2319 # install_rpath : rootlibexecdir,
2321 # install_dir : rootlibexecdir)
2323 # executable('systemd-sleep',
2324 # 'src/sleep/sleep.c',
2325 # include_directories : includes,
2326 # link_with : [libshared],
2327 # install_rpath : rootlibexecdir,
2329 # install_dir : rootlibexecdir)
2331 # exe = executable('systemd-sysctl',
2332 # 'src/sysctl/sysctl.c',
2333 # include_directories : includes,
2334 # link_with : [libshared],
2335 # install_rpath : rootlibexecdir,
2337 # install_dir : rootlibexecdir)
2338 # public_programs += [exe]
2340 # executable('systemd-ac-power',
2341 # 'src/ac-power/ac-power.c',
2342 # include_directories : includes,
2343 # link_with : [libshared],
2344 # install_rpath : rootlibexecdir,
2346 # install_dir : rootlibexecdir)
2348 # exe = executable('systemd-detect-virt',
2349 # 'src/detect-virt/detect-virt.c',
2350 # include_directories : includes,
2351 # link_with : [libshared],
2352 # install_rpath : rootlibexecdir,
2354 # public_programs += [exe]
2356 # exe = executable('systemd-delta',
2357 # 'src/delta/delta.c',
2358 # include_directories : includes,
2359 # link_with : [libshared],
2360 # install_rpath : rootlibexecdir,
2362 # public_programs += [exe]
2364 # exe = executable('systemd-escape',
2365 # 'src/escape/escape.c',
2366 # include_directories : includes,
2367 # link_with : [libshared],
2368 # install_rpath : rootlibexecdir,
2370 # install_dir : rootbindir)
2371 # public_programs += [exe]
2373 # exe = executable('systemd-notify',
2374 # 'src/notify/notify.c',
2375 # include_directories : includes,
2376 # link_with : [libshared],
2377 # install_rpath : rootlibexecdir,
2379 # install_dir : rootbindir)
2380 # public_programs += [exe]
2382 # executable('systemd-volatile-root',
2383 # 'src/volatile-root/volatile-root.c',
2384 # include_directories : includes,
2385 # link_with : [libshared],
2386 # install_rpath : rootlibexecdir,
2388 # install_dir : rootlibexecdir)
2390 # executable('systemd-cgroups-agent',
2391 # 'src/cgroups-agent/cgroups-agent.c',
2392 # include_directories : includes,
2393 # link_with : [libshared],
2394 # install_rpath : rootlibexecdir,
2396 # install_dir : rootlibexecdir)
2398 executable('elogind-cgroups-agent',
2399 'src/cgroups-agent/cgroups-agent.c',
2400 include_directories : includes,
2401 link_with : [libshared_static],
2402 install_rpath : rootlibexecdir,
2404 install_dir : rootlibexecdir)
2407 #if 0 /// UNNEEDED by elogind
2408 # exe = executable('systemd-path',
2409 # 'src/path/path.c',
2410 # include_directories : includes,
2411 # link_with : [libshared],
2412 # install_rpath : rootlibexecdir,
2414 # public_programs += [exe]
2416 # exe = executable('systemd-ask-password',
2417 # 'src/ask-password/ask-password.c',
2418 # include_directories : includes,
2419 # link_with : [libshared],
2420 # install_rpath : rootlibexecdir,
2422 # install_dir : rootbindir)
2423 # public_programs += [exe]
2425 # executable('systemd-reply-password',
2426 # 'src/reply-password/reply-password.c',
2427 # include_directories : includes,
2428 # link_with : [libshared],
2429 # install_rpath : rootlibexecdir,
2431 # install_dir : rootlibexecdir)
2433 # exe = executable('systemd-tty-ask-password-agent',
2434 # 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2435 # include_directories : includes,
2436 # link_with : [libshared],
2437 # install_rpath : rootlibexecdir,
2439 # install_dir : rootbindir)
2440 # public_programs += [exe]
2442 # exe = executable('systemd-cgls',
2443 # 'src/cgls/cgls.c',
2444 # include_directories : includes,
2445 # link_with : [libshared],
2446 # install_rpath : rootlibexecdir,
2448 # public_programs += [exe]
2450 # exe = executable('systemd-cgtop',
2451 # 'src/cgtop/cgtop.c',
2452 # include_directories : includes,
2453 # link_with : [libshared],
2454 # install_rpath : rootlibexecdir,
2456 # public_programs += [exe]
2458 # executable('systemd-initctl',
2459 # 'src/initctl/initctl.c',
2460 # include_directories : includes,
2461 # link_with : [libshared],
2462 # install_rpath : rootlibexecdir,
2464 # install_dir : rootlibexecdir)
2466 # exe = executable('systemd-mount',
2467 # 'src/mount/mount-tool.c',
2468 # include_directories : includes,
2469 # link_with : [libshared],
2470 # install_rpath : rootlibexecdir,
2472 # public_programs += [exe]
2474 # meson.add_install_script(meson_make_symlink,
2475 # 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2477 # exe = executable('systemd-run',
2479 # include_directories : includes,
2480 # link_with : [libshared],
2481 # install_rpath : rootlibexecdir,
2483 # public_programs += [exe]
2485 # exe = executable('systemd-stdio-bridge',
2486 # 'src/stdio-bridge/stdio-bridge.c',
2487 # include_directories : includes,
2488 # link_with : [libshared],
2489 # install_rpath : rootlibexecdir,
2491 # public_programs += [exe]
2493 # exe = executable('busctl',
2494 # 'src/busctl/busctl.c',
2495 # 'src/busctl/busctl-introspect.c',
2496 # 'src/busctl/busctl-introspect.h',
2497 # include_directories : includes,
2498 # link_with : [libshared],
2499 # install_rpath : rootlibexecdir,
2501 # public_programs += [exe]
2503 # if conf.get('ENABLE_SYSUSERS') == 1
2504 # exe = executable('systemd-sysusers',
2505 # 'src/sysusers/sysusers.c',
2506 # include_directories : includes,
2507 # link_with : [libshared],
2508 # install_rpath : rootlibexecdir,
2510 # install_dir : rootbindir)
2511 # public_programs += [exe]
2514 # if conf.get('ENABLE_TMPFILES') == 1
2515 # exe = executable('systemd-tmpfiles',
2516 # 'src/tmpfiles/tmpfiles.c',
2517 # include_directories : includes,
2518 # link_with : [libshared],
2519 # dependencies : [libacl],
2520 # install_rpath : rootlibexecdir,
2522 # install_dir : rootbindir)
2523 # public_programs += [exe]
2525 # test('test-systemd-tmpfiles',
2526 # test_systemd_tmpfiles_py,
2527 # args : exe.full_path())
2528 # # https://github.com/mesonbuild/meson/issues/2681
2531 # if conf.get('ENABLE_HWDB') == 1
2532 # exe = executable('systemd-hwdb',
2533 # 'src/hwdb/hwdb.c',
2534 # 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2535 # include_directories : includes,
2536 # link_with : [libudev_static],
2537 # install_rpath : udev_rpath,
2539 # install_dir : rootbindir)
2540 # public_programs += [exe]
2543 # if conf.get('ENABLE_QUOTACHECK') == 1
2544 # executable('systemd-quotacheck',
2545 # 'src/quotacheck/quotacheck.c',
2546 # include_directories : includes,
2547 # link_with : [libshared],
2548 # install_rpath : rootlibexecdir,
2550 # install_dir : rootlibexecdir)
2553 # exe = executable('systemd-socket-proxyd',
2554 # 'src/socket-proxy/socket-proxyd.c',
2555 # include_directories : includes,
2556 # link_with : [libshared],
2557 # dependencies : [threads],
2558 # install_rpath : rootlibexecdir,
2560 # install_dir : rootlibexecdir)
2561 # public_programs += [exe]
2563 # exe = executable('systemd-udevd',
2564 # systemd_udevd_sources,
2565 # include_directories : includes,
2566 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2567 # link_with : [libudev_core,
2568 # libsystemd_network,
2570 # dependencies : [threads,
2575 # install_rpath : udev_rpath,
2577 # install_dir : rootlibexecdir)
2578 # public_programs += [exe]
2580 # exe = executable('udevadm',
2582 # c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2583 # include_directories : includes,
2584 # link_with : [libudev_core,
2585 # libsystemd_network,
2587 # dependencies : [threads,
2592 # install_rpath : udev_rpath,
2594 # install_dir : rootbindir)
2595 # public_programs += [exe]
2597 # executable('systemd-shutdown',
2598 # systemd_shutdown_sources,
2599 # include_directories : includes,
2600 # link_with : [libshared],
2601 # install_rpath : rootlibexecdir,
2603 # install_dir : rootlibexecdir)
2605 # executable('systemd-update-done',
2606 # 'src/update-done/update-done.c',
2607 # include_directories : includes,
2608 # link_with : [libshared],
2609 # install_rpath : rootlibexecdir,
2611 # install_dir : rootlibexecdir)
2613 # executable('systemd-update-utmp',
2614 # 'src/update-utmp/update-utmp.c',
2615 # include_directories : includes,
2616 # link_with : [libshared],
2617 # dependencies : [libaudit],
2618 # install_rpath : rootlibexecdir,
2620 # install_dir : rootlibexecdir)
2622 # if conf.get('HAVE_KMOD') == 1
2623 # executable('systemd-modules-load',
2624 # 'src/modules-load/modules-load.c',
2625 # include_directories : includes,
2626 # link_with : [libshared],
2627 # dependencies : [libkmod],
2628 # install_rpath : rootlibexecdir,
2630 # install_dir : rootlibexecdir)
2632 # meson.add_install_script('sh', '-c',
2633 # mkdir_p.format(modulesloaddir))
2634 # meson.add_install_script('sh', '-c',
2635 # mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2638 # exe = executable('systemd-nspawn',
2639 # systemd_nspawn_sources,
2640 # 'src/core/mount-setup.c', # FIXME: use a variable?
2641 # 'src/core/mount-setup.h',
2642 # 'src/core/loopback-setup.c',
2643 # 'src/core/loopback-setup.h',
2644 # include_directories : [includes, include_directories('src/nspawn')],
2645 # link_with : [libshared],
2646 # dependencies : [libacl,
2650 # install_rpath : rootlibexecdir,
2652 # public_programs += [exe]
2654 # if conf.get('ENABLE_NETWORKD') == 1
2655 # executable('systemd-networkd',
2656 # systemd_networkd_sources,
2657 # include_directories : includes,
2658 # link_with : [libnetworkd_core,
2659 # libsystemd_network,
2662 # dependencies : [threads],
2663 # install_rpath : rootlibexecdir,
2665 # install_dir : rootlibexecdir)
2667 # executable('systemd-networkd-wait-online',
2668 # systemd_networkd_wait_online_sources,
2669 # include_directories : includes,
2670 # link_with : [libnetworkd_core,
2672 # install_rpath : rootlibexecdir,
2674 # install_dir : rootlibexecdir)
2676 # exe = executable('networkctl',
2677 # networkctl_sources,
2678 # include_directories : includes,
2679 # link_with : [libsystemd_network,
2681 # install_rpath : rootlibexecdir,
2683 # install_dir : rootbindir)
2684 # public_programs += [exe]
2687 # executable('systemd-sulogin-shell',
2688 # ['src/sulogin-shell/sulogin-shell.c'],
2689 # include_directories : includes,
2690 # link_with : [libshared],
2691 # install_rpath : rootlibexecdir,
2693 # install_dir : rootlibexecdir)
2695 executable('elogind-uaccess-command',
2696 'src/uaccess-command/uaccess-command.c',
2697 include_directories : includes,
2698 link_with : [liblogind_core,
2700 dependencies: [libacl,
2702 install_rpath : rootlibexecdir,
2704 install_dir : rootlibexecdir)
2707 ############################################################
2709 foreach tuple : tests
2711 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2712 dependencies = tuple[2]
2713 condition = tuple.length() >= 4 ? tuple[3] : ''
2714 type = tuple.length() >= 5 ? tuple[4] : ''
2715 defs = tuple.length() >= 6 ? tuple[5] : []
2716 incs = tuple.length() >= 7 ? tuple[6] : includes
2719 name = sources[0].split('/')[-1].split('.')[0]
2720 if type.startswith('timeout=')
2721 timeout = type.split('=')[1].to_int()
2724 if want_tests == 'false'
2725 message('Not compiling @0@ because tests is set to false'.format(name))
2726 elif condition == '' or conf.get(condition) == 1
2730 include_directories : incs,
2731 link_with : link_with,
2732 dependencies : dependencies,
2734 install_rpath : rootlibexecdir,
2735 install : install_tests,
2736 install_dir : join_paths(testsdir, type))
2739 message('@0@ is a manual test'.format(name))
2740 elif type == 'unsafe' and want_tests != 'unsafe'
2741 message('@0@ is an unsafe test'.format(name))
2748 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2752 #if 0 /// UNNEEDED by elogind
2753 # test_libsystemd_sym = executable(
2754 # 'test-libsystemd-sym',
2755 # test_libsystemd_sym_c,
2756 # include_directories : includes,
2757 # link_with : [libsystemd],
2758 # install : install_tests,
2759 # install_dir : testsdir)
2760 # test('test-libsystemd-sym',
2761 # test_libsystemd_sym)
2763 # test_libudev_sym = executable(
2764 # 'test-libudev-sym',
2765 # test_libudev_sym_c,
2766 # include_directories : includes,
2767 # c_args : ['-Wno-deprecated-declarations'],
2768 # link_with : [libudev],
2769 # install : install_tests,
2770 # install_dir : testsdir)
2771 # test('test-libudev-sym',
2774 # ############################################################
2778 # foreach tuple : fuzzers
2779 # sources = tuple[0]
2780 # link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2781 # dependencies = tuple[2]
2782 # defs = tuple.length() >= 4 ? tuple[3] : []
2783 # incs = tuple.length() >= 5 ? tuple[4] : includes
2786 # dependencies += fuzzing_engine
2788 # sources += 'src/fuzz/fuzz-main.c'
2791 # name = sources[0].split('/')[-1].split('.')[0]
2793 # fuzzer_exes += executable(
2796 # include_directories : [incs, include_directories('src/fuzz')],
2797 # link_with : link_with,
2798 # dependencies : dependencies,
2803 # run_target('fuzzers',
2804 # depends : fuzzer_exes,
2805 # command : ['true'])
2807 test_libelogind_sym = executable(
2808 'test-libelogind-sym',
2809 test_libelogind_sym_c,
2810 include_directories : includes,
2811 link_with : [libelogind],
2812 install : install_tests,
2813 install_dir : testsdir)
2814 test('test-libelogind-sym',
2815 test_libelogind_sym)
2818 ############################################################
2820 make_directive_index_py = find_program('tools/make-directive-index.py')
2821 make_man_index_py = find_program('tools/make-man-index.py')
2822 xml_helper_py = find_program('tools/xml_helper.py')
2823 #if 0 /// UNNEEDED by elogind
2824 # hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2827 # subdir('sysctl.d')
2828 # subdir('sysusers.d')
2829 # subdir('tmpfiles.d')
2835 subdir('shell-completion/bash')
2836 subdir('shell-completion/zsh')
2837 #if 0 /// UNNEEDED by elogind
2838 # subdir('docs/sysvinit')
2839 # subdir('docs/var-log')
2842 # FIXME: figure out if the warning is true:
2843 # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2844 install_subdir('factory/etc',
2845 install_dir : factorydir)
2848 #if 0 /// UNNEEDED by elogind
2849 # install_data('xorg/50-systemd-user.sh',
2850 # install_dir : xinitrcdir)
2851 # install_data('modprobe.d/systemd.conf',
2852 # install_dir : modprobedir)
2854 install_data('README',
2857 #if 0 /// UNNEEDED by elogind
2863 'TRANSIENT-SETTINGS.md',
2865 'src/libelogind/sd-bus/GVARIANT-SERIALIZATION',
2866 install_dir : docdir)
2868 #if 0 /// UNNEEDED by elogind
2869 # meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2871 meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2873 ############################################################
2875 meson_check_help = find_program('tools/meson-check-help.sh')
2877 foreach exec : public_programs
2878 name = exec.full_path().split('/')[-1]
2879 test('check-help-' + name,
2881 args : [exec.full_path()])
2884 ############################################################
2887 all_files = run_command(
2889 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2892 all_files = files(all_files.stdout().split())
2897 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2901 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2904 #if 0 /// UNNEEDED by elogind
2906 # meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2909 # command : [meson_git_contrib_sh])
2914 git_head = run_command(
2916 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2917 'rev-parse', 'HEAD']).stdout().strip()
2918 git_head_short = run_command(
2920 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2921 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2925 command : ['git', 'archive',
2926 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2928 '--prefix', 'systemd-@0@/'.format(git_head),
2932 ############################################################
2934 meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
2937 depends : [man, libelogind, libudev],
2938 command : [meson_check_api_docs_sh, libelogind.full_path(), libudev.full_path()])
2940 ############################################################
2943 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2945 #if 0 /// UNSUPPORTED by elogind
2946 # 'prefix directory: @0@'.format(prefixdir),
2947 # 'rootprefix directory: @0@'.format(rootprefixdir),
2948 # 'sysconf directory: @0@'.format(sysconfdir),
2949 # 'include directory: @0@'.format(includedir),
2950 # 'lib directory: @0@'.format(libdir),
2951 # 'rootlib directory: @0@'.format(rootlibdir),
2952 # 'SysV init scripts: @0@'.format(sysvinit_path),
2953 # 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2955 'rootexeclib dir: @0@'.format(rootlibexecdir),
2957 #if 0 /// UNSUPPORTED by elogind
2958 # 'PAM modules directory: @0@'.format(pamlibdir),
2959 # 'PAM configuration directory: @0@'.format(pamconfdir),
2960 # 'RPM macros directory: @0@'.format(rpmmacrosdir),
2961 # 'modprobe.d directory: @0@'.format(modprobedir),
2962 # 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2963 # 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2964 # 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2965 # 'bash completions directory: @0@'.format(bashcompletiondir),
2966 # 'zsh completions directory: @0@'.format(zshcompletiondir),
2967 # 'extra start script: @0@'.format(get_option('rc-local')),
2968 # 'extra stop script: @0@'.format(get_option('halt-local')),
2969 # 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2970 # get_option('debug-tty')),
2972 'TTY GID: @0@'.format(tty_gid),
2973 #if 0 /// UNSUPPORTED by elogind
2974 # 'users GID: @0@'.format(users_gid),
2976 'maximum system UID: @0@'.format(system_uid_max),
2977 'maximum system GID: @0@'.format(system_gid_max),
2978 #if 0 /// UNSUPPORTED by elogind
2979 # 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
2980 # 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
2981 # 'minimum container UID base: @0@'.format(container_uid_base_min),
2982 # 'maximum container UID base: @0@'.format(container_uid_base_max),
2983 # '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2984 # 'render group access mode: @0@'.format(get_option('group-render-mode')),
2985 # 'certificate root directory: @0@'.format(get_option('certificate-root')),
2986 # 'support URL: @0@'.format(support_url),
2987 # 'nobody user name: @0@'.format(nobody_user),
2988 # 'nobody group name: @0@'.format(nobody_group),
2989 # 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2990 # 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2992 # 'default DNSSEC mode: @0@'.format(default_dnssec),
2993 # 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2995 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2997 #if 0 /// UNSUPPORTED by elogind
2998 # alt_dns_servers = '\n '.join(dns_servers.split(' '))
2999 # alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
3001 # 'default DNS servers: @0@'.format(alt_dns_servers),
3002 # 'default NTP servers: @0@'.format(alt_ntp_servers)]
3004 # alt_time_epoch = run_command('date', '-Is', '-u', '-d',
3005 # '@@0@'.format(time_epoch)).stdout().strip()
3007 # 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
3011 # CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
3012 # CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
3013 # LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
3015 #if 0 /// UNNEEDED by elogind
3016 # if conf.get('ENABLE_EFI') == 1
3018 # 'efi arch: @0@'.format(efi_arch)]
3022 # 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
3023 # 'EFI CC @0@'.format(efi_cc),
3024 # 'EFI lib directory: @0@'.format(efi_libdir),
3025 # 'EFI lds directory: @0@'.format(efi_ldsdir),
3026 # 'EFI include directory: @0@'.format(efi_incdir)]
3035 #if 0 /// UNNEEDED by elogind
3036 # ['libcryptsetup'],
3040 #if 0 /// UNNEEDED by elogind
3045 #if 0 /// UNNEEDED by elogind
3049 #if 0 /// UNNEEDED by elogind
3056 #if 0 /// UNNEEDED by elogind
3072 # ['environment.d'],
3090 ['legacy pkla', install_polkit_pkla],
3091 #if 0 /// UNNEEDED by elogind
3093 # ['gnu-efi', have_gnu_efi],
3100 #if 0 /// UNNEEDED by elogind
3101 # ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
3105 ['man pages', want_man],
3106 ['html pages', want_html],
3107 ['man page indices', want_man and have_lxml],
3108 #if 0 /// UNNEEDED by elogind
3109 # ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
3113 #if 0 /// UNNEEDED by elogind
3116 # ['adm group', get_option('adm-group')],
3117 # ['wheel group', get_option('wheel-group')],
3123 ['debug mmap cache'],
3126 cond = tuple.get(1, '')
3128 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
3129 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
3130 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
3135 missing += [tuple[0]]
3141 'enabled features: @0@'.format(', '.join(found)),
3143 'disabled features: @0@'.format(', '.join(missing)),
3145 message('\n '.join(status))
3147 if rootprefixdir != rootprefix_default
3148 message('WARNING:\n' +
3149 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
3150 ' elogind used fixed names for unit file directories and other paths, so anything\n' +
3151 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))