blob: 5fb90ddea331df6627ba925ece443e1b25865222 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001project('systemd', 'c',
Lennart Poettering43091722017-06-27 23:11:26 +02002 version : '234',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04003 license : 'LGPLv2+',
4 default_options: [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04005 'c_std=gnu99',
6 'prefix=/usr',
7 'sysconfdir=/etc',
8 'localstatedir=/var',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04009 ],
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -040010 meson_version : '>= 0.40',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040011 )
12
13# We need the same data in three different formats, ugh!
14# Also, for hysterical reasons, we use different variable
15# names, sometimes. Not all variables are included in every
16# set. Ugh, ugh, ugh!
17conf = configuration_data()
18conf.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
19conf.set_quoted('PACKAGE_VERSION', meson.project_version())
20
21substs = configuration_data()
22substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
23substs.set('PACKAGE_VERSION', meson.project_version())
24
25m4_defines = []
26
27#####################################################################
28
Zbigniew Jędrzejewski-Szmek003c8872017-07-24 04:41:45 -040029# Try to install the git pre-commit hook
30git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
31if git_hook.returncode() == 0
32 message(git_hook.stdout().strip())
33endif
34
35#####################################################################
36
Zbigniew Jędrzejewski-Szmekab916f22017-04-13 22:15:01 -040037rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040038if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040039 conf.set('HAVE_SPLIT_USR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040040 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040041else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040042 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040043endif
44
45sysvinit_path = get_option('sysvinit-path')
46sysvrcnd_path = get_option('sysvrcnd-path')
47if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040048 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040049 description : 'SysV init scripts and rcN.d links are supported')
50 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040051endif
52
53# join_paths ignore the preceding arguments if an absolute component is
54# encountered, so this should canonicalize various paths when they are
55# absolute or relative.
56prefixdir = get_option('prefix')
57if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040058 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040059endif
60bindir = join_paths(prefixdir, get_option('bindir'))
61libdir = join_paths(prefixdir, get_option('libdir'))
62sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
63includedir = join_paths(prefixdir, get_option('includedir'))
64datadir = join_paths(prefixdir, get_option('datadir'))
65localstatedir = join_paths('/', get_option('localstatedir'))
66
67rootbindir = join_paths(rootprefixdir, 'bin')
68rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
69
70rootlibdir = get_option('rootlibdir')
71if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040072 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040073endif
74
75# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040076pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
77pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
78polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
79polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
80polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
81varlogdir = join_paths(localstatedir, 'log')
82xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040083rpmmacrosdir = get_option('rpmmacrosdir')
Yu Watanabead6fc5b2017-08-03 21:01:38 +090084modprobedir = join_paths(prefixdir, 'lib/modprobe.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040085
86# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040087pkgdatadir = join_paths(datadir, 'systemd')
88environmentdir = join_paths(prefixdir, 'lib/environment.d')
89pkgsysconfdir = join_paths(sysconfdir, 'systemd')
90userunitdir = join_paths(prefixdir, 'lib/systemd/user')
91userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
92tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
93sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
94sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
95binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
96modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
97networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
98pkgincludedir = join_paths(includedir, 'systemd')
99systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
100usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
101systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
102userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
103systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
104systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
105systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
106systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
107udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
108udevhomedir = udevlibexecdir
109udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
110udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
111catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
112kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
113factorydir = join_paths(datadir, 'factory')
114docdir = join_paths(datadir, 'doc/systemd')
115bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
116testsdir = join_paths(prefixdir, 'lib/systemd/tests')
117systemdstatedir = join_paths(localstatedir, 'lib/systemd')
118catalogstatedir = join_paths(systemdstatedir, 'catalog')
119randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400120
121dbuspolicydir = get_option('dbuspolicydir')
122if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400123 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400124endif
125
126dbussessionservicedir = get_option('dbussessionservicedir')
127if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400128 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400129endif
130
131dbussystemservicedir = get_option('dbussystemservicedir')
132if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400133 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400134endif
135
136pamlibdir = get_option('pamlibdir')
137if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400138 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400139endif
140
141pamconfdir = get_option('pamconfdir')
142if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400143 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400144endif
145
146conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400147conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400148conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
149conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
150conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400151conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
152conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400153conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400154conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
155conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400156conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
157conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
158conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
159conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
160conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
161conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
162conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
163conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
164conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400165conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400166conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400167conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
168conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400169conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
170conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
171conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
172conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
173conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
174conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400175conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
176conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400177conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400178conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400179conf.set_quoted('LIBDIR', libdir)
180conf.set_quoted('ROOTLIBDIR', rootlibdir)
181conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
182conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400183conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
184conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
185conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
186conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
187conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
188conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400189
190conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
191conf.set_quoted('ABS_SRC_DIR', meson.source_root())
192
193substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400194substs.set('exec_prefix', prefixdir)
195substs.set('libdir', libdir)
196substs.set('rootlibdir', rootlibdir)
197substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400198substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400199substs.set('bindir', bindir)
200substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400201substs.set('rootlibexecdir', rootlibexecdir)
202substs.set('systemunitdir', systemunitdir)
203substs.set('userunitdir', userunitdir)
204substs.set('systempresetdir', systempresetdir)
205substs.set('userpresetdir', userpresetdir)
206substs.set('udevhwdbdir', udevhwdbdir)
207substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400208substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400209substs.set('catalogdir', catalogdir)
210substs.set('tmpfilesdir', tmpfilesdir)
211substs.set('sysusersdir', sysusersdir)
212substs.set('sysctldir', sysctldir)
213substs.set('binfmtdir', binfmtdir)
214substs.set('modulesloaddir', modulesloaddir)
215substs.set('systemgeneratordir', systemgeneratordir)
216substs.set('usergeneratordir', usergeneratordir)
217substs.set('systemenvgeneratordir', systemenvgeneratordir)
218substs.set('userenvgeneratordir', userenvgeneratordir)
219substs.set('systemshutdowndir', systemshutdowndir)
220substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400221substs.set('VARLOGDIR', varlogdir)
222substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400223substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
224substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400225substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
226substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
227substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
228substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400229
230#####################################################################
231
232cc = meson.get_compiler('c')
233pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400234check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400235
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400236cxx = find_program('c++', required : false)
237if cxx.found()
238 # Used only for tests
239 add_languages('cpp')
240endif
241
Zbigniew Jędrzejewski-Szmek75cf1d62017-07-04 17:59:15 -0400242foreach arg : ['-Wextra',
243 '-Wundef',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400244 '-Wlogical-op',
245 '-Wmissing-include-dirs',
246 '-Wold-style-definition',
247 '-Wpointer-arith',
248 '-Winit-self',
249 '-Wdeclaration-after-statement',
250 '-Wfloat-equal',
251 '-Wsuggest-attribute=noreturn',
252 '-Werror=missing-prototypes',
253 '-Werror=implicit-function-declaration',
254 '-Werror=missing-declarations',
255 '-Werror=return-type',
256 '-Werror=incompatible-pointer-types',
257 '-Werror=format=2',
258 '-Wstrict-prototypes',
259 '-Wredundant-decls',
260 '-Wmissing-noreturn',
261 '-Wshadow',
262 '-Wendif-labels',
263 '-Wstrict-aliasing=2',
264 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400265 '-Werror=overflow',
266 '-Wdate-time',
267 '-Wnested-externs',
268 '-ffast-math',
269 '-fno-common',
270 '-fdiagnostics-show-option',
271 '-fno-strict-aliasing',
272 '-fvisibility=hidden',
273 '-fstack-protector',
274 '-fstack-protector-strong',
275 '-fPIE',
276 '--param=ssp-buffer-size=4',
277 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400278 if cc.has_argument(arg)
279 add_project_arguments(arg, language : 'c')
280 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400281endforeach
282
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400283# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
284# arguments, just emits a warnings. So test for the "positive" version instead.
285foreach arg : ['unused-parameter',
286 'missing-field-initializers',
287 'unused-result',
Zbigniew Jędrzejewski-Szmekfb1b5882017-09-04 19:49:12 +0300288 'format-signedness',
289 'error=nonnull', # work-around for gcc 7.1 turning this on on its own
290 ]
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400291 if cc.has_argument('-W' + arg)
292 add_project_arguments('-Wno-' + arg, language : 'c')
293 endif
294endforeach
295
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400296if cc.compiles('
297 #include <time.h>
298 #include <inttypes.h>
299 typedef uint64_t usec_t;
300 usec_t now(clockid_t clock);
301 int main(void) {
302 struct timespec now;
303 return 0;
304 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400305', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400306 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400307endif
308
309if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400310 foreach arg : ['-Wno-typedef-redefinition',
311 '-Wno-gnu-variable-sized-type-not-at-end',
312 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400313 if cc.has_argument(arg,
314 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400315 add_project_arguments(arg, language : 'c')
316 endif
317 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400318endif
319
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400320link_test_c = files('tools/meson-link-test.c')
321
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400322# --as-needed and --no-undefined are provided by meson by default,
323# run mesonconf to see what is enabled
324foreach arg : ['-Wl,-z,relro',
325 '-Wl,-z,now',
326 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400327 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400328
329 have = run_command(check_compilation_sh,
330 cc.cmd_array(), '-x', 'c', arg,
331 '-include', link_test_c).returncode() == 0
332 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
333 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400334 add_project_link_arguments(arg, language : 'c')
335 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400336endforeach
337
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400338if get_option('buildtype') != 'debug'
339 foreach arg : ['-ffunction-sections',
340 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400341 if cc.has_argument(arg,
342 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400343 add_project_arguments(arg, language : 'c')
344 endif
345 endforeach
346
347 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400348 have = run_command(check_compilation_sh,
349 cc.cmd_array(), '-x', 'c', arg,
350 '-include', link_test_c).returncode() == 0
351 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
352 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400353 add_project_link_arguments(arg, language : 'c')
354 endif
355 endforeach
356endif
357
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400358cpp = ' '.join(cc.cmd_array()) + ' -E'
359
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400360#####################################################################
361# compilation result tests
362
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400363conf.set('_GNU_SOURCE', true)
364conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400365
366conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
367conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
368conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
369conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
370conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
371conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
372conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
373
374decl_headers = '''
375#include <uchar.h>
376#include <linux/ethtool.h>
377'''
378# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
379
380foreach decl : ['char16_t',
381 'char32_t',
382 'key_serial_t',
383 'struct ethtool_link_settings',
384 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400385
386 # We get -1 if the size cannot be determined
387 have = cc.sizeof(decl, prefix : decl_headers) > 0
388 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400389endforeach
390
391foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
392 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
393 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
394 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
395 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
396 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
397 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
398 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
399 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
400 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530401 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400402 # if_tunnel.h is buggy and cannot be included on its own
403 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
404 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
405 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
406 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
407 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
408 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
409 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
410 ['NDA_IFINDEX', 'linux/neighbour.h'],
411 ['IFA_FLAGS', 'linux/if_addr.h'],
412 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
413 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400414 prefix = decl.length() > 2 ? decl[2] : ''
415 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
416 conf.set10('HAVE_DECL_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400417endforeach
418
419skip = false
420foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400421 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400422 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400423 skip = true
424 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400425endforeach
426
427foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400428 ['memfd_create', '''#include <sys/memfd.h>'''],
429 ['gettid', '''#include <sys/types.h>'''],
430 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
431 ['name_to_handle_at', '''#define _GNU_SOURCE
432 #include <sys/types.h>
433 #include <sys/stat.h>
434 #include <fcntl.h>'''],
435 ['setns', '''#define _GNU_SOURCE
436 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400437 ['renameat2', '''#include <stdio.h>'''],
438 ['kcmp', '''#include <linux/kcmp.h>'''],
439 ['keyctl', '''#include <sys/types.h>
440 #include <keyutils.h>'''],
441 ['copy_file_range', '''#include <sys/syscall.h>
442 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400443 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400444]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400445
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400446 have = cc.has_function(ident[0], prefix : ident[1])
447 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400448endforeach
449
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400450if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400451 conf.set('USE_SYS_RANDOM_H', true)
452 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400453else
454 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
455 conf.set10('HAVE_DECL_GETRANDOM', have)
456endif
457
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400458#####################################################################
459
460sed = find_program('sed')
461grep = find_program('grep')
462awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400463m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400464stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400465git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400466
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400467meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400468mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400469test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
470splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400471
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400472# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
473# /usr/sbin, /sbin, and fall back to the default from middle column.
474progs = [['telinit', '/lib/sysvinit/telinit'],
475 ['quotaon', '/usr/sbin/quotaon' ],
476 ['quotacheck', '/usr/sbin/quotacheck' ],
477 ['kill', '/usr/bin/kill' ],
478 ['kmod', '/usr/bin/kmod' ],
479 ['kexec', '/usr/sbin/kexec' ],
480 ['sulogin', '/usr/sbin/sulogin' ],
481 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
482 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
483 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
484 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
485 ]
486foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400487 path = get_option(prog[0] + '-path')
488 if path != ''
489 message('Using @1@ for @0@'.format(prog[0], path))
490 else
491 exe = find_program(prog[0],
492 '/usr/sbin/' + prog[0],
493 '/sbin/' + prog[0],
494 required: false)
495 path = exe.found() ? exe.path() : prog[1]
496 endif
497 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
498 conf.set_quoted(name, path)
499 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400500endforeach
501
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400502if run_command('ln', '--relative', '--help').returncode() != 0
503 error('ln does not support --relative')
504endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400505
506############################################################
507
508gperf = find_program('gperf')
509
510gperf_test_format = '''
511#include <string.h>
512const char * in_word_set(const char *, @0@);
513@1@
514'''
515gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
516gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
517gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
518if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400519 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400520else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400521 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
522 if cc.compiles(gperf_test)
523 gperf_len_type = 'unsigned'
524 else
525 error('unable to determine gperf len type')
526 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400527endif
528message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400529conf.set('GPERF_LEN_TYPE', gperf_len_type,
530 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400531
532############################################################
533
534if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400535 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400536endif
537foreach header : ['linux/btrfs.h',
538 'linux/memfd.h',
539 'linux/vm_sockets.h',
540 'valgrind/memcheck.h',
541 'valgrind/valgrind.h',
542 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400543
544 conf.set('HAVE_' + header.underscorify().to_upper(),
545 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400546endforeach
547
548############################################################
549
550conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -0400551conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
552gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400553
554default_hierarchy = get_option('default-hierarchy')
555conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
556 description : 'default cgroup hierarchy as string')
557if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400558 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400559elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400560 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400561else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400562 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400563endif
564
565time_epoch = get_option('time-epoch')
566if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400567 NEWS = files('NEWS')
568 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400569endif
570time_epoch = time_epoch.to_int()
571conf.set('TIME_EPOCH', time_epoch)
572
573system_uid_max = get_option('system-uid-max')
574if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400575 system_uid_max = run_command(
576 awk,
577 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
578 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400579endif
580system_uid_max = system_uid_max.to_int()
581conf.set('SYSTEM_UID_MAX', system_uid_max)
582substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400583message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400584
585conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
586conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
587
588system_gid_max = get_option('system-gid-max')
589if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400590 system_gid_max = run_command(
591 awk,
592 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
593 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400594endif
595system_gid_max = system_gid_max.to_int()
596conf.set('SYSTEM_GID_MAX', system_gid_max)
597substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400598message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400599
600tty_gid = get_option('tty-gid')
601conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400602substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400603
604if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400605 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400606endif
607
608if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400609 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400610endif
611
612substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
613
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400614kill_user_processes = get_option('default-kill-user-processes')
615conf.set10('KILL_USER_PROCESSES', kill_user_processes)
616substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400617
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400618dns_servers = get_option('dns-servers')
619conf.set_quoted('DNS_SERVERS', dns_servers)
620substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400621
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400622ntp_servers = get_option('ntp-servers')
623conf.set_quoted('NTP_SERVERS', ntp_servers)
624substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400625
626conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
627
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400628substs.set('SUSHELL', get_option('debug-shell'))
629substs.set('DEBUGTTY', get_option('debug-tty'))
630
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400631debug = get_option('debug')
632if debug != ''
633 foreach name : debug.split(',')
634 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400635 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400636 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400637 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400638 else
639 message('unknown debug option "@0@", ignoring'.format(name))
640 endif
641 endforeach
642endif
643
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400644#####################################################################
645
646threads = dependency('threads')
647librt = cc.find_library('rt')
648libm = cc.find_library('m')
649libdl = cc.find_library('dl')
650libcrypt = cc.find_library('crypt')
651
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400652libcap = dependency('libcap', required : false)
653if not libcap.found()
654 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
655 libcap = cc.find_library('cap')
656endif
657
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400658libmount = dependency('mount',
659 version : '>= 2.27')
660
661want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400662if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400663 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400664 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400665 required : want_seccomp == 'true')
666 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400667 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400668 m4_defines += ['-DHAVE_SECCOMP']
669 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400670else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400671 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400672endif
673
674want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400675if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400676 libselinux = dependency('libselinux',
677 version : '>= 2.1.9',
678 required : want_selinux == 'true')
679 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400680 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400681 m4_defines += ['-DHAVE_SELINUX']
682 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400683else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400684 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400685endif
686
687want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400688if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400689 libapparmor = dependency('libapparmor',
690 required : want_apparmor == 'true')
691 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400692 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400693 m4_defines += ['-DHAVE_APPARMOR']
694 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400695else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400696 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400697endif
698
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400699smack_run_label = get_option('smack-run-label')
700if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400701 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
702 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400703endif
704
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400705want_polkit = get_option('polkit')
706install_polkit = false
707install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400708if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400709 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400710 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400711
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400712 libpolkit = dependency('polkit-gobject-1',
713 required : false)
714 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
715 message('Old polkit detected, will install pkla files')
716 install_polkit_pkla = true
717 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400718endif
719
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400720want_acl = get_option('acl')
721if want_acl != 'false'
722 libacl = cc.find_library('acl', required : want_acl == 'true')
723 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400724 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400725 m4_defines += ['-DHAVE_ACL']
726 endif
727else
728 libacl = []
729endif
730
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400731want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400732if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400733 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400734 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400735else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400736 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400737endif
738
739want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400740if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400741 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400742 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400743else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400744 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400745endif
746
747want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400748if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400749 libkmod = dependency('libkmod',
750 version : '>= 15',
751 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400752 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400753else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400754 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400755endif
756
757want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400758if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400759 libpam = cc.find_library('pam', required : want_pam == 'true')
760 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
761 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400762 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400763 m4_defines += ['-DHAVE_PAM']
764 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400765else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400766 libpam = []
767 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400768endif
769
770want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400771if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400772 libmicrohttpd = dependency('libmicrohttpd',
773 version : '>= 0.9.33',
774 required : want_microhttpd == 'true')
775 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400776 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400777 m4_defines += ['-DHAVE_MICROHTTPD']
778 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400779else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400780 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400781endif
782
783want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400784if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400785 libcryptsetup = dependency('libcryptsetup',
786 version : '>= 1.6.0',
787 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400788 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400789else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400790 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400791endif
792
793want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400794if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400795 libcurl = dependency('libcurl',
796 version : '>= 7.32.0',
797 required : want_libcurl == 'true')
798 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400799 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400800 m4_defines += ['-DHAVE_LIBCURL']
801 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400802else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400803 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400804endif
805
806want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400807want_libidn2 = get_option('libidn2')
808if want_libidn == 'true' and want_libidn2 == 'true'
809 error('libidn and libidn2 cannot be requested simultaneously')
810endif
811
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400812if want_libidn != 'false' and want_libidn2 != 'true'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400813 libidn = dependency('libidn',
814 required : want_libidn == 'true')
815 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400816 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400817 m4_defines += ['-DHAVE_LIBIDN']
818 endif
Zbigniew Jędrzejewski-Szmek7f7ab222017-07-12 03:25:59 -0400819else
820 libidn = []
821endif
822if not conf.get('HAVE_LIBIDN', false) and want_libidn2 != 'false'
823 # libidn is used for both libidn and libidn2 objects
824 libidn = dependency('libidn2',
825 required : want_libidn2 == 'true')
826 if libidn.found()
827 conf.set('HAVE_LIBIDN2', true)
828 m4_defines += ['-DHAVE_LIBIDN2']
829 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400830endif
831
832want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400833if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400834 libiptc = dependency('libiptc',
835 required : want_libiptc == 'true')
836 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400837 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400838 m4_defines += ['-DHAVE_LIBIPTC']
839 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400840else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400841 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400842endif
843
844want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400845if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400846 libqrencode = dependency('libqrencode',
847 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400848 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400849else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400850 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400851endif
852
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400853want_gcrypt = get_option('gcrypt')
854if want_gcrypt != 'false'
855 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
856 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
857
858 have_deps = libgcrypt.found() and libgpg_error.found()
859 conf.set('HAVE_GCRYPT', have_deps)
860 if not have_deps
861 # link to neither of the libs if one is not found
862 libgcrypt = []
863 libgpg_error = []
864 endif
865else
866 libgcrypt = []
867 libgpg_error = []
868endif
869
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400870want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400871if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400872 libgnutls = dependency('gnutls',
873 version : '>= 3.1.4',
874 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400875 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400876else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400877 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400878endif
879
880want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400881if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400882 libdw = dependency('libdw',
883 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400884 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400885else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400886 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400887endif
888
889want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400890if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400891 libz = dependency('zlib',
892 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400893 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400894else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400895 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400896endif
897
898want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400899if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400900 libbzip2 = cc.find_library('bz2',
901 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400902 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400903else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400904 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400905endif
906
907want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400908if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400909 libxz = dependency('liblzma',
910 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400911 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400912else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400913 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400914endif
915
916want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400917if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400918 liblz4 = dependency('liblz4',
919 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400920 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400921else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400922 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400923endif
924
Zbigniew Jędrzejewski-Szmeka44fb602017-07-26 14:08:46 -0400925want_xkbcommon = get_option('xkbcommon')
926if want_xkbcommon != 'false'
927 libxkbcommon = dependency('xkbcommon',
928 version : '>= 0.3.0',
929 required : want_xkbcommon == 'true')
930 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
931else
932 libxkbcommon = []
933endif
934
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400935want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400936if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400937 libglib = dependency('glib-2.0',
938 version : '>= 2.22.0',
939 required : want_glib == 'true')
940 libgobject = dependency('gobject-2.0',
941 version : '>= 2.22.0',
942 required : want_glib == 'true')
943 libgio = dependency('gio-2.0',
944 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400945 have = libglib.found() and libgobject.found() and libgio.found()
946 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400947else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400948 libglib = []
949 libgobject = []
950 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400951endif
952
953want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400954if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400955 libdbus = dependency('dbus-1',
956 version : '>= 1.3.2',
957 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400958 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400959else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400960 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400961endif
962
Yu Watanabe42303dc2017-06-18 05:22:32 +0900963default_dnssec = get_option('default-dnssec')
964if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
965 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
966 default_dnssec = 'no'
967endif
968conf.set('DEFAULT_DNSSEC_MODE',
969 'DNSSEC_' + default_dnssec.underscorify().to_upper())
970substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
971
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400972want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400973if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400974 have_deps = (conf.get('HAVE_LIBCURL', false) and
975 conf.get('HAVE_ZLIB', false) and
976 conf.get('HAVE_BZIP2', false) and
977 conf.get('HAVE_XZ', false) and
978 conf.get('HAVE_GCRYPT', false))
979 conf.set('ENABLE_IMPORTD', have_deps)
980 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400981 error('importd support was requested, but dependencies are not available')
982 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400983endif
984
985want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400986if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400987 have_deps = [conf.get('HAVE_MICROHTTPD', false),
988 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400989 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
990 # it's possible to build one without the other. Complain only if
991 # support was explictly requested. The auxiliary files like sysusers
992 # config should be installed when any of the programs are built.
993 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
994 error('remote support was requested, but dependencies are not available')
995 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400996 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400997endif
998
999foreach pair : [['utmp', 'HAVE_UTMP'],
1000 ['hibernate', 'ENABLE_HIBERNATE'],
1001 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
1002 ['binfmt', 'ENABLE_BINFMT'],
1003 ['coredump', 'ENABLE_COREDUMP'],
1004 ['resolve', 'ENABLE_RESOLVED'],
1005 ['logind', 'ENABLE_LOGIND'],
1006 ['hostnamed', 'ENABLE_HOSTNAMED'],
1007 ['localed', 'ENABLE_LOCALED'],
1008 ['machined', 'ENABLE_MACHINED'],
1009 ['networkd', 'ENABLE_NETWORKD'],
1010 ['timedated', 'ENABLE_TIMEDATED'],
1011 ['timesyncd', 'ENABLE_TIMESYNCD'],
1012 ['myhostname', 'HAVE_MYHOSTNAME'],
1013 ['firstboot', 'ENABLE_FIRSTBOOT'],
1014 ['randomseed', 'ENABLE_RANDOMSEED'],
1015 ['backlight', 'ENABLE_BACKLIGHT'],
1016 ['vconsole', 'ENABLE_VCONSOLE'],
1017 ['quotacheck', 'ENABLE_QUOTACHECK'],
1018 ['sysusers', 'ENABLE_SYSUSERS'],
1019 ['tmpfiles', 'ENABLE_TMPFILES'],
1020 ['hwdb', 'ENABLE_HWDB'],
1021 ['rfkill', 'ENABLE_RFKILL'],
1022 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001023 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek18b9ad12017-07-13 09:31:47 -04001024 ['tpm', 'ENABLE_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001025 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001026 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001027 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001028 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001029 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001030 ]
1031
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001032 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001033 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001034 m4_defines += ['-D' + pair[1]]
1035 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001036endforeach
1037
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001038want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001039install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001040tests = []
1041
Zbigniew Jędrzejewski-Szmek00d82c82017-07-12 21:25:17 +00001042conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', get_option('slow-tests'))
1043
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001044#####################################################################
1045
1046if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001047 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001048
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001049 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001050 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001051 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001052 elif efi_arch == 'x86_64'
1053 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001054 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001055 elif efi_arch == 'arm'
1056 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001057 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001058 elif efi_arch == 'aarch64'
1059 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001060 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001061 else
1062 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001063 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001064 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001065
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001066 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001067 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001068
1069 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001070endif
1071
1072#####################################################################
1073
1074config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001075 output : 'config.h',
1076 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001077
1078includes = include_directories('src/basic',
1079 'src/shared',
1080 'src/systemd',
1081 'src/journal',
1082 'src/resolve',
1083 'src/timesync',
1084 'src/login',
1085 'src/udev',
1086 'src/libudev',
1087 'src/core',
1088 'src/libsystemd/sd-bus',
1089 'src/libsystemd/sd-device',
1090 'src/libsystemd/sd-hwdb',
1091 'src/libsystemd/sd-id128',
1092 'src/libsystemd/sd-netlink',
1093 'src/libsystemd/sd-network',
1094 'src/libsystemd-network',
Davide Cavalca5e1771a2017-08-30 08:34:44 -07001095 '.',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001096 )
1097
1098add_project_arguments('-include', 'config.h', language : 'c')
1099
1100gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1101 'src/shared/gcrypt-util.c')
1102
1103subdir('po')
1104subdir('catalog')
1105subdir('src/systemd')
1106subdir('src/basic')
1107subdir('src/libsystemd')
1108subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001109subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001110subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001111
1112libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001113 'journal-core',
1114 libjournal_core_sources,
1115 journald_gperf_c,
1116 include_directories : includes,
1117 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001118
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001119libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001120libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001121 'systemd',
1122 libsystemd_internal_sources,
1123 journal_internal_sources,
Lennart Poettering43091722017-06-27 23:11:26 +02001124 version : '0.19.0',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001125 include_directories : includes,
1126 link_args : ['-shared',
1127 '-Wl,--version-script=' + libsystemd_sym_path],
1128 link_with : [libbasic],
1129 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001130 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001131 librt,
1132 libxz,
1133 liblz4],
1134 link_depends : libsystemd_sym,
1135 install : true,
1136 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001137
1138############################################################
1139
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001140# binaries that have --help and are intended for use by humans,
1141# usually, but not always, installed in /bin.
1142public_programs = []
1143
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001144subdir('src/libudev')
1145subdir('src/shared')
1146subdir('src/core')
1147subdir('src/udev')
1148subdir('src/network')
1149
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001150subdir('src/analyze')
1151subdir('src/journal-remote')
1152subdir('src/coredump')
1153subdir('src/hostname')
1154subdir('src/import')
1155subdir('src/kernel-install')
1156subdir('src/locale')
1157subdir('src/machine')
1158subdir('src/nspawn')
1159subdir('src/resolve')
1160subdir('src/timedate')
1161subdir('src/timesync')
1162subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001163subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001164subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001165
1166subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001167subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001168
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001169############################################################
1170
1171# only static linking apart from libdl, to make sure that the
1172# module is linked to all libraries that it uses.
1173test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001174 'test-dlopen',
1175 test_dlopen_c,
1176 include_directories : includes,
1177 link_with : [libbasic],
1178 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001179
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001180foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001181 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001182 ['mymachines', 'ENABLE_MACHINED'],
1183 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001184
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001185 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001186 if condition
1187 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001188
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001189 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1190 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001191
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001192 nss = shared_library(
1193 'nss_' + module,
1194 'src/nss-@0@/nss-@0@.c'.format(module),
1195 version : '2',
1196 include_directories : includes,
1197 link_args : ['-shared',
1198 '-Wl,--version-script=' + version_script_arg,
1199 '-Wl,--undefined'],
1200 link_with : [libsystemd_internal,
1201 libbasic],
1202 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001203 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001204 link_depends : sym,
1205 install : true,
1206 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001207
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001208 # We cannot use shared_module because it does not support version suffix.
1209 # Unfortunately shared_library insists on creating the symlink…
1210 meson.add_install_script('sh', '-c',
1211 'rm $DESTDIR@0@/libnss_@1@.so'
1212 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001213
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001214 test('dlopen-nss_' + module,
1215 test_dlopen,
1216 args : [nss.full_path()]) # path to dlopen must include a slash
1217 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001218endforeach
1219
1220############################################################
1221
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001222executable('systemd',
1223 systemd_sources,
1224 include_directories : includes,
1225 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001226 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001227 dependencies : [threads,
1228 librt,
1229 libseccomp,
1230 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001231 libmount,
1232 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001233 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001234 install : true,
1235 install_dir : rootlibexecdir)
1236
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001237exe = executable('systemd-analyze',
1238 systemd_analyze_sources,
1239 include_directories : includes,
1240 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001241 libshared],
1242 dependencies : [threads,
1243 librt,
1244 libseccomp,
1245 libselinux,
1246 libmount,
1247 libblkid],
1248 install_rpath : rootlibexecdir,
1249 install : true)
1250public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001251
1252executable('systemd-journald',
1253 systemd_journald_sources,
1254 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001255 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001256 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001257 dependencies : [threads,
1258 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001259 liblz4,
1260 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001261 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001262 install : true,
1263 install_dir : rootlibexecdir)
1264
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001265exe = executable('systemd-cat',
1266 systemd_cat_sources,
1267 include_directories : includes,
1268 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001269 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001270 dependencies : [threads],
1271 install_rpath : rootlibexecdir,
1272 install : true)
1273public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001274
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001275exe = executable('journalctl',
1276 journalctl_sources,
1277 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001278 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001279 dependencies : [threads,
1280 libqrencode,
1281 libxz,
1282 liblz4],
1283 install_rpath : rootlibexecdir,
1284 install : true,
1285 install_dir : rootbindir)
1286public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001287
1288executable('systemd-getty-generator',
1289 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001290 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001291 link_with : [libshared],
1292 install_rpath : rootlibexecdir,
1293 install : true,
1294 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001295
1296executable('systemd-debug-generator',
1297 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001298 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001299 link_with : [libshared],
1300 install_rpath : rootlibexecdir,
1301 install : true,
1302 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001303
1304executable('systemd-fstab-generator',
1305 'src/fstab-generator/fstab-generator.c',
1306 'src/core/mount-setup.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001307 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001308 link_with : [libshared],
1309 install_rpath : rootlibexecdir,
1310 install : true,
1311 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001312
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001313if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001314 executable('30-systemd-environment-d-generator',
1315 'src/environment-d-generator/environment-d-generator.c',
1316 include_directories : includes,
1317 link_with : [libshared],
1318 install_rpath : rootlibexecdir,
1319 install : true,
1320 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001321
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001322 meson.add_install_script(meson_make_symlink,
1323 join_paths(sysconfdir, 'environment'),
1324 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001325endif
1326
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001327if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001328 executable('systemd-hibernate-resume-generator',
1329 'src/hibernate-resume/hibernate-resume-generator.c',
1330 include_directories : includes,
1331 link_with : [libshared],
1332 install_rpath : rootlibexecdir,
1333 install : true,
1334 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001335
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001336 executable('systemd-hibernate-resume',
1337 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001338 include_directories : includes,
1339 link_with : [libshared],
1340 install_rpath : rootlibexecdir,
1341 install : true,
1342 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001343endif
1344
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001345if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001346 executable('systemd-gpt-auto-generator',
1347 'src/gpt-auto-generator/gpt-auto-generator.c',
1348 'src/basic/blkid-util.h',
1349 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001350 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001351 dependencies : libblkid,
1352 install_rpath : rootlibexecdir,
1353 install : true,
1354 install_dir : systemgeneratordir)
1355
1356 exe = executable('systemd-dissect',
1357 'src/dissect/dissect.c',
1358 include_directories : includes,
1359 link_with : [libshared],
1360 install_rpath : rootlibexecdir,
1361 install : true,
1362 install_dir : rootlibexecdir)
1363 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001364endif
1365
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001366if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001367 executable('systemd-resolved',
1368 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001369 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001370 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001371 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001372 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001373 libgcrypt,
1374 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001375 libm,
1376 libidn],
1377 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001378 install : true,
1379 install_dir : rootlibexecdir)
1380
1381 exe = executable('systemd-resolve',
1382 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001383 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001384 include_directories : includes,
1385 link_with : [libshared],
1386 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001387 libgcrypt,
1388 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001389 libm,
1390 libidn],
1391 install_rpath : rootlibexecdir,
1392 install : true)
1393 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001394endif
1395
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001396if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001397 executable('systemd-logind',
1398 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001399 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001400 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001401 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001402 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001403 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001404 install_rpath : rootlibexecdir,
1405 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001406 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001407
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001408 exe = executable('loginctl',
1409 loginctl_sources,
1410 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001411 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001412 dependencies : [threads,
1413 liblz4,
1414 libxz],
1415 install_rpath : rootlibexecdir,
1416 install : true,
1417 install_dir : rootbindir)
1418 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001419
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001420 exe = executable('systemd-inhibit',
1421 'src/login/inhibit.c',
1422 include_directories : includes,
1423 link_with : [libshared],
1424 install_rpath : rootlibexecdir,
1425 install : true,
1426 install_dir : rootbindir)
1427 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001428
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001429 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001430 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1431 pam_systemd = shared_library(
1432 'pam_systemd',
1433 pam_systemd_c,
1434 name_prefix : '',
1435 include_directories : includes,
1436 link_args : ['-shared',
1437 '-Wl,--version-script=' + version_script_arg],
1438 link_with : [libsystemd_internal,
1439 libshared_static],
1440 dependencies : [threads,
1441 libpam,
1442 libpam_misc],
1443 link_depends : pam_systemd_sym,
1444 install : true,
1445 install_dir : pamlibdir)
1446
1447 test('dlopen-pam_systemd',
1448 test_dlopen,
1449 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1450 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001451endif
1452
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001453if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001454 executable('systemd-user-sessions',
1455 'src/user-sessions/user-sessions.c',
1456 include_directories : includes,
1457 link_with : [libshared],
1458 install_rpath : rootlibexecdir,
1459 install : true,
1460 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001461endif
1462
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001463if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001464 exe = executable('bootctl',
1465 'src/boot/bootctl.c',
1466 include_directories : includes,
1467 link_with : [libshared],
1468 dependencies : [libblkid],
1469 install_rpath : rootlibexecdir,
1470 install : true)
1471 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001472endif
1473
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001474exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1475 include_directories : includes,
1476 link_with : [libshared],
1477 dependencies : [threads],
1478 install_rpath : rootlibexecdir,
1479 install : true)
1480public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001481
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001482exe = executable('systemctl', 'src/systemctl/systemctl.c',
1483 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001484 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001485 dependencies : [threads,
1486 libcap,
1487 libselinux,
1488 libxz,
1489 liblz4],
1490 install_rpath : rootlibexecdir,
1491 install : true,
1492 install_dir : rootbindir)
1493public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001494
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001495if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001496 executable('systemd-backlight',
1497 'src/backlight/backlight.c',
1498 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001499 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001500 install_rpath : rootlibexecdir,
1501 install : true,
1502 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001503endif
1504
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001505if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001506 executable('systemd-rfkill',
1507 'src/rfkill/rfkill.c',
1508 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001509 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001510 install_rpath : rootlibexecdir,
1511 install : true,
1512 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001513endif
1514
1515executable('systemd-system-update-generator',
1516 'src/system-update-generator/system-update-generator.c',
1517 include_directories : includes,
1518 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001519 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001520 install : true,
1521 install_dir : systemgeneratordir)
1522
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001523if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001524 executable('systemd-cryptsetup',
1525 'src/cryptsetup/cryptsetup.c',
1526 include_directories : includes,
1527 link_with : [libshared],
1528 dependencies : [libcryptsetup],
1529 install_rpath : rootlibexecdir,
1530 install : true,
1531 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001532
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001533 executable('systemd-cryptsetup-generator',
1534 'src/cryptsetup/cryptsetup-generator.c',
1535 include_directories : includes,
1536 link_with : [libshared],
1537 dependencies : [libcryptsetup],
1538 install_rpath : rootlibexecdir,
1539 install : true,
1540 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001541
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001542 executable('systemd-veritysetup',
1543 'src/veritysetup/veritysetup.c',
1544 include_directories : includes,
1545 link_with : [libshared],
1546 dependencies : [libcryptsetup],
1547 install_rpath : rootlibexecdir,
1548 install : true,
1549 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001550
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001551 executable('systemd-veritysetup-generator',
1552 'src/veritysetup/veritysetup-generator.c',
1553 include_directories : includes,
1554 link_with : [libshared],
1555 dependencies : [libcryptsetup],
1556 install_rpath : rootlibexecdir,
1557 install : true,
1558 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001559endif
1560
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001561if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001562 executable('systemd-sysv-generator',
1563 'src/sysv-generator/sysv-generator.c',
1564 include_directories : includes,
1565 link_with : [libshared],
1566 install_rpath : rootlibexecdir,
1567 install : true,
1568 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001569
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001570 executable('systemd-rc-local-generator',
1571 'src/rc-local-generator/rc-local-generator.c',
1572 include_directories : includes,
1573 link_with : [libshared],
1574 install_rpath : rootlibexecdir,
1575 install : true,
1576 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001577endif
1578
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001579if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001580 executable('systemd-hostnamed',
1581 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001582 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001583 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001584 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001585 install : true,
1586 install_dir : rootlibexecdir)
1587
1588 exe = executable('hostnamectl',
1589 'src/hostname/hostnamectl.c',
1590 include_directories : includes,
1591 link_with : [libshared],
1592 install_rpath : rootlibexecdir,
1593 install : true)
1594 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001595endif
1596
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001597if conf.get('ENABLE_LOCALED', false)
1598 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001599 # logind will load libxkbcommon.so dynamically on its own
1600 deps = [libdl]
1601 else
1602 deps = []
1603 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001604
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001605 executable('systemd-localed',
1606 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001607 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001608 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001609 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001610 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001611 install : true,
1612 install_dir : rootlibexecdir)
1613
1614 exe = executable('localectl',
1615 localectl_sources,
1616 include_directories : includes,
1617 link_with : [libshared],
1618 install_rpath : rootlibexecdir,
1619 install : true)
1620 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001621endif
1622
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001623if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001624 executable('systemd-timedated',
1625 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001626 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001627 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001628 install_rpath : rootlibexecdir,
1629 install : true,
1630 install_dir : rootlibexecdir)
1631
1632 exe = executable('timedatectl',
1633 'src/timedate/timedatectl.c',
1634 include_directories : includes,
1635 install_rpath : rootlibexecdir,
1636 link_with : [libshared],
1637 install : true)
1638 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001639endif
1640
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001641if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001642 executable('systemd-timesyncd',
1643 systemd_timesyncd_sources,
1644 include_directories : includes,
1645 link_with : [libshared],
1646 dependencies : [threads,
1647 libm],
1648 install_rpath : rootlibexecdir,
1649 install : true,
1650 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001651endif
1652
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001653if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001654 executable('systemd-machined',
1655 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001656 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001657 link_with : [libmachine_core,
1658 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001659 install_rpath : rootlibexecdir,
1660 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001661 install_dir : rootlibexecdir)
1662
1663 exe = executable('machinectl',
1664 'src/machine/machinectl.c',
1665 include_directories : includes,
1666 link_with : [libshared],
1667 dependencies : [threads,
1668 libxz,
1669 liblz4],
1670 install_rpath : rootlibexecdir,
1671 install : true,
1672 install_dir : rootbindir)
1673 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001674endif
1675
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001676if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001677 executable('systemd-importd',
1678 systemd_importd_sources,
1679 include_directories : includes,
1680 link_with : [libshared],
1681 dependencies : [threads],
1682 install_rpath : rootlibexecdir,
1683 install : true,
1684 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001685
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001686 systemd_pull = executable('systemd-pull',
1687 systemd_pull_sources,
1688 include_directories : includes,
1689 link_with : [libshared],
1690 dependencies : [libcurl,
1691 libz,
1692 libbzip2,
1693 libxz,
1694 libgcrypt],
1695 install_rpath : rootlibexecdir,
1696 install : true,
1697 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001698
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001699 systemd_import = executable('systemd-import',
1700 systemd_import_sources,
1701 include_directories : includes,
1702 link_with : [libshared],
1703 dependencies : [libcurl,
1704 libz,
1705 libbzip2,
1706 libxz],
1707 install_rpath : rootlibexecdir,
1708 install : true,
1709 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001710
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001711 systemd_export = executable('systemd-export',
1712 systemd_export_sources,
1713 include_directories : includes,
1714 link_with : [libshared],
1715 dependencies : [libcurl,
1716 libz,
1717 libbzip2,
1718 libxz],
1719 install_rpath : rootlibexecdir,
1720 install : true,
1721 install_dir : rootlibexecdir)
1722 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001723endif
1724
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001725if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001726 exe = executable('systemd-journal-upload',
1727 systemd_journal_upload_sources,
1728 include_directories : includes,
1729 link_with : [libshared],
1730 dependencies : [threads,
1731 libcurl,
1732 libgnutls,
1733 libxz,
1734 liblz4],
1735 install_rpath : rootlibexecdir,
1736 install : true,
1737 install_dir : rootlibexecdir)
1738 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001739endif
1740
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001741if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001742 s_j_remote = executable('systemd-journal-remote',
1743 systemd_journal_remote_sources,
1744 include_directories : includes,
1745 link_with : [libshared],
1746 dependencies : [threads,
1747 libmicrohttpd,
1748 libgnutls,
1749 libxz,
1750 liblz4],
1751 install_rpath : rootlibexecdir,
1752 install : true,
1753 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001754
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001755 s_j_gatewayd = executable('systemd-journal-gatewayd',
1756 systemd_journal_gatewayd_sources,
1757 include_directories : includes,
1758 link_with : [libshared],
1759 dependencies : [threads,
1760 libmicrohttpd,
1761 libgnutls,
1762 libxz,
1763 liblz4],
1764 install_rpath : rootlibexecdir,
1765 install : true,
1766 install_dir : rootlibexecdir)
1767 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001768endif
1769
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001770if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001771 executable('systemd-coredump',
1772 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001773 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001774 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001775 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001776 libacl,
1777 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001778 libxz,
1779 liblz4],
1780 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001781 install : true,
1782 install_dir : rootlibexecdir)
1783
1784 exe = executable('coredumpctl',
1785 coredumpctl_sources,
1786 include_directories : includes,
1787 link_with : [libshared],
1788 dependencies : [threads,
1789 libxz,
1790 liblz4],
1791 install_rpath : rootlibexecdir,
1792 install : true)
1793 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001794endif
1795
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001796if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001797 exe = executable('systemd-binfmt',
1798 'src/binfmt/binfmt.c',
1799 include_directories : includes,
1800 link_with : [libshared],
1801 install_rpath : rootlibexecdir,
1802 install : true,
1803 install_dir : rootlibexecdir)
1804 public_programs += [exe]
1805
1806 meson.add_install_script('sh', '-c',
1807 mkdir_p.format(binfmtdir))
1808 meson.add_install_script('sh', '-c',
1809 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1810endif
1811
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001812if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001813 executable('systemd-vconsole-setup',
1814 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001815 include_directories : includes,
1816 link_with : [libshared],
1817 install_rpath : rootlibexecdir,
1818 install : true,
1819 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001820endif
1821
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001822if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001823 executable('systemd-random-seed',
1824 'src/random-seed/random-seed.c',
1825 include_directories : includes,
1826 link_with : [libshared],
1827 install_rpath : rootlibexecdir,
1828 install : true,
1829 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001830endif
1831
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001832if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001833 executable('systemd-firstboot',
1834 'src/firstboot/firstboot.c',
1835 include_directories : includes,
1836 link_with : [libshared],
1837 dependencies : [libcrypt],
1838 install_rpath : rootlibexecdir,
1839 install : true,
1840 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001841endif
1842
1843executable('systemd-remount-fs',
1844 'src/remount-fs/remount-fs.c',
1845 'src/core/mount-setup.c',
1846 'src/core/mount-setup.h',
1847 include_directories : includes,
1848 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001849 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001850 install : true,
1851 install_dir : rootlibexecdir)
1852
1853executable('systemd-machine-id-setup',
1854 'src/machine-id-setup/machine-id-setup-main.c',
1855 'src/core/machine-id-setup.c',
1856 'src/core/machine-id-setup.h',
1857 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001858 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001859 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001860 install : true,
1861 install_dir : rootbindir)
1862
1863executable('systemd-fsck',
1864 'src/fsck/fsck.c',
1865 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001866 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001867 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001868 install : true,
1869 install_dir : rootlibexecdir)
1870
1871executable('systemd-sleep',
1872 'src/sleep/sleep.c',
1873 include_directories : includes,
1874 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001875 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001876 install : true,
1877 install_dir : rootlibexecdir)
1878
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001879exe = executable('systemd-sysctl',
1880 'src/sysctl/sysctl.c',
1881 include_directories : includes,
1882 link_with : [libshared],
1883 install_rpath : rootlibexecdir,
1884 install : true,
1885 install_dir : rootlibexecdir)
1886public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001887
1888executable('systemd-ac-power',
1889 'src/ac-power/ac-power.c',
1890 include_directories : includes,
1891 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001892 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001893 install : true,
1894 install_dir : rootlibexecdir)
1895
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001896exe = executable('systemd-detect-virt',
1897 'src/detect-virt/detect-virt.c',
1898 include_directories : includes,
1899 link_with : [libshared],
1900 install_rpath : rootlibexecdir,
1901 install : true)
1902public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001903
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001904exe = executable('systemd-delta',
1905 'src/delta/delta.c',
1906 include_directories : includes,
1907 link_with : [libshared],
1908 install_rpath : rootlibexecdir,
1909 install : true)
1910public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001911
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001912exe = executable('systemd-escape',
1913 'src/escape/escape.c',
1914 include_directories : includes,
1915 link_with : [libshared],
1916 install_rpath : rootlibexecdir,
1917 install : true,
1918 install_dir : rootbindir)
1919public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001920
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001921exe = executable('systemd-notify',
1922 'src/notify/notify.c',
1923 include_directories : includes,
1924 link_with : [libshared],
1925 install_rpath : rootlibexecdir,
1926 install : true,
1927 install_dir : rootbindir)
1928public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001929
1930executable('systemd-volatile-root',
1931 'src/volatile-root/volatile-root.c',
1932 include_directories : includes,
1933 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001934 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001935 install : true,
1936 install_dir : rootlibexecdir)
1937
1938executable('systemd-cgroups-agent',
1939 'src/cgroups-agent/cgroups-agent.c',
1940 include_directories : includes,
1941 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001942 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001943 install : true,
1944 install_dir : rootlibexecdir)
1945
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001946exe = executable('systemd-path',
1947 'src/path/path.c',
1948 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001949 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001950 install_rpath : rootlibexecdir,
1951 install : true)
1952public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001953
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001954exe = executable('systemd-ask-password',
1955 'src/ask-password/ask-password.c',
1956 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001957 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001958 install_rpath : rootlibexecdir,
1959 install : true,
1960 install_dir : rootbindir)
1961public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001962
1963executable('systemd-reply-password',
1964 'src/reply-password/reply-password.c',
1965 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001966 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001967 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001968 install : true,
1969 install_dir : rootlibexecdir)
1970
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001971exe = executable('systemd-tty-ask-password-agent',
1972 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1973 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001974 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001975 install_rpath : rootlibexecdir,
1976 install : true,
1977 install_dir : rootbindir)
1978public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001979
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001980exe = executable('systemd-cgls',
1981 'src/cgls/cgls.c',
1982 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001983 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001984 install_rpath : rootlibexecdir,
1985 install : true)
1986public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001987
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001988exe = executable('systemd-cgtop',
1989 'src/cgtop/cgtop.c',
1990 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001991 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001992 install_rpath : rootlibexecdir,
1993 install : true)
1994public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001995
1996executable('systemd-initctl',
1997 'src/initctl/initctl.c',
1998 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001999 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002000 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002001 install : true,
2002 install_dir : rootlibexecdir)
2003
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002004exe = executable('systemd-mount',
2005 'src/mount/mount-tool.c',
2006 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002007 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002008 install_rpath : rootlibexecdir,
2009 install : true)
2010public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002011
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002012meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04002013 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04002014
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002015exe = executable('systemd-run',
2016 'src/run/run.c',
2017 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002018 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002019 install_rpath : rootlibexecdir,
2020 install : true)
2021public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002022
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002023exe = executable('systemd-stdio-bridge',
2024 'src/stdio-bridge/stdio-bridge.c',
2025 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002026 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002027 install_rpath : rootlibexecdir,
2028 install : true)
2029public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002030
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002031exe = executable('busctl',
2032 'src/busctl/busctl.c',
2033 'src/busctl/busctl-introspect.c',
2034 'src/busctl/busctl-introspect.h',
2035 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002036 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002037 install_rpath : rootlibexecdir,
2038 install : true)
2039public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002040
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002041if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002042 exe = executable('systemd-sysusers',
2043 'src/sysusers/sysusers.c',
2044 include_directories : includes,
2045 link_with : [libshared],
2046 install_rpath : rootlibexecdir,
2047 install : true,
2048 install_dir : rootbindir)
2049 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002050endif
2051
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002052if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002053 exe = executable('systemd-tmpfiles',
2054 'src/tmpfiles/tmpfiles.c',
2055 include_directories : includes,
2056 link_with : [libshared],
2057 dependencies : [libacl],
2058 install_rpath : rootlibexecdir,
2059 install : true,
2060 install_dir : rootbindir)
2061 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002062endif
2063
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002064if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002065 exe = executable('systemd-hwdb',
2066 'src/hwdb/hwdb.c',
2067 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2068 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002069 link_with : [libudev_internal],
2070 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002071 install : true,
2072 install_dir : rootbindir)
2073 public_programs += [exe]
2074endif
2075
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002076if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002077 executable('systemd-quotacheck',
2078 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002079 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002080 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002081 install_rpath : rootlibexecdir,
2082 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002083 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002084endif
2085
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002086exe = executable('systemd-socket-proxyd',
2087 'src/socket-proxy/socket-proxyd.c',
2088 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002089 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002090 dependencies : [threads],
2091 install_rpath : rootlibexecdir,
2092 install : true,
2093 install_dir : rootlibexecdir)
2094public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002095
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002096exe = executable('systemd-udevd',
2097 systemd_udevd_sources,
2098 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002099 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002100 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002101 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002102 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002103 dependencies : [threads,
2104 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002105 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002106 libacl,
2107 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002108 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002109 install : true,
2110 install_dir : rootlibexecdir)
2111public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002112
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002113exe = executable('udevadm',
2114 udevadm_sources,
2115 include_directories : includes,
2116 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002117 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002118 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002119 dependencies : [threads,
2120 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002121 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002122 libacl,
2123 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002124 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002125 install : true,
2126 install_dir : rootbindir)
2127public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002128
2129executable('systemd-shutdown',
2130 systemd_shutdown_sources,
2131 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002132 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002133 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002134 install : true,
2135 install_dir : rootlibexecdir)
2136
2137executable('systemd-update-done',
2138 'src/update-done/update-done.c',
2139 include_directories : includes,
2140 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002141 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002142 install : true,
2143 install_dir : rootlibexecdir)
2144
2145executable('systemd-update-utmp',
2146 'src/update-utmp/update-utmp.c',
2147 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002148 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002149 dependencies : [libaudit],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002150 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002151 install : true,
2152 install_dir : rootlibexecdir)
2153
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002154if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002155 executable('systemd-modules-load',
2156 'src/modules-load/modules-load.c',
2157 include_directories : includes,
2158 link_with : [libshared],
2159 dependencies : [libkmod],
2160 install_rpath : rootlibexecdir,
2161 install : true,
2162 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002163
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002164 meson.add_install_script('sh', '-c',
2165 mkdir_p.format(modulesloaddir))
2166 meson.add_install_script('sh', '-c',
2167 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002168endif
2169
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002170exe = executable('systemd-nspawn',
2171 systemd_nspawn_sources,
2172 'src/core/mount-setup.c', # FIXME: use a variable?
2173 'src/core/mount-setup.h',
2174 'src/core/loopback-setup.c',
2175 'src/core/loopback-setup.h',
2176 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002177 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002178 dependencies : [libacl,
2179 libblkid,
2180 libseccomp,
2181 libselinux],
2182 install_rpath : rootlibexecdir,
2183 install : true)
2184public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002185
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002186if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002187 executable('systemd-networkd',
2188 systemd_networkd_sources,
2189 include_directories : includes,
2190 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002191 libsystemd_network,
2192 libudev_internal,
2193 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002194 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002195 install_rpath : rootlibexecdir,
2196 install : true,
2197 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002198
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002199 executable('systemd-networkd-wait-online',
2200 systemd_networkd_wait_online_sources,
2201 include_directories : includes,
2202 link_with : [libnetworkd_core,
2203 libshared],
2204 install_rpath : rootlibexecdir,
2205 install : true,
2206 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002207
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002208 exe = executable('networkctl',
2209 networkctl_sources,
2210 include_directories : includes,
2211 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002212 libshared],
Felipe Satelerdcfe0722017-08-21 09:48:41 -03002213 install_rpath : rootlibexecdir,
2214 install : true,
2215 install_dir : rootbindir)
2216 public_programs += [exe]
2217endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002218############################################################
2219
2220foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002221 sources = tuple[0]
2222 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2223 dependencies = tuple[2]
2224 condition = tuple.length() >= 4 ? tuple[3] : ''
2225 type = tuple.length() >= 5 ? tuple[4] : ''
2226 defs = tuple.length() >= 6 ? tuple[5] : []
2227 incs = tuple.length() >= 7 ? tuple[6] : includes
2228 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002229
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002230 name = sources[0].split('/')[-1].split('.')[0]
2231 if type.startswith('timeout=')
2232 timeout = type.split('=')[1].to_int()
2233 type = ''
2234 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002235
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002236 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002237 exe = executable(
2238 name,
2239 sources,
2240 include_directories : incs,
2241 link_with : link_with,
2242 dependencies : dependencies,
2243 c_args : defs,
2244 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002245 install : install_tests,
2246 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002247
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002248 if type == 'manual'
2249 message('@0@ is a manual test'.format(name))
2250 elif type == 'unsafe' and want_tests != 'unsafe'
2251 message('@0@ is an unsafe test'.format(name))
2252 else
2253 test(name, exe,
2254 env : test_env,
2255 timeout : timeout)
2256 endif
2257 else
2258 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2259 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002260endforeach
2261
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002262test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002263 'test-libsystemd-sym',
2264 test_libsystemd_sym_c,
2265 include_directories : includes,
2266 link_with : [libsystemd],
2267 install : install_tests,
2268 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002269test('test-libsystemd-sym',
2270 test_libsystemd_sym)
2271
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002272test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002273 'test-libudev-sym',
2274 test_libudev_sym_c,
2275 include_directories : includes,
2276 c_args : ['-Wno-deprecated-declarations'],
2277 link_with : [libudev],
2278 install : install_tests,
2279 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002280test('test-libudev-sym',
2281 test_libudev_sym)
2282
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002283############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002284
2285make_directive_index_py = find_program('tools/make-directive-index.py')
2286make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002287xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002288hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002289
2290subdir('units')
2291subdir('sysctl.d')
2292subdir('sysusers.d')
2293subdir('tmpfiles.d')
2294subdir('rules')
2295subdir('hwdb')
2296subdir('network')
2297subdir('man')
2298subdir('shell-completion/bash')
2299subdir('shell-completion/zsh')
2300subdir('docs/sysvinit')
2301subdir('docs/var-log')
2302
2303# FIXME: figure out if the warning is true:
2304# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2305install_subdir('factory/etc',
2306 install_dir : factorydir)
2307
2308
2309install_data('xorg/50-systemd-user.sh',
2310 install_dir : xinitrcdir)
2311install_data('system-preset/90-systemd.preset',
2312 install_dir : systempresetdir)
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002313install_data('modprobe.d/systemd.conf',
2314 install_dir : modprobedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002315install_data('README',
2316 'NEWS',
2317 'CODING_STYLE',
2318 'DISTRO_PORTING',
2319 'ENVIRONMENT.md',
2320 'LICENSE.GPL2',
2321 'LICENSE.LGPL2.1',
2322 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2323 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002324
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002325meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2326meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2327
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002328############################################################
2329
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002330meson_check_help = find_program('tools/meson-check-help.sh')
2331
2332foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002333 name = exec.full_path().split('/')[-1]
2334 test('check-help-' + name,
2335 meson_check_help,
2336 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002337endforeach
2338
2339############################################################
2340
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002341if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002342 all_files = run_command(
2343 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002344 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002345 'ls-files',
2346 ':/*.[ch]'])
2347 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002348
userwithuide85a6902017-08-09 13:41:44 +00002349 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002350 'tags',
userwithuide85a6902017-08-09 13:41:44 +00002351 output : 'tags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002352 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.current_source_dir())] + all_files)
userwithuide85a6902017-08-09 13:41:44 +00002353 custom_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002354 'ctags',
userwithuide85a6902017-08-09 13:41:44 +00002355 output : 'ctags',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002356 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.current_source_dir())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002357endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002358
2359if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002360 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002361 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002362 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002363 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002364endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002365
2366if git.found()
2367 git_head = run_command(
2368 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002369 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002370 'rev-parse', 'HEAD']).stdout().strip()
2371 git_head_short = run_command(
2372 git,
Davide Cavalca450b60b2017-08-30 08:04:53 -07002373 ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002374 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2375
2376 run_target(
2377 'git-snapshot',
2378 command : ['git', 'archive',
Davide Cavalca450b60b2017-08-30 08:04:53 -07002379 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.current_source_dir(),
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002380 git_head_short),
2381 '--prefix', 'systemd-@0@/'.format(git_head),
2382 'HEAD'])
2383endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002384
2385############################################################
2386
2387status = [
2388 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2389
2390 'prefix: @0@'.format(prefixdir),
2391 'rootprefix: @0@'.format(rootprefixdir),
2392 'sysconf dir: @0@'.format(sysconfdir),
2393 'includedir: @0@'.format(includedir),
2394 'lib dir: @0@'.format(libdir),
2395 'rootlib dir: @0@'.format(rootlibdir),
2396 'SysV init scripts: @0@'.format(sysvinit_path),
2397 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2398 'PAM modules dir: @0@'.format(pamlibdir),
2399 'PAM configuration dir: @0@'.format(pamconfdir),
2400 'RPM macros dir: @0@'.format(rpmmacrosdir),
Dimitri John Ledkov582faeb2017-08-02 13:41:18 +01002401 'modprobe.d dir: @0@'.format(modprobedir),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002402 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2403 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2404 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2405 'bash completions dir: @0@'.format(bashcompletiondir),
2406 'zsh completions dir: @0@'.format(zshcompletiondir),
2407 'extra start script: @0@'.format(get_option('rc-local')),
2408 'extra stop script: @0@'.format(get_option('halt-local')),
2409 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2410 get_option('debug-tty')),
2411 'TTY GID: @0@'.format(tty_gid),
2412 'maximum system UID: @0@'.format(system_uid_max),
2413 'maximum system GID: @0@'.format(system_gid_max),
2414 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2415 'certificate root: @0@'.format(get_option('certificate-root')),
2416 'support URL: @0@'.format(support_url),
2417 'nobody user name: @0@'.format(get_option('nobody-user')),
2418 'nobody group name: @0@'.format(get_option('nobody-group')),
2419 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
Zbigniew Jędrzejewski-Szmek5248e7e2017-07-11 02:15:08 -04002420 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002421
2422 'default DNSSEC mode: @0@'.format(default_dnssec),
2423 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2424 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2425
2426alt_dns_servers = '\n '.join(dns_servers.split(' '))
2427alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2428status += [
2429 'default DNS servers: @0@'.format(alt_dns_servers),
2430 'default NTP servers: @0@'.format(alt_ntp_servers)]
2431
2432alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2433 '@@0@'.format(time_epoch)).stdout().strip()
2434status += [
2435 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2436
2437# TODO:
2438# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2439# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2440# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2441
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002442if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002443 status += [
2444 'efi arch: @0@'.format(efi_arch)]
2445
2446 if have_gnu_efi
2447 status += [
2448 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2449 'EFI CC @0@'.format(efi_cc),
2450 'EFI libdir: @0@'.format(efi_libdir),
2451 'EFI ldsdir: @0@'.format(efi_ldsdir),
2452 'EFI includedir: @0@'.format(efi_incdir)]
2453 endif
2454endif
2455
2456found = []
2457missing = []
2458
2459foreach tuple : [
2460 ['libcryptsetup'],
2461 ['PAM'],
2462 ['AUDIT'],
2463 ['IMA'],
2464 ['AppArmor'],
2465 ['SELinux'],
2466 ['SECCOMP'],
2467 ['SMACK'],
2468 ['zlib'],
2469 ['xz'],
2470 ['lz4'],
2471 ['bzip2'],
2472 ['ACL'],
2473 ['gcrypt'],
2474 ['qrencode'],
2475 ['microhttpd'],
2476 ['gnutls'],
2477 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002478 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002479 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002480 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002481 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002482 ['libiptc'],
2483 ['elfutils'],
2484 ['binfmt'],
2485 ['vconsole'],
2486 ['quotacheck'],
2487 ['tmpfiles'],
2488 ['environment.d'],
2489 ['sysusers'],
2490 ['firstboot'],
2491 ['randomseed'],
2492 ['backlight'],
2493 ['rfkill'],
2494 ['logind'],
2495 ['machined'],
2496 ['importd'],
2497 ['hostnamed'],
2498 ['timedated'],
2499 ['timesyncd'],
2500 ['localed'],
2501 ['networkd'],
2502 ['resolved'],
2503 ['coredump'],
2504 ['polkit'],
2505 ['legacy pkla', install_polkit_pkla],
2506 ['efi'],
2507 ['gnu-efi', have_gnu_efi],
2508 ['kmod'],
2509 ['xkbcommon'],
2510 ['blkid'],
2511 ['dbus'],
2512 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002513 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002514 ['hwdb'],
2515 ['tpm'],
2516 ['man pages', want_man],
2517 ['html pages', want_html],
2518 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002519 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002520 ['SysV compat'],
2521 ['utmp'],
2522 ['ldconfig'],
2523 ['hibernate'],
2524 ['adm group', get_option('adm-group')],
2525 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002526 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002527 ['debug hashmap'],
2528 ['debug mmap cache'],
2529]
2530
2531 cond = tuple.get(1, '')
2532 if cond == ''
2533 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2534 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002535 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002536 endif
2537 if cond
2538 found += [tuple[0]]
2539 else
2540 missing += [tuple[0]]
2541 endif
2542endforeach
2543
2544status += [
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002545 '',
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002546 'enabled features: @0@'.format(', '.join(found)),
Zbigniew Jędrzejewski-Szmek9d39c1b2017-07-26 14:14:44 -04002547 '',
2548 'disabled features: @0@'.format(', '.join(missing)),
2549 '']
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002550message('\n '.join(status))