blob: b038d6df820d33fae87d50f403af386550282de0 [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-Szmek349cc4a2017-10-03 10:41:51 +020057conf.set10('HAVE_SPLIT_USR', get_option('split-usr'))
Zbigniew Jędrzejewski-Szmekee4bfa22017-11-17 13:07:46 +010058rootprefixdir = get_option('split-usr') ? '/' : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040059
60sysvinit_path = get_option('sysvinit-path')
61sysvrcnd_path = get_option('sysvrcnd-path')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +020062have = sysvinit_path != '' or sysvrcnd_path != ''
63conf.set10('HAVE_SYSV_COMPAT', have,
64 description : 'SysV init scripts and rcN.d links are supported')
65m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040066
67# join_paths ignore the preceding arguments if an absolute component is
68# encountered, so this should canonicalize various paths when they are
69# absolute or relative.
70prefixdir = get_option('prefix')
71if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040072 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040073endif
74bindir = join_paths(prefixdir, get_option('bindir'))
75libdir = join_paths(prefixdir, get_option('libdir'))
76sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
77includedir = join_paths(prefixdir, get_option('includedir'))
78datadir = join_paths(prefixdir, get_option('datadir'))
79localstatedir = join_paths('/', get_option('localstatedir'))
80
81rootbindir = join_paths(rootprefixdir, 'bin')
82rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
83
84rootlibdir = get_option('rootlibdir')
85if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040086 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040087endif
88
89# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040090pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
91pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
92polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
93polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
94polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
95varlogdir = join_paths(localstatedir, 'log')
96xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek0c6e2702017-11-17 13:22:13 +010097rpmmacrosdir = join_paths(prefixdir, get_option('rpmmacrosdir'))
Michael Biebl02fa0542017-10-21 08:32:50 +020098modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040099
100# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -0400101pkgdatadir = join_paths(datadir, 'systemd')
102environmentdir = join_paths(prefixdir, 'lib/environment.d')
103pkgsysconfdir = join_paths(sysconfdir, 'systemd')
104userunitdir = join_paths(prefixdir, 'lib/systemd/user')
105userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
106tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
107sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
108sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
109binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
110modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
111networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
112pkgincludedir = join_paths(includedir, 'systemd')
113systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
114usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
115systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
116userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
117systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
118systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
119systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
120systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
121udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
122udevhomedir = udevlibexecdir
123udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
124udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
125catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
126kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
127factorydir = join_paths(datadir, 'factory')
128docdir = join_paths(datadir, 'doc/systemd')
129bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
130testsdir = join_paths(prefixdir, 'lib/systemd/tests')
131systemdstatedir = join_paths(localstatedir, 'lib/systemd')
132catalogstatedir = join_paths(systemdstatedir, 'catalog')
133randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400134
135dbuspolicydir = get_option('dbuspolicydir')
136if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400137 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400138endif
139
140dbussessionservicedir = get_option('dbussessionservicedir')
141if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400142 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400143endif
144
145dbussystemservicedir = get_option('dbussystemservicedir')
146if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400147 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400148endif
149
150pamlibdir = get_option('pamlibdir')
151if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400152 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400153endif
154
155pamconfdir = get_option('pamconfdir')
156if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400157 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400158endif
159
160conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400161conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400162conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
163conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
164conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400165conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
166conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400167conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400168conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
169conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400170conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
171conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
172conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
173conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
174conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
175conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
176conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
177conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
178conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400179conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400180conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
181conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400182conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
183conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
184conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
185conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
186conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
187conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400188conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
189conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400190conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400191conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400192conf.set_quoted('LIBDIR', libdir)
193conf.set_quoted('ROOTLIBDIR', rootlibdir)
194conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
195conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400196conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
197conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
198conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
199conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
200conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
201conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400202
203conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
204conf.set_quoted('ABS_SRC_DIR', meson.source_root())
205
206substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400207substs.set('exec_prefix', prefixdir)
208substs.set('libdir', libdir)
209substs.set('rootlibdir', rootlibdir)
210substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400211substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400212substs.set('bindir', bindir)
213substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400214substs.set('rootlibexecdir', rootlibexecdir)
215substs.set('systemunitdir', systemunitdir)
216substs.set('userunitdir', userunitdir)
217substs.set('systempresetdir', systempresetdir)
218substs.set('userpresetdir', userpresetdir)
219substs.set('udevhwdbdir', udevhwdbdir)
220substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400221substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400222substs.set('catalogdir', catalogdir)
223substs.set('tmpfilesdir', tmpfilesdir)
224substs.set('sysusersdir', sysusersdir)
225substs.set('sysctldir', sysctldir)
226substs.set('binfmtdir', binfmtdir)
227substs.set('modulesloaddir', modulesloaddir)
228substs.set('systemgeneratordir', systemgeneratordir)
229substs.set('usergeneratordir', usergeneratordir)
230substs.set('systemenvgeneratordir', systemenvgeneratordir)
231substs.set('userenvgeneratordir', userenvgeneratordir)
232substs.set('systemshutdowndir', systemshutdowndir)
233substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400234substs.set('VARLOGDIR', varlogdir)
235substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400236substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
237substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400238substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
239substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
240substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
241substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400242
243#####################################################################
244
245cc = meson.get_compiler('c')
246pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400247check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400248
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400249cxx = find_program('c++', required : false)
250if cxx.found()
251 # Used only for tests
252 add_languages('cpp')
253endif
254
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400255foreach arg : ['-Wextra',
Zbigniew Jędrzejewski-Szmek70160ce2017-10-03 12:11:49 +0200256 '-Werror=undef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400257 '-Wlogical-op',
258 '-Wmissing-include-dirs',
259 '-Wold-style-definition',
260 '-Wpointer-arith',
261 '-Winit-self',
262 '-Wdeclaration-after-statement',
263 '-Wfloat-equal',
264 '-Wsuggest-attribute=noreturn',
265 '-Werror=missing-prototypes',
266 '-Werror=implicit-function-declaration',
267 '-Werror=missing-declarations',
268 '-Werror=return-type',
269 '-Werror=incompatible-pointer-types',
270 '-Werror=format=2',
271 '-Wstrict-prototypes',
272 '-Wredundant-decls',
273 '-Wmissing-noreturn',
Zbigniew Jędrzejewski-Szmek18c8db12017-11-20 12:14:47 +0100274 '-Wimplicit-fallthrough=3',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400275 '-Wshadow',
276 '-Wendif-labels',
277 '-Wstrict-aliasing=2',
278 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400279 '-Werror=overflow',
280 '-Wdate-time',
281 '-Wnested-externs',
282 '-ffast-math',
283 '-fno-common',
284 '-fdiagnostics-show-option',
285 '-fno-strict-aliasing',
286 '-fvisibility=hidden',
287 '-fstack-protector',
288 '-fstack-protector-strong',
289 '-fPIE',
290 '--param=ssp-buffer-size=4',
291 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400292 if cc.has_argument(arg)
293 add_project_arguments(arg, language : 'c')
294 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400295endforeach
296
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400297# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
298# arguments, just emits a warnings. So test for the "positive" version instead.
299foreach arg : ['unused-parameter',
300 'missing-field-initializers',
301 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300302 'format-signedness',
303 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
304 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400305 if cc.has_argument('-W' + arg)
306 add_project_arguments('-Wno-' + arg, language : 'c')
307 endif
308endforeach
309
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400310if cc.compiles('
311 #include <time.h>
312 #include <inttypes.h>
313 typedef uint64_t usec_t;
314 usec_t now(clockid_t clock);
315 int main(void) {
316 struct timespec now;
317 return 0;
318 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400319', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400320 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400321endif
322
323if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400324 foreach arg : ['-Wno-typedef-redefinition',
325 '-Wno-gnu-variable-sized-type-not-at-end',
326 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400327 if cc.has_argument(arg,
328 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400329 add_project_arguments(arg, language : 'c')
330 endif
331 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400332endif
333
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400334link_test_c = files('tools/meson-link-test.c')
335
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400336# --as-needed and --no-undefined are provided by meson by default,
337# run mesonconf to see what is enabled
338foreach arg : ['-Wl,-z,relro',
339 '-Wl,-z,now',
340 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400341 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400342
343 have = run_command(check_compilation_sh,
344 cc.cmd_array(), '-x', 'c', arg,
345 '-include', link_test_c).returncode() == 0
346 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
347 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400348 add_project_link_arguments(arg, language : 'c')
349 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400350endforeach
351
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400352if get_option('buildtype') != 'debug'
353 foreach arg : ['-ffunction-sections',
354 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400355 if cc.has_argument(arg,
356 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400357 add_project_arguments(arg, language : 'c')
358 endif
359 endforeach
360
361 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400362 have = run_command(check_compilation_sh,
363 cc.cmd_array(), '-x', 'c', arg,
364 '-include', link_test_c).returncode() == 0
365 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
366 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400367 add_project_link_arguments(arg, language : 'c')
368 endif
369 endforeach
370endif
371
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400372cpp = ' '.join(cc.cmd_array()) + ' -E'
373
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400374#####################################################################
375# compilation result tests
376
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400377conf.set('_GNU_SOURCE', true)
378conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400379
380conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
381conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
382conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
383conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
384conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
385conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
386conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
387
388decl_headers = '''
389#include <uchar.h>
390#include <linux/ethtool.h>
Susant Sahanibce67bb2017-09-14 19:51:39 +0000391#include <linux/fib_rules.h>
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400392'''
393# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
394
395foreach decl : ['char16_t',
396 'char32_t',
397 'key_serial_t',
398 'struct ethtool_link_settings',
Susant Sahanibce67bb2017-09-14 19:51:39 +0000399 'struct fib_rule_uid_range',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400400 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400401
402 # We get -1 if the size cannot be determined
403 have = cc.sizeof(decl, prefix : decl_headers) > 0
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200404 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400405endforeach
406
407foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
408 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
409 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
410 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
411 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
412 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
413 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
414 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
415 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
416 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530417 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400418 # if_tunnel.h is buggy and cannot be included on its own
419 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
420 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
421 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
422 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
423 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
424 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
425 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
426 ['NDA_IFINDEX', 'linux/neighbour.h'],
427 ['IFA_FLAGS', 'linux/if_addr.h'],
Susant Sahanibce67bb2017-09-14 19:51:39 +0000428 ['FRA_UID_RANGE', 'linux/fib_rules.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400429 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
430 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400431 prefix = decl.length() > 2 ? decl[2] : ''
432 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200433 conf.set10('HAVE_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400434endforeach
435
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400436foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200437 conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400438endforeach
439
440foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400441 ['memfd_create', '''#include <sys/memfd.h>'''],
442 ['gettid', '''#include <sys/types.h>'''],
443 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
444 ['name_to_handle_at', '''#define _GNU_SOURCE
445 #include <sys/types.h>
446 #include <sys/stat.h>
447 #include <fcntl.h>'''],
448 ['setns', '''#define _GNU_SOURCE
449 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400450 ['renameat2', '''#include <stdio.h>'''],
451 ['kcmp', '''#include <linux/kcmp.h>'''],
452 ['keyctl', '''#include <sys/types.h>
453 #include <keyutils.h>'''],
454 ['copy_file_range', '''#include <sys/syscall.h>
455 #include <unistd.h>'''],
Daniel Mack71e52002016-10-18 17:57:10 +0200456 ['bpf', '''#include <sys/syscall.h>
457 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400458 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400459]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400460
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400461 have = cc.has_function(ident[0], prefix : ident[1])
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200462 conf.set10('HAVE_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400463endforeach
464
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400465if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200466 conf.set10('USE_SYS_RANDOM_H', true)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200467 conf.set10('HAVE_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400468else
469 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200470 conf.set10('USE_SYS_RANDOM_H', false)
Zbigniew Jędrzejewski-Szmek4b9545f2017-10-03 10:32:34 +0200471 conf.set10('HAVE_GETRANDOM', have)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400472endif
473
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400474#####################################################################
475
476sed = find_program('sed')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400477awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400478m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400479stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400480git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400481
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400482meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400483mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400484test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
485splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400486
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400487# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
488# /usr/sbin, /sbin, and fall back to the default from middle column.
489progs = [['telinit', '/lib/sysvinit/telinit'],
490 ['quotaon', '/usr/sbin/quotaon' ],
491 ['quotacheck', '/usr/sbin/quotacheck' ],
492 ['kill', '/usr/bin/kill' ],
493 ['kmod', '/usr/bin/kmod' ],
494 ['kexec', '/usr/sbin/kexec' ],
495 ['sulogin', '/usr/sbin/sulogin' ],
496 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
497 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
498 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
499 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
500 ]
501foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400502 path = get_option(prog[0] + '-path')
503 if path != ''
504 message('Using @1@ for @0@'.format(prog[0], path))
505 else
506 exe = find_program(prog[0],
507 '/usr/sbin/' + prog[0],
508 '/sbin/' + prog[0],
509 required: false)
510 path = exe.found() ? exe.path() : prog[1]
511 endif
512 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
513 conf.set_quoted(name, path)
514 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400515endforeach
516
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400517if run_command('ln', '--relative', '--help').returncode() != 0
518 error('ln does not support --relative')
519endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400520
521############################################################
522
523gperf = find_program('gperf')
524
525gperf_test_format = '''
526#include <string.h>
527const char * in_word_set(const char *, @0@);
528@1@
529'''
530gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
531gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
532gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
533if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400534 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400535else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400536 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
537 if cc.compiles(gperf_test)
538 gperf_len_type = 'unsigned'
539 else
540 error('unable to determine gperf len type')
541 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400542endif
543message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400544conf.set('GPERF_LEN_TYPE', gperf_len_type,
545 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400546
547############################################################
548
549if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400550 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400551endif
552foreach header : ['linux/btrfs.h',
553 'linux/memfd.h',
554 'linux/vm_sockets.h',
Zbigniew Jędrzejewski-Szmekaf8786b2017-10-03 12:09:40 +0200555 'sys/auxv.h',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400556 'valgrind/memcheck.h',
557 'valgrind/valgrind.h',
558 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400559
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200560 conf.set10('HAVE_' + header.underscorify().to_upper(),
561 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400562endforeach
563
564############################################################
565
566conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400567conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
568gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400569
570default_hierarchy = get_option('default-hierarchy')
571conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
572 description : 'default cgroup hierarchy as string')
573if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400574 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400575elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400576 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400577else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400578 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400579endif
580
581time_epoch = get_option('time-epoch')
582if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400583 NEWS = files('NEWS')
584 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400585endif
586time_epoch = time_epoch.to_int()
587conf.set('TIME_EPOCH', time_epoch)
588
589system_uid_max = get_option('system-uid-max')
590if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400591 system_uid_max = run_command(
592 awk,
593 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
594 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400595endif
596system_uid_max = system_uid_max.to_int()
597conf.set('SYSTEM_UID_MAX', system_uid_max)
598substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400599message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400600
601conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
602conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
603
604system_gid_max = get_option('system-gid-max')
605if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400606 system_gid_max = run_command(
607 awk,
608 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
609 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400610endif
611system_gid_max = system_gid_max.to_int()
612conf.set('SYSTEM_GID_MAX', system_gid_max)
613substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400614message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400615
616tty_gid = get_option('tty-gid')
617conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400618substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400619
620if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400621 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400622endif
623
624if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400625 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400626endif
627
628substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
Tom Stellard4e15a732017-10-31 08:46:24 -0700629substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400630
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400631kill_user_processes = get_option('default-kill-user-processes')
632conf.set10('KILL_USER_PROCESSES', kill_user_processes)
633substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400634
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400635dns_servers = get_option('dns-servers')
636conf.set_quoted('DNS_SERVERS', dns_servers)
637substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400638
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400639ntp_servers = get_option('ntp-servers')
640conf.set_quoted('NTP_SERVERS', ntp_servers)
641substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400642
643conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
644
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400645substs.set('SUSHELL', get_option('debug-shell'))
646substs.set('DEBUGTTY', get_option('debug-tty'))
647
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400648debug = get_option('debug')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200649enable_debug_hashmap = false
650enable_debug_mmap_cache = false
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400651if debug != ''
652 foreach name : debug.split(',')
653 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200654 enable_debug_hashmap = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400655 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200656 enable_debug_mmap_cache = true
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400657 else
658 message('unknown debug option "@0@", ignoring'.format(name))
659 endif
660 endforeach
661endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200662conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
663conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400664
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400665#####################################################################
666
667threads = dependency('threads')
668librt = cc.find_library('rt')
669libm = cc.find_library('m')
670libdl = cc.find_library('dl')
671libcrypt = cc.find_library('crypt')
672
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400673libcap = dependency('libcap', required : false)
674if not libcap.found()
675 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
676 libcap = cc.find_library('cap')
677endif
678
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400679libmount = dependency('mount',
Zbigniew Jędrzejewski-Szmekd6e80962017-09-15 14:47:57 +0200680 version : '>= 2.30')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400681
682want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400683if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400684 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400685 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400686 required : want_seccomp == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200687 have = libseccomp.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400688else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200689 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400690 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400691endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200692conf.set10('HAVE_SECCOMP', have)
693m4_defines += have ? ['-DHAVE_SECCOMP'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400694
695want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400696if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400697 libselinux = dependency('libselinux',
698 version : '>= 2.1.9',
699 required : want_selinux == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200700 have = libselinux.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400701else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200702 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400703 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400704endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200705conf.set10('HAVE_SELINUX', have)
706m4_defines += have ? ['-DHAVE_SELINUX'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400707
708want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400709if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400710 libapparmor = dependency('libapparmor',
711 required : want_apparmor == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200712 have = libapparmor.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400713else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200714 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400715 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400716endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200717conf.set10('HAVE_APPARMOR', have)
718m4_defines += have ? ['-DHAVE_APPARMOR'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400719
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400720smack_run_label = get_option('smack-run-label')
721if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400722 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
723 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400724endif
725
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400726want_polkit = get_option('polkit')
727install_polkit = false
728install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400729if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400730 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400731
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400732 libpolkit = dependency('polkit-gobject-1',
733 required : false)
734 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
735 message('Old polkit detected, will install pkla files')
736 install_polkit_pkla = true
737 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400738endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200739conf.set10('ENABLE_POLKIT', install_polkit)
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400740
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400741want_acl = get_option('acl')
742if want_acl != 'false'
743 libacl = cc.find_library('acl', required : want_acl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200744 have = libacl.found()
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400745else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200746 have = false
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400747 libacl = []
748endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200749conf.set10('HAVE_ACL', have)
750m4_defines += have ? ['-DHAVE_ACL'] : []
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400751
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400752want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400753if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400754 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200755 have = libaudit.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400756else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200757 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400758 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400759endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200760conf.set10('HAVE_AUDIT', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400761
762want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400763if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400764 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200765 have = libblkid.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400766else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200767 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400768 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400769endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200770conf.set10('HAVE_BLKID', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400771
772want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400773if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400774 libkmod = dependency('libkmod',
775 version : '>= 15',
776 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200777 have = libkmod.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400778else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200779 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400780 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400781endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200782conf.set10('HAVE_KMOD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400783
784want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400785if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400786 libpam = cc.find_library('pam', required : want_pam == 'true')
787 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200788 have = libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400789else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200790 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400791 libpam = []
792 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400793endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200794conf.set10('HAVE_PAM', have)
795m4_defines += have ? ['-DHAVE_PAM'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400796
797want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400798if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400799 libmicrohttpd = dependency('libmicrohttpd',
800 version : '>= 0.9.33',
801 required : want_microhttpd == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200802 have = libmicrohttpd.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 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400806endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200807conf.set10('HAVE_MICROHTTPD', have)
808m4_defines += have ? ['-DHAVE_MICROHTTPD'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400809
810want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400811if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400812 libcryptsetup = dependency('libcryptsetup',
813 version : '>= 1.6.0',
814 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200815 have = libcryptsetup.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400816else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200817 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400818 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400819endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200820conf.set10('HAVE_LIBCRYPTSETUP', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400821
822want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400823if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400824 libcurl = dependency('libcurl',
825 version : '>= 7.32.0',
826 required : want_libcurl == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200827 have = libcurl.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400828else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200829 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400830 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400831endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200832conf.set10('HAVE_LIBCURL', have)
833m4_defines += have ? ['-DHAVE_LIBCURL'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400834
835want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400836want_libidn2 = get_option('libidn2')
837if want_libidn == 'true' and want_libidn2 == 'true'
838 error('libidn and libidn2 cannot be requested simultaneously')
839endif
840
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400841if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400842 libidn = dependency('libidn',
843 required : want_libidn == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200844 have = libidn.found()
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400845else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200846 have = false
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400847 libidn = []
848endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200849conf.set10('HAVE_LIBIDN', have)
850m4_defines += have ? ['-DHAVE_LIBIDN'] : []
851if not have and want_libidn2 != 'false'
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400852 # libidn is used for both libidn and libidn2 objects
853 libidn = dependency('libidn2',
854 required : want_libidn2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200855 have = libidn.found()
856else
857 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400858endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200859conf.set10('HAVE_LIBIDN2', have)
860m4_defines += have ? ['-DHAVE_LIBIDN2'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400861
862want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400863if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400864 libiptc = dependency('libiptc',
865 required : want_libiptc == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200866 have = libiptc.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400867else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200868 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400869 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400870endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200871conf.set10('HAVE_LIBIPTC', have)
872m4_defines += have ? ['-DHAVE_LIBIPTC'] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400873
874want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400875if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400876 libqrencode = dependency('libqrencode',
877 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200878 have = libqrencode.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400879else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200880 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400881 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400882endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200883conf.set10('HAVE_QRENCODE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400884
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400885want_gcrypt = get_option('gcrypt')
886if want_gcrypt != 'false'
887 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
888 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200889 have = libgcrypt.found() and libgpg_error.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400890else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200891 have = false
892endif
893if not have
894 # link to neither of the libs if one is not found
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400895 libgcrypt = []
896 libgpg_error = []
897endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200898conf.set10('HAVE_GCRYPT', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400899
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400900want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400901if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400902 libgnutls = dependency('gnutls',
903 version : '>= 3.1.4',
904 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200905 have = libgnutls.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400906else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200907 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400908 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400909endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200910conf.set10('HAVE_GNUTLS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400911
912want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400913if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400914 libdw = dependency('libdw',
915 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200916 have = libdw.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400917else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200918 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400919 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400920endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200921conf.set10('HAVE_ELFUTILS', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400922
923want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400924if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400925 libz = dependency('zlib',
926 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200927 have = libz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400928else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200929 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400930 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400931endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200932conf.set10('HAVE_ZLIB', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400933
934want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400935if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400936 libbzip2 = cc.find_library('bz2',
937 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200938 have = libbzip2.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400939else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200940 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400941 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400942endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200943conf.set10('HAVE_BZIP2', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400944
945want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400946if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400947 libxz = dependency('liblzma',
948 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200949 have = libxz.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400950else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200951 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400952 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400953endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200954conf.set10('HAVE_XZ', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400955
956want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400957if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400958 liblz4 = dependency('liblz4',
959 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200960 have = liblz4.found()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400961else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200962 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400963 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400964endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200965conf.set10('HAVE_LZ4', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400966
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400967want_xkbcommon = get_option('xkbcommon')
968if want_xkbcommon != 'false'
969 libxkbcommon = dependency('xkbcommon',
970 version : '>= 0.3.0',
971 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200972 have = libxkbcommon.found()
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400973else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200974 have = false
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400975 libxkbcommon = []
976endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200977conf.set10('HAVE_XKBCOMMON', have)
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400978
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400979want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400980if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400981 libglib = dependency('glib-2.0',
982 version : '>= 2.22.0',
983 required : want_glib == 'true')
984 libgobject = dependency('gobject-2.0',
985 version : '>= 2.22.0',
986 required : want_glib == 'true')
987 libgio = dependency('gio-2.0',
988 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400989 have = libglib.found() and libgobject.found() and libgio.found()
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400990else
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200991 have = false
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400992 libglib = []
993 libgobject = []
994 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400995endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +0200996conf.set10('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400997
998want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400999if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001000 libdbus = dependency('dbus-1',
1001 version : '>= 1.3.2',
1002 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001003 have = libdbus.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 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001007endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001008conf.set10('HAVE_DBUS', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001009
Yu Watanabe42303dc2017-06-18 05:22:32 +09001010default_dnssec = get_option('default-dnssec')
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001011if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0
Yu Watanabe42303dc2017-06-18 05:22:32 +09001012 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
1013 default_dnssec = 'no'
1014endif
1015conf.set('DEFAULT_DNSSEC_MODE',
1016 'DNSSEC_' + default_dnssec.underscorify().to_upper())
1017substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
1018
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001019want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001020if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001021 have = (conf.get('HAVE_LIBCURL') == 1 and
1022 conf.get('HAVE_ZLIB') == 1 and
1023 conf.get('HAVE_BZIP2') == 1 and
1024 conf.get('HAVE_XZ') == 1 and
1025 conf.get('HAVE_GCRYPT') == 1)
1026 if want_importd == 'true' and not have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001027 error('importd support was requested, but dependencies are not available')
1028 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001029else
1030 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001031endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001032conf.set10('ENABLE_IMPORTD', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001033
1034want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -04001035if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001036 have_deps = [conf.get('HAVE_MICROHTTPD') == 1,
1037 conf.get('HAVE_LIBCURL') == 1]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001038 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
1039 # it's possible to build one without the other. Complain only if
1040 # support was explictly requested. The auxiliary files like sysusers
1041 # config should be installed when any of the programs are built.
1042 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
1043 error('remote support was requested, but dependencies are not available')
1044 endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001045 have = have_deps[0] or have_deps[1]
1046else
1047 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001048endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001049conf.set10('ENABLE_REMOTE', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001050
Zbigniew Jędrzejewski-Szmeka9149d82017-10-03 13:15:27 +02001051foreach term : ['utmp',
1052 'hibernate',
1053 'environment-d',
1054 'binfmt',
1055 'coredump',
1056 'resolve',
1057 'logind',
1058 'hostnamed',
1059 'localed',
1060 'machined',
1061 'networkd',
1062 'timedated',
1063 'timesyncd',
1064 'myhostname',
1065 'firstboot',
1066 'randomseed',
1067 'backlight',
1068 'vconsole',
1069 'quotacheck',
1070 'sysusers',
1071 'tmpfiles',
1072 'hwdb',
1073 'rfkill',
1074 'ldconfig',
1075 'efi',
1076 'tpm',
1077 'ima',
1078 'smack',
1079 'gshadow',
1080 'idn',
1081 'nss-systemd']
1082 have = get_option(term)
1083 name = 'ENABLE_' + term.underscorify().to_upper()
1084 conf.set10(name, have)
1085 m4_defines += have ? ['-D' + name] : []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001086endforeach
1087
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001088want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001089install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001090tests = []
1091
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001092conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1093
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001094#####################################################################
1095
1096if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001097 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001098
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001099 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001100 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001101 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001102 elif efi_arch == 'x86_64'
1103 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001104 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001105 elif efi_arch == 'arm'
1106 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001107 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001108 elif efi_arch == 'aarch64'
1109 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001110 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001111 else
1112 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001113 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001114 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001115
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001116 have = true
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001117 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001118
1119 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001120else
1121 have = false
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001122endif
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001123conf.set10('ENABLE_EFI', have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001124
1125#####################################################################
1126
1127config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001128 output : 'config.h',
1129 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001130
1131includes = include_directories('src/basic',
1132 'src/shared',
1133 'src/systemd',
1134 'src/journal',
1135 'src/resolve',
1136 'src/timesync',
1137 'src/login',
1138 'src/udev',
1139 'src/libudev',
1140 'src/core',
1141 'src/libsystemd/sd-bus',
1142 'src/libsystemd/sd-device',
1143 'src/libsystemd/sd-hwdb',
1144 'src/libsystemd/sd-id128',
1145 'src/libsystemd/sd-netlink',
1146 'src/libsystemd/sd-network',
1147 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001148 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001149 )
1150
1151add_project_arguments('-include', 'config.h', language : 'c')
1152
1153gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1154 'src/shared/gcrypt-util.c')
1155
1156subdir('po')
1157subdir('catalog')
1158subdir('src/systemd')
1159subdir('src/basic')
1160subdir('src/libsystemd')
1161subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001162subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001163subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001164
1165libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001166 'journal-core',
1167 libjournal_core_sources,
1168 journald_gperf_c,
1169 include_directories : includes,
1170 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001171
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001172libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001173libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001174 'systemd',
1175 libsystemd_internal_sources,
1176 journal_internal_sources,
Zbigniew Jędrzejewski-Szmek56d50ab2017-09-28 19:24:16 +02001177 version : libsystemd_version,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001178 include_directories : includes,
1179 link_args : ['-shared',
1180 '-Wl,--version-script=' + libsystemd_sym_path],
1181 link_with : [libbasic],
1182 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001183 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001184 librt,
1185 libxz,
1186 liblz4],
1187 link_depends : libsystemd_sym,
1188 install : true,
1189 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001190
1191############################################################
1192
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001193# binaries that have --help and are intended for use by humans,
1194# usually, but not always, installed in /bin.
1195public_programs = []
1196
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001197subdir('src/libudev')
1198subdir('src/shared')
1199subdir('src/core')
1200subdir('src/udev')
1201subdir('src/network')
1202
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001203subdir('src/analyze')
1204subdir('src/journal-remote')
1205subdir('src/coredump')
1206subdir('src/hostname')
1207subdir('src/import')
1208subdir('src/kernel-install')
1209subdir('src/locale')
1210subdir('src/machine')
1211subdir('src/nspawn')
1212subdir('src/resolve')
1213subdir('src/timedate')
1214subdir('src/timesync')
1215subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001216subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001217subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001218
1219subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001220subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001221
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001222############################################################
1223
1224# only static linking apart from libdl, to make sure that the
1225# module is linked to all libraries that it uses.
1226test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001227 'test-dlopen',
1228 test_dlopen_c,
1229 include_directories : includes,
1230 link_with : [libbasic],
1231 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001232
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02001233foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001234 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001235 ['mymachines', 'ENABLE_MACHINED'],
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001236 ['resolve', 'ENABLE_RESOLVE']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001237
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001238 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001239 if condition
1240 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001241
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001242 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1243 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001244
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001245 nss = shared_library(
1246 'nss_' + module,
1247 'src/nss-@0@/nss-@0@.c'.format(module),
1248 version : '2',
1249 include_directories : includes,
1250 link_args : ['-shared',
1251 '-Wl,--version-script=' + version_script_arg,
1252 '-Wl,--undefined'],
1253 link_with : [libsystemd_internal,
1254 libbasic],
1255 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001256 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001257 link_depends : sym,
1258 install : true,
1259 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001260
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001261 # We cannot use shared_module because it does not support version suffix.
1262 # Unfortunately shared_library insists on creating the symlink…
1263 meson.add_install_script('sh', '-c',
1264 'rm $DESTDIR@0@/libnss_@1@.so'
1265 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001266
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001267 test('dlopen-nss_' + module,
1268 test_dlopen,
1269 args : [nss.full_path()]) # path to dlopen must include a slash
1270 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001271endforeach
1272
1273############################################################
1274
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001275executable('systemd',
1276 systemd_sources,
1277 include_directories : includes,
1278 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001279 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001280 dependencies : [threads,
1281 librt,
1282 libseccomp,
1283 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001284 libmount,
1285 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001286 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001287 install : true,
1288 install_dir : rootlibexecdir)
1289
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001290exe = executable('systemd-analyze',
1291 systemd_analyze_sources,
1292 include_directories : includes,
1293 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001294 libshared],
1295 dependencies : [threads,
1296 librt,
1297 libseccomp,
1298 libselinux,
1299 libmount,
1300 libblkid],
1301 install_rpath : rootlibexecdir,
1302 install : true)
1303public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001304
1305executable('systemd-journald',
1306 systemd_journald_sources,
1307 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001308 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001309 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001310 dependencies : [threads,
1311 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001312 liblz4,
1313 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001314 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001315 install : true,
1316 install_dir : rootlibexecdir)
1317
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001318exe = executable('systemd-cat',
1319 systemd_cat_sources,
1320 include_directories : includes,
1321 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001322 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001323 dependencies : [threads],
1324 install_rpath : rootlibexecdir,
1325 install : true)
1326public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001327
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001328exe = executable('journalctl',
1329 journalctl_sources,
1330 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001331 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001332 dependencies : [threads,
1333 libqrencode,
1334 libxz,
1335 liblz4],
1336 install_rpath : rootlibexecdir,
1337 install : true,
1338 install_dir : rootbindir)
1339public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001340
1341executable('systemd-getty-generator',
1342 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001343 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001344 link_with : [libshared],
1345 install_rpath : rootlibexecdir,
1346 install : true,
1347 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001348
1349executable('systemd-debug-generator',
1350 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001351 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001352 link_with : [libshared],
1353 install_rpath : rootlibexecdir,
1354 install : true,
1355 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001356
1357executable('systemd-fstab-generator',
1358 'src/fstab-generator/fstab-generator.c',
1359 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001360 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001361 link_with : [libshared],
1362 install_rpath : rootlibexecdir,
1363 install : true,
1364 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001365
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001366if conf.get('ENABLE_ENVIRONMENT_D') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001367 executable('30-systemd-environment-d-generator',
1368 'src/environment-d-generator/environment-d-generator.c',
1369 include_directories : includes,
1370 link_with : [libshared],
1371 install_rpath : rootlibexecdir,
1372 install : true,
1373 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001374
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001375 meson.add_install_script(meson_make_symlink,
1376 join_paths(sysconfdir, 'environment'),
1377 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001378endif
1379
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001380if conf.get('ENABLE_HIBERNATE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001381 executable('systemd-hibernate-resume-generator',
1382 'src/hibernate-resume/hibernate-resume-generator.c',
1383 include_directories : includes,
1384 link_with : [libshared],
1385 install_rpath : rootlibexecdir,
1386 install : true,
1387 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001388
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001389 executable('systemd-hibernate-resume',
1390 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001391 include_directories : includes,
1392 link_with : [libshared],
1393 install_rpath : rootlibexecdir,
1394 install : true,
1395 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001396endif
1397
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001398if conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001399 executable('systemd-gpt-auto-generator',
1400 'src/gpt-auto-generator/gpt-auto-generator.c',
1401 'src/basic/blkid-util.h',
1402 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001403 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001404 dependencies : libblkid,
1405 install_rpath : rootlibexecdir,
1406 install : true,
1407 install_dir : systemgeneratordir)
1408
1409 exe = executable('systemd-dissect',
1410 'src/dissect/dissect.c',
1411 include_directories : includes,
1412 link_with : [libshared],
1413 install_rpath : rootlibexecdir,
1414 install : true,
1415 install_dir : rootlibexecdir)
1416 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001417endif
1418
Zbigniew Jędrzejewski-Szmek1ec57f32017-10-03 13:12:29 +02001419if conf.get('ENABLE_RESOLVE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001420 executable('systemd-resolved',
1421 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001422 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001423 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001424 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001425 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001426 libgcrypt,
1427 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001428 libm,
1429 libidn],
1430 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001431 install : true,
1432 install_dir : rootlibexecdir)
1433
1434 exe = executable('systemd-resolve',
1435 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001436 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001437 include_directories : includes,
1438 link_with : [libshared],
1439 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001440 libgcrypt,
1441 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001442 libm,
1443 libidn],
1444 install_rpath : rootlibexecdir,
1445 install : true)
1446 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001447endif
1448
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001449if conf.get('ENABLE_LOGIND') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001450 executable('systemd-logind',
1451 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001452 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001453 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001454 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001455 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001456 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001457 install_rpath : rootlibexecdir,
1458 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001459 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001460
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001461 exe = executable('loginctl',
1462 loginctl_sources,
1463 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001464 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001465 dependencies : [threads,
1466 liblz4,
1467 libxz],
1468 install_rpath : rootlibexecdir,
1469 install : true,
1470 install_dir : rootbindir)
1471 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001472
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001473 exe = executable('systemd-inhibit',
1474 'src/login/inhibit.c',
1475 include_directories : includes,
1476 link_with : [libshared],
1477 install_rpath : rootlibexecdir,
1478 install : true,
1479 install_dir : rootbindir)
1480 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001481
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001482 if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001483 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1484 pam_systemd = shared_library(
1485 'pam_systemd',
1486 pam_systemd_c,
1487 name_prefix : '',
1488 include_directories : includes,
1489 link_args : ['-shared',
1490 '-Wl,--version-script=' + version_script_arg],
1491 link_with : [libsystemd_internal,
1492 libshared_static],
1493 dependencies : [threads,
1494 libpam,
1495 libpam_misc],
1496 link_depends : pam_systemd_sym,
1497 install : true,
1498 install_dir : pamlibdir)
1499
1500 test('dlopen-pam_systemd',
1501 test_dlopen,
1502 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1503 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001504endif
1505
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001506if conf.get('HAVE_PAM') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001507 executable('systemd-user-sessions',
1508 'src/user-sessions/user-sessions.c',
1509 include_directories : includes,
1510 link_with : [libshared],
1511 install_rpath : rootlibexecdir,
1512 install : true,
1513 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001514endif
1515
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001516if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001517 exe = executable('bootctl',
1518 'src/boot/bootctl.c',
1519 include_directories : includes,
1520 link_with : [libshared],
1521 dependencies : [libblkid],
1522 install_rpath : rootlibexecdir,
1523 install : true)
1524 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001525endif
1526
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001527exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1528 include_directories : includes,
1529 link_with : [libshared],
1530 dependencies : [threads],
1531 install_rpath : rootlibexecdir,
1532 install : true)
1533public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001534
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001535exe = executable('systemctl', 'src/systemctl/systemctl.c',
1536 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001537 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001538 dependencies : [threads,
1539 libcap,
1540 libselinux,
1541 libxz,
1542 liblz4],
1543 install_rpath : rootlibexecdir,
1544 install : true,
1545 install_dir : rootbindir)
1546public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001547
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001548if conf.get('ENABLE_BACKLIGHT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001549 executable('systemd-backlight',
1550 'src/backlight/backlight.c',
1551 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001552 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001553 install_rpath : rootlibexecdir,
1554 install : true,
1555 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001556endif
1557
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001558if conf.get('ENABLE_RFKILL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001559 executable('systemd-rfkill',
1560 'src/rfkill/rfkill.c',
1561 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001562 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001563 install_rpath : rootlibexecdir,
1564 install : true,
1565 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001566endif
1567
1568executable('systemd-system-update-generator',
1569 'src/system-update-generator/system-update-generator.c',
1570 include_directories : includes,
1571 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001572 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001573 install : true,
1574 install_dir : systemgeneratordir)
1575
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001576if conf.get('HAVE_LIBCRYPTSETUP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001577 executable('systemd-cryptsetup',
1578 'src/cryptsetup/cryptsetup.c',
1579 include_directories : includes,
1580 link_with : [libshared],
1581 dependencies : [libcryptsetup],
1582 install_rpath : rootlibexecdir,
1583 install : true,
1584 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001585
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001586 executable('systemd-cryptsetup-generator',
1587 'src/cryptsetup/cryptsetup-generator.c',
1588 include_directories : includes,
1589 link_with : [libshared],
1590 dependencies : [libcryptsetup],
1591 install_rpath : rootlibexecdir,
1592 install : true,
1593 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001594
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001595 executable('systemd-veritysetup',
1596 'src/veritysetup/veritysetup.c',
1597 include_directories : includes,
1598 link_with : [libshared],
1599 dependencies : [libcryptsetup],
1600 install_rpath : rootlibexecdir,
1601 install : true,
1602 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001603
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001604 executable('systemd-veritysetup-generator',
1605 'src/veritysetup/veritysetup-generator.c',
1606 include_directories : includes,
1607 link_with : [libshared],
1608 dependencies : [libcryptsetup],
1609 install_rpath : rootlibexecdir,
1610 install : true,
1611 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001612endif
1613
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001614if conf.get('HAVE_SYSV_COMPAT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001615 executable('systemd-sysv-generator',
1616 'src/sysv-generator/sysv-generator.c',
1617 include_directories : includes,
1618 link_with : [libshared],
1619 install_rpath : rootlibexecdir,
1620 install : true,
1621 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001622
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001623 executable('systemd-rc-local-generator',
1624 'src/rc-local-generator/rc-local-generator.c',
1625 include_directories : includes,
1626 link_with : [libshared],
1627 install_rpath : rootlibexecdir,
1628 install : true,
1629 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001630endif
1631
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001632if conf.get('ENABLE_HOSTNAMED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001633 executable('systemd-hostnamed',
1634 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001635 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001636 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001637 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001638 install : true,
1639 install_dir : rootlibexecdir)
1640
1641 exe = executable('hostnamectl',
1642 'src/hostname/hostnamectl.c',
1643 include_directories : includes,
1644 link_with : [libshared],
1645 install_rpath : rootlibexecdir,
1646 install : true)
1647 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001648endif
1649
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001650if conf.get('ENABLE_LOCALED') == 1
1651 if conf.get('HAVE_XKBCOMMON') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001652 # logind will load libxkbcommon.so dynamically on its own
1653 deps = [libdl]
1654 else
1655 deps = []
1656 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001657
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001658 executable('systemd-localed',
1659 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001660 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001661 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001662 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001663 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001664 install : true,
1665 install_dir : rootlibexecdir)
1666
1667 exe = executable('localectl',
1668 localectl_sources,
1669 include_directories : includes,
1670 link_with : [libshared],
1671 install_rpath : rootlibexecdir,
1672 install : true)
1673 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001674endif
1675
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001676if conf.get('ENABLE_TIMEDATED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001677 executable('systemd-timedated',
1678 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001679 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001680 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001681 install_rpath : rootlibexecdir,
1682 install : true,
1683 install_dir : rootlibexecdir)
1684
1685 exe = executable('timedatectl',
1686 'src/timedate/timedatectl.c',
1687 include_directories : includes,
1688 install_rpath : rootlibexecdir,
1689 link_with : [libshared],
1690 install : true)
1691 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001692endif
1693
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001694if conf.get('ENABLE_TIMESYNCD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001695 executable('systemd-timesyncd',
1696 systemd_timesyncd_sources,
1697 include_directories : includes,
1698 link_with : [libshared],
1699 dependencies : [threads,
1700 libm],
1701 install_rpath : rootlibexecdir,
1702 install : true,
1703 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001704endif
1705
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001706if conf.get('ENABLE_MACHINED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001707 executable('systemd-machined',
1708 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001709 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001710 link_with : [libmachine_core,
1711 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001712 install_rpath : rootlibexecdir,
1713 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001714 install_dir : rootlibexecdir)
1715
1716 exe = executable('machinectl',
1717 'src/machine/machinectl.c',
1718 include_directories : includes,
1719 link_with : [libshared],
1720 dependencies : [threads,
1721 libxz,
1722 liblz4],
1723 install_rpath : rootlibexecdir,
1724 install : true,
1725 install_dir : rootbindir)
1726 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001727endif
1728
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001729if conf.get('ENABLE_IMPORTD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001730 executable('systemd-importd',
1731 systemd_importd_sources,
1732 include_directories : includes,
1733 link_with : [libshared],
1734 dependencies : [threads],
1735 install_rpath : rootlibexecdir,
1736 install : true,
1737 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001738
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001739 systemd_pull = executable('systemd-pull',
1740 systemd_pull_sources,
1741 include_directories : includes,
1742 link_with : [libshared],
1743 dependencies : [libcurl,
1744 libz,
1745 libbzip2,
1746 libxz,
1747 libgcrypt],
1748 install_rpath : rootlibexecdir,
1749 install : true,
1750 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001751
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001752 systemd_import = executable('systemd-import',
1753 systemd_import_sources,
1754 include_directories : includes,
1755 link_with : [libshared],
1756 dependencies : [libcurl,
1757 libz,
1758 libbzip2,
1759 libxz],
1760 install_rpath : rootlibexecdir,
1761 install : true,
1762 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001763
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001764 systemd_export = executable('systemd-export',
1765 systemd_export_sources,
1766 include_directories : includes,
1767 link_with : [libshared],
1768 dependencies : [libcurl,
1769 libz,
1770 libbzip2,
1771 libxz],
1772 install_rpath : rootlibexecdir,
1773 install : true,
1774 install_dir : rootlibexecdir)
1775 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001776endif
1777
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001778if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001779 exe = executable('systemd-journal-upload',
1780 systemd_journal_upload_sources,
1781 include_directories : includes,
1782 link_with : [libshared],
1783 dependencies : [threads,
1784 libcurl,
1785 libgnutls,
1786 libxz,
1787 liblz4],
1788 install_rpath : rootlibexecdir,
1789 install : true,
1790 install_dir : rootlibexecdir)
1791 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001792endif
1793
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001794if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001795 s_j_remote = executable('systemd-journal-remote',
1796 systemd_journal_remote_sources,
1797 include_directories : includes,
1798 link_with : [libshared],
1799 dependencies : [threads,
1800 libmicrohttpd,
1801 libgnutls,
1802 libxz,
1803 liblz4],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001807
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001808 s_j_gatewayd = executable('systemd-journal-gatewayd',
1809 systemd_journal_gatewayd_sources,
1810 include_directories : includes,
1811 link_with : [libshared],
1812 dependencies : [threads,
1813 libmicrohttpd,
1814 libgnutls,
1815 libxz,
1816 liblz4],
1817 install_rpath : rootlibexecdir,
1818 install : true,
1819 install_dir : rootlibexecdir)
1820 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001821endif
1822
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001823if conf.get('ENABLE_COREDUMP') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001824 executable('systemd-coredump',
1825 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001826 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001827 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001828 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001829 libacl,
1830 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001831 libxz,
1832 liblz4],
1833 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001834 install : true,
1835 install_dir : rootlibexecdir)
1836
1837 exe = executable('coredumpctl',
1838 coredumpctl_sources,
1839 include_directories : includes,
1840 link_with : [libshared],
1841 dependencies : [threads,
1842 libxz,
1843 liblz4],
1844 install_rpath : rootlibexecdir,
1845 install : true)
1846 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001847endif
1848
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001849if conf.get('ENABLE_BINFMT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001850 exe = executable('systemd-binfmt',
1851 'src/binfmt/binfmt.c',
1852 include_directories : includes,
1853 link_with : [libshared],
1854 install_rpath : rootlibexecdir,
1855 install : true,
1856 install_dir : rootlibexecdir)
1857 public_programs += [exe]
1858
1859 meson.add_install_script('sh', '-c',
1860 mkdir_p.format(binfmtdir))
1861 meson.add_install_script('sh', '-c',
1862 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1863endif
1864
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001865if conf.get('ENABLE_VCONSOLE') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001866 executable('systemd-vconsole-setup',
1867 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001868 include_directories : includes,
1869 link_with : [libshared],
1870 install_rpath : rootlibexecdir,
1871 install : true,
1872 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001873endif
1874
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001875if conf.get('ENABLE_RANDOMSEED') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001876 executable('systemd-random-seed',
1877 'src/random-seed/random-seed.c',
1878 include_directories : includes,
1879 link_with : [libshared],
1880 install_rpath : rootlibexecdir,
1881 install : true,
1882 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001883endif
1884
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02001885if conf.get('ENABLE_FIRSTBOOT') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001886 executable('systemd-firstboot',
1887 'src/firstboot/firstboot.c',
1888 include_directories : includes,
1889 link_with : [libshared],
1890 dependencies : [libcrypt],
1891 install_rpath : rootlibexecdir,
1892 install : true,
1893 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001894endif
1895
1896executable('systemd-remount-fs',
1897 'src/remount-fs/remount-fs.c',
1898 'src/core/mount-setup.c',
1899 'src/core/mount-setup.h',
1900 include_directories : includes,
1901 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001902 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001903 install : true,
1904 install_dir : rootlibexecdir)
1905
1906executable('systemd-machine-id-setup',
1907 'src/machine-id-setup/machine-id-setup-main.c',
1908 'src/core/machine-id-setup.c',
1909 'src/core/machine-id-setup.h',
1910 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001911 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001912 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001913 install : true,
1914 install_dir : rootbindir)
1915
1916executable('systemd-fsck',
1917 'src/fsck/fsck.c',
1918 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001919 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001920 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001921 install : true,
1922 install_dir : rootlibexecdir)
1923
1924executable('systemd-sleep',
1925 'src/sleep/sleep.c',
1926 include_directories : includes,
1927 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001928 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001929 install : true,
1930 install_dir : rootlibexecdir)
1931
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001932exe = executable('systemd-sysctl',
1933 'src/sysctl/sysctl.c',
1934 include_directories : includes,
1935 link_with : [libshared],
1936 install_rpath : rootlibexecdir,
1937 install : true,
1938 install_dir : rootlibexecdir)
1939public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001940
1941executable('systemd-ac-power',
1942 'src/ac-power/ac-power.c',
1943 include_directories : includes,
1944 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001945 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001946 install : true,
1947 install_dir : rootlibexecdir)
1948
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001949exe = executable('systemd-detect-virt',
1950 'src/detect-virt/detect-virt.c',
1951 include_directories : includes,
1952 link_with : [libshared],
1953 install_rpath : rootlibexecdir,
1954 install : true)
1955public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001956
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001957exe = executable('systemd-delta',
1958 'src/delta/delta.c',
1959 include_directories : includes,
1960 link_with : [libshared],
1961 install_rpath : rootlibexecdir,
1962 install : true)
1963public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001964
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001965exe = executable('systemd-escape',
1966 'src/escape/escape.c',
1967 include_directories : includes,
1968 link_with : [libshared],
1969 install_rpath : rootlibexecdir,
1970 install : true,
1971 install_dir : rootbindir)
1972public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001973
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001974exe = executable('systemd-notify',
1975 'src/notify/notify.c',
1976 include_directories : includes,
1977 link_with : [libshared],
1978 install_rpath : rootlibexecdir,
1979 install : true,
1980 install_dir : rootbindir)
1981public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001982
1983executable('systemd-volatile-root',
1984 'src/volatile-root/volatile-root.c',
1985 include_directories : includes,
1986 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001987 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001988 install : true,
1989 install_dir : rootlibexecdir)
1990
1991executable('systemd-cgroups-agent',
1992 'src/cgroups-agent/cgroups-agent.c',
1993 include_directories : includes,
1994 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001995 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001996 install : true,
1997 install_dir : rootlibexecdir)
1998
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001999exe = executable('systemd-path',
2000 'src/path/path.c',
2001 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002002 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002003 install_rpath : rootlibexecdir,
2004 install : true)
2005public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002006
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002007exe = executable('systemd-ask-password',
2008 'src/ask-password/ask-password.c',
2009 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002010 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002011 install_rpath : rootlibexecdir,
2012 install : true,
2013 install_dir : rootbindir)
2014public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002015
2016executable('systemd-reply-password',
2017 'src/reply-password/reply-password.c',
2018 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002019 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002020 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002021 install : true,
2022 install_dir : rootlibexecdir)
2023
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002024exe = executable('systemd-tty-ask-password-agent',
2025 'src/tty-ask-password-agent/tty-ask-password-agent.c',
2026 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002027 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002028 install_rpath : rootlibexecdir,
2029 install : true,
2030 install_dir : rootbindir)
2031public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002032
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002033exe = executable('systemd-cgls',
2034 'src/cgls/cgls.c',
2035 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002036 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002037 install_rpath : rootlibexecdir,
2038 install : true)
2039public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002040
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002041exe = executable('systemd-cgtop',
2042 'src/cgtop/cgtop.c',
2043 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002044 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002045 install_rpath : rootlibexecdir,
2046 install : true)
2047public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002048
2049executable('systemd-initctl',
2050 'src/initctl/initctl.c',
2051 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002052 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002053 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002054 install : true,
2055 install_dir : rootlibexecdir)
2056
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002057exe = executable('systemd-mount',
2058 'src/mount/mount-tool.c',
2059 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002060 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002061 install_rpath : rootlibexecdir,
2062 install : true)
2063public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002064
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002065meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002066 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002067
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002068exe = executable('systemd-run',
2069 'src/run/run.c',
2070 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002071 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002072 install_rpath : rootlibexecdir,
2073 install : true)
2074public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002075
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002076exe = executable('systemd-stdio-bridge',
2077 'src/stdio-bridge/stdio-bridge.c',
2078 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002079 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002080 install_rpath : rootlibexecdir,
2081 install : true)
2082public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002083
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084exe = executable('busctl',
2085 'src/busctl/busctl.c',
2086 'src/busctl/busctl-introspect.c',
2087 'src/busctl/busctl-introspect.h',
2088 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002089 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002090 install_rpath : rootlibexecdir,
2091 install : true)
2092public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002093
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002094if conf.get('ENABLE_SYSUSERS') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002095 exe = executable('systemd-sysusers',
2096 'src/sysusers/sysusers.c',
2097 include_directories : includes,
2098 link_with : [libshared],
2099 install_rpath : rootlibexecdir,
2100 install : true,
2101 install_dir : rootbindir)
2102 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002103endif
2104
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002105if conf.get('ENABLE_TMPFILES') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002106 exe = executable('systemd-tmpfiles',
2107 'src/tmpfiles/tmpfiles.c',
2108 include_directories : includes,
2109 link_with : [libshared],
2110 dependencies : [libacl],
2111 install_rpath : rootlibexecdir,
2112 install : true,
2113 install_dir : rootbindir)
2114 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002115endif
2116
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002117if conf.get('ENABLE_HWDB') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002118 exe = executable('systemd-hwdb',
2119 'src/hwdb/hwdb.c',
2120 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2121 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002122 link_with : [libudev_internal],
2123 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002124 install : true,
2125 install_dir : rootbindir)
2126 public_programs += [exe]
2127endif
2128
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002129if conf.get('ENABLE_QUOTACHECK') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002130 executable('systemd-quotacheck',
2131 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002132 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002133 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002134 install_rpath : rootlibexecdir,
2135 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002136 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002137endif
2138
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002139exe = executable('systemd-socket-proxyd',
2140 'src/socket-proxy/socket-proxyd.c',
2141 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002142 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002143 dependencies : [threads],
2144 install_rpath : rootlibexecdir,
2145 install : true,
2146 install_dir : rootlibexecdir)
2147public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002148
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002149exe = executable('systemd-udevd',
2150 systemd_udevd_sources,
2151 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002152 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002153 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002154 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002155 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002156 dependencies : [threads,
2157 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002158 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002159 libacl,
2160 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002161 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002162 install : true,
2163 install_dir : rootlibexecdir)
2164public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002165
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002166exe = executable('udevadm',
2167 udevadm_sources,
2168 include_directories : includes,
2169 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002170 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002171 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002172 dependencies : [threads,
2173 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002174 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002175 libacl,
2176 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002177 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002178 install : true,
2179 install_dir : rootbindir)
2180public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002181
2182executable('systemd-shutdown',
2183 systemd_shutdown_sources,
2184 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002185 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002186 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002187 install : true,
2188 install_dir : rootlibexecdir)
2189
2190executable('systemd-update-done',
2191 'src/update-done/update-done.c',
2192 include_directories : includes,
2193 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002194 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002195 install : true,
2196 install_dir : rootlibexecdir)
2197
2198executable('systemd-update-utmp',
2199 'src/update-utmp/update-utmp.c',
2200 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002201 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002202 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002203 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002204 install : true,
2205 install_dir : rootlibexecdir)
2206
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002207if conf.get('HAVE_KMOD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002208 executable('systemd-modules-load',
2209 'src/modules-load/modules-load.c',
2210 include_directories : includes,
2211 link_with : [libshared],
2212 dependencies : [libkmod],
2213 install_rpath : rootlibexecdir,
2214 install : true,
2215 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002216
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002217 meson.add_install_script('sh', '-c',
2218 mkdir_p.format(modulesloaddir))
2219 meson.add_install_script('sh', '-c',
2220 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002221endif
2222
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002223exe = executable('systemd-nspawn',
2224 systemd_nspawn_sources,
2225 'src/core/mount-setup.c', # FIXME: use a variable?
2226 'src/core/mount-setup.h',
2227 'src/core/loopback-setup.c',
2228 'src/core/loopback-setup.h',
2229 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002230 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002231 dependencies : [libacl,
2232 libblkid,
2233 libseccomp,
2234 libselinux],
2235 install_rpath : rootlibexecdir,
2236 install : true)
2237public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002238
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002239if conf.get('ENABLE_NETWORKD') == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002240 executable('systemd-networkd',
2241 systemd_networkd_sources,
2242 include_directories : includes,
2243 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002244 libsystemd_network,
2245 libudev_internal,
2246 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002247 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002248 install_rpath : rootlibexecdir,
2249 install : true,
2250 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002251
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002252 executable('systemd-networkd-wait-online',
2253 systemd_networkd_wait_online_sources,
2254 include_directories : includes,
2255 link_with : [libnetworkd_core,
2256 libshared],
2257 install_rpath : rootlibexecdir,
2258 install : true,
2259 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002260
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002261 exe = executable('networkctl',
2262 networkctl_sources,
2263 include_directories : includes,
2264 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002265 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002266 install_rpath : rootlibexecdir,
2267 install : true,
2268 install_dir : rootbindir)
2269 public_programs += [exe]
2270endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002271############################################################
2272
2273foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002274 sources = tuple[0]
2275 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2276 dependencies = tuple[2]
2277 condition = tuple.length() >= 4 ? tuple[3] : ''
2278 type = tuple.length() >= 5 ? tuple[4] : ''
2279 defs = tuple.length() >= 6 ? tuple[5] : []
2280 incs = tuple.length() >= 7 ? tuple[6] : includes
2281 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002282
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002283 name = sources[0].split('/')[-1].split('.')[0]
2284 if type.startswith('timeout=')
2285 timeout = type.split('=')[1].to_int()
2286 type = ''
2287 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002288
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002289 if condition == '' or conf.get(condition) == 1
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002290 exe = executable(
2291 name,
2292 sources,
2293 include_directories : incs,
2294 link_with : link_with,
2295 dependencies : dependencies,
2296 c_args : defs,
2297 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002298 install : install_tests,
2299 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002300
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002301 if type == 'manual'
2302 message('@0@ is a manual test'.format(name))
2303 elif type == 'unsafe' and want_tests != 'unsafe'
2304 message('@0@ is an unsafe test'.format(name))
2305 else
2306 test(name, exe,
2307 env : test_env,
2308 timeout : timeout)
2309 endif
2310 else
2311 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2312 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002313endforeach
2314
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002315test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002316 'test-libsystemd-sym',
2317 test_libsystemd_sym_c,
2318 include_directories : includes,
2319 link_with : [libsystemd],
2320 install : install_tests,
2321 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002322test('test-libsystemd-sym',
2323 test_libsystemd_sym)
2324
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002325test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002326 'test-libudev-sym',
2327 test_libudev_sym_c,
2328 include_directories : includes,
2329 c_args : ['-Wno-deprecated-declarations'],
2330 link_with : [libudev],
2331 install : install_tests,
2332 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002333test('test-libudev-sym',
2334 test_libudev_sym)
2335
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002336############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002337
2338make_directive_index_py = find_program('tools/make-directive-index.py')
2339make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002340xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002341hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002342
2343subdir('units')
2344subdir('sysctl.d')
2345subdir('sysusers.d')
2346subdir('tmpfiles.d')
2347subdir('rules')
2348subdir('hwdb')
2349subdir('network')
2350subdir('man')
2351subdir('shell-completion/bash')
2352subdir('shell-completion/zsh')
2353subdir('docs/sysvinit')
2354subdir('docs/var-log')
2355
2356# FIXME: figure out if the warning is true:
2357# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2358install_subdir('factory/etc',
2359 install_dir : factorydir)
2360
2361
2362install_data('xorg/50-systemd-user.sh',
2363 install_dir : xinitrcdir)
2364install_data('system-preset/90-systemd.preset',
2365 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002366install_data('modprobe.d/systemd.conf',
2367 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002368install_data('README',
2369 'NEWS',
2370 'CODING_STYLE',
2371 'DISTRO_PORTING',
2372 'ENVIRONMENT.md',
2373 'LICENSE.GPL2',
2374 'LICENSE.LGPL2.1',
2375 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2376 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002377
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002378meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2379meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2380
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002381############################################################
2382
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002383meson_check_help = find_program('tools/meson-check-help.sh')
2384
2385foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002386 name = exec.full_path().split('/')[-1]
2387 test('check-help-' + name,
2388 meson_check_help,
2389 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002390endforeach
2391
2392############################################################
2393
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002394if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002395 all_files = run_command(
2396 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002397 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002398 'ls-files',
2399 ':/*.[ch]'])
2400 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002401
userwithuide85a6902017-08-09 13:41:44 +00002402 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002403 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002404 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002405 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002406 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002407 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002408 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002409 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002410endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002411
2412if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002413 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002414 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002415 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002416 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002417endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002418
2419if git.found()
2420 git_head = run_command(
2421 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002422 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002423 'rev-parse', 'HEAD']).stdout().strip()
2424 git_head_short = run_command(
2425 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002426 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002427 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2428
2429 run_target(
2430 'git-snapshot',
2431 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002432 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002433 git_head_short),
2434 '--prefix', 'systemd-@0@/'.format(git_head),
2435 'HEAD'])
2436endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002437
2438############################################################
2439
2440status = [
2441 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2442
2443 'prefix: @0@'.format(prefixdir),
2444 'rootprefix: @0@'.format(rootprefixdir),
2445 'sysconf dir: @0@'.format(sysconfdir),
2446 'includedir: @0@'.format(includedir),
2447 'lib dir: @0@'.format(libdir),
2448 'rootlib dir: @0@'.format(rootlibdir),
2449 'SysV init scripts: @0@'.format(sysvinit_path),
2450 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2451 'PAM modules dir: @0@'.format(pamlibdir),
2452 'PAM configuration dir: @0@'.format(pamconfdir),
2453 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002454 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002455 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2456 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2457 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2458 'bash completions dir: @0@'.format(bashcompletiondir),
2459 'zsh completions dir: @0@'.format(zshcompletiondir),
2460 'extra start script: @0@'.format(get_option('rc-local')),
2461 'extra stop script: @0@'.format(get_option('halt-local')),
2462 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2463 get_option('debug-tty')),
2464 'TTY GID: @0@'.format(tty_gid),
2465 'maximum system UID: @0@'.format(system_uid_max),
2466 'maximum system GID: @0@'.format(system_gid_max),
2467 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
Tom Stellard4e15a732017-10-31 08:46:24 -07002468 'render group access mode: @0@'.format(get_option('group-render-mode')),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002469 'certificate root: @0@'.format(get_option('certificate-root')),
2470 'support URL: @0@'.format(support_url),
2471 'nobody user name: @0@'.format(get_option('nobody-user')),
2472 'nobody group name: @0@'.format(get_option('nobody-group')),
2473 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002474 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002475
2476 'default DNSSEC mode: @0@'.format(default_dnssec),
2477 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2478 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2479
2480alt_dns_servers = '\n '.join(dns_servers.split(' '))
2481alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2482status += [
2483 'default DNS servers: @0@'.format(alt_dns_servers),
2484 'default NTP servers: @0@'.format(alt_ntp_servers)]
2485
2486alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2487 '@@0@'.format(time_epoch)).stdout().strip()
2488status += [
2489 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2490
2491# TODO:
2492# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2493# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2494# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2495
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002496if conf.get('ENABLE_EFI') == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002497 status += [
2498 'efi arch: @0@'.format(efi_arch)]
2499
2500 if have_gnu_efi
2501 status += [
2502 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2503 'EFI CC @0@'.format(efi_cc),
2504 'EFI libdir: @0@'.format(efi_libdir),
2505 'EFI ldsdir: @0@'.format(efi_ldsdir),
2506 'EFI includedir: @0@'.format(efi_incdir)]
2507 endif
2508endif
2509
2510found = []
2511missing = []
2512
2513foreach tuple : [
2514 ['libcryptsetup'],
2515 ['PAM'],
2516 ['AUDIT'],
2517 ['IMA'],
2518 ['AppArmor'],
2519 ['SELinux'],
2520 ['SECCOMP'],
2521 ['SMACK'],
2522 ['zlib'],
2523 ['xz'],
2524 ['lz4'],
2525 ['bzip2'],
2526 ['ACL'],
2527 ['gcrypt'],
2528 ['qrencode'],
2529 ['microhttpd'],
2530 ['gnutls'],
2531 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002532 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002533 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002534 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002535 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002536 ['libiptc'],
2537 ['elfutils'],
2538 ['binfmt'],
2539 ['vconsole'],
2540 ['quotacheck'],
2541 ['tmpfiles'],
2542 ['environment.d'],
2543 ['sysusers'],
2544 ['firstboot'],
2545 ['randomseed'],
2546 ['backlight'],
2547 ['rfkill'],
2548 ['logind'],
2549 ['machined'],
2550 ['importd'],
2551 ['hostnamed'],
2552 ['timedated'],
2553 ['timesyncd'],
2554 ['localed'],
2555 ['networkd'],
Yu Watanabea7456af2017-10-06 16:33:21 +09002556 ['resolve'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002557 ['coredump'],
2558 ['polkit'],
2559 ['legacy pkla', install_polkit_pkla],
2560 ['efi'],
2561 ['gnu-efi', have_gnu_efi],
2562 ['kmod'],
2563 ['xkbcommon'],
2564 ['blkid'],
2565 ['dbus'],
2566 ['glib'],
Zbigniew Jędrzejewski-Szmek08cf5b82017-10-03 12:23:55 +02002567 ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002568 ['hwdb'],
2569 ['tpm'],
2570 ['man pages', want_man],
2571 ['html pages', want_html],
2572 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002573 ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002574 ['SysV compat'],
2575 ['utmp'],
2576 ['ldconfig'],
2577 ['hibernate'],
2578 ['adm group', get_option('adm-group')],
2579 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002580 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002581 ['debug hashmap'],
2582 ['debug mmap cache'],
2583]
2584
2585 cond = tuple.get(1, '')
2586 if cond == ''
2587 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2588 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek349cc4a2017-10-03 10:41:51 +02002589 cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002590 endif
2591 if cond
2592 found += [tuple[0]]
2593 else
2594 missing += [tuple[0]]
2595 endif
2596endforeach
2597
2598status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002599 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002600 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002601 '',
2602 'disabled features: @0@'.format(', '.join(missing)),
2603 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002604message('\n '.join(status))