]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
4 | # | |
5 | # systemd is free software; you can redistribute it and/or modify it | |
6 | # under the terms of the GNU Lesser General Public License as published by | |
7 | # the Free Software Foundation; either version 2.1 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # systemd is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public License | |
16 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
5c23128d | 18 | project('systemd', 'c', |
63950427 | 19 | version : '235', |
5c23128d ZJS |
20 | license : 'LGPLv2+', |
21 | default_options: [ | |
37efbbd8 ZJS |
22 | 'c_std=gnu99', |
23 | 'prefix=/usr', | |
24 | 'sysconfdir=/etc', | |
25 | 'localstatedir=/var', | |
5c23128d | 26 | ], |
86ea8d70 | 27 | meson_version : '>= 0.41', |
5c23128d ZJS |
28 | ) |
29 | ||
d128f369 LP |
30 | libsystemd_version = '0.19.1' |
31 | libudev_version = '1.6.7' | |
56d50ab1 | 32 | |
5c23128d ZJS |
33 | # We need the same data in three different formats, ugh! |
34 | # Also, for hysterical reasons, we use different variable | |
35 | # names, sometimes. Not all variables are included in every | |
36 | # set. Ugh, ugh, ugh! | |
37 | conf = configuration_data() | |
38 | conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version()) | |
39 | conf.set_quoted('PACKAGE_VERSION', meson.project_version()) | |
40 | ||
41 | substs = configuration_data() | |
42 | substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd') | |
43 | substs.set('PACKAGE_VERSION', meson.project_version()) | |
44 | ||
45 | m4_defines = [] | |
46 | ||
47 | ##################################################################### | |
48 | ||
003c8879 ZJS |
49 | # Try to install the git pre-commit hook |
50 | git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh')) | |
51 | if git_hook.returncode() == 0 | |
52 | message(git_hook.stdout().strip()) | |
53 | endif | |
54 | ||
55 | ##################################################################### | |
56 | ||
349cc4a5 | 57 | conf.set10('HAVE_SPLIT_USR', get_option('split-usr')) |
ee4bfa21 | 58 | rootprefixdir = get_option('split-usr') ? '/' : '/usr' |
5c23128d ZJS |
59 | |
60 | sysvinit_path = get_option('sysvinit-path') | |
61 | sysvrcnd_path = get_option('sysvrcnd-path') | |
349cc4a5 ZJS |
62 | have = sysvinit_path != '' or sysvrcnd_path != '' |
63 | conf.set10('HAVE_SYSV_COMPAT', have, | |
64 | description : 'SysV init scripts and rcN.d links are supported') | |
65 | m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : [] | |
5c23128d ZJS |
66 | |
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. | |
70 | prefixdir = get_option('prefix') | |
71 | if not prefixdir.startswith('/') | |
37efbbd8 | 72 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) |
5c23128d ZJS |
73 | endif |
74 | bindir = join_paths(prefixdir, get_option('bindir')) | |
75 | libdir = join_paths(prefixdir, get_option('libdir')) | |
76 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) | |
77 | includedir = join_paths(prefixdir, get_option('includedir')) | |
78 | datadir = join_paths(prefixdir, get_option('datadir')) | |
79 | localstatedir = join_paths('/', get_option('localstatedir')) | |
80 | ||
81 | rootbindir = join_paths(rootprefixdir, 'bin') | |
82 | rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd') | |
83 | ||
84 | rootlibdir = get_option('rootlibdir') | |
85 | if rootlibdir == '' | |
37efbbd8 | 86 | rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) |
5c23128d ZJS |
87 | endif |
88 | ||
89 | # Dirs of external packages | |
e17e5ba9 MB |
90 | pkgconfigdatadir = join_paths(datadir, 'pkgconfig') |
91 | pkgconfiglibdir = join_paths(libdir, 'pkgconfig') | |
92 | polkitpolicydir = join_paths(datadir, 'polkit-1/actions') | |
93 | polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d') | |
94 | polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d') | |
95 | varlogdir = join_paths(localstatedir, 'log') | |
96 | xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d') | |
0c6e2702 | 97 | rpmmacrosdir = join_paths(prefixdir, get_option('rpmmacrosdir')) |
02fa054d | 98 | modprobedir = join_paths(rootprefixdir, 'lib/modprobe.d') |
5c23128d ZJS |
99 | |
100 | # Our own paths | |
e17e5ba9 MB |
101 | pkgdatadir = join_paths(datadir, 'systemd') |
102 | environmentdir = join_paths(prefixdir, 'lib/environment.d') | |
103 | pkgsysconfdir = join_paths(sysconfdir, 'systemd') | |
104 | userunitdir = join_paths(prefixdir, 'lib/systemd/user') | |
105 | userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset') | |
106 | tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d') | |
107 | sysusersdir = join_paths(prefixdir, 'lib/sysusers.d') | |
108 | sysctldir = join_paths(prefixdir, 'lib/sysctl.d') | |
109 | binfmtdir = join_paths(prefixdir, 'lib/binfmt.d') | |
110 | modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d') | |
111 | networkdir = join_paths(rootprefixdir, 'lib/systemd/network') | |
112 | pkgincludedir = join_paths(includedir, 'systemd') | |
113 | systemgeneratordir = join_paths(rootlibexecdir, 'system-generators') | |
114 | usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators') | |
115 | systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators') | |
116 | userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators') | |
117 | systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown') | |
118 | systemsleepdir = join_paths(rootlibexecdir, 'system-sleep') | |
119 | systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system') | |
120 | systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset') | |
121 | udevlibexecdir = join_paths(rootprefixdir, 'lib/udev') | |
122 | udevhomedir = udevlibexecdir | |
123 | udevrulesdir = join_paths(udevlibexecdir, 'rules.d') | |
124 | udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d') | |
125 | catalogdir = join_paths(prefixdir, 'lib/systemd/catalog') | |
126 | kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d') | |
127 | factorydir = join_paths(datadir, 'factory') | |
128 | docdir = join_paths(datadir, 'doc/systemd') | |
129 | bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi') | |
130 | testsdir = join_paths(prefixdir, 'lib/systemd/tests') | |
131 | systemdstatedir = join_paths(localstatedir, 'lib/systemd') | |
132 | catalogstatedir = join_paths(systemdstatedir, 'catalog') | |
133 | randomseeddir = join_paths(localstatedir, 'lib/systemd') | |
5c23128d ZJS |
134 | |
135 | dbuspolicydir = get_option('dbuspolicydir') | |
136 | if dbuspolicydir == '' | |
37efbbd8 | 137 | dbuspolicydir = join_paths(datadir, 'dbus-1/system.d') |
5c23128d ZJS |
138 | endif |
139 | ||
140 | dbussessionservicedir = get_option('dbussessionservicedir') | |
141 | if dbussessionservicedir == '' | |
37efbbd8 | 142 | dbussessionservicedir = join_paths(datadir, 'dbus-1/services') |
5c23128d ZJS |
143 | endif |
144 | ||
145 | dbussystemservicedir = get_option('dbussystemservicedir') | |
146 | if dbussystemservicedir == '' | |
37efbbd8 | 147 | dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services') |
5c23128d ZJS |
148 | endif |
149 | ||
150 | pamlibdir = get_option('pamlibdir') | |
151 | if pamlibdir == '' | |
37efbbd8 | 152 | pamlibdir = join_paths(rootlibdir, 'security') |
5c23128d ZJS |
153 | endif |
154 | ||
155 | pamconfdir = get_option('pamconfdir') | |
156 | if pamconfdir == '' | |
37efbbd8 | 157 | pamconfdir = join_paths(sysconfdir, 'pam.d') |
5c23128d ZJS |
158 | endif |
159 | ||
160 | conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir) | |
e17e5ba9 | 161 | conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system')) |
5c23128d ZJS |
162 | conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) |
163 | conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) | |
164 | conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) | |
2a4c156d ZJS |
165 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) |
166 | conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) | |
e17e5ba9 | 167 | conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user')) |
5c23128d ZJS |
168 | conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir) |
169 | conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) | |
e17e5ba9 MB |
170 | conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) |
171 | conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) | |
172 | conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd')) | |
173 | conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck')) | |
174 | conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) | |
175 | conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep')) | |
176 | conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) | |
177 | conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) | |
178 | conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge')) | |
3131bfe3 | 179 | conf.set_quoted('RANDOM_SEED_DIR', randomseeddir) |
e17e5ba9 MB |
180 | conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) |
181 | conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup')) | |
5c23128d ZJS |
182 | conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir) |
183 | conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir) | |
184 | conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir) | |
185 | conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir) | |
186 | conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir) | |
187 | conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir) | |
e17e5ba9 MB |
188 | conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map')) |
189 | conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map')) | |
5c23128d | 190 | conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) |
e17e5ba9 | 191 | conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent')) |
5c23128d ZJS |
192 | conf.set_quoted('LIBDIR', libdir) |
193 | conf.set_quoted('ROOTLIBDIR', rootlibdir) | |
194 | conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) | |
195 | conf.set_quoted('BOOTLIBDIR', bootlibdir) | |
e17e5ba9 MB |
196 | conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull')) |
197 | conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import')) | |
198 | conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export')) | |
199 | conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg')) | |
200 | conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg')) | |
201 | conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd')) | |
5c23128d ZJS |
202 | |
203 | conf.set_quoted('ABS_BUILD_DIR', meson.build_root()) | |
204 | conf.set_quoted('ABS_SRC_DIR', meson.source_root()) | |
205 | ||
206 | substs.set('prefix', prefixdir) | |
3131bfe3 ZJS |
207 | substs.set('exec_prefix', prefixdir) |
208 | substs.set('libdir', libdir) | |
209 | substs.set('rootlibdir', rootlibdir) | |
210 | substs.set('includedir', includedir) | |
5c23128d | 211 | substs.set('pkgsysconfdir', pkgsysconfdir) |
3131bfe3 ZJS |
212 | substs.set('bindir', bindir) |
213 | substs.set('rootbindir', rootbindir) | |
5c23128d ZJS |
214 | substs.set('rootlibexecdir', rootlibexecdir) |
215 | substs.set('systemunitdir', systemunitdir) | |
216 | substs.set('userunitdir', userunitdir) | |
217 | substs.set('systempresetdir', systempresetdir) | |
218 | substs.set('userpresetdir', userpresetdir) | |
219 | substs.set('udevhwdbdir', udevhwdbdir) | |
220 | substs.set('udevrulesdir', udevrulesdir) | |
3131bfe3 | 221 | substs.set('udevlibexecdir', udevlibexecdir) |
5c23128d ZJS |
222 | substs.set('catalogdir', catalogdir) |
223 | substs.set('tmpfilesdir', tmpfilesdir) | |
224 | substs.set('sysusersdir', sysusersdir) | |
225 | substs.set('sysctldir', sysctldir) | |
226 | substs.set('binfmtdir', binfmtdir) | |
227 | substs.set('modulesloaddir', modulesloaddir) | |
228 | substs.set('systemgeneratordir', systemgeneratordir) | |
229 | substs.set('usergeneratordir', usergeneratordir) | |
230 | substs.set('systemenvgeneratordir', systemenvgeneratordir) | |
231 | substs.set('userenvgeneratordir', userenvgeneratordir) | |
232 | substs.set('systemshutdowndir', systemshutdowndir) | |
233 | substs.set('systemsleepdir', systemsleepdir) | |
2a4c156d ZJS |
234 | substs.set('VARLOGDIR', varlogdir) |
235 | substs.set('CERTIFICATEROOT', get_option('certificate-root')) | |
e17e5ba9 MB |
236 | substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl')) |
237 | substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) | |
2a4c156d ZJS |
238 | substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) |
239 | substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) | |
240 | substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) | |
241 | substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local')) | |
5c23128d ZJS |
242 | |
243 | ##################################################################### | |
244 | ||
245 | cc = meson.get_compiler('c') | |
246 | pkgconfig = import('pkgconfig') | |
6e2afb1c | 247 | check_compilation_sh = find_program('tools/meson-check-compilation.sh') |
5c23128d | 248 | |
94e2523b ZJS |
249 | cxx = find_program('c++', required : false) |
250 | if cxx.found() | |
251 | # Used only for tests | |
252 | add_languages('cpp') | |
253 | endif | |
254 | ||
75cf1d66 | 255 | foreach arg : ['-Wextra', |
70160ce8 | 256 | '-Werror=undef', |
5c23128d ZJS |
257 | '-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', | |
18c8db14 | 274 | '-Wimplicit-fallthrough=3', |
5c23128d ZJS |
275 | '-Wshadow', |
276 | '-Wendif-labels', | |
277 | '-Wstrict-aliasing=2', | |
278 | '-Wwrite-strings', | |
5c23128d ZJS |
279 | '-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 | ] | |
37efbbd8 ZJS |
292 | if cc.has_argument(arg) |
293 | add_project_arguments(arg, language : 'c') | |
294 | endif | |
5c23128d ZJS |
295 | endforeach |
296 | ||
2c5434ad ZJS |
297 | # "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. | |
299 | foreach arg : ['unused-parameter', | |
300 | 'missing-field-initializers', | |
301 | 'unused-result', | |
fb1b5882 ZJS |
302 | 'format-signedness', |
303 | 'error=nonnull', # work-around for gcc 7.1 turning this on on its own | |
304 | ] | |
2c5434ad ZJS |
305 | if cc.has_argument('-W' + arg) |
306 | add_project_arguments('-Wno-' + arg, language : 'c') | |
307 | endif | |
308 | endforeach | |
309 | ||
5c23128d ZJS |
310 | if 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 | } | |
7572aa80 | 319 | ', name : '-Werror=shadow with local shadowing') |
37efbbd8 | 320 | add_project_arguments('-Werror=shadow', language : 'c') |
5c23128d ZJS |
321 | endif |
322 | ||
323 | if cc.get_id() == 'clang' | |
37efbbd8 ZJS |
324 | foreach arg : ['-Wno-typedef-redefinition', |
325 | '-Wno-gnu-variable-sized-type-not-at-end', | |
326 | ] | |
7572aa80 ZJS |
327 | if cc.has_argument(arg, |
328 | name : '@0@ is supported'.format(arg)) | |
37efbbd8 ZJS |
329 | add_project_arguments(arg, language : 'c') |
330 | endif | |
331 | endforeach | |
5c23128d ZJS |
332 | endif |
333 | ||
6e2afb1c ZJS |
334 | link_test_c = files('tools/meson-link-test.c') |
335 | ||
5c23128d ZJS |
336 | # --as-needed and --no-undefined are provided by meson by default, |
337 | # run mesonconf to see what is enabled | |
338 | foreach arg : ['-Wl,-z,relro', | |
339 | '-Wl,-z,now', | |
340 | '-pie', | |
5c23128d | 341 | ] |
6e2afb1c ZJS |
342 | |
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 | |
37efbbd8 ZJS |
348 | add_project_link_arguments(arg, language : 'c') |
349 | endif | |
5c23128d ZJS |
350 | endforeach |
351 | ||
41afb5eb ZJS |
352 | if get_option('buildtype') != 'debug' |
353 | foreach arg : ['-ffunction-sections', | |
354 | '-fdata-sections'] | |
7572aa80 ZJS |
355 | if cc.has_argument(arg, |
356 | name : '@0@ is supported'.format(arg)) | |
41afb5eb ZJS |
357 | add_project_arguments(arg, language : 'c') |
358 | endif | |
359 | endforeach | |
360 | ||
361 | foreach arg : ['-Wl,--gc-sections'] | |
6e2afb1c ZJS |
362 | 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 | |
41afb5eb ZJS |
367 | add_project_link_arguments(arg, language : 'c') |
368 | endif | |
369 | endforeach | |
370 | endif | |
371 | ||
9cc0e6e9 ZJS |
372 | cpp = ' '.join(cc.cmd_array()) + ' -E' |
373 | ||
5c23128d ZJS |
374 | ##################################################################### |
375 | # compilation result tests | |
376 | ||
2c201c21 ZJS |
377 | conf.set('_GNU_SOURCE', true) |
378 | conf.set('__SANE_USERSPACE_TYPES__', true) | |
5c23128d ZJS |
379 | |
380 | conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>')) | |
381 | conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>')) | |
382 | conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>')) | |
383 | conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>')) | |
384 | conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>')) | |
385 | conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>')) | |
386 | conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>')) | |
387 | ||
388 | decl_headers = ''' | |
389 | #include <uchar.h> | |
390 | #include <linux/ethtool.h> | |
bce67bbe | 391 | #include <linux/fib_rules.h> |
5c23128d ZJS |
392 | ''' |
393 | # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail | |
394 | ||
395 | foreach decl : ['char16_t', | |
396 | 'char32_t', | |
397 | 'key_serial_t', | |
398 | 'struct ethtool_link_settings', | |
bce67bbe | 399 | 'struct fib_rule_uid_range', |
5c23128d | 400 | ] |
2c201c21 ZJS |
401 | |
402 | # We get -1 if the size cannot be determined | |
403 | have = cc.sizeof(decl, prefix : decl_headers) > 0 | |
349cc4a5 | 404 | conf.set10('HAVE_' + decl.underscorify().to_upper(), have) |
5c23128d ZJS |
405 | endforeach |
406 | ||
407 | foreach 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'], | |
9dfed8dd | 417 | ['IFLA_GENEVE_LABEL', 'linux/if_link.h'], |
5c23128d ZJS |
418 | # 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'], | |
bce67bbe | 428 | ['FRA_UID_RANGE', 'linux/fib_rules.h'], |
5c23128d ZJS |
429 | ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], |
430 | ] | |
37efbbd8 ZJS |
431 | prefix = decl.length() > 2 ? decl[2] : '' |
432 | have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) | |
4b9545f1 | 433 | conf.set10('HAVE_' + decl[0], have) |
5c23128d ZJS |
434 | endforeach |
435 | ||
5c23128d | 436 | foreach ident : ['secure_getenv', '__secure_getenv'] |
349cc4a5 | 437 | conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) |
5c23128d ZJS |
438 | endforeach |
439 | ||
440 | foreach ident : [ | |
37efbbd8 ZJS |
441 | ['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>'''], | |
37efbbd8 ZJS |
450 | ['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>'''], | |
71e5200f DM |
456 | ['bpf', '''#include <sys/syscall.h> |
457 | #include <unistd.h>'''], | |
38f1ae0f | 458 | ['explicit_bzero' , '''#include <string.h>'''], |
37efbbd8 ZJS |
459 | ] |
460 | ||
461 | have = cc.has_function(ident[0], prefix : ident[1]) | |
4b9545f1 | 462 | conf.set10('HAVE_' + ident[0].to_upper(), have) |
5c23128d ZJS |
463 | endforeach |
464 | ||
4984c8be | 465 | if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''') |
349cc4a5 | 466 | conf.set10('USE_SYS_RANDOM_H', true) |
4b9545f1 | 467 | conf.set10('HAVE_GETRANDOM', true) |
4984c8be ZJS |
468 | else |
469 | have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''') | |
349cc4a5 | 470 | conf.set10('USE_SYS_RANDOM_H', false) |
4b9545f1 | 471 | conf.set10('HAVE_GETRANDOM', have) |
4984c8be ZJS |
472 | endif |
473 | ||
5c23128d ZJS |
474 | ##################################################################### |
475 | ||
476 | sed = find_program('sed') | |
5c23128d | 477 | awk = find_program('awk') |
d730e2d1 | 478 | m4 = find_program('m4') |
5c23128d | 479 | stat = find_program('stat') |
d68b342b | 480 | git = find_program('git', required : false) |
5c23128d | 481 | |
7b76fce1 | 482 | meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh' |
94e75a54 | 483 | mkdir_p = 'mkdir -p $DESTDIR/@0@' |
d83f4f50 ZJS |
484 | test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh') |
485 | splash_bmp = files('test/splash.bmp') | |
94e75a54 | 486 | |
5c23128d ZJS |
487 | # 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. | |
489 | progs = [['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 | ] | |
501 | foreach prog : progs | |
37efbbd8 ZJS |
502 | 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) | |
5c23128d ZJS |
515 | endforeach |
516 | ||
1276a9f6 ZJS |
517 | if run_command('ln', '--relative', '--help').returncode() != 0 |
518 | error('ln does not support --relative') | |
519 | endif | |
5c23128d ZJS |
520 | |
521 | ############################################################ | |
522 | ||
523 | gperf = find_program('gperf') | |
524 | ||
525 | gperf_test_format = ''' | |
526 | #include <string.h> | |
527 | const char * in_word_set(const char *, @0@); | |
528 | @1@ | |
529 | ''' | |
530 | gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C' | |
531 | gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path())) | |
532 | gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout()) | |
533 | if cc.compiles(gperf_test) | |
37efbbd8 | 534 | gperf_len_type = 'size_t' |
5c23128d | 535 | else |
37efbbd8 ZJS |
536 | 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 | |
5c23128d ZJS |
542 | endif |
543 | message('gperf len type is @0@'.format(gperf_len_type)) | |
37efbbd8 ZJS |
544 | conf.set('GPERF_LEN_TYPE', gperf_len_type, |
545 | description : 'The type of gperf "len" parameter') | |
5c23128d ZJS |
546 | |
547 | ############################################################ | |
548 | ||
549 | if not cc.has_header('sys/capability.h') | |
37efbbd8 | 550 | error('POSIX caps headers not found') |
5c23128d ZJS |
551 | endif |
552 | foreach header : ['linux/btrfs.h', | |
553 | 'linux/memfd.h', | |
554 | 'linux/vm_sockets.h', | |
af8786b1 | 555 | 'sys/auxv.h', |
5c23128d ZJS |
556 | 'valgrind/memcheck.h', |
557 | 'valgrind/valgrind.h', | |
558 | ] | |
2c201c21 | 559 | |
349cc4a5 ZJS |
560 | conf.set10('HAVE_' + header.underscorify().to_upper(), |
561 | cc.has_header(header)) | |
5c23128d ZJS |
562 | endforeach |
563 | ||
564 | ############################################################ | |
565 | ||
566 | conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname')) | |
5248e7e1 ZJS |
567 | conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname')) |
568 | gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : []) | |
5c23128d ZJS |
569 | |
570 | default_hierarchy = get_option('default-hierarchy') | |
571 | conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy, | |
572 | description : 'default cgroup hierarchy as string') | |
573 | if default_hierarchy == 'legacy' | |
37efbbd8 | 574 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE') |
5c23128d | 575 | elif default_hierarchy == 'hybrid' |
37efbbd8 | 576 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD') |
5c23128d | 577 | else |
37efbbd8 | 578 | conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL') |
5c23128d ZJS |
579 | endif |
580 | ||
581 | time_epoch = get_option('time-epoch') | |
582 | if time_epoch == '' | |
37efbbd8 ZJS |
583 | NEWS = files('NEWS') |
584 | time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout() | |
5c23128d ZJS |
585 | endif |
586 | time_epoch = time_epoch.to_int() | |
587 | conf.set('TIME_EPOCH', time_epoch) | |
588 | ||
589 | system_uid_max = get_option('system-uid-max') | |
590 | if system_uid_max == '' | |
37efbbd8 ZJS |
591 | 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() | |
5c23128d ZJS |
595 | endif |
596 | system_uid_max = system_uid_max.to_int() | |
597 | conf.set('SYSTEM_UID_MAX', system_uid_max) | |
598 | substs.set('systemuidmax', system_uid_max) | |
7572aa80 | 599 | message('maximum system UID is @0@'.format(system_uid_max)) |
5c23128d ZJS |
600 | |
601 | conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user')) | |
602 | conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group')) | |
603 | ||
604 | system_gid_max = get_option('system-gid-max') | |
605 | if system_gid_max == '' | |
37efbbd8 ZJS |
606 | 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() | |
5c23128d ZJS |
610 | endif |
611 | system_gid_max = system_gid_max.to_int() | |
612 | conf.set('SYSTEM_GID_MAX', system_gid_max) | |
613 | substs.set('systemgidmax', system_gid_max) | |
7572aa80 | 614 | message('maximum system GID is @0@'.format(system_gid_max)) |
5c23128d ZJS |
615 | |
616 | tty_gid = get_option('tty-gid') | |
617 | conf.set('TTY_GID', tty_gid) | |
2a4c156d | 618 | substs.set('TTY_GID', tty_gid) |
5c23128d ZJS |
619 | |
620 | if get_option('adm-group') | |
37efbbd8 | 621 | m4_defines += ['-DENABLE_ADM_GROUP'] |
5c23128d ZJS |
622 | endif |
623 | ||
624 | if get_option('wheel-group') | |
37efbbd8 | 625 | m4_defines += ['-DENABLE_WHEEL_GROUP'] |
5c23128d ZJS |
626 | endif |
627 | ||
628 | substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode')) | |
4e15a734 | 629 | substs.set('GROUP_RENDER_MODE', get_option('group-render-mode')) |
5c23128d | 630 | |
2a4c156d ZJS |
631 | kill_user_processes = get_option('default-kill-user-processes') |
632 | conf.set10('KILL_USER_PROCESSES', kill_user_processes) | |
633 | substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no') | |
5c23128d | 634 | |
829257d1 ZJS |
635 | dns_servers = get_option('dns-servers') |
636 | conf.set_quoted('DNS_SERVERS', dns_servers) | |
637 | substs.set('DNS_SERVERS', dns_servers) | |
5c23128d | 638 | |
829257d1 ZJS |
639 | ntp_servers = get_option('ntp-servers') |
640 | conf.set_quoted('NTP_SERVERS', ntp_servers) | |
641 | substs.set('NTP_SERVERS', ntp_servers) | |
5c23128d ZJS |
642 | |
643 | conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) | |
644 | ||
3131bfe3 ZJS |
645 | substs.set('SUSHELL', get_option('debug-shell')) |
646 | substs.set('DEBUGTTY', get_option('debug-tty')) | |
647 | ||
671677da | 648 | debug = get_option('debug') |
349cc4a5 ZJS |
649 | enable_debug_hashmap = false |
650 | enable_debug_mmap_cache = false | |
671677da ZJS |
651 | if debug != '' |
652 | foreach name : debug.split(',') | |
653 | if name == 'hashmap' | |
349cc4a5 | 654 | enable_debug_hashmap = true |
671677da | 655 | elif name == 'mmap-cache' |
349cc4a5 | 656 | enable_debug_mmap_cache = true |
671677da ZJS |
657 | else |
658 | message('unknown debug option "@0@", ignoring'.format(name)) | |
659 | endif | |
660 | endforeach | |
661 | endif | |
349cc4a5 ZJS |
662 | conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap) |
663 | conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache) | |
671677da | 664 | |
5c23128d ZJS |
665 | ##################################################################### |
666 | ||
667 | threads = dependency('threads') | |
668 | librt = cc.find_library('rt') | |
669 | libm = cc.find_library('m') | |
670 | libdl = cc.find_library('dl') | |
671 | libcrypt = cc.find_library('crypt') | |
672 | ||
1800cc85 ZJS |
673 | libcap = dependency('libcap', required : false) |
674 | if not libcap.found() | |
675 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file | |
676 | libcap = cc.find_library('cap') | |
677 | endif | |
678 | ||
5c23128d | 679 | libmount = dependency('mount', |
d6e80966 | 680 | version : '>= 2.30') |
5c23128d ZJS |
681 | |
682 | want_seccomp = get_option('seccomp') | |
4390be30 | 683 | if want_seccomp != 'false' |
37efbbd8 | 684 | libseccomp = dependency('libseccomp', |
9f0e9c01 | 685 | version : '>= 2.3.1', |
37efbbd8 | 686 | required : want_seccomp == 'true') |
349cc4a5 | 687 | have = libseccomp.found() |
5c23128d | 688 | else |
349cc4a5 | 689 | have = false |
37efbbd8 | 690 | libseccomp = [] |
5c23128d | 691 | endif |
349cc4a5 ZJS |
692 | conf.set10('HAVE_SECCOMP', have) |
693 | m4_defines += have ? ['-DHAVE_SECCOMP'] : [] | |
5c23128d ZJS |
694 | |
695 | want_selinux = get_option('selinux') | |
4390be30 | 696 | if want_selinux != 'false' |
37efbbd8 ZJS |
697 | libselinux = dependency('libselinux', |
698 | version : '>= 2.1.9', | |
699 | required : want_selinux == 'true') | |
349cc4a5 | 700 | have = libselinux.found() |
5c23128d | 701 | else |
349cc4a5 | 702 | have = false |
37efbbd8 | 703 | libselinux = [] |
5c23128d | 704 | endif |
349cc4a5 ZJS |
705 | conf.set10('HAVE_SELINUX', have) |
706 | m4_defines += have ? ['-DHAVE_SELINUX'] : [] | |
5c23128d ZJS |
707 | |
708 | want_apparmor = get_option('apparmor') | |
4390be30 | 709 | if want_apparmor != 'false' |
37efbbd8 ZJS |
710 | libapparmor = dependency('libapparmor', |
711 | required : want_apparmor == 'true') | |
349cc4a5 | 712 | have = libapparmor.found() |
5c23128d | 713 | else |
349cc4a5 | 714 | have = false |
37efbbd8 | 715 | libapparmor = [] |
5c23128d | 716 | endif |
349cc4a5 ZJS |
717 | conf.set10('HAVE_APPARMOR', have) |
718 | m4_defines += have ? ['-DHAVE_APPARMOR'] : [] | |
5c23128d | 719 | |
5c23128d ZJS |
720 | smack_run_label = get_option('smack-run-label') |
721 | if smack_run_label != '' | |
37efbbd8 ZJS |
722 | conf.set_quoted('SMACK_RUN_LABEL', smack_run_label) |
723 | m4_defines += ['-DHAVE_SMACK_RUN_LABEL'] | |
5c23128d ZJS |
724 | endif |
725 | ||
3ca0cb73 ZJS |
726 | want_polkit = get_option('polkit') |
727 | install_polkit = false | |
728 | install_polkit_pkla = false | |
4390be30 | 729 | if want_polkit != 'false' |
37efbbd8 | 730 | install_polkit = true |
3ca0cb73 | 731 | |
37efbbd8 ZJS |
732 | 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 | |
3ca0cb73 | 738 | endif |
349cc4a5 | 739 | conf.set10('ENABLE_POLKIT', install_polkit) |
3ca0cb73 | 740 | |
36f0387e ZJS |
741 | want_acl = get_option('acl') |
742 | if want_acl != 'false' | |
743 | libacl = cc.find_library('acl', required : want_acl == 'true') | |
349cc4a5 | 744 | have = libacl.found() |
36f0387e | 745 | else |
349cc4a5 | 746 | have = false |
36f0387e ZJS |
747 | libacl = [] |
748 | endif | |
349cc4a5 ZJS |
749 | conf.set10('HAVE_ACL', have) |
750 | m4_defines += have ? ['-DHAVE_ACL'] : [] | |
36f0387e | 751 | |
5c23128d | 752 | want_audit = get_option('audit') |
4390be30 | 753 | if want_audit != 'false' |
37efbbd8 | 754 | libaudit = dependency('audit', required : want_audit == 'true') |
349cc4a5 | 755 | have = libaudit.found() |
5c23128d | 756 | else |
349cc4a5 | 757 | have = false |
37efbbd8 | 758 | libaudit = [] |
5c23128d | 759 | endif |
349cc4a5 | 760 | conf.set10('HAVE_AUDIT', have) |
5c23128d ZJS |
761 | |
762 | want_blkid = get_option('blkid') | |
4390be30 | 763 | if want_blkid != 'false' |
37efbbd8 | 764 | libblkid = dependency('blkid', required : want_blkid == 'true') |
349cc4a5 | 765 | have = libblkid.found() |
5c23128d | 766 | else |
349cc4a5 | 767 | have = false |
37efbbd8 | 768 | libblkid = [] |
5c23128d | 769 | endif |
349cc4a5 | 770 | conf.set10('HAVE_BLKID', have) |
5c23128d ZJS |
771 | |
772 | want_kmod = get_option('kmod') | |
4390be30 | 773 | if want_kmod != 'false' |
37efbbd8 ZJS |
774 | libkmod = dependency('libkmod', |
775 | version : '>= 15', | |
776 | required : want_kmod == 'true') | |
349cc4a5 | 777 | have = libkmod.found() |
5c23128d | 778 | else |
349cc4a5 | 779 | have = false |
37efbbd8 | 780 | libkmod = [] |
5c23128d | 781 | endif |
349cc4a5 | 782 | conf.set10('HAVE_KMOD', have) |
5c23128d ZJS |
783 | |
784 | want_pam = get_option('pam') | |
4390be30 | 785 | if want_pam != 'false' |
37efbbd8 ZJS |
786 | libpam = cc.find_library('pam', required : want_pam == 'true') |
787 | libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true') | |
349cc4a5 | 788 | have = libpam.found() and libpam_misc.found() |
5c23128d | 789 | else |
349cc4a5 | 790 | have = false |
37efbbd8 ZJS |
791 | libpam = [] |
792 | libpam_misc = [] | |
5c23128d | 793 | endif |
349cc4a5 ZJS |
794 | conf.set10('HAVE_PAM', have) |
795 | m4_defines += have ? ['-DHAVE_PAM'] : [] | |
5c23128d ZJS |
796 | |
797 | want_microhttpd = get_option('microhttpd') | |
4390be30 | 798 | if want_microhttpd != 'false' |
37efbbd8 ZJS |
799 | libmicrohttpd = dependency('libmicrohttpd', |
800 | version : '>= 0.9.33', | |
801 | required : want_microhttpd == 'true') | |
349cc4a5 | 802 | have = libmicrohttpd.found() |
5c23128d | 803 | else |
349cc4a5 | 804 | have = false |
37efbbd8 | 805 | libmicrohttpd = [] |
5c23128d | 806 | endif |
349cc4a5 ZJS |
807 | conf.set10('HAVE_MICROHTTPD', have) |
808 | m4_defines += have ? ['-DHAVE_MICROHTTPD'] : [] | |
5c23128d ZJS |
809 | |
810 | want_libcryptsetup = get_option('libcryptsetup') | |
4390be30 | 811 | if want_libcryptsetup != 'false' |
37efbbd8 ZJS |
812 | libcryptsetup = dependency('libcryptsetup', |
813 | version : '>= 1.6.0', | |
814 | required : want_libcryptsetup == 'true') | |
349cc4a5 | 815 | have = libcryptsetup.found() |
5c23128d | 816 | else |
349cc4a5 | 817 | have = false |
37efbbd8 | 818 | libcryptsetup = [] |
5c23128d | 819 | endif |
349cc4a5 | 820 | conf.set10('HAVE_LIBCRYPTSETUP', have) |
5c23128d ZJS |
821 | |
822 | want_libcurl = get_option('libcurl') | |
4390be30 | 823 | if want_libcurl != 'false' |
37efbbd8 ZJS |
824 | libcurl = dependency('libcurl', |
825 | version : '>= 7.32.0', | |
826 | required : want_libcurl == 'true') | |
349cc4a5 | 827 | have = libcurl.found() |
5c23128d | 828 | else |
349cc4a5 | 829 | have = false |
37efbbd8 | 830 | libcurl = [] |
5c23128d | 831 | endif |
349cc4a5 ZJS |
832 | conf.set10('HAVE_LIBCURL', have) |
833 | m4_defines += have ? ['-DHAVE_LIBCURL'] : [] | |
5c23128d ZJS |
834 | |
835 | want_libidn = get_option('libidn') | |
87057e24 ZJS |
836 | want_libidn2 = get_option('libidn2') |
837 | if want_libidn == 'true' and want_libidn2 == 'true' | |
838 | error('libidn and libidn2 cannot be requested simultaneously') | |
839 | endif | |
840 | ||
7f7ab228 ZJS |
841 | if want_libidn != 'false' and want_libidn2 != 'true' |
842 | libidn = dependency('libidn', | |
843 | required : want_libidn == 'true') | |
349cc4a5 | 844 | have = libidn.found() |
87057e24 | 845 | else |
349cc4a5 | 846 | have = false |
87057e24 ZJS |
847 | libidn = [] |
848 | endif | |
349cc4a5 ZJS |
849 | conf.set10('HAVE_LIBIDN', have) |
850 | m4_defines += have ? ['-DHAVE_LIBIDN'] : [] | |
851 | if not have and want_libidn2 != 'false' | |
7f7ab228 ZJS |
852 | # libidn is used for both libidn and libidn2 objects |
853 | libidn = dependency('libidn2', | |
854 | required : want_libidn2 == 'true') | |
349cc4a5 ZJS |
855 | have = libidn.found() |
856 | else | |
857 | have = false | |
5c23128d | 858 | endif |
349cc4a5 ZJS |
859 | conf.set10('HAVE_LIBIDN2', have) |
860 | m4_defines += have ? ['-DHAVE_LIBIDN2'] : [] | |
5c23128d ZJS |
861 | |
862 | want_libiptc = get_option('libiptc') | |
4390be30 | 863 | if want_libiptc != 'false' |
37efbbd8 ZJS |
864 | libiptc = dependency('libiptc', |
865 | required : want_libiptc == 'true') | |
349cc4a5 | 866 | have = libiptc.found() |
5c23128d | 867 | else |
349cc4a5 | 868 | have = false |
37efbbd8 | 869 | libiptc = [] |
5c23128d | 870 | endif |
349cc4a5 ZJS |
871 | conf.set10('HAVE_LIBIPTC', have) |
872 | m4_defines += have ? ['-DHAVE_LIBIPTC'] : [] | |
5c23128d ZJS |
873 | |
874 | want_qrencode = get_option('qrencode') | |
4390be30 | 875 | if want_qrencode != 'false' |
37efbbd8 ZJS |
876 | libqrencode = dependency('libqrencode', |
877 | required : want_qrencode == 'true') | |
349cc4a5 | 878 | have = libqrencode.found() |
5c23128d | 879 | else |
349cc4a5 | 880 | have = false |
37efbbd8 | 881 | libqrencode = [] |
5c23128d | 882 | endif |
349cc4a5 | 883 | conf.set10('HAVE_QRENCODE', have) |
5c23128d | 884 | |
a44fb601 ZJS |
885 | want_gcrypt = get_option('gcrypt') |
886 | if 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') | |
349cc4a5 | 889 | have = libgcrypt.found() and libgpg_error.found() |
a44fb601 | 890 | else |
349cc4a5 ZJS |
891 | have = false |
892 | endif | |
893 | if not have | |
894 | # link to neither of the libs if one is not found | |
a44fb601 ZJS |
895 | libgcrypt = [] |
896 | libgpg_error = [] | |
897 | endif | |
349cc4a5 | 898 | conf.set10('HAVE_GCRYPT', have) |
a44fb601 | 899 | |
5c23128d | 900 | want_gnutls = get_option('gnutls') |
4390be30 | 901 | if want_gnutls != 'false' |
37efbbd8 ZJS |
902 | libgnutls = dependency('gnutls', |
903 | version : '>= 3.1.4', | |
904 | required : want_gnutls == 'true') | |
349cc4a5 | 905 | have = libgnutls.found() |
5c23128d | 906 | else |
349cc4a5 | 907 | have = false |
37efbbd8 | 908 | libgnutls = [] |
5c23128d | 909 | endif |
349cc4a5 | 910 | conf.set10('HAVE_GNUTLS', have) |
5c23128d ZJS |
911 | |
912 | want_elfutils = get_option('elfutils') | |
4390be30 | 913 | if want_elfutils != 'false' |
37efbbd8 ZJS |
914 | libdw = dependency('libdw', |
915 | required : want_elfutils == 'true') | |
349cc4a5 | 916 | have = libdw.found() |
5c23128d | 917 | else |
349cc4a5 | 918 | have = false |
37efbbd8 | 919 | libdw = [] |
5c23128d | 920 | endif |
349cc4a5 | 921 | conf.set10('HAVE_ELFUTILS', have) |
5c23128d ZJS |
922 | |
923 | want_zlib = get_option('zlib') | |
4390be30 | 924 | if want_zlib != 'false' |
37efbbd8 ZJS |
925 | libz = dependency('zlib', |
926 | required : want_zlib == 'true') | |
349cc4a5 | 927 | have = libz.found() |
5c23128d | 928 | else |
349cc4a5 | 929 | have = false |
37efbbd8 | 930 | libz = [] |
5c23128d | 931 | endif |
349cc4a5 | 932 | conf.set10('HAVE_ZLIB', have) |
5c23128d ZJS |
933 | |
934 | want_bzip2 = get_option('bzip2') | |
4390be30 | 935 | if want_bzip2 != 'false' |
37efbbd8 ZJS |
936 | libbzip2 = cc.find_library('bz2', |
937 | required : want_bzip2 == 'true') | |
349cc4a5 | 938 | have = libbzip2.found() |
5c23128d | 939 | else |
349cc4a5 | 940 | have = false |
37efbbd8 | 941 | libbzip2 = [] |
5c23128d | 942 | endif |
349cc4a5 | 943 | conf.set10('HAVE_BZIP2', have) |
5c23128d ZJS |
944 | |
945 | want_xz = get_option('xz') | |
4390be30 | 946 | if want_xz != 'false' |
37efbbd8 ZJS |
947 | libxz = dependency('liblzma', |
948 | required : want_xz == 'true') | |
349cc4a5 | 949 | have = libxz.found() |
5c23128d | 950 | else |
349cc4a5 | 951 | have = false |
37efbbd8 | 952 | libxz = [] |
5c23128d | 953 | endif |
349cc4a5 | 954 | conf.set10('HAVE_XZ', have) |
5c23128d ZJS |
955 | |
956 | want_lz4 = get_option('lz4') | |
4390be30 | 957 | if want_lz4 != 'false' |
37efbbd8 ZJS |
958 | liblz4 = dependency('liblz4', |
959 | required : want_lz4 == 'true') | |
349cc4a5 | 960 | have = liblz4.found() |
5c23128d | 961 | else |
349cc4a5 | 962 | have = false |
37efbbd8 | 963 | liblz4 = [] |
5c23128d | 964 | endif |
349cc4a5 | 965 | conf.set10('HAVE_LZ4', have) |
5c23128d | 966 | |
a44fb601 ZJS |
967 | want_xkbcommon = get_option('xkbcommon') |
968 | if want_xkbcommon != 'false' | |
969 | libxkbcommon = dependency('xkbcommon', | |
970 | version : '>= 0.3.0', | |
971 | required : want_xkbcommon == 'true') | |
349cc4a5 | 972 | have = libxkbcommon.found() |
a44fb601 | 973 | else |
349cc4a5 | 974 | have = false |
a44fb601 ZJS |
975 | libxkbcommon = [] |
976 | endif | |
349cc4a5 | 977 | conf.set10('HAVE_XKBCOMMON', have) |
a44fb601 | 978 | |
69e96427 | 979 | want_glib = get_option('glib') |
4390be30 | 980 | if want_glib != 'false' |
37efbbd8 ZJS |
981 | 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') | |
2c201c21 | 989 | have = libglib.found() and libgobject.found() and libgio.found() |
69e96427 | 990 | else |
349cc4a5 | 991 | have = false |
37efbbd8 ZJS |
992 | libglib = [] |
993 | libgobject = [] | |
994 | libgio = [] | |
69e96427 | 995 | endif |
349cc4a5 | 996 | conf.set10('HAVE_GLIB', have) |
69e96427 ZJS |
997 | |
998 | want_dbus = get_option('dbus') | |
4390be30 | 999 | if want_dbus != 'false' |
37efbbd8 ZJS |
1000 | libdbus = dependency('dbus-1', |
1001 | version : '>= 1.3.2', | |
1002 | required : want_dbus == 'true') | |
349cc4a5 | 1003 | have = libdbus.found() |
69e96427 | 1004 | else |
349cc4a5 | 1005 | have = false |
37efbbd8 | 1006 | libdbus = [] |
69e96427 | 1007 | endif |
349cc4a5 | 1008 | conf.set10('HAVE_DBUS', have) |
69e96427 | 1009 | |
42303dcb | 1010 | default_dnssec = get_option('default-dnssec') |
349cc4a5 | 1011 | if default_dnssec != 'no' and conf.get('HAVE_GCRYPT') == 0 |
42303dcb YW |
1012 | message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.') |
1013 | default_dnssec = 'no' | |
1014 | endif | |
1015 | conf.set('DEFAULT_DNSSEC_MODE', | |
1016 | 'DNSSEC_' + default_dnssec.underscorify().to_upper()) | |
1017 | substs.set('DEFAULT_DNSSEC_MODE', default_dnssec) | |
1018 | ||
5c23128d | 1019 | want_importd = get_option('importd') |
4390be30 | 1020 | if want_importd != 'false' |
349cc4a5 ZJS |
1021 | 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 | |
37efbbd8 ZJS |
1027 | error('importd support was requested, but dependencies are not available') |
1028 | endif | |
349cc4a5 ZJS |
1029 | else |
1030 | have = false | |
5c23128d | 1031 | endif |
349cc4a5 | 1032 | conf.set10('ENABLE_IMPORTD', have) |
5c23128d ZJS |
1033 | |
1034 | want_remote = get_option('remote') | |
4390be30 | 1035 | if want_remote != 'false' |
349cc4a5 ZJS |
1036 | have_deps = [conf.get('HAVE_MICROHTTPD') == 1, |
1037 | conf.get('HAVE_LIBCURL') == 1] | |
37efbbd8 ZJS |
1038 | # 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 | |
349cc4a5 ZJS |
1045 | have = have_deps[0] or have_deps[1] |
1046 | else | |
1047 | have = false | |
5c23128d | 1048 | endif |
349cc4a5 | 1049 | conf.set10('ENABLE_REMOTE', have) |
5c23128d | 1050 | |
a9149d87 ZJS |
1051 | foreach 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] : [] | |
5c23128d ZJS |
1086 | endforeach |
1087 | ||
69e96427 | 1088 | want_tests = get_option('tests') |
572baca1 | 1089 | install_tests = get_option('install-tests') |
69e96427 ZJS |
1090 | tests = [] |
1091 | ||
00d82c81 ZJS |
1092 | conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests')) |
1093 | ||
5c23128d ZJS |
1094 | ##################################################################### |
1095 | ||
1096 | if get_option('efi') | |
37efbbd8 | 1097 | efi_arch = host_machine.cpu_family() |
b710072d | 1098 | |
6800fe7f | 1099 | if efi_arch == 'x86' |
37efbbd8 | 1100 | EFI_MACHINE_TYPE_NAME = 'ia32' |
6800fe7f | 1101 | gnu_efi_arch = 'ia32' |
37efbbd8 ZJS |
1102 | elif efi_arch == 'x86_64' |
1103 | EFI_MACHINE_TYPE_NAME = 'x64' | |
6800fe7f | 1104 | gnu_efi_arch = 'x86_64' |
37efbbd8 ZJS |
1105 | elif efi_arch == 'arm' |
1106 | EFI_MACHINE_TYPE_NAME = 'arm' | |
6800fe7f | 1107 | gnu_efi_arch = 'arm' |
37efbbd8 ZJS |
1108 | elif efi_arch == 'aarch64' |
1109 | EFI_MACHINE_TYPE_NAME = 'aa64' | |
6800fe7f | 1110 | gnu_efi_arch = 'aarch64' |
37efbbd8 ZJS |
1111 | else |
1112 | EFI_MACHINE_TYPE_NAME = '' | |
6800fe7f | 1113 | gnu_efi_arch = '' |
37efbbd8 | 1114 | endif |
5c23128d | 1115 | |
349cc4a5 | 1116 | have = true |
37efbbd8 | 1117 | conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) |
80c6fce8 ZJS |
1118 | |
1119 | conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int()) | |
349cc4a5 ZJS |
1120 | else |
1121 | have = false | |
5c23128d | 1122 | endif |
349cc4a5 | 1123 | conf.set10('ENABLE_EFI', have) |
5c23128d ZJS |
1124 | |
1125 | ##################################################################### | |
1126 | ||
1127 | config_h = configure_file( | |
37efbbd8 ZJS |
1128 | output : 'config.h', |
1129 | configuration : conf) | |
5c23128d ZJS |
1130 | |
1131 | includes = 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', | |
5e1771ac | 1148 | '.', |
5c23128d ZJS |
1149 | ) |
1150 | ||
1151 | add_project_arguments('-include', 'config.h', language : 'c') | |
1152 | ||
1153 | gcrypt_util_sources = files('src/shared/gcrypt-util.h', | |
1154 | 'src/shared/gcrypt-util.c') | |
1155 | ||
1156 | subdir('po') | |
1157 | subdir('catalog') | |
1158 | subdir('src/systemd') | |
1159 | subdir('src/basic') | |
1160 | subdir('src/libsystemd') | |
1161 | subdir('src/libsystemd-network') | |
5c23128d | 1162 | subdir('src/journal') |
5c23128d | 1163 | subdir('src/login') |
5c23128d ZJS |
1164 | |
1165 | libjournal_core = static_library( | |
37efbbd8 ZJS |
1166 | 'journal-core', |
1167 | libjournal_core_sources, | |
1168 | journald_gperf_c, | |
1169 | include_directories : includes, | |
1170 | install : false) | |
5c23128d | 1171 | |
37ab1a25 | 1172 | libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym) |
5c23128d | 1173 | libsystemd = shared_library( |
37efbbd8 ZJS |
1174 | 'systemd', |
1175 | libsystemd_internal_sources, | |
1176 | journal_internal_sources, | |
56d50ab1 | 1177 | version : libsystemd_version, |
37efbbd8 ZJS |
1178 | include_directories : includes, |
1179 | link_args : ['-shared', | |
1180 | '-Wl,--version-script=' + libsystemd_sym_path], | |
1181 | link_with : [libbasic], | |
1182 | dependencies : [threads, | |
76c87410 | 1183 | libgcrypt, |
37efbbd8 ZJS |
1184 | librt, |
1185 | libxz, | |
1186 | liblz4], | |
1187 | link_depends : libsystemd_sym, | |
1188 | install : true, | |
1189 | install_dir : rootlibdir) | |
5c23128d ZJS |
1190 | |
1191 | ############################################################ | |
1192 | ||
83b6af36 ZJS |
1193 | # binaries that have --help and are intended for use by humans, |
1194 | # usually, but not always, installed in /bin. | |
1195 | public_programs = [] | |
1196 | ||
1197 | subdir('src/libudev') | |
1198 | subdir('src/shared') | |
1199 | subdir('src/core') | |
1200 | subdir('src/udev') | |
1201 | subdir('src/network') | |
1202 | ||
1203 | subdir('src/analyze') | |
1204 | subdir('src/journal-remote') | |
1205 | subdir('src/coredump') | |
1206 | subdir('src/hostname') | |
1207 | subdir('src/import') | |
1208 | subdir('src/kernel-install') | |
1209 | subdir('src/locale') | |
1210 | subdir('src/machine') | |
1211 | subdir('src/nspawn') | |
1212 | subdir('src/resolve') | |
1213 | subdir('src/timedate') | |
1214 | subdir('src/timesync') | |
1215 | subdir('src/vconsole') | |
1216 | subdir('src/sulogin-shell') | |
1217 | subdir('src/boot/efi') | |
1218 | ||
1219 | subdir('src/test') | |
1220 | subdir('test') | |
1221 | ||
1222 | ############################################################ | |
1223 | ||
1224 | # only static linking apart from libdl, to make sure that the | |
1225 | # module is linked to all libraries that it uses. | |
1226 | test_dlopen = executable( | |
37efbbd8 ZJS |
1227 | 'test-dlopen', |
1228 | test_dlopen_c, | |
1229 | include_directories : includes, | |
1230 | link_with : [libbasic], | |
1231 | dependencies : [libdl]) | |
83b6af36 | 1232 | |
08cf5b8d | 1233 | foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'], |
e7e11bbf | 1234 | ['systemd', 'ENABLE_NSS_SYSTEMD'], |
5486a31d | 1235 | ['mymachines', 'ENABLE_MACHINED'], |
1ec57f33 | 1236 | ['resolve', 'ENABLE_RESOLVE']] |
5c23128d | 1237 | |
349cc4a5 | 1238 | condition = tuple[1] == '' or conf.get(tuple[1]) == 1 |
37efbbd8 ZJS |
1239 | if condition |
1240 | module = tuple[0] | |
37efbbd8 ZJS |
1241 | |
1242 | sym = 'src/nss-@0@/nss-@0@.sym'.format(module) | |
1243 | version_script_arg = join_paths(meson.current_source_dir(), sym) | |
1244 | ||
1245 | 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, | |
5486a31d | 1256 | librt], |
37efbbd8 ZJS |
1257 | link_depends : sym, |
1258 | install : true, | |
1259 | install_dir : rootlibdir) | |
1260 | ||
1261 | # 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)) | |
1266 | ||
1267 | test('dlopen-nss_' + module, | |
1268 | test_dlopen, | |
1269 | args : [nss.full_path()]) # path to dlopen must include a slash | |
1270 | endif | |
5c23128d ZJS |
1271 | endforeach |
1272 | ||
1273 | ############################################################ | |
1274 | ||
5c23128d ZJS |
1275 | executable('systemd', |
1276 | systemd_sources, | |
1277 | include_directories : includes, | |
1278 | link_with : [libcore, | |
34ce0a52 | 1279 | libshared], |
5c23128d ZJS |
1280 | dependencies : [threads, |
1281 | librt, | |
1282 | libseccomp, | |
1283 | libselinux, | |
f4ee10a2 ZJS |
1284 | libmount, |
1285 | libblkid], | |
421f0012 | 1286 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1287 | install : true, |
1288 | install_dir : rootlibexecdir) | |
1289 | ||
005a29f2 ZJS |
1290 | exe = executable('systemd-analyze', |
1291 | systemd_analyze_sources, | |
1292 | include_directories : includes, | |
1293 | link_with : [libcore, | |
005a29f2 ZJS |
1294 | libshared], |
1295 | dependencies : [threads, | |
1296 | librt, | |
1297 | libseccomp, | |
1298 | libselinux, | |
1299 | libmount, | |
1300 | libblkid], | |
1301 | install_rpath : rootlibexecdir, | |
1302 | install : true) | |
1303 | public_programs += [exe] | |
5c23128d ZJS |
1304 | |
1305 | executable('systemd-journald', | |
1306 | systemd_journald_sources, | |
1307 | include_directories : includes, | |
aac26058 | 1308 | link_with : [libjournal_core, |
34ce0a52 | 1309 | libshared], |
5c23128d ZJS |
1310 | dependencies : [threads, |
1311 | libxz, | |
aac26058 ZJS |
1312 | liblz4, |
1313 | libselinux], | |
421f0012 | 1314 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1315 | install : true, |
1316 | install_dir : rootlibexecdir) | |
1317 | ||
005a29f2 ZJS |
1318 | exe = executable('systemd-cat', |
1319 | systemd_cat_sources, | |
1320 | include_directories : includes, | |
1321 | link_with : [libjournal_core, | |
34ce0a52 | 1322 | libshared], |
005a29f2 ZJS |
1323 | dependencies : [threads], |
1324 | install_rpath : rootlibexecdir, | |
1325 | install : true) | |
1326 | public_programs += [exe] | |
1327 | ||
1328 | exe = executable('journalctl', | |
1329 | journalctl_sources, | |
1330 | include_directories : includes, | |
34ce0a52 | 1331 | link_with : [libshared], |
005a29f2 ZJS |
1332 | dependencies : [threads, |
1333 | libqrencode, | |
1334 | libxz, | |
1335 | liblz4], | |
1336 | install_rpath : rootlibexecdir, | |
1337 | install : true, | |
1338 | install_dir : rootbindir) | |
1339 | public_programs += [exe] | |
5c23128d ZJS |
1340 | |
1341 | executable('systemd-getty-generator', | |
1342 | 'src/getty-generator/getty-generator.c', | |
5c23128d | 1343 | include_directories : includes, |
b2fc5836 ZJS |
1344 | link_with : [libshared], |
1345 | install_rpath : rootlibexecdir, | |
1346 | install : true, | |
1347 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1348 | |
1349 | executable('systemd-debug-generator', | |
1350 | 'src/debug-generator/debug-generator.c', | |
5c23128d | 1351 | include_directories : includes, |
b2fc5836 ZJS |
1352 | link_with : [libshared], |
1353 | install_rpath : rootlibexecdir, | |
1354 | install : true, | |
1355 | install_dir : systemgeneratordir) | |
5c23128d ZJS |
1356 | |
1357 | executable('systemd-fstab-generator', | |
1358 | 'src/fstab-generator/fstab-generator.c', | |
1359 | 'src/core/mount-setup.c', | |
5c23128d | 1360 | include_directories : includes, |
b2fc5836 ZJS |
1361 | link_with : [libshared], |
1362 | install_rpath : rootlibexecdir, | |
1363 | install : true, | |
1364 | install_dir : systemgeneratordir) | |
5c23128d | 1365 | |
349cc4a5 | 1366 | if conf.get('ENABLE_ENVIRONMENT_D') == 1 |
37efbbd8 ZJS |
1367 | 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) | |
7b76fce1 | 1374 | |
37efbbd8 ZJS |
1375 | meson.add_install_script(meson_make_symlink, |
1376 | join_paths(sysconfdir, 'environment'), | |
1377 | join_paths(environmentdir, '99-environment.conf')) | |
5c23128d ZJS |
1378 | endif |
1379 | ||
349cc4a5 | 1380 | if conf.get('ENABLE_HIBERNATE') == 1 |
37efbbd8 ZJS |
1381 | 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) | |
5c23128d | 1388 | |
37efbbd8 ZJS |
1389 | executable('systemd-hibernate-resume', |
1390 | 'src/hibernate-resume/hibernate-resume.c', | |
005a29f2 ZJS |
1391 | include_directories : includes, |
1392 | link_with : [libshared], | |
1393 | install_rpath : rootlibexecdir, | |
1394 | install : true, | |
1395 | install_dir : rootlibexecdir) | |
37efbbd8 ZJS |
1396 | endif |
1397 | ||
349cc4a5 | 1398 | if conf.get('HAVE_BLKID') == 1 |
37efbbd8 ZJS |
1399 | executable('systemd-gpt-auto-generator', |
1400 | 'src/gpt-auto-generator/gpt-auto-generator.c', | |
1401 | 'src/basic/blkid-util.h', | |
1402 | include_directories : includes, | |
34ce0a52 | 1403 | link_with : [libshared], |
37efbbd8 ZJS |
1404 | 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] | |
5c23128d ZJS |
1417 | endif |
1418 | ||
1ec57f33 | 1419 | if conf.get('ENABLE_RESOLVE') == 1 |
37efbbd8 ZJS |
1420 | executable('systemd-resolved', |
1421 | systemd_resolved_sources, | |
76c87410 | 1422 | gcrypt_util_sources, |
005a29f2 | 1423 | include_directories : includes, |
aac26058 | 1424 | link_with : [libshared], |
005a29f2 | 1425 | dependencies : [threads, |
76c87410 MB |
1426 | libgcrypt, |
1427 | libgpg_error, | |
005a29f2 ZJS |
1428 | libm, |
1429 | libidn], | |
1430 | install_rpath : rootlibexecdir, | |
37efbbd8 ZJS |
1431 | install : true, |
1432 | install_dir : rootlibexecdir) | |
1433 | ||
1434 | exe = executable('systemd-resolve', | |
1435 | systemd_resolve_sources, | |
76c87410 | 1436 | gcrypt_util_sources, |
37efbbd8 ZJS |
1437 | include_directories : includes, |
1438 | link_with : [libshared], | |
1439 | dependencies : [threads, | |
76c87410 MB |
1440 | libgcrypt, |
1441 | libgpg_error, | |
37efbbd8 ZJS |
1442 | libm, |
1443 | libidn], | |
1444 | install_rpath : rootlibexecdir, | |
1445 | install : true) | |
1446 | public_programs += [exe] | |
5c23128d ZJS |
1447 | endif |
1448 | ||
349cc4a5 | 1449 | if conf.get('ENABLE_LOGIND') == 1 |
37efbbd8 ZJS |
1450 | executable('systemd-logind', |
1451 | systemd_logind_sources, | |
005a29f2 | 1452 | include_directories : includes, |
37efbbd8 | 1453 | link_with : [liblogind_core, |
34ce0a52 | 1454 | libshared], |
005a29f2 | 1455 | dependencies : [threads, |
37efbbd8 | 1456 | libacl], |
005a29f2 ZJS |
1457 | install_rpath : rootlibexecdir, |
1458 | install : true, | |
37efbbd8 ZJS |
1459 | install_dir : rootlibexecdir) |
1460 | ||
1461 | exe = executable('loginctl', | |
1462 | loginctl_sources, | |
1463 | include_directories : includes, | |
34ce0a52 | 1464 | link_with : [libshared], |
37efbbd8 ZJS |
1465 | dependencies : [threads, |
1466 | liblz4, | |
1467 | libxz], | |
1468 | install_rpath : rootlibexecdir, | |
1469 | install : true, | |
1470 | install_dir : rootbindir) | |
1471 | public_programs += [exe] | |
1472 | ||
1473 | 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] | |
1481 | ||
349cc4a5 | 1482 | if conf.get('HAVE_PAM') == 1 |
37efbbd8 ZJS |
1483 | 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 | |
1504 | endif | |
005a29f2 | 1505 | |
349cc4a5 | 1506 | if conf.get('HAVE_PAM') == 1 |
37efbbd8 ZJS |
1507 | executable('systemd-user-sessions', |
1508 | 'src/user-sessions/user-sessions.c', | |
005a29f2 | 1509 | include_directories : includes, |
aac26058 | 1510 | link_with : [libshared], |
005a29f2 ZJS |
1511 | install_rpath : rootlibexecdir, |
1512 | install : true, | |
37efbbd8 | 1513 | install_dir : rootlibexecdir) |
5c23128d ZJS |
1514 | endif |
1515 | ||
349cc4a5 | 1516 | if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1 |
37efbbd8 ZJS |
1517 | 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] | |
005a29f2 ZJS |
1525 | endif |
1526 | ||
1527 | exe = 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) | |
1533 | public_programs += [exe] | |
1534 | ||
1535 | exe = executable('systemctl', 'src/systemctl/systemctl.c', | |
1536 | include_directories : includes, | |
aac26058 | 1537 | link_with : [libshared], |
005a29f2 ZJS |
1538 | dependencies : [threads, |
1539 | libcap, | |
1540 | libselinux, | |
1541 | libxz, | |
1542 | liblz4], | |
1543 | install_rpath : rootlibexecdir, | |
1544 | install : true, | |
1545 | install_dir : rootbindir) | |
1546 | public_programs += [exe] | |
5c23128d | 1547 | |
349cc4a5 | 1548 | if conf.get('ENABLE_BACKLIGHT') == 1 |
37efbbd8 ZJS |
1549 | executable('systemd-backlight', |
1550 | 'src/backlight/backlight.c', | |
1551 | include_directories : includes, | |
34ce0a52 | 1552 | link_with : [libshared], |
37efbbd8 ZJS |
1553 | install_rpath : rootlibexecdir, |
1554 | install : true, | |
1555 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1556 | endif |
1557 | ||
349cc4a5 | 1558 | if conf.get('ENABLE_RFKILL') == 1 |
37efbbd8 ZJS |
1559 | executable('systemd-rfkill', |
1560 | 'src/rfkill/rfkill.c', | |
1561 | include_directories : includes, | |
34ce0a52 | 1562 | link_with : [libshared], |
37efbbd8 ZJS |
1563 | install_rpath : rootlibexecdir, |
1564 | install : true, | |
1565 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1566 | endif |
1567 | ||
1568 | executable('systemd-system-update-generator', | |
1569 | 'src/system-update-generator/system-update-generator.c', | |
1570 | include_directories : includes, | |
1571 | link_with : [libshared], | |
b2fc5836 | 1572 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1573 | install : true, |
1574 | install_dir : systemgeneratordir) | |
1575 | ||
349cc4a5 | 1576 | if conf.get('HAVE_LIBCRYPTSETUP') == 1 |
37efbbd8 ZJS |
1577 | 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) | |
1585 | ||
1586 | 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) | |
1594 | ||
1595 | 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) | |
1603 | ||
1604 | 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) | |
5c23128d ZJS |
1612 | endif |
1613 | ||
349cc4a5 | 1614 | if conf.get('HAVE_SYSV_COMPAT') == 1 |
37efbbd8 ZJS |
1615 | 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) | |
1622 | ||
1623 | 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) | |
5c23128d ZJS |
1630 | endif |
1631 | ||
349cc4a5 | 1632 | if conf.get('ENABLE_HOSTNAMED') == 1 |
37efbbd8 ZJS |
1633 | executable('systemd-hostnamed', |
1634 | 'src/hostname/hostnamed.c', | |
005a29f2 | 1635 | include_directories : includes, |
aac26058 | 1636 | link_with : [libshared], |
005a29f2 | 1637 | install_rpath : rootlibexecdir, |
37efbbd8 ZJS |
1638 | 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] | |
5c23128d ZJS |
1648 | endif |
1649 | ||
349cc4a5 ZJS |
1650 | if conf.get('ENABLE_LOCALED') == 1 |
1651 | if conf.get('HAVE_XKBCOMMON') == 1 | |
37efbbd8 ZJS |
1652 | # logind will load libxkbcommon.so dynamically on its own |
1653 | deps = [libdl] | |
1654 | else | |
1655 | deps = [] | |
1656 | endif | |
1657 | ||
1658 | executable('systemd-localed', | |
1659 | systemd_localed_sources, | |
005a29f2 | 1660 | include_directories : includes, |
aac26058 | 1661 | link_with : [libshared], |
37efbbd8 | 1662 | dependencies : deps, |
005a29f2 | 1663 | install_rpath : rootlibexecdir, |
37efbbd8 ZJS |
1664 | 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] | |
5c23128d ZJS |
1674 | endif |
1675 | ||
349cc4a5 | 1676 | if conf.get('ENABLE_TIMEDATED') == 1 |
37efbbd8 ZJS |
1677 | executable('systemd-timedated', |
1678 | 'src/timedate/timedated.c', | |
005a29f2 | 1679 | include_directories : includes, |
aac26058 | 1680 | link_with : [libshared], |
37efbbd8 ZJS |
1681 | install_rpath : rootlibexecdir, |
1682 | install : true, | |
1683 | install_dir : rootlibexecdir) | |
5c23128d | 1684 | |
37efbbd8 ZJS |
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] | |
5c23128d ZJS |
1692 | endif |
1693 | ||
349cc4a5 | 1694 | if conf.get('ENABLE_TIMESYNCD') == 1 |
37efbbd8 ZJS |
1695 | executable('systemd-timesyncd', |
1696 | systemd_timesyncd_sources, | |
005a29f2 | 1697 | include_directories : includes, |
aac26058 | 1698 | link_with : [libshared], |
005a29f2 | 1699 | dependencies : [threads, |
37efbbd8 | 1700 | libm], |
005a29f2 ZJS |
1701 | install_rpath : rootlibexecdir, |
1702 | install : true, | |
37efbbd8 | 1703 | install_dir : rootlibexecdir) |
5c23128d ZJS |
1704 | endif |
1705 | ||
349cc4a5 | 1706 | if conf.get('ENABLE_MACHINED') == 1 |
37efbbd8 ZJS |
1707 | executable('systemd-machined', |
1708 | systemd_machined_sources, | |
1709 | include_directories : includes, | |
1710 | link_with : [libmachine_core, | |
1711 | libshared], | |
1712 | install_rpath : rootlibexecdir, | |
1713 | install : true, | |
1714 | 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] | |
5c23128d ZJS |
1727 | endif |
1728 | ||
349cc4a5 | 1729 | if conf.get('ENABLE_IMPORTD') == 1 |
37efbbd8 ZJS |
1730 | executable('systemd-importd', |
1731 | systemd_importd_sources, | |
005a29f2 | 1732 | include_directories : includes, |
aac26058 | 1733 | link_with : [libshared], |
37efbbd8 | 1734 | dependencies : [threads], |
005a29f2 ZJS |
1735 | install_rpath : rootlibexecdir, |
1736 | install : true, | |
1737 | install_dir : rootlibexecdir) | |
37efbbd8 ZJS |
1738 | |
1739 | 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) | |
1751 | ||
1752 | 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) | |
1763 | ||
1764 | 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] | |
1776 | endif | |
1777 | ||
349cc4a5 | 1778 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1 |
37efbbd8 ZJS |
1779 | 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] | |
5c23128d ZJS |
1792 | endif |
1793 | ||
349cc4a5 | 1794 | if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 |
37efbbd8 ZJS |
1795 | 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) | |
1807 | ||
1808 | 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] | |
5c23128d ZJS |
1821 | endif |
1822 | ||
349cc4a5 | 1823 | if conf.get('ENABLE_COREDUMP') == 1 |
37efbbd8 ZJS |
1824 | executable('systemd-coredump', |
1825 | systemd_coredump_sources, | |
005a29f2 | 1826 | include_directories : includes, |
aac26058 | 1827 | link_with : [libshared], |
005a29f2 | 1828 | dependencies : [threads, |
37efbbd8 ZJS |
1829 | libacl, |
1830 | libdw, | |
005a29f2 ZJS |
1831 | libxz, |
1832 | liblz4], | |
1833 | install_rpath : rootlibexecdir, | |
37efbbd8 ZJS |
1834 | 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] | |
5c23128d ZJS |
1847 | endif |
1848 | ||
349cc4a5 | 1849 | if conf.get('ENABLE_BINFMT') == 1 |
37efbbd8 ZJS |
1850 | 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'))) | |
1863 | endif | |
1864 | ||
349cc4a5 | 1865 | if conf.get('ENABLE_VCONSOLE') == 1 |
37efbbd8 ZJS |
1866 | executable('systemd-vconsole-setup', |
1867 | 'src/vconsole/vconsole-setup.c', | |
005a29f2 ZJS |
1868 | include_directories : includes, |
1869 | link_with : [libshared], | |
1870 | install_rpath : rootlibexecdir, | |
1871 | install : true, | |
1872 | install_dir : rootlibexecdir) | |
5c23128d ZJS |
1873 | endif |
1874 | ||
349cc4a5 | 1875 | if conf.get('ENABLE_RANDOMSEED') == 1 |
37efbbd8 ZJS |
1876 | 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) | |
5c23128d ZJS |
1883 | endif |
1884 | ||
349cc4a5 | 1885 | if conf.get('ENABLE_FIRSTBOOT') == 1 |
37efbbd8 ZJS |
1886 | 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) | |
5c23128d ZJS |
1894 | endif |
1895 | ||
1896 | executable('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], | |
b2fc5836 | 1902 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1903 | install : true, |
1904 | install_dir : rootlibexecdir) | |
1905 | ||
1906 | executable('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, | |
aac26058 | 1911 | link_with : [libshared], |
b2fc5836 | 1912 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1913 | install : true, |
1914 | install_dir : rootbindir) | |
1915 | ||
1916 | executable('systemd-fsck', | |
1917 | 'src/fsck/fsck.c', | |
1918 | include_directories : includes, | |
aac26058 | 1919 | link_with : [libshared], |
421f0012 | 1920 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1921 | install : true, |
1922 | install_dir : rootlibexecdir) | |
1923 | ||
1924 | executable('systemd-sleep', | |
1925 | 'src/sleep/sleep.c', | |
1926 | include_directories : includes, | |
1927 | link_with : [libshared], | |
421f0012 | 1928 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1929 | install : true, |
1930 | install_dir : rootlibexecdir) | |
1931 | ||
005a29f2 ZJS |
1932 | exe = 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) | |
1939 | public_programs += [exe] | |
5c23128d ZJS |
1940 | |
1941 | executable('systemd-ac-power', | |
1942 | 'src/ac-power/ac-power.c', | |
1943 | include_directories : includes, | |
1944 | link_with : [libshared], | |
421f0012 | 1945 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1946 | install : true, |
1947 | install_dir : rootlibexecdir) | |
1948 | ||
005a29f2 ZJS |
1949 | exe = 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) | |
1955 | public_programs += [exe] | |
1956 | ||
1957 | exe = executable('systemd-delta', | |
1958 | 'src/delta/delta.c', | |
1959 | include_directories : includes, | |
1960 | link_with : [libshared], | |
1961 | install_rpath : rootlibexecdir, | |
1962 | install : true) | |
1963 | public_programs += [exe] | |
1964 | ||
1965 | exe = 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) | |
1972 | public_programs += [exe] | |
1973 | ||
1974 | exe = 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) | |
1981 | public_programs += [exe] | |
5c23128d ZJS |
1982 | |
1983 | executable('systemd-volatile-root', | |
1984 | 'src/volatile-root/volatile-root.c', | |
1985 | include_directories : includes, | |
1986 | link_with : [libshared], | |
421f0012 | 1987 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1988 | install : true, |
1989 | install_dir : rootlibexecdir) | |
1990 | ||
1991 | executable('systemd-cgroups-agent', | |
1992 | 'src/cgroups-agent/cgroups-agent.c', | |
1993 | include_directories : includes, | |
1994 | link_with : [libshared], | |
421f0012 | 1995 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
1996 | install : true, |
1997 | install_dir : rootlibexecdir) | |
1998 | ||
005a29f2 ZJS |
1999 | exe = executable('systemd-path', |
2000 | 'src/path/path.c', | |
2001 | include_directories : includes, | |
aac26058 | 2002 | link_with : [libshared], |
005a29f2 ZJS |
2003 | install_rpath : rootlibexecdir, |
2004 | install : true) | |
2005 | public_programs += [exe] | |
2006 | ||
2007 | exe = executable('systemd-ask-password', | |
2008 | 'src/ask-password/ask-password.c', | |
2009 | include_directories : includes, | |
aac26058 | 2010 | link_with : [libshared], |
005a29f2 ZJS |
2011 | install_rpath : rootlibexecdir, |
2012 | install : true, | |
2013 | install_dir : rootbindir) | |
2014 | public_programs += [exe] | |
5c23128d ZJS |
2015 | |
2016 | executable('systemd-reply-password', | |
2017 | 'src/reply-password/reply-password.c', | |
2018 | include_directories : includes, | |
aac26058 | 2019 | link_with : [libshared], |
421f0012 | 2020 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2021 | install : true, |
2022 | install_dir : rootlibexecdir) | |
2023 | ||
005a29f2 ZJS |
2024 | exe = executable('systemd-tty-ask-password-agent', |
2025 | 'src/tty-ask-password-agent/tty-ask-password-agent.c', | |
2026 | include_directories : includes, | |
aac26058 | 2027 | link_with : [libshared], |
005a29f2 ZJS |
2028 | install_rpath : rootlibexecdir, |
2029 | install : true, | |
2030 | install_dir : rootbindir) | |
2031 | public_programs += [exe] | |
2032 | ||
2033 | exe = executable('systemd-cgls', | |
2034 | 'src/cgls/cgls.c', | |
2035 | include_directories : includes, | |
aac26058 | 2036 | link_with : [libshared], |
005a29f2 ZJS |
2037 | install_rpath : rootlibexecdir, |
2038 | install : true) | |
2039 | public_programs += [exe] | |
2040 | ||
2041 | exe = executable('systemd-cgtop', | |
2042 | 'src/cgtop/cgtop.c', | |
2043 | include_directories : includes, | |
aac26058 | 2044 | link_with : [libshared], |
005a29f2 ZJS |
2045 | install_rpath : rootlibexecdir, |
2046 | install : true) | |
2047 | public_programs += [exe] | |
5c23128d ZJS |
2048 | |
2049 | executable('systemd-initctl', | |
2050 | 'src/initctl/initctl.c', | |
2051 | include_directories : includes, | |
aac26058 | 2052 | link_with : [libshared], |
421f0012 | 2053 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2054 | install : true, |
2055 | install_dir : rootlibexecdir) | |
2056 | ||
005a29f2 ZJS |
2057 | exe = executable('systemd-mount', |
2058 | 'src/mount/mount-tool.c', | |
2059 | include_directories : includes, | |
34ce0a52 | 2060 | link_with : [libshared], |
005a29f2 ZJS |
2061 | install_rpath : rootlibexecdir, |
2062 | install : true) | |
2063 | public_programs += [exe] | |
5c23128d | 2064 | |
7b76fce1 | 2065 | meson.add_install_script(meson_make_symlink, |
e17e5ba9 | 2066 | 'systemd-mount', join_paths(bindir, 'systemd-umount')) |
7b76fce1 | 2067 | |
005a29f2 ZJS |
2068 | exe = executable('systemd-run', |
2069 | 'src/run/run.c', | |
2070 | include_directories : includes, | |
aac26058 | 2071 | link_with : [libshared], |
005a29f2 ZJS |
2072 | install_rpath : rootlibexecdir, |
2073 | install : true) | |
2074 | public_programs += [exe] | |
2075 | ||
2076 | exe = executable('systemd-stdio-bridge', | |
2077 | 'src/stdio-bridge/stdio-bridge.c', | |
2078 | include_directories : includes, | |
aac26058 | 2079 | link_with : [libshared], |
005a29f2 ZJS |
2080 | install_rpath : rootlibexecdir, |
2081 | install : true) | |
2082 | public_programs += [exe] | |
2083 | ||
2084 | exe = executable('busctl', | |
2085 | 'src/busctl/busctl.c', | |
2086 | 'src/busctl/busctl-introspect.c', | |
2087 | 'src/busctl/busctl-introspect.h', | |
2088 | include_directories : includes, | |
aac26058 | 2089 | link_with : [libshared], |
005a29f2 ZJS |
2090 | install_rpath : rootlibexecdir, |
2091 | install : true) | |
2092 | public_programs += [exe] | |
5c23128d | 2093 | |
349cc4a5 | 2094 | if conf.get('ENABLE_SYSUSERS') == 1 |
37efbbd8 ZJS |
2095 | 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] | |
5c23128d ZJS |
2103 | endif |
2104 | ||
349cc4a5 | 2105 | if conf.get('ENABLE_TMPFILES') == 1 |
37efbbd8 ZJS |
2106 | 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] | |
5c23128d ZJS |
2115 | endif |
2116 | ||
349cc4a5 | 2117 | if conf.get('ENABLE_HWDB') == 1 |
37efbbd8 ZJS |
2118 | exe = executable('systemd-hwdb', |
2119 | 'src/hwdb/hwdb.c', | |
2120 | 'src/libsystemd/sd-hwdb/hwdb-internal.h', | |
2121 | include_directories : includes, | |
0da6f396 MB |
2122 | link_with : [libudev_internal], |
2123 | install_rpath : udev_rpath, | |
37efbbd8 ZJS |
2124 | install : true, |
2125 | install_dir : rootbindir) | |
2126 | public_programs += [exe] | |
2127 | endif | |
2128 | ||
349cc4a5 | 2129 | if conf.get('ENABLE_QUOTACHECK') == 1 |
37efbbd8 ZJS |
2130 | executable('systemd-quotacheck', |
2131 | 'src/quotacheck/quotacheck.c', | |
005a29f2 | 2132 | include_directories : includes, |
aac26058 | 2133 | link_with : [libshared], |
005a29f2 ZJS |
2134 | install_rpath : rootlibexecdir, |
2135 | install : true, | |
37efbbd8 | 2136 | install_dir : rootlibexecdir) |
5c23128d ZJS |
2137 | endif |
2138 | ||
005a29f2 ZJS |
2139 | exe = executable('systemd-socket-proxyd', |
2140 | 'src/socket-proxy/socket-proxyd.c', | |
2141 | include_directories : includes, | |
aac26058 | 2142 | link_with : [libshared], |
005a29f2 ZJS |
2143 | dependencies : [threads], |
2144 | install_rpath : rootlibexecdir, | |
2145 | install : true, | |
2146 | install_dir : rootlibexecdir) | |
2147 | public_programs += [exe] | |
2148 | ||
2149 | exe = executable('systemd-udevd', | |
2150 | systemd_udevd_sources, | |
2151 | include_directories : includes, | |
5c72049f | 2152 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
005a29f2 | 2153 | link_with : [libudev_core, |
005a29f2 | 2154 | libsystemd_network, |
1aec3ed9 | 2155 | libudev_internal], |
3a30f21f ZJS |
2156 | dependencies : [threads, |
2157 | libkmod, | |
005a29f2 | 2158 | libidn, |
aac26058 ZJS |
2159 | libacl, |
2160 | libblkid], | |
1aec3ed9 | 2161 | install_rpath : udev_rpath, |
005a29f2 ZJS |
2162 | install : true, |
2163 | install_dir : rootlibexecdir) | |
2164 | public_programs += [exe] | |
2165 | ||
2166 | exe = executable('udevadm', | |
2167 | udevadm_sources, | |
2168 | include_directories : includes, | |
2169 | link_with : [libudev_core, | |
005a29f2 | 2170 | libsystemd_network, |
1aec3ed9 | 2171 | libudev_internal], |
3a30f21f ZJS |
2172 | dependencies : [threads, |
2173 | libkmod, | |
005a29f2 | 2174 | libidn, |
aac26058 ZJS |
2175 | libacl, |
2176 | libblkid], | |
1aec3ed9 | 2177 | install_rpath : udev_rpath, |
005a29f2 ZJS |
2178 | install : true, |
2179 | install_dir : rootbindir) | |
2180 | public_programs += [exe] | |
5c23128d ZJS |
2181 | |
2182 | executable('systemd-shutdown', | |
2183 | systemd_shutdown_sources, | |
2184 | include_directories : includes, | |
34ce0a52 | 2185 | link_with : [libshared], |
421f0012 | 2186 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2187 | install : true, |
2188 | install_dir : rootlibexecdir) | |
2189 | ||
2190 | executable('systemd-update-done', | |
2191 | 'src/update-done/update-done.c', | |
2192 | include_directories : includes, | |
2193 | link_with : [libshared], | |
421f0012 | 2194 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2195 | install : true, |
2196 | install_dir : rootlibexecdir) | |
2197 | ||
2198 | executable('systemd-update-utmp', | |
2199 | 'src/update-utmp/update-utmp.c', | |
2200 | include_directories : includes, | |
aac26058 | 2201 | link_with : [libshared], |
5c23128d | 2202 | dependencies : [libaudit], |
421f0012 | 2203 | install_rpath : rootlibexecdir, |
5c23128d ZJS |
2204 | install : true, |
2205 | install_dir : rootlibexecdir) | |
2206 | ||
349cc4a5 | 2207 | if conf.get('HAVE_KMOD') == 1 |
37efbbd8 ZJS |
2208 | 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) | |
94e75a54 | 2216 | |
37efbbd8 ZJS |
2217 | 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'))) | |
5c23128d ZJS |
2221 | endif |
2222 | ||
005a29f2 ZJS |
2223 | exe = 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')], | |
0bc91152 | 2230 | link_with : [libshared], |
005a29f2 ZJS |
2231 | dependencies : [libacl, |
2232 | libblkid, | |
2233 | libseccomp, | |
2234 | libselinux], | |
2235 | install_rpath : rootlibexecdir, | |
2236 | install : true) | |
2237 | public_programs += [exe] | |
5c23128d | 2238 | |
349cc4a5 | 2239 | if conf.get('ENABLE_NETWORKD') == 1 |
37efbbd8 ZJS |
2240 | executable('systemd-networkd', |
2241 | systemd_networkd_sources, | |
2242 | include_directories : includes, | |
2243 | link_with : [libnetworkd_core, | |
37efbbd8 ZJS |
2244 | libsystemd_network, |
2245 | libudev_internal, | |
2246 | libshared], | |
4b57a272 | 2247 | dependencies : [threads], |
37efbbd8 ZJS |
2248 | install_rpath : rootlibexecdir, |
2249 | install : true, | |
2250 | install_dir : rootlibexecdir) | |
2251 | ||
2252 | 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) | |
5c23128d | 2260 | |
dcfe072a FS |
2261 | exe = executable('networkctl', |
2262 | networkctl_sources, | |
2263 | include_directories : includes, | |
2264 | link_with : [libsystemd_network, | |
aac26058 | 2265 | libshared], |
dcfe072a FS |
2266 | install_rpath : rootlibexecdir, |
2267 | install : true, | |
2268 | install_dir : rootbindir) | |
2269 | public_programs += [exe] | |
2270 | endif | |
69e96427 ZJS |
2271 | ############################################################ |
2272 | ||
2273 | foreach tuple : tests | |
37efbbd8 ZJS |
2274 | 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 | |
2282 | ||
2283 | name = sources[0].split('/')[-1].split('.')[0] | |
2284 | if type.startswith('timeout=') | |
2285 | timeout = type.split('=')[1].to_int() | |
2286 | type = '' | |
2287 | endif | |
2288 | ||
349cc4a5 | 2289 | if condition == '' or conf.get(condition) == 1 |
37efbbd8 ZJS |
2290 | 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, | |
7cdd9783 MB |
2298 | install : install_tests, |
2299 | install_dir : join_paths(testsdir, type)) | |
37efbbd8 ZJS |
2300 | |
2301 | 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 | |
69e96427 ZJS |
2313 | endforeach |
2314 | ||
37ab1a25 | 2315 | test_libsystemd_sym = executable( |
37efbbd8 ZJS |
2316 | 'test-libsystemd-sym', |
2317 | test_libsystemd_sym_c, | |
2318 | include_directories : includes, | |
2319 | link_with : [libsystemd], | |
2320 | install : install_tests, | |
2321 | install_dir : testsdir) | |
37ab1a25 ZJS |
2322 | test('test-libsystemd-sym', |
2323 | test_libsystemd_sym) | |
2324 | ||
e0bec52f | 2325 | test_libudev_sym = executable( |
37efbbd8 ZJS |
2326 | '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) | |
e0bec52f ZJS |
2333 | test('test-libudev-sym', |
2334 | test_libudev_sym) | |
2335 | ||
69e96427 | 2336 | ############################################################ |
5c23128d ZJS |
2337 | |
2338 | make_directive_index_py = find_program('tools/make-directive-index.py') | |
2339 | make_man_index_py = find_program('tools/make-man-index.py') | |
b184e8fe | 2340 | xml_helper_py = find_program('tools/xml_helper.py') |
abba22c5 | 2341 | hwdb_update_sh = find_program('tools/meson-hwdb-update.sh') |
5c23128d ZJS |
2342 | |
2343 | subdir('units') | |
2344 | subdir('sysctl.d') | |
2345 | subdir('sysusers.d') | |
2346 | subdir('tmpfiles.d') | |
2347 | subdir('rules') | |
2348 | subdir('hwdb') | |
2349 | subdir('network') | |
2350 | subdir('man') | |
2351 | subdir('shell-completion/bash') | |
2352 | subdir('shell-completion/zsh') | |
2353 | subdir('docs/sysvinit') | |
2354 | subdir('docs/var-log') | |
2355 | ||
2356 | # FIXME: figure out if the warning is true: | |
2357 | # https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir | |
2358 | install_subdir('factory/etc', | |
2359 | install_dir : factorydir) | |
2360 | ||
2361 | ||
2362 | install_data('xorg/50-systemd-user.sh', | |
2363 | install_dir : xinitrcdir) | |
2364 | install_data('system-preset/90-systemd.preset', | |
2365 | install_dir : systempresetdir) | |
582faeb4 DJL |
2366 | install_data('modprobe.d/systemd.conf', |
2367 | install_dir : modprobedir) | |
5c23128d ZJS |
2368 | install_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) | |
d68b342b | 2377 | |
94e75a54 ZJS |
2378 | meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir)) |
2379 | meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir)) | |
2380 | ||
d68b342b ZJS |
2381 | ############################################################ |
2382 | ||
005a29f2 ZJS |
2383 | meson_check_help = find_program('tools/meson-check-help.sh') |
2384 | ||
2385 | foreach exec : public_programs | |
37efbbd8 ZJS |
2386 | name = exec.full_path().split('/')[-1] |
2387 | test('check-help-' + name, | |
2388 | meson_check_help, | |
2389 | args : [exec.full_path()]) | |
005a29f2 ZJS |
2390 | endforeach |
2391 | ||
2392 | ############################################################ | |
2393 | ||
0700e8ba | 2394 | if git.found() |
37efbbd8 ZJS |
2395 | all_files = run_command( |
2396 | git, | |
450b60ba | 2397 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
37efbbd8 ZJS |
2398 | 'ls-files', |
2399 | ':/*.[ch]']) | |
2400 | all_files = files(all_files.stdout().split()) | |
d68b342b | 2401 | |
e85a690b | 2402 | custom_target( |
0700e8ba | 2403 | 'tags', |
e85a690b | 2404 | output : 'tags', |
450b60ba | 2405 | command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files) |
e85a690b | 2406 | custom_target( |
0700e8ba | 2407 | 'ctags', |
e85a690b | 2408 | output : 'ctags', |
450b60ba | 2409 | command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files) |
d68b342b | 2410 | endif |
177929c2 ZJS |
2411 | |
2412 | if git.found() | |
37efbbd8 | 2413 | meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh') |
a923e085 | 2414 | run_target( |
37efbbd8 | 2415 | 'git-contrib', |
37efbbd8 | 2416 | command : [meson_git_contrib_sh]) |
177929c2 | 2417 | endif |
dd6ab3df ZJS |
2418 | |
2419 | if git.found() | |
2420 | git_head = run_command( | |
2421 | git, | |
450b60ba | 2422 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
dd6ab3df ZJS |
2423 | 'rev-parse', 'HEAD']).stdout().strip() |
2424 | git_head_short = run_command( | |
2425 | git, | |
450b60ba | 2426 | ['--git-dir=@0@/.git'.format(meson.current_source_dir()), |
dd6ab3df ZJS |
2427 | 'rev-parse', '--short=7', 'HEAD']).stdout().strip() |
2428 | ||
2429 | run_target( | |
2430 | 'git-snapshot', | |
2431 | command : ['git', 'archive', | |
450b60ba | 2432 | '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(), |
dd6ab3df ZJS |
2433 | git_head_short), |
2434 | '--prefix', 'systemd-@0@/'.format(git_head), | |
2435 | 'HEAD']) | |
2436 | endif | |
829257d1 ZJS |
2437 | |
2438 | ############################################################ | |
2439 | ||
2440 | status = [ | |
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), | |
582faeb4 | 2454 | 'modprobe.d dir: @0@'.format(modprobedir), |
829257d1 ZJS |
2455 | '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')), | |
4e15a734 | 2468 | 'render group access mode: @0@'.format(get_option('group-render-mode')), |
829257d1 ZJS |
2469 | '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')), | |
5248e7e1 | 2474 | 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)), |
829257d1 ZJS |
2475 | |
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 | ||
2480 | alt_dns_servers = '\n '.join(dns_servers.split(' ')) | |
2481 | alt_ntp_servers = '\n '.join(ntp_servers.split(' ')) | |
2482 | status += [ | |
2483 | 'default DNS servers: @0@'.format(alt_dns_servers), | |
2484 | 'default NTP servers: @0@'.format(alt_ntp_servers)] | |
2485 | ||
2486 | alt_time_epoch = run_command('date', '-Is', '-u', '-d', | |
2487 | '@@0@'.format(time_epoch)).stdout().strip() | |
2488 | status += [ | |
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 | ||
349cc4a5 | 2496 | if conf.get('ENABLE_EFI') == 1 |
829257d1 ZJS |
2497 | 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 | |
2508 | endif | |
2509 | ||
2510 | found = [] | |
2511 | missing = [] | |
2512 | ||
2513 | foreach 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'], | |
d1bf5675 | 2532 | ['idn'], |
87057e24 | 2533 | ['libidn2'], |
829257d1 | 2534 | ['libidn'], |
e7e11bbf | 2535 | ['nss-systemd'], |
829257d1 ZJS |
2536 | ['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'], | |
a7456af5 | 2556 | ['resolve'], |
829257d1 ZJS |
2557 | ['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'], | |
08cf5b8d | 2567 | ['nss-myhostname', conf.get('ENABLE_MYHOSTNAME') == 1], |
829257d1 ZJS |
2568 | ['hwdb'], |
2569 | ['tpm'], | |
2570 | ['man pages', want_man], | |
2571 | ['html pages', want_html], | |
2572 | ['man page indices', want_man and have_lxml], | |
349cc4a5 | 2573 | ['split /usr', conf.get('HAVE_SPLIT_USR') == 1], |
829257d1 ZJS |
2574 | ['SysV compat'], |
2575 | ['utmp'], | |
2576 | ['ldconfig'], | |
2577 | ['hibernate'], | |
2578 | ['adm group', get_option('adm-group')], | |
2579 | ['wheel group', get_option('wheel-group')], | |
b14e1b43 | 2580 | ['gshadow'], |
829257d1 ZJS |
2581 | ['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() | |
349cc4a5 | 2589 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 |
829257d1 ZJS |
2590 | endif |
2591 | if cond | |
2592 | found += [tuple[0]] | |
2593 | else | |
2594 | missing += [tuple[0]] | |
2595 | endif | |
2596 | endforeach | |
2597 | ||
2598 | status += [ | |
9d39c1bf | 2599 | '', |
829257d1 | 2600 | 'enabled features: @0@'.format(', '.join(found)), |
9d39c1bf ZJS |
2601 | '', |
2602 | 'disabled features: @0@'.format(', '.join(missing)), | |
2603 | ''] | |
829257d1 | 2604 | message('\n '.join(status)) |