blob: ce59d18b83fc17970cc00274d8cbde49c30f9d86 [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-Szmekab916f22017-04-13 22:15:01 -040029rootprefixdir = get_option('rootprefix')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040030if get_option('split-usr')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040031 conf.set('HAVE_SPLIT_USR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040032 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040033else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040034 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040035endif
36
37sysvinit_path = get_option('sysvinit-path')
38sysvrcnd_path = get_option('sysvrcnd-path')
39if sysvinit_path != '' or sysvrcnd_path != ''
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -040040 conf.set('HAVE_SYSV_COMPAT', true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040041 description : 'SysV init scripts and rcN.d links are supported')
42 m4_defines += ['-DHAVE_SYSV_COMPAT']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040043endif
44
45# join_paths ignore the preceding arguments if an absolute component is
46# encountered, so this should canonicalize various paths when they are
47# absolute or relative.
48prefixdir = get_option('prefix')
49if not prefixdir.startswith('/')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040050 error('Prefix is not absolute: "@0@"'.format(prefixdir))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040051endif
52bindir = join_paths(prefixdir, get_option('bindir'))
53libdir = join_paths(prefixdir, get_option('libdir'))
54sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
55includedir = join_paths(prefixdir, get_option('includedir'))
56datadir = join_paths(prefixdir, get_option('datadir'))
57localstatedir = join_paths('/', get_option('localstatedir'))
58
59rootbindir = join_paths(rootprefixdir, 'bin')
60rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
61
62rootlibdir = get_option('rootlibdir')
63if rootlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -040064 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040065endif
66
67# Dirs of external packages
Michael Bieble17e5ba2017-04-13 10:30:56 -040068pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
69pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
70polkitpolicydir = join_paths(datadir, 'polkit-1/actions')
71polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d')
72polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d')
73varlogdir = join_paths(localstatedir, 'log')
74xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -040075rpmmacrosdir = get_option('rpmmacrosdir')
76
77# Our own paths
Michael Bieble17e5ba2017-04-13 10:30:56 -040078pkgdatadir = join_paths(datadir, 'systemd')
79environmentdir = join_paths(prefixdir, 'lib/environment.d')
80pkgsysconfdir = join_paths(sysconfdir, 'systemd')
81userunitdir = join_paths(prefixdir, 'lib/systemd/user')
82userpresetdir = join_paths(prefixdir, 'lib/systemd/user-preset')
83tmpfilesdir = join_paths(prefixdir, 'lib/tmpfiles.d')
84sysusersdir = join_paths(prefixdir, 'lib/sysusers.d')
85sysctldir = join_paths(prefixdir, 'lib/sysctl.d')
86binfmtdir = join_paths(prefixdir, 'lib/binfmt.d')
87modulesloaddir = join_paths(prefixdir, 'lib/modules-load.d')
88networkdir = join_paths(rootprefixdir, 'lib/systemd/network')
89pkgincludedir = join_paths(includedir, 'systemd')
90systemgeneratordir = join_paths(rootlibexecdir, 'system-generators')
91usergeneratordir = join_paths(prefixdir, 'lib/systemd/user-generators')
92systemenvgeneratordir = join_paths(prefixdir, 'lib/systemd/system-environment-generators')
93userenvgeneratordir = join_paths(prefixdir, 'lib/systemd/user-environment-generators')
94systemshutdowndir = join_paths(rootlibexecdir, 'system-shutdown')
95systemsleepdir = join_paths(rootlibexecdir, 'system-sleep')
96systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
97systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
98udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
99udevhomedir = udevlibexecdir
100udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
101udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
102catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
103kernelinstalldir = join_paths(prefixdir, 'lib/kernel/install.d')
104factorydir = join_paths(datadir, 'factory')
105docdir = join_paths(datadir, 'doc/systemd')
106bootlibdir = join_paths(prefixdir, 'lib/systemd/boot/efi')
107testsdir = join_paths(prefixdir, 'lib/systemd/tests')
108systemdstatedir = join_paths(localstatedir, 'lib/systemd')
109catalogstatedir = join_paths(systemdstatedir, 'catalog')
110randomseeddir = join_paths(localstatedir, 'lib/systemd')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400111
112dbuspolicydir = get_option('dbuspolicydir')
113if dbuspolicydir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400114 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400115endif
116
117dbussessionservicedir = get_option('dbussessionservicedir')
118if dbussessionservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400119 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400120endif
121
122dbussystemservicedir = get_option('dbussystemservicedir')
123if dbussystemservicedir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400124 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400125endif
126
127pamlibdir = get_option('pamlibdir')
128if pamlibdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400129 pamlibdir = join_paths(rootlibdir, 'security')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400130endif
131
132pamconfdir = get_option('pamconfdir')
133if pamconfdir == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400134 pamconfdir = join_paths(sysconfdir, 'pam.d')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400135endif
136
137conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400138conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400139conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
140conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
141conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400142conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
143conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400144conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400145conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
146conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400147conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database'))
148conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent'))
149conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd'))
150conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck'))
151conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown'))
152conf.set_quoted('SYSTEMD_SLEEP_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-sleep'))
153conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl'))
154conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent'))
155conf.set_quoted('SYSTEMD_STDIO_BRIDGE_BINARY_PATH', join_paths(bindir, 'systemd-stdio-bridge'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400156conf.set_quoted('ROOTPREFIX', rootprefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400157conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400158conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
159conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400160conf.set_quoted('SYSTEM_GENERATOR_PATH', systemgeneratordir)
161conf.set_quoted('USER_GENERATOR_PATH', usergeneratordir)
162conf.set_quoted('SYSTEM_ENV_GENERATOR_PATH', systemenvgeneratordir)
163conf.set_quoted('USER_ENV_GENERATOR_PATH', userenvgeneratordir)
164conf.set_quoted('SYSTEM_SHUTDOWN_PATH', systemshutdowndir)
165conf.set_quoted('SYSTEM_SLEEP_PATH', systemsleepdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400166conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
167conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400168conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400169conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400170conf.set_quoted('LIBDIR', libdir)
171conf.set_quoted('ROOTLIBDIR', rootlibdir)
172conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
173conf.set_quoted('BOOTLIBDIR', bootlibdir)
Michael Bieble17e5ba2017-04-13 10:30:56 -0400174conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
175conf.set_quoted('SYSTEMD_IMPORT_PATH', join_paths(rootlibexecdir, 'systemd-import'))
176conf.set_quoted('SYSTEMD_EXPORT_PATH', join_paths(rootlibexecdir, 'systemd-export'))
177conf.set_quoted('VENDOR_KEYRING_PATH', join_paths(rootlibexecdir, 'import-pubring.gpg'))
178conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
179conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400180
181conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
182conf.set_quoted('ABS_SRC_DIR', meson.source_root())
183
184substs.set('prefix', prefixdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400185substs.set('exec_prefix', prefixdir)
186substs.set('libdir', libdir)
187substs.set('rootlibdir', rootlibdir)
188substs.set('includedir', includedir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400189substs.set('pkgsysconfdir', pkgsysconfdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400190substs.set('bindir', bindir)
191substs.set('rootbindir', rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400192substs.set('rootlibexecdir', rootlibexecdir)
193substs.set('systemunitdir', systemunitdir)
194substs.set('userunitdir', userunitdir)
195substs.set('systempresetdir', systempresetdir)
196substs.set('userpresetdir', userpresetdir)
197substs.set('udevhwdbdir', udevhwdbdir)
198substs.set('udevrulesdir', udevrulesdir)
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400199substs.set('udevlibexecdir', udevlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400200substs.set('catalogdir', catalogdir)
201substs.set('tmpfilesdir', tmpfilesdir)
202substs.set('sysusersdir', sysusersdir)
203substs.set('sysctldir', sysctldir)
204substs.set('binfmtdir', binfmtdir)
205substs.set('modulesloaddir', modulesloaddir)
206substs.set('systemgeneratordir', systemgeneratordir)
207substs.set('usergeneratordir', usergeneratordir)
208substs.set('systemenvgeneratordir', systemenvgeneratordir)
209substs.set('userenvgeneratordir', userenvgeneratordir)
210substs.set('systemshutdowndir', systemshutdowndir)
211substs.set('systemsleepdir', systemsleepdir)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400212substs.set('VARLOGDIR', varlogdir)
213substs.set('CERTIFICATEROOT', get_option('certificate-root'))
Michael Bieble17e5ba2017-04-13 10:30:56 -0400214substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
215substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400216substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
217substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
218substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
219substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400220
221#####################################################################
222
223cc = meson.get_compiler('c')
224pkgconfig = import('pkgconfig')
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400225check_compilation_sh = find_program('tools/meson-check-compilation.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400226
Zbigniew Jędrzejewski-Szmek94e25232017-05-13 13:23:28 -0400227cxx = find_program('c++', required : false)
228if cxx.found()
229 # Used only for tests
230 add_languages('cpp')
231endif
232
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400233foreach arg : ['-Wundef',
234 '-Wlogical-op',
235 '-Wmissing-include-dirs',
236 '-Wold-style-definition',
237 '-Wpointer-arith',
238 '-Winit-self',
239 '-Wdeclaration-after-statement',
240 '-Wfloat-equal',
241 '-Wsuggest-attribute=noreturn',
242 '-Werror=missing-prototypes',
243 '-Werror=implicit-function-declaration',
244 '-Werror=missing-declarations',
245 '-Werror=return-type',
246 '-Werror=incompatible-pointer-types',
247 '-Werror=format=2',
248 '-Wstrict-prototypes',
249 '-Wredundant-decls',
250 '-Wmissing-noreturn',
251 '-Wshadow',
252 '-Wendif-labels',
253 '-Wstrict-aliasing=2',
254 '-Wwrite-strings',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400255 '-Werror=overflow',
256 '-Wdate-time',
257 '-Wnested-externs',
258 '-ffast-math',
259 '-fno-common',
260 '-fdiagnostics-show-option',
261 '-fno-strict-aliasing',
262 '-fvisibility=hidden',
263 '-fstack-protector',
264 '-fstack-protector-strong',
265 '-fPIE',
266 '--param=ssp-buffer-size=4',
267 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400268 if cc.has_argument(arg)
269 add_project_arguments(arg, language : 'c')
270 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400271endforeach
272
Zbigniew Jędrzejewski-Szmek2c5434a2017-04-27 10:05:41 -0400273# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
274# arguments, just emits a warnings. So test for the "positive" version instead.
275foreach arg : ['unused-parameter',
276 'missing-field-initializers',
277 'unused-result',
278 'format-signedness']
279 if cc.has_argument('-W' + arg)
280 add_project_arguments('-Wno-' + arg, language : 'c')
281 endif
282endforeach
283
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400284if cc.compiles('
285 #include <time.h>
286 #include <inttypes.h>
287 typedef uint64_t usec_t;
288 usec_t now(clockid_t clock);
289 int main(void) {
290 struct timespec now;
291 return 0;
292 }
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400293', name : '-Werror=shadow with local shadowing')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400294 add_project_arguments('-Werror=shadow', language : 'c')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400295endif
296
297if cc.get_id() == 'clang'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400298 foreach arg : ['-Wno-typedef-redefinition',
299 '-Wno-gnu-variable-sized-type-not-at-end',
300 ]
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400301 if cc.has_argument(arg,
302 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400303 add_project_arguments(arg, language : 'c')
304 endif
305 endforeach
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400306endif
307
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400308link_test_c = files('tools/meson-link-test.c')
309
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400310# --as-needed and --no-undefined are provided by meson by default,
311# run mesonconf to see what is enabled
312foreach arg : ['-Wl,-z,relro',
313 '-Wl,-z,now',
314 '-pie',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400315 ]
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400316
317 have = run_command(check_compilation_sh,
318 cc.cmd_array(), '-x', 'c', arg,
319 '-include', link_test_c).returncode() == 0
320 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
321 if have
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400322 add_project_link_arguments(arg, language : 'c')
323 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400324endforeach
325
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400326if get_option('buildtype') != 'debug'
327 foreach arg : ['-ffunction-sections',
328 '-fdata-sections']
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400329 if cc.has_argument(arg,
330 name : '@0@ is supported'.format(arg))
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400331 add_project_arguments(arg, language : 'c')
332 endif
333 endforeach
334
335 foreach arg : ['-Wl,--gc-sections']
Zbigniew Jędrzejewski-Szmek6e2afb12017-04-24 21:03:35 -0400336 have = run_command(check_compilation_sh,
337 cc.cmd_array(), '-x', 'c', arg,
338 '-include', link_test_c).returncode() == 0
339 message('Linking with @0@ supported: @1@'.format(arg, have ? 'yes' : 'no'))
340 if have
Zbigniew Jędrzejewski-Szmek41afb5e2017-04-24 19:28:04 -0400341 add_project_link_arguments(arg, language : 'c')
342 endif
343 endforeach
344endif
345
Zbigniew Jędrzejewski-Szmek9cc0e6e2017-04-11 10:25:34 -0400346cpp = ' '.join(cc.cmd_array()) + ' -E'
347
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400348#####################################################################
349# compilation result tests
350
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400351conf.set('_GNU_SOURCE', true)
352conf.set('__SANE_USERSPACE_TYPES__', true)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400353
354conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
355conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
356conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
357conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
358conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
359conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
360conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
361
362decl_headers = '''
363#include <uchar.h>
364#include <linux/ethtool.h>
365'''
366# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
367
368foreach decl : ['char16_t',
369 'char32_t',
370 'key_serial_t',
371 'struct ethtool_link_settings',
372 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400373
374 # We get -1 if the size cannot be determined
375 have = cc.sizeof(decl, prefix : decl_headers) > 0
376 conf.set('HAVE_' + decl.underscorify().to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400377endforeach
378
379foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
380 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
381 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
382 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
383 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
384 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
385 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
386 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
387 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
388 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
Susant Sahani9dfed8d2017-04-25 20:30:34 +0530389 ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400390 # if_tunnel.h is buggy and cannot be included on its own
391 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
392 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
393 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
394 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
395 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
396 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
397 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
398 ['NDA_IFINDEX', 'linux/neighbour.h'],
399 ['IFA_FLAGS', 'linux/if_addr.h'],
400 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
401 ]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400402 prefix = decl.length() > 2 ? decl[2] : ''
403 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
404 conf.set10('HAVE_DECL_' + decl[0], have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400405endforeach
406
407skip = false
408foreach ident : ['secure_getenv', '__secure_getenv']
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400409 if not skip and cc.has_function(ident)
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400410 conf.set('HAVE_' + ident.to_upper(), true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400411 skip = true
412 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400413endforeach
414
415foreach ident : [
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400416 ['memfd_create', '''#include <sys/memfd.h>'''],
417 ['gettid', '''#include <sys/types.h>'''],
418 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
419 ['name_to_handle_at', '''#define _GNU_SOURCE
420 #include <sys/types.h>
421 #include <sys/stat.h>
422 #include <fcntl.h>'''],
423 ['setns', '''#define _GNU_SOURCE
424 #include <sched.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400425 ['renameat2', '''#include <stdio.h>'''],
426 ['kcmp', '''#include <linux/kcmp.h>'''],
427 ['keyctl', '''#include <sys/types.h>
428 #include <keyutils.h>'''],
429 ['copy_file_range', '''#include <sys/syscall.h>
430 #include <unistd.h>'''],
Zbigniew Jędrzejewski-Szmek38f1ae02017-04-19 16:14:16 -0400431 ['explicit_bzero' , '''#include <string.h>'''],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400432]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400433
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400434 have = cc.has_function(ident[0], prefix : ident[1])
435 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400436endforeach
437
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400438if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400439 conf.set('USE_SYS_RANDOM_H', true)
440 conf.set10('HAVE_DECL_GETRANDOM', true)
Zbigniew Jędrzejewski-Szmek4984c8b2017-04-19 21:20:54 -0400441else
442 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
443 conf.set10('HAVE_DECL_GETRANDOM', have)
444endif
445
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400446#####################################################################
447
448sed = find_program('sed')
449grep = find_program('grep')
450awk = find_program('awk')
Zbigniew Jędrzejewski-Szmekd730e2d2017-04-25 08:49:58 -0400451m4 = find_program('m4')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400452stat = find_program('stat')
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -0400453git = find_program('git', required : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400454
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -0400455meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400456mkdir_p = 'mkdir -p $DESTDIR/@0@'
Zbigniew Jędrzejewski-Szmekd83f4f52017-04-16 12:04:46 -0400457test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
458splash_bmp = files('test/splash.bmp')
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -0400459
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400460# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
461# /usr/sbin, /sbin, and fall back to the default from middle column.
462progs = [['telinit', '/lib/sysvinit/telinit'],
463 ['quotaon', '/usr/sbin/quotaon' ],
464 ['quotacheck', '/usr/sbin/quotacheck' ],
465 ['kill', '/usr/bin/kill' ],
466 ['kmod', '/usr/bin/kmod' ],
467 ['kexec', '/usr/sbin/kexec' ],
468 ['sulogin', '/usr/sbin/sulogin' ],
469 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
470 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
471 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
472 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
473 ]
474foreach prog : progs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400475 path = get_option(prog[0] + '-path')
476 if path != ''
477 message('Using @1@ for @0@'.format(prog[0], path))
478 else
479 exe = find_program(prog[0],
480 '/usr/sbin/' + prog[0],
481 '/sbin/' + prog[0],
482 required: false)
483 path = exe.found() ? exe.path() : prog[1]
484 endif
485 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
486 conf.set_quoted(name, path)
487 substs.set(name, path)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400488endforeach
489
Zbigniew Jędrzejewski-Szmek1276a9f2017-04-18 19:11:54 -0400490if run_command('ln', '--relative', '--help').returncode() != 0
491 error('ln does not support --relative')
492endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400493
494############################################################
495
496gperf = find_program('gperf')
497
498gperf_test_format = '''
499#include <string.h>
500const char * in_word_set(const char *, @0@);
501@1@
502'''
503gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
504gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
505gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
506if cc.compiles(gperf_test)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400507 gperf_len_type = 'size_t'
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400508else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400509 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
510 if cc.compiles(gperf_test)
511 gperf_len_type = 'unsigned'
512 else
513 error('unable to determine gperf len type')
514 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400515endif
516message('gperf len type is @0@'.format(gperf_len_type))
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400517conf.set('GPERF_LEN_TYPE', gperf_len_type,
518 description : 'The type of gperf "len" parameter')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400519
520############################################################
521
522if not cc.has_header('sys/capability.h')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400523 error('POSIX caps headers not found')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400524endif
525foreach header : ['linux/btrfs.h',
526 'linux/memfd.h',
527 'linux/vm_sockets.h',
528 'valgrind/memcheck.h',
529 'valgrind/valgrind.h',
530 ]
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400531
532 conf.set('HAVE_' + header.underscorify().to_upper(),
533 cc.has_header(header))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400534endforeach
535
536############################################################
537
538conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
539
540default_hierarchy = get_option('default-hierarchy')
541conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
542 description : 'default cgroup hierarchy as string')
543if default_hierarchy == 'legacy'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400544 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400545elif default_hierarchy == 'hybrid'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400546 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400547else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400548 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400549endif
550
551time_epoch = get_option('time-epoch')
552if time_epoch == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400553 NEWS = files('NEWS')
554 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400555endif
556time_epoch = time_epoch.to_int()
557conf.set('TIME_EPOCH', time_epoch)
558
559system_uid_max = get_option('system-uid-max')
560if system_uid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400561 system_uid_max = run_command(
562 awk,
563 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
564 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400565endif
566system_uid_max = system_uid_max.to_int()
567conf.set('SYSTEM_UID_MAX', system_uid_max)
568substs.set('systemuidmax', system_uid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400569message('maximum system UID is @0@'.format(system_uid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400570
571conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
572conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
573
574system_gid_max = get_option('system-gid-max')
575if system_gid_max == ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400576 system_gid_max = run_command(
577 awk,
578 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
579 '/etc/login.defs').stdout()
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400580endif
581system_gid_max = system_gid_max.to_int()
582conf.set('SYSTEM_GID_MAX', system_gid_max)
583substs.set('systemgidmax', system_gid_max)
Zbigniew Jędrzejewski-Szmek7572aa82017-04-24 21:46:40 -0400584message('maximum system GID is @0@'.format(system_gid_max))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400585
586tty_gid = get_option('tty-gid')
587conf.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400588substs.set('TTY_GID', tty_gid)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400589
590if get_option('adm-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400591 m4_defines += ['-DENABLE_ADM_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400592endif
593
594if get_option('wheel-group')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400595 m4_defines += ['-DENABLE_WHEEL_GROUP']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400596endif
597
598substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
599
Zbigniew Jędrzejewski-Szmek2a4c1562017-04-12 19:54:33 -0400600kill_user_processes = get_option('default-kill-user-processes')
601conf.set10('KILL_USER_PROCESSES', kill_user_processes)
602substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400603
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400604dns_servers = get_option('dns-servers')
605conf.set_quoted('DNS_SERVERS', dns_servers)
606substs.set('DNS_SERVERS', dns_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400607
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -0400608ntp_servers = get_option('ntp-servers')
609conf.set_quoted('NTP_SERVERS', ntp_servers)
610substs.set('NTP_SERVERS', ntp_servers)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400611
612conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
613
Zbigniew Jędrzejewski-Szmek3131bfe2017-04-10 19:06:45 -0400614substs.set('SUSHELL', get_option('debug-shell'))
615substs.set('DEBUGTTY', get_option('debug-tty'))
616
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400617debug = get_option('debug')
618if debug != ''
619 foreach name : debug.split(',')
620 if name == 'hashmap'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400621 conf.set('ENABLE_DEBUG_HASHMAP', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400622 elif name == 'mmap-cache'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400623 conf.set('ENABLE_DEBUG_MMAP_CACHE', true)
Zbigniew Jędrzejewski-Szmek671677d2017-04-27 20:51:34 -0400624 else
625 message('unknown debug option "@0@", ignoring'.format(name))
626 endif
627 endforeach
628endif
629
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400630#####################################################################
631
632threads = dependency('threads')
633librt = cc.find_library('rt')
634libm = cc.find_library('m')
635libdl = cc.find_library('dl')
636libcrypt = cc.find_library('crypt')
637
Zbigniew Jędrzejewski-Szmek1800cc82017-04-27 01:30:30 -0400638libcap = dependency('libcap', required : false)
639if not libcap.found()
640 # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
641 libcap = cc.find_library('cap')
642endif
643
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400644libmount = dependency('mount',
645 version : '>= 2.27')
646
647want_seccomp = get_option('seccomp')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400648if want_seccomp != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400649 libseccomp = dependency('libseccomp',
Zbigniew Jędrzejewski-Szmek9f0e9c02017-04-27 10:05:18 -0400650 version : '>= 2.3.1',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400651 required : want_seccomp == 'true')
652 if libseccomp.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400653 conf.set('HAVE_SECCOMP', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400654 m4_defines += ['-DHAVE_SECCOMP']
655 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400656else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400657 libseccomp = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400658endif
659
660want_selinux = get_option('selinux')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400661if want_selinux != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400662 libselinux = dependency('libselinux',
663 version : '>= 2.1.9',
664 required : want_selinux == 'true')
665 if libselinux.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400666 conf.set('HAVE_SELINUX', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400667 m4_defines += ['-DHAVE_SELINUX']
668 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400669else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400670 libselinux = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400671endif
672
673want_apparmor = get_option('apparmor')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400674if want_apparmor != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400675 libapparmor = dependency('libapparmor',
676 required : want_apparmor == 'true')
677 if libapparmor.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400678 conf.set('HAVE_APPARMOR', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400679 m4_defines += ['-DHAVE_APPARMOR']
680 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400681else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400682 libapparmor = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400683endif
684
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400685smack_run_label = get_option('smack-run-label')
686if smack_run_label != ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400687 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
688 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400689endif
690
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400691want_polkit = get_option('polkit')
692install_polkit = false
693install_polkit_pkla = false
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400694if want_polkit != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400695 conf.set('ENABLE_POLKIT', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400696 install_polkit = true
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400697
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400698 libpolkit = dependency('polkit-gobject-1',
699 required : false)
700 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
701 message('Old polkit detected, will install pkla files')
702 install_polkit_pkla = true
703 endif
Zbigniew Jędrzejewski-Szmek3ca0cb72017-04-12 19:09:26 -0400704endif
705
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400706want_acl = get_option('acl')
707if want_acl != 'false'
708 libacl = cc.find_library('acl', required : want_acl == 'true')
709 if libacl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400710 conf.set('HAVE_ACL', true)
Zbigniew Jędrzejewski-Szmek36f03872017-04-21 13:53:59 -0400711 m4_defines += ['-DHAVE_ACL']
712 endif
713else
714 libacl = []
715endif
716
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400717want_audit = get_option('audit')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400718if want_audit != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400719 libaudit = dependency('audit', required : want_audit == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400720 conf.set('HAVE_AUDIT', libaudit.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400721else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400722 libaudit = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400723endif
724
725want_blkid = get_option('blkid')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400726if want_blkid != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400727 libblkid = dependency('blkid', required : want_blkid == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400728 conf.set('HAVE_BLKID', libblkid.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400729else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400730 libblkid = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400731endif
732
733want_kmod = get_option('kmod')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400734if want_kmod != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400735 libkmod = dependency('libkmod',
736 version : '>= 15',
737 required : want_kmod == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400738 conf.set('HAVE_KMOD', libkmod.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400739else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400740 libkmod = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400741endif
742
743want_pam = get_option('pam')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400744if want_pam != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400745 libpam = cc.find_library('pam', required : want_pam == 'true')
746 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
747 if libpam.found() and libpam_misc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400748 conf.set('HAVE_PAM', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400749 m4_defines += ['-DHAVE_PAM']
750 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400751else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400752 libpam = []
753 libpam_misc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400754endif
755
756want_microhttpd = get_option('microhttpd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400757if want_microhttpd != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400758 libmicrohttpd = dependency('libmicrohttpd',
759 version : '>= 0.9.33',
760 required : want_microhttpd == 'true')
761 if libmicrohttpd.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400762 conf.set('HAVE_MICROHTTPD', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400763 m4_defines += ['-DHAVE_MICROHTTPD']
764 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400765else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400766 libmicrohttpd = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400767endif
768
769want_libcryptsetup = get_option('libcryptsetup')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400770if want_libcryptsetup != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400771 libcryptsetup = dependency('libcryptsetup',
772 version : '>= 1.6.0',
773 required : want_libcryptsetup == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400774 conf.set('HAVE_LIBCRYPTSETUP', libcryptsetup.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400775else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400776 libcryptsetup = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400777endif
778
779want_libcurl = get_option('libcurl')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400780if want_libcurl != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400781 libcurl = dependency('libcurl',
782 version : '>= 7.32.0',
783 required : want_libcurl == 'true')
784 if libcurl.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400785 conf.set('HAVE_LIBCURL', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400786 m4_defines += ['-DHAVE_LIBCURL']
787 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400788else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400789 libcurl = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400790endif
791
792want_libidn = get_option('libidn')
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -0400793want_libidn2 = get_option('libidn2')
794if want_libidn == 'true' and want_libidn2 == 'true'
795 error('libidn and libidn2 cannot be requested simultaneously')
796endif
797
798if want_libidn2 != 'false' and want_libidn != 'true'
799 libidn = dependency('libidn2',
800 required : want_libidn2 == 'true')
801 # libidn is used for both libidn and libidn2 objects
802 if libidn.found()
803 conf.set('HAVE_LIBIDN2', true)
804 m4_defines += ['-DHAVE_LIBIDN2']
805 endif
806else
807 libidn = []
808endif
809if not conf.get('HAVE_LIBIDN2', false) and want_libidn != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400810 libidn = dependency('libidn',
811 required : want_libidn == 'true')
812 if libidn.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400813 conf.set('HAVE_LIBIDN', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400814 m4_defines += ['-DHAVE_LIBIDN']
815 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400816endif
817
818want_libiptc = get_option('libiptc')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400819if want_libiptc != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400820 libiptc = dependency('libiptc',
821 required : want_libiptc == 'true')
822 if libiptc.found()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400823 conf.set('HAVE_LIBIPTC', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400824 m4_defines += ['-DHAVE_LIBIPTC']
825 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400826else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400827 libiptc = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400828endif
829
830want_qrencode = get_option('qrencode')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400831if want_qrencode != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400832 libqrencode = dependency('libqrencode',
833 required : want_qrencode == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400834 conf.set('HAVE_QRENCODE', libqrencode.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400835else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400836 libqrencode = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400837endif
838
839want_gnutls = get_option('gnutls')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400840if want_gnutls != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400841 libgnutls = dependency('gnutls',
842 version : '>= 3.1.4',
843 required : want_gnutls == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400844 conf.set('HAVE_GNUTLS', libgnutls.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400845else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400846 libgnutls = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400847endif
848
849want_elfutils = get_option('elfutils')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400850if want_elfutils != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400851 libdw = dependency('libdw',
852 required : want_elfutils == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400853 conf.set('HAVE_ELFUTILS', libdw.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400854else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400855 libdw = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400856endif
857
858want_zlib = get_option('zlib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400859if want_zlib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400860 libz = dependency('zlib',
861 required : want_zlib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400862 conf.set('HAVE_ZLIB', libz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400863else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400864 libz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400865endif
866
867want_bzip2 = get_option('bzip2')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400868if want_bzip2 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400869 libbzip2 = cc.find_library('bz2',
870 required : want_bzip2 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400871 conf.set('HAVE_BZIP2', libbzip2.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400872else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400873 libbzip2 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400874endif
875
876want_xz = get_option('xz')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400877if want_xz != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400878 libxz = dependency('liblzma',
879 required : want_xz == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400880 conf.set('HAVE_XZ', libxz.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400881else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400882 libxz = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400883endif
884
885want_lz4 = get_option('lz4')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400886if want_lz4 != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400887 liblz4 = dependency('liblz4',
888 required : want_lz4 == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400889 conf.set('HAVE_LZ4', liblz4.found())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400890else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400891 liblz4 = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400892endif
893
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400894want_glib = get_option('glib')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400895if want_glib != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400896 libglib = dependency('glib-2.0',
897 version : '>= 2.22.0',
898 required : want_glib == 'true')
899 libgobject = dependency('gobject-2.0',
900 version : '>= 2.22.0',
901 required : want_glib == 'true')
902 libgio = dependency('gio-2.0',
903 required : want_glib == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400904 have = libglib.found() and libgobject.found() and libgio.found()
905 conf.set('HAVE_GLIB', have)
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400906else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400907 libglib = []
908 libgobject = []
909 libgio = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400910endif
911
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400912want_xkbcommon = get_option('xkbcommon')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400913if want_xkbcommon != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400914 libxkbcommon = dependency('xkbcommon',
915 version : '>= 0.3.0',
916 required : want_xkbcommon == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400917 conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400918else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400919 libxkbcommon = []
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -0400920endif
921
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400922want_dbus = get_option('dbus')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400923if want_dbus != 'false'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400924 libdbus = dependency('dbus-1',
925 version : '>= 1.3.2',
926 required : want_dbus == 'true')
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400927 conf.set('HAVE_DBUS', libdbus.found())
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400928else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400929 libdbus = []
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -0400930endif
931
Michael Biebl76c87412017-04-21 23:45:54 +0200932want_gcrypt = get_option('gcrypt')
933if want_gcrypt != 'false'
934 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
935 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
936
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400937 have_deps = libgcrypt.found() and libgpg_error.found()
938 conf.set('HAVE_GCRYPT', have_deps)
939 if not have_deps
Michael Biebl76c87412017-04-21 23:45:54 +0200940 # link to neither of the libs if one is not found
941 libgcrypt = []
942 libgpg_error = []
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400943 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400944else
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400945 libgcrypt = []
Michael Biebl76c87412017-04-21 23:45:54 +0200946 libgpg_error = []
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400947endif
948
Yu Watanabe42303dc2017-06-18 05:22:32 +0900949default_dnssec = get_option('default-dnssec')
950if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
951 message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
952 default_dnssec = 'no'
953endif
954conf.set('DEFAULT_DNSSEC_MODE',
955 'DNSSEC_' + default_dnssec.underscorify().to_upper())
956substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
957
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400958want_importd = get_option('importd')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400959if want_importd != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400960 have_deps = (conf.get('HAVE_LIBCURL', false) and
961 conf.get('HAVE_ZLIB', false) and
962 conf.get('HAVE_BZIP2', false) and
963 conf.get('HAVE_XZ', false) and
964 conf.get('HAVE_GCRYPT', false))
965 conf.set('ENABLE_IMPORTD', have_deps)
966 if want_importd == 'true' and not have_deps
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400967 error('importd support was requested, but dependencies are not available')
968 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400969endif
970
971want_remote = get_option('remote')
Zbigniew Jędrzejewski-Szmek4390be32017-04-13 20:30:07 -0400972if want_remote != 'false'
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400973 have_deps = [conf.get('HAVE_MICROHTTPD', false),
974 conf.get('HAVE_LIBCURL', false)]
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -0400975 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
976 # it's possible to build one without the other. Complain only if
977 # support was explictly requested. The auxiliary files like sysusers
978 # config should be installed when any of the programs are built.
979 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
980 error('remote support was requested, but dependencies are not available')
981 endif
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -0400982 conf.set('ENABLE_REMOTE', have_deps[0] or have_deps[1])
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -0400983endif
984
985foreach pair : [['utmp', 'HAVE_UTMP'],
986 ['hibernate', 'ENABLE_HIBERNATE'],
987 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
988 ['binfmt', 'ENABLE_BINFMT'],
989 ['coredump', 'ENABLE_COREDUMP'],
990 ['resolve', 'ENABLE_RESOLVED'],
991 ['logind', 'ENABLE_LOGIND'],
992 ['hostnamed', 'ENABLE_HOSTNAMED'],
993 ['localed', 'ENABLE_LOCALED'],
994 ['machined', 'ENABLE_MACHINED'],
995 ['networkd', 'ENABLE_NETWORKD'],
996 ['timedated', 'ENABLE_TIMEDATED'],
997 ['timesyncd', 'ENABLE_TIMESYNCD'],
998 ['myhostname', 'HAVE_MYHOSTNAME'],
999 ['firstboot', 'ENABLE_FIRSTBOOT'],
1000 ['randomseed', 'ENABLE_RANDOMSEED'],
1001 ['backlight', 'ENABLE_BACKLIGHT'],
1002 ['vconsole', 'ENABLE_VCONSOLE'],
1003 ['quotacheck', 'ENABLE_QUOTACHECK'],
1004 ['sysusers', 'ENABLE_SYSUSERS'],
1005 ['tmpfiles', 'ENABLE_TMPFILES'],
1006 ['hwdb', 'ENABLE_HWDB'],
1007 ['rfkill', 'ENABLE_RFKILL'],
1008 ['ldconfig', 'ENABLE_LDCONFIG'],
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001009 ['efi', 'ENABLE_EFI'],
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001010 ['tpm', 'SD_BOOT_LOG_TPM'],
Zbigniew Jędrzejewski-Szmek2895c8e2017-04-13 19:45:05 -04001011 ['ima', 'HAVE_IMA'],
Zbigniew Jędrzejewski-Szmek5464ec82017-04-24 19:28:04 -04001012 ['smack', 'HAVE_SMACK'],
Franck Buib14e1b42017-05-09 14:02:37 +02001013 ['gshadow', 'ENABLE_GSHADOW'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04001014 ['idn', 'ENABLE_IDN'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001015 ['nss-systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001016 ]
1017
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001018 if get_option(pair[0])
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001019 conf.set(pair[1], true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001020 m4_defines += ['-D' + pair[1]]
1021 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001022endforeach
1023
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001024want_tests = get_option('tests')
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04001025install_tests = get_option('install-tests')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001026tests = []
1027
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001028#####################################################################
1029
1030if get_option('efi')
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001031 efi_arch = host_machine.cpu_family()
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001032
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001033 if efi_arch == 'x86'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001034 EFI_MACHINE_TYPE_NAME = 'ia32'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001035 gnu_efi_arch = 'ia32'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001036 elif efi_arch == 'x86_64'
1037 EFI_MACHINE_TYPE_NAME = 'x64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001038 gnu_efi_arch = 'x86_64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001039 elif efi_arch == 'arm'
1040 EFI_MACHINE_TYPE_NAME = 'arm'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001041 gnu_efi_arch = 'arm'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001042 elif efi_arch == 'aarch64'
1043 EFI_MACHINE_TYPE_NAME = 'aa64'
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001044 gnu_efi_arch = 'aarch64'
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001045 else
1046 EFI_MACHINE_TYPE_NAME = ''
Zbigniew Jędrzejewski-Szmek6800fe72017-04-19 22:57:52 -04001047 gnu_efi_arch = ''
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001048 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001049
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001050 conf.set('ENABLE_EFI', true)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001051 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
Zbigniew Jędrzejewski-Szmek80c6fce2017-04-24 19:28:04 -04001052
1053 conf.set('SD_TPM_PCR', get_option('tpm-pcrindex').to_int())
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001054endif
1055
1056#####################################################################
1057
1058config_h = configure_file(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001059 output : 'config.h',
1060 configuration : conf)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001061
1062includes = include_directories('src/basic',
1063 'src/shared',
1064 'src/systemd',
1065 'src/journal',
1066 'src/resolve',
1067 'src/timesync',
1068 'src/login',
1069 'src/udev',
1070 'src/libudev',
1071 'src/core',
1072 'src/libsystemd/sd-bus',
1073 'src/libsystemd/sd-device',
1074 'src/libsystemd/sd-hwdb',
1075 'src/libsystemd/sd-id128',
1076 'src/libsystemd/sd-netlink',
1077 'src/libsystemd/sd-network',
1078 'src/libsystemd-network',
1079 )
1080
1081add_project_arguments('-include', 'config.h', language : 'c')
1082
1083gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1084 'src/shared/gcrypt-util.c')
1085
1086subdir('po')
1087subdir('catalog')
1088subdir('src/systemd')
1089subdir('src/basic')
1090subdir('src/libsystemd')
1091subdir('src/libsystemd-network')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001092subdir('src/journal')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001093subdir('src/login')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001094
1095libjournal_core = static_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001096 'journal-core',
1097 libjournal_core_sources,
1098 journald_gperf_c,
1099 include_directories : includes,
1100 install : false)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001101
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04001102libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001103libsystemd = shared_library(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001104 'systemd',
1105 libsystemd_internal_sources,
1106 journal_internal_sources,
Lennart Poettering43091722017-06-27 23:11:26 +02001107 version : '0.19.0',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001108 include_directories : includes,
1109 link_args : ['-shared',
1110 '-Wl,--version-script=' + libsystemd_sym_path],
1111 link_with : [libbasic],
1112 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001113 libgcrypt,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001114 librt,
1115 libxz,
1116 liblz4],
1117 link_depends : libsystemd_sym,
1118 install : true,
1119 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001120
1121############################################################
1122
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001123# binaries that have --help and are intended for use by humans,
1124# usually, but not always, installed in /bin.
1125public_programs = []
1126
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001127subdir('src/libudev')
1128subdir('src/shared')
1129subdir('src/core')
1130subdir('src/udev')
1131subdir('src/network')
1132
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001133subdir('src/analyze')
1134subdir('src/journal-remote')
1135subdir('src/coredump')
1136subdir('src/hostname')
1137subdir('src/import')
1138subdir('src/kernel-install')
1139subdir('src/locale')
1140subdir('src/machine')
1141subdir('src/nspawn')
1142subdir('src/resolve')
1143subdir('src/timedate')
1144subdir('src/timesync')
1145subdir('src/vconsole')
Zbigniew Jędrzejewski-Szmek4e4ab1c2017-04-10 12:37:52 -04001146subdir('src/sulogin-shell')
Zbigniew Jędrzejewski-Szmekb7100722017-04-12 15:05:55 -04001147subdir('src/boot/efi')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001148
1149subdir('src/test')
Zbigniew Jędrzejewski-Szmek4ff3f252017-04-13 20:47:20 -04001150subdir('test')
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04001151
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001152############################################################
1153
1154# only static linking apart from libdl, to make sure that the
1155# module is linked to all libraries that it uses.
1156test_dlopen = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001157 'test-dlopen',
1158 test_dlopen_c,
1159 include_directories : includes,
1160 link_with : [libbasic],
1161 dependencies : [libdl])
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001162
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001163foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02001164 ['systemd', 'ENABLE_NSS_SYSTEMD'],
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001165 ['mymachines', 'ENABLE_MACHINED'],
1166 ['resolve', 'ENABLE_RESOLVED']]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001167
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001168 condition = tuple[1] == '' or conf.get(tuple[1], false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001169 if condition
1170 module = tuple[0]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001171
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001172 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1173 version_script_arg = join_paths(meson.current_source_dir(), sym)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001174
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001175 nss = shared_library(
1176 'nss_' + module,
1177 'src/nss-@0@/nss-@0@.c'.format(module),
1178 version : '2',
1179 include_directories : includes,
1180 link_args : ['-shared',
1181 '-Wl,--version-script=' + version_script_arg,
1182 '-Wl,--undefined'],
1183 link_with : [libsystemd_internal,
1184 libbasic],
1185 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek5486a312017-05-12 08:31:46 -04001186 librt],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001187 link_depends : sym,
1188 install : true,
1189 install_dir : rootlibdir)
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001190
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001191 # We cannot use shared_module because it does not support version suffix.
1192 # Unfortunately shared_library insists on creating the symlink…
1193 meson.add_install_script('sh', '-c',
1194 'rm $DESTDIR@0@/libnss_@1@.so'
1195 .format(rootlibdir, module))
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001196
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001197 test('dlopen-nss_' + module,
1198 test_dlopen,
1199 args : [nss.full_path()]) # path to dlopen must include a slash
1200 endif
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001201endforeach
1202
1203############################################################
1204
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001205executable('systemd',
1206 systemd_sources,
1207 include_directories : includes,
1208 link_with : [libcore,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001209 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001210 dependencies : [threads,
1211 librt,
1212 libseccomp,
1213 libselinux,
Zbigniew Jędrzejewski-Szmekf4ee10a2017-04-09 14:08:53 -04001214 libmount,
1215 libblkid],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001216 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001217 install : true,
1218 install_dir : rootlibexecdir)
1219
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001220exe = executable('systemd-analyze',
1221 systemd_analyze_sources,
1222 include_directories : includes,
1223 link_with : [libcore,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001224 libshared],
1225 dependencies : [threads,
1226 librt,
1227 libseccomp,
1228 libselinux,
1229 libmount,
1230 libblkid],
1231 install_rpath : rootlibexecdir,
1232 install : true)
1233public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001234
1235executable('systemd-journald',
1236 systemd_journald_sources,
1237 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001238 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001239 libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001240 dependencies : [threads,
1241 libxz,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001242 liblz4,
1243 libselinux],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001244 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001245 install : true,
1246 install_dir : rootlibexecdir)
1247
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001248exe = executable('systemd-cat',
1249 systemd_cat_sources,
1250 include_directories : includes,
1251 link_with : [libjournal_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001252 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001253 dependencies : [threads],
1254 install_rpath : rootlibexecdir,
1255 install : true)
1256public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001257
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001258exe = executable('journalctl',
1259 journalctl_sources,
1260 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001261 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001262 dependencies : [threads,
1263 libqrencode,
1264 libxz,
1265 liblz4],
1266 install_rpath : rootlibexecdir,
1267 install : true,
1268 install_dir : rootbindir)
1269public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001270
1271executable('systemd-getty-generator',
1272 'src/getty-generator/getty-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001273 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001274 link_with : [libshared],
1275 install_rpath : rootlibexecdir,
1276 install : true,
1277 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001278
1279executable('systemd-debug-generator',
1280 'src/debug-generator/debug-generator.c',
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001281 include_directories : includes,
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001282 link_with : [libshared],
1283 install_rpath : rootlibexecdir,
1284 install : true,
1285 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001286
1287executable('systemd-fstab-generator',
1288 'src/fstab-generator/fstab-generator.c',
1289 'src/core/mount-setup.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
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001296if conf.get('ENABLE_ENVIRONMENT_D', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001297 executable('30-systemd-environment-d-generator',
1298 'src/environment-d-generator/environment-d-generator.c',
1299 include_directories : includes,
1300 link_with : [libshared],
1301 install_rpath : rootlibexecdir,
1302 install : true,
1303 install_dir : userenvgeneratordir)
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001304
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001305 meson.add_install_script(meson_make_symlink,
1306 join_paths(sysconfdir, 'environment'),
1307 join_paths(environmentdir, '99-environment.conf'))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001308endif
1309
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001310if conf.get('ENABLE_HIBERNATE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001311 executable('systemd-hibernate-resume-generator',
1312 'src/hibernate-resume/hibernate-resume-generator.c',
1313 include_directories : includes,
1314 link_with : [libshared],
1315 install_rpath : rootlibexecdir,
1316 install : true,
1317 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001318
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001319 executable('systemd-hibernate-resume',
1320 'src/hibernate-resume/hibernate-resume.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001321 include_directories : includes,
1322 link_with : [libshared],
1323 install_rpath : rootlibexecdir,
1324 install : true,
1325 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001326endif
1327
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001328if conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001329 executable('systemd-gpt-auto-generator',
1330 'src/gpt-auto-generator/gpt-auto-generator.c',
1331 'src/basic/blkid-util.h',
1332 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001333 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001334 dependencies : libblkid,
1335 install_rpath : rootlibexecdir,
1336 install : true,
1337 install_dir : systemgeneratordir)
1338
1339 exe = executable('systemd-dissect',
1340 'src/dissect/dissect.c',
1341 include_directories : includes,
1342 link_with : [libshared],
1343 install_rpath : rootlibexecdir,
1344 install : true,
1345 install_dir : rootlibexecdir)
1346 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001347endif
1348
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001349if conf.get('ENABLE_RESOLVED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001350 executable('systemd-resolved',
1351 systemd_resolved_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001352 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001353 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001354 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001355 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001356 libgcrypt,
1357 libgpg_error,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001358 libm,
1359 libidn],
1360 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001361 install : true,
1362 install_dir : rootlibexecdir)
1363
1364 exe = executable('systemd-resolve',
1365 systemd_resolve_sources,
Michael Biebl76c87412017-04-21 23:45:54 +02001366 gcrypt_util_sources,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001367 include_directories : includes,
1368 link_with : [libshared],
1369 dependencies : [threads,
Michael Biebl76c87412017-04-21 23:45:54 +02001370 libgcrypt,
1371 libgpg_error,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001372 libm,
1373 libidn],
1374 install_rpath : rootlibexecdir,
1375 install : true)
1376 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001377endif
1378
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001379if conf.get('ENABLE_LOGIND', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001380 executable('systemd-logind',
1381 systemd_logind_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001382 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001383 link_with : [liblogind_core,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001384 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001385 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001386 libacl],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001387 install_rpath : rootlibexecdir,
1388 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001389 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001390
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001391 exe = executable('loginctl',
1392 loginctl_sources,
1393 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001394 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001395 dependencies : [threads,
1396 liblz4,
1397 libxz],
1398 install_rpath : rootlibexecdir,
1399 install : true,
1400 install_dir : rootbindir)
1401 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001402
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001403 exe = executable('systemd-inhibit',
1404 'src/login/inhibit.c',
1405 include_directories : includes,
1406 link_with : [libshared],
1407 install_rpath : rootlibexecdir,
1408 install : true,
1409 install_dir : rootbindir)
1410 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek83b6af32017-04-14 20:10:28 -04001411
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001412 if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001413 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1414 pam_systemd = shared_library(
1415 'pam_systemd',
1416 pam_systemd_c,
1417 name_prefix : '',
1418 include_directories : includes,
1419 link_args : ['-shared',
1420 '-Wl,--version-script=' + version_script_arg],
1421 link_with : [libsystemd_internal,
1422 libshared_static],
1423 dependencies : [threads,
1424 libpam,
1425 libpam_misc],
1426 link_depends : pam_systemd_sym,
1427 install : true,
1428 install_dir : pamlibdir)
1429
1430 test('dlopen-pam_systemd',
1431 test_dlopen,
1432 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1433 endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001434endif
1435
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001436if conf.get('HAVE_PAM', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001437 executable('systemd-user-sessions',
1438 'src/user-sessions/user-sessions.c',
1439 include_directories : includes,
1440 link_with : [libshared],
1441 install_rpath : rootlibexecdir,
1442 install : true,
1443 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001444endif
1445
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001446if conf.get('ENABLE_EFI', false) and conf.get('HAVE_BLKID', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001447 exe = executable('bootctl',
1448 'src/boot/bootctl.c',
1449 include_directories : includes,
1450 link_with : [libshared],
1451 dependencies : [libblkid],
1452 install_rpath : rootlibexecdir,
1453 install : true)
1454 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001455endif
1456
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001457exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1458 include_directories : includes,
1459 link_with : [libshared],
1460 dependencies : [threads],
1461 install_rpath : rootlibexecdir,
1462 install : true)
1463public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001464
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001465exe = executable('systemctl', 'src/systemctl/systemctl.c',
1466 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001467 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001468 dependencies : [threads,
1469 libcap,
1470 libselinux,
1471 libxz,
1472 liblz4],
1473 install_rpath : rootlibexecdir,
1474 install : true,
1475 install_dir : rootbindir)
1476public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001477
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001478if conf.get('ENABLE_BACKLIGHT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001479 executable('systemd-backlight',
1480 'src/backlight/backlight.c',
1481 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001482 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001483 install_rpath : rootlibexecdir,
1484 install : true,
1485 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001486endif
1487
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001488if conf.get('ENABLE_RFKILL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001489 executable('systemd-rfkill',
1490 'src/rfkill/rfkill.c',
1491 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001492 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001493 install_rpath : rootlibexecdir,
1494 install : true,
1495 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001496endif
1497
1498executable('systemd-system-update-generator',
1499 'src/system-update-generator/system-update-generator.c',
1500 include_directories : includes,
1501 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001502 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001503 install : true,
1504 install_dir : systemgeneratordir)
1505
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001506if conf.get('HAVE_LIBCRYPTSETUP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001507 executable('systemd-cryptsetup',
1508 'src/cryptsetup/cryptsetup.c',
1509 include_directories : includes,
1510 link_with : [libshared],
1511 dependencies : [libcryptsetup],
1512 install_rpath : rootlibexecdir,
1513 install : true,
1514 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001515
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001516 executable('systemd-cryptsetup-generator',
1517 'src/cryptsetup/cryptsetup-generator.c',
1518 include_directories : includes,
1519 link_with : [libshared],
1520 dependencies : [libcryptsetup],
1521 install_rpath : rootlibexecdir,
1522 install : true,
1523 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001524
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001525 executable('systemd-veritysetup',
1526 'src/veritysetup/veritysetup.c',
1527 include_directories : includes,
1528 link_with : [libshared],
1529 dependencies : [libcryptsetup],
1530 install_rpath : rootlibexecdir,
1531 install : true,
1532 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001533
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001534 executable('systemd-veritysetup-generator',
1535 'src/veritysetup/veritysetup-generator.c',
1536 include_directories : includes,
1537 link_with : [libshared],
1538 dependencies : [libcryptsetup],
1539 install_rpath : rootlibexecdir,
1540 install : true,
1541 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001542endif
1543
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001544if conf.get('HAVE_SYSV_COMPAT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001545 executable('systemd-sysv-generator',
1546 'src/sysv-generator/sysv-generator.c',
1547 include_directories : includes,
1548 link_with : [libshared],
1549 install_rpath : rootlibexecdir,
1550 install : true,
1551 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001552
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001553 executable('systemd-rc-local-generator',
1554 'src/rc-local-generator/rc-local-generator.c',
1555 include_directories : includes,
1556 link_with : [libshared],
1557 install_rpath : rootlibexecdir,
1558 install : true,
1559 install_dir : systemgeneratordir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001560endif
1561
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001562if conf.get('ENABLE_HOSTNAMED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001563 executable('systemd-hostnamed',
1564 'src/hostname/hostnamed.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001565 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001566 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001567 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001568 install : true,
1569 install_dir : rootlibexecdir)
1570
1571 exe = executable('hostnamectl',
1572 'src/hostname/hostnamectl.c',
1573 include_directories : includes,
1574 link_with : [libshared],
1575 install_rpath : rootlibexecdir,
1576 install : true)
1577 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001578endif
1579
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001580if conf.get('ENABLE_LOCALED', false)
1581 if conf.get('HAVE_XKBCOMMON', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001582 # logind will load libxkbcommon.so dynamically on its own
1583 deps = [libdl]
1584 else
1585 deps = []
1586 endif
Zbigniew Jędrzejewski-Szmek1eeb43f2017-04-13 19:37:14 -04001587
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001588 executable('systemd-localed',
1589 systemd_localed_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001590 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001591 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001592 dependencies : deps,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001593 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001594 install : true,
1595 install_dir : rootlibexecdir)
1596
1597 exe = executable('localectl',
1598 localectl_sources,
1599 include_directories : includes,
1600 link_with : [libshared],
1601 install_rpath : rootlibexecdir,
1602 install : true)
1603 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001604endif
1605
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001606if conf.get('ENABLE_TIMEDATED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001607 executable('systemd-timedated',
1608 'src/timedate/timedated.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001609 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001610 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001611 install_rpath : rootlibexecdir,
1612 install : true,
1613 install_dir : rootlibexecdir)
1614
1615 exe = executable('timedatectl',
1616 'src/timedate/timedatectl.c',
1617 include_directories : includes,
1618 install_rpath : rootlibexecdir,
1619 link_with : [libshared],
1620 install : true)
1621 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001622endif
1623
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001624if conf.get('ENABLE_TIMESYNCD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001625 executable('systemd-timesyncd',
1626 systemd_timesyncd_sources,
1627 include_directories : includes,
1628 link_with : [libshared],
1629 dependencies : [threads,
1630 libm],
1631 install_rpath : rootlibexecdir,
1632 install : true,
1633 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001634endif
1635
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001636if conf.get('ENABLE_MACHINED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001637 executable('systemd-machined',
1638 systemd_machined_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001639 include_directories : includes,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001640 link_with : [libmachine_core,
1641 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001642 install_rpath : rootlibexecdir,
1643 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001644 install_dir : rootlibexecdir)
1645
1646 exe = executable('machinectl',
1647 'src/machine/machinectl.c',
1648 include_directories : includes,
1649 link_with : [libshared],
1650 dependencies : [threads,
1651 libxz,
1652 liblz4],
1653 install_rpath : rootlibexecdir,
1654 install : true,
1655 install_dir : rootbindir)
1656 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001657endif
1658
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001659if conf.get('ENABLE_IMPORTD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001660 executable('systemd-importd',
1661 systemd_importd_sources,
1662 include_directories : includes,
1663 link_with : [libshared],
1664 dependencies : [threads],
1665 install_rpath : rootlibexecdir,
1666 install : true,
1667 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001668
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001669 systemd_pull = executable('systemd-pull',
1670 systemd_pull_sources,
1671 include_directories : includes,
1672 link_with : [libshared],
1673 dependencies : [libcurl,
1674 libz,
1675 libbzip2,
1676 libxz,
1677 libgcrypt],
1678 install_rpath : rootlibexecdir,
1679 install : true,
1680 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001681
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001682 systemd_import = executable('systemd-import',
1683 systemd_import_sources,
1684 include_directories : includes,
1685 link_with : [libshared],
1686 dependencies : [libcurl,
1687 libz,
1688 libbzip2,
1689 libxz],
1690 install_rpath : rootlibexecdir,
1691 install : true,
1692 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001693
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001694 systemd_export = executable('systemd-export',
1695 systemd_export_sources,
1696 include_directories : includes,
1697 link_with : [libshared],
1698 dependencies : [libcurl,
1699 libz,
1700 libbzip2,
1701 libxz],
1702 install_rpath : rootlibexecdir,
1703 install : true,
1704 install_dir : rootlibexecdir)
1705 public_programs += [systemd_pull, systemd_import, systemd_export]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001706endif
1707
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001708if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_LIBCURL', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001709 exe = executable('systemd-journal-upload',
1710 systemd_journal_upload_sources,
1711 include_directories : includes,
1712 link_with : [libshared],
1713 dependencies : [threads,
1714 libcurl,
1715 libgnutls,
1716 libxz,
1717 liblz4],
1718 install_rpath : rootlibexecdir,
1719 install : true,
1720 install_dir : rootlibexecdir)
1721 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001722endif
1723
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001724if conf.get('ENABLE_REMOTE', false) and conf.get('HAVE_MICROHTTPD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001725 s_j_remote = executable('systemd-journal-remote',
1726 systemd_journal_remote_sources,
1727 include_directories : includes,
1728 link_with : [libshared],
1729 dependencies : [threads,
1730 libmicrohttpd,
1731 libgnutls,
1732 libxz,
1733 liblz4],
1734 install_rpath : rootlibexecdir,
1735 install : true,
1736 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001737
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001738 s_j_gatewayd = executable('systemd-journal-gatewayd',
1739 systemd_journal_gatewayd_sources,
1740 include_directories : includes,
1741 link_with : [libshared],
1742 dependencies : [threads,
1743 libmicrohttpd,
1744 libgnutls,
1745 libxz,
1746 liblz4],
1747 install_rpath : rootlibexecdir,
1748 install : true,
1749 install_dir : rootlibexecdir)
1750 public_programs += [s_j_remote, s_j_gatewayd]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001751endif
1752
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001753if conf.get('ENABLE_COREDUMP', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001754 executable('systemd-coredump',
1755 systemd_coredump_sources,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001756 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001757 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001758 dependencies : [threads,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001759 libacl,
1760 libdw,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001761 libxz,
1762 liblz4],
1763 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001764 install : true,
1765 install_dir : rootlibexecdir)
1766
1767 exe = executable('coredumpctl',
1768 coredumpctl_sources,
1769 include_directories : includes,
1770 link_with : [libshared],
1771 dependencies : [threads,
1772 libxz,
1773 liblz4],
1774 install_rpath : rootlibexecdir,
1775 install : true)
1776 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001777endif
1778
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001779if conf.get('ENABLE_BINFMT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001780 exe = executable('systemd-binfmt',
1781 'src/binfmt/binfmt.c',
1782 include_directories : includes,
1783 link_with : [libshared],
1784 install_rpath : rootlibexecdir,
1785 install : true,
1786 install_dir : rootlibexecdir)
1787 public_programs += [exe]
1788
1789 meson.add_install_script('sh', '-c',
1790 mkdir_p.format(binfmtdir))
1791 meson.add_install_script('sh', '-c',
1792 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1793endif
1794
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001795if conf.get('ENABLE_VCONSOLE', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001796 executable('systemd-vconsole-setup',
1797 'src/vconsole/vconsole-setup.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001798 include_directories : includes,
1799 link_with : [libshared],
1800 install_rpath : rootlibexecdir,
1801 install : true,
1802 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001803endif
1804
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001805if conf.get('ENABLE_RANDOMSEED', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001806 executable('systemd-random-seed',
1807 'src/random-seed/random-seed.c',
1808 include_directories : includes,
1809 link_with : [libshared],
1810 install_rpath : rootlibexecdir,
1811 install : true,
1812 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001813endif
1814
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04001815if conf.get('ENABLE_FIRSTBOOT', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04001816 executable('systemd-firstboot',
1817 'src/firstboot/firstboot.c',
1818 include_directories : includes,
1819 link_with : [libshared],
1820 dependencies : [libcrypt],
1821 install_rpath : rootlibexecdir,
1822 install : true,
1823 install_dir : rootbindir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001824endif
1825
1826executable('systemd-remount-fs',
1827 'src/remount-fs/remount-fs.c',
1828 'src/core/mount-setup.c',
1829 'src/core/mount-setup.h',
1830 include_directories : includes,
1831 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001832 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001833 install : true,
1834 install_dir : rootlibexecdir)
1835
1836executable('systemd-machine-id-setup',
1837 'src/machine-id-setup/machine-id-setup-main.c',
1838 'src/core/machine-id-setup.c',
1839 'src/core/machine-id-setup.h',
1840 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001841 link_with : [libshared],
Zbigniew Jędrzejewski-Szmekb2fc5832017-04-10 18:13:00 -04001842 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001843 install : true,
1844 install_dir : rootbindir)
1845
1846executable('systemd-fsck',
1847 'src/fsck/fsck.c',
1848 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001849 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001850 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001851 install : true,
1852 install_dir : rootlibexecdir)
1853
1854executable('systemd-sleep',
1855 'src/sleep/sleep.c',
1856 include_directories : includes,
1857 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001858 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001859 install : true,
1860 install_dir : rootlibexecdir)
1861
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001862exe = executable('systemd-sysctl',
1863 'src/sysctl/sysctl.c',
1864 include_directories : includes,
1865 link_with : [libshared],
1866 install_rpath : rootlibexecdir,
1867 install : true,
1868 install_dir : rootlibexecdir)
1869public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001870
1871executable('systemd-ac-power',
1872 'src/ac-power/ac-power.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-detect-virt',
1880 'src/detect-virt/detect-virt.c',
1881 include_directories : includes,
1882 link_with : [libshared],
1883 install_rpath : rootlibexecdir,
1884 install : true)
1885public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001886
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001887exe = executable('systemd-delta',
1888 'src/delta/delta.c',
1889 include_directories : includes,
1890 link_with : [libshared],
1891 install_rpath : rootlibexecdir,
1892 install : true)
1893public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001894
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001895exe = executable('systemd-escape',
1896 'src/escape/escape.c',
1897 include_directories : includes,
1898 link_with : [libshared],
1899 install_rpath : rootlibexecdir,
1900 install : true,
1901 install_dir : rootbindir)
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-notify',
1905 'src/notify/notify.c',
1906 include_directories : includes,
1907 link_with : [libshared],
1908 install_rpath : rootlibexecdir,
1909 install : true,
1910 install_dir : rootbindir)
1911public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001912
1913executable('systemd-volatile-root',
1914 'src/volatile-root/volatile-root.c',
1915 include_directories : includes,
1916 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001917 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001918 install : true,
1919 install_dir : rootlibexecdir)
1920
1921executable('systemd-cgroups-agent',
1922 'src/cgroups-agent/cgroups-agent.c',
1923 include_directories : includes,
1924 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001925 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001926 install : true,
1927 install_dir : rootlibexecdir)
1928
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001929exe = executable('systemd-path',
1930 'src/path/path.c',
1931 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001932 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001933 install_rpath : rootlibexecdir,
1934 install : true)
1935public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001936
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001937exe = executable('systemd-ask-password',
1938 'src/ask-password/ask-password.c',
1939 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001940 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001941 install_rpath : rootlibexecdir,
1942 install : true,
1943 install_dir : rootbindir)
1944public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001945
1946executable('systemd-reply-password',
1947 'src/reply-password/reply-password.c',
1948 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001949 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001950 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001951 install : true,
1952 install_dir : rootlibexecdir)
1953
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001954exe = executable('systemd-tty-ask-password-agent',
1955 'src/tty-ask-password-agent/tty-ask-password-agent.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
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001963exe = executable('systemd-cgls',
1964 'src/cgls/cgls.c',
1965 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001966 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001967 install_rpath : rootlibexecdir,
1968 install : true)
1969public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001970
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001971exe = executable('systemd-cgtop',
1972 'src/cgtop/cgtop.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)
1977public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001978
1979executable('systemd-initctl',
1980 'src/initctl/initctl.c',
1981 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04001982 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04001983 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001984 install : true,
1985 install_dir : rootlibexecdir)
1986
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001987exe = executable('systemd-mount',
1988 'src/mount/mount-tool.c',
1989 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02001990 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001991 install_rpath : rootlibexecdir,
1992 install : true)
1993public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04001994
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001995meson.add_install_script(meson_make_symlink,
Michael Bieble17e5ba2017-04-13 10:30:56 -04001996 'systemd-mount', join_paths(bindir, 'systemd-umount'))
Zbigniew Jędrzejewski-Szmek7b76fce2017-04-09 23:55:50 -04001997
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04001998exe = executable('systemd-run',
1999 'src/run/run.c',
2000 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002001 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002002 install_rpath : rootlibexecdir,
2003 install : true)
2004public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002005
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002006exe = executable('systemd-stdio-bridge',
2007 'src/stdio-bridge/stdio-bridge.c',
2008 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002009 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002010 install_rpath : rootlibexecdir,
2011 install : true)
2012public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002013
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002014exe = executable('busctl',
2015 'src/busctl/busctl.c',
2016 'src/busctl/busctl-introspect.c',
2017 'src/busctl/busctl-introspect.h',
2018 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002019 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002020 install_rpath : rootlibexecdir,
2021 install : true)
2022public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002023
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002024if conf.get('ENABLE_SYSUSERS', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002025 exe = executable('systemd-sysusers',
2026 'src/sysusers/sysusers.c',
2027 include_directories : includes,
2028 link_with : [libshared],
2029 install_rpath : rootlibexecdir,
2030 install : true,
2031 install_dir : rootbindir)
2032 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002033endif
2034
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002035if conf.get('ENABLE_TMPFILES', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002036 exe = executable('systemd-tmpfiles',
2037 'src/tmpfiles/tmpfiles.c',
2038 include_directories : includes,
2039 link_with : [libshared],
2040 dependencies : [libacl],
2041 install_rpath : rootlibexecdir,
2042 install : true,
2043 install_dir : rootbindir)
2044 public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002045endif
2046
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002047if conf.get('ENABLE_HWDB', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002048 exe = executable('systemd-hwdb',
2049 'src/hwdb/hwdb.c',
2050 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2051 include_directories : includes,
Michael Biebl0da6f392017-04-21 18:32:14 +02002052 link_with : [libudev_internal],
2053 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002054 install : true,
2055 install_dir : rootbindir)
2056 public_programs += [exe]
2057endif
2058
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002059if conf.get('ENABLE_QUOTACHECK', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002060 executable('systemd-quotacheck',
2061 'src/quotacheck/quotacheck.c',
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002062 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002063 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002064 install_rpath : rootlibexecdir,
2065 install : true,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002066 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002067endif
2068
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002069exe = executable('systemd-socket-proxyd',
2070 'src/socket-proxy/socket-proxyd.c',
2071 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002072 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002073 dependencies : [threads],
2074 install_rpath : rootlibexecdir,
2075 install : true,
2076 install_dir : rootlibexecdir)
2077public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002078
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002079exe = executable('systemd-udevd',
2080 systemd_udevd_sources,
2081 include_directories : includes,
Zbigniew Jędrzejewski-Szmek5c720492017-02-22 23:13:22 -05002082 c_args : ['-DLOG_REALM=LOG_REALM_UDEV'],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002083 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002084 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002085 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002086 dependencies : [threads,
2087 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002088 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002089 libacl,
2090 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002091 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002092 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('udevadm',
2097 udevadm_sources,
2098 include_directories : includes,
2099 link_with : [libudev_core,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002100 libsystemd_network,
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002101 libudev_internal],
Zbigniew Jędrzejewski-Szmek3a30f212017-04-17 12:07:12 -04002102 dependencies : [threads,
2103 libkmod,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002104 libidn,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002105 libacl,
2106 libblkid],
Zbigniew Jędrzejewski-Szmek1aec3ed2017-04-17 19:33:10 -04002107 install_rpath : udev_rpath,
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002108 install : true,
2109 install_dir : rootbindir)
2110public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002111
2112executable('systemd-shutdown',
2113 systemd_shutdown_sources,
2114 include_directories : includes,
Michael Biebl34ce0a52017-04-25 20:19:54 +02002115 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002116 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002117 install : true,
2118 install_dir : rootlibexecdir)
2119
2120executable('systemd-update-done',
2121 'src/update-done/update-done.c',
2122 include_directories : includes,
2123 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek421f0012017-04-12 12:02:30 -04002124 install_rpath : rootlibexecdir,
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002125 install : true,
2126 install_dir : rootlibexecdir)
2127
2128executable('systemd-update-utmp',
2129 'src/update-utmp/update-utmp.c',
2130 include_directories : includes,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002131 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002132 dependencies : [libaudit],
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
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002137if conf.get('HAVE_KMOD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002138 executable('systemd-modules-load',
2139 'src/modules-load/modules-load.c',
2140 include_directories : includes,
2141 link_with : [libshared],
2142 dependencies : [libkmod],
2143 install_rpath : rootlibexecdir,
2144 install : true,
2145 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002146
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002147 meson.add_install_script('sh', '-c',
2148 mkdir_p.format(modulesloaddir))
2149 meson.add_install_script('sh', '-c',
2150 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002151endif
2152
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002153exe = executable('systemd-nspawn',
2154 systemd_nspawn_sources,
2155 'src/core/mount-setup.c', # FIXME: use a variable?
2156 'src/core/mount-setup.h',
2157 'src/core/loopback-setup.c',
2158 'src/core/loopback-setup.h',
2159 include_directories : [includes, include_directories('src/nspawn')],
Zbigniew Jędrzejewski-Szmek0bc91152017-04-27 13:39:54 -04002160 link_with : [libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002161 dependencies : [libacl,
2162 libblkid,
2163 libseccomp,
2164 libselinux],
2165 install_rpath : rootlibexecdir,
2166 install : true)
2167public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002168
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002169if conf.get('ENABLE_NETWORKD', false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002170 executable('systemd-networkd',
2171 systemd_networkd_sources,
2172 include_directories : includes,
2173 link_with : [libnetworkd_core,
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002174 libsystemd_network,
2175 libudev_internal,
2176 libshared],
Zbigniew Jędrzejewski-Szmek4b57a272017-06-21 06:05:15 -04002177 dependencies : [threads],
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002178 install_rpath : rootlibexecdir,
2179 install : true,
2180 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002181
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002182 executable('systemd-networkd-wait-online',
2183 systemd_networkd_wait_online_sources,
2184 include_directories : includes,
2185 link_with : [libnetworkd_core,
2186 libshared],
2187 install_rpath : rootlibexecdir,
2188 install : true,
2189 install_dir : rootlibexecdir)
Zbigniew Jędrzejewski-Szmekf0bd7cc2017-04-12 12:14:30 -04002190endif
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002191
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002192exe = executable('networkctl',
2193 networkctl_sources,
2194 include_directories : includes,
2195 link_with : [libsystemd_network,
Zbigniew Jędrzejewski-Szmekaac26052017-04-14 18:49:47 -04002196 libshared],
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002197 install_rpath : rootlibexecdir,
2198 install : true,
2199 install_dir : rootbindir)
2200public_programs += [exe]
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002201
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002202############################################################
2203
2204foreach tuple : tests
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002205 sources = tuple[0]
2206 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2207 dependencies = tuple[2]
2208 condition = tuple.length() >= 4 ? tuple[3] : ''
2209 type = tuple.length() >= 5 ? tuple[4] : ''
2210 defs = tuple.length() >= 6 ? tuple[5] : []
2211 incs = tuple.length() >= 7 ? tuple[6] : includes
2212 timeout = 30
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002213
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002214 name = sources[0].split('/')[-1].split('.')[0]
2215 if type.startswith('timeout=')
2216 timeout = type.split('=')[1].to_int()
2217 type = ''
2218 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002219
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002220 if condition == '' or conf.get(condition, false)
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002221 exe = executable(
2222 name,
2223 sources,
2224 include_directories : incs,
2225 link_with : link_with,
2226 dependencies : dependencies,
2227 c_args : defs,
2228 install_rpath : rootlibexecdir,
Michael Biebl7cdd9782017-06-23 03:23:30 +02002229 install : install_tests,
2230 install_dir : join_paths(testsdir, type))
Zbigniew Jędrzejewski-Szmek572baca2017-04-08 01:55:38 -04002231
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002232 if type == 'manual'
2233 message('@0@ is a manual test'.format(name))
2234 elif type == 'unsafe' and want_tests != 'unsafe'
2235 message('@0@ is an unsafe test'.format(name))
2236 else
2237 test(name, exe,
2238 env : test_env,
2239 timeout : timeout)
2240 endif
2241 else
2242 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2243 endif
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002244endforeach
2245
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002246test_libsystemd_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002247 'test-libsystemd-sym',
2248 test_libsystemd_sym_c,
2249 include_directories : includes,
2250 link_with : [libsystemd],
2251 install : install_tests,
2252 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmek37ab1a22017-04-10 14:13:40 -04002253test('test-libsystemd-sym',
2254 test_libsystemd_sym)
2255
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002256test_libudev_sym = executable(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002257 'test-libudev-sym',
2258 test_libudev_sym_c,
2259 include_directories : includes,
2260 c_args : ['-Wno-deprecated-declarations'],
2261 link_with : [libudev],
2262 install : install_tests,
2263 install_dir : testsdir)
Zbigniew Jędrzejewski-Szmeke0bec522017-04-10 15:20:42 -04002264test('test-libudev-sym',
2265 test_libudev_sym)
2266
Zbigniew Jędrzejewski-Szmek69e96422017-04-07 00:19:09 -04002267############################################################
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002268
2269make_directive_index_py = find_program('tools/make-directive-index.py')
2270make_man_index_py = find_program('tools/make-man-index.py')
Zbigniew Jędrzejewski-Szmekb184e8f2017-04-13 19:59:21 -04002271xml_helper_py = find_program('tools/xml_helper.py')
Zbigniew Jędrzejewski-Szmekabba22c2017-04-15 00:40:59 -04002272hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
Zbigniew Jędrzejewski-Szmek5c231282017-04-04 23:03:47 -04002273
2274subdir('units')
2275subdir('sysctl.d')
2276subdir('sysusers.d')
2277subdir('tmpfiles.d')
2278subdir('rules')
2279subdir('hwdb')
2280subdir('network')
2281subdir('man')
2282subdir('shell-completion/bash')
2283subdir('shell-completion/zsh')
2284subdir('docs/sysvinit')
2285subdir('docs/var-log')
2286
2287# FIXME: figure out if the warning is true:
2288# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2289install_subdir('factory/etc',
2290 install_dir : factorydir)
2291
2292
2293install_data('xorg/50-systemd-user.sh',
2294 install_dir : xinitrcdir)
2295install_data('system-preset/90-systemd.preset',
2296 install_dir : systempresetdir)
2297install_data('README',
2298 'NEWS',
2299 'CODING_STYLE',
2300 'DISTRO_PORTING',
2301 'ENVIRONMENT.md',
2302 'LICENSE.GPL2',
2303 'LICENSE.LGPL2.1',
2304 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2305 install_dir : docdir)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002306
Zbigniew Jędrzejewski-Szmek94e75a52017-04-09 23:55:05 -04002307meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2308meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2309
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002310############################################################
2311
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002312meson_check_help = find_program('tools/meson-check-help.sh')
2313
2314foreach exec : public_programs
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002315 name = exec.full_path().split('/')[-1]
2316 test('check-help-' + name,
2317 meson_check_help,
2318 args : [exec.full_path()])
Zbigniew Jędrzejewski-Szmek005a29f2017-04-13 11:52:05 -04002319endforeach
2320
2321############################################################
2322
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002323if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002324 all_files = run_command(
2325 git,
2326 ['--git-dir=@0@/.git'.format(meson.source_root()),
2327 'ls-files',
2328 ':/*.[ch]'])
2329 all_files = files(all_files.stdout().split())
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002330
Zbigniew Jędrzejewski-Szmek341b8922017-05-30 19:56:12 -04002331 run_target(
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002332 'tags',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002333 input : all_files,
Zbigniew Jędrzejewski-Szmek0700e8b2017-07-03 12:42:29 -04002334 command : ['env', 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
2335 run_target(
2336 'ctags',
2337 input : all_files,
2338 command : ['env', 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
Zbigniew Jędrzejewski-Szmekd68b3422017-04-06 14:33:27 -04002339endif
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002340
2341if git.found()
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002342 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
Zbigniew Jędrzejewski-Szmeka923e082017-04-17 19:48:20 -04002343 run_target(
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002344 'git-contrib',
Zbigniew Jędrzejewski-Szmek37efbbd2017-04-17 19:25:00 -04002345 command : [meson_git_contrib_sh])
Zbigniew Jędrzejewski-Szmek177929c2017-04-15 00:16:23 -04002346endif
Zbigniew Jędrzejewski-Szmekdd6ab3d2017-04-24 19:28:05 -04002347
2348if git.found()
2349 git_head = run_command(
2350 git,
2351 ['--git-dir=@0@/.git'.format(meson.source_root()),
2352 'rev-parse', 'HEAD']).stdout().strip()
2353 git_head_short = run_command(
2354 git,
2355 ['--git-dir=@0@/.git'.format(meson.source_root()),
2356 'rev-parse', '--short=7', 'HEAD']).stdout().strip()
2357
2358 run_target(
2359 'git-snapshot',
2360 command : ['git', 'archive',
2361 '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
2362 git_head_short),
2363 '--prefix', 'systemd-@0@/'.format(git_head),
2364 'HEAD'])
2365endif
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002366
2367############################################################
2368
2369status = [
2370 '@0@ @1@'.format(meson.project_name(), meson.project_version()),
2371
2372 'prefix: @0@'.format(prefixdir),
2373 'rootprefix: @0@'.format(rootprefixdir),
2374 'sysconf dir: @0@'.format(sysconfdir),
2375 'includedir: @0@'.format(includedir),
2376 'lib dir: @0@'.format(libdir),
2377 'rootlib dir: @0@'.format(rootlibdir),
2378 'SysV init scripts: @0@'.format(sysvinit_path),
2379 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
2380 'PAM modules dir: @0@'.format(pamlibdir),
2381 'PAM configuration dir: @0@'.format(pamconfdir),
2382 'RPM macros dir: @0@'.format(rpmmacrosdir),
2383 'D-Bus policy dir: @0@'.format(dbuspolicydir),
2384 'D-Bus session dir: @0@'.format(dbussessionservicedir),
2385 'D-Bus system dir: @0@'.format(dbussystemservicedir),
2386 'bash completions dir: @0@'.format(bashcompletiondir),
2387 'zsh completions dir: @0@'.format(zshcompletiondir),
2388 'extra start script: @0@'.format(get_option('rc-local')),
2389 'extra stop script: @0@'.format(get_option('halt-local')),
2390 'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
2391 get_option('debug-tty')),
2392 'TTY GID: @0@'.format(tty_gid),
2393 'maximum system UID: @0@'.format(system_uid_max),
2394 'maximum system GID: @0@'.format(system_gid_max),
2395 '/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
2396 'certificate root: @0@'.format(get_option('certificate-root')),
2397 'support URL: @0@'.format(support_url),
2398 'nobody user name: @0@'.format(get_option('nobody-user')),
2399 'nobody group name: @0@'.format(get_option('nobody-group')),
2400 'fallback hostname: @0@'.format(get_option('fallback-hostname')),
2401
2402 'default DNSSEC mode: @0@'.format(default_dnssec),
2403 'default cgroup hierarchy: @0@'.format(default_hierarchy),
2404 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
2405
2406alt_dns_servers = '\n '.join(dns_servers.split(' '))
2407alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
2408status += [
2409 'default DNS servers: @0@'.format(alt_dns_servers),
2410 'default NTP servers: @0@'.format(alt_ntp_servers)]
2411
2412alt_time_epoch = run_command('date', '-Is', '-u', '-d',
2413 '@@0@'.format(time_epoch)).stdout().strip()
2414status += [
2415 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)]
2416
2417# TODO:
2418# CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
2419# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
2420# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
2421
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002422if conf.get('ENABLE_EFI', false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002423 status += [
2424 'efi arch: @0@'.format(efi_arch)]
2425
2426 if have_gnu_efi
2427 status += [
2428 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME),
2429 'EFI CC @0@'.format(efi_cc),
2430 'EFI libdir: @0@'.format(efi_libdir),
2431 'EFI ldsdir: @0@'.format(efi_ldsdir),
2432 'EFI includedir: @0@'.format(efi_incdir)]
2433 endif
2434endif
2435
2436found = []
2437missing = []
2438
2439foreach tuple : [
2440 ['libcryptsetup'],
2441 ['PAM'],
2442 ['AUDIT'],
2443 ['IMA'],
2444 ['AppArmor'],
2445 ['SELinux'],
2446 ['SECCOMP'],
2447 ['SMACK'],
2448 ['zlib'],
2449 ['xz'],
2450 ['lz4'],
2451 ['bzip2'],
2452 ['ACL'],
2453 ['gcrypt'],
2454 ['qrencode'],
2455 ['microhttpd'],
2456 ['gnutls'],
2457 ['libcurl'],
Zbigniew Jędrzejewski-Szmekd1bf5672017-06-16 09:16:28 -04002458 ['idn'],
Zbigniew Jędrzejewski-Szmek87057e22017-05-09 21:56:34 -04002459 ['libidn2'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002460 ['libidn'],
Waldemar Brodkorbe7e11bb2017-06-24 19:30:26 +02002461 ['nss-systemd'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002462 ['libiptc'],
2463 ['elfutils'],
2464 ['binfmt'],
2465 ['vconsole'],
2466 ['quotacheck'],
2467 ['tmpfiles'],
2468 ['environment.d'],
2469 ['sysusers'],
2470 ['firstboot'],
2471 ['randomseed'],
2472 ['backlight'],
2473 ['rfkill'],
2474 ['logind'],
2475 ['machined'],
2476 ['importd'],
2477 ['hostnamed'],
2478 ['timedated'],
2479 ['timesyncd'],
2480 ['localed'],
2481 ['networkd'],
2482 ['resolved'],
2483 ['coredump'],
2484 ['polkit'],
2485 ['legacy pkla', install_polkit_pkla],
2486 ['efi'],
2487 ['gnu-efi', have_gnu_efi],
2488 ['kmod'],
2489 ['xkbcommon'],
2490 ['blkid'],
2491 ['dbus'],
2492 ['glib'],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002493 ['nss-myhostname', conf.get('HAVE_MYHOSTNAME', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002494 ['hwdb'],
2495 ['tpm'],
2496 ['man pages', want_man],
2497 ['html pages', want_html],
2498 ['man page indices', want_man and have_lxml],
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002499 ['split /usr', conf.get('HAVE_SPLIT_USR', false)],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002500 ['SysV compat'],
2501 ['utmp'],
2502 ['ldconfig'],
2503 ['hibernate'],
2504 ['adm group', get_option('adm-group')],
2505 ['wheel group', get_option('wheel-group')],
Franck Buib14e1b42017-05-09 14:02:37 +02002506 ['gshadow'],
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002507 ['debug hashmap'],
2508 ['debug mmap cache'],
2509]
2510
2511 cond = tuple.get(1, '')
2512 if cond == ''
2513 ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
2514 ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
Zbigniew Jędrzejewski-Szmek2c201c22017-04-27 21:13:08 -04002515 cond = conf.get(ident1, false) or conf.get(ident2, false)
Zbigniew Jędrzejewski-Szmek829257d2017-04-27 20:54:52 -04002516 endif
2517 if cond
2518 found += [tuple[0]]
2519 else
2520 missing += [tuple[0]]
2521 endif
2522endforeach
2523
2524status += [
2525 'enabled features: @0@'.format(', '.join(found)),
2526 'disabled features: @0@'.format(', '.join(missing))]
2527message('\n '.join(status))