blob: 94917ca6676db03dc2f0dc315c55c96cb2194ea0 [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 Poettering63950422017-09-28 11:29:52 +020019 version : '235',
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 Poetteringd128f362017-10-05 17:14:04 +020030libsystemd_version = '0.19.1'
31libudev_version = '1.6.7'
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')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +020070have = sysvinit_path != '' or sysvrcnd_path != ''
71conf.set10('HAVE_SYSV_COMPAT', have,
72 description : 'SysV init scripts and rcN.d links are supported')
73m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
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'))
185conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
186conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
187conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
188conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
189conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek74344a12017-11-28 20:00:10 +0100190conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400191conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400192conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
193conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400194conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
195conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
196conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
197conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
198conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
199conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400200conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
201conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400202conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400203conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400204conf.set_quoted('LIBDIR', libdir)
205conf.set_quoted('ROOTLIBDIR', rootlibdir)
206conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
207conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400208conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
209conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
210conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
211conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
212conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
213conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400214
215conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
216conf.set_quoted('ABS_SRC_DIR', meson.source_root())
217
218substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400219substs.set('exec_prefix', prefixdir)
220substs.set('libdir', libdir)
221substs.set('rootlibdir', rootlibdir)
222substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400223substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400224substs.set('bindir', bindir)
225substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400226substs.set('rootlibexecdir', rootlibexecdir)
227substs.set('systemunitdir', systemunitdir)
228substs.set('userunitdir', userunitdir)
229substs.set('systempresetdir', systempresetdir)
230substs.set('userpresetdir', userpresetdir)
231substs.set('udevhwdbdir', udevhwdbdir)
232substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400233substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400234substs.set('catalogdir', catalogdir)
235substs.set('tmpfilesdir', tmpfilesdir)
236substs.set('sysusersdir', sysusersdir)
237substs.set('sysctldir', sysctldir)
238substs.set('binfmtdir', binfmtdir)
239substs.set('modulesloaddir', modulesloaddir)
240substs.set('systemgeneratordir', systemgeneratordir)
241substs.set('usergeneratordir', usergeneratordir)
242substs.set('systemenvgeneratordir', systemenvgeneratordir)
243substs.set('userenvgeneratordir', userenvgeneratordir)
244substs.set('systemshutdowndir', systemshutdowndir)
245substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400246substs.set('VARLOGDIR', varlogdir)
247substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400248substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
249substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400250substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
251substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
252substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
253substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400254
255#####################################################################
256
257cc = meson.get_compiler('c')
258pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400259check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400260
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400261cxx = find_program('c++', required : false)
262if cxx.found()
263 # Used only for tests
264 add_languages('cpp')
265endif
266
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400267foreach arg : ['-Wextra',
Zbigniew Jędrzejewski-Szmek70160ce2017-10-03 12:11:49 +0200268 '-Werror=undef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400269 '-Wlogical-op',
270 '-Wmissing-include-dirs',
271 '-Wold-style-definition',
272 '-Wpointer-arith',
273 '-Winit-self',
274 '-Wdeclaration-after-statement',
275 '-Wfloat-equal',
276 '-Wsuggest-attribute=noreturn',
277 '-Werror=missing-prototypes',
278 '-Werror=implicit-function-declaration',
279 '-Werror=missing-declarations',
280 '-Werror=return-type',
281 '-Werror=incompatible-pointer-types',
282 '-Werror=format=2',
283 '-Wstrict-prototypes',
284 '-Wredundant-decls',
285 '-Wmissing-noreturn',
Zbigniew Jędrzejewski-Szmek97279d82017-11-20 14:23:40 +0100286 '-Wimplicit-fallthrough=5',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400287 '-Wshadow',
288 '-Wendif-labels',
289 '-Wstrict-aliasing=2',
290 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400291 '-Werror=overflow',
292 '-Wdate-time',
293 '-Wnested-externs',
294 '-ffast-math',
295 '-fno-common',
296 '-fdiagnostics-show-option',
297 '-fno-strict-aliasing',
298 '-fvisibility=hidden',
299 '-fstack-protector',
300 '-fstack-protector-strong',
301 '-fPIE',
302 '--param=ssp-buffer-size=4',
303 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400304 if cc.has_argument(arg)
305 add_project_arguments(arg, language : 'c')
306 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400307endforeach
308
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400309# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
310# arguments, just emits a warnings. So test for the "positive" version instead.
311foreach arg : ['unused-parameter',
312 'missing-field-initializers',
313 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300314 'format-signedness',
315 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
316 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400317 if cc.has_argument('-W' + arg)
318 add_project_arguments('-Wno-' + arg, language : 'c')
319 endif
320endforeach
321
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400322if cc.compiles('
323 #include <time.h>
324 #include <inttypes.h>
325 typedef uint64_t usec_t;
326 usec_t now(clockid_t clock);
327 int main(void) {
328 struct timespec now;
329 return 0;
330 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400331', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400332 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400333endif
334
335if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400336 foreach arg : ['-Wno-typedef-redefinition',
337 '-Wno-gnu-variable-sized-type-not-at-end',
338 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400339 if cc.has_argument(arg,
340 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400341 add_project_arguments(arg, language : 'c')
342 endif
343 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400344endif
345
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400346link_test_c = files('tools/meson-link-test.c')
347
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400348# --as-needed and --no-undefined are provided by meson by default,
349# run mesonconf to see what is enabled
350foreach arg : ['-Wl,-z,relro',
351 '-Wl,-z,now',
352 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400353 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400354
355 have = run_command(check_compilation_sh,
356 cc.cmd_array(), '-x', 'c', arg,
357 '-include', link_test_c).returncode() == 0
358 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
359 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400360 add_project_link_arguments(arg, language : 'c')
361 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400362endforeach
363
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400364if get_option('buildtype') != 'debug'
365 foreach arg : ['-ffunction-sections',
366 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400367 if cc.has_argument(arg,
368 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400369 add_project_arguments(arg, language : 'c')
370 endif
371 endforeach
372
373 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400374 have = run_command(check_compilation_sh,
375 cc.cmd_array(), '-x', 'c', arg,
376 '-include', link_test_c).returncode() == 0
377 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
378 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400379 add_project_link_arguments(arg, language : 'c')
380 endif
381 endforeach
382endif
383
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400384cpp = ' '.join(cc.cmd_array()) + ' -E'
385
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400386#####################################################################
387# compilation result tests
388
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400389conf.set('_GNU_SOURCE', true)
390conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400391
392conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
393conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
394conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
395conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
396conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
397conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
398conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
399
400decl_headers = '''
401#include <uchar.h>
402#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000403#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400404'''
405# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
406
407foreach decl : ['char16_t',
408 'char32_t',
409 'key_serial_t',
410 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000411 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400412 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400413
414 # We get -1 if the size cannot be determined
415 have = cc.sizeof(decl, prefix : decl_headers) > 0
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200416 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400417endforeach
418
419foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
420 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
421 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
422 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
423 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
424 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
425 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
426 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
427 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
428 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530429 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400430 # if_tunnel.h is buggy and cannot be included on its own
431 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
432 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
433 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
434 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
435 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
436 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
437 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
438 ['NDA_IFINDEX', 'linux/neighbour.h'],
439 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000440 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400441 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
Susant Sahanid6df5832017-11-22 12:53:22 +0530442 ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400443 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400444 prefix = decl.length() > 2 ? decl[2] : ''
445 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200446 conf.set10('HAVE_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400447endforeach
448
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400449foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200450 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400451endforeach
452
453foreach ident : [
Yu Watanabee4816452017-11-26 02:17:06 +0900454 ['memfd_create', '''#define _GNU_SOURCE
455 #include <sys/mman.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400456 ['gettid', '''#include <sys/types.h>'''],
457 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
458 ['name_to_handle_at', '''#define _GNU_SOURCE
459 #include <sys/types.h>
460 #include <sys/stat.h>
461 #include <fcntl.h>'''],
462 ['setns', '''#define _GNU_SOURCE
463 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400464 ['renameat2', '''#include <stdio.h>'''],
465 ['kcmp', '''#include <linux/kcmp.h>'''],
466 ['keyctl', '''#include <sys/types.h>
467 #include <keyutils.h>'''],
468 ['copy_file_range', '''#include <sys/syscall.h>
469 #include <unistd.h>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200470 ['bpf', '''#include <sys/syscall.h>
471 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400472 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400473]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400474
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400475 have = cc.has_function(ident[0], prefix : ident[1])
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200476 conf.set10('HAVE_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400477endforeach
478
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400479if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200480 conf.set10('USE_SYS_RANDOM_H', true)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200481 conf.set10('HAVE_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400482else
483 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200484 conf.set10('USE_SYS_RANDOM_H', false)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200485 conf.set10('HAVE_GETRANDOM', have)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400486endif
487
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400488#####################################################################
489
490sed = find_program('sed')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400491awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400492m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400493stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400494git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400495
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400496meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400497mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400498test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
499splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400500
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400501# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
502# /usr/sbin, /sbin, and fall back to the default from middle column.
503progs = [['telinit', '/lib/sysvinit/telinit'],
504 ['quotaon', '/usr/sbin/quotaon' ],
505 ['quotacheck', '/usr/sbin/quotacheck' ],
506 ['kill', '/usr/bin/kill' ],
507 ['kmod', '/usr/bin/kmod' ],
508 ['kexec', '/usr/sbin/kexec' ],
509 ['sulogin', '/usr/sbin/sulogin' ],
510 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
511 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
512 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
513 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
514 ]
515foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400516 path = get_option(prog[0] + '-path')
517 if path != ''
518 message('Using @1@ for @0@'.format(prog[0], path))
519 else
520 exe = find_program(prog[0],
521 '/usr/sbin/' + prog[0],
522 '/sbin/' + prog[0],
523 required: false)
524 path = exe.found() ? exe.path() : prog[1]
525 endif
526 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
527 conf.set_quoted(name, path)
528 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400529endforeach
530
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400531if run_command('ln', '--relative', '--help').returncode() != 0
532 error('ln does not support --relative')
533endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400534
535############################################################
536
537gperf = find_program('gperf')
538
539gperf_test_format = '''
540#include <string.h>
541const char * in_word_set(const char *, @0@);
542@1@
543'''
544gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
545gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
546gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
547if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400548 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400549else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400550 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
551 if cc.compiles(gperf_test)
552 gperf_len_type = 'unsigned'
553 else
554 error('unable to determine gperf len type')
555 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400556endif
557message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400558conf.set('GPERF_LEN_TYPE', gperf_len_type,
559 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400560
561############################################################
562
563if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400564 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400565endif
566foreach header : ['linux/btrfs.h',
567 'linux/memfd.h',
568 'linux/vm_sockets.h',
Zbigniew Jędrzejewski-Szmekaf8786b2017-10-03 12:09:40 +0200569 'sys/auxv.h',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400570 'valgrind/memcheck.h',
571 'valgrind/valgrind.h',
572 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400573
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200574 conf.set10('HAVE_' + header.underscorify().to_upper(),
575 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400576endforeach
577
578############################################################
579
580conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400581conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
582gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400583
584default_hierarchy = get_option('default-hierarchy')
585conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
586 description : 'default cgroup hierarchy as string')
587if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400588 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400589elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400590 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400591else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400592 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400593endif
594
595time_epoch = get_option('time-epoch')
596if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400597 NEWS = files('NEWS')
598 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400599endif
600time_epoch = time_epoch.to_int()
601conf.set('TIME_EPOCH', time_epoch)
602
603system_uid_max = get_option('system-uid-max')
604if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400605 system_uid_max = run_command(
606 awk,
607 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
608 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400609endif
610system_uid_max = system_uid_max.to_int()
611conf.set('SYSTEM_UID_MAX', system_uid_max)
612substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400613message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400614
615conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
616conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
617
618system_gid_max = get_option('system-gid-max')
619if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400620 system_gid_max = run_command(
621 awk,
622 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
623 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400624endif
625system_gid_max = system_gid_max.to_int()
626conf.set('SYSTEM_GID_MAX', system_gid_max)
627substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400628message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400629
630tty_gid = get_option('tty-gid')
631conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400632substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400633
634if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400635 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400636endif
637
638if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400639 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400640endif
641
642substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
Tom Stellard4e15a732017-10-31 08:46:24 -0700643substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400644
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400645kill_user_processes = get_option('default-kill-user-processes')
646conf.set10('KILL_USER_PROCESSES', kill_user_processes)
647substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400648
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400649dns_servers = get_option('dns-servers')
650conf.set_quoted('DNS_SERVERS', dns_servers)
651substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400652
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400653ntp_servers = get_option('ntp-servers')
654conf.set_quoted('NTP_SERVERS', ntp_servers)
655substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400656
657conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
658
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400659substs.set('SUSHELL', get_option('debug-shell'))
660substs.set('DEBUGTTY', get_option('debug-tty'))
661
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400662debug = get_option('debug')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200663enable_debug_hashmap = false
664enable_debug_mmap_cache = false
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400665if debug != ''
666 foreach name : debug.split(',')
667 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200668 enable_debug_hashmap = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400669 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200670 enable_debug_mmap_cache = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400671 else
672 message('unknown debug option "@0@", ignoring'.format(name))
673 endif
674 endforeach
675endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200676conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
677conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400678
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400679#####################################################################
680
681threads = dependency('threads')
682librt = cc.find_library('rt')
683libm = cc.find_library('m')
684libdl = cc.find_library('dl')
685libcrypt = cc.find_library('crypt')
686
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400687libcap = dependency('libcap', required : false)
688if not libcap.found()
689 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
690 libcap = cc.find_library('cap')
691endif
692
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400693libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200694 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400695
696want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400697if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400698 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400699 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400700 required : want_seccomp == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200701 have = libseccomp.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400702else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200703 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400704 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400705endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200706conf.set10('HAVE_SECCOMP', have)
707m4_defines += have ? ['-DHAVE_SECCOMP'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400708
709want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400710if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400711 libselinux = dependency('libselinux',
712 version : '>= 2.1.9',
713 required : want_selinux == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200714 have = libselinux.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400715else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200716 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400717 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400718endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200719conf.set10('HAVE_SELINUX', have)
720m4_defines += have ? ['-DHAVE_SELINUX'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400721
722want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400723if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400724 libapparmor = dependency('libapparmor',
725 required : want_apparmor == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200726 have = libapparmor.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400727else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200728 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400729 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400730endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200731conf.set10('HAVE_APPARMOR', have)
732m4_defines += have ? ['-DHAVE_APPARMOR'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400733
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400734smack_run_label = get_option('smack-run-label')
735if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400736 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
737 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400738endif
739
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400740want_polkit = get_option('polkit')
741install_polkit = false
742install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400743if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400744 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400745
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400746 libpolkit = dependency('polkit-gobject-1',
747 required : false)
748 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
749 message('Old polkit detected, will install pkla files')
750 install_polkit_pkla = true
751 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400752endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200753conf.set10('ENABLE_POLKIT', install_polkit)
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400754
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400755want_acl = get_option('acl')
756if want_acl != 'false'
757 libacl = cc.find_library('acl', required : want_acl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200758 have = libacl.found()
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400759else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200760 have = false
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400761 libacl = []
762endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200763conf.set10('HAVE_ACL', have)
764m4_defines += have ? ['-DHAVE_ACL'] : []
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400765
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400766want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400767if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400768 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200769 have = libaudit.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400770else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200771 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400772 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400773endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200774conf.set10('HAVE_AUDIT', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400775
776want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400777if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400778 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200779 have = libblkid.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400780else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200781 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400782 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400783endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200784conf.set10('HAVE_BLKID', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400785
786want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400787if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400788 libkmod = dependency('libkmod',
789 version : '>= 15',
790 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200791 have = libkmod.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400792else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200793 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400794 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400795endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200796conf.set10('HAVE_KMOD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400797
798want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400799if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400800 libpam = cc.find_library('pam', required : want_pam == 'true')
801 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200802 have = libpam.found() and libpam_misc.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 libpam = []
806 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400807endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200808conf.set10('HAVE_PAM', have)
809m4_defines += have ? ['-DHAVE_PAM'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400810
811want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400812if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400813 libmicrohttpd = dependency('libmicrohttpd',
814 version : '>= 0.9.33',
815 required : want_microhttpd == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200816 have = libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400817else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200818 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400819 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400820endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200821conf.set10('HAVE_MICROHTTPD', have)
822m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400823
824want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400825if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400826 libcryptsetup = dependency('libcryptsetup',
827 version : '>= 1.6.0',
828 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200829 have = libcryptsetup.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400830else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200831 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400832 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400833endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200834conf.set10('HAVE_LIBCRYPTSETUP', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400835
836want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400837if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400838 libcurl = dependency('libcurl',
839 version : '>= 7.32.0',
840 required : want_libcurl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200841 have = libcurl.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400842else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200843 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400844 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400845endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200846conf.set10('HAVE_LIBCURL', have)
847m4_defines += have ? ['-DHAVE_LIBCURL'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400848
849want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400850want_libidn2 = get_option('libidn2')
851if want_libidn == 'true' and want_libidn2 == 'true'
852 error('libidn and libidn2 cannot be requested simultaneously')
853endif
854
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400855if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400856 libidn = dependency('libidn',
857 required : want_libidn == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200858 have = libidn.found()
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400859else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200860 have = false
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400861 libidn = []
862endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200863conf.set10('HAVE_LIBIDN', have)
864m4_defines += have ? ['-DHAVE_LIBIDN'] : []
865if not have and want_libidn2 != 'false'
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400866 # libidn is used for both libidn and libidn2 objects
867 libidn = dependency('libidn2',
868 required : want_libidn2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200869 have = libidn.found()
870else
871 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400872endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200873conf.set10('HAVE_LIBIDN2', have)
874m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400875
876want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400877if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400878 libiptc = dependency('libiptc',
879 required : want_libiptc == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200880 have = libiptc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400881else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200882 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400883 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400884endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200885conf.set10('HAVE_LIBIPTC', have)
886m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400887
888want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400889if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400890 libqrencode = dependency('libqrencode',
891 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200892 have = libqrencode.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400893else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200894 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400895 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400896endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200897conf.set10('HAVE_QRENCODE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400898
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400899want_gcrypt = get_option('gcrypt')
900if want_gcrypt != 'false'
901 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
902 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200903 have = libgcrypt.found() and libgpg_error.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400904else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200905 have = false
906endif
907if not have
908 # link to neither of the libs if one is not found
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400909 libgcrypt = []
910 libgpg_error = []
911endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200912conf.set10('HAVE_GCRYPT', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400913
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400914want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400915if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400916 libgnutls = dependency('gnutls',
917 version : '>= 3.1.4',
918 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200919 have = libgnutls.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400920else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200921 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400922 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400923endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200924conf.set10('HAVE_GNUTLS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400925
926want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400927if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400928 libdw = dependency('libdw',
929 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200930 have = libdw.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400931else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200932 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400933 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400934endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200935conf.set10('HAVE_ELFUTILS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400936
937want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400938if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400939 libz = dependency('zlib',
940 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200941 have = libz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400942else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200943 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400944 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400945endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200946conf.set10('HAVE_ZLIB', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400947
948want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400949if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400950 libbzip2 = cc.find_library('bz2',
951 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200952 have = libbzip2.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400953else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200954 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400955 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400956endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200957conf.set10('HAVE_BZIP2', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400958
959want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400960if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400961 libxz = dependency('liblzma',
962 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200963 have = libxz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400964else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200965 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400966 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400967endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200968conf.set10('HAVE_XZ', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400969
970want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400971if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400972 liblz4 = dependency('liblz4',
973 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200974 have = liblz4.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400975else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200976 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400977 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400978endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200979conf.set10('HAVE_LZ4', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400980
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400981want_xkbcommon = get_option('xkbcommon')
982if want_xkbcommon != 'false'
983 libxkbcommon = dependency('xkbcommon',
984 version : '>= 0.3.0',
985 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200986 have = libxkbcommon.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400987else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200988 have = false
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400989 libxkbcommon = []
990endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200991conf.set10('HAVE_XKBCOMMON', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400992
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400993want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400994if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400995 libglib = dependency('glib-2.0',
996 version : '>= 2.22.0',
997 required : want_glib == 'true')
998 libgobject = dependency('gobject-2.0',
999 version : '>= 2.22.0',
1000 required : want_glib == 'true')
1001 libgio = dependency('gio-2.0',
1002 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001003 have = libglib.found() and libgobject.found() and libgio.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001004else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001005 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001006 libglib = []
1007 libgobject = []
1008 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001009endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001010conf.set10('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001011
1012want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001013if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001014 libdbus = dependency('dbus-1',
1015 version : '>= 1.3.2',
1016 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001017 have = libdbus.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001018else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001019 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001020 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001021endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001022conf.set10('HAVE_DBUS', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001023
Yu Watanabe42303dc2017-06-18 05:22:32 +09001024default_dnssec = get_option('default-dnssec')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001025if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
Yu Watanabe42303dc2017-06-18 05:22:32 +09001026 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1027 default_dnssec = 'no'
1028endif
1029conf.set('DEFAULT_DNSSEC_MODE',
1030 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1031substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1032
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001033want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001034if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001035 have = (conf.get('HAVE_LIBCURL') == 1 and
1036 conf.get('HAVE_ZLIB') == 1 and
1037 conf.get('HAVE_BZIP2') == 1 and
1038 conf.get('HAVE_XZ') == 1 and
1039 conf.get('HAVE_GCRYPT') == 1)
1040 if want_importd == 'true' and not have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001041 error('importd support was requested, but dependencies are not available')
1042 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001043else
1044 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001045endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001046conf.set10('ENABLE_IMPORTD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001047
1048want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001049if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001050 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1051 conf.get('HAVE_LIBCURL') == 1]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001052 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1053 # it's possible to build one without the other. Complain only if
1054 # support was explictly requested. The auxiliary files like sysusers
1055 # config should be installed when any of the programs are built.
1056 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1057 error('remote support was requested, but dependencies are not available')
1058 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001059 have = have_deps[0] or have_deps[1]
1060else
1061 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001062endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001063conf.set10('ENABLE_REMOTE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001064
Zbigniew Jędrzejewski-Szmeka9149d82017-10-03 13:15:27 +02001065foreach term : ['utmp',
1066 'hibernate',
1067 'environment-d',
1068 'binfmt',
1069 'coredump',
1070 'resolve',
1071 'logind',
1072 'hostnamed',
1073 'localed',
1074 'machined',
1075 'networkd',
1076 'timedated',
1077 'timesyncd',
1078 'myhostname',
1079 'firstboot',
1080 'randomseed',
1081 'backlight',
1082 'vconsole',
1083 'quotacheck',
1084 'sysusers',
1085 'tmpfiles',
1086 'hwdb',
1087 'rfkill',
1088 'ldconfig',
1089 'efi',
1090 'tpm',
1091 'ima',
1092 'smack',
1093 'gshadow',
1094 'idn',
1095 'nss-systemd']
1096 have = get_option(term)
1097 name = 'ENABLE_' + term.underscorify().to_upper()
1098 conf.set10(name, have)
1099 m4_defines += have ? ['-D' + name] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001100endforeach
1101
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001102want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001103install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001104tests = []
1105
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001106conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1107
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001108#####################################################################
1109
1110if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001111 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001112
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001113 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001114 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001115 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001116 elif efi_arch == 'x86_64'
1117 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001118 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001119 elif efi_arch == 'arm'
1120 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001121 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001122 elif efi_arch == 'aarch64'
1123 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001124 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001125 else
1126 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001127 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001128 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001129
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001130 have = true
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001131 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001132
1133 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001134else
1135 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001136endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001137conf.set10('ENABLE_EFI', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001138
1139#####################################################################
1140
1141config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001142 output : 'config.h',
1143 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001144
1145includes = include_directories('src/basic',
1146 'src/shared',
1147 'src/systemd',
1148 'src/journal',
1149 'src/resolve',
1150 'src/timesync',
1151 'src/login',
1152 'src/udev',
1153 'src/libudev',
1154 'src/core',
1155 'src/libsystemd/sd-bus',
1156 'src/libsystemd/sd-device',
1157 'src/libsystemd/sd-hwdb',
1158 'src/libsystemd/sd-id128',
1159 'src/libsystemd/sd-netlink',
1160 'src/libsystemd/sd-network',
1161 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001162 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001163 )
1164
1165add_project_arguments('-include', 'config.h', language : 'c')
1166
1167gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1168 'src/shared/gcrypt-util.c')
1169
1170subdir('po')
1171subdir('catalog')
1172subdir('src/systemd')
1173subdir('src/basic')
1174subdir('src/libsystemd')
1175subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001176subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001177subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001178
1179libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001180 'journal-core',
1181 libjournal_core_sources,
1182 journald_gperf_c,
1183 include_directories : includes,
1184 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001185
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001186libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001187libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001188 'systemd',
1189 libsystemd_internal_sources,
1190 journal_internal_sources,
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +02001191 version : libsystemd_version,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001192 include_directories : includes,
1193 link_args : ['-shared',
1194 '-Wl,--version-script=' + libsystemd_sym_path],
1195 link_with : [libbasic],
1196 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001197 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001198 librt,
1199 libxz,
1200 liblz4],
1201 link_depends : libsystemd_sym,
1202 install : true,
1203 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001204
1205############################################################
1206
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001207# binaries that have --help and are intended for use by humans,
1208# usually, but not always, installed in /bin.
1209public_programs = []
1210
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001211subdir('src/libudev')
1212subdir('src/shared')
1213subdir('src/core')
1214subdir('src/udev')
1215subdir('src/network')
1216
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001217subdir('src/analyze')
1218subdir('src/journal-remote')
1219subdir('src/coredump')
1220subdir('src/hostname')
1221subdir('src/import')
1222subdir('src/kernel-install')
1223subdir('src/locale')
1224subdir('src/machine')
1225subdir('src/nspawn')
1226subdir('src/resolve')
1227subdir('src/timedate')
1228subdir('src/timesync')
1229subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001230subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001231subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001232
1233subdir('src/test')
Zbigniew Jędrzejewski-Szmek6b97bf22017-11-22 12:42:28 +01001234subdir('rules')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001235subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001236
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001237############################################################
1238
1239# only static linking apart from libdl, to make sure that the
1240# module is linked to all libraries that it uses.
1241test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001242 'test-dlopen',
1243 test_dlopen_c,
1244 include_directories : includes,
1245 link_with : [libbasic],
1246 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001247
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02001248foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001249 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001250 ['mymachines', 'ENABLE_MACHINED'],
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001251 ['resolve', 'ENABLE_RESOLVE']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001252
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001253 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001254 if condition
1255 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001256
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001257 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1258 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001259
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001260 nss = shared_library(
1261 'nss_' + module,
1262 'src/nss-@0@/nss-@0@.c'.format(module),
1263 version : '2',
1264 include_directories : includes,
1265 link_args : ['-shared',
1266 '-Wl,--version-script=' + version_script_arg,
1267 '-Wl,--undefined'],
1268 link_with : [libsystemd_internal,
1269 libbasic],
1270 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001271 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001272 link_depends : sym,
1273 install : true,
1274 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001275
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001276 # We cannot use shared_module because it does not support version suffix.
1277 # Unfortunately shared_library insists on creating the symlink…
1278 meson.add_install_script('sh', '-c',
1279 'rm $DESTDIR@0@/libnss_@1@.so'
1280 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001281
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001282 test('dlopen-nss_' + module,
1283 test_dlopen,
1284 args : [nss.full_path()]) # path to dlopen must include a slash
1285 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001286endforeach
1287
1288############################################################
1289
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001290executable('systemd',
1291 systemd_sources,
1292 include_directories : includes,
1293 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001294 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001295 dependencies : [threads,
1296 librt,
1297 libseccomp,
1298 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001299 libmount,
1300 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001301 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001302 install : true,
1303 install_dir : rootlibexecdir)
1304
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001305exe = executable('systemd-analyze',
1306 systemd_analyze_sources,
1307 include_directories : includes,
1308 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001309 libshared],
1310 dependencies : [threads,
1311 librt,
1312 libseccomp,
1313 libselinux,
1314 libmount,
1315 libblkid],
1316 install_rpath : rootlibexecdir,
1317 install : true)
1318public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001319
1320executable('systemd-journald',
1321 systemd_journald_sources,
1322 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001323 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001324 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001325 dependencies : [threads,
1326 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001327 liblz4,
1328 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001329 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001330 install : true,
1331 install_dir : rootlibexecdir)
1332
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001333exe = executable('systemd-cat',
1334 systemd_cat_sources,
1335 include_directories : includes,
1336 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001337 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001338 dependencies : [threads],
1339 install_rpath : rootlibexecdir,
1340 install : true)
1341public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001342
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001343exe = executable('journalctl',
1344 journalctl_sources,
1345 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001346 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001347 dependencies : [threads,
1348 libqrencode,
1349 libxz,
1350 liblz4],
1351 install_rpath : rootlibexecdir,
1352 install : true,
1353 install_dir : rootbindir)
1354public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001355
1356executable('systemd-getty-generator',
1357 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001358 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001359 link_with : [libshared],
1360 install_rpath : rootlibexecdir,
1361 install : true,
1362 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001363
1364executable('systemd-debug-generator',
1365 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001366 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001367 link_with : [libshared],
1368 install_rpath : rootlibexecdir,
1369 install : true,
1370 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001371
1372executable('systemd-fstab-generator',
1373 'src/fstab-generator/fstab-generator.c',
1374 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001375 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001376 link_with : [libshared],
1377 install_rpath : rootlibexecdir,
1378 install : true,
1379 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001380
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001381if conf.get('ENABLE_ENVIRONMENT_D') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001382 executable('30-systemd-environment-d-generator',
1383 'src/environment-d-generator/environment-d-generator.c',
1384 include_directories : includes,
1385 link_with : [libshared],
1386 install_rpath : rootlibexecdir,
1387 install : true,
1388 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001389
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001390 meson.add_install_script(meson_make_symlink,
1391 join_paths(sysconfdir, 'environment'),
1392 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001393endif
1394
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001395if conf.get('ENABLE_HIBERNATE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001396 executable('systemd-hibernate-resume-generator',
1397 'src/hibernate-resume/hibernate-resume-generator.c',
1398 include_directories : includes,
1399 link_with : [libshared],
1400 install_rpath : rootlibexecdir,
1401 install : true,
1402 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001403
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001404 executable('systemd-hibernate-resume',
1405 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001406 include_directories : includes,
1407 link_with : [libshared],
1408 install_rpath : rootlibexecdir,
1409 install : true,
1410 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001411endif
1412
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001413if conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001414 executable('systemd-gpt-auto-generator',
1415 'src/gpt-auto-generator/gpt-auto-generator.c',
1416 'src/basic/blkid-util.h',
1417 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001418 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001419 dependencies : libblkid,
1420 install_rpath : rootlibexecdir,
1421 install : true,
1422 install_dir : systemgeneratordir)
1423
1424 exe = executable('systemd-dissect',
1425 'src/dissect/dissect.c',
1426 include_directories : includes,
1427 link_with : [libshared],
1428 install_rpath : rootlibexecdir,
1429 install : true,
1430 install_dir : rootlibexecdir)
1431 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001432endif
1433
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001434if conf.get('ENABLE_RESOLVE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001435 executable('systemd-resolved',
1436 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001437 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001438 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001439 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001440 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001441 libgcrypt,
1442 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001443 libm,
1444 libidn],
1445 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001446 install : true,
1447 install_dir : rootlibexecdir)
1448
1449 exe = executable('systemd-resolve',
1450 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001451 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001452 include_directories : includes,
1453 link_with : [libshared],
1454 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001455 libgcrypt,
1456 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001457 libm,
1458 libidn],
1459 install_rpath : rootlibexecdir,
1460 install : true)
1461 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001462endif
1463
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001464if conf.get('ENABLE_LOGIND') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001465 executable('systemd-logind',
1466 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001467 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001468 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001469 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001470 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001471 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001472 install_rpath : rootlibexecdir,
1473 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001474 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001475
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001476 exe = executable('loginctl',
1477 loginctl_sources,
1478 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001479 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001480 dependencies : [threads,
1481 liblz4,
1482 libxz],
1483 install_rpath : rootlibexecdir,
1484 install : true,
1485 install_dir : rootbindir)
1486 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001487
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001488 exe = executable('systemd-inhibit',
1489 'src/login/inhibit.c',
1490 include_directories : includes,
1491 link_with : [libshared],
1492 install_rpath : rootlibexecdir,
1493 install : true,
1494 install_dir : rootbindir)
1495 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001496
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001497 if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001498 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1499 pam_systemd = shared_library(
1500 'pam_systemd',
1501 pam_systemd_c,
1502 name_prefix : '',
1503 include_directories : includes,
1504 link_args : ['-shared',
1505 '-Wl,--version-script=' + version_script_arg],
1506 link_with : [libsystemd_internal,
1507 libshared_static],
1508 dependencies : [threads,
1509 libpam,
1510 libpam_misc],
1511 link_depends : pam_systemd_sym,
1512 install : true,
1513 install_dir : pamlibdir)
1514
1515 test('dlopen-pam_systemd',
1516 test_dlopen,
1517 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1518 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001519endif
1520
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001521if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001522 executable('systemd-user-sessions',
1523 'src/user-sessions/user-sessions.c',
1524 include_directories : includes,
1525 link_with : [libshared],
1526 install_rpath : rootlibexecdir,
1527 install : true,
1528 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001529endif
1530
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001531if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001532 exe = executable('bootctl',
1533 'src/boot/bootctl.c',
1534 include_directories : includes,
1535 link_with : [libshared],
1536 dependencies : [libblkid],
1537 install_rpath : rootlibexecdir,
1538 install : true)
1539 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001540endif
1541
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001542exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1543 include_directories : includes,
1544 link_with : [libshared],
1545 dependencies : [threads],
1546 install_rpath : rootlibexecdir,
1547 install : true)
1548public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001549
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001550exe = executable('systemctl', 'src/systemctl/systemctl.c',
1551 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001552 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001553 dependencies : [threads,
1554 libcap,
1555 libselinux,
1556 libxz,
1557 liblz4],
1558 install_rpath : rootlibexecdir,
1559 install : true,
1560 install_dir : rootbindir)
1561public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001562
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001563if conf.get('ENABLE_BACKLIGHT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001564 executable('systemd-backlight',
1565 'src/backlight/backlight.c',
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 install_rpath : rootlibexecdir,
1569 install : true,
1570 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001571endif
1572
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001573if conf.get('ENABLE_RFKILL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001574 executable('systemd-rfkill',
1575 'src/rfkill/rfkill.c',
1576 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001577 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001578 install_rpath : rootlibexecdir,
1579 install : true,
1580 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001581endif
1582
1583executable('systemd-system-update-generator',
1584 'src/system-update-generator/system-update-generator.c',
1585 include_directories : includes,
1586 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001587 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001588 install : true,
1589 install_dir : systemgeneratordir)
1590
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001591if conf.get('HAVE_LIBCRYPTSETUP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001592 executable('systemd-cryptsetup',
1593 'src/cryptsetup/cryptsetup.c',
1594 include_directories : includes,
1595 link_with : [libshared],
1596 dependencies : [libcryptsetup],
1597 install_rpath : rootlibexecdir,
1598 install : true,
1599 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001600
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001601 executable('systemd-cryptsetup-generator',
1602 'src/cryptsetup/cryptsetup-generator.c',
1603 include_directories : includes,
1604 link_with : [libshared],
1605 dependencies : [libcryptsetup],
1606 install_rpath : rootlibexecdir,
1607 install : true,
1608 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001609
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001610 executable('systemd-veritysetup',
1611 'src/veritysetup/veritysetup.c',
1612 include_directories : includes,
1613 link_with : [libshared],
1614 dependencies : [libcryptsetup],
1615 install_rpath : rootlibexecdir,
1616 install : true,
1617 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001618
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001619 executable('systemd-veritysetup-generator',
1620 'src/veritysetup/veritysetup-generator.c',
1621 include_directories : includes,
1622 link_with : [libshared],
1623 dependencies : [libcryptsetup],
1624 install_rpath : rootlibexecdir,
1625 install : true,
1626 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001627endif
1628
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001629if conf.get('HAVE_SYSV_COMPAT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001630 executable('systemd-sysv-generator',
1631 'src/sysv-generator/sysv-generator.c',
1632 include_directories : includes,
1633 link_with : [libshared],
1634 install_rpath : rootlibexecdir,
1635 install : true,
1636 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001637
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001638 executable('systemd-rc-local-generator',
1639 'src/rc-local-generator/rc-local-generator.c',
1640 include_directories : includes,
1641 link_with : [libshared],
1642 install_rpath : rootlibexecdir,
1643 install : true,
1644 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001645endif
1646
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001647if conf.get('ENABLE_HOSTNAMED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001648 executable('systemd-hostnamed',
1649 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001650 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001651 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001652 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001653 install : true,
1654 install_dir : rootlibexecdir)
1655
1656 exe = executable('hostnamectl',
1657 'src/hostname/hostnamectl.c',
1658 include_directories : includes,
1659 link_with : [libshared],
1660 install_rpath : rootlibexecdir,
1661 install : true)
1662 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001663endif
1664
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001665if conf.get('ENABLE_LOCALED') == 1
1666 if conf.get('HAVE_XKBCOMMON') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001667 # logind will load libxkbcommon.so dynamically on its own
1668 deps = [libdl]
1669 else
1670 deps = []
1671 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001672
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001673 executable('systemd-localed',
1674 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001675 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001676 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001677 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001678 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001679 install : true,
1680 install_dir : rootlibexecdir)
1681
1682 exe = executable('localectl',
1683 localectl_sources,
1684 include_directories : includes,
1685 link_with : [libshared],
1686 install_rpath : rootlibexecdir,
1687 install : true)
1688 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001689endif
1690
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001691if conf.get('ENABLE_TIMEDATED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001692 executable('systemd-timedated',
1693 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001694 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001695 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001696 install_rpath : rootlibexecdir,
1697 install : true,
1698 install_dir : rootlibexecdir)
1699
1700 exe = executable('timedatectl',
1701 'src/timedate/timedatectl.c',
1702 include_directories : includes,
1703 install_rpath : rootlibexecdir,
1704 link_with : [libshared],
1705 install : true)
1706 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001707endif
1708
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001709if conf.get('ENABLE_TIMESYNCD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001710 executable('systemd-timesyncd',
1711 systemd_timesyncd_sources,
1712 include_directories : includes,
1713 link_with : [libshared],
1714 dependencies : [threads,
1715 libm],
1716 install_rpath : rootlibexecdir,
1717 install : true,
1718 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001719endif
1720
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001721if conf.get('ENABLE_MACHINED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001722 executable('systemd-machined',
1723 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001724 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001725 link_with : [libmachine_core,
1726 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001727 install_rpath : rootlibexecdir,
1728 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001729 install_dir : rootlibexecdir)
1730
1731 exe = executable('machinectl',
1732 'src/machine/machinectl.c',
1733 include_directories : includes,
1734 link_with : [libshared],
1735 dependencies : [threads,
1736 libxz,
1737 liblz4],
1738 install_rpath : rootlibexecdir,
1739 install : true,
1740 install_dir : rootbindir)
1741 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001742endif
1743
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001744if conf.get('ENABLE_IMPORTD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001745 executable('systemd-importd',
1746 systemd_importd_sources,
1747 include_directories : includes,
1748 link_with : [libshared],
1749 dependencies : [threads],
1750 install_rpath : rootlibexecdir,
1751 install : true,
1752 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001753
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001754 systemd_pull = executable('systemd-pull',
1755 systemd_pull_sources,
1756 include_directories : includes,
1757 link_with : [libshared],
1758 dependencies : [libcurl,
1759 libz,
1760 libbzip2,
1761 libxz,
1762 libgcrypt],
1763 install_rpath : rootlibexecdir,
1764 install : true,
1765 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001766
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001767 systemd_import = executable('systemd-import',
1768 systemd_import_sources,
1769 include_directories : includes,
1770 link_with : [libshared],
1771 dependencies : [libcurl,
1772 libz,
1773 libbzip2,
1774 libxz],
1775 install_rpath : rootlibexecdir,
1776 install : true,
1777 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001778
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001779 systemd_export = executable('systemd-export',
1780 systemd_export_sources,
1781 include_directories : includes,
1782 link_with : [libshared],
1783 dependencies : [libcurl,
1784 libz,
1785 libbzip2,
1786 libxz],
1787 install_rpath : rootlibexecdir,
1788 install : true,
1789 install_dir : rootlibexecdir)
1790 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001791endif
1792
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001793if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001794 exe = executable('systemd-journal-upload',
1795 systemd_journal_upload_sources,
1796 include_directories : includes,
1797 link_with : [libshared],
1798 dependencies : [threads,
1799 libcurl,
1800 libgnutls,
1801 libxz,
1802 liblz4],
1803 install_rpath : rootlibexecdir,
1804 install : true,
1805 install_dir : rootlibexecdir)
1806 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001807endif
1808
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001809if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001810 s_j_remote = executable('systemd-journal-remote',
1811 systemd_journal_remote_sources,
1812 include_directories : includes,
1813 link_with : [libshared],
1814 dependencies : [threads,
1815 libmicrohttpd,
1816 libgnutls,
1817 libxz,
1818 liblz4],
1819 install_rpath : rootlibexecdir,
1820 install : true,
1821 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001822
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001823 s_j_gatewayd = executable('systemd-journal-gatewayd',
1824 systemd_journal_gatewayd_sources,
1825 include_directories : includes,
1826 link_with : [libshared],
1827 dependencies : [threads,
1828 libmicrohttpd,
1829 libgnutls,
1830 libxz,
1831 liblz4],
1832 install_rpath : rootlibexecdir,
1833 install : true,
1834 install_dir : rootlibexecdir)
1835 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001836endif
1837
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001838if conf.get('ENABLE_COREDUMP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001839 executable('systemd-coredump',
1840 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001841 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001842 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001843 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001844 libacl,
1845 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001846 libxz,
1847 liblz4],
1848 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001849 install : true,
1850 install_dir : rootlibexecdir)
1851
1852 exe = executable('coredumpctl',
1853 coredumpctl_sources,
1854 include_directories : includes,
1855 link_with : [libshared],
1856 dependencies : [threads,
1857 libxz,
1858 liblz4],
1859 install_rpath : rootlibexecdir,
1860 install : true)
1861 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001862endif
1863
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001864if conf.get('ENABLE_BINFMT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001865 exe = executable('systemd-binfmt',
1866 'src/binfmt/binfmt.c',
1867 include_directories : includes,
1868 link_with : [libshared],
1869 install_rpath : rootlibexecdir,
1870 install : true,
1871 install_dir : rootlibexecdir)
1872 public_programs += [exe]
1873
1874 meson.add_install_script('sh', '-c',
1875 mkdir_p.format(binfmtdir))
1876 meson.add_install_script('sh', '-c',
1877 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1878endif
1879
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001880if conf.get('ENABLE_VCONSOLE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001881 executable('systemd-vconsole-setup',
1882 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001883 include_directories : includes,
1884 link_with : [libshared],
1885 install_rpath : rootlibexecdir,
1886 install : true,
1887 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001888endif
1889
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001890if conf.get('ENABLE_RANDOMSEED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001891 executable('systemd-random-seed',
1892 'src/random-seed/random-seed.c',
1893 include_directories : includes,
1894 link_with : [libshared],
1895 install_rpath : rootlibexecdir,
1896 install : true,
1897 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001898endif
1899
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001900if conf.get('ENABLE_FIRSTBOOT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001901 executable('systemd-firstboot',
1902 'src/firstboot/firstboot.c',
1903 include_directories : includes,
1904 link_with : [libshared],
1905 dependencies : [libcrypt],
1906 install_rpath : rootlibexecdir,
1907 install : true,
1908 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001909endif
1910
1911executable('systemd-remount-fs',
1912 'src/remount-fs/remount-fs.c',
1913 'src/core/mount-setup.c',
1914 'src/core/mount-setup.h',
1915 include_directories : includes,
1916 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001917 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001918 install : true,
1919 install_dir : rootlibexecdir)
1920
1921executable('systemd-machine-id-setup',
1922 'src/machine-id-setup/machine-id-setup-main.c',
1923 'src/core/machine-id-setup.c',
1924 'src/core/machine-id-setup.h',
1925 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001926 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001927 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001928 install : true,
1929 install_dir : rootbindir)
1930
1931executable('systemd-fsck',
1932 'src/fsck/fsck.c',
1933 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001934 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001935 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001936 install : true,
1937 install_dir : rootlibexecdir)
1938
Zbigniew Jędrzejewski-Szmek80750ad2017-10-23 13:40:38 +02001939executable('systemd-growfs',
1940 'src/partition/growfs.c',
1941 include_directories : includes,
1942 link_with : [libshared],
1943 install_rpath : rootlibexecdir,
1944 install : true,
1945 install_dir : rootlibexecdir)
1946
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001947executable('systemd-sleep',
1948 'src/sleep/sleep.c',
1949 include_directories : includes,
1950 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001951 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001952 install : true,
1953 install_dir : rootlibexecdir)
1954
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001955exe = executable('systemd-sysctl',
1956 'src/sysctl/sysctl.c',
1957 include_directories : includes,
1958 link_with : [libshared],
1959 install_rpath : rootlibexecdir,
1960 install : true,
1961 install_dir : rootlibexecdir)
1962public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001963
1964executable('systemd-ac-power',
1965 'src/ac-power/ac-power.c',
1966 include_directories : includes,
1967 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001968 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001969 install : true,
1970 install_dir : rootlibexecdir)
1971
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001972exe = executable('systemd-detect-virt',
1973 'src/detect-virt/detect-virt.c',
1974 include_directories : includes,
1975 link_with : [libshared],
1976 install_rpath : rootlibexecdir,
1977 install : true)
1978public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001979
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001980exe = executable('systemd-delta',
1981 'src/delta/delta.c',
1982 include_directories : includes,
1983 link_with : [libshared],
1984 install_rpath : rootlibexecdir,
1985 install : true)
1986public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001987
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001988exe = executable('systemd-escape',
1989 'src/escape/escape.c',
1990 include_directories : includes,
1991 link_with : [libshared],
1992 install_rpath : rootlibexecdir,
1993 install : true,
1994 install_dir : rootbindir)
1995public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001996
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001997exe = executable('systemd-notify',
1998 'src/notify/notify.c',
1999 include_directories : includes,
2000 link_with : [libshared],
2001 install_rpath : rootlibexecdir,
2002 install : true,
2003 install_dir : rootbindir)
2004public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002005
2006executable('systemd-volatile-root',
2007 'src/volatile-root/volatile-root.c',
2008 include_directories : includes,
2009 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002010 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002011 install : true,
2012 install_dir : rootlibexecdir)
2013
2014executable('systemd-cgroups-agent',
2015 'src/cgroups-agent/cgroups-agent.c',
2016 include_directories : includes,
2017 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002018 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002019 install : true,
2020 install_dir : rootlibexecdir)
2021
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002022exe = executable('systemd-path',
2023 'src/path/path.c',
2024 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002025 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002026 install_rpath : rootlibexecdir,
2027 install : true)
2028public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002029
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002030exe = executable('systemd-ask-password',
2031 'src/ask-password/ask-password.c',
2032 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002033 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002034 install_rpath : rootlibexecdir,
2035 install : true,
2036 install_dir : rootbindir)
2037public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002038
2039executable('systemd-reply-password',
2040 'src/reply-password/reply-password.c',
2041 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002042 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002043 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002044 install : true,
2045 install_dir : rootlibexecdir)
2046
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002047exe = executable('systemd-tty-ask-password-agent',
2048 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2049 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002050 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002051 install_rpath : rootlibexecdir,
2052 install : true,
2053 install_dir : rootbindir)
2054public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002055
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002056exe = executable('systemd-cgls',
2057 'src/cgls/cgls.c',
2058 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002059 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002060 install_rpath : rootlibexecdir,
2061 install : true)
2062public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002063
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002064exe = executable('systemd-cgtop',
2065 'src/cgtop/cgtop.c',
2066 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002067 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002068 install_rpath : rootlibexecdir,
2069 install : true)
2070public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002071
2072executable('systemd-initctl',
2073 'src/initctl/initctl.c',
2074 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002075 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002076 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002077 install : true,
2078 install_dir : rootlibexecdir)
2079
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002080exe = executable('systemd-mount',
2081 'src/mount/mount-tool.c',
2082 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002083 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084 install_rpath : rootlibexecdir,
2085 install : true)
2086public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002087
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002088meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002089 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002090
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002091exe = executable('systemd-run',
2092 'src/run/run.c',
2093 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002094 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002095 install_rpath : rootlibexecdir,
2096 install : true)
2097public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002098
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002099exe = executable('systemd-stdio-bridge',
2100 'src/stdio-bridge/stdio-bridge.c',
2101 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002102 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002103 install_rpath : rootlibexecdir,
2104 install : true)
2105public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002106
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002107exe = executable('busctl',
2108 'src/busctl/busctl.c',
2109 'src/busctl/busctl-introspect.c',
2110 'src/busctl/busctl-introspect.h',
2111 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002112 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002113 install_rpath : rootlibexecdir,
2114 install : true)
2115public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002116
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002117if conf.get('ENABLE_SYSUSERS') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002118 exe = executable('systemd-sysusers',
2119 'src/sysusers/sysusers.c',
2120 include_directories : includes,
2121 link_with : [libshared],
2122 install_rpath : rootlibexecdir,
2123 install : true,
2124 install_dir : rootbindir)
2125 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002126endif
2127
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002128if conf.get('ENABLE_TMPFILES') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002129 exe = executable('systemd-tmpfiles',
2130 'src/tmpfiles/tmpfiles.c',
2131 include_directories : includes,
2132 link_with : [libshared],
2133 dependencies : [libacl],
2134 install_rpath : rootlibexecdir,
2135 install : true,
2136 install_dir : rootbindir)
2137 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002138endif
2139
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002140if conf.get('ENABLE_HWDB') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002141 exe = executable('systemd-hwdb',
2142 'src/hwdb/hwdb.c',
2143 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2144 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002145 link_with : [libudev_internal],
2146 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002147 install : true,
2148 install_dir : rootbindir)
2149 public_programs += [exe]
2150endif
2151
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002152if conf.get('ENABLE_QUOTACHECK') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002153 executable('systemd-quotacheck',
2154 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002155 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,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002159 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002160endif
2161
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002162exe = executable('systemd-socket-proxyd',
2163 'src/socket-proxy/socket-proxyd.c',
2164 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002165 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002166 dependencies : [threads],
2167 install_rpath : rootlibexecdir,
2168 install : true,
2169 install_dir : rootlibexecdir)
2170public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002171
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002172exe = executable('systemd-udevd',
2173 systemd_udevd_sources,
2174 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002175 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002176 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002177 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002178 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002179 dependencies : [threads,
2180 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002181 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002182 libacl,
2183 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002184 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002185 install : true,
2186 install_dir : rootlibexecdir)
2187public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002188
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002189exe = executable('udevadm',
2190 udevadm_sources,
2191 include_directories : includes,
2192 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002193 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002194 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002195 dependencies : [threads,
2196 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002197 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002198 libacl,
2199 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002200 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002201 install : true,
2202 install_dir : rootbindir)
2203public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002204
2205executable('systemd-shutdown',
2206 systemd_shutdown_sources,
2207 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002208 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002209 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002210 install : true,
2211 install_dir : rootlibexecdir)
2212
2213executable('systemd-update-done',
2214 'src/update-done/update-done.c',
2215 include_directories : includes,
2216 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002217 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002218 install : true,
2219 install_dir : rootlibexecdir)
2220
2221executable('systemd-update-utmp',
2222 'src/update-utmp/update-utmp.c',
2223 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002224 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002225 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002226 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002227 install : true,
2228 install_dir : rootlibexecdir)
2229
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002230if conf.get('HAVE_KMOD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002231 executable('systemd-modules-load',
2232 'src/modules-load/modules-load.c',
2233 include_directories : includes,
2234 link_with : [libshared],
2235 dependencies : [libkmod],
2236 install_rpath : rootlibexecdir,
2237 install : true,
2238 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002239
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002240 meson.add_install_script('sh', '-c',
2241 mkdir_p.format(modulesloaddir))
2242 meson.add_install_script('sh', '-c',
2243 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002244endif
2245
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002246exe = executable('systemd-nspawn',
2247 systemd_nspawn_sources,
2248 'src/core/mount-setup.c', # FIXME: use a variable?
2249 'src/core/mount-setup.h',
2250 'src/core/loopback-setup.c',
2251 'src/core/loopback-setup.h',
2252 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002253 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002254 dependencies : [libacl,
2255 libblkid,
2256 libseccomp,
2257 libselinux],
2258 install_rpath : rootlibexecdir,
2259 install : true)
2260public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002261
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002262if conf.get('ENABLE_NETWORKD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002263 executable('systemd-networkd',
2264 systemd_networkd_sources,
2265 include_directories : includes,
2266 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002267 libsystemd_network,
2268 libudev_internal,
2269 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002270 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002271 install_rpath : rootlibexecdir,
2272 install : true,
2273 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002274
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002275 executable('systemd-networkd-wait-online',
2276 systemd_networkd_wait_online_sources,
2277 include_directories : includes,
2278 link_with : [libnetworkd_core,
2279 libshared],
2280 install_rpath : rootlibexecdir,
2281 install : true,
2282 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002283
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002284 exe = executable('networkctl',
2285 networkctl_sources,
2286 include_directories : includes,
2287 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002288 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002289 install_rpath : rootlibexecdir,
2290 install : true,
2291 install_dir : rootbindir)
2292 public_programs += [exe]
2293endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002294############################################################
2295
2296foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002297 sources = tuple[0]
2298 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2299 dependencies = tuple[2]
2300 condition = tuple.length() >= 4 ? tuple[3] : ''
2301 type = tuple.length() >= 5 ? tuple[4] : ''
2302 defs = tuple.length() >= 6 ? tuple[5] : []
2303 incs = tuple.length() >= 7 ? tuple[6] : includes
2304 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002305
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002306 name = sources[0].split('/')[-1].split('.')[0]
2307 if type.startswith('timeout=')
2308 timeout = type.split('=')[1].to_int()
2309 type = ''
2310 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002311
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002312 if condition == '' or conf.get(condition) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002313 exe = executable(
2314 name,
2315 sources,
2316 include_directories : incs,
2317 link_with : link_with,
2318 dependencies : dependencies,
2319 c_args : defs,
2320 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002321 install : install_tests,
2322 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002323
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002324 if type == 'manual'
2325 message('@0@ is a manual test'.format(name))
2326 elif type == 'unsafe' and want_tests != 'unsafe'
2327 message('@0@ is an unsafe test'.format(name))
2328 else
2329 test(name, exe,
2330 env : test_env,
2331 timeout : timeout)
2332 endif
2333 else
2334 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2335 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002336endforeach
2337
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002338test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002339 'test-libsystemd-sym',
2340 test_libsystemd_sym_c,
2341 include_directories : includes,
2342 link_with : [libsystemd],
2343 install : install_tests,
2344 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002345test('test-libsystemd-sym',
2346 test_libsystemd_sym)
2347
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002348test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002349 'test-libudev-sym',
2350 test_libudev_sym_c,
2351 include_directories : includes,
2352 c_args : ['-Wno-deprecated-declarations'],
2353 link_with : [libudev],
2354 install : install_tests,
2355 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002356test('test-libudev-sym',
2357 test_libudev_sym)
2358
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002359############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002360
2361make_directive_index_py = find_program('tools/make-directive-index.py')
2362make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002363xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002364hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002365
2366subdir('units')
2367subdir('sysctl.d')
2368subdir('sysusers.d')
2369subdir('tmpfiles.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002370subdir('hwdb')
2371subdir('network')
2372subdir('man')
2373subdir('shell-completion/bash')
2374subdir('shell-completion/zsh')
2375subdir('docs/sysvinit')
2376subdir('docs/var-log')
2377
2378# FIXME: figure out if the warning is true:
2379# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2380install_subdir('factory/etc',
2381 install_dir : factorydir)
2382
2383
2384install_data('xorg/50-systemd-user.sh',
2385 install_dir : xinitrcdir)
2386install_data('system-preset/90-systemd.preset',
2387 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002388install_data('modprobe.d/systemd.conf',
2389 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002390install_data('README',
2391 'NEWS',
2392 'CODING_STYLE',
2393 'DISTRO_PORTING',
2394 'ENVIRONMENT.md',
2395 'LICENSE.GPL2',
2396 'LICENSE.LGPL2.1',
2397 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2398 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002399
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002400meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2401meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2402
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002403############################################################
2404
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002405meson_check_help = find_program('tools/meson-check-help.sh')
2406
2407foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002408 name = exec.full_path().split('/')[-1]
2409 test('check-help-' + name,
2410 meson_check_help,
2411 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002412endforeach
2413
2414############################################################
2415
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002416if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002417 all_files = run_command(
2418 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002419 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002420 'ls-files',
2421 ':/*.[ch]'])
2422 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002423
userwithuide85a6902017-08-09 13:41:44 +00002424 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002425 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002426 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002427 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002428 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002429 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002430 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002431 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002432endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002433
2434if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002435 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002436 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002437 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002438 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002439endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002440
2441if git.found()
2442 git_head = run_command(
2443 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002444 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002445 'rev-parse', 'HEAD']).stdout().strip()
2446 git_head_short = run_command(
2447 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002448 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002449 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2450
2451 run_target(
2452 'git-snapshot',
2453 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002454 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002455 git_head_short),
2456 '--prefix', 'systemd-@0@/'.format(git_head),
2457 'HEAD'])
2458endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002459
2460############################################################
2461
2462status = [
2463 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2464
Yu Watanabe359b4962017-11-25 20:35:24 +09002465 'prefix directory: @0@'.format(prefixdir),
2466 'rootprefix directory: @0@'.format(rootprefixdir),
2467 'sysconf directory: @0@'.format(sysconfdir),
2468 'include directory: @0@'.format(includedir),
2469 'lib directory: @0@'.format(libdir),
2470 'rootlib directory: @0@'.format(rootlibdir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002471 'SysV init scripts: @0@'.format(sysvinit_path),
2472 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
Yu Watanabe359b4962017-11-25 20:35:24 +09002473 'PAM modules directory: @0@'.format(pamlibdir),
2474 'PAM configuration directory: @0@'.format(pamconfdir),
2475 'RPM macros directory: @0@'.format(rpmmacrosdir),
2476 'modprobe.d directory: @0@'.format(modprobedir),
2477 'D-Bus policy directory: @0@'.format(dbuspolicydir),
2478 'D-Bus session directory: @0@'.format(dbussessionservicedir),
2479 'D-Bus system directory: @0@'.format(dbussystemservicedir),
2480 'bash completions directory: @0@'.format(bashcompletiondir),
2481 'zsh completions directory: @0@'.format(zshcompletiondir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002482 'extra start script: @0@'.format(get_option('rc-local')),
2483 'extra stop script: @0@'.format(get_option('halt-local')),
2484 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2485 get_option('debug-tty')),
2486 'TTY GID: @0@'.format(tty_gid),
2487 'maximum system UID: @0@'.format(system_uid_max),
2488 'maximum system GID: @0@'.format(system_gid_max),
2489 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
Tom Stellard4e15a732017-10-31 08:46:24 -07002490 'render group access mode: @0@'.format(get_option('group-render-mode')),
Yu Watanabe359b4962017-11-25 20:35:24 +09002491 'certificate root directory: @0@'.format(get_option('certificate-root')),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002492 'support URL: @0@'.format(support_url),
2493 'nobody user name: @0@'.format(get_option('nobody-user')),
2494 'nobody group name: @0@'.format(get_option('nobody-group')),
2495 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002496 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002497
2498 'default DNSSEC mode: @0@'.format(default_dnssec),
2499 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2500 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2501
2502alt_dns_servers = '\n '.join(dns_servers.split(' '))
2503alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2504status += [
2505 'default DNS servers: @0@'.format(alt_dns_servers),
2506 'default NTP servers: @0@'.format(alt_ntp_servers)]
2507
2508alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2509 '@@0@'.format(time_epoch)).stdout().strip()
2510status += [
2511 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2512
2513# TODO:
2514# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2515# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2516# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2517
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002518if conf.get('ENABLE_EFI') == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002519 status += [
2520 'efi arch: @0@'.format(efi_arch)]
2521
2522 if have_gnu_efi
2523 status += [
2524 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2525 'EFI CC @0@'.format(efi_cc),
Yu Watanabe359b4962017-11-25 20:35:24 +09002526 'EFI lib directory: @0@'.format(efi_libdir),
2527 'EFI lds directory: @0@'.format(efi_ldsdir),
2528 'EFI include directory: @0@'.format(efi_incdir)]
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002529 endif
2530endif
2531
2532found = []
2533missing = []
2534
2535foreach tuple : [
2536 ['libcryptsetup'],
2537 ['PAM'],
2538 ['AUDIT'],
2539 ['IMA'],
2540 ['AppArmor'],
2541 ['SELinux'],
2542 ['SECCOMP'],
2543 ['SMACK'],
2544 ['zlib'],
2545 ['xz'],
2546 ['lz4'],
2547 ['bzip2'],
2548 ['ACL'],
2549 ['gcrypt'],
2550 ['qrencode'],
2551 ['microhttpd'],
2552 ['gnutls'],
2553 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002554 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002555 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002556 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002557 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002558 ['libiptc'],
2559 ['elfutils'],
2560 ['binfmt'],
2561 ['vconsole'],
2562 ['quotacheck'],
2563 ['tmpfiles'],
2564 ['environment.d'],
2565 ['sysusers'],
2566 ['firstboot'],
2567 ['randomseed'],
2568 ['backlight'],
2569 ['rfkill'],
2570 ['logind'],
2571 ['machined'],
2572 ['importd'],
2573 ['hostnamed'],
2574 ['timedated'],
2575 ['timesyncd'],
2576 ['localed'],
2577 ['networkd'],
Yu Watanabea7456af2017-10-06 16:33:21 +09002578 ['resolve'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002579 ['coredump'],
2580 ['polkit'],
2581 ['legacy pkla', install_polkit_pkla],
2582 ['efi'],
2583 ['gnu-efi', have_gnu_efi],
2584 ['kmod'],
2585 ['xkbcommon'],
2586 ['blkid'],
2587 ['dbus'],
2588 ['glib'],
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02002589 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002590 ['hwdb'],
2591 ['tpm'],
2592 ['man pages', want_man],
2593 ['html pages', want_html],
2594 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002595 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002596 ['SysV compat'],
2597 ['utmp'],
2598 ['ldconfig'],
2599 ['hibernate'],
2600 ['adm group', get_option('adm-group')],
2601 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002602 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002603 ['debug hashmap'],
2604 ['debug mmap cache'],
2605]
2606
2607 cond = tuple.get(1, '')
2608 if cond == ''
2609 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2610 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002611 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002612 endif
2613 if cond
2614 found += [tuple[0]]
2615 else
2616 missing += [tuple[0]]
2617 endif
2618endforeach
2619
2620status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002621 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002622 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002623 '',
2624 'disabled features: @0@'.format(', '.join(missing)),
2625 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002626message('\n '.join(status))
Zbigniew Jędrzejewski-Szmek9a8e64b2017-11-28 21:46:53 +01002627
2628if rootprefixdir != rootprefix_default
2629 message('WARNING:\n' +
2630 ' Note that the installation prefix was changed to "@0@".\n'.format(rootprefixdir) +
2631 ' systemd used fixed names for unit file directories and other paths, so anything\n' +
2632 ' except the default ("@0@") is strongly discouraged.'.format(rootprefix_default))
2633endif