]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - meson.build
Add x-systemd.makefs option for fstab
[thirdparty/systemd.git] / meson.build
... / ...
CommitLineData
1# SPDX-License-Identifier: LGPL-2.1+
2#
3# Copyright 2017 Zbigniew Jędrzejewski-Szmek
4#
5# systemd 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.
9#
10# systemd 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.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18project('systemd', 'c',
19 version : '235',
20 license : 'LGPLv2+',
21 default_options: [
22 'c_std=gnu99',
23 'prefix=/usr',
24 'sysconfdir=/etc',
25 'localstatedir=/var',
26 ],
27 meson_version : '>= 0.41',
28 )
29
30libsystemd_version = '0.19.1'
31libudev_version = '1.6.7'
32
33# We need the same data in three different formats, ugh!
34# Also, for hysterical reasons, we use different variable
35# names, sometimes. Not all variables are included in every
36# set. Ugh, ugh, ugh!
37conf = configuration_data()
38conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
39conf.set_quoted('PACKAGE_VERSION', meson.project_version())
40
41substs = configuration_data()
42substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
43substs.set('PACKAGE_VERSION', meson.project_version())
44
45m4_defines = []
46
47#####################################################################
48
49# Try to install the git pre-commit hook
50git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
51if git_hook.returncode() == 0
52 message(git_hook.stdout().strip())
53endif
54
55#####################################################################
56
57split_usr = get_option('split-usr')
58conf.set10('HAVE_SPLIT_USR', split_usr)
59
60rootprefixdir = get_option('rootprefix')
61# Unusual rootprefixdir values are used by some distros
62# (see https://github.com/systemd/systemd/pull/7461).
63rootprefix_default = get_option('split-usr') ? '/' : '/usr'
64if rootprefixdir == ''
65 rootprefixdir = rootprefix_default
66endif
67
68sysvinit_path = get_option('sysvinit-path')
69sysvrcnd_path = get_option('sysvrcnd-path')
70have = sysvinit_path != '' or sysvrcnd_path != ''
71conf.set10('HAVE_SYSV_COMPAT', have,
72 description : 'SysV init scripts and rcN.d links are supported')
73m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
74
75# join_paths ignore the preceding arguments if an absolute component is
76# encountered, so this should canonicalize various paths when they are
77# absolute or relative.
78prefixdir = get_option('prefix')
79if not prefixdir.startswith('/')
80 error('Prefix is not absolute: "@0@"'.format(prefixdir))
81endif
82bindir = join_paths(prefixdir, get_option('bindir'))
83libdir = join_paths(prefixdir, get_option('libdir'))
84sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
85includedir = join_paths(prefixdir, get_option('includedir'))
86datadir = join_paths(prefixdir, get_option('datadir'))
87localstatedir = join_paths('/', get_option('localstatedir'))
88
89rootbindir = join_paths(rootprefixdir, 'bin')
90rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
91
92rootlibdir = get_option('rootlibdir')
93if rootlibdir == ''
94 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
95endif
96
97# Dirs of external packages
98pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
99pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
100polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
101polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
102polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
103varlogdir = join_paths(localstatedir, 'log')
104xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
105rpmmacrosdir = get_option('rpmmacrosdir')
106if rpmmacrosdir != 'no'
107 rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
108endif
109modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
110
111# Our own paths
112pkgdatadir = join_paths(datadir, 'systemd')
113environmentdir = join_paths(prefixdir, 'lib/environment.d')
114pkgsysconfdir = join_paths(sysconfdir, 'systemd')
115userunitdir = join_paths(prefixdir, 'lib/systemd/user')
116userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
117tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
118sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
119sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
120binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
121modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
122networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
123pkgincludedir = join_paths(includedir, 'systemd')
124systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
125usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
126systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
127userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
128systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
129systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
130systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
131systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
132udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
133udevhomedir = udevlibexecdir
134udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
135udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
136catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
137kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
138factorydir = join_paths(datadir, 'factory')
139docdir = join_paths(datadir, 'doc/systemd')
140bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
141testsdir = join_paths(prefixdir, 'lib/systemd/tests')
142systemdstatedir = join_paths(localstatedir, 'lib/systemd')
143catalogstatedir = join_paths(systemdstatedir, 'catalog')
144randomseeddir = join_paths(localstatedir, 'lib/systemd')
145
146dbuspolicydir = get_option('dbuspolicydir')
147if dbuspolicydir == ''
148 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
149endif
150
151dbussessionservicedir = get_option('dbussessionservicedir')
152if dbussessionservicedir == ''
153 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
154endif
155
156dbussystemservicedir = get_option('dbussystemservicedir')
157if dbussystemservicedir == ''
158 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
159endif
160
161pamlibdir = get_option('pamlibdir')
162if pamlibdir == ''
163 pamlibdir = join_paths(rootlibdir, 'security')
164endif
165
166pamconfdir = get_option('pamconfdir')
167if pamconfdir == ''
168 pamconfdir = join_paths(sysconfdir, 'pam.d')
169endif
170
171conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
172conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
173conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
174conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
175conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
176conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
177conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
178conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
179conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
180conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
181conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
182conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
183conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
184conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
185conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
186conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
187conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
188conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
189conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
190conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
191conf.set_quoted('ROOTPREFIX', rootprefixdir)
192conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
193conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
194conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
195conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
196conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
197conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
198conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
199conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
200conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
201conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
202conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
203conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
204conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
205conf.set_quoted('LIBDIR', libdir)
206conf.set_quoted('ROOTLIBDIR', rootlibdir)
207conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
208conf.set_quoted('BOOTLIBDIR', bootlibdir)
209conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
210conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
211conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
212conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
213conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
214conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
215
216conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
217conf.set_quoted('ABS_SRC_DIR', meson.source_root())
218
219substs.set('prefix', prefixdir)
220substs.set('exec_prefix', prefixdir)
221substs.set('libdir', libdir)
222substs.set('rootlibdir', rootlibdir)
223substs.set('includedir', includedir)
224substs.set('pkgsysconfdir', pkgsysconfdir)
225substs.set('bindir', bindir)
226substs.set('rootbindir', rootbindir)
227substs.set('rootlibexecdir', rootlibexecdir)
228substs.set('systemunitdir', systemunitdir)
229substs.set('userunitdir', userunitdir)
230substs.set('systempresetdir', systempresetdir)
231substs.set('userpresetdir', userpresetdir)
232substs.set('udevhwdbdir', udevhwdbdir)
233substs.set('udevrulesdir', udevrulesdir)
234substs.set('udevlibexecdir', udevlibexecdir)
235substs.set('catalogdir', catalogdir)
236substs.set('tmpfilesdir', tmpfilesdir)
237substs.set('sysusersdir', sysusersdir)
238substs.set('sysctldir', sysctldir)
239substs.set('binfmtdir', binfmtdir)
240substs.set('modulesloaddir', modulesloaddir)
241substs.set('systemgeneratordir', systemgeneratordir)
242substs.set('usergeneratordir', usergeneratordir)
243substs.set('systemenvgeneratordir', systemenvgeneratordir)
244substs.set('userenvgeneratordir', userenvgeneratordir)
245substs.set('systemshutdowndir', systemshutdowndir)
246substs.set('systemsleepdir', systemsleepdir)
247substs.set('VARLOGDIR', varlogdir)
248substs.set('CERTIFICATEROOT', get_option('certificate-root'))
249substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
250substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
251substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
252substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
253substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
254substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
255
256#####################################################################
257
258cc = meson.get_compiler('c')
259pkgconfig = import('pkgconfig')
260check_compilation_sh = find_program('tools/meson-check-compilation.sh')
261
262cxx = find_program('c++', required : false)
263if cxx.found()
264 # Used only for tests
265 add_languages('cpp')
266endif
267
268foreach arg : ['-Wextra',
269 '-Werror=undef',
270 '-Wlogical-op',
271 '-Wmissing-include-dirs',
272 '-Wold-style-definition',
273 '-Wpointer-arith',
274 '-Winit-self',
275 '-Wdeclaration-after-statement',
276 '-Wfloat-equal',
277 '-Wsuggest-attribute=noreturn',
278 '-Werror=missing-prototypes',
279 '-Werror=implicit-function-declaration',
280 '-Werror=missing-declarations',
281 '-Werror=return-type',
282 '-Werror=incompatible-pointer-types',
283 '-Werror=format=2',
284 '-Wstrict-prototypes',
285 '-Wredundant-decls',
286 '-Wmissing-noreturn',
287 '-Wimplicit-fallthrough=5',
288 '-Wshadow',
289 '-Wendif-labels',
290 '-Wstrict-aliasing=2',
291 '-Wwrite-strings',
292 '-Werror=overflow',
293 '-Wdate-time',
294 '-Wnested-externs',
295 '-ffast-math',
296 '-fno-common',
297 '-fdiagnostics-show-option',
298 '-fno-strict-aliasing',
299 '-fvisibility=hidden',
300 '-fstack-protector',
301 '-fstack-protector-strong',
302 '-fPIE',
303 '--param=ssp-buffer-size=4',
304 ]
305 if cc.has_argument(arg)
306 add_project_arguments(arg, language : 'c')
307 endif
308endforeach
309
310# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
311# arguments, just emits a warnings. So test for the "positive" version instead.
312foreach arg : ['unused-parameter',
313 'missing-field-initializers',
314 'unused-result',
315 'format-signedness',
316 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
317 ]
318 if cc.has_argument('-W' + arg)
319 add_project_arguments('-Wno-' + arg, language : 'c')
320 endif
321endforeach
322
323if cc.compiles('
324 #include <time.h>
325 #include <inttypes.h>
326 typedef uint64_t usec_t;
327 usec_t now(clockid_t clock);
328 int main(void) {
329 struct timespec now;
330 return 0;
331 }
332', name : '-Werror=shadow with local shadowing')
333 add_project_arguments('-Werror=shadow', language : 'c')
334endif
335
336if cc.get_id() == 'clang'
337 foreach arg : ['-Wno-typedef-redefinition',
338 '-Wno-gnu-variable-sized-type-not-at-end',
339 ]
340 if cc.has_argument(arg,
341 name : '@0@ is supported'.format(arg))
342 add_project_arguments(arg, language : 'c')
343 endif
344 endforeach
345endif
346
347link_test_c = files('tools/meson-link-test.c')
348
349# --as-needed and --no-undefined are provided by meson by default,
350# run mesonconf to see what is enabled
351foreach arg : ['-Wl,-z,relro',
352 '-Wl,-z,now',
353 '-pie',
354 ]
355
356 have = run_command(check_compilation_sh,
357 cc.cmd_array(), '-x', 'c', arg,
358 '-include', link_test_c).returncode() == 0
359 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
360 if have
361 add_project_link_arguments(arg, language : 'c')
362 endif
363endforeach
364
365if get_option('buildtype') != 'debug'
366 foreach arg : ['-ffunction-sections',
367 '-fdata-sections']
368 if cc.has_argument(arg,
369 name : '@0@ is supported'.format(arg))
370 add_project_arguments(arg, language : 'c')
371 endif
372 endforeach
373
374 foreach arg : ['-Wl,--gc-sections']
375 have = run_command(check_compilation_sh,
376 cc.cmd_array(), '-x', 'c', arg,
377 '-include', link_test_c).returncode() == 0
378 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
379 if have
380 add_project_link_arguments(arg, language : 'c')
381 endif
382 endforeach
383endif
384
385cpp = ' '.join(cc.cmd_array()) + ' -E'
386
387#####################################################################
388# compilation result tests
389
390conf.set('_GNU_SOURCE', true)
391conf.set('__SANE_USERSPACE_TYPES__', true)
392
393conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
394conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
395conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
396conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
397conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
398conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
399conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
400
401decl_headers = '''
402#include <uchar.h>
403#include <linux/ethtool.h>
404#include <linux/fib_rules.h>
405'''
406# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
407
408foreach decl : ['char16_t',
409 'char32_t',
410 'key_serial_t',
411 'struct ethtool_link_settings',
412 'struct fib_rule_uid_range',
413 ]
414
415 # We get -1 if the size cannot be determined
416 have = cc.sizeof(decl, prefix : decl_headers) > 0
417 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
418endforeach
419
420foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
421 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
422 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
423 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
424 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
425 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
426 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
427 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
428 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
429 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
430 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
431 # if_tunnel.h is buggy and cannot be included on its own
432 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
433 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
434 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
435 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
436 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
437 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
438 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
439 ['NDA_IFINDEX', 'linux/neighbour.h'],
440 ['IFA_FLAGS', 'linux/if_addr.h'],
441 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
442 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
443 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
444 ]
445 prefix = decl.length() > 2 ? decl[2] : ''
446 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
447 conf.set10('HAVE_' + decl[0], have)
448endforeach
449
450foreach ident : ['secure_getenv', '__secure_getenv']
451 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
452endforeach
453
454foreach ident : [
455 ['memfd_create', '''#define _GNU_SOURCE
456 #include <sys/mman.h>'''],
457 ['gettid', '''#include <sys/types.h>'''],
458 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
459 ['name_to_handle_at', '''#define _GNU_SOURCE
460 #include <sys/types.h>
461 #include <sys/stat.h>
462 #include <fcntl.h>'''],
463 ['setns', '''#define _GNU_SOURCE
464 #include <sched.h>'''],
465 ['renameat2', '''#include <stdio.h>'''],
466 ['kcmp', '''#include <linux/kcmp.h>'''],
467 ['keyctl', '''#include <sys/types.h>
468 #include <keyutils.h>'''],
469 ['copy_file_range', '''#include <sys/syscall.h>
470 #include <unistd.h>'''],
471 ['bpf', '''#include <sys/syscall.h>
472 #include <unistd.h>'''],
473 ['explicit_bzero' , '''#include <string.h>'''],
474]
475
476 have = cc.has_function(ident[0], prefix : ident[1])
477 conf.set10('HAVE_' + ident[0].to_upper(), have)
478endforeach
479
480if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
481 conf.set10('USE_SYS_RANDOM_H', true)
482 conf.set10('HAVE_GETRANDOM', true)
483else
484 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
485 conf.set10('USE_SYS_RANDOM_H', false)
486 conf.set10('HAVE_GETRANDOM', have)
487endif
488
489#####################################################################
490
491sed = find_program('sed')
492awk = find_program('awk')
493m4 = find_program('m4')
494stat = find_program('stat')
495git = find_program('git', required : false)
496
497meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
498mkdir_p = 'mkdir -p $DESTDIR/@0@'
499test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
500splash_bmp = files('test/splash.bmp')
501
502# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
503# /usr/sbin, /sbin, and fall back to the default from middle column.
504progs = [['telinit', '/lib/sysvinit/telinit'],
505 ['quotaon', '/usr/sbin/quotaon' ],
506 ['quotacheck', '/usr/sbin/quotacheck' ],
507 ['kill', '/usr/bin/kill' ],
508 ['kmod', '/usr/bin/kmod' ],
509 ['kexec', '/usr/sbin/kexec' ],
510 ['sulogin', '/usr/sbin/sulogin' ],
511 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
512 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
513 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
514 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
515 ]
516foreach prog : progs
517 path = get_option(prog[0] + '-path')
518 if path != ''
519 message('Using @1@ for @0@'.format(prog[0], path))
520 else
521 exe = find_program(prog[0],
522 '/usr/sbin/' + prog[0],
523 '/sbin/' + prog[0],
524 required: false)
525 path = exe.found() ? exe.path() : prog[1]
526 endif
527 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
528 conf.set_quoted(name, path)
529 substs.set(name, path)
530endforeach
531
532if run_command('ln', '--relative', '--help').returncode() != 0
533 error('ln does not support --relative')
534endif
535
536############################################################
537
538gperf = find_program('gperf')
539
540gperf_test_format = '''
541#include <string.h>
542const char * in_word_set(const char *, @0@);
543@1@
544'''
545gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
546gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
547gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
548if cc.compiles(gperf_test)
549 gperf_len_type = 'size_t'
550else
551 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
552 if cc.compiles(gperf_test)
553 gperf_len_type = 'unsigned'
554 else
555 error('unable to determine gperf len type')
556 endif
557endif
558message('gperf len type is @0@'.format(gperf_len_type))
559conf.set('GPERF_LEN_TYPE', gperf_len_type,
560 description : 'The type of gperf "len" parameter')
561
562############################################################
563
564if not cc.has_header('sys/capability.h')
565 error('POSIX caps headers not found')
566endif
567foreach header : ['linux/btrfs.h',
568 'linux/memfd.h',
569 'linux/vm_sockets.h',
570 'sys/auxv.h',
571 'valgrind/memcheck.h',
572 'valgrind/valgrind.h',
573 ]
574
575 conf.set10('HAVE_' + header.underscorify().to_upper(),
576 cc.has_header(header))
577endforeach
578
579############################################################
580
581conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
582conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
583gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
584
585default_hierarchy = get_option('default-hierarchy')
586conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
587 description : 'default cgroup hierarchy as string')
588if default_hierarchy == 'legacy'
589 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
590elif default_hierarchy == 'hybrid'
591 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
592else
593 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
594endif
595
596time_epoch = get_option('time-epoch')
597if time_epoch == ''
598 NEWS = files('NEWS')
599 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
600endif
601time_epoch = time_epoch.to_int()
602conf.set('TIME_EPOCH', time_epoch)
603
604system_uid_max = get_option('system-uid-max')
605if system_uid_max == ''
606 system_uid_max = run_command(
607 awk,
608 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
609 '/etc/login.defs').stdout()
610endif
611system_uid_max = system_uid_max.to_int()
612conf.set('SYSTEM_UID_MAX', system_uid_max)
613substs.set('systemuidmax', system_uid_max)
614message('maximum system UID is @0@'.format(system_uid_max))
615
616conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
617conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
618
619system_gid_max = get_option('system-gid-max')
620if system_gid_max == ''
621 system_gid_max = run_command(
622 awk,
623 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
624 '/etc/login.defs').stdout()
625endif
626system_gid_max = system_gid_max.to_int()
627conf.set('SYSTEM_GID_MAX', system_gid_max)
628substs.set('systemgidmax', system_gid_max)
629message('maximum system GID is @0@'.format(system_gid_max))
630
631tty_gid = get_option('tty-gid')
632conf.set('TTY_GID', tty_gid)
633substs.set('TTY_GID', tty_gid)
634
635if get_option('adm-group')
636 m4_defines += ['-DENABLE_ADM_GROUP']
637endif
638
639if get_option('wheel-group')
640 m4_defines += ['-DENABLE_WHEEL_GROUP']
641endif
642
643substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
644substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
645
646kill_user_processes = get_option('default-kill-user-processes')
647conf.set10('KILL_USER_PROCESSES', kill_user_processes)
648substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
649
650dns_servers = get_option('dns-servers')
651conf.set_quoted('DNS_SERVERS', dns_servers)
652substs.set('DNS_SERVERS', dns_servers)
653
654ntp_servers = get_option('ntp-servers')
655conf.set_quoted('NTP_SERVERS', ntp_servers)
656substs.set('NTP_SERVERS', ntp_servers)
657
658conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
659
660substs.set('SUSHELL', get_option('debug-shell'))
661substs.set('DEBUGTTY', get_option('debug-tty'))
662
663debug = get_option('debug')
664enable_debug_hashmap = false
665enable_debug_mmap_cache = false
666if debug != ''
667 foreach name : debug.split(',')
668 if name == 'hashmap'
669 enable_debug_hashmap = true
670 elif name == 'mmap-cache'
671 enable_debug_mmap_cache = true
672 else
673 message('unknown debug option "@0@", ignoring'.format(name))
674 endif
675 endforeach
676endif
677conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
678conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
679
680#####################################################################
681
682threads = dependency('threads')
683librt = cc.find_library('rt')
684libm = cc.find_library('m')
685libdl = cc.find_library('dl')
686libcrypt = cc.find_library('crypt')
687
688libcap = dependency('libcap', required : false)
689if not libcap.found()
690 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
691 libcap = cc.find_library('cap')
692endif
693
694libmount = dependency('mount',
695 version : '>= 2.30')
696
697want_seccomp = get_option('seccomp')
698if want_seccomp != 'false'
699 libseccomp = dependency('libseccomp',
700 version : '>= 2.3.1',
701 required : want_seccomp == 'true')
702 have = libseccomp.found()
703else
704 have = false
705 libseccomp = []
706endif
707conf.set10('HAVE_SECCOMP', have)
708m4_defines += have ? ['-DHAVE_SECCOMP'] : []
709
710want_selinux = get_option('selinux')
711if want_selinux != 'false'
712 libselinux = dependency('libselinux',
713 version : '>= 2.1.9',
714 required : want_selinux == 'true')
715 have = libselinux.found()
716else
717 have = false
718 libselinux = []
719endif
720conf.set10('HAVE_SELINUX', have)
721m4_defines += have ? ['-DHAVE_SELINUX'] : []
722
723want_apparmor = get_option('apparmor')
724if want_apparmor != 'false'
725 libapparmor = dependency('libapparmor',
726 required : want_apparmor == 'true')
727 have = libapparmor.found()
728else
729 have = false
730 libapparmor = []
731endif
732conf.set10('HAVE_APPARMOR', have)
733m4_defines += have ? ['-DHAVE_APPARMOR'] : []
734
735smack_run_label = get_option('smack-run-label')
736if smack_run_label != ''
737 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
738 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
739endif
740
741want_polkit = get_option('polkit')
742install_polkit = false
743install_polkit_pkla = false
744if want_polkit != 'false'
745 install_polkit = true
746
747 libpolkit = dependency('polkit-gobject-1',
748 required : false)
749 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
750 message('Old polkit detected, will install pkla files')
751 install_polkit_pkla = true
752 endif
753endif
754conf.set10('ENABLE_POLKIT', install_polkit)
755
756want_acl = get_option('acl')
757if want_acl != 'false'
758 libacl = cc.find_library('acl', required : want_acl == 'true')
759 have = libacl.found()
760else
761 have = false
762 libacl = []
763endif
764conf.set10('HAVE_ACL', have)
765m4_defines += have ? ['-DHAVE_ACL'] : []
766
767want_audit = get_option('audit')
768if want_audit != 'false'
769 libaudit = dependency('audit', required : want_audit == 'true')
770 have = libaudit.found()
771else
772 have = false
773 libaudit = []
774endif
775conf.set10('HAVE_AUDIT', have)
776
777want_blkid = get_option('blkid')
778if want_blkid != 'false'
779 libblkid = dependency('blkid', required : want_blkid == 'true')
780 have = libblkid.found()
781else
782 have = false
783 libblkid = []
784endif
785conf.set10('HAVE_BLKID', have)
786
787want_kmod = get_option('kmod')
788if want_kmod != 'false'
789 libkmod = dependency('libkmod',
790 version : '>= 15',
791 required : want_kmod == 'true')
792 have = libkmod.found()
793else
794 have = false
795 libkmod = []
796endif
797conf.set10('HAVE_KMOD', have)
798
799want_pam = get_option('pam')
800if want_pam != 'false'
801 libpam = cc.find_library('pam', required : want_pam == 'true')
802 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
803 have = libpam.found() and libpam_misc.found()
804else
805 have = false
806 libpam = []
807 libpam_misc = []
808endif
809conf.set10('HAVE_PAM', have)
810m4_defines += have ? ['-DHAVE_PAM'] : []
811
812want_microhttpd = get_option('microhttpd')
813if want_microhttpd != 'false'
814 libmicrohttpd = dependency('libmicrohttpd',
815 version : '>= 0.9.33',
816 required : want_microhttpd == 'true')
817 have = libmicrohttpd.found()
818else
819 have = false
820 libmicrohttpd = []
821endif
822conf.set10('HAVE_MICROHTTPD', have)
823m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
824
825want_libcryptsetup = get_option('libcryptsetup')
826if want_libcryptsetup != 'false'
827 libcryptsetup = dependency('libcryptsetup',
828 version : '>= 1.6.0',
829 required : want_libcryptsetup == 'true')
830 have = libcryptsetup.found()
831else
832 have = false
833 libcryptsetup = []
834endif
835conf.set10('HAVE_LIBCRYPTSETUP', have)
836
837want_libcurl = get_option('libcurl')
838if want_libcurl != 'false'
839 libcurl = dependency('libcurl',
840 version : '>= 7.32.0',
841 required : want_libcurl == 'true')
842 have = libcurl.found()
843else
844 have = false
845 libcurl = []
846endif
847conf.set10('HAVE_LIBCURL', have)
848m4_defines += have ? ['-DHAVE_LIBCURL'] : []
849
850want_libidn = get_option('libidn')
851want_libidn2 = get_option('libidn2')
852if want_libidn == 'true' and want_libidn2 == 'true'
853 error('libidn and libidn2 cannot be requested simultaneously')
854endif
855
856if want_libidn != 'false' and want_libidn2 != 'true'
857 libidn = dependency('libidn',
858 required : want_libidn == 'true')
859 have = libidn.found()
860else
861 have = false
862 libidn = []
863endif
864conf.set10('HAVE_LIBIDN', have)
865m4_defines += have ? ['-DHAVE_LIBIDN'] : []
866if not have and want_libidn2 != 'false'
867 # libidn is used for both libidn and libidn2 objects
868 libidn = dependency('libidn2',
869 required : want_libidn2 == 'true')
870 have = libidn.found()
871else
872 have = false
873endif
874conf.set10('HAVE_LIBIDN2', have)
875m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
876
877want_libiptc = get_option('libiptc')
878if want_libiptc != 'false'
879 libiptc = dependency('libiptc',
880 required : want_libiptc == 'true')
881 have = libiptc.found()
882else
883 have = false
884 libiptc = []
885endif
886conf.set10('HAVE_LIBIPTC', have)
887m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
888
889want_qrencode = get_option('qrencode')
890if want_qrencode != 'false'
891 libqrencode = dependency('libqrencode',
892 required : want_qrencode == 'true')
893 have = libqrencode.found()
894else
895 have = false
896 libqrencode = []
897endif
898conf.set10('HAVE_QRENCODE', have)
899
900want_gcrypt = get_option('gcrypt')
901if want_gcrypt != 'false'
902 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
903 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
904 have = libgcrypt.found() and libgpg_error.found()
905else
906 have = false
907endif
908if not have
909 # link to neither of the libs if one is not found
910 libgcrypt = []
911 libgpg_error = []
912endif
913conf.set10('HAVE_GCRYPT', have)
914
915want_gnutls = get_option('gnutls')
916if want_gnutls != 'false'
917 libgnutls = dependency('gnutls',
918 version : '>= 3.1.4',
919 required : want_gnutls == 'true')
920 have = libgnutls.found()
921else
922 have = false
923 libgnutls = []
924endif
925conf.set10('HAVE_GNUTLS', have)
926
927want_elfutils = get_option('elfutils')
928if want_elfutils != 'false'
929 libdw = dependency('libdw',
930 required : want_elfutils == 'true')
931 have = libdw.found()
932else
933 have = false
934 libdw = []
935endif
936conf.set10('HAVE_ELFUTILS', have)
937
938want_zlib = get_option('zlib')
939if want_zlib != 'false'
940 libz = dependency('zlib',
941 required : want_zlib == 'true')
942 have = libz.found()
943else
944 have = false
945 libz = []
946endif
947conf.set10('HAVE_ZLIB', have)
948
949want_bzip2 = get_option('bzip2')
950if want_bzip2 != 'false'
951 libbzip2 = cc.find_library('bz2',
952 required : want_bzip2 == 'true')
953 have = libbzip2.found()
954else
955 have = false
956 libbzip2 = []
957endif
958conf.set10('HAVE_BZIP2', have)
959
960want_xz = get_option('xz')
961if want_xz != 'false'
962 libxz = dependency('liblzma',
963 required : want_xz == 'true')
964 have = libxz.found()
965else
966 have = false
967 libxz = []
968endif
969conf.set10('HAVE_XZ', have)
970
971want_lz4 = get_option('lz4')
972if want_lz4 != 'false'
973 liblz4 = dependency('liblz4',
974 required : want_lz4 == 'true')
975 have = liblz4.found()
976else
977 have = false
978 liblz4 = []
979endif
980conf.set10('HAVE_LZ4', have)
981
982want_xkbcommon = get_option('xkbcommon')
983if want_xkbcommon != 'false'
984 libxkbcommon = dependency('xkbcommon',
985 version : '>= 0.3.0',
986 required : want_xkbcommon == 'true')
987 have = libxkbcommon.found()
988else
989 have = false
990 libxkbcommon = []
991endif
992conf.set10('HAVE_XKBCOMMON', have)
993
994want_glib = get_option('glib')
995if want_glib != 'false'
996 libglib = dependency('glib-2.0',
997 version : '>= 2.22.0',
998 required : want_glib == 'true')
999 libgobject = dependency('gobject-2.0',
1000 version : '>= 2.22.0',
1001 required : want_glib == 'true')
1002 libgio = dependency('gio-2.0',
1003 required : want_glib == 'true')
1004 have = libglib.found() and libgobject.found() and libgio.found()
1005else
1006 have = false
1007 libglib = []
1008 libgobject = []
1009 libgio = []
1010endif
1011conf.set10('HAVE_GLIB', have)
1012
1013want_dbus = get_option('dbus')
1014if want_dbus != 'false'
1015 libdbus = dependency('dbus-1',
1016 version : '>= 1.3.2',
1017 required : want_dbus == 'true')
1018 have = libdbus.found()
1019else
1020 have = false
1021 libdbus = []
1022endif
1023conf.set10('HAVE_DBUS', have)
1024
1025default_dnssec = get_option('default-dnssec')
1026if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
1027 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1028 default_dnssec = 'no'
1029endif
1030conf.set('DEFAULT_DNSSEC_MODE',
1031 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1032substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1033
1034want_importd = get_option('importd')
1035if want_importd != 'false'
1036 have = (conf.get('HAVE_LIBCURL') == 1 and
1037 conf.get('HAVE_ZLIB') == 1 and
1038 conf.get('HAVE_BZIP2') == 1 and
1039 conf.get('HAVE_XZ') == 1 and
1040 conf.get('HAVE_GCRYPT') == 1)
1041 if want_importd == 'true' and not have
1042 error('importd support was requested, but dependencies are not available')
1043 endif
1044else
1045 have = false
1046endif
1047conf.set10('ENABLE_IMPORTD', have)
1048
1049want_remote = get_option('remote')
1050if want_remote != 'false'
1051 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1052 conf.get('HAVE_LIBCURL') == 1]
1053 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1054 # it's possible to build one without the other. Complain only if
1055 # support was explictly requested. The auxiliary files like sysusers
1056 # config should be installed when any of the programs are built.
1057 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1058 error('remote support was requested, but dependencies are not available')
1059 endif
1060 have = have_deps[0] or have_deps[1]
1061else
1062 have = false
1063endif
1064conf.set10('ENABLE_REMOTE', have)
1065
1066foreach term : ['utmp',
1067 'hibernate',
1068 'environment-d',
1069 'binfmt',
1070 'coredump',
1071 'resolve',
1072 'logind',
1073 'hostnamed',
1074 'localed',
1075 'machined',
1076 'networkd',
1077 'timedated',
1078 'timesyncd',
1079 'myhostname',
1080 'firstboot',
1081 'randomseed',
1082 'backlight',
1083 'vconsole',
1084 'quotacheck',
1085 'sysusers',
1086 'tmpfiles',
1087 'hwdb',
1088 'rfkill',
1089 'ldconfig',
1090 'efi',
1091 'tpm',
1092 'ima',
1093 'smack',
1094 'gshadow',
1095 'idn',
1096 'nss-systemd']
1097 have = get_option(term)
1098 name = 'ENABLE_' + term.underscorify().to_upper()
1099 conf.set10(name, have)
1100 m4_defines += have ? ['-D' + name] : []
1101endforeach
1102
1103want_tests = get_option('tests')
1104install_tests = get_option('install-tests')
1105tests = []
1106
1107conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1108
1109#####################################################################
1110
1111if get_option('efi')
1112 efi_arch = host_machine.cpu_family()
1113
1114 if efi_arch == 'x86'
1115 EFI_MACHINE_TYPE_NAME = 'ia32'
1116 gnu_efi_arch = 'ia32'
1117 elif efi_arch == 'x86_64'
1118 EFI_MACHINE_TYPE_NAME = 'x64'
1119 gnu_efi_arch = 'x86_64'
1120 elif efi_arch == 'arm'
1121 EFI_MACHINE_TYPE_NAME = 'arm'
1122 gnu_efi_arch = 'arm'
1123 elif efi_arch == 'aarch64'
1124 EFI_MACHINE_TYPE_NAME = 'aa64'
1125 gnu_efi_arch = 'aarch64'
1126 else
1127 EFI_MACHINE_TYPE_NAME = ''
1128 gnu_efi_arch = ''
1129 endif
1130
1131 have = true
1132 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
1133
1134 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
1135else
1136 have = false
1137endif
1138conf.set10('ENABLE_EFI', have)
1139
1140#####################################################################
1141
1142config_h = configure_file(
1143 output : 'config.h',
1144 configuration : conf)
1145
1146includes = include_directories('src/basic',
1147 'src/shared',
1148 'src/systemd',
1149 'src/journal',
1150 'src/resolve',
1151 'src/timesync',
1152 'src/login',
1153 'src/udev',
1154 'src/libudev',
1155 'src/core',
1156 'src/libsystemd/sd-bus',
1157 'src/libsystemd/sd-device',
1158 'src/libsystemd/sd-hwdb',
1159 'src/libsystemd/sd-id128',
1160 'src/libsystemd/sd-netlink',
1161 'src/libsystemd/sd-network',
1162 'src/libsystemd-network',
1163 '.',
1164 )
1165
1166add_project_arguments('-include', 'config.h', language : 'c')
1167
1168gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1169 'src/shared/gcrypt-util.c')
1170
1171subdir('po')
1172subdir('catalog')
1173subdir('src/systemd')
1174subdir('src/basic')
1175subdir('src/libsystemd')
1176subdir('src/libsystemd-network')
1177subdir('src/journal')
1178subdir('src/login')
1179
1180libjournal_core = static_library(
1181 'journal-core',
1182 libjournal_core_sources,
1183 journald_gperf_c,
1184 include_directories : includes,
1185 install : false)
1186
1187libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
1188libsystemd = shared_library(
1189 'systemd',
1190 libsystemd_internal_sources,
1191 journal_internal_sources,
1192 version : libsystemd_version,
1193 include_directories : includes,
1194 link_args : ['-shared',
1195 '-Wl,--version-script=' + libsystemd_sym_path],
1196 link_with : [libbasic],
1197 dependencies : [threads,
1198 libgcrypt,
1199 librt,
1200 libxz,
1201 liblz4],
1202 link_depends : libsystemd_sym,
1203 install : true,
1204 install_dir : rootlibdir)
1205
1206############################################################
1207
1208# binaries that have --help and are intended for use by humans,
1209# usually, but not always, installed in /bin.
1210public_programs = []
1211
1212subdir('src/libudev')
1213subdir('src/shared')
1214subdir('src/core')
1215subdir('src/udev')
1216subdir('src/network')
1217
1218subdir('src/analyze')
1219subdir('src/journal-remote')
1220subdir('src/coredump')
1221subdir('src/hostname')
1222subdir('src/import')
1223subdir('src/kernel-install')
1224subdir('src/locale')
1225subdir('src/machine')
1226subdir('src/nspawn')
1227subdir('src/resolve')
1228subdir('src/timedate')
1229subdir('src/timesync')
1230subdir('src/vconsole')
1231subdir('src/sulogin-shell')
1232subdir('src/boot/efi')
1233
1234subdir('src/test')
1235subdir('rules')
1236subdir('test')
1237
1238############################################################
1239
1240# only static linking apart from libdl, to make sure that the
1241# module is linked to all libraries that it uses.
1242test_dlopen = executable(
1243 'test-dlopen',
1244 test_dlopen_c,
1245 include_directories : includes,
1246 link_with : [libbasic],
1247 dependencies : [libdl])
1248
1249foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
1250 ['systemd', 'ENABLE_NSS_SYSTEMD'],
1251 ['mymachines', 'ENABLE_MACHINED'],
1252 ['resolve', 'ENABLE_RESOLVE']]
1253
1254 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
1255 if condition
1256 module = tuple[0]
1257
1258 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1259 version_script_arg = join_paths(meson.current_source_dir(), sym)
1260
1261 nss = shared_library(
1262 'nss_' + module,
1263 'src/nss-@0@/nss-@0@.c'.format(module),
1264 version : '2',
1265 include_directories : includes,
1266 link_args : ['-shared',
1267 '-Wl,--version-script=' + version_script_arg,
1268 '-Wl,--undefined'],
1269 link_with : [libsystemd_internal,
1270 libbasic],
1271 dependencies : [threads,
1272 librt],
1273 link_depends : sym,
1274 install : true,
1275 install_dir : rootlibdir)
1276
1277 # We cannot use shared_module because it does not support version suffix.
1278 # Unfortunately shared_library insists on creating the symlink…
1279 meson.add_install_script('sh', '-c',
1280 'rm $DESTDIR@0@/libnss_@1@.so'
1281 .format(rootlibdir, module))
1282
1283 test('dlopen-nss_' + module,
1284 test_dlopen,
1285 args : [nss.full_path()]) # path to dlopen must include a slash
1286 endif
1287endforeach
1288
1289############################################################
1290
1291executable('systemd',
1292 systemd_sources,
1293 include_directories : includes,
1294 link_with : [libcore,
1295 libshared],
1296 dependencies : [threads,
1297 librt,
1298 libseccomp,
1299 libselinux,
1300 libmount,
1301 libblkid],
1302 install_rpath : rootlibexecdir,
1303 install : true,
1304 install_dir : rootlibexecdir)
1305
1306exe = executable('systemd-analyze',
1307 systemd_analyze_sources,
1308 include_directories : includes,
1309 link_with : [libcore,
1310 libshared],
1311 dependencies : [threads,
1312 librt,
1313 libseccomp,
1314 libselinux,
1315 libmount,
1316 libblkid],
1317 install_rpath : rootlibexecdir,
1318 install : true)
1319public_programs += [exe]
1320
1321executable('systemd-journald',
1322 systemd_journald_sources,
1323 include_directories : includes,
1324 link_with : [libjournal_core,
1325 libshared],
1326 dependencies : [threads,
1327 libxz,
1328 liblz4,
1329 libselinux],
1330 install_rpath : rootlibexecdir,
1331 install : true,
1332 install_dir : rootlibexecdir)
1333
1334exe = executable('systemd-cat',
1335 systemd_cat_sources,
1336 include_directories : includes,
1337 link_with : [libjournal_core,
1338 libshared],
1339 dependencies : [threads],
1340 install_rpath : rootlibexecdir,
1341 install : true)
1342public_programs += [exe]
1343
1344exe = executable('journalctl',
1345 journalctl_sources,
1346 include_directories : includes,
1347 link_with : [libshared],
1348 dependencies : [threads,
1349 libqrencode,
1350 libxz,
1351 liblz4],
1352 install_rpath : rootlibexecdir,
1353 install : true,
1354 install_dir : rootbindir)
1355public_programs += [exe]
1356
1357executable('systemd-getty-generator',
1358 'src/getty-generator/getty-generator.c',
1359 include_directories : includes,
1360 link_with : [libshared],
1361 install_rpath : rootlibexecdir,
1362 install : true,
1363 install_dir : systemgeneratordir)
1364
1365executable('systemd-debug-generator',
1366 'src/debug-generator/debug-generator.c',
1367 include_directories : includes,
1368 link_with : [libshared],
1369 install_rpath : rootlibexecdir,
1370 install : true,
1371 install_dir : systemgeneratordir)
1372
1373executable('systemd-fstab-generator',
1374 'src/fstab-generator/fstab-generator.c',
1375 'src/core/mount-setup.c',
1376 include_directories : includes,
1377 link_with : [libshared],
1378 install_rpath : rootlibexecdir,
1379 install : true,
1380 install_dir : systemgeneratordir)
1381
1382if conf.get('ENABLE_ENVIRONMENT_D') == 1
1383 executable('30-systemd-environment-d-generator',
1384 'src/environment-d-generator/environment-d-generator.c',
1385 include_directories : includes,
1386 link_with : [libshared],
1387 install_rpath : rootlibexecdir,
1388 install : true,
1389 install_dir : userenvgeneratordir)
1390
1391 meson.add_install_script(meson_make_symlink,
1392 join_paths(sysconfdir, 'environment'),
1393 join_paths(environmentdir, '99-environment.conf'))
1394endif
1395
1396if conf.get('ENABLE_HIBERNATE') == 1
1397 executable('systemd-hibernate-resume-generator',
1398 'src/hibernate-resume/hibernate-resume-generator.c',
1399 include_directories : includes,
1400 link_with : [libshared],
1401 install_rpath : rootlibexecdir,
1402 install : true,
1403 install_dir : systemgeneratordir)
1404
1405 executable('systemd-hibernate-resume',
1406 'src/hibernate-resume/hibernate-resume.c',
1407 include_directories : includes,
1408 link_with : [libshared],
1409 install_rpath : rootlibexecdir,
1410 install : true,
1411 install_dir : rootlibexecdir)
1412endif
1413
1414if conf.get('HAVE_BLKID') == 1
1415 executable('systemd-gpt-auto-generator',
1416 'src/gpt-auto-generator/gpt-auto-generator.c',
1417 'src/basic/blkid-util.h',
1418 include_directories : includes,
1419 link_with : [libshared],
1420 dependencies : libblkid,
1421 install_rpath : rootlibexecdir,
1422 install : true,
1423 install_dir : systemgeneratordir)
1424
1425 exe = executable('systemd-dissect',
1426 'src/dissect/dissect.c',
1427 include_directories : includes,
1428 link_with : [libshared],
1429 install_rpath : rootlibexecdir,
1430 install : true,
1431 install_dir : rootlibexecdir)
1432 public_programs += [exe]
1433endif
1434
1435if conf.get('ENABLE_RESOLVE') == 1
1436 executable('systemd-resolved',
1437 systemd_resolved_sources,
1438 gcrypt_util_sources,
1439 include_directories : includes,
1440 link_with : [libshared],
1441 dependencies : [threads,
1442 libgcrypt,
1443 libgpg_error,
1444 libm,
1445 libidn],
1446 install_rpath : rootlibexecdir,
1447 install : true,
1448 install_dir : rootlibexecdir)
1449
1450 exe = executable('systemd-resolve',
1451 systemd_resolve_sources,
1452 gcrypt_util_sources,
1453 include_directories : includes,
1454 link_with : [libshared],
1455 dependencies : [threads,
1456 libgcrypt,
1457 libgpg_error,
1458 libm,
1459 libidn],
1460 install_rpath : rootlibexecdir,
1461 install : true)
1462 public_programs += [exe]
1463endif
1464
1465if conf.get('ENABLE_LOGIND') == 1
1466 executable('systemd-logind',
1467 systemd_logind_sources,
1468 include_directories : includes,
1469 link_with : [liblogind_core,
1470 libshared],
1471 dependencies : [threads,
1472 libacl],
1473 install_rpath : rootlibexecdir,
1474 install : true,
1475 install_dir : rootlibexecdir)
1476
1477 exe = executable('loginctl',
1478 loginctl_sources,
1479 include_directories : includes,
1480 link_with : [libshared],
1481 dependencies : [threads,
1482 liblz4,
1483 libxz],
1484 install_rpath : rootlibexecdir,
1485 install : true,
1486 install_dir : rootbindir)
1487 public_programs += [exe]
1488
1489 exe = executable('systemd-inhibit',
1490 'src/login/inhibit.c',
1491 include_directories : includes,
1492 link_with : [libshared],
1493 install_rpath : rootlibexecdir,
1494 install : true,
1495 install_dir : rootbindir)
1496 public_programs += [exe]
1497
1498 if conf.get('HAVE_PAM') == 1
1499 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1500 pam_systemd = shared_library(
1501 'pam_systemd',
1502 pam_systemd_c,
1503 name_prefix : '',
1504 include_directories : includes,
1505 link_args : ['-shared',
1506 '-Wl,--version-script=' + version_script_arg],
1507 link_with : [libsystemd_internal,
1508 libshared_static],
1509 dependencies : [threads,
1510 libpam,
1511 libpam_misc],
1512 link_depends : pam_systemd_sym,
1513 install : true,
1514 install_dir : pamlibdir)
1515
1516 test('dlopen-pam_systemd',
1517 test_dlopen,
1518 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1519 endif
1520endif
1521
1522if conf.get('HAVE_PAM') == 1
1523 executable('systemd-user-sessions',
1524 'src/user-sessions/user-sessions.c',
1525 include_directories : includes,
1526 link_with : [libshared],
1527 install_rpath : rootlibexecdir,
1528 install : true,
1529 install_dir : rootlibexecdir)
1530endif
1531
1532if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
1533 exe = executable('bootctl',
1534 'src/boot/bootctl.c',
1535 include_directories : includes,
1536 link_with : [libshared],
1537 dependencies : [libblkid],
1538 install_rpath : rootlibexecdir,
1539 install : true)
1540 public_programs += [exe]
1541endif
1542
1543exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1544 include_directories : includes,
1545 link_with : [libshared],
1546 dependencies : [threads],
1547 install_rpath : rootlibexecdir,
1548 install : true)
1549public_programs += [exe]
1550
1551exe = executable('systemctl', 'src/systemctl/systemctl.c',
1552 include_directories : includes,
1553 link_with : [libshared],
1554 dependencies : [threads,
1555 libcap,
1556 libselinux,
1557 libxz,
1558 liblz4],
1559 install_rpath : rootlibexecdir,
1560 install : true,
1561 install_dir : rootbindir)
1562public_programs += [exe]
1563
1564if conf.get('ENABLE_BACKLIGHT') == 1
1565 executable('systemd-backlight',
1566 'src/backlight/backlight.c',
1567 include_directories : includes,
1568 link_with : [libshared],
1569 install_rpath : rootlibexecdir,
1570 install : true,
1571 install_dir : rootlibexecdir)
1572endif
1573
1574if conf.get('ENABLE_RFKILL') == 1
1575 executable('systemd-rfkill',
1576 'src/rfkill/rfkill.c',
1577 include_directories : includes,
1578 link_with : [libshared],
1579 install_rpath : rootlibexecdir,
1580 install : true,
1581 install_dir : rootlibexecdir)
1582endif
1583
1584executable('systemd-system-update-generator',
1585 'src/system-update-generator/system-update-generator.c',
1586 include_directories : includes,
1587 link_with : [libshared],
1588 install_rpath : rootlibexecdir,
1589 install : true,
1590 install_dir : systemgeneratordir)
1591
1592if conf.get('HAVE_LIBCRYPTSETUP') == 1
1593 executable('systemd-cryptsetup',
1594 'src/cryptsetup/cryptsetup.c',
1595 include_directories : includes,
1596 link_with : [libshared],
1597 dependencies : [libcryptsetup],
1598 install_rpath : rootlibexecdir,
1599 install : true,
1600 install_dir : rootlibexecdir)
1601
1602 executable('systemd-cryptsetup-generator',
1603 'src/cryptsetup/cryptsetup-generator.c',
1604 include_directories : includes,
1605 link_with : [libshared],
1606 dependencies : [libcryptsetup],
1607 install_rpath : rootlibexecdir,
1608 install : true,
1609 install_dir : systemgeneratordir)
1610
1611 executable('systemd-veritysetup',
1612 'src/veritysetup/veritysetup.c',
1613 include_directories : includes,
1614 link_with : [libshared],
1615 dependencies : [libcryptsetup],
1616 install_rpath : rootlibexecdir,
1617 install : true,
1618 install_dir : rootlibexecdir)
1619
1620 executable('systemd-veritysetup-generator',
1621 'src/veritysetup/veritysetup-generator.c',
1622 include_directories : includes,
1623 link_with : [libshared],
1624 dependencies : [libcryptsetup],
1625 install_rpath : rootlibexecdir,
1626 install : true,
1627 install_dir : systemgeneratordir)
1628endif
1629
1630if conf.get('HAVE_SYSV_COMPAT') == 1
1631 executable('systemd-sysv-generator',
1632 'src/sysv-generator/sysv-generator.c',
1633 include_directories : includes,
1634 link_with : [libshared],
1635 install_rpath : rootlibexecdir,
1636 install : true,
1637 install_dir : systemgeneratordir)
1638
1639 executable('systemd-rc-local-generator',
1640 'src/rc-local-generator/rc-local-generator.c',
1641 include_directories : includes,
1642 link_with : [libshared],
1643 install_rpath : rootlibexecdir,
1644 install : true,
1645 install_dir : systemgeneratordir)
1646endif
1647
1648if conf.get('ENABLE_HOSTNAMED') == 1
1649 executable('systemd-hostnamed',
1650 'src/hostname/hostnamed.c',
1651 include_directories : includes,
1652 link_with : [libshared],
1653 install_rpath : rootlibexecdir,
1654 install : true,
1655 install_dir : rootlibexecdir)
1656
1657 exe = executable('hostnamectl',
1658 'src/hostname/hostnamectl.c',
1659 include_directories : includes,
1660 link_with : [libshared],
1661 install_rpath : rootlibexecdir,
1662 install : true)
1663 public_programs += [exe]
1664endif
1665
1666if conf.get('ENABLE_LOCALED') == 1
1667 if conf.get('HAVE_XKBCOMMON') == 1
1668 # logind will load libxkbcommon.so dynamically on its own
1669 deps = [libdl]
1670 else
1671 deps = []
1672 endif
1673
1674 executable('systemd-localed',
1675 systemd_localed_sources,
1676 include_directories : includes,
1677 link_with : [libshared],
1678 dependencies : deps,
1679 install_rpath : rootlibexecdir,
1680 install : true,
1681 install_dir : rootlibexecdir)
1682
1683 exe = executable('localectl',
1684 localectl_sources,
1685 include_directories : includes,
1686 link_with : [libshared],
1687 install_rpath : rootlibexecdir,
1688 install : true)
1689 public_programs += [exe]
1690endif
1691
1692if conf.get('ENABLE_TIMEDATED') == 1
1693 executable('systemd-timedated',
1694 'src/timedate/timedated.c',
1695 include_directories : includes,
1696 link_with : [libshared],
1697 install_rpath : rootlibexecdir,
1698 install : true,
1699 install_dir : rootlibexecdir)
1700
1701 exe = executable('timedatectl',
1702 'src/timedate/timedatectl.c',
1703 include_directories : includes,
1704 install_rpath : rootlibexecdir,
1705 link_with : [libshared],
1706 install : true)
1707 public_programs += [exe]
1708endif
1709
1710if conf.get('ENABLE_TIMESYNCD') == 1
1711 executable('systemd-timesyncd',
1712 systemd_timesyncd_sources,
1713 include_directories : includes,
1714 link_with : [libshared],
1715 dependencies : [threads,
1716 libm],
1717 install_rpath : rootlibexecdir,
1718 install : true,
1719 install_dir : rootlibexecdir)
1720endif
1721
1722if conf.get('ENABLE_MACHINED') == 1
1723 executable('systemd-machined',
1724 systemd_machined_sources,
1725 include_directories : includes,
1726 link_with : [libmachine_core,
1727 libshared],
1728 install_rpath : rootlibexecdir,
1729 install : true,
1730 install_dir : rootlibexecdir)
1731
1732 exe = executable('machinectl',
1733 'src/machine/machinectl.c',
1734 include_directories : includes,
1735 link_with : [libshared],
1736 dependencies : [threads,
1737 libxz,
1738 liblz4],
1739 install_rpath : rootlibexecdir,
1740 install : true,
1741 install_dir : rootbindir)
1742 public_programs += [exe]
1743endif
1744
1745if conf.get('ENABLE_IMPORTD') == 1
1746 executable('systemd-importd',
1747 systemd_importd_sources,
1748 include_directories : includes,
1749 link_with : [libshared],
1750 dependencies : [threads],
1751 install_rpath : rootlibexecdir,
1752 install : true,
1753 install_dir : rootlibexecdir)
1754
1755 systemd_pull = executable('systemd-pull',
1756 systemd_pull_sources,
1757 include_directories : includes,
1758 link_with : [libshared],
1759 dependencies : [libcurl,
1760 libz,
1761 libbzip2,
1762 libxz,
1763 libgcrypt],
1764 install_rpath : rootlibexecdir,
1765 install : true,
1766 install_dir : rootlibexecdir)
1767
1768 systemd_import = executable('systemd-import',
1769 systemd_import_sources,
1770 include_directories : includes,
1771 link_with : [libshared],
1772 dependencies : [libcurl,
1773 libz,
1774 libbzip2,
1775 libxz],
1776 install_rpath : rootlibexecdir,
1777 install : true,
1778 install_dir : rootlibexecdir)
1779
1780 systemd_export = executable('systemd-export',
1781 systemd_export_sources,
1782 include_directories : includes,
1783 link_with : [libshared],
1784 dependencies : [libcurl,
1785 libz,
1786 libbzip2,
1787 libxz],
1788 install_rpath : rootlibexecdir,
1789 install : true,
1790 install_dir : rootlibexecdir)
1791 public_programs += [systemd_pull, systemd_import, systemd_export]
1792endif
1793
1794if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
1795 exe = executable('systemd-journal-upload',
1796 systemd_journal_upload_sources,
1797 include_directories : includes,
1798 link_with : [libshared],
1799 dependencies : [threads,
1800 libcurl,
1801 libgnutls,
1802 libxz,
1803 liblz4],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootlibexecdir)
1807 public_programs += [exe]
1808endif
1809
1810if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
1811 s_j_remote = executable('systemd-journal-remote',
1812 systemd_journal_remote_sources,
1813 include_directories : includes,
1814 link_with : [libshared],
1815 dependencies : [threads,
1816 libmicrohttpd,
1817 libgnutls,
1818 libxz,
1819 liblz4],
1820 install_rpath : rootlibexecdir,
1821 install : true,
1822 install_dir : rootlibexecdir)
1823
1824 s_j_gatewayd = executable('systemd-journal-gatewayd',
1825 systemd_journal_gatewayd_sources,
1826 include_directories : includes,
1827 link_with : [libshared],
1828 dependencies : [threads,
1829 libmicrohttpd,
1830 libgnutls,
1831 libxz,
1832 liblz4],
1833 install_rpath : rootlibexecdir,
1834 install : true,
1835 install_dir : rootlibexecdir)
1836 public_programs += [s_j_remote, s_j_gatewayd]
1837endif
1838
1839if conf.get('ENABLE_COREDUMP') == 1
1840 executable('systemd-coredump',
1841 systemd_coredump_sources,
1842 include_directories : includes,
1843 link_with : [libshared],
1844 dependencies : [threads,
1845 libacl,
1846 libdw,
1847 libxz,
1848 liblz4],
1849 install_rpath : rootlibexecdir,
1850 install : true,
1851 install_dir : rootlibexecdir)
1852
1853 exe = executable('coredumpctl',
1854 coredumpctl_sources,
1855 include_directories : includes,
1856 link_with : [libshared],
1857 dependencies : [threads,
1858 libxz,
1859 liblz4],
1860 install_rpath : rootlibexecdir,
1861 install : true)
1862 public_programs += [exe]
1863endif
1864
1865if conf.get('ENABLE_BINFMT') == 1
1866 exe = executable('systemd-binfmt',
1867 'src/binfmt/binfmt.c',
1868 include_directories : includes,
1869 link_with : [libshared],
1870 install_rpath : rootlibexecdir,
1871 install : true,
1872 install_dir : rootlibexecdir)
1873 public_programs += [exe]
1874
1875 meson.add_install_script('sh', '-c',
1876 mkdir_p.format(binfmtdir))
1877 meson.add_install_script('sh', '-c',
1878 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1879endif
1880
1881if conf.get('ENABLE_VCONSOLE') == 1
1882 executable('systemd-vconsole-setup',
1883 'src/vconsole/vconsole-setup.c',
1884 include_directories : includes,
1885 link_with : [libshared],
1886 install_rpath : rootlibexecdir,
1887 install : true,
1888 install_dir : rootlibexecdir)
1889endif
1890
1891if conf.get('ENABLE_RANDOMSEED') == 1
1892 executable('systemd-random-seed',
1893 'src/random-seed/random-seed.c',
1894 include_directories : includes,
1895 link_with : [libshared],
1896 install_rpath : rootlibexecdir,
1897 install : true,
1898 install_dir : rootlibexecdir)
1899endif
1900
1901if conf.get('ENABLE_FIRSTBOOT') == 1
1902 executable('systemd-firstboot',
1903 'src/firstboot/firstboot.c',
1904 include_directories : includes,
1905 link_with : [libshared],
1906 dependencies : [libcrypt],
1907 install_rpath : rootlibexecdir,
1908 install : true,
1909 install_dir : rootbindir)
1910endif
1911
1912executable('systemd-remount-fs',
1913 'src/remount-fs/remount-fs.c',
1914 'src/core/mount-setup.c',
1915 'src/core/mount-setup.h',
1916 include_directories : includes,
1917 link_with : [libshared],
1918 install_rpath : rootlibexecdir,
1919 install : true,
1920 install_dir : rootlibexecdir)
1921
1922executable('systemd-machine-id-setup',
1923 'src/machine-id-setup/machine-id-setup-main.c',
1924 'src/core/machine-id-setup.c',
1925 'src/core/machine-id-setup.h',
1926 include_directories : includes,
1927 link_with : [libshared],
1928 install_rpath : rootlibexecdir,
1929 install : true,
1930 install_dir : rootbindir)
1931
1932executable('systemd-fsck',
1933 'src/fsck/fsck.c',
1934 include_directories : includes,
1935 link_with : [libshared],
1936 install_rpath : rootlibexecdir,
1937 install : true,
1938 install_dir : rootlibexecdir)
1939
1940executable('systemd-growfs',
1941 'src/partition/growfs.c',
1942 include_directories : includes,
1943 link_with : [libshared],
1944 dependencies : [libcryptsetup],
1945 install_rpath : rootlibexecdir,
1946 install : true,
1947 install_dir : rootlibexecdir)
1948
1949executable('systemd-makefs',
1950 'src/partition/makefs.c',
1951 include_directories : includes,
1952 link_with : [libshared],
1953 install_rpath : rootlibexecdir,
1954 install : true,
1955 install_dir : rootlibexecdir)
1956
1957executable('systemd-sleep',
1958 'src/sleep/sleep.c',
1959 include_directories : includes,
1960 link_with : [libshared],
1961 install_rpath : rootlibexecdir,
1962 install : true,
1963 install_dir : rootlibexecdir)
1964
1965exe = executable('systemd-sysctl',
1966 'src/sysctl/sysctl.c',
1967 include_directories : includes,
1968 link_with : [libshared],
1969 install_rpath : rootlibexecdir,
1970 install : true,
1971 install_dir : rootlibexecdir)
1972public_programs += [exe]
1973
1974executable('systemd-ac-power',
1975 'src/ac-power/ac-power.c',
1976 include_directories : includes,
1977 link_with : [libshared],
1978 install_rpath : rootlibexecdir,
1979 install : true,
1980 install_dir : rootlibexecdir)
1981
1982exe = executable('systemd-detect-virt',
1983 'src/detect-virt/detect-virt.c',
1984 include_directories : includes,
1985 link_with : [libshared],
1986 install_rpath : rootlibexecdir,
1987 install : true)
1988public_programs += [exe]
1989
1990exe = executable('systemd-delta',
1991 'src/delta/delta.c',
1992 include_directories : includes,
1993 link_with : [libshared],
1994 install_rpath : rootlibexecdir,
1995 install : true)
1996public_programs += [exe]
1997
1998exe = executable('systemd-escape',
1999 'src/escape/escape.c',
2000 include_directories : includes,
2001 link_with : [libshared],
2002 install_rpath : rootlibexecdir,
2003 install : true,
2004 install_dir : rootbindir)
2005public_programs += [exe]
2006
2007exe = executable('systemd-notify',
2008 'src/notify/notify.c',
2009 include_directories : includes,
2010 link_with : [libshared],
2011 install_rpath : rootlibexecdir,
2012 install : true,
2013 install_dir : rootbindir)
2014public_programs += [exe]
2015
2016executable('systemd-volatile-root',
2017 'src/volatile-root/volatile-root.c',
2018 include_directories : includes,
2019 link_with : [libshared],
2020 install_rpath : rootlibexecdir,
2021 install : true,
2022 install_dir : rootlibexecdir)
2023
2024executable('systemd-cgroups-agent',
2025 'src/cgroups-agent/cgroups-agent.c',
2026 include_directories : includes,
2027 link_with : [libshared],
2028 install_rpath : rootlibexecdir,
2029 install : true,
2030 install_dir : rootlibexecdir)
2031
2032exe = executable('systemd-path',
2033 'src/path/path.c',
2034 include_directories : includes,
2035 link_with : [libshared],
2036 install_rpath : rootlibexecdir,
2037 install : true)
2038public_programs += [exe]
2039
2040exe = executable('systemd-ask-password',
2041 'src/ask-password/ask-password.c',
2042 include_directories : includes,
2043 link_with : [libshared],
2044 install_rpath : rootlibexecdir,
2045 install : true,
2046 install_dir : rootbindir)
2047public_programs += [exe]
2048
2049executable('systemd-reply-password',
2050 'src/reply-password/reply-password.c',
2051 include_directories : includes,
2052 link_with : [libshared],
2053 install_rpath : rootlibexecdir,
2054 install : true,
2055 install_dir : rootlibexecdir)
2056
2057exe = executable('systemd-tty-ask-password-agent',
2058 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2059 include_directories : includes,
2060 link_with : [libshared],
2061 install_rpath : rootlibexecdir,
2062 install : true,
2063 install_dir : rootbindir)
2064public_programs += [exe]
2065
2066exe = executable('systemd-cgls',
2067 'src/cgls/cgls.c',
2068 include_directories : includes,
2069 link_with : [libshared],
2070 install_rpath : rootlibexecdir,
2071 install : true)
2072public_programs += [exe]
2073
2074exe = executable('systemd-cgtop',
2075 'src/cgtop/cgtop.c',
2076 include_directories : includes,
2077 link_with : [libshared],
2078 install_rpath : rootlibexecdir,
2079 install : true)
2080public_programs += [exe]
2081
2082executable('systemd-initctl',
2083 'src/initctl/initctl.c',
2084 include_directories : includes,
2085 link_with : [libshared],
2086 install_rpath : rootlibexecdir,
2087 install : true,
2088 install_dir : rootlibexecdir)
2089
2090exe = executable('systemd-mount',
2091 'src/mount/mount-tool.c',
2092 include_directories : includes,
2093 link_with : [libshared],
2094 install_rpath : rootlibexecdir,
2095 install : true)
2096public_programs += [exe]
2097
2098meson.add_install_script(meson_make_symlink,
2099 'systemd-mount', join_paths(bindir, 'systemd-umount'))
2100
2101exe = executable('systemd-run',
2102 'src/run/run.c',
2103 include_directories : includes,
2104 link_with : [libshared],
2105 install_rpath : rootlibexecdir,
2106 install : true)
2107public_programs += [exe]
2108
2109exe = executable('systemd-stdio-bridge',
2110 'src/stdio-bridge/stdio-bridge.c',
2111 include_directories : includes,
2112 link_with : [libshared],
2113 install_rpath : rootlibexecdir,
2114 install : true)
2115public_programs += [exe]
2116
2117exe = executable('busctl',
2118 'src/busctl/busctl.c',
2119 'src/busctl/busctl-introspect.c',
2120 'src/busctl/busctl-introspect.h',
2121 include_directories : includes,
2122 link_with : [libshared],
2123 install_rpath : rootlibexecdir,
2124 install : true)
2125public_programs += [exe]
2126
2127if conf.get('ENABLE_SYSUSERS') == 1
2128 exe = executable('systemd-sysusers',
2129 'src/sysusers/sysusers.c',
2130 include_directories : includes,
2131 link_with : [libshared],
2132 install_rpath : rootlibexecdir,
2133 install : true,
2134 install_dir : rootbindir)
2135 public_programs += [exe]
2136endif
2137
2138if conf.get('ENABLE_TMPFILES') == 1
2139 exe = executable('systemd-tmpfiles',
2140 'src/tmpfiles/tmpfiles.c',
2141 include_directories : includes,
2142 link_with : [libshared],
2143 dependencies : [libacl],
2144 install_rpath : rootlibexecdir,
2145 install : true,
2146 install_dir : rootbindir)
2147 public_programs += [exe]
2148endif
2149
2150if conf.get('ENABLE_HWDB') == 1
2151 exe = executable('systemd-hwdb',
2152 'src/hwdb/hwdb.c',
2153 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2154 include_directories : includes,
2155 link_with : [libudev_internal],
2156 install_rpath : udev_rpath,
2157 install : true,
2158 install_dir : rootbindir)
2159 public_programs += [exe]
2160endif
2161
2162if conf.get('ENABLE_QUOTACHECK') == 1
2163 executable('systemd-quotacheck',
2164 'src/quotacheck/quotacheck.c',
2165 include_directories : includes,
2166 link_with : [libshared],
2167 install_rpath : rootlibexecdir,
2168 install : true,
2169 install_dir : rootlibexecdir)
2170endif
2171
2172exe = executable('systemd-socket-proxyd',
2173 'src/socket-proxy/socket-proxyd.c',
2174 include_directories : includes,
2175 link_with : [libshared],
2176 dependencies : [threads],
2177 install_rpath : rootlibexecdir,
2178 install : true,
2179 install_dir : rootlibexecdir)
2180public_programs += [exe]
2181
2182exe = executable('systemd-udevd',
2183 systemd_udevd_sources,
2184 include_directories : includes,
2185 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
2186 link_with : [libudev_core,
2187 libsystemd_network,
2188 libudev_internal],
2189 dependencies : [threads,
2190 libkmod,
2191 libidn,
2192 libacl,
2193 libblkid],
2194 install_rpath : udev_rpath,
2195 install : true,
2196 install_dir : rootlibexecdir)
2197public_programs += [exe]
2198
2199exe = executable('udevadm',
2200 udevadm_sources,
2201 include_directories : includes,
2202 link_with : [libudev_core,
2203 libsystemd_network,
2204 libudev_internal],
2205 dependencies : [threads,
2206 libkmod,
2207 libidn,
2208 libacl,
2209 libblkid],
2210 install_rpath : udev_rpath,
2211 install : true,
2212 install_dir : rootbindir)
2213public_programs += [exe]
2214
2215executable('systemd-shutdown',
2216 systemd_shutdown_sources,
2217 include_directories : includes,
2218 link_with : [libshared],
2219 install_rpath : rootlibexecdir,
2220 install : true,
2221 install_dir : rootlibexecdir)
2222
2223executable('systemd-update-done',
2224 'src/update-done/update-done.c',
2225 include_directories : includes,
2226 link_with : [libshared],
2227 install_rpath : rootlibexecdir,
2228 install : true,
2229 install_dir : rootlibexecdir)
2230
2231executable('systemd-update-utmp',
2232 'src/update-utmp/update-utmp.c',
2233 include_directories : includes,
2234 link_with : [libshared],
2235 dependencies : [libaudit],
2236 install_rpath : rootlibexecdir,
2237 install : true,
2238 install_dir : rootlibexecdir)
2239
2240if conf.get('HAVE_KMOD') == 1
2241 executable('systemd-modules-load',
2242 'src/modules-load/modules-load.c',
2243 include_directories : includes,
2244 link_with : [libshared],
2245 dependencies : [libkmod],
2246 install_rpath : rootlibexecdir,
2247 install : true,
2248 install_dir : rootlibexecdir)
2249
2250 meson.add_install_script('sh', '-c',
2251 mkdir_p.format(modulesloaddir))
2252 meson.add_install_script('sh', '-c',
2253 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
2254endif
2255
2256exe = executable('systemd-nspawn',
2257 systemd_nspawn_sources,
2258 'src/core/mount-setup.c', # FIXME: use a variable?
2259 'src/core/mount-setup.h',
2260 'src/core/loopback-setup.c',
2261 'src/core/loopback-setup.h',
2262 include_directories : [includes, include_directories('src/nspawn')],
2263 link_with : [libshared],
2264 dependencies : [libacl,
2265 libblkid,
2266 libseccomp,
2267 libselinux],
2268 install_rpath : rootlibexecdir,
2269 install : true)
2270public_programs += [exe]
2271
2272if conf.get('ENABLE_NETWORKD') == 1
2273 executable('systemd-networkd',
2274 systemd_networkd_sources,
2275 include_directories : includes,
2276 link_with : [libnetworkd_core,
2277 libsystemd_network,
2278 libudev_internal,
2279 libshared],
2280 dependencies : [threads],
2281 install_rpath : rootlibexecdir,
2282 install : true,
2283 install_dir : rootlibexecdir)
2284
2285 executable('systemd-networkd-wait-online',
2286 systemd_networkd_wait_online_sources,
2287 include_directories : includes,
2288 link_with : [libnetworkd_core,
2289 libshared],
2290 install_rpath : rootlibexecdir,
2291 install : true,
2292 install_dir : rootlibexecdir)
2293
2294 exe = executable('networkctl',
2295 networkctl_sources,
2296 include_directories : includes,
2297 link_with : [libsystemd_network,
2298 libshared],
2299 install_rpath : rootlibexecdir,
2300 install : true,
2301 install_dir : rootbindir)
2302 public_programs += [exe]
2303endif
2304############################################################
2305
2306foreach tuple : tests
2307 sources = tuple[0]
2308 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2309 dependencies = tuple[2]
2310 condition = tuple.length() >= 4 ? tuple[3] : ''
2311 type = tuple.length() >= 5 ? tuple[4] : ''
2312 defs = tuple.length() >= 6 ? tuple[5] : []
2313 incs = tuple.length() >= 7 ? tuple[6] : includes
2314 timeout = 30
2315
2316 name = sources[0].split('/')[-1].split('.')[0]
2317 if type.startswith('timeout=')
2318 timeout = type.split('=')[1].to_int()
2319 type = ''
2320 endif
2321
2322 if condition == '' or conf.get(condition) == 1
2323 exe = executable(
2324 name,
2325 sources,
2326 include_directories : incs,
2327 link_with : link_with,
2328 dependencies : dependencies,
2329 c_args : defs,
2330 install_rpath : rootlibexecdir,
2331 install : install_tests,
2332 install_dir : join_paths(testsdir, type))
2333
2334 if type == 'manual'
2335 message('@0@ is a manual test'.format(name))
2336 elif type == 'unsafe' and want_tests != 'unsafe'
2337 message('@0@ is an unsafe test'.format(name))
2338 else
2339 test(name, exe,
2340 env : test_env,
2341 timeout : timeout)
2342 endif
2343 else
2344 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2345 endif
2346endforeach
2347
2348test_libsystemd_sym = executable(
2349 'test-libsystemd-sym',
2350 test_libsystemd_sym_c,
2351 include_directories : includes,
2352 link_with : [libsystemd],
2353 install : install_tests,
2354 install_dir : testsdir)
2355test('test-libsystemd-sym',
2356 test_libsystemd_sym)
2357
2358test_libudev_sym = executable(
2359 'test-libudev-sym',
2360 test_libudev_sym_c,
2361 include_directories : includes,
2362 c_args : ['-Wno-deprecated-declarations'],
2363 link_with : [libudev],
2364 install : install_tests,
2365 install_dir : testsdir)
2366test('test-libudev-sym',
2367 test_libudev_sym)
2368
2369############################################################
2370
2371make_directive_index_py = find_program('tools/make-directive-index.py')
2372make_man_index_py = find_program('tools/make-man-index.py')
2373xml_helper_py = find_program('tools/xml_helper.py')
2374hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
2375
2376subdir('units')
2377subdir('sysctl.d')
2378subdir('sysusers.d')
2379subdir('tmpfiles.d')
2380subdir('hwdb')
2381subdir('network')
2382subdir('man')
2383subdir('shell-completion/bash')
2384subdir('shell-completion/zsh')
2385subdir('docs/sysvinit')
2386subdir('docs/var-log')
2387
2388# FIXME: figure out if the warning is true:
2389# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2390install_subdir('factory/etc',
2391 install_dir : factorydir)
2392
2393
2394install_data('xorg/50-systemd-user.sh',
2395 install_dir : xinitrcdir)
2396install_data('system-preset/90-systemd.preset',
2397 install_dir : systempresetdir)
2398install_data('modprobe.d/systemd.conf',
2399 install_dir : modprobedir)
2400install_data('README',
2401 'NEWS',
2402 'CODING_STYLE',
2403 'DISTRO_PORTING',
2404 'ENVIRONMENT.md',
2405 'LICENSE.GPL2',
2406 'LICENSE.LGPL2.1',
2407 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2408 install_dir : docdir)
2409
2410meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2411meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2412
2413############################################################
2414
2415meson_check_help = find_program('tools/meson-check-help.sh')
2416
2417foreach exec : public_programs
2418 name = exec.full_path().split('/')[-1]
2419 test('check-help-' + name,
2420 meson_check_help,
2421 args : [exec.full_path()])
2422endforeach
2423
2424############################################################
2425
2426if git.found()
2427 all_files = run_command(
2428 git,
2429 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2430 'ls-files',
2431 ':/*.[ch]'])
2432 all_files = files(all_files.stdout().split())
2433
2434 custom_target(
2435 'tags',
2436 output : 'tags',
2437 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
2438 custom_target(
2439 'ctags',
2440 output : 'ctags',
2441 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
2442endif
2443
2444if git.found()
2445 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
2446 run_target(
2447 'git-contrib',
2448 command : [meson_git_contrib_sh])
2449endif
2450
2451if git.found()
2452 git_head = run_command(
2453 git,
2454 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2455 'rev-parse', 'HEAD']).stdout().strip()
2456 git_head_short = run_command(
2457 git,
2458 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
2459 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2460
2461 run_target(
2462 'git-snapshot',
2463 command : ['git', 'archive',
2464 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
2465 git_head_short),
2466 '--prefix', 'systemd-@0@/'.format(git_head),
2467 'HEAD'])
2468endif
2469
2470############################################################
2471
2472status = [
2473 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2474
2475 'prefix directory: @0@'.format(prefixdir),
2476 'rootprefix directory: @0@'.format(rootprefixdir),
2477 'sysconf directory: @0@'.format(sysconfdir),
2478 'include directory: @0@'.format(includedir),
2479 'lib directory: @0@'.format(libdir),
2480 'rootlib directory: @0@'.format(rootlibdir),
2481 'SysV init scripts: @0@'.format(sysvinit_path),
2482 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2483 'PAM modules directory: @0@'.format(pamlibdir),
2484 'PAM configuration directory: @0@'.format(pamconfdir),
2485 'RPM macros directory: @0@'.format(rpmmacrosdir),
2486 'modprobe.d directory: @0@'.format(modprobedir),
2487 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2488 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2489 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2490 'bash completions directory: @0@'.format(bashcompletiondir),
2491 'zsh completions directory: @0@'.format(zshcompletiondir),
2492 'extra start script: @0@'.format(get_option('rc-local')),
2493 'extra stop script: @0@'.format(get_option('halt-local')),
2494 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2495 get_option('debug-tty')),
2496 'TTY GID: @0@'.format(tty_gid),
2497 'maximum system UID: @0@'.format(system_uid_max),
2498 'maximum system GID: @0@'.format(system_gid_max),
2499 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2500 'render group access mode: @0@'.format(get_option('group-render-mode')),
2501 'certificate root directory: @0@'.format(get_option('certificate-root')),
2502 'support URL: @0@'.format(support_url),
2503 'nobody user name: @0@'.format(get_option('nobody-user')),
2504 'nobody group name: @0@'.format(get_option('nobody-group')),
2505 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2506 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
2507
2508 'default DNSSEC mode: @0@'.format(default_dnssec),
2509 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2510 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2511
2512alt_dns_servers = '\n '.join(dns_servers.split(' '))
2513alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2514status += [
2515 'default DNS servers: @0@'.format(alt_dns_servers),
2516 'default NTP servers: @0@'.format(alt_ntp_servers)]
2517
2518alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2519 '@@0@'.format(time_epoch)).stdout().strip()
2520status += [
2521 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2522
2523# TODO:
2524# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2525# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2526# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2527
2528if conf.get('ENABLE_EFI') == 1
2529 status += [
2530 'efi arch: @0@'.format(efi_arch)]
2531
2532 if have_gnu_efi
2533 status += [
2534 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2535 'EFI CC @0@'.format(efi_cc),
2536 'EFI lib directory: @0@'.format(efi_libdir),
2537 'EFI lds directory: @0@'.format(efi_ldsdir),
2538 'EFI include directory: @0@'.format(efi_incdir)]
2539 endif
2540endif
2541
2542found = []
2543missing = []
2544
2545foreach tuple : [
2546 ['libcryptsetup'],
2547 ['PAM'],
2548 ['AUDIT'],
2549 ['IMA'],
2550 ['AppArmor'],
2551 ['SELinux'],
2552 ['SECCOMP'],
2553 ['SMACK'],
2554 ['zlib'],
2555 ['xz'],
2556 ['lz4'],
2557 ['bzip2'],
2558 ['ACL'],
2559 ['gcrypt'],
2560 ['qrencode'],
2561 ['microhttpd'],
2562 ['gnutls'],
2563 ['libcurl'],
2564 ['idn'],
2565 ['libidn2'],
2566 ['libidn'],
2567 ['nss-systemd'],
2568 ['libiptc'],
2569 ['elfutils'],
2570 ['binfmt'],
2571 ['vconsole'],
2572 ['quotacheck'],
2573 ['tmpfiles'],
2574 ['environment.d'],
2575 ['sysusers'],
2576 ['firstboot'],
2577 ['randomseed'],
2578 ['backlight'],
2579 ['rfkill'],
2580 ['logind'],
2581 ['machined'],
2582 ['importd'],
2583 ['hostnamed'],
2584 ['timedated'],
2585 ['timesyncd'],
2586 ['localed'],
2587 ['networkd'],
2588 ['resolve'],
2589 ['coredump'],
2590 ['polkit'],
2591 ['legacy pkla', install_polkit_pkla],
2592 ['efi'],
2593 ['gnu-efi', have_gnu_efi],
2594 ['kmod'],
2595 ['xkbcommon'],
2596 ['blkid'],
2597 ['dbus'],
2598 ['glib'],
2599 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
2600 ['hwdb'],
2601 ['tpm'],
2602 ['man pages', want_man],
2603 ['html pages', want_html],
2604 ['man page indices', want_man and have_lxml],
2605 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
2606 ['SysV compat'],
2607 ['utmp'],
2608 ['ldconfig'],
2609 ['hibernate'],
2610 ['adm group', get_option('adm-group')],
2611 ['wheel group', get_option('wheel-group')],
2612 ['gshadow'],
2613 ['debug hashmap'],
2614 ['debug mmap cache'],
2615]
2616
2617 cond = tuple.get(1, '')
2618 if cond == ''
2619 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2620 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
2621 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
2622 endif
2623 if cond
2624 found += [tuple[0]]
2625 else
2626 missing += [tuple[0]]
2627 endif
2628endforeach
2629
2630status += [
2631 '',
2632 'enabled features: @0@'.format(', '.join(found)),
2633 '',
2634 'disabled features: @0@'.format(', '.join(missing)),
2635 '']
2636message('\n '.join(status))
2637
2638if rootprefixdir != rootprefix_default
2639 message('WARNING:\n' +
2640 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
2641 ' systemd used fixed names for unit file directories and other paths, so anything\n' +
2642 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
2643endif