]> git.ipfire.org Git - thirdparty/systemd.git/blame - meson.build
meson: use -f{function,data}-sections for optimized builds
[thirdparty/systemd.git] / meson.build
CommitLineData
5c23128d
ZJS
1project('systemd', 'c',
2 version : '233',
3 license : 'LGPLv2+',
4 default_options: [
37efbbd8
ZJS
5 'c_std=gnu99',
6 'prefix=/usr',
7 'sysconfdir=/etc',
8 'localstatedir=/var',
5c23128d
ZJS
9 ],
10 meson_version : '>= 0.39.1',
11 )
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
ab916f2e 29rootprefixdir = get_option('rootprefix')
5c23128d 30if get_option('split-usr')
37efbbd8
ZJS
31 conf.set('HAVE_SPLIT_USR', 1)
32 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/'
5c23128d 33else
37efbbd8 34 rootprefixdir = rootprefixdir != '' ? rootprefixdir : '/usr'
5c23128d
ZJS
35endif
36
37sysvinit_path = get_option('sysvinit-path')
38sysvrcnd_path = get_option('sysvrcnd-path')
39if sysvinit_path != '' or sysvrcnd_path != ''
37efbbd8
ZJS
40 conf.set('HAVE_SYSV_COMPAT', 1,
41 description : 'SysV init scripts and rcN.d links are supported')
42 m4_defines += ['-DHAVE_SYSV_COMPAT']
5c23128d
ZJS
43endif
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('/')
37efbbd8 50 error('Prefix is not absolute: "@0@"'.format(prefixdir))
5c23128d
ZJS
51endif
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 == ''
37efbbd8 64 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
5c23128d
ZJS
65endif
66
67# Dirs of external packages
e17e5ba9
MB
68pkgconfigdatadir = 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')
5c23128d
ZJS
75rpmmacrosdir = get_option('rpmmacrosdir')
76
77# Our own paths
e17e5ba9
MB
78pkgdatadir = 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')
5c23128d
ZJS
111
112dbuspolicydir = get_option('dbuspolicydir')
113if dbuspolicydir == ''
37efbbd8 114 dbuspolicydir = join_paths(datadir, 'dbus-1/system.d')
5c23128d
ZJS
115endif
116
117dbussessionservicedir = get_option('dbussessionservicedir')
118if dbussessionservicedir == ''
37efbbd8 119 dbussessionservicedir = join_paths(datadir, 'dbus-1/services')
5c23128d
ZJS
120endif
121
122dbussystemservicedir = get_option('dbussystemservicedir')
123if dbussystemservicedir == ''
37efbbd8 124 dbussystemservicedir = join_paths(datadir, 'dbus-1/system-services')
5c23128d
ZJS
125endif
126
127pamlibdir = get_option('pamlibdir')
128if pamlibdir == ''
37efbbd8 129 pamlibdir = join_paths(rootlibdir, 'security')
5c23128d
ZJS
130endif
131
132pamconfdir = get_option('pamconfdir')
133if pamconfdir == ''
37efbbd8 134 pamconfdir = join_paths(sysconfdir, 'pam.d')
5c23128d
ZJS
135endif
136
137conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
e17e5ba9 138conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'system'))
5c23128d
ZJS
139conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
140conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
141conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
2a4c156d
ZJS
142conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
143conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
e17e5ba9 144conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
5c23128d
ZJS
145conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
146conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
e17e5ba9
MB
147conf.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'))
5c23128d 156conf.set_quoted('ROOTPREFIX', rootprefixdir)
3131bfe3 157conf.set_quoted('RANDOM_SEED_DIR', randomseeddir)
e17e5ba9
MB
158conf.set_quoted('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
159conf.set_quoted('SYSTEMD_CRYPTSETUP_PATH', join_paths(rootlibexecdir, 'systemd-cryptsetup'))
5c23128d
ZJS
160conf.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)
e17e5ba9
MB
166conf.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'))
5c23128d 168conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
e17e5ba9 169conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
5c23128d
ZJS
170conf.set_quoted('LIBDIR', libdir)
171conf.set_quoted('ROOTLIBDIR', rootlibdir)
172conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
173conf.set_quoted('BOOTLIBDIR', bootlibdir)
e17e5ba9
MB
174conf.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'))
5c23128d
ZJS
180
181conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
182conf.set_quoted('ABS_SRC_DIR', meson.source_root())
183
184substs.set('prefix', prefixdir)
3131bfe3
ZJS
185substs.set('exec_prefix', prefixdir)
186substs.set('libdir', libdir)
187substs.set('rootlibdir', rootlibdir)
188substs.set('includedir', includedir)
5c23128d 189substs.set('pkgsysconfdir', pkgsysconfdir)
3131bfe3
ZJS
190substs.set('bindir', bindir)
191substs.set('rootbindir', rootbindir)
5c23128d
ZJS
192substs.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)
3131bfe3 199substs.set('udevlibexecdir', udevlibexecdir)
5c23128d
ZJS
200substs.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)
2a4c156d
ZJS
212substs.set('VARLOGDIR', varlogdir)
213substs.set('CERTIFICATEROOT', get_option('certificate-root'))
e17e5ba9
MB
214substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
215substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
2a4c156d
ZJS
216substs.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'))
5c23128d
ZJS
220
221#####################################################################
222
223cc = meson.get_compiler('c')
224pkgconfig = import('pkgconfig')
225
226foreach arg : ['-Wundef',
227 '-Wlogical-op',
228 '-Wmissing-include-dirs',
229 '-Wold-style-definition',
230 '-Wpointer-arith',
231 '-Winit-self',
232 '-Wdeclaration-after-statement',
233 '-Wfloat-equal',
234 '-Wsuggest-attribute=noreturn',
235 '-Werror=missing-prototypes',
236 '-Werror=implicit-function-declaration',
237 '-Werror=missing-declarations',
238 '-Werror=return-type',
239 '-Werror=incompatible-pointer-types',
240 '-Werror=format=2',
241 '-Wstrict-prototypes',
242 '-Wredundant-decls',
243 '-Wmissing-noreturn',
244 '-Wshadow',
245 '-Wendif-labels',
246 '-Wstrict-aliasing=2',
247 '-Wwrite-strings',
248 '-Wno-unused-parameter',
249 '-Wno-missing-field-initializers',
250 '-Wno-unused-result',
251 '-Wno-format-signedness',
252 '-Werror=overflow',
253 '-Wdate-time',
254 '-Wnested-externs',
255 '-ffast-math',
256 '-fno-common',
257 '-fdiagnostics-show-option',
258 '-fno-strict-aliasing',
259 '-fvisibility=hidden',
260 '-fstack-protector',
261 '-fstack-protector-strong',
262 '-fPIE',
263 '--param=ssp-buffer-size=4',
264 ]
37efbbd8
ZJS
265 if cc.has_argument(arg)
266 add_project_arguments(arg, language : 'c')
267 endif
5c23128d
ZJS
268endforeach
269
270if cc.compiles('
271 #include <time.h>
272 #include <inttypes.h>
273 typedef uint64_t usec_t;
274 usec_t now(clockid_t clock);
275 int main(void) {
276 struct timespec now;
277 return 0;
278 }
279')
37efbbd8
ZJS
280 # TODO: message?
281 add_project_arguments('-Werror=shadow', language : 'c')
5c23128d
ZJS
282endif
283
284if cc.get_id() == 'clang'
37efbbd8
ZJS
285 foreach arg : ['-Wno-typedef-redefinition',
286 '-Wno-gnu-variable-sized-type-not-at-end',
287 ]
288 if cc.has_argument(arg)
289 add_project_arguments(arg, language : 'c')
290 endif
291 endforeach
5c23128d
ZJS
292endif
293
294# --as-needed and --no-undefined are provided by meson by default,
295# run mesonconf to see what is enabled
296foreach arg : ['-Wl,-z,relro',
297 '-Wl,-z,now',
298 '-pie',
299 '-Wl,-fuse-ld=gold',
300 ]
37efbbd8
ZJS
301 if cc.has_argument(arg)
302 add_project_link_arguments(arg, language : 'c')
303 endif
5c23128d
ZJS
304endforeach
305
41afb5eb
ZJS
306if get_option('buildtype') != 'debug'
307 foreach arg : ['-ffunction-sections',
308 '-fdata-sections']
309 if cc.has_argument(arg)
310 add_project_arguments(arg, language : 'c')
311 endif
312 endforeach
313
314 foreach arg : ['-Wl,--gc-sections']
315 if cc.has_argument(arg)
316 add_project_link_arguments(arg, language : 'c')
317 endif
318 endforeach
319endif
320
9cc0e6e9
ZJS
321cpp = ' '.join(cc.cmd_array()) + ' -E'
322
5c23128d
ZJS
323#####################################################################
324# compilation result tests
325
326conf.set('_GNU_SOURCE', 1)
327conf.set('__SANE_USERSPACE_TYPES__', 1)
328
329conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
330conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
331conf.set('SIZEOF_GID_T', cc.sizeof('gid_t', prefix : '#include <sys/types.h>'))
332conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
333conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
334conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
335conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
336
337decl_headers = '''
338#include <uchar.h>
339#include <linux/ethtool.h>
340'''
341# FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
342
343foreach decl : ['char16_t',
344 'char32_t',
345 'key_serial_t',
346 'struct ethtool_link_settings',
347 ]
37efbbd8
ZJS
348 if cc.sizeof(decl, prefix : decl_headers) > 0
349 # We get -1 if the size cannot be determined
350 conf.set('HAVE_' + decl.underscorify().to_upper(), 1)
351 endif
5c23128d
ZJS
352endforeach
353
354foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
355 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
356 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
357 ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'],
358 ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
359 ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
360 ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
361 ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'],
362 ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
363 ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
364 # if_tunnel.h is buggy and cannot be included on its own
365 ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include <net/if.h>'],
366 ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
367 ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
368 ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'],
369 ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'],
370 ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
371 ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
372 ['NDA_IFINDEX', 'linux/neighbour.h'],
373 ['IFA_FLAGS', 'linux/if_addr.h'],
374 ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
375 ]
37efbbd8
ZJS
376 prefix = decl.length() > 2 ? decl[2] : ''
377 have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
378 conf.set10('HAVE_DECL_' + decl[0], have)
5c23128d
ZJS
379endforeach
380
381skip = false
382foreach ident : ['secure_getenv', '__secure_getenv']
37efbbd8
ZJS
383 if not skip and cc.has_function(ident)
384 conf.set('HAVE_' + ident.to_upper(), 1)
385 skip = true
386 endif
5c23128d
ZJS
387endforeach
388
389foreach ident : [
37efbbd8
ZJS
390 ['memfd_create', '''#include <sys/memfd.h>'''],
391 ['gettid', '''#include <sys/types.h>'''],
392 ['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
393 ['name_to_handle_at', '''#define _GNU_SOURCE
394 #include <sys/types.h>
395 #include <sys/stat.h>
396 #include <fcntl.h>'''],
397 ['setns', '''#define _GNU_SOURCE
398 #include <sched.h>'''],
37efbbd8
ZJS
399 ['renameat2', '''#include <stdio.h>'''],
400 ['kcmp', '''#include <linux/kcmp.h>'''],
401 ['keyctl', '''#include <sys/types.h>
402 #include <keyutils.h>'''],
403 ['copy_file_range', '''#include <sys/syscall.h>
404 #include <unistd.h>'''],
38f1ae0f 405 ['explicit_bzero' , '''#include <string.h>'''],
37efbbd8
ZJS
406]
407
408 have = cc.has_function(ident[0], prefix : ident[1])
409 conf.set10('HAVE_DECL_' + ident[0].to_upper(), have)
5c23128d
ZJS
410endforeach
411
4984c8be
ZJS
412if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
413 conf.set('USE_SYS_RANDOM_H', 1)
414 conf.set10('HAVE_DECL_GETRANDOM', 1)
415else
416 have = cc.has_function('getrandom', prefix : '''#include <linux/random.h>''')
417 conf.set10('HAVE_DECL_GETRANDOM', have)
418endif
419
5c23128d
ZJS
420#####################################################################
421
422sed = find_program('sed')
423grep = find_program('grep')
424awk = find_program('awk')
78b68dcb 425m4 = find_program('/usr/bin/m4')
5c23128d 426stat = find_program('stat')
d68b342b
ZJS
427git = find_program('git', required : false)
428etags = find_program('etags', required : false)
5c23128d 429
7b76fce1 430meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
94e75a54 431mkdir_p = 'mkdir -p $DESTDIR/@0@'
fdd147a8 432check_compilation_sh = find_program('tools/meson-check-compilation.sh')
d83f4f50
ZJS
433test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
434splash_bmp = files('test/splash.bmp')
94e75a54 435
5c23128d
ZJS
436# if -Dxxx-path option is found, use that. Otherwise, check in $PATH,
437# /usr/sbin, /sbin, and fall back to the default from middle column.
438progs = [['telinit', '/lib/sysvinit/telinit'],
439 ['quotaon', '/usr/sbin/quotaon' ],
440 ['quotacheck', '/usr/sbin/quotacheck' ],
441 ['kill', '/usr/bin/kill' ],
442 ['kmod', '/usr/bin/kmod' ],
443 ['kexec', '/usr/sbin/kexec' ],
444 ['sulogin', '/usr/sbin/sulogin' ],
445 ['mount', '/usr/bin/mount', 'MOUNT_PATH'],
446 ['umount', '/usr/bin/umount', 'UMOUNT_PATH'],
447 ['loadkeys', '/usr/bin/loadkeys', 'KBD_LOADKEYS'],
448 ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
449 ]
450foreach prog : progs
37efbbd8
ZJS
451 path = get_option(prog[0] + '-path')
452 if path != ''
453 message('Using @1@ for @0@'.format(prog[0], path))
454 else
455 exe = find_program(prog[0],
456 '/usr/sbin/' + prog[0],
457 '/sbin/' + prog[0],
458 required: false)
459 path = exe.found() ? exe.path() : prog[1]
460 endif
461 name = prog.length() > 2 ? prog[2] : prog[0].to_upper()
462 conf.set_quoted(name, path)
463 substs.set(name, path)
5c23128d
ZJS
464endforeach
465
1276a9f6
ZJS
466if run_command('ln', '--relative', '--help').returncode() != 0
467 error('ln does not support --relative')
468endif
5c23128d
ZJS
469
470############################################################
471
472gperf = find_program('gperf')
473
474gperf_test_format = '''
475#include <string.h>
476const char * in_word_set(const char *, @0@);
477@1@
478'''
479gperf_snippet_format = 'echo foo,bar | @0@ -L ANSI-C'
480gperf_snippet = run_command('sh', '-c', gperf_snippet_format.format(gperf.path()))
481gperf_test = gperf_test_format.format('size_t', gperf_snippet.stdout())
482if cc.compiles(gperf_test)
37efbbd8 483 gperf_len_type = 'size_t'
5c23128d 484else
37efbbd8
ZJS
485 gperf_test = gperf_test_format.format('unsigned', gperf_snippet.stdout())
486 if cc.compiles(gperf_test)
487 gperf_len_type = 'unsigned'
488 else
489 error('unable to determine gperf len type')
490 endif
5c23128d
ZJS
491endif
492message('gperf len type is @0@'.format(gperf_len_type))
37efbbd8
ZJS
493conf.set('GPERF_LEN_TYPE', gperf_len_type,
494 description : 'The type of gperf "len" parameter')
5c23128d
ZJS
495
496############################################################
497
498if not cc.has_header('sys/capability.h')
37efbbd8 499 error('POSIX caps headers not found')
5c23128d
ZJS
500endif
501foreach header : ['linux/btrfs.h',
502 'linux/memfd.h',
503 'linux/vm_sockets.h',
504 'valgrind/memcheck.h',
505 'valgrind/valgrind.h',
506 ]
37efbbd8
ZJS
507 if cc.has_header(header)
508 conf.set('HAVE_' + header.underscorify().to_upper(), 1)
509 endif
5c23128d
ZJS
510endforeach
511
512############################################################
513
514conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
515
516default_hierarchy = get_option('default-hierarchy')
517conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
518 description : 'default cgroup hierarchy as string')
519if default_hierarchy == 'legacy'
37efbbd8 520 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_NONE')
5c23128d 521elif default_hierarchy == 'hybrid'
37efbbd8 522 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_SYSTEMD')
5c23128d 523else
37efbbd8 524 conf.set('DEFAULT_HIERARCHY', 'CGROUP_UNIFIED_ALL')
5c23128d
ZJS
525endif
526
527time_epoch = get_option('time-epoch')
528if time_epoch == ''
37efbbd8
ZJS
529 NEWS = files('NEWS')
530 time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
5c23128d
ZJS
531endif
532time_epoch = time_epoch.to_int()
533conf.set('TIME_EPOCH', time_epoch)
534
535system_uid_max = get_option('system-uid-max')
536if system_uid_max == ''
37efbbd8
ZJS
537 system_uid_max = run_command(
538 awk,
539 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }',
540 '/etc/login.defs').stdout()
5c23128d
ZJS
541endif
542system_uid_max = system_uid_max.to_int()
543conf.set('SYSTEM_UID_MAX', system_uid_max)
544substs.set('systemuidmax', system_uid_max)
545message('Maximum system UID is @0@'.format(system_uid_max))
546
547conf.set_quoted('NOBODY_USER_NAME', get_option('nobody-user'))
548conf.set_quoted('NOBODY_GROUP_NAME', get_option('nobody-group'))
549
550system_gid_max = get_option('system-gid-max')
551if system_gid_max == ''
37efbbd8
ZJS
552 system_gid_max = run_command(
553 awk,
554 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }',
555 '/etc/login.defs').stdout()
5c23128d
ZJS
556endif
557system_gid_max = system_gid_max.to_int()
558conf.set('SYSTEM_GID_MAX', system_gid_max)
559substs.set('systemgidmax', system_gid_max)
560message('Maximum system GID is @0@'.format(system_gid_max))
561
562tty_gid = get_option('tty-gid')
563conf.set('TTY_GID', tty_gid)
2a4c156d 564substs.set('TTY_GID', tty_gid)
5c23128d
ZJS
565
566if get_option('adm-group')
37efbbd8 567 m4_defines += ['-DENABLE_ADM_GROUP']
5c23128d
ZJS
568endif
569
570if get_option('wheel-group')
37efbbd8 571 m4_defines += ['-DENABLE_WHEEL_GROUP']
5c23128d
ZJS
572endif
573
574substs.set('DEV_KVM_MODE', get_option('dev-kvm-mode'))
575
2a4c156d
ZJS
576kill_user_processes = get_option('default-kill-user-processes')
577conf.set10('KILL_USER_PROCESSES', kill_user_processes)
578substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
5c23128d
ZJS
579
580default_dnssec = get_option('default-dnssec')
581conf.set('DEFAULT_DNSSEC_MODE',
582 'DNSSEC_' + default_dnssec.underscorify().to_upper())
2a4c156d 583substs.set('DEFAULT_DNSSEC_MODE', default_dnssec)
5c23128d
ZJS
584
585conf.set_quoted('DNS_SERVERS', get_option('dns-servers'))
2a4c156d 586substs.set('DNS_SERVERS', get_option('dns-servers'))
5c23128d
ZJS
587
588conf.set_quoted('NTP_SERVERS', get_option('ntp-servers'))
2a4c156d 589substs.set('NTP_SERVERS', get_option('ntp-servers'))
5c23128d
ZJS
590
591conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
592
3131bfe3
ZJS
593substs.set('SUSHELL', get_option('debug-shell'))
594substs.set('DEBUGTTY', get_option('debug-tty'))
595
5c23128d
ZJS
596#####################################################################
597
598threads = dependency('threads')
599librt = cc.find_library('rt')
600libm = cc.find_library('m')
601libdl = cc.find_library('dl')
602libcrypt = cc.find_library('crypt')
603
604libcap = dependency('libcap')
605libmount = dependency('mount',
606 version : '>= 2.27')
607
608want_seccomp = get_option('seccomp')
4390be30 609if want_seccomp != 'false'
37efbbd8
ZJS
610 libseccomp = dependency('libseccomp',
611 required : want_seccomp == 'true')
612 if libseccomp.found()
613 conf.set('HAVE_SECCOMP', 1)
614 m4_defines += ['-DHAVE_SECCOMP']
615 endif
5c23128d 616else
37efbbd8 617 libseccomp = []
5c23128d
ZJS
618endif
619
620want_selinux = get_option('selinux')
4390be30 621if want_selinux != 'false'
37efbbd8
ZJS
622 libselinux = dependency('libselinux',
623 version : '>= 2.1.9',
624 required : want_selinux == 'true')
625 if libselinux.found()
626 conf.set('HAVE_SELINUX', 1)
627 m4_defines += ['-DHAVE_SELINUX']
628 endif
5c23128d 629else
37efbbd8 630 libselinux = []
5c23128d
ZJS
631endif
632
633want_apparmor = get_option('apparmor')
4390be30 634if want_apparmor != 'false'
37efbbd8
ZJS
635 libapparmor = dependency('libapparmor',
636 required : want_apparmor == 'true')
637 if libapparmor.found()
638 conf.set('HAVE_APPARMOR', 1)
639 m4_defines += ['-DHAVE_APPARMOR']
640 endif
5c23128d 641else
37efbbd8 642 libapparmor = []
5c23128d
ZJS
643endif
644
645want_smack = get_option('smack')
4390be30 646if want_smack != 'false'
37efbbd8
ZJS
647 libsmack = dependency('libsmack',
648 required : want_smack == 'true')
649 if libsmack.found()
650 conf.set('HAVE_SMACK', 1)
651 m4_defines += ['-DHAVE_SMACK']
652 endif
5c23128d 653else
37efbbd8 654 libsmack = []
5c23128d
ZJS
655endif
656
657smack_run_label = get_option('smack-run-label')
658if smack_run_label != ''
37efbbd8
ZJS
659 conf.set_quoted('SMACK_RUN_LABEL', smack_run_label)
660 m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
5c23128d
ZJS
661endif
662
3ca0cb73
ZJS
663want_polkit = get_option('polkit')
664install_polkit = false
665install_polkit_pkla = false
4390be30 666if want_polkit != 'false'
37efbbd8
ZJS
667 conf.set('ENABLE_POLKIT', 1)
668 install_polkit = true
3ca0cb73 669
37efbbd8
ZJS
670 libpolkit = dependency('polkit-gobject-1',
671 required : false)
672 if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
673 message('Old polkit detected, will install pkla files')
674 install_polkit_pkla = true
675 endif
3ca0cb73
ZJS
676endif
677
36f0387e
ZJS
678want_acl = get_option('acl')
679if want_acl != 'false'
680 libacl = cc.find_library('acl', required : want_acl == 'true')
681 if libacl.found()
682 conf.set('HAVE_ACL', 1)
683 m4_defines += ['-DHAVE_ACL']
684 endif
685else
686 libacl = []
687endif
688
5c23128d 689want_audit = get_option('audit')
4390be30 690if want_audit != 'false'
37efbbd8
ZJS
691 libaudit = dependency('audit', required : want_audit == 'true')
692 if libaudit.found()
693 conf.set('HAVE_AUDIT', 1)
694 endif
5c23128d 695else
37efbbd8 696 libaudit = []
5c23128d
ZJS
697endif
698
699want_blkid = get_option('blkid')
4390be30 700if want_blkid != 'false'
37efbbd8
ZJS
701 libblkid = dependency('blkid', required : want_blkid == 'true')
702 if libblkid.found()
703 conf.set('HAVE_BLKID', 1)
704 endif
5c23128d 705else
37efbbd8 706 libblkid = []
5c23128d
ZJS
707endif
708
709want_kmod = get_option('kmod')
4390be30 710if want_kmod != 'false'
37efbbd8
ZJS
711 libkmod = dependency('libkmod',
712 version : '>= 15',
713 required : want_kmod == 'true')
714 if libkmod.found()
715 conf.set('HAVE_KMOD', 1)
716 endif
5c23128d 717else
37efbbd8 718 libkmod = []
5c23128d
ZJS
719endif
720
721want_pam = get_option('pam')
4390be30 722if want_pam != 'false'
37efbbd8
ZJS
723 libpam = cc.find_library('pam', required : want_pam == 'true')
724 libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
725 if libpam.found() and libpam_misc.found()
726 conf.set('HAVE_PAM', 1)
727 m4_defines += ['-DHAVE_PAM']
728 endif
5c23128d 729else
37efbbd8
ZJS
730 libpam = []
731 libpam_misc = []
5c23128d
ZJS
732endif
733
734want_microhttpd = get_option('microhttpd')
4390be30 735if want_microhttpd != 'false'
37efbbd8
ZJS
736 libmicrohttpd = dependency('libmicrohttpd',
737 version : '>= 0.9.33',
738 required : want_microhttpd == 'true')
739 if libmicrohttpd.found()
740 conf.set('HAVE_MICROHTTPD', 1)
741 m4_defines += ['-DHAVE_MICROHTTPD']
742 endif
5c23128d 743else
37efbbd8 744 libmicrohttpd = []
5c23128d
ZJS
745endif
746
747want_libcryptsetup = get_option('libcryptsetup')
4390be30 748if want_libcryptsetup != 'false'
37efbbd8
ZJS
749 libcryptsetup = dependency('libcryptsetup',
750 version : '>= 1.6.0',
751 required : want_libcryptsetup == 'true')
752 if libcryptsetup.found()
753 conf.set('HAVE_LIBCRYPTSETUP', 1)
754 endif
5c23128d 755else
37efbbd8 756 libcryptsetup = []
5c23128d
ZJS
757endif
758
759want_libcurl = get_option('libcurl')
4390be30 760if want_libcurl != 'false'
37efbbd8
ZJS
761 libcurl = dependency('libcurl',
762 version : '>= 7.32.0',
763 required : want_libcurl == 'true')
764 if libcurl.found()
765 conf.set('HAVE_LIBCURL', 1)
766 m4_defines += ['-DHAVE_LIBCURL']
767 endif
5c23128d 768else
37efbbd8 769 libcurl = []
5c23128d
ZJS
770endif
771
772want_libidn = get_option('libidn')
4390be30 773if want_libidn != 'false'
37efbbd8
ZJS
774 libidn = dependency('libidn',
775 required : want_libidn == 'true')
776 if libidn.found()
777 conf.set('HAVE_LIBIDN', 1)
778 m4_defines += ['-DHAVE_LIBIDN']
779 endif
5c23128d 780else
37efbbd8 781 libidn = []
5c23128d
ZJS
782endif
783
784want_libiptc = get_option('libiptc')
4390be30 785if want_libiptc != 'false'
37efbbd8
ZJS
786 libiptc = dependency('libiptc',
787 required : want_libiptc == 'true')
788 if libiptc.found()
789 conf.set('HAVE_LIBIPTC', 1)
790 m4_defines += ['-DHAVE_LIBIPTC']
791 endif
5c23128d 792else
37efbbd8 793 libiptc = []
5c23128d
ZJS
794endif
795
796want_qrencode = get_option('qrencode')
4390be30 797if want_qrencode != 'false'
37efbbd8
ZJS
798 libqrencode = dependency('libqrencode',
799 required : want_qrencode == 'true')
800 if libqrencode.found()
801 conf.set('HAVE_QRENCODE', 1)
802 endif
5c23128d 803else
37efbbd8 804 libqrencode = []
5c23128d
ZJS
805endif
806
807want_gnutls = get_option('gnutls')
4390be30 808if want_gnutls != 'false'
37efbbd8
ZJS
809 libgnutls = dependency('gnutls',
810 version : '>= 3.1.4',
811 required : want_gnutls == 'true')
812 if libgnutls.found()
813 conf.set('HAVE_GNUTLS', 1)
814 endif
5c23128d 815else
37efbbd8 816 libgnutls = []
5c23128d
ZJS
817endif
818
819want_elfutils = get_option('elfutils')
4390be30 820if want_elfutils != 'false'
37efbbd8
ZJS
821 libdw = dependency('libdw',
822 required : want_elfutils == 'true')
823 if libdw.found()
824 conf.set('HAVE_ELFUTILS', 1)
825 endif
5c23128d 826else
37efbbd8 827 libdw = []
5c23128d
ZJS
828endif
829
830want_zlib = get_option('zlib')
4390be30 831if want_zlib != 'false'
37efbbd8
ZJS
832 libz = dependency('zlib',
833 required : want_zlib == 'true')
834 if libz.found()
835 conf.set('HAVE_ZLIB', 1)
836 endif
5c23128d 837else
37efbbd8 838 libz = []
5c23128d
ZJS
839endif
840
841want_bzip2 = get_option('bzip2')
4390be30 842if want_bzip2 != 'false'
37efbbd8
ZJS
843 libbzip2 = cc.find_library('bz2',
844 required : want_bzip2 == 'true')
845 if libbzip2.found()
846 conf.set('HAVE_BZIP2', 1)
847 endif
5c23128d 848else
37efbbd8 849 libbzip2 = []
5c23128d
ZJS
850endif
851
852want_xz = get_option('xz')
4390be30 853if want_xz != 'false'
37efbbd8
ZJS
854 libxz = dependency('liblzma',
855 required : want_xz == 'true')
856 if libxz.found()
857 conf.set('HAVE_XZ', 1)
858 endif
5c23128d 859else
37efbbd8 860 libxz = []
5c23128d
ZJS
861endif
862
863want_lz4 = get_option('lz4')
4390be30 864if want_lz4 != 'false'
37efbbd8
ZJS
865 liblz4 = dependency('liblz4',
866 required : want_lz4 == 'true')
867 if liblz4.found()
868 conf.set('HAVE_LZ4', 1)
869 endif
5c23128d 870else
37efbbd8 871 liblz4 = []
5c23128d
ZJS
872endif
873
69e96427 874want_glib = get_option('glib')
4390be30 875if want_glib != 'false'
37efbbd8
ZJS
876 libglib = dependency('glib-2.0',
877 version : '>= 2.22.0',
878 required : want_glib == 'true')
879 libgobject = dependency('gobject-2.0',
880 version : '>= 2.22.0',
881 required : want_glib == 'true')
882 libgio = dependency('gio-2.0',
883 required : want_glib == 'true')
884 if libglib.found() and libgobject.found() and libgio.found()
885 conf.set('HAVE_GLIB', 1)
886 endif
69e96427 887else
37efbbd8
ZJS
888 libglib = []
889 libgobject = []
890 libgio = []
69e96427
ZJS
891endif
892
1eeb43f5 893want_xkbcommon = get_option('xkbcommon')
4390be30 894if want_xkbcommon != 'false'
37efbbd8
ZJS
895 libxkbcommon = dependency('xkbcommon',
896 version : '>= 0.3.0',
897 required : want_xkbcommon == 'true')
898 if libxkbcommon.found()
899 conf.set('HAVE_XKBCOMMON', 1)
900 endif
1eeb43f5 901else
37efbbd8 902 libxkbcommon = []
1eeb43f5
ZJS
903endif
904
69e96427 905want_dbus = get_option('dbus')
4390be30 906if want_dbus != 'false'
37efbbd8
ZJS
907 libdbus = dependency('dbus-1',
908 version : '>= 1.3.2',
909 required : want_dbus == 'true')
910 if libdbus.found()
911 conf.set('HAVE_DBUS', 1)
912 endif
69e96427 913else
37efbbd8 914 libdbus = []
69e96427
ZJS
915endif
916
76c87410
MB
917want_gcrypt = get_option('gcrypt')
918if want_gcrypt != 'false'
919 libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
920 libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
921
922 if libgcrypt.found() and libgpg_error.found()
923 conf.set('HAVE_GCRYPT', 1)
924 else
925 # link to neither of the libs if one is not found
926 libgcrypt = []
927 libgpg_error = []
37efbbd8 928 endif
5c23128d 929else
37efbbd8 930 libgcrypt = []
76c87410 931 libgpg_error = []
5c23128d
ZJS
932endif
933
934want_importd = get_option('importd')
4390be30 935if want_importd != 'false'
37efbbd8
ZJS
936 have_deps = (conf.get('HAVE_LIBCURL', 0) == 1 and
937 conf.get('HAVE_ZLIB', 0) == 1 and
938 conf.get('HAVE_BZIP2', 0) == 1 and
939 conf.get('HAVE_XZ', 0) == 1 and
76c87410 940 conf.get('HAVE_GCRYPT', 0) == 1)
37efbbd8
ZJS
941 if have_deps
942 conf.set('ENABLE_IMPORTD', 1)
943 elif want_importd == 'true'
944 error('importd support was requested, but dependencies are not available')
945 endif
5c23128d
ZJS
946endif
947
948want_remote = get_option('remote')
4390be30 949if want_remote != 'false'
37efbbd8
ZJS
950 have_deps = [conf.get('HAVE_MICROHTTPD', 0) == 1,
951 conf.get('HAVE_LIBCURL', 0) == 1]
952 # sd-j-remote requires µhttpd, and sd-j-upload requires libcurl, so
953 # it's possible to build one without the other. Complain only if
954 # support was explictly requested. The auxiliary files like sysusers
955 # config should be installed when any of the programs are built.
956 if want_remote == 'true' and not (have_deps[0] and have_deps[1])
957 error('remote support was requested, but dependencies are not available')
958 endif
959 if have_deps[0] or have_deps[1]
960 conf.set('ENABLE_REMOTE', 1)
961 endif
5c23128d
ZJS
962endif
963
964foreach pair : [['utmp', 'HAVE_UTMP'],
965 ['hibernate', 'ENABLE_HIBERNATE'],
966 ['environment-d', 'ENABLE_ENVIRONMENT_D'],
967 ['binfmt', 'ENABLE_BINFMT'],
968 ['coredump', 'ENABLE_COREDUMP'],
969 ['resolve', 'ENABLE_RESOLVED'],
970 ['logind', 'ENABLE_LOGIND'],
971 ['hostnamed', 'ENABLE_HOSTNAMED'],
972 ['localed', 'ENABLE_LOCALED'],
973 ['machined', 'ENABLE_MACHINED'],
974 ['networkd', 'ENABLE_NETWORKD'],
975 ['timedated', 'ENABLE_TIMEDATED'],
976 ['timesyncd', 'ENABLE_TIMESYNCD'],
977 ['myhostname', 'HAVE_MYHOSTNAME'],
978 ['firstboot', 'ENABLE_FIRSTBOOT'],
979 ['randomseed', 'ENABLE_RANDOMSEED'],
980 ['backlight', 'ENABLE_BACKLIGHT'],
981 ['vconsole', 'ENABLE_VCONSOLE'],
982 ['quotacheck', 'ENABLE_QUOTACHECK'],
983 ['sysusers', 'ENABLE_SYSUSERS'],
984 ['tmpfiles', 'ENABLE_TMPFILES'],
985 ['hwdb', 'ENABLE_HWDB'],
986 ['rfkill', 'ENABLE_RFKILL'],
987 ['ldconfig', 'ENABLE_LDCONFIG'],
b710072d 988 ['efi', 'ENABLE_EFI'],
2895c8ee 989 ['ima', 'HAVE_IMA'],
5c23128d
ZJS
990 ]
991
37efbbd8
ZJS
992 if get_option(pair[0])
993 conf.set(pair[1], 1)
994 m4_defines += ['-D' + pair[1]]
995 endif
5c23128d
ZJS
996endforeach
997
69e96427 998want_tests = get_option('tests')
572baca1 999install_tests = get_option('install-tests')
69e96427
ZJS
1000tests = []
1001
5c23128d
ZJS
1002#####################################################################
1003
1004if get_option('efi')
37efbbd8 1005 efi_arch = host_machine.cpu_family()
b710072d 1006
6800fe7f 1007 if efi_arch == 'x86'
37efbbd8 1008 EFI_MACHINE_TYPE_NAME = 'ia32'
6800fe7f 1009 gnu_efi_arch = 'ia32'
37efbbd8
ZJS
1010 elif efi_arch == 'x86_64'
1011 EFI_MACHINE_TYPE_NAME = 'x64'
6800fe7f 1012 gnu_efi_arch = 'x86_64'
37efbbd8
ZJS
1013 elif efi_arch == 'arm'
1014 EFI_MACHINE_TYPE_NAME = 'arm'
6800fe7f 1015 gnu_efi_arch = 'arm'
37efbbd8
ZJS
1016 elif efi_arch == 'aarch64'
1017 EFI_MACHINE_TYPE_NAME = 'aa64'
6800fe7f 1018 gnu_efi_arch = 'aarch64'
37efbbd8
ZJS
1019 else
1020 EFI_MACHINE_TYPE_NAME = ''
6800fe7f 1021 gnu_efi_arch = ''
37efbbd8 1022 endif
5c23128d 1023
37efbbd8
ZJS
1024 conf.set('ENABLE_EFI', 1)
1025 conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
5c23128d
ZJS
1026endif
1027
1028#####################################################################
1029
1030config_h = configure_file(
37efbbd8
ZJS
1031 output : 'config.h',
1032 configuration : conf)
5c23128d
ZJS
1033
1034includes = include_directories('src/basic',
1035 'src/shared',
1036 'src/systemd',
1037 'src/journal',
1038 'src/resolve',
1039 'src/timesync',
1040 'src/login',
1041 'src/udev',
1042 'src/libudev',
1043 'src/core',
1044 'src/libsystemd/sd-bus',
1045 'src/libsystemd/sd-device',
1046 'src/libsystemd/sd-hwdb',
1047 'src/libsystemd/sd-id128',
1048 'src/libsystemd/sd-netlink',
1049 'src/libsystemd/sd-network',
1050 'src/libsystemd-network',
1051 )
1052
1053add_project_arguments('-include', 'config.h', language : 'c')
1054
1055gcrypt_util_sources = files('src/shared/gcrypt-util.h',
1056 'src/shared/gcrypt-util.c')
1057
1058subdir('po')
1059subdir('catalog')
1060subdir('src/systemd')
1061subdir('src/basic')
1062subdir('src/libsystemd')
1063subdir('src/libsystemd-network')
5c23128d 1064subdir('src/journal')
5c23128d 1065subdir('src/login')
5c23128d
ZJS
1066
1067libjournal_core = static_library(
37efbbd8
ZJS
1068 'journal-core',
1069 libjournal_core_sources,
1070 journald_gperf_c,
1071 include_directories : includes,
1072 install : false)
5c23128d 1073
37ab1a25 1074libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
5c23128d 1075libsystemd = shared_library(
37efbbd8
ZJS
1076 'systemd',
1077 libsystemd_internal_sources,
1078 journal_internal_sources,
1079 version : '0.18.0',
1080 include_directories : includes,
1081 link_args : ['-shared',
1082 '-Wl,--version-script=' + libsystemd_sym_path],
1083 link_with : [libbasic],
1084 dependencies : [threads,
76c87410 1085 libgcrypt,
37efbbd8
ZJS
1086 librt,
1087 libxz,
1088 liblz4],
1089 link_depends : libsystemd_sym,
1090 install : true,
1091 install_dir : rootlibdir)
5c23128d
ZJS
1092
1093############################################################
1094
83b6af36
ZJS
1095# binaries that have --help and are intended for use by humans,
1096# usually, but not always, installed in /bin.
1097public_programs = []
1098
1099subdir('src/libudev')
1100subdir('src/shared')
1101subdir('src/core')
1102subdir('src/udev')
1103subdir('src/network')
1104
1105subdir('src/analyze')
1106subdir('src/journal-remote')
1107subdir('src/coredump')
1108subdir('src/hostname')
1109subdir('src/import')
1110subdir('src/kernel-install')
1111subdir('src/locale')
1112subdir('src/machine')
1113subdir('src/nspawn')
1114subdir('src/resolve')
1115subdir('src/timedate')
1116subdir('src/timesync')
1117subdir('src/vconsole')
1118subdir('src/sulogin-shell')
1119subdir('src/boot/efi')
1120
1121subdir('src/test')
1122subdir('test')
1123
1124############################################################
1125
1126# only static linking apart from libdl, to make sure that the
1127# module is linked to all libraries that it uses.
1128test_dlopen = executable(
37efbbd8
ZJS
1129 'test-dlopen',
1130 test_dlopen_c,
1131 include_directories : includes,
1132 link_with : [libbasic],
1133 dependencies : [libdl])
83b6af36 1134
5c23128d
ZJS
1135foreach tuple : [['myhostname', 'HAVE_MYHOSTNAME', []],
1136 ['systemd', '', []],
1137 ['mymachines', 'ENABLE_MACHINED', []],
1138 ['resolve', 'ENABLE_RESOLVED', [libdl]]]
1139
37efbbd8
ZJS
1140 condition = tuple[1] == '' or conf.get(tuple[1], 0) == 1
1141 if condition
1142 module = tuple[0]
1143 extra_deps = tuple[2]
1144
1145 sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
1146 version_script_arg = join_paths(meson.current_source_dir(), sym)
1147
1148 nss = shared_library(
1149 'nss_' + module,
1150 'src/nss-@0@/nss-@0@.c'.format(module),
1151 version : '2',
1152 include_directories : includes,
1153 link_args : ['-shared',
1154 '-Wl,--version-script=' + version_script_arg,
1155 '-Wl,--undefined'],
1156 link_with : [libsystemd_internal,
1157 libbasic],
1158 dependencies : [threads,
1159 librt] + extra_deps,
1160 link_depends : sym,
1161 install : true,
1162 install_dir : rootlibdir)
1163
1164 # We cannot use shared_module because it does not support version suffix.
1165 # Unfortunately shared_library insists on creating the symlink…
1166 meson.add_install_script('sh', '-c',
1167 'rm $DESTDIR@0@/libnss_@1@.so'
1168 .format(rootlibdir, module))
1169
1170 test('dlopen-nss_' + module,
1171 test_dlopen,
1172 args : [nss.full_path()]) # path to dlopen must include a slash
1173 endif
5c23128d
ZJS
1174endforeach
1175
1176############################################################
1177
5c23128d
ZJS
1178executable('systemd',
1179 systemd_sources,
1180 include_directories : includes,
1181 link_with : [libcore,
826472ce 1182 libshared,
aac26058 1183 libudev],
5c23128d
ZJS
1184 dependencies : [threads,
1185 librt,
1186 libseccomp,
1187 libselinux,
f4ee10a2
ZJS
1188 libmount,
1189 libblkid],
421f0012 1190 install_rpath : rootlibexecdir,
5c23128d
ZJS
1191 install : true,
1192 install_dir : rootlibexecdir)
1193
005a29f2
ZJS
1194exe = executable('systemd-analyze',
1195 systemd_analyze_sources,
1196 include_directories : includes,
1197 link_with : [libcore,
1198 libudev,
005a29f2
ZJS
1199 libshared],
1200 dependencies : [threads,
1201 librt,
1202 libseccomp,
1203 libselinux,
1204 libmount,
1205 libblkid],
1206 install_rpath : rootlibexecdir,
1207 install : true)
1208public_programs += [exe]
5c23128d
ZJS
1209
1210executable('systemd-journald',
1211 systemd_journald_sources,
1212 include_directories : includes,
aac26058 1213 link_with : [libjournal_core,
5c23128d
ZJS
1214 libshared,
1215 libudev],
1216 dependencies : [threads,
1217 libxz,
aac26058
ZJS
1218 liblz4,
1219 libselinux],
421f0012 1220 install_rpath : rootlibexecdir,
5c23128d
ZJS
1221 install : true,
1222 install_dir : rootlibexecdir)
1223
005a29f2
ZJS
1224exe = executable('systemd-cat',
1225 systemd_cat_sources,
1226 include_directories : includes,
1227 link_with : [libjournal_core,
1228 libshared,
1229 libudev],
1230 dependencies : [threads],
1231 install_rpath : rootlibexecdir,
1232 install : true)
1233public_programs += [exe]
1234
1235exe = executable('journalctl',
1236 journalctl_sources,
1237 include_directories : includes,
aac26058
ZJS
1238 link_with : [libshared,
1239 libudev],
005a29f2
ZJS
1240 dependencies : [threads,
1241 libqrencode,
1242 libxz,
1243 liblz4],
1244 install_rpath : rootlibexecdir,
1245 install : true,
1246 install_dir : rootbindir)
1247public_programs += [exe]
5c23128d
ZJS
1248
1249executable('systemd-getty-generator',
1250 'src/getty-generator/getty-generator.c',
5c23128d 1251 include_directories : includes,
b2fc5836
ZJS
1252 link_with : [libshared],
1253 install_rpath : rootlibexecdir,
1254 install : true,
1255 install_dir : systemgeneratordir)
5c23128d
ZJS
1256
1257executable('systemd-debug-generator',
1258 'src/debug-generator/debug-generator.c',
5c23128d 1259 include_directories : includes,
b2fc5836
ZJS
1260 link_with : [libshared],
1261 install_rpath : rootlibexecdir,
1262 install : true,
1263 install_dir : systemgeneratordir)
5c23128d
ZJS
1264
1265executable('systemd-fstab-generator',
1266 'src/fstab-generator/fstab-generator.c',
1267 'src/core/mount-setup.c',
5c23128d 1268 include_directories : includes,
b2fc5836
ZJS
1269 link_with : [libshared],
1270 install_rpath : rootlibexecdir,
1271 install : true,
1272 install_dir : systemgeneratordir)
5c23128d
ZJS
1273
1274if conf.get('ENABLE_ENVIRONMENT_D', 0) == 1
37efbbd8
ZJS
1275 executable('30-systemd-environment-d-generator',
1276 'src/environment-d-generator/environment-d-generator.c',
1277 include_directories : includes,
1278 link_with : [libshared],
1279 install_rpath : rootlibexecdir,
1280 install : true,
1281 install_dir : userenvgeneratordir)
7b76fce1 1282
37efbbd8
ZJS
1283 meson.add_install_script(meson_make_symlink,
1284 join_paths(sysconfdir, 'environment'),
1285 join_paths(environmentdir, '99-environment.conf'))
5c23128d
ZJS
1286endif
1287
1288if conf.get('ENABLE_HIBERNATE', 0) == 1
37efbbd8
ZJS
1289 executable('systemd-hibernate-resume-generator',
1290 'src/hibernate-resume/hibernate-resume-generator.c',
1291 include_directories : includes,
1292 link_with : [libshared],
1293 install_rpath : rootlibexecdir,
1294 install : true,
1295 install_dir : systemgeneratordir)
5c23128d 1296
37efbbd8
ZJS
1297 executable('systemd-hibernate-resume',
1298 'src/hibernate-resume/hibernate-resume.c',
005a29f2
ZJS
1299 include_directories : includes,
1300 link_with : [libshared],
1301 install_rpath : rootlibexecdir,
1302 install : true,
1303 install_dir : rootlibexecdir)
37efbbd8
ZJS
1304endif
1305
1306if conf.get('HAVE_BLKID', 0) == 1
1307 executable('systemd-gpt-auto-generator',
1308 'src/gpt-auto-generator/gpt-auto-generator.c',
1309 'src/basic/blkid-util.h',
1310 include_directories : includes,
1311 link_with : [libshared,
1312 libudev],
1313 dependencies : libblkid,
1314 install_rpath : rootlibexecdir,
1315 install : true,
1316 install_dir : systemgeneratordir)
1317
1318 exe = executable('systemd-dissect',
1319 'src/dissect/dissect.c',
1320 include_directories : includes,
1321 link_with : [libshared],
1322 install_rpath : rootlibexecdir,
1323 install : true,
1324 install_dir : rootlibexecdir)
1325 public_programs += [exe]
5c23128d
ZJS
1326endif
1327
1328if conf.get('ENABLE_RESOLVED', 0) == 1
37efbbd8
ZJS
1329 executable('systemd-resolved',
1330 systemd_resolved_sources,
76c87410 1331 gcrypt_util_sources,
005a29f2 1332 include_directories : includes,
aac26058 1333 link_with : [libshared],
005a29f2 1334 dependencies : [threads,
76c87410
MB
1335 libgcrypt,
1336 libgpg_error,
005a29f2
ZJS
1337 libm,
1338 libidn],
1339 install_rpath : rootlibexecdir,
37efbbd8
ZJS
1340 install : true,
1341 install_dir : rootlibexecdir)
1342
1343 exe = executable('systemd-resolve',
1344 systemd_resolve_sources,
76c87410 1345 gcrypt_util_sources,
37efbbd8
ZJS
1346 include_directories : includes,
1347 link_with : [libshared],
1348 dependencies : [threads,
76c87410
MB
1349 libgcrypt,
1350 libgpg_error,
37efbbd8
ZJS
1351 libm,
1352 libidn],
1353 install_rpath : rootlibexecdir,
1354 install : true)
1355 public_programs += [exe]
5c23128d
ZJS
1356endif
1357
1358if conf.get('ENABLE_LOGIND', 0) == 1
37efbbd8
ZJS
1359 executable('systemd-logind',
1360 systemd_logind_sources,
005a29f2 1361 include_directories : includes,
37efbbd8
ZJS
1362 link_with : [liblogind_core,
1363 libshared,
aac26058 1364 libudev],
005a29f2 1365 dependencies : [threads,
37efbbd8 1366 libacl],
005a29f2
ZJS
1367 install_rpath : rootlibexecdir,
1368 install : true,
37efbbd8
ZJS
1369 install_dir : rootlibexecdir)
1370
1371 exe = executable('loginctl',
1372 loginctl_sources,
1373 include_directories : includes,
1374 link_with : [libshared,
1375 libudev],
1376 dependencies : [threads,
1377 liblz4,
1378 libxz],
1379 install_rpath : rootlibexecdir,
1380 install : true,
1381 install_dir : rootbindir)
1382 public_programs += [exe]
1383
1384 exe = executable('systemd-inhibit',
1385 'src/login/inhibit.c',
1386 include_directories : includes,
1387 link_with : [libshared],
1388 install_rpath : rootlibexecdir,
1389 install : true,
1390 install_dir : rootbindir)
1391 public_programs += [exe]
1392
1393 if conf.get('HAVE_PAM', 0) == 1
1394 version_script_arg = join_paths(meson.current_source_dir(), pam_systemd_sym)
1395 pam_systemd = shared_library(
1396 'pam_systemd',
1397 pam_systemd_c,
1398 name_prefix : '',
1399 include_directories : includes,
1400 link_args : ['-shared',
1401 '-Wl,--version-script=' + version_script_arg],
1402 link_with : [libsystemd_internal,
1403 libshared_static],
1404 dependencies : [threads,
1405 libpam,
1406 libpam_misc],
1407 link_depends : pam_systemd_sym,
1408 install : true,
1409 install_dir : pamlibdir)
1410
1411 test('dlopen-pam_systemd',
1412 test_dlopen,
1413 args : [pam_systemd.full_path()]) # path to dlopen must include a slash
1414 endif
1415endif
005a29f2 1416
37efbbd8
ZJS
1417if conf.get('HAVE_PAM', 0) == 1
1418 executable('systemd-user-sessions',
1419 'src/user-sessions/user-sessions.c',
005a29f2 1420 include_directories : includes,
aac26058 1421 link_with : [libshared],
005a29f2
ZJS
1422 install_rpath : rootlibexecdir,
1423 install : true,
37efbbd8 1424 install_dir : rootlibexecdir)
5c23128d
ZJS
1425endif
1426
8191c594 1427if conf.get('ENABLE_EFI', 0) == 1 and conf.get('HAVE_BLKID', 0) == 1
37efbbd8
ZJS
1428 exe = executable('bootctl',
1429 'src/boot/bootctl.c',
1430 include_directories : includes,
1431 link_with : [libshared],
1432 dependencies : [libblkid],
1433 install_rpath : rootlibexecdir,
1434 install : true)
1435 public_programs += [exe]
005a29f2
ZJS
1436endif
1437
1438exe = executable('systemd-socket-activate', 'src/activate/activate.c',
1439 include_directories : includes,
1440 link_with : [libshared],
1441 dependencies : [threads],
1442 install_rpath : rootlibexecdir,
1443 install : true)
1444public_programs += [exe]
1445
1446exe = executable('systemctl', 'src/systemctl/systemctl.c',
1447 include_directories : includes,
aac26058 1448 link_with : [libshared],
005a29f2
ZJS
1449 dependencies : [threads,
1450 libcap,
1451 libselinux,
1452 libxz,
1453 liblz4],
1454 install_rpath : rootlibexecdir,
1455 install : true,
1456 install_dir : rootbindir)
1457public_programs += [exe]
5c23128d
ZJS
1458
1459if conf.get('ENABLE_BACKLIGHT', 0) == 1
37efbbd8
ZJS
1460 executable('systemd-backlight',
1461 'src/backlight/backlight.c',
1462 include_directories : includes,
1463 link_with : [libshared,
1464 libudev],
1465 install_rpath : rootlibexecdir,
1466 install : true,
1467 install_dir : rootlibexecdir)
5c23128d
ZJS
1468endif
1469
1470if conf.get('ENABLE_RFKILL', 0) == 1
37efbbd8
ZJS
1471 executable('systemd-rfkill',
1472 'src/rfkill/rfkill.c',
1473 include_directories : includes,
1474 link_with : [libshared,
1475 libudev],
1476 install_rpath : rootlibexecdir,
1477 install : true,
1478 install_dir : rootlibexecdir)
5c23128d
ZJS
1479endif
1480
1481executable('systemd-system-update-generator',
1482 'src/system-update-generator/system-update-generator.c',
1483 include_directories : includes,
1484 link_with : [libshared],
b2fc5836 1485 install_rpath : rootlibexecdir,
5c23128d
ZJS
1486 install : true,
1487 install_dir : systemgeneratordir)
1488
1489if conf.get('HAVE_LIBCRYPTSETUP', 0) == 1
37efbbd8
ZJS
1490 executable('systemd-cryptsetup',
1491 'src/cryptsetup/cryptsetup.c',
1492 include_directories : includes,
1493 link_with : [libshared],
1494 dependencies : [libcryptsetup],
1495 install_rpath : rootlibexecdir,
1496 install : true,
1497 install_dir : rootlibexecdir)
1498
1499 executable('systemd-cryptsetup-generator',
1500 'src/cryptsetup/cryptsetup-generator.c',
1501 include_directories : includes,
1502 link_with : [libshared],
1503 dependencies : [libcryptsetup],
1504 install_rpath : rootlibexecdir,
1505 install : true,
1506 install_dir : systemgeneratordir)
1507
1508 executable('systemd-veritysetup',
1509 'src/veritysetup/veritysetup.c',
1510 include_directories : includes,
1511 link_with : [libshared],
1512 dependencies : [libcryptsetup],
1513 install_rpath : rootlibexecdir,
1514 install : true,
1515 install_dir : rootlibexecdir)
1516
1517 executable('systemd-veritysetup-generator',
1518 'src/veritysetup/veritysetup-generator.c',
1519 include_directories : includes,
1520 link_with : [libshared],
1521 dependencies : [libcryptsetup],
1522 install_rpath : rootlibexecdir,
1523 install : true,
1524 install_dir : systemgeneratordir)
5c23128d
ZJS
1525endif
1526
1527if conf.get('HAVE_SYSV_COMPAT', 0) == 1
37efbbd8
ZJS
1528 executable('systemd-sysv-generator',
1529 'src/sysv-generator/sysv-generator.c',
1530 include_directories : includes,
1531 link_with : [libshared],
1532 install_rpath : rootlibexecdir,
1533 install : true,
1534 install_dir : systemgeneratordir)
1535
1536 executable('systemd-rc-local-generator',
1537 'src/rc-local-generator/rc-local-generator.c',
1538 include_directories : includes,
1539 link_with : [libshared],
1540 install_rpath : rootlibexecdir,
1541 install : true,
1542 install_dir : systemgeneratordir)
5c23128d
ZJS
1543endif
1544
1545if conf.get('ENABLE_HOSTNAMED', 0) == 1
37efbbd8
ZJS
1546 executable('systemd-hostnamed',
1547 'src/hostname/hostnamed.c',
005a29f2 1548 include_directories : includes,
aac26058 1549 link_with : [libshared],
005a29f2 1550 install_rpath : rootlibexecdir,
37efbbd8
ZJS
1551 install : true,
1552 install_dir : rootlibexecdir)
1553
1554 exe = executable('hostnamectl',
1555 'src/hostname/hostnamectl.c',
1556 include_directories : includes,
1557 link_with : [libshared],
1558 install_rpath : rootlibexecdir,
1559 install : true)
1560 public_programs += [exe]
5c23128d
ZJS
1561endif
1562
1563if conf.get('ENABLE_LOCALED', 0) == 1
37efbbd8
ZJS
1564 if conf.get('HAVE_XKBCOMMON', 0) == 1
1565 # logind will load libxkbcommon.so dynamically on its own
1566 deps = [libdl]
1567 else
1568 deps = []
1569 endif
1570
1571 executable('systemd-localed',
1572 systemd_localed_sources,
005a29f2 1573 include_directories : includes,
aac26058 1574 link_with : [libshared],
37efbbd8 1575 dependencies : deps,
005a29f2 1576 install_rpath : rootlibexecdir,
37efbbd8
ZJS
1577 install : true,
1578 install_dir : rootlibexecdir)
1579
1580 exe = executable('localectl',
1581 localectl_sources,
1582 include_directories : includes,
1583 link_with : [libshared],
1584 install_rpath : rootlibexecdir,
1585 install : true)
1586 public_programs += [exe]
5c23128d
ZJS
1587endif
1588
1589if conf.get('ENABLE_TIMEDATED', 0) == 1
37efbbd8
ZJS
1590 executable('systemd-timedated',
1591 'src/timedate/timedated.c',
005a29f2 1592 include_directories : includes,
aac26058 1593 link_with : [libshared],
37efbbd8
ZJS
1594 install_rpath : rootlibexecdir,
1595 install : true,
1596 install_dir : rootlibexecdir)
5c23128d 1597
37efbbd8
ZJS
1598 exe = executable('timedatectl',
1599 'src/timedate/timedatectl.c',
1600 include_directories : includes,
1601 install_rpath : rootlibexecdir,
1602 link_with : [libshared],
1603 install : true)
1604 public_programs += [exe]
5c23128d
ZJS
1605endif
1606
37efbbd8
ZJS
1607if conf.get('ENABLE_TIMESYNCD', 0) == 1
1608 executable('systemd-timesyncd',
1609 systemd_timesyncd_sources,
005a29f2 1610 include_directories : includes,
aac26058 1611 link_with : [libshared],
005a29f2 1612 dependencies : [threads,
37efbbd8 1613 libm],
005a29f2
ZJS
1614 install_rpath : rootlibexecdir,
1615 install : true,
37efbbd8 1616 install_dir : rootlibexecdir)
5c23128d
ZJS
1617endif
1618
37efbbd8
ZJS
1619if conf.get('ENABLE_MACHINED', 0) == 1
1620 executable('systemd-machined',
1621 systemd_machined_sources,
1622 include_directories : includes,
1623 link_with : [libmachine_core,
1624 libshared],
1625 install_rpath : rootlibexecdir,
1626 install : true,
1627 install_dir : rootlibexecdir)
1628
1629 exe = executable('machinectl',
1630 'src/machine/machinectl.c',
1631 include_directories : includes,
1632 link_with : [libshared],
1633 dependencies : [threads,
1634 libxz,
1635 liblz4],
1636 install_rpath : rootlibexecdir,
1637 install : true,
1638 install_dir : rootbindir)
1639 public_programs += [exe]
5c23128d
ZJS
1640endif
1641
37efbbd8
ZJS
1642if conf.get('ENABLE_IMPORTD', 0) == 1
1643 executable('systemd-importd',
1644 systemd_importd_sources,
005a29f2 1645 include_directories : includes,
aac26058 1646 link_with : [libshared],
37efbbd8 1647 dependencies : [threads],
005a29f2
ZJS
1648 install_rpath : rootlibexecdir,
1649 install : true,
1650 install_dir : rootlibexecdir)
37efbbd8
ZJS
1651
1652 systemd_pull = executable('systemd-pull',
1653 systemd_pull_sources,
1654 include_directories : includes,
1655 link_with : [libshared],
1656 dependencies : [libcurl,
1657 libz,
1658 libbzip2,
1659 libxz,
1660 libgcrypt],
1661 install_rpath : rootlibexecdir,
1662 install : true,
1663 install_dir : rootlibexecdir)
1664
1665 systemd_import = executable('systemd-import',
1666 systemd_import_sources,
1667 include_directories : includes,
1668 link_with : [libshared],
1669 dependencies : [libcurl,
1670 libz,
1671 libbzip2,
1672 libxz],
1673 install_rpath : rootlibexecdir,
1674 install : true,
1675 install_dir : rootlibexecdir)
1676
1677 systemd_export = executable('systemd-export',
1678 systemd_export_sources,
1679 include_directories : includes,
1680 link_with : [libshared],
1681 dependencies : [libcurl,
1682 libz,
1683 libbzip2,
1684 libxz],
1685 install_rpath : rootlibexecdir,
1686 install : true,
1687 install_dir : rootlibexecdir)
1688 public_programs += [systemd_pull, systemd_import, systemd_export]
1689endif
1690
1691if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_LIBCURL', 0) == 1
1692 exe = executable('systemd-journal-upload',
1693 systemd_journal_upload_sources,
1694 include_directories : includes,
1695 link_with : [libshared],
1696 dependencies : [threads,
1697 libcurl,
1698 libgnutls,
1699 libxz,
1700 liblz4],
1701 install_rpath : rootlibexecdir,
1702 install : true,
1703 install_dir : rootlibexecdir)
1704 public_programs += [exe]
5c23128d
ZJS
1705endif
1706
1707if conf.get('ENABLE_REMOTE', 0) == 1 and conf.get('HAVE_MICROHTTPD', 0) == 1
37efbbd8
ZJS
1708 s_j_remote = executable('systemd-journal-remote',
1709 systemd_journal_remote_sources,
1710 include_directories : includes,
1711 link_with : [libshared],
1712 dependencies : [threads,
1713 libmicrohttpd,
1714 libgnutls,
1715 libxz,
1716 liblz4],
1717 install_rpath : rootlibexecdir,
1718 install : true,
1719 install_dir : rootlibexecdir)
1720
1721 s_j_gatewayd = executable('systemd-journal-gatewayd',
1722 systemd_journal_gatewayd_sources,
1723 include_directories : includes,
1724 link_with : [libshared],
1725 dependencies : [threads,
1726 libmicrohttpd,
1727 libgnutls,
1728 libxz,
1729 liblz4],
1730 install_rpath : rootlibexecdir,
1731 install : true,
1732 install_dir : rootlibexecdir)
1733 public_programs += [s_j_remote, s_j_gatewayd]
5c23128d
ZJS
1734endif
1735
1736if conf.get('ENABLE_COREDUMP', 0) == 1
37efbbd8
ZJS
1737 executable('systemd-coredump',
1738 systemd_coredump_sources,
005a29f2 1739 include_directories : includes,
aac26058 1740 link_with : [libshared],
005a29f2 1741 dependencies : [threads,
37efbbd8
ZJS
1742 libacl,
1743 libdw,
005a29f2
ZJS
1744 libxz,
1745 liblz4],
1746 install_rpath : rootlibexecdir,
37efbbd8
ZJS
1747 install : true,
1748 install_dir : rootlibexecdir)
1749
1750 exe = executable('coredumpctl',
1751 coredumpctl_sources,
1752 include_directories : includes,
1753 link_with : [libshared],
1754 dependencies : [threads,
1755 libxz,
1756 liblz4],
1757 install_rpath : rootlibexecdir,
1758 install : true)
1759 public_programs += [exe]
5c23128d
ZJS
1760endif
1761
1762if conf.get('ENABLE_BINFMT', 0) == 1
37efbbd8
ZJS
1763 exe = executable('systemd-binfmt',
1764 'src/binfmt/binfmt.c',
1765 include_directories : includes,
1766 link_with : [libshared],
1767 install_rpath : rootlibexecdir,
1768 install : true,
1769 install_dir : rootlibexecdir)
1770 public_programs += [exe]
1771
1772 meson.add_install_script('sh', '-c',
1773 mkdir_p.format(binfmtdir))
1774 meson.add_install_script('sh', '-c',
1775 mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
1776endif
1777
1778if conf.get('ENABLE_VCONSOLE', 0) == 1
1779 executable('systemd-vconsole-setup',
1780 'src/vconsole/vconsole-setup.c',
005a29f2
ZJS
1781 include_directories : includes,
1782 link_with : [libshared],
1783 install_rpath : rootlibexecdir,
1784 install : true,
1785 install_dir : rootlibexecdir)
5c23128d
ZJS
1786endif
1787
1788if conf.get('ENABLE_RANDOMSEED', 0) == 1
37efbbd8
ZJS
1789 executable('systemd-random-seed',
1790 'src/random-seed/random-seed.c',
1791 include_directories : includes,
1792 link_with : [libshared],
1793 install_rpath : rootlibexecdir,
1794 install : true,
1795 install_dir : rootlibexecdir)
5c23128d
ZJS
1796endif
1797
1798if conf.get('ENABLE_FIRSTBOOT', 0) == 1
37efbbd8
ZJS
1799 executable('systemd-firstboot',
1800 'src/firstboot/firstboot.c',
1801 include_directories : includes,
1802 link_with : [libshared],
1803 dependencies : [libcrypt],
1804 install_rpath : rootlibexecdir,
1805 install : true,
1806 install_dir : rootbindir)
5c23128d
ZJS
1807endif
1808
1809executable('systemd-remount-fs',
1810 'src/remount-fs/remount-fs.c',
1811 'src/core/mount-setup.c',
1812 'src/core/mount-setup.h',
1813 include_directories : includes,
1814 link_with : [libshared],
b2fc5836 1815 install_rpath : rootlibexecdir,
5c23128d
ZJS
1816 install : true,
1817 install_dir : rootlibexecdir)
1818
1819executable('systemd-machine-id-setup',
1820 'src/machine-id-setup/machine-id-setup-main.c',
1821 'src/core/machine-id-setup.c',
1822 'src/core/machine-id-setup.h',
1823 include_directories : includes,
aac26058 1824 link_with : [libshared],
b2fc5836 1825 install_rpath : rootlibexecdir,
5c23128d
ZJS
1826 install : true,
1827 install_dir : rootbindir)
1828
1829executable('systemd-fsck',
1830 'src/fsck/fsck.c',
1831 include_directories : includes,
aac26058 1832 link_with : [libshared],
421f0012 1833 install_rpath : rootlibexecdir,
5c23128d
ZJS
1834 install : true,
1835 install_dir : rootlibexecdir)
1836
1837executable('systemd-sleep',
1838 'src/sleep/sleep.c',
1839 include_directories : includes,
1840 link_with : [libshared],
421f0012 1841 install_rpath : rootlibexecdir,
5c23128d
ZJS
1842 install : true,
1843 install_dir : rootlibexecdir)
1844
005a29f2
ZJS
1845exe = executable('systemd-sysctl',
1846 'src/sysctl/sysctl.c',
1847 include_directories : includes,
1848 link_with : [libshared],
1849 install_rpath : rootlibexecdir,
1850 install : true,
1851 install_dir : rootlibexecdir)
1852public_programs += [exe]
5c23128d
ZJS
1853
1854executable('systemd-ac-power',
1855 'src/ac-power/ac-power.c',
1856 include_directories : includes,
1857 link_with : [libshared],
421f0012 1858 install_rpath : rootlibexecdir,
5c23128d
ZJS
1859 install : true,
1860 install_dir : rootlibexecdir)
1861
005a29f2
ZJS
1862exe = executable('systemd-detect-virt',
1863 'src/detect-virt/detect-virt.c',
1864 include_directories : includes,
1865 link_with : [libshared],
1866 install_rpath : rootlibexecdir,
1867 install : true)
1868public_programs += [exe]
1869
1870exe = executable('systemd-delta',
1871 'src/delta/delta.c',
1872 include_directories : includes,
1873 link_with : [libshared],
1874 install_rpath : rootlibexecdir,
1875 install : true)
1876public_programs += [exe]
1877
1878exe = executable('systemd-escape',
1879 'src/escape/escape.c',
1880 include_directories : includes,
1881 link_with : [libshared],
1882 install_rpath : rootlibexecdir,
1883 install : true,
1884 install_dir : rootbindir)
1885public_programs += [exe]
1886
1887exe = executable('systemd-notify',
1888 'src/notify/notify.c',
1889 include_directories : includes,
1890 link_with : [libshared],
1891 install_rpath : rootlibexecdir,
1892 install : true,
1893 install_dir : rootbindir)
1894public_programs += [exe]
5c23128d
ZJS
1895
1896executable('systemd-volatile-root',
1897 'src/volatile-root/volatile-root.c',
1898 include_directories : includes,
1899 link_with : [libshared],
421f0012 1900 install_rpath : rootlibexecdir,
5c23128d
ZJS
1901 install : true,
1902 install_dir : rootlibexecdir)
1903
1904executable('systemd-cgroups-agent',
1905 'src/cgroups-agent/cgroups-agent.c',
1906 include_directories : includes,
1907 link_with : [libshared],
421f0012 1908 install_rpath : rootlibexecdir,
5c23128d
ZJS
1909 install : true,
1910 install_dir : rootlibexecdir)
1911
005a29f2
ZJS
1912exe = executable('systemd-path',
1913 'src/path/path.c',
1914 include_directories : includes,
aac26058 1915 link_with : [libshared],
005a29f2
ZJS
1916 install_rpath : rootlibexecdir,
1917 install : true)
1918public_programs += [exe]
1919
1920exe = executable('systemd-ask-password',
1921 'src/ask-password/ask-password.c',
1922 include_directories : includes,
aac26058 1923 link_with : [libshared],
005a29f2
ZJS
1924 install_rpath : rootlibexecdir,
1925 install : true,
1926 install_dir : rootbindir)
1927public_programs += [exe]
5c23128d
ZJS
1928
1929executable('systemd-reply-password',
1930 'src/reply-password/reply-password.c',
1931 include_directories : includes,
aac26058 1932 link_with : [libshared],
421f0012 1933 install_rpath : rootlibexecdir,
5c23128d
ZJS
1934 install : true,
1935 install_dir : rootlibexecdir)
1936
005a29f2
ZJS
1937exe = executable('systemd-tty-ask-password-agent',
1938 'src/tty-ask-password-agent/tty-ask-password-agent.c',
1939 include_directories : includes,
aac26058 1940 link_with : [libshared],
005a29f2
ZJS
1941 install_rpath : rootlibexecdir,
1942 install : true,
1943 install_dir : rootbindir)
1944public_programs += [exe]
1945
1946exe = executable('systemd-cgls',
1947 'src/cgls/cgls.c',
1948 include_directories : includes,
aac26058 1949 link_with : [libshared],
005a29f2
ZJS
1950 install_rpath : rootlibexecdir,
1951 install : true)
1952public_programs += [exe]
1953
1954exe = executable('systemd-cgtop',
1955 'src/cgtop/cgtop.c',
1956 include_directories : includes,
aac26058 1957 link_with : [libshared],
005a29f2
ZJS
1958 install_rpath : rootlibexecdir,
1959 install : true)
1960public_programs += [exe]
5c23128d
ZJS
1961
1962executable('systemd-initctl',
1963 'src/initctl/initctl.c',
1964 include_directories : includes,
aac26058 1965 link_with : [libshared],
421f0012 1966 install_rpath : rootlibexecdir,
5c23128d
ZJS
1967 install : true,
1968 install_dir : rootlibexecdir)
1969
005a29f2
ZJS
1970exe = executable('systemd-mount',
1971 'src/mount/mount-tool.c',
1972 include_directories : includes,
1973 link_with : [libshared,
005a29f2
ZJS
1974 libudev],
1975 install_rpath : rootlibexecdir,
1976 install : true)
1977public_programs += [exe]
5c23128d 1978
7b76fce1 1979meson.add_install_script(meson_make_symlink,
e17e5ba9 1980 'systemd-mount', join_paths(bindir, 'systemd-umount'))
7b76fce1 1981
005a29f2
ZJS
1982exe = executable('systemd-run',
1983 'src/run/run.c',
1984 include_directories : includes,
aac26058 1985 link_with : [libshared],
005a29f2
ZJS
1986 install_rpath : rootlibexecdir,
1987 install : true)
1988public_programs += [exe]
1989
1990exe = executable('systemd-stdio-bridge',
1991 'src/stdio-bridge/stdio-bridge.c',
1992 include_directories : includes,
aac26058 1993 link_with : [libshared],
005a29f2
ZJS
1994 install_rpath : rootlibexecdir,
1995 install : true)
1996public_programs += [exe]
1997
1998exe = executable('busctl',
1999 'src/busctl/busctl.c',
2000 'src/busctl/busctl-introspect.c',
2001 'src/busctl/busctl-introspect.h',
2002 include_directories : includes,
aac26058 2003 link_with : [libshared],
005a29f2
ZJS
2004 install_rpath : rootlibexecdir,
2005 install : true)
2006public_programs += [exe]
5c23128d
ZJS
2007
2008if conf.get('ENABLE_SYSUSERS', 0) == 1
37efbbd8
ZJS
2009 exe = executable('systemd-sysusers',
2010 'src/sysusers/sysusers.c',
2011 include_directories : includes,
2012 link_with : [libshared],
2013 install_rpath : rootlibexecdir,
2014 install : true,
2015 install_dir : rootbindir)
2016 public_programs += [exe]
5c23128d
ZJS
2017endif
2018
2019if conf.get('ENABLE_TMPFILES', 0) == 1
37efbbd8
ZJS
2020 exe = executable('systemd-tmpfiles',
2021 'src/tmpfiles/tmpfiles.c',
2022 include_directories : includes,
2023 link_with : [libshared],
2024 dependencies : [libacl],
2025 install_rpath : rootlibexecdir,
2026 install : true,
2027 install_dir : rootbindir)
2028 public_programs += [exe]
5c23128d
ZJS
2029endif
2030
2031if conf.get('ENABLE_HWDB', 0) == 1
37efbbd8
ZJS
2032 exe = executable('systemd-hwdb',
2033 'src/hwdb/hwdb.c',
2034 'src/libsystemd/sd-hwdb/hwdb-internal.h',
2035 include_directories : includes,
0da6f396
MB
2036 link_with : [libudev_internal],
2037 install_rpath : udev_rpath,
37efbbd8
ZJS
2038 install : true,
2039 install_dir : rootbindir)
2040 public_programs += [exe]
2041endif
2042
2043if conf.get('ENABLE_QUOTACHECK', 0) == 1
2044 executable('systemd-quotacheck',
2045 'src/quotacheck/quotacheck.c',
005a29f2 2046 include_directories : includes,
aac26058 2047 link_with : [libshared],
005a29f2
ZJS
2048 install_rpath : rootlibexecdir,
2049 install : true,
37efbbd8 2050 install_dir : rootlibexecdir)
5c23128d
ZJS
2051endif
2052
005a29f2
ZJS
2053exe = executable('systemd-socket-proxyd',
2054 'src/socket-proxy/socket-proxyd.c',
2055 include_directories : includes,
aac26058 2056 link_with : [libshared],
005a29f2
ZJS
2057 dependencies : [threads],
2058 install_rpath : rootlibexecdir,
2059 install : true,
2060 install_dir : rootlibexecdir)
2061public_programs += [exe]
2062
2063exe = executable('systemd-udevd',
2064 systemd_udevd_sources,
2065 include_directories : includes,
2066 link_with : [libudev_core,
005a29f2 2067 libsystemd_network,
1aec3ed9 2068 libudev_internal],
3a30f21f
ZJS
2069 dependencies : [threads,
2070 libkmod,
005a29f2 2071 libidn,
aac26058
ZJS
2072 libacl,
2073 libblkid],
1aec3ed9 2074 install_rpath : udev_rpath,
005a29f2
ZJS
2075 install : true,
2076 install_dir : rootlibexecdir)
2077public_programs += [exe]
2078
2079exe = executable('udevadm',
2080 udevadm_sources,
2081 include_directories : includes,
2082 link_with : [libudev_core,
005a29f2 2083 libsystemd_network,
1aec3ed9 2084 libudev_internal],
3a30f21f
ZJS
2085 dependencies : [threads,
2086 libkmod,
005a29f2 2087 libidn,
aac26058
ZJS
2088 libacl,
2089 libblkid],
1aec3ed9 2090 install_rpath : udev_rpath,
005a29f2
ZJS
2091 install : true,
2092 install_dir : rootbindir)
2093public_programs += [exe]
5c23128d
ZJS
2094
2095executable('systemd-shutdown',
2096 systemd_shutdown_sources,
2097 include_directories : includes,
826472ce
ZJS
2098 link_with : [libshared,
2099 libudev],
421f0012 2100 install_rpath : rootlibexecdir,
5c23128d
ZJS
2101 install : true,
2102 install_dir : rootlibexecdir)
2103
2104executable('systemd-update-done',
2105 'src/update-done/update-done.c',
2106 include_directories : includes,
2107 link_with : [libshared],
421f0012 2108 install_rpath : rootlibexecdir,
5c23128d
ZJS
2109 install : true,
2110 install_dir : rootlibexecdir)
2111
2112executable('systemd-update-utmp',
2113 'src/update-utmp/update-utmp.c',
2114 include_directories : includes,
aac26058 2115 link_with : [libshared],
5c23128d 2116 dependencies : [libaudit],
421f0012 2117 install_rpath : rootlibexecdir,
5c23128d
ZJS
2118 install : true,
2119 install_dir : rootlibexecdir)
2120
2121if conf.get('HAVE_KMOD', 0) == 1
37efbbd8
ZJS
2122 executable('systemd-modules-load',
2123 'src/modules-load/modules-load.c',
2124 include_directories : includes,
2125 link_with : [libshared],
2126 dependencies : [libkmod],
2127 install_rpath : rootlibexecdir,
2128 install : true,
2129 install_dir : rootlibexecdir)
94e75a54 2130
37efbbd8
ZJS
2131 meson.add_install_script('sh', '-c',
2132 mkdir_p.format(modulesloaddir))
2133 meson.add_install_script('sh', '-c',
2134 mkdir_p.format(join_paths(sysconfdir, 'modules-load.d')))
5c23128d
ZJS
2135endif
2136
005a29f2
ZJS
2137exe = executable('systemd-nspawn',
2138 systemd_nspawn_sources,
2139 'src/core/mount-setup.c', # FIXME: use a variable?
2140 'src/core/mount-setup.h',
2141 'src/core/loopback-setup.c',
2142 'src/core/loopback-setup.h',
2143 include_directories : [includes, include_directories('src/nspawn')],
2144 link_with : [libfirewall,
2145 libshared,
aac26058 2146 libudev],
005a29f2
ZJS
2147 dependencies : [libacl,
2148 libblkid,
2149 libseccomp,
2150 libselinux],
2151 install_rpath : rootlibexecdir,
2152 install : true)
2153public_programs += [exe]
5c23128d 2154
f0bd7cc7 2155if conf.get('ENABLE_NETWORKD', 0) == 1
37efbbd8
ZJS
2156 executable('systemd-networkd',
2157 systemd_networkd_sources,
2158 include_directories : includes,
2159 link_with : [libnetworkd_core,
2160 libfirewall,
2161 libsystemd_network,
2162 libudev_internal,
2163 libshared],
2164 install_rpath : rootlibexecdir,
2165 install : true,
2166 install_dir : rootlibexecdir)
2167
2168 executable('systemd-networkd-wait-online',
2169 systemd_networkd_wait_online_sources,
2170 include_directories : includes,
2171 link_with : [libnetworkd_core,
2172 libshared],
2173 install_rpath : rootlibexecdir,
2174 install : true,
2175 install_dir : rootlibexecdir)
f0bd7cc7 2176endif
5c23128d 2177
005a29f2
ZJS
2178exe = executable('networkctl',
2179 networkctl_sources,
2180 include_directories : includes,
2181 link_with : [libsystemd_network,
aac26058 2182 libshared],
005a29f2
ZJS
2183 install_rpath : rootlibexecdir,
2184 install : true,
2185 install_dir : rootbindir)
2186public_programs += [exe]
5c23128d 2187
69e96427
ZJS
2188############################################################
2189
2190foreach tuple : tests
37efbbd8
ZJS
2191 sources = tuple[0]
2192 link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
2193 dependencies = tuple[2]
2194 condition = tuple.length() >= 4 ? tuple[3] : ''
2195 type = tuple.length() >= 5 ? tuple[4] : ''
2196 defs = tuple.length() >= 6 ? tuple[5] : []
2197 incs = tuple.length() >= 7 ? tuple[6] : includes
2198 timeout = 30
2199
2200 name = sources[0].split('/')[-1].split('.')[0]
2201 if type.startswith('timeout=')
2202 timeout = type.split('=')[1].to_int()
2203 type = ''
2204 endif
2205
2206 if condition == '' or conf.get(condition, 0) == 1
2207 install = install_tests and type == ''
2208
2209 exe = executable(
2210 name,
2211 sources,
2212 include_directories : incs,
2213 link_with : link_with,
2214 dependencies : dependencies,
2215 c_args : defs,
2216 install_rpath : rootlibexecdir,
2217 install : install,
2218 install_dir : testsdir)
2219
2220 if type == 'manual'
2221 message('@0@ is a manual test'.format(name))
2222 elif type == 'unsafe' and want_tests != 'unsafe'
2223 message('@0@ is an unsafe test'.format(name))
2224 else
2225 test(name, exe,
2226 env : test_env,
2227 timeout : timeout)
2228 endif
2229 else
2230 message('Not compiling @0@ because @1@ is not true'.format(name, condition))
2231 endif
69e96427
ZJS
2232endforeach
2233
37ab1a25 2234test_libsystemd_sym = executable(
37efbbd8
ZJS
2235 'test-libsystemd-sym',
2236 test_libsystemd_sym_c,
2237 include_directories : includes,
2238 link_with : [libsystemd],
2239 install : install_tests,
2240 install_dir : testsdir)
37ab1a25
ZJS
2241test('test-libsystemd-sym',
2242 test_libsystemd_sym)
2243
e0bec52f 2244test_libudev_sym = executable(
37efbbd8
ZJS
2245 'test-libudev-sym',
2246 test_libudev_sym_c,
2247 include_directories : includes,
2248 c_args : ['-Wno-deprecated-declarations'],
2249 link_with : [libudev],
2250 install : install_tests,
2251 install_dir : testsdir)
e0bec52f
ZJS
2252test('test-libudev-sym',
2253 test_libudev_sym)
2254
69e96427 2255############################################################
5c23128d
ZJS
2256
2257make_directive_index_py = find_program('tools/make-directive-index.py')
2258make_man_index_py = find_program('tools/make-man-index.py')
b184e8fe 2259xml_helper_py = find_program('tools/xml_helper.py')
abba22c5 2260hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
5c23128d
ZJS
2261
2262subdir('units')
2263subdir('sysctl.d')
2264subdir('sysusers.d')
2265subdir('tmpfiles.d')
2266subdir('rules')
2267subdir('hwdb')
2268subdir('network')
2269subdir('man')
2270subdir('shell-completion/bash')
2271subdir('shell-completion/zsh')
2272subdir('docs/sysvinit')
2273subdir('docs/var-log')
2274
2275# FIXME: figure out if the warning is true:
2276# https://github.com/mesonbuild/meson/wiki/Reference-manual#install_subdir
2277install_subdir('factory/etc',
2278 install_dir : factorydir)
2279
2280
2281install_data('xorg/50-systemd-user.sh',
2282 install_dir : xinitrcdir)
2283install_data('system-preset/90-systemd.preset',
2284 install_dir : systempresetdir)
2285install_data('README',
2286 'NEWS',
2287 'CODING_STYLE',
2288 'DISTRO_PORTING',
2289 'ENVIRONMENT.md',
2290 'LICENSE.GPL2',
2291 'LICENSE.LGPL2.1',
2292 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
2293 install_dir : docdir)
d68b342b 2294
94e75a54
ZJS
2295meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
2296meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
2297
d68b342b
ZJS
2298############################################################
2299
005a29f2
ZJS
2300meson_check_help = find_program('tools/meson-check-help.sh')
2301
2302foreach exec : public_programs
37efbbd8
ZJS
2303 name = exec.full_path().split('/')[-1]
2304 test('check-help-' + name,
2305 meson_check_help,
2306 args : [exec.full_path()])
005a29f2
ZJS
2307endforeach
2308
2309############################################################
2310
d68b342b 2311if git.found() and etags.found()
37efbbd8
ZJS
2312 all_files = run_command(
2313 git,
2314 ['--git-dir=@0@/.git'.format(meson.source_root()),
2315 'ls-files',
2316 ':/*.[ch]'])
2317 all_files = files(all_files.stdout().split())
d68b342b 2318
37efbbd8
ZJS
2319 custom_target(
2320 'TAGS',
2321 output : 'TAGS',
2322 input : all_files,
2323 command : [etags, '-o', '@OUTPUT@'] + all_files)
d68b342b 2324endif
177929c2
ZJS
2325
2326if git.found()
37efbbd8 2327 meson_git_contrib_sh = find_program('tools/meson-git-contrib.sh')
a923e085 2328 run_target(
37efbbd8 2329 'git-contrib',
37efbbd8 2330 command : [meson_git_contrib_sh])
177929c2 2331endif