blob: 784a138f2ff6b396b8edfa6705779c7cfae3fe38 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek3a726fc2017-11-18 18:32:01 +01001# 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
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040018project('systemd', 'c',
Lennart Poetteringcbd73c62017-12-11 16:10:25 +010019 version : '236',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040020 license : 'LGPLv2+',
21 default_options: [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040022 'c_std=gnu99',
23 'prefix=/usr',
24 'sysconfdir=/etc',
25 'localstatedir=/var',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040026 ],
Zbigniew Jędrzejewski-Szmek86ea8d72017-11-20 08:08:43 +010027 meson_version : '>= 0.41',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040028 )
29
Lennart Poetteringcbd73c62017-12-11 16:10:25 +010030libsystemd_version = '0.20.0'
31libudev_version = '1.6.8'
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +020032
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040033# 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
Zbigniew Jędrzejewski-Szmek003c8872017-07-24 04:41:45 -040049# 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
Zbigniew Jędrzejewski-Szmek9a8e64b2017-11-28 21:46:53 +010057split_usr = get_option('split-usr')
58conf.set10('HAVE_SPLIT_USR', split_usr)
59
Zbigniew Jędrzejewski-Szmek74344a12017-11-28 20:00:10 +010060rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek74344a12017-11-28 20:00:10 +010061# Unusual rootprefixdir values are used by some distros
62# (see https://github.com/systemd/systemd/pull/7461).
Zbigniew Jędrzejewski-Szmek9a8e64b2017-11-28 21:46:53 +010063rootprefix_default = get_option('split-usr') ? '/' : '/usr'
64if rootprefixdir == ''
65 rootprefixdir = rootprefix_default
Zbigniew Jędrzejewski-Szmek74344a12017-11-28 20:00:10 +010066endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040067
68sysvinit_path = get_option('sysvinit-path')
69sysvrcnd_path = get_option('sysvrcnd-path')
Max Harmathy54248242017-12-15 16:05:25 +010070have = sysvinit_path != '' and sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +020071conf.set10('HAVE_SYSV_COMPAT', have,
72 description : 'SysV init scripts and rcN.d links are supported')
73m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040074
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('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040080 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040081endif
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 == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040094 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040095endif
96
97# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040098pkgconfigdatadir = 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')
Yu Watanabe8a38aac2017-11-23 22:20:22 +0900105rpmmacrosdir = get_option('rpmmacrosdir')
106if rpmmacrosdir != 'no'
107 rpmmacrosdir = join_paths(prefixdir, rpmmacrosdir)
108endif
Michael Biebl02fa0542017-10-21 08:32:50 +0200109modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400110
111# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -0400112pkgdatadir = 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')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400145
146dbuspolicydir = get_option('dbuspolicydir')
147if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400148 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400149endif
150
151dbussessionservicedir = get_option('dbussessionservicedir')
152if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400153 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400154endif
155
156dbussystemservicedir = get_option('dbussystemservicedir')
157if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400158 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400159endif
160
161pamlibdir = get_option('pamlibdir')
162if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400163 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400164endif
165
166pamconfdir = get_option('pamconfdir')
167if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400168 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400169endif
170
171conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400172conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400173conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
174conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
175conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400176conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
177conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400178conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400179conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
180conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400181conf.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'))
Zbigniew Jędrzejewski-Szmekda495a02017-11-21 23:18:05 +0100185conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs'))
Zbigniew Jędrzejewski-Szmek7f2806d2017-11-29 20:02:11 +0100186conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400187conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
188conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
189conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
190conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
191conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek74344a12017-11-28 20:00:10 +0100192conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400193conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400194conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
195conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400196conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
197conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
198conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
199conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
200conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
201conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400202conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
203conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400204conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400205conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400206conf.set_quoted('LIBDIR', libdir)
207conf.set_quoted('ROOTLIBDIR', rootlibdir)
208conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
209conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400210conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
211conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
212conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
213conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
214conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
215conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400216
217conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
218conf.set_quoted('ABS_SRC_DIR', meson.source_root())
219
220substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400221substs.set('exec_prefix', prefixdir)
222substs.set('libdir', libdir)
223substs.set('rootlibdir', rootlibdir)
224substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400225substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400226substs.set('bindir', bindir)
227substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400228substs.set('rootlibexecdir', rootlibexecdir)
229substs.set('systemunitdir', systemunitdir)
230substs.set('userunitdir', userunitdir)
231substs.set('systempresetdir', systempresetdir)
232substs.set('userpresetdir', userpresetdir)
233substs.set('udevhwdbdir', udevhwdbdir)
234substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400235substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400236substs.set('catalogdir', catalogdir)
237substs.set('tmpfilesdir', tmpfilesdir)
238substs.set('sysusersdir', sysusersdir)
239substs.set('sysctldir', sysctldir)
240substs.set('binfmtdir', binfmtdir)
241substs.set('modulesloaddir', modulesloaddir)
242substs.set('systemgeneratordir', systemgeneratordir)
243substs.set('usergeneratordir', usergeneratordir)
244substs.set('systemenvgeneratordir', systemenvgeneratordir)
245substs.set('userenvgeneratordir', userenvgeneratordir)
246substs.set('systemshutdowndir', systemshutdowndir)
247substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400248substs.set('VARLOGDIR', varlogdir)
249substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400250substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
251substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400252substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
253substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
254substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
255substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400256
257#####################################################################
258
259cc = meson.get_compiler('c')
260pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400261check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400262
Adam Duskett08318a22018-01-15 06:25:46 -0500263if get_option('tests') != 'false'
264 cxx = find_program('c++', required : false)
265 if cxx.found()
266 # Used only for tests
267 add_languages('cpp')
268 endif
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400269endif
270
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -0500271ossfuzz = get_option('oss-fuzz')
272if ossfuzz
273 fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
274endif
275
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400276foreach arg : ['-Wextra',
Zbigniew Jędrzejewski-Szmek70160ce2017-10-03 12:11:49 +0200277 '-Werror=undef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400278 '-Wlogical-op',
279 '-Wmissing-include-dirs',
280 '-Wold-style-definition',
281 '-Wpointer-arith',
282 '-Winit-self',
283 '-Wdeclaration-after-statement',
284 '-Wfloat-equal',
285 '-Wsuggest-attribute=noreturn',
286 '-Werror=missing-prototypes',
287 '-Werror=implicit-function-declaration',
288 '-Werror=missing-declarations',
289 '-Werror=return-type',
290 '-Werror=incompatible-pointer-types',
291 '-Werror=format=2',
292 '-Wstrict-prototypes',
293 '-Wredundant-decls',
294 '-Wmissing-noreturn',
Zbigniew Jędrzejewski-Szmek97279d82017-11-20 14:23:40 +0100295 '-Wimplicit-fallthrough=5',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400296 '-Wshadow',
297 '-Wendif-labels',
298 '-Wstrict-aliasing=2',
299 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400300 '-Werror=overflow',
301 '-Wdate-time',
302 '-Wnested-externs',
303 '-ffast-math',
304 '-fno-common',
305 '-fdiagnostics-show-option',
306 '-fno-strict-aliasing',
307 '-fvisibility=hidden',
308 '-fstack-protector',
309 '-fstack-protector-strong',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400310 '--param=ssp-buffer-size=4',
311 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400312 if cc.has_argument(arg)
313 add_project_arguments(arg, language : 'c')
314 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400315endforeach
316
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -0500317# the oss-fuzz fuzzers are not built with -fPIE, so don't
318# enable it when we are linking against them
319if not ossfuzz
320 if cc.has_argument('-fPIE')
321 add_project_arguments('-fPIE', language : 'c')
322 endif
323endif
324
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400325# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
326# arguments, just emits a warnings. So test for the "positive" version instead.
327foreach arg : ['unused-parameter',
328 'missing-field-initializers',
329 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300330 'format-signedness',
331 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
332 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400333 if cc.has_argument('-W' + arg)
334 add_project_arguments('-Wno-' + arg, language : 'c')
335 endif
336endforeach
337
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400338if cc.compiles('
339 #include <time.h>
340 #include <inttypes.h>
341 typedef uint64_t usec_t;
342 usec_t now(clockid_t clock);
343 int main(void) {
344 struct timespec now;
345 return 0;
346 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400347', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400348 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400349endif
350
351if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400352 foreach arg : ['-Wno-typedef-redefinition',
353 '-Wno-gnu-variable-sized-type-not-at-end',
354 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400355 if cc.has_argument(arg,
356 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400357 add_project_arguments(arg, language : 'c')
358 endif
359 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400360endif
361
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400362link_test_c = files('tools/meson-link-test.c')
363
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400364# --as-needed and --no-undefined are provided by meson by default,
365# run mesonconf to see what is enabled
366foreach arg : ['-Wl,-z,relro',
367 '-Wl,-z,now',
368 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400369 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400370
371 have = run_command(check_compilation_sh,
372 cc.cmd_array(), '-x', 'c', arg,
373 '-include', link_test_c).returncode() == 0
374 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -0500375 if have and (arg != '-pie' or not ossfuzz)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400376 add_project_link_arguments(arg, language : 'c')
377 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400378endforeach
379
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400380if get_option('buildtype') != 'debug'
381 foreach arg : ['-ffunction-sections',
382 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400383 if cc.has_argument(arg,
384 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400385 add_project_arguments(arg, language : 'c')
386 endif
387 endforeach
388
389 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400390 have = run_command(check_compilation_sh,
391 cc.cmd_array(), '-x', 'c', arg,
392 '-include', link_test_c).returncode() == 0
393 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
394 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400395 add_project_link_arguments(arg, language : 'c')
396 endif
397 endforeach
398endif
399
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400400cpp = ' '.join(cc.cmd_array()) + ' -E'
401
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400402#####################################################################
403# compilation result tests
404
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400405conf.set('_GNU_SOURCE', true)
406conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400407
408conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
409conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
410conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
411conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
412conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
413conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
414conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
415
416decl_headers = '''
417#include <uchar.h>
418#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000419#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400420'''
421# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
422
423foreach decl : ['char16_t',
424 'char32_t',
425 'key_serial_t',
426 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000427 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400428 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400429
430 # We get -1 if the size cannot be determined
431 have = cc.sizeof(decl, prefix : decl_headers) > 0
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200432 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400433endforeach
434
435foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
436 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
437 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
438 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
Susant Sahanid3848262017-12-23 23:25:03 +0530439 ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400440 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
441 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
442 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
443 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
444 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530445 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400446 # if_tunnel.h is buggy and cannot be included on its own
447 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
448 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
449 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
450 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
451 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
452 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
453 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
Susant Sahanid3848262017-12-23 23:25:03 +0530454 ['IPVLAN_F_PRIVATE', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400455 ['NDA_IFINDEX', 'linux/neighbour.h'],
456 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000457 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400458 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
Susant Sahanid6df5832017-11-22 12:53:22 +0530459 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400460 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400461 prefix = decl.length() > 2 ? decl[2] : ''
462 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200463 conf.set10('HAVE_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400464endforeach
465
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400466foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200467 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400468endforeach
469
470foreach ident : [
Lennart Poettering85db59b2017-12-25 12:01:14 +0100471 ['memfd_create', '''#include <sys/mman.h>'''],
Lennart Poettering7b961e42017-12-25 12:35:28 +0100472 ['gettid', '''#include <sys/types.h>
473 #include <unistd.h>'''],
Lennart Poettering3c042ad2017-12-25 12:07:40 +0100474 ['pivot_root', '''#include <stdlib.h>
475 #include <unistd.h>'''], # no known header declares pivot_root
Lennart Poettering85db59b2017-12-25 12:01:14 +0100476 ['name_to_handle_at', '''#include <sys/types.h>
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400477 #include <sys/stat.h>
478 #include <fcntl.h>'''],
Lennart Poettering85db59b2017-12-25 12:01:14 +0100479 ['setns', '''#include <sched.h>'''],
Lennart Poettering2acfd0f2017-12-25 12:35:43 +0100480 ['renameat2', '''#include <stdio.h>
481 #include <fcntl.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400482 ['kcmp', '''#include <linux/kcmp.h>'''],
483 ['keyctl', '''#include <sys/types.h>
484 #include <keyutils.h>'''],
Lennart Poettering85db59b2017-12-25 12:01:14 +0100485 ['copy_file_range', '''#include <sys/syscall.h>
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400486 #include <unistd.h>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200487 ['bpf', '''#include <sys/syscall.h>
488 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400489 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400490]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400491
Lennart Poettering85db59b2017-12-25 12:01:14 +0100492 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200493 conf.set10('HAVE_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400494endforeach
495
Lennart Poettering85db59b2017-12-25 12:01:14 +0100496if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200497 conf.set10('USE_SYS_RANDOM_H', true)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200498 conf.set10('HAVE_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400499else
500 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200501 conf.set10('USE_SYS_RANDOM_H', false)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200502 conf.set10('HAVE_GETRANDOM', have)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400503endif
504
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400505#####################################################################
506
507sed = find_program('sed')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400508awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400509m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400510stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400511git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400512
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400513meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400514mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400515test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
516splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400517
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400518# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
519# /usr/sbin, /sbin, and fall back to the default from middle column.
Mike Gilbert2fa645f2018-01-04 07:14:20 -0500520progs = [['quotaon', '/usr/sbin/quotaon' ],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400521 ['quotacheck', '/usr/sbin/quotacheck' ],
522 ['kill', '/usr/bin/kill' ],
523 ['kmod', '/usr/bin/kmod' ],
524 ['kexec', '/usr/sbin/kexec' ],
525 ['sulogin', '/usr/sbin/sulogin' ],
526 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
527 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
528 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
529 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
530 ]
531foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400532 path = get_option(prog[0] + '-path')
533 if path != ''
534 message('Using @1@ for @0@'.format(prog[0], path))
535 else
536 exe = find_program(prog[0],
537 '/usr/sbin/' + prog[0],
538 '/sbin/' + prog[0],
539 required: false)
540 path = exe.found() ? exe.path() : prog[1]
541 endif
542 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
543 conf.set_quoted(name, path)
544 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400545endforeach
546
Mike Gilbert2fa645f2018-01-04 07:14:20 -0500547conf.set_quoted('TELINIT', get_option('telinit-path'))
548
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400549if run_command('ln', '--relative', '--help').returncode() != 0
550 error('ln does not support --relative')
551endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400552
553############################################################
554
555gperf = find_program('gperf')
556
557gperf_test_format = '''
558#include <string.h>
559const char * in_word_set(const char *, @0@);
560@1@
561'''
562gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
563gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
564gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
565if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400566 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400567else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400568 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
569 if cc.compiles(gperf_test)
570 gperf_len_type = 'unsigned'
571 else
572 error('unable to determine gperf len type')
573 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400574endif
575message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400576conf.set('GPERF_LEN_TYPE', gperf_len_type,
577 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400578
579############################################################
580
581if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400582 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400583endif
584foreach header : ['linux/btrfs.h',
585 'linux/memfd.h',
586 'linux/vm_sockets.h',
Zbigniew Jędrzejewski-Szmekaf8786b2017-10-03 12:09:40 +0200587 'sys/auxv.h',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400588 'valgrind/memcheck.h',
589 'valgrind/valgrind.h',
590 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400591
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200592 conf.set10('HAVE_' + header.underscorify().to_upper(),
593 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400594endforeach
595
596############################################################
597
598conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400599conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
600gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400601
602default_hierarchy = get_option('default-hierarchy')
603conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
604 description : 'default cgroup hierarchy as string')
605if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400606 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400607elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400608 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400609else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400610 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400611endif
612
613time_epoch = get_option('time-epoch')
614if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400615 NEWS = files('NEWS')
616 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400617endif
618time_epoch = time_epoch.to_int()
619conf.set('TIME_EPOCH', time_epoch)
620
621system_uid_max = get_option('system-uid-max')
622if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400623 system_uid_max = run_command(
624 awk,
625 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
626 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400627endif
628system_uid_max = system_uid_max.to_int()
629conf.set('SYSTEM_UID_MAX', system_uid_max)
630substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400631message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400632
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400633system_gid_max = get_option('system-gid-max')
634if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400635 system_gid_max = run_command(
636 awk,
637 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
638 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400639endif
640system_gid_max = system_gid_max.to_int()
641conf.set('SYSTEM_GID_MAX', system_gid_max)
642substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400643message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400644
Lennart Poettering87d5e4f2017-12-02 12:48:31 +0100645dynamic_uid_min = get_option('dynamic-uid-min').to_int()
646dynamic_uid_max = get_option('dynamic-uid-max').to_int()
647conf.set('DYNAMIC_UID_MIN', dynamic_uid_min)
648conf.set('DYNAMIC_UID_MAX', dynamic_uid_max)
649substs.set('dynamicuidmin', dynamic_uid_min)
650substs.set('dynamicuidmax', dynamic_uid_max)
651
652container_uid_base_min = get_option('container-uid-base-min').to_int()
653container_uid_base_max = get_option('container-uid-base-max').to_int()
654conf.set('CONTAINER_UID_BASE_MIN', container_uid_base_min)
655conf.set('CONTAINER_UID_BASE_MAX', container_uid_base_max)
656substs.set('containeruidbasemin', container_uid_base_min)
657substs.set('containeruidbasemax', container_uid_base_max)
658
Lennart Poetteringafde4572017-12-05 11:00:24 +0100659nobody_user = get_option('nobody-user')
660nobody_group = get_option('nobody-group')
661
662getent_result = run_command('getent', 'passwd', '65534')
663if getent_result.returncode() == 0
664 name = getent_result.stdout().split(':')[0]
665 if name != nobody_user
666 message('WARNING:\n' +
667 ' 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) +
668 ' Your build will result in an user table setup that is incompatible with the local system.')
669 endif
670endif
671id_result = run_command('id', '-u', nobody_user)
672if id_result.returncode() == 0
673 id = id_result.stdout().to_int()
674 if id != 65534
675 message('WARNING:\n' +
676 ' 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) +
677 ' Your build will result in an user table setup that is incompatible with the local system.')
678 endif
679endif
680
681getent_result = run_command('getent', 'group', '65534')
682if getent_result.returncode() == 0
683 name = getent_result.stdout().split(':')[0]
684 if name != nobody_group
685 message('WARNING:\n' +
686 ' 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) +
687 ' Your build will result in an group table setup that is incompatible with the local system.')
688 endif
689endif
690id_result = run_command('id', '-g', nobody_group)
691if id_result.returncode() == 0
692 id = id_result.stdout().to_int()
693 if id != 65534
694 message('WARNING:\n' +
695 ' 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) +
696 ' Your build will result in an group table setup that is incompatible with the local system.')
697 endif
698endif
Yu Watanabe8374cc62017-12-07 17:19:11 +0900699if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
700 message('WARNING:\n' +
701 ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
702 ' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
703endif
Lennart Poetteringafde4572017-12-05 11:00:24 +0100704
705conf.set_quoted('NOBODY_USER_NAME', nobody_user)
706conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
Yu Watanabe60712022017-12-07 15:49:16 +0900707substs.set('NOBODY_USER_NAME', nobody_user)
708substs.set('NOBODY_GROUP_NAME', nobody_group)
Lennart Poettering87d5e4f2017-12-02 12:48:31 +0100709
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400710tty_gid = get_option('tty-gid')
711conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400712substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400713
Ikey Doherty84786b82017-12-03 12:28:23 +0000714# Ensure provided GID argument is numeric, otherwise fallback to default assignment
715if get_option('users-gid') != ''
Yu Watanabed6806872017-12-05 14:01:39 +0900716 users_gid = get_option('users-gid').to_int()
Ikey Doherty84786b82017-12-03 12:28:23 +0000717else
Yu Watanabed6806872017-12-05 14:01:39 +0900718 users_gid = '-'
Ikey Doherty84786b82017-12-03 12:28:23 +0000719endif
720substs.set('USERS_GID', users_gid)
721
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400722if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400723 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400724endif
725
726if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400727 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400728endif
729
730substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
Tom Stellard4e15a732017-10-31 08:46:24 -0700731substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400732
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400733kill_user_processes = get_option('default-kill-user-processes')
734conf.set10('KILL_USER_PROCESSES', kill_user_processes)
735substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400736
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400737dns_servers = get_option('dns-servers')
738conf.set_quoted('DNS_SERVERS', dns_servers)
739substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400740
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400741ntp_servers = get_option('ntp-servers')
742conf.set_quoted('NTP_SERVERS', ntp_servers)
743substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400744
745conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
746
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400747substs.set('SUSHELL', get_option('debug-shell'))
748substs.set('DEBUGTTY', get_option('debug-tty'))
749
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400750debug = get_option('debug')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200751enable_debug_hashmap = false
752enable_debug_mmap_cache = false
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400753if debug != ''
754 foreach name : debug.split(',')
755 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200756 enable_debug_hashmap = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400757 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200758 enable_debug_mmap_cache = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400759 else
760 message('unknown debug option "@0@", ignoring'.format(name))
761 endif
762 endforeach
763endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200764conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
765conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400766
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400767#####################################################################
768
769threads = dependency('threads')
770librt = cc.find_library('rt')
771libm = cc.find_library('m')
772libdl = cc.find_library('dl')
773libcrypt = cc.find_library('crypt')
774
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400775libcap = dependency('libcap', required : false)
776if not libcap.found()
777 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
778 libcap = cc.find_library('cap')
779endif
780
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400781libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200782 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400783
784want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400785if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400786 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400787 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400788 required : want_seccomp == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200789 have = libseccomp.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400790else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200791 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400792 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400793endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200794conf.set10('HAVE_SECCOMP', have)
795m4_defines += have ? ['-DHAVE_SECCOMP'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400796
797want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400798if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400799 libselinux = dependency('libselinux',
800 version : '>= 2.1.9',
801 required : want_selinux == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200802 have = libselinux.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400803else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200804 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400805 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400806endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200807conf.set10('HAVE_SELINUX', have)
808m4_defines += have ? ['-DHAVE_SELINUX'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400809
810want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400811if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400812 libapparmor = dependency('libapparmor',
813 required : want_apparmor == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200814 have = libapparmor.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400815else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200816 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400817 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400818endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200819conf.set10('HAVE_APPARMOR', have)
820m4_defines += have ? ['-DHAVE_APPARMOR'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400821
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400822smack_run_label = get_option('smack-run-label')
823if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400824 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
825 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400826endif
827
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400828want_polkit = get_option('polkit')
829install_polkit = false
830install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400831if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400832 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400833
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400834 libpolkit = dependency('polkit-gobject-1',
835 required : false)
836 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
837 message('Old polkit detected, will install pkla files')
838 install_polkit_pkla = true
839 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400840endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200841conf.set10('ENABLE_POLKIT', install_polkit)
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400842
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400843want_acl = get_option('acl')
844if want_acl != 'false'
845 libacl = cc.find_library('acl', required : want_acl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200846 have = libacl.found()
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400847else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200848 have = false
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400849 libacl = []
850endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200851conf.set10('HAVE_ACL', have)
852m4_defines += have ? ['-DHAVE_ACL'] : []
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400853
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400854want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400855if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400856 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200857 have = libaudit.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400858else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200859 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400860 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400861endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200862conf.set10('HAVE_AUDIT', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400863
864want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400865if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400866 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200867 have = libblkid.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400868else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200869 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400870 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400871endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200872conf.set10('HAVE_BLKID', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400873
874want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400875if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400876 libkmod = dependency('libkmod',
877 version : '>= 15',
878 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200879 have = libkmod.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400880else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200881 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400882 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400883endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200884conf.set10('HAVE_KMOD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400885
886want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400887if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400888 libpam = cc.find_library('pam', required : want_pam == 'true')
889 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200890 have = libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400891else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200892 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400893 libpam = []
894 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400895endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200896conf.set10('HAVE_PAM', have)
897m4_defines += have ? ['-DHAVE_PAM'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400898
899want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400900if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400901 libmicrohttpd = dependency('libmicrohttpd',
902 version : '>= 0.9.33',
903 required : want_microhttpd == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200904 have = libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400905else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200906 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400907 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400908endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200909conf.set10('HAVE_MICROHTTPD', have)
910m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400911
912want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400913if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400914 libcryptsetup = dependency('libcryptsetup',
915 version : '>= 1.6.0',
916 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200917 have = libcryptsetup.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400918else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200919 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400920 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400921endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200922conf.set10('HAVE_LIBCRYPTSETUP', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400923
924want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400925if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400926 libcurl = dependency('libcurl',
927 version : '>= 7.32.0',
928 required : want_libcurl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200929 have = libcurl.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400930else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200931 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400932 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400933endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200934conf.set10('HAVE_LIBCURL', have)
935m4_defines += have ? ['-DHAVE_LIBCURL'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400936
937want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400938want_libidn2 = get_option('libidn2')
939if want_libidn == 'true' and want_libidn2 == 'true'
940 error('libidn and libidn2 cannot be requested simultaneously')
941endif
942
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400943if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400944 libidn = dependency('libidn',
945 required : want_libidn == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200946 have = libidn.found()
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400947else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200948 have = false
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400949 libidn = []
950endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200951conf.set10('HAVE_LIBIDN', have)
952m4_defines += have ? ['-DHAVE_LIBIDN'] : []
953if not have and want_libidn2 != 'false'
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400954 # libidn is used for both libidn and libidn2 objects
955 libidn = dependency('libidn2',
956 required : want_libidn2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200957 have = libidn.found()
958else
959 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400960endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200961conf.set10('HAVE_LIBIDN2', have)
962m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400963
964want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400965if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400966 libiptc = dependency('libiptc',
967 required : want_libiptc == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200968 have = libiptc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400969else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200970 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400971 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400972endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200973conf.set10('HAVE_LIBIPTC', have)
974m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400975
976want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400977if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400978 libqrencode = dependency('libqrencode',
979 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200980 have = libqrencode.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400981else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200982 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400983 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400984endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200985conf.set10('HAVE_QRENCODE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400986
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400987want_gcrypt = get_option('gcrypt')
988if want_gcrypt != 'false'
989 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
990 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200991 have = libgcrypt.found() and libgpg_error.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400992else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200993 have = false
994endif
995if not have
996 # link to neither of the libs if one is not found
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400997 libgcrypt = []
998 libgpg_error = []
999endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001000conf.set10('HAVE_GCRYPT', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -04001001
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001002want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001003if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001004 libgnutls = dependency('gnutls',
1005 version : '>= 3.1.4',
1006 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001007 have = libgnutls.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001008else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001009 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001010 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001011endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001012conf.set10('HAVE_GNUTLS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001013
1014want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001015if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001016 libdw = dependency('libdw',
1017 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001018 have = libdw.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001019else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001020 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001021 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001022endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001023conf.set10('HAVE_ELFUTILS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001024
1025want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001026if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001027 libz = dependency('zlib',
1028 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001029 have = libz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001030else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001031 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001032 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001033endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001034conf.set10('HAVE_ZLIB', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001035
1036want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001037if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001038 libbzip2 = cc.find_library('bz2',
1039 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001040 have = libbzip2.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001041else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001042 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001043 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001044endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001045conf.set10('HAVE_BZIP2', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001046
1047want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001048if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001049 libxz = dependency('liblzma',
1050 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001051 have = libxz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001052else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001053 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001054 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001055endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001056conf.set10('HAVE_XZ', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001057
1058want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001059if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001060 liblz4 = dependency('liblz4',
1061 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001062 have = liblz4.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001063else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001064 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001065 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001066endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001067conf.set10('HAVE_LZ4', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001068
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -04001069want_xkbcommon = get_option('xkbcommon')
1070if want_xkbcommon != 'false'
1071 libxkbcommon = dependency('xkbcommon',
1072 version : '>= 0.3.0',
1073 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001074 have = libxkbcommon.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -04001075else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001076 have = false
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -04001077 libxkbcommon = []
1078endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001079conf.set10('HAVE_XKBCOMMON', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -04001080
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001081want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001082if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001083 libglib = dependency('glib-2.0',
1084 version : '>= 2.22.0',
1085 required : want_glib == 'true')
1086 libgobject = dependency('gobject-2.0',
1087 version : '>= 2.22.0',
1088 required : want_glib == 'true')
1089 libgio = dependency('gio-2.0',
1090 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001091 have = libglib.found() and libgobject.found() and libgio.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001092else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001093 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001094 libglib = []
1095 libgobject = []
1096 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001097endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001098conf.set10('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001099
1100want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001101if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001102 libdbus = dependency('dbus-1',
1103 version : '>= 1.3.2',
1104 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001105 have = libdbus.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001106else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001107 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001108 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001109endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001110conf.set10('HAVE_DBUS', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001111
Yu Watanabe42303dc2017-06-18 05:22:32 +09001112default_dnssec = get_option('default-dnssec')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001113if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
Yu Watanabe42303dc2017-06-18 05:22:32 +09001114 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1115 default_dnssec = 'no'
1116endif
1117conf.set('DEFAULT_DNSSEC_MODE',
1118 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1119substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1120
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001121want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001122if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001123 have = (conf.get('HAVE_LIBCURL') == 1 and
1124 conf.get('HAVE_ZLIB') == 1 and
1125 conf.get('HAVE_BZIP2') == 1 and
1126 conf.get('HAVE_XZ') == 1 and
1127 conf.get('HAVE_GCRYPT') == 1)
1128 if want_importd == 'true' and not have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001129 error('importd support was requested, but dependencies are not available')
1130 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001131else
1132 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001133endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001134conf.set10('ENABLE_IMPORTD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001135
1136want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001137if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001138 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1139 conf.get('HAVE_LIBCURL') == 1]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001140 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1141 # it's possible to build one without the other. Complain only if
1142 # support was explictly requested. The auxiliary files like sysusers
1143 # config should be installed when any of the programs are built.
1144 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1145 error('remote support was requested, but dependencies are not available')
1146 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001147 have = have_deps[0] or have_deps[1]
1148else
1149 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001150endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001151conf.set10('ENABLE_REMOTE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001152
Zbigniew Jędrzejewski-Szmeka9149d82017-10-03 13:15:27 +02001153foreach term : ['utmp',
1154 'hibernate',
1155 'environment-d',
1156 'binfmt',
1157 'coredump',
1158 'resolve',
1159 'logind',
1160 'hostnamed',
1161 'localed',
1162 'machined',
1163 'networkd',
1164 'timedated',
1165 'timesyncd',
1166 'myhostname',
1167 'firstboot',
1168 'randomseed',
1169 'backlight',
1170 'vconsole',
1171 'quotacheck',
1172 'sysusers',
1173 'tmpfiles',
1174 'hwdb',
1175 'rfkill',
1176 'ldconfig',
1177 'efi',
1178 'tpm',
1179 'ima',
1180 'smack',
1181 'gshadow',
1182 'idn',
1183 'nss-systemd']
1184 have = get_option(term)
1185 name = 'ENABLE_' + term.underscorify().to_upper()
1186 conf.set10(name, have)
1187 m4_defines += have ? ['-D' + name] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001188endforeach
1189
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001190want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001191install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001192tests = []
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -05001193fuzzers = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001194
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001195conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1196
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001197#####################################################################
1198
1199if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001200 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001201
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001202 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001203 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001204 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001205 elif efi_arch == 'x86_64'
1206 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001207 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001208 elif efi_arch == 'arm'
1209 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001210 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001211 elif efi_arch == 'aarch64'
1212 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001213 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001214 else
1215 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001216 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001217 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001218
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001219 have = true
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001220 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001221
1222 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001223else
1224 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001225endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001226conf.set10('ENABLE_EFI', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001227
1228#####################################################################
1229
1230config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001231 output : 'config.h',
1232 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001233
1234includes = include_directories('src/basic',
1235 'src/shared',
1236 'src/systemd',
1237 'src/journal',
1238 'src/resolve',
1239 'src/timesync',
1240 'src/login',
1241 'src/udev',
1242 'src/libudev',
1243 'src/core',
1244 'src/libsystemd/sd-bus',
1245 'src/libsystemd/sd-device',
1246 'src/libsystemd/sd-hwdb',
1247 'src/libsystemd/sd-id128',
1248 'src/libsystemd/sd-netlink',
1249 'src/libsystemd/sd-network',
1250 'src/libsystemd-network',
Zbigniew Jędrzejewski-Szmek2d4ceca2017-12-19 14:19:46 +01001251 '.')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001252
1253add_project_arguments('-include', 'config.h', language : 'c')
1254
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001255subdir('po')
1256subdir('catalog')
1257subdir('src/systemd')
1258subdir('src/basic')
1259subdir('src/libsystemd')
1260subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001261subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001262subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001263
1264libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001265 'journal-core',
1266 libjournal_core_sources,
1267 journald_gperf_c,
1268 include_directories : includes,
1269 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001270
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001271libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001272libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001273 'systemd',
Zbigniew Jędrzejewski-Szmek7f1ea2c2017-12-20 09:12:08 +01001274 'src/systemd/sd-id128.h', # pick a header file at random to work around old meson bug
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +02001275 version : libsystemd_version,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001276 include_directories : includes,
1277 link_args : ['-shared',
1278 '-Wl,--version-script=' + libsystemd_sym_path],
Zbigniew Jędrzejewski-Szmek34e221a2017-12-19 19:06:56 +01001279 link_with : [libbasic,
1280 libbasic_gcrypt],
Zbigniew Jędrzejewski-Szmek5e3cec82017-12-19 19:38:43 +01001281 link_whole : [libsystemd_static,
1282 libjournal_client],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001283 dependencies : [threads,
1284 librt,
1285 libxz,
1286 liblz4],
1287 link_depends : libsystemd_sym,
1288 install : true,
1289 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001290
1291############################################################
1292
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001293# binaries that have --help and are intended for use by humans,
1294# usually, but not always, installed in /bin.
1295public_programs = []
1296
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001297subdir('src/libudev')
1298subdir('src/shared')
1299subdir('src/core')
1300subdir('src/udev')
1301subdir('src/network')
1302
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001303subdir('src/analyze')
1304subdir('src/journal-remote')
1305subdir('src/coredump')
1306subdir('src/hostname')
1307subdir('src/import')
1308subdir('src/kernel-install')
1309subdir('src/locale')
1310subdir('src/machine')
1311subdir('src/nspawn')
1312subdir('src/resolve')
1313subdir('src/timedate')
1314subdir('src/timesync')
1315subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001316subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001317
1318subdir('src/test')
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -05001319subdir('src/fuzz')
Zbigniew Jędrzejewski-Szmek6b97bf22017-11-22 12:42:28 +01001320subdir('rules')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001321subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001322
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001323############################################################
1324
1325# only static linking apart from libdl, to make sure that the
1326# module is linked to all libraries that it uses.
1327test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001328 'test-dlopen',
1329 test_dlopen_c,
1330 include_directories : includes,
1331 link_with : [libbasic],
1332 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001333
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02001334foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001335 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001336 ['mymachines', 'ENABLE_MACHINED'],
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001337 ['resolve', 'ENABLE_RESOLVE']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001338
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001339 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001340 if condition
1341 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001342
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001343 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1344 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001345
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001346 nss = shared_library(
1347 'nss_' + module,
1348 'src/nss-@0@/nss-@0@.c'.format(module),
1349 version : '2',
1350 include_directories : includes,
Lennart Poetteringb4b36f42017-12-12 20:13:16 +01001351 # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
1352 link_args : ['-Wl,-z,nodelete',
1353 '-shared',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001354 '-Wl,--version-script=' + version_script_arg,
1355 '-Wl,--undefined'],
Zbigniew Jędrzejewski-Szmek37e4d7a2017-12-19 11:35:01 +01001356 link_with : [libsystemd_static,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001357 libbasic],
1358 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001359 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001360 link_depends : sym,
1361 install : true,
1362 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001363
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001364 # We cannot use shared_module because it does not support version suffix.
1365 # Unfortunately shared_library insists on creating the symlink…
1366 meson.add_install_script('sh', '-c',
1367 'rm $DESTDIR@0@/libnss_@1@.so'
1368 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001369
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001370 test('dlopen-nss_' + module,
1371 test_dlopen,
1372 args : [nss.full_path()]) # path to dlopen must include a slash
1373 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001374endforeach
1375
1376############################################################
1377
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001378executable('systemd',
1379 systemd_sources,
1380 include_directories : includes,
1381 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001382 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001383 dependencies : [threads,
1384 librt,
1385 libseccomp,
1386 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001387 libmount,
1388 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001389 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001390 install : true,
1391 install_dir : rootlibexecdir)
1392
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001393exe = executable('systemd-analyze',
1394 systemd_analyze_sources,
1395 include_directories : includes,
1396 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001397 libshared],
1398 dependencies : [threads,
1399 librt,
1400 libseccomp,
1401 libselinux,
1402 libmount,
1403 libblkid],
1404 install_rpath : rootlibexecdir,
1405 install : true)
1406public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001407
1408executable('systemd-journald',
1409 systemd_journald_sources,
1410 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001411 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001412 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001413 dependencies : [threads,
1414 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001415 liblz4,
1416 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001417 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001418 install : true,
1419 install_dir : rootlibexecdir)
1420
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001421exe = executable('systemd-cat',
1422 systemd_cat_sources,
1423 include_directories : includes,
1424 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001425 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001426 dependencies : [threads],
1427 install_rpath : rootlibexecdir,
1428 install : true)
1429public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001430
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001431exe = executable('journalctl',
1432 journalctl_sources,
1433 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001434 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001435 dependencies : [threads,
1436 libqrencode,
1437 libxz,
1438 liblz4],
1439 install_rpath : rootlibexecdir,
1440 install : true,
1441 install_dir : rootbindir)
1442public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001443
1444executable('systemd-getty-generator',
1445 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001446 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001447 link_with : [libshared],
1448 install_rpath : rootlibexecdir,
1449 install : true,
1450 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001451
1452executable('systemd-debug-generator',
1453 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001454 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001455 link_with : [libshared],
1456 install_rpath : rootlibexecdir,
1457 install : true,
1458 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001459
1460executable('systemd-fstab-generator',
1461 'src/fstab-generator/fstab-generator.c',
1462 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001463 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001464 link_with : [libshared],
1465 install_rpath : rootlibexecdir,
1466 install : true,
1467 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001468
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001469if conf.get('ENABLE_ENVIRONMENT_D') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001470 executable('30-systemd-environment-d-generator',
1471 'src/environment-d-generator/environment-d-generator.c',
1472 include_directories : includes,
1473 link_with : [libshared],
1474 install_rpath : rootlibexecdir,
1475 install : true,
1476 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001477
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001478 meson.add_install_script(meson_make_symlink,
1479 join_paths(sysconfdir, 'environment'),
1480 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001481endif
1482
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001483if conf.get('ENABLE_HIBERNATE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001484 executable('systemd-hibernate-resume-generator',
1485 'src/hibernate-resume/hibernate-resume-generator.c',
1486 include_directories : includes,
1487 link_with : [libshared],
1488 install_rpath : rootlibexecdir,
1489 install : true,
1490 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001491
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001492 executable('systemd-hibernate-resume',
1493 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001494 include_directories : includes,
1495 link_with : [libshared],
1496 install_rpath : rootlibexecdir,
1497 install : true,
1498 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001499endif
1500
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001501if conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001502 executable('systemd-gpt-auto-generator',
1503 'src/gpt-auto-generator/gpt-auto-generator.c',
1504 'src/basic/blkid-util.h',
1505 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001506 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001507 dependencies : libblkid,
1508 install_rpath : rootlibexecdir,
1509 install : true,
1510 install_dir : systemgeneratordir)
1511
1512 exe = executable('systemd-dissect',
1513 'src/dissect/dissect.c',
1514 include_directories : includes,
1515 link_with : [libshared],
1516 install_rpath : rootlibexecdir,
1517 install : true,
1518 install_dir : rootlibexecdir)
1519 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001520endif
1521
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001522if conf.get('ENABLE_RESOLVE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001523 executable('systemd-resolved',
1524 systemd_resolved_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001525 include_directories : includes,
Zbigniew Jędrzejewski-Szmek34e221a2017-12-19 19:06:56 +01001526 link_with : [libshared,
Zbigniew Jędrzejewski-Szmek568a4ff2017-12-19 22:46:01 +01001527 libbasic_gcrypt,
1528 libsystemd_resolve_core],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001529 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001530 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001531 libm,
1532 libidn],
1533 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001534 install : true,
1535 install_dir : rootlibexecdir)
1536
1537 exe = executable('systemd-resolve',
1538 systemd_resolve_sources,
1539 include_directories : includes,
Zbigniew Jędrzejewski-Szmek34e221a2017-12-19 19:06:56 +01001540 link_with : [libshared,
Zbigniew Jędrzejewski-Szmek568a4ff2017-12-19 22:46:01 +01001541 libbasic_gcrypt,
1542 libsystemd_resolve_core],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001543 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001544 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001545 libm,
1546 libidn],
1547 install_rpath : rootlibexecdir,
1548 install : true)
1549 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001550endif
1551
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001552if conf.get('ENABLE_LOGIND') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001553 executable('systemd-logind',
1554 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001555 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001556 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001557 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001558 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001559 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001560 install_rpath : rootlibexecdir,
1561 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001562 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001563
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001564 exe = executable('loginctl',
1565 loginctl_sources,
1566 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001567 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001568 dependencies : [threads,
1569 liblz4,
1570 libxz],
1571 install_rpath : rootlibexecdir,
1572 install : true,
1573 install_dir : rootbindir)
1574 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001575
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001576 exe = executable('systemd-inhibit',
1577 'src/login/inhibit.c',
1578 include_directories : includes,
1579 link_with : [libshared],
1580 install_rpath : rootlibexecdir,
1581 install : true,
1582 install_dir : rootbindir)
1583 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001584
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001585 if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001586 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1587 pam_systemd = shared_library(
1588 'pam_systemd',
1589 pam_systemd_c,
1590 name_prefix : '',
1591 include_directories : includes,
1592 link_args : ['-shared',
1593 '-Wl,--version-script=' + version_script_arg],
Zbigniew Jędrzejewski-Szmek37e4d7a2017-12-19 11:35:01 +01001594 link_with : [libsystemd_static,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001595 libshared_static],
1596 dependencies : [threads,
1597 libpam,
1598 libpam_misc],
1599 link_depends : pam_systemd_sym,
1600 install : true,
1601 install_dir : pamlibdir)
1602
1603 test('dlopen-pam_systemd',
1604 test_dlopen,
1605 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1606 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001607endif
1608
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001609if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001610 executable('systemd-user-sessions',
1611 'src/user-sessions/user-sessions.c',
1612 include_directories : includes,
1613 link_with : [libshared],
1614 install_rpath : rootlibexecdir,
1615 install : true,
1616 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001617endif
1618
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001619if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001620 exe = executable('bootctl',
1621 'src/boot/bootctl.c',
1622 include_directories : includes,
1623 link_with : [libshared],
1624 dependencies : [libblkid],
1625 install_rpath : rootlibexecdir,
1626 install : true)
1627 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001628endif
1629
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001630exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1631 include_directories : includes,
1632 link_with : [libshared],
1633 dependencies : [threads],
1634 install_rpath : rootlibexecdir,
1635 install : true)
1636public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001637
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001638exe = executable('systemctl', 'src/systemctl/systemctl.c',
1639 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001640 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001641 dependencies : [threads,
1642 libcap,
1643 libselinux,
1644 libxz,
1645 liblz4],
1646 install_rpath : rootlibexecdir,
1647 install : true,
1648 install_dir : rootbindir)
1649public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001650
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001651if conf.get('ENABLE_BACKLIGHT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001652 executable('systemd-backlight',
1653 'src/backlight/backlight.c',
1654 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001655 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001656 install_rpath : rootlibexecdir,
1657 install : true,
1658 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001659endif
1660
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001661if conf.get('ENABLE_RFKILL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001662 executable('systemd-rfkill',
1663 'src/rfkill/rfkill.c',
1664 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001665 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001666 install_rpath : rootlibexecdir,
1667 install : true,
1668 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001669endif
1670
1671executable('systemd-system-update-generator',
1672 'src/system-update-generator/system-update-generator.c',
1673 include_directories : includes,
1674 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001675 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001676 install : true,
1677 install_dir : systemgeneratordir)
1678
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001679if conf.get('HAVE_LIBCRYPTSETUP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001680 executable('systemd-cryptsetup',
1681 'src/cryptsetup/cryptsetup.c',
1682 include_directories : includes,
1683 link_with : [libshared],
1684 dependencies : [libcryptsetup],
1685 install_rpath : rootlibexecdir,
1686 install : true,
1687 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001688
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001689 executable('systemd-cryptsetup-generator',
1690 'src/cryptsetup/cryptsetup-generator.c',
1691 include_directories : includes,
1692 link_with : [libshared],
1693 dependencies : [libcryptsetup],
1694 install_rpath : rootlibexecdir,
1695 install : true,
1696 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001697
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001698 executable('systemd-veritysetup',
1699 'src/veritysetup/veritysetup.c',
1700 include_directories : includes,
1701 link_with : [libshared],
1702 dependencies : [libcryptsetup],
1703 install_rpath : rootlibexecdir,
1704 install : true,
1705 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001706
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001707 executable('systemd-veritysetup-generator',
1708 'src/veritysetup/veritysetup-generator.c',
1709 include_directories : includes,
1710 link_with : [libshared],
1711 dependencies : [libcryptsetup],
1712 install_rpath : rootlibexecdir,
1713 install : true,
1714 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001715endif
1716
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001717if conf.get('HAVE_SYSV_COMPAT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001718 executable('systemd-sysv-generator',
1719 'src/sysv-generator/sysv-generator.c',
1720 include_directories : includes,
1721 link_with : [libshared],
1722 install_rpath : rootlibexecdir,
1723 install : true,
1724 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001725
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001726 executable('systemd-rc-local-generator',
1727 'src/rc-local-generator/rc-local-generator.c',
1728 include_directories : includes,
1729 link_with : [libshared],
1730 install_rpath : rootlibexecdir,
1731 install : true,
1732 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001733endif
1734
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001735if conf.get('ENABLE_HOSTNAMED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001736 executable('systemd-hostnamed',
1737 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001738 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001739 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001740 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001741 install : true,
1742 install_dir : rootlibexecdir)
1743
1744 exe = executable('hostnamectl',
1745 'src/hostname/hostnamectl.c',
1746 include_directories : includes,
1747 link_with : [libshared],
1748 install_rpath : rootlibexecdir,
1749 install : true)
1750 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001751endif
1752
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001753if conf.get('ENABLE_LOCALED') == 1
1754 if conf.get('HAVE_XKBCOMMON') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001755 # logind will load libxkbcommon.so dynamically on its own
1756 deps = [libdl]
1757 else
1758 deps = []
1759 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001760
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001761 executable('systemd-localed',
1762 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001763 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001764 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001765 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001766 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001767 install : true,
1768 install_dir : rootlibexecdir)
1769
1770 exe = executable('localectl',
1771 localectl_sources,
1772 include_directories : includes,
1773 link_with : [libshared],
1774 install_rpath : rootlibexecdir,
1775 install : true)
1776 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001777endif
1778
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001779if conf.get('ENABLE_TIMEDATED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001780 executable('systemd-timedated',
1781 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001782 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001783 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001784 install_rpath : rootlibexecdir,
1785 install : true,
1786 install_dir : rootlibexecdir)
1787
1788 exe = executable('timedatectl',
1789 'src/timedate/timedatectl.c',
1790 include_directories : includes,
1791 install_rpath : rootlibexecdir,
1792 link_with : [libshared],
1793 install : true)
1794 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001795endif
1796
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001797if conf.get('ENABLE_TIMESYNCD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001798 executable('systemd-timesyncd',
1799 systemd_timesyncd_sources,
1800 include_directories : includes,
1801 link_with : [libshared],
1802 dependencies : [threads,
1803 libm],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001807endif
1808
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001809if conf.get('ENABLE_MACHINED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001810 executable('systemd-machined',
1811 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001812 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001813 link_with : [libmachine_core,
1814 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001815 install_rpath : rootlibexecdir,
1816 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001817 install_dir : rootlibexecdir)
1818
1819 exe = executable('machinectl',
1820 'src/machine/machinectl.c',
1821 include_directories : includes,
1822 link_with : [libshared],
1823 dependencies : [threads,
1824 libxz,
1825 liblz4],
1826 install_rpath : rootlibexecdir,
1827 install : true,
1828 install_dir : rootbindir)
1829 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001830endif
1831
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001832if conf.get('ENABLE_IMPORTD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001833 executable('systemd-importd',
1834 systemd_importd_sources,
1835 include_directories : includes,
1836 link_with : [libshared],
1837 dependencies : [threads],
1838 install_rpath : rootlibexecdir,
1839 install : true,
1840 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001841
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001842 systemd_pull = executable('systemd-pull',
1843 systemd_pull_sources,
1844 include_directories : includes,
1845 link_with : [libshared],
1846 dependencies : [libcurl,
1847 libz,
1848 libbzip2,
1849 libxz,
1850 libgcrypt],
1851 install_rpath : rootlibexecdir,
1852 install : true,
1853 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001854
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001855 systemd_import = executable('systemd-import',
1856 systemd_import_sources,
1857 include_directories : includes,
1858 link_with : [libshared],
1859 dependencies : [libcurl,
1860 libz,
1861 libbzip2,
1862 libxz],
1863 install_rpath : rootlibexecdir,
1864 install : true,
1865 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001866
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001867 systemd_export = executable('systemd-export',
1868 systemd_export_sources,
1869 include_directories : includes,
1870 link_with : [libshared],
1871 dependencies : [libcurl,
1872 libz,
1873 libbzip2,
1874 libxz],
1875 install_rpath : rootlibexecdir,
1876 install : true,
1877 install_dir : rootlibexecdir)
1878 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001879endif
1880
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001881if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001882 exe = executable('systemd-journal-upload',
1883 systemd_journal_upload_sources,
1884 include_directories : includes,
1885 link_with : [libshared],
1886 dependencies : [threads,
1887 libcurl,
1888 libgnutls,
1889 libxz,
1890 liblz4],
1891 install_rpath : rootlibexecdir,
1892 install : true,
1893 install_dir : rootlibexecdir)
1894 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001895endif
1896
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001897if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001898 s_j_remote = executable('systemd-journal-remote',
1899 systemd_journal_remote_sources,
1900 include_directories : includes,
1901 link_with : [libshared],
1902 dependencies : [threads,
1903 libmicrohttpd,
1904 libgnutls,
1905 libxz,
1906 liblz4],
1907 install_rpath : rootlibexecdir,
1908 install : true,
1909 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001910
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001911 s_j_gatewayd = executable('systemd-journal-gatewayd',
1912 systemd_journal_gatewayd_sources,
1913 include_directories : includes,
1914 link_with : [libshared],
1915 dependencies : [threads,
1916 libmicrohttpd,
1917 libgnutls,
1918 libxz,
1919 liblz4],
1920 install_rpath : rootlibexecdir,
1921 install : true,
1922 install_dir : rootlibexecdir)
1923 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001924endif
1925
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001926if conf.get('ENABLE_COREDUMP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001927 executable('systemd-coredump',
1928 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001929 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001930 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001931 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001932 libacl,
1933 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001934 libxz,
1935 liblz4],
1936 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001937 install : true,
1938 install_dir : rootlibexecdir)
1939
1940 exe = executable('coredumpctl',
1941 coredumpctl_sources,
1942 include_directories : includes,
1943 link_with : [libshared],
1944 dependencies : [threads,
1945 libxz,
1946 liblz4],
1947 install_rpath : rootlibexecdir,
1948 install : true)
1949 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001950endif
1951
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001952if conf.get('ENABLE_BINFMT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001953 exe = executable('systemd-binfmt',
1954 'src/binfmt/binfmt.c',
1955 include_directories : includes,
1956 link_with : [libshared],
1957 install_rpath : rootlibexecdir,
1958 install : true,
1959 install_dir : rootlibexecdir)
1960 public_programs += [exe]
1961
1962 meson.add_install_script('sh', '-c',
1963 mkdir_p.format(binfmtdir))
1964 meson.add_install_script('sh', '-c',
1965 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1966endif
1967
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001968if conf.get('ENABLE_VCONSOLE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001969 executable('systemd-vconsole-setup',
1970 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001971 include_directories : includes,
1972 link_with : [libshared],
1973 install_rpath : rootlibexecdir,
1974 install : true,
1975 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001976endif
1977
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001978if conf.get('ENABLE_RANDOMSEED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001979 executable('systemd-random-seed',
1980 'src/random-seed/random-seed.c',
1981 include_directories : includes,
1982 link_with : [libshared],
1983 install_rpath : rootlibexecdir,
1984 install : true,
1985 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001986endif
1987
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001988if conf.get('ENABLE_FIRSTBOOT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001989 executable('systemd-firstboot',
1990 'src/firstboot/firstboot.c',
1991 include_directories : includes,
1992 link_with : [libshared],
1993 dependencies : [libcrypt],
1994 install_rpath : rootlibexecdir,
1995 install : true,
1996 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001997endif
1998
1999executable('systemd-remount-fs',
2000 'src/remount-fs/remount-fs.c',
2001 'src/core/mount-setup.c',
2002 'src/core/mount-setup.h',
2003 include_directories : includes,
2004 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04002005 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002006 install : true,
2007 install_dir : rootlibexecdir)
2008
2009executable('systemd-machine-id-setup',
2010 'src/machine-id-setup/machine-id-setup-main.c',
2011 'src/core/machine-id-setup.c',
2012 'src/core/machine-id-setup.h',
2013 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002014 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04002015 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002016 install : true,
2017 install_dir : rootbindir)
2018
2019executable('systemd-fsck',
2020 'src/fsck/fsck.c',
2021 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002022 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002023 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002024 install : true,
2025 install_dir : rootlibexecdir)
2026
Zbigniew Jędrzejewski-Szmek80750ad2017-10-23 13:40:38 +02002027executable('systemd-growfs',
2028 'src/partition/growfs.c',
2029 include_directories : includes,
2030 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekc34b75a2017-11-21 18:56:52 +01002031 dependencies : [libcryptsetup],
Zbigniew Jędrzejewski-Szmek80750ad2017-10-23 13:40:38 +02002032 install_rpath : rootlibexecdir,
2033 install : true,
2034 install_dir : rootlibexecdir)
2035
Zbigniew Jędrzejewski-Szmekb7f28ac2017-11-26 22:51:29 +01002036executable('systemd-makefs',
2037 'src/partition/makefs.c',
2038 include_directories : includes,
2039 link_with : [libshared],
2040 install_rpath : rootlibexecdir,
2041 install : true,
2042 install_dir : rootlibexecdir)
2043
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002044executable('systemd-sleep',
2045 'src/sleep/sleep.c',
2046 include_directories : includes,
2047 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002048 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002049 install : true,
2050 install_dir : rootlibexecdir)
2051
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002052exe = executable('systemd-sysctl',
2053 'src/sysctl/sysctl.c',
2054 include_directories : includes,
2055 link_with : [libshared],
2056 install_rpath : rootlibexecdir,
2057 install : true,
2058 install_dir : rootlibexecdir)
2059public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002060
2061executable('systemd-ac-power',
2062 'src/ac-power/ac-power.c',
2063 include_directories : includes,
2064 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002065 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002066 install : true,
2067 install_dir : rootlibexecdir)
2068
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002069exe = executable('systemd-detect-virt',
2070 'src/detect-virt/detect-virt.c',
2071 include_directories : includes,
2072 link_with : [libshared],
2073 install_rpath : rootlibexecdir,
2074 install : true)
2075public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002076
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002077exe = executable('systemd-delta',
2078 'src/delta/delta.c',
2079 include_directories : includes,
2080 link_with : [libshared],
2081 install_rpath : rootlibexecdir,
2082 install : true)
2083public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002084
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002085exe = executable('systemd-escape',
2086 'src/escape/escape.c',
2087 include_directories : includes,
2088 link_with : [libshared],
2089 install_rpath : rootlibexecdir,
2090 install : true,
2091 install_dir : rootbindir)
2092public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002093
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002094exe = executable('systemd-notify',
2095 'src/notify/notify.c',
2096 include_directories : includes,
2097 link_with : [libshared],
2098 install_rpath : rootlibexecdir,
2099 install : true,
2100 install_dir : rootbindir)
2101public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002102
2103executable('systemd-volatile-root',
2104 'src/volatile-root/volatile-root.c',
2105 include_directories : includes,
2106 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002107 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002108 install : true,
2109 install_dir : rootlibexecdir)
2110
2111executable('systemd-cgroups-agent',
2112 'src/cgroups-agent/cgroups-agent.c',
2113 include_directories : includes,
2114 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002115 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002116 install : true,
2117 install_dir : rootlibexecdir)
2118
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002119exe = executable('systemd-path',
2120 'src/path/path.c',
2121 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002122 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002123 install_rpath : rootlibexecdir,
2124 install : true)
2125public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002126
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002127exe = executable('systemd-ask-password',
2128 'src/ask-password/ask-password.c',
2129 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002130 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002131 install_rpath : rootlibexecdir,
2132 install : true,
2133 install_dir : rootbindir)
2134public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002135
2136executable('systemd-reply-password',
2137 'src/reply-password/reply-password.c',
2138 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002139 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002140 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002141 install : true,
2142 install_dir : rootlibexecdir)
2143
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002144exe = executable('systemd-tty-ask-password-agent',
2145 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2146 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002147 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002148 install_rpath : rootlibexecdir,
2149 install : true,
2150 install_dir : rootbindir)
2151public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002152
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002153exe = executable('systemd-cgls',
2154 'src/cgls/cgls.c',
2155 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002156 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002157 install_rpath : rootlibexecdir,
2158 install : true)
2159public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002160
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002161exe = executable('systemd-cgtop',
2162 'src/cgtop/cgtop.c',
2163 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002164 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002165 install_rpath : rootlibexecdir,
2166 install : true)
2167public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002168
2169executable('systemd-initctl',
2170 'src/initctl/initctl.c',
2171 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002172 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002173 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002174 install : true,
2175 install_dir : rootlibexecdir)
2176
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002177exe = executable('systemd-mount',
2178 'src/mount/mount-tool.c',
2179 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002180 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002181 install_rpath : rootlibexecdir,
2182 install : true)
2183public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002184
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002185meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002186 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002187
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002188exe = executable('systemd-run',
2189 'src/run/run.c',
2190 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002191 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002192 install_rpath : rootlibexecdir,
2193 install : true)
2194public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002195
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002196exe = executable('systemd-stdio-bridge',
2197 'src/stdio-bridge/stdio-bridge.c',
2198 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002199 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002200 install_rpath : rootlibexecdir,
2201 install : true)
2202public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002203
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002204exe = executable('busctl',
2205 'src/busctl/busctl.c',
2206 'src/busctl/busctl-introspect.c',
2207 'src/busctl/busctl-introspect.h',
2208 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002209 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002210 install_rpath : rootlibexecdir,
2211 install : true)
2212public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002213
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002214if conf.get('ENABLE_SYSUSERS') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002215 exe = executable('systemd-sysusers',
2216 'src/sysusers/sysusers.c',
2217 include_directories : includes,
2218 link_with : [libshared],
2219 install_rpath : rootlibexecdir,
2220 install : true,
2221 install_dir : rootbindir)
2222 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002223endif
2224
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002225if conf.get('ENABLE_TMPFILES') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002226 exe = executable('systemd-tmpfiles',
2227 'src/tmpfiles/tmpfiles.c',
2228 include_directories : includes,
2229 link_with : [libshared],
2230 dependencies : [libacl],
2231 install_rpath : rootlibexecdir,
2232 install : true,
2233 install_dir : rootbindir)
2234 public_programs += [exe]
Zbigniew Jędrzejewski-Szmekd9daae52017-11-22 14:13:32 +01002235
2236 test('test-systemd-tmpfiles',
2237 test_systemd_tmpfiles_py,
2238 args : exe.full_path())
2239 # https://github.com/mesonbuild/meson/issues/2681
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002240endif
2241
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002242if conf.get('ENABLE_HWDB') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002243 exe = executable('systemd-hwdb',
2244 'src/hwdb/hwdb.c',
2245 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2246 include_directories : includes,
Zbigniew Jędrzejewski-Szmek0c06b502017-12-19 20:54:46 +01002247 link_with : [libudev_static],
Michael Biebl0da6f392017-04-21 18:32:14 +02002248 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002249 install : true,
2250 install_dir : rootbindir)
2251 public_programs += [exe]
2252endif
2253
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002254if conf.get('ENABLE_QUOTACHECK') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002255 executable('systemd-quotacheck',
2256 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002257 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002258 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002259 install_rpath : rootlibexecdir,
2260 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002261 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002262endif
2263
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002264exe = executable('systemd-socket-proxyd',
2265 'src/socket-proxy/socket-proxyd.c',
2266 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002267 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002268 dependencies : [threads],
2269 install_rpath : rootlibexecdir,
2270 install : true,
2271 install_dir : rootlibexecdir)
2272public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002273
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002274exe = executable('systemd-udevd',
2275 systemd_udevd_sources,
2276 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002277 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002278 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002279 libsystemd_network,
Zbigniew Jędrzejewski-Szmek0c06b502017-12-19 20:54:46 +01002280 libudev_static],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002281 dependencies : [threads,
2282 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002283 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002284 libacl,
2285 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002286 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002287 install : true,
2288 install_dir : rootlibexecdir)
2289public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002290
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002291exe = executable('udevadm',
2292 udevadm_sources,
Franck Bui6671e812017-12-16 09:36:36 +01002293 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002294 include_directories : includes,
2295 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002296 libsystemd_network,
Zbigniew Jędrzejewski-Szmek0c06b502017-12-19 20:54:46 +01002297 libudev_static],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002298 dependencies : [threads,
2299 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002300 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002301 libacl,
2302 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002303 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002304 install : true,
2305 install_dir : rootbindir)
2306public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002307
2308executable('systemd-shutdown',
2309 systemd_shutdown_sources,
2310 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002311 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002312 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002313 install : true,
2314 install_dir : rootlibexecdir)
2315
2316executable('systemd-update-done',
2317 'src/update-done/update-done.c',
2318 include_directories : includes,
2319 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002320 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002321 install : true,
2322 install_dir : rootlibexecdir)
2323
2324executable('systemd-update-utmp',
2325 'src/update-utmp/update-utmp.c',
2326 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002327 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002328 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002329 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002330 install : true,
2331 install_dir : rootlibexecdir)
2332
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002333if conf.get('HAVE_KMOD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002334 executable('systemd-modules-load',
2335 'src/modules-load/modules-load.c',
2336 include_directories : includes,
2337 link_with : [libshared],
2338 dependencies : [libkmod],
2339 install_rpath : rootlibexecdir,
2340 install : true,
2341 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002342
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002343 meson.add_install_script('sh', '-c',
2344 mkdir_p.format(modulesloaddir))
2345 meson.add_install_script('sh', '-c',
2346 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002347endif
2348
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002349exe = executable('systemd-nspawn',
2350 systemd_nspawn_sources,
2351 'src/core/mount-setup.c', # FIXME: use a variable?
2352 'src/core/mount-setup.h',
2353 'src/core/loopback-setup.c',
2354 'src/core/loopback-setup.h',
2355 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002356 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002357 dependencies : [libacl,
2358 libblkid,
2359 libseccomp,
2360 libselinux],
2361 install_rpath : rootlibexecdir,
2362 install : true)
2363public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002364
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002365if conf.get('ENABLE_NETWORKD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002366 executable('systemd-networkd',
2367 systemd_networkd_sources,
2368 include_directories : includes,
2369 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002370 libsystemd_network,
Zbigniew Jędrzejewski-Szmek0c06b502017-12-19 20:54:46 +01002371 libudev_static,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002372 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002373 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002374 install_rpath : rootlibexecdir,
2375 install : true,
2376 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002377
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002378 executable('systemd-networkd-wait-online',
2379 systemd_networkd_wait_online_sources,
2380 include_directories : includes,
2381 link_with : [libnetworkd_core,
2382 libshared],
2383 install_rpath : rootlibexecdir,
2384 install : true,
2385 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002386
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002387 exe = executable('networkctl',
2388 networkctl_sources,
2389 include_directories : includes,
2390 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002391 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002392 install_rpath : rootlibexecdir,
2393 install : true,
2394 install_dir : rootbindir)
2395 public_programs += [exe]
2396endif
Zbigniew Jędrzejewski-Szmeke821f6a2017-12-07 10:44:43 +01002397
2398executable('systemd-sulogin-shell',
2399 ['src/sulogin-shell/sulogin-shell.c'],
2400 include_directories : includes,
2401 link_with : [libshared],
2402 install_rpath : rootlibexecdir,
2403 install : true,
2404 install_dir : rootlibexecdir)
2405
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002406############################################################
2407
2408foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002409 sources = tuple[0]
2410 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2411 dependencies = tuple[2]
2412 condition = tuple.length() >= 4 ? tuple[3] : ''
2413 type = tuple.length() >= 5 ? tuple[4] : ''
2414 defs = tuple.length() >= 6 ? tuple[5] : []
2415 incs = tuple.length() >= 7 ? tuple[6] : includes
2416 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002417
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002418 name = sources[0].split('/')[-1].split('.')[0]
2419 if type.startswith('timeout=')
2420 timeout = type.split('=')[1].to_int()
2421 type = ''
2422 endif
Adam Duskett08318a22018-01-15 06:25:46 -05002423 if want_tests == 'false'
2424 message('Not compiling @0@ because tests is set to false'.format(name))
2425 elif condition == '' or conf.get(condition) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002426 exe = executable(
2427 name,
2428 sources,
2429 include_directories : incs,
2430 link_with : link_with,
2431 dependencies : dependencies,
2432 c_args : defs,
2433 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002434 install : install_tests,
2435 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002436
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002437 if type == 'manual'
2438 message('@0@ is a manual test'.format(name))
2439 elif type == 'unsafe' and want_tests != 'unsafe'
2440 message('@0@ is an unsafe test'.format(name))
2441 else
2442 test(name, exe,
2443 env : test_env,
2444 timeout : timeout)
2445 endif
2446 else
2447 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2448 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002449endforeach
2450
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002451test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002452 'test-libsystemd-sym',
2453 test_libsystemd_sym_c,
2454 include_directories : includes,
2455 link_with : [libsystemd],
2456 install : install_tests,
2457 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002458test('test-libsystemd-sym',
2459 test_libsystemd_sym)
2460
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002461test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002462 'test-libudev-sym',
2463 test_libudev_sym_c,
2464 include_directories : includes,
2465 c_args : ['-Wno-deprecated-declarations'],
2466 link_with : [libudev],
2467 install : install_tests,
2468 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002469test('test-libudev-sym',
2470 test_libudev_sym)
2471
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002472############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002473
Jonathan Rudenberg7db7d5b2018-01-13 19:51:07 -05002474fuzzer_exes = []
2475
2476foreach tuple : fuzzers
2477 sources = tuple[0]
2478 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2479 dependencies = tuple[2]
2480 defs = tuple.length() >= 4 ? tuple[3] : []
2481 incs = tuple.length() >= 5 ? tuple[4] : includes
2482
2483 if ossfuzz
2484 dependencies += fuzzing_engine
2485 else
2486 sources += 'src/fuzz/fuzz-main.c'
2487 endif
2488
2489 name = sources[0].split('/')[-1].split('.')[0]
2490
2491 fuzzer_exes += executable(
2492 name,
2493 sources,
2494 include_directories : [incs, include_directories('src/fuzz')],
2495 link_with : link_with,
2496 dependencies : dependencies,
2497 c_args : defs,
2498 install : false)
2499endforeach
2500
2501run_target('fuzzers',
2502 depends : fuzzer_exes,
2503 command : ['true'])
2504
2505############################################################
2506
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002507make_directive_index_py = find_program('tools/make-directive-index.py')
2508make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002509xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002510hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002511
2512subdir('units')
2513subdir('sysctl.d')
2514subdir('sysusers.d')
2515subdir('tmpfiles.d')
Zbigniew Jędrzejewski-Szmeke783f952017-11-23 13:23:42 +01002516subdir('presets')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002517subdir('hwdb')
2518subdir('network')
2519subdir('man')
2520subdir('shell-completion/bash')
2521subdir('shell-completion/zsh')
2522subdir('docs/sysvinit')
2523subdir('docs/var-log')
2524
2525# FIXME: figure out if the warning is true:
2526# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2527install_subdir('factory/etc',
2528 install_dir : factorydir)
2529
2530
2531install_data('xorg/50-systemd-user.sh',
2532 install_dir : xinitrcdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002533install_data('modprobe.d/systemd.conf',
2534 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002535install_data('README',
2536 'NEWS',
2537 'CODING_STYLE',
2538 'DISTRO_PORTING',
2539 'ENVIRONMENT.md',
2540 'LICENSE.GPL2',
2541 'LICENSE.LGPL2.1',
Felipe Satelerf9f54412017-12-18 10:58:13 -03002542 'TRANSIENT-SETTINGS.md',
2543 'UIDS-GIDS.md',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002544 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2545 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002546
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002547meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2548meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2549
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002550############################################################
2551
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002552meson_check_help = find_program('tools/meson-check-help.sh')
2553
2554foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002555 name = exec.full_path().split('/')[-1]
2556 test('check-help-' + name,
2557 meson_check_help,
2558 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002559endforeach
2560
2561############################################################
2562
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002563if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002564 all_files = run_command(
2565 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002566 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002567 'ls-files',
2568 ':/*.[ch]'])
2569 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002570
userwithuide85a6902017-08-09 13:41:44 +00002571 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002572 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002573 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002574 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002575 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002576 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002577 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002578 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002579endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002580
2581if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002582 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002583 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002584 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002585 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002586endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002587
2588if git.found()
2589 git_head = run_command(
2590 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002591 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002592 'rev-parse', 'HEAD']).stdout().strip()
2593 git_head_short = run_command(
2594 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002595 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002596 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2597
2598 run_target(
2599 'git-snapshot',
2600 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002601 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002602 git_head_short),
2603 '--prefix', 'systemd-@0@/'.format(git_head),
2604 'HEAD'])
2605endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002606
2607############################################################
2608
Lennart Poettering51b13862017-12-20 12:51:14 +01002609meson_check_api_docs_sh = find_program('tools/meson-check-api-docs.sh')
2610run_target(
2611 'check-api-docs',
2612 depends : [man, libsystemd, libudev],
2613 command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
2614
2615############################################################
2616
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002617status = [
2618 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2619
Yu Watanabe359b4962017-11-25 20:35:24 +09002620 'prefix directory: @0@'.format(prefixdir),
2621 'rootprefix directory: @0@'.format(rootprefixdir),
2622 'sysconf directory: @0@'.format(sysconfdir),
2623 'include directory: @0@'.format(includedir),
2624 'lib directory: @0@'.format(libdir),
2625 'rootlib directory: @0@'.format(rootlibdir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002626 'SysV init scripts: @0@'.format(sysvinit_path),
2627 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
Yu Watanabe359b4962017-11-25 20:35:24 +09002628 'PAM modules directory: @0@'.format(pamlibdir),
2629 'PAM configuration directory: @0@'.format(pamconfdir),
2630 'RPM macros directory: @0@'.format(rpmmacrosdir),
2631 'modprobe.d directory: @0@'.format(modprobedir),
2632 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2633 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2634 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2635 'bash completions directory: @0@'.format(bashcompletiondir),
2636 'zsh completions directory: @0@'.format(zshcompletiondir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002637 'extra start script: @0@'.format(get_option('rc-local')),
2638 'extra stop script: @0@'.format(get_option('halt-local')),
2639 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2640 get_option('debug-tty')),
2641 'TTY GID: @0@'.format(tty_gid),
Ikey Doherty84786b82017-12-03 12:28:23 +00002642 'users GID: @0@'.format(users_gid),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002643 'maximum system UID: @0@'.format(system_uid_max),
2644 'maximum system GID: @0@'.format(system_gid_max),
Lennart Poettering87d5e4f2017-12-02 12:48:31 +01002645 'minimum dynamic UID: @0@'.format(dynamic_uid_min),
2646 'maximum dynamic UID: @0@'.format(dynamic_uid_max),
2647 'minimum container UID base: @0@'.format(container_uid_base_min),
2648 'maximum container UID base: @0@'.format(container_uid_base_max),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002649 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
Tom Stellard4e15a732017-10-31 08:46:24 -07002650 'render group access mode: @0@'.format(get_option('group-render-mode')),
Yu Watanabe359b4962017-11-25 20:35:24 +09002651 'certificate root directory: @0@'.format(get_option('certificate-root')),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002652 'support URL: @0@'.format(support_url),
Lennart Poetteringafde4572017-12-05 11:00:24 +01002653 'nobody user name: @0@'.format(nobody_user),
2654 'nobody group name: @0@'.format(nobody_group),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002655 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002656 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002657
2658 'default DNSSEC mode: @0@'.format(default_dnssec),
2659 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2660 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2661
2662alt_dns_servers = '\n '.join(dns_servers.split(' '))
2663alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2664status += [
2665 'default DNS servers: @0@'.format(alt_dns_servers),
2666 'default NTP servers: @0@'.format(alt_ntp_servers)]
2667
2668alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2669 '@@0@'.format(time_epoch)).stdout().strip()
2670status += [
2671 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2672
2673# TODO:
2674# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2675# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2676# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2677
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002678if conf.get('ENABLE_EFI') == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002679 status += [
2680 'efi arch: @0@'.format(efi_arch)]
2681
2682 if have_gnu_efi
2683 status += [
2684 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2685 'EFI CC @0@'.format(efi_cc),
Yu Watanabe359b4962017-11-25 20:35:24 +09002686 'EFI lib directory: @0@'.format(efi_libdir),
2687 'EFI lds directory: @0@'.format(efi_ldsdir),
2688 'EFI include directory: @0@'.format(efi_incdir)]
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002689 endif
2690endif
2691
2692found = []
2693missing = []
2694
2695foreach tuple : [
2696 ['libcryptsetup'],
2697 ['PAM'],
2698 ['AUDIT'],
2699 ['IMA'],
2700 ['AppArmor'],
2701 ['SELinux'],
2702 ['SECCOMP'],
2703 ['SMACK'],
2704 ['zlib'],
2705 ['xz'],
2706 ['lz4'],
2707 ['bzip2'],
2708 ['ACL'],
2709 ['gcrypt'],
2710 ['qrencode'],
2711 ['microhttpd'],
2712 ['gnutls'],
2713 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002714 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002715 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002716 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002717 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002718 ['libiptc'],
2719 ['elfutils'],
2720 ['binfmt'],
2721 ['vconsole'],
2722 ['quotacheck'],
2723 ['tmpfiles'],
2724 ['environment.d'],
2725 ['sysusers'],
2726 ['firstboot'],
2727 ['randomseed'],
2728 ['backlight'],
2729 ['rfkill'],
2730 ['logind'],
2731 ['machined'],
2732 ['importd'],
2733 ['hostnamed'],
2734 ['timedated'],
2735 ['timesyncd'],
2736 ['localed'],
2737 ['networkd'],
Yu Watanabea7456af2017-10-06 16:33:21 +09002738 ['resolve'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002739 ['coredump'],
2740 ['polkit'],
2741 ['legacy pkla', install_polkit_pkla],
2742 ['efi'],
2743 ['gnu-efi', have_gnu_efi],
2744 ['kmod'],
2745 ['xkbcommon'],
2746 ['blkid'],
2747 ['dbus'],
2748 ['glib'],
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02002749 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002750 ['hwdb'],
2751 ['tpm'],
2752 ['man pages', want_man],
2753 ['html pages', want_html],
2754 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002755 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002756 ['SysV compat'],
2757 ['utmp'],
2758 ['ldconfig'],
2759 ['hibernate'],
2760 ['adm group', get_option('adm-group')],
2761 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002762 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002763 ['debug hashmap'],
2764 ['debug mmap cache'],
2765]
2766
2767 cond = tuple.get(1, '')
2768 if cond == ''
2769 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2770 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002771 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002772 endif
2773 if cond
2774 found += [tuple[0]]
2775 else
2776 missing += [tuple[0]]
2777 endif
2778endforeach
2779
2780status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002781 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002782 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002783 '',
2784 'disabled features: @0@'.format(', '.join(missing)),
2785 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002786message('\n '.join(status))
Zbigniew Jędrzejewski-Szmek9a8e64b2017-11-28 21:46:53 +01002787
2788if rootprefixdir != rootprefix_default
2789 message('WARNING:\n' +
2790 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
2791 ' systemd used fixed names for unit file directories and other paths, so anything\n' +
2792 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
2793endif