]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
systemctl,loginctl,machinectl: use a shared helper for arg_signal
[thirdparty/systemd.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 shared_sources = files('''
4 acl-util.h
5 acpi-fpdt.c
6 acpi-fpdt.h
7 apparmor-util.c
8 apparmor-util.h
9 ask-password-api.c
10 ask-password-api.h
11 barrier.c
12 barrier.h
13 base-filesystem.c
14 base-filesystem.h
15 binfmt-util.c
16 binfmt-util.h
17 bitmap.c
18 bitmap.h
19 blkid-util.h
20 bond-util.c
21 bond-util.h
22 boot-timestamps.c
23 boot-timestamps.h
24 bootspec.c
25 bootspec.h
26 bpf-program.c
27 bpf-program.h
28 bridge-util.c
29 bridge-util.h
30 bus-get-properties.c
31 bus-get-properties.h
32 bus-locator.c
33 bus-locator.h
34 bus-log-control-api.c
35 bus-log-control-api.h
36 bus-map-properties.c
37 bus-map-properties.h
38 bus-message-util.c
39 bus-message-util.h
40 bus-object.c
41 bus-object.h
42 bus-polkit.c
43 bus-polkit.h
44 bus-print-properties.c
45 bus-print-properties.h
46 bus-unit-procs.c
47 bus-unit-procs.h
48 bus-unit-util.c
49 bus-unit-util.h
50 bus-util.c
51 bus-util.h
52 bus-wait-for-jobs.c
53 bus-wait-for-jobs.h
54 bus-wait-for-units.c
55 bus-wait-for-units.h
56 calendarspec.c
57 calendarspec.h
58 cgroup-setup.c
59 cgroup-setup.h
60 cgroup-show.c
61 cgroup-show.h
62 chown-recursive.c
63 chown-recursive.h
64 clean-ipc.c
65 clean-ipc.h
66 clock-util.c
67 clock-util.h
68 condition.c
69 condition.h
70 conf-parser.c
71 conf-parser.h
72 coredump-util.c
73 coredump-util.h
74 cpu-set-util.c
75 cpu-set-util.h
76 cryptsetup-util.c
77 cryptsetup-util.h
78 daemon-util.h
79 dev-setup.c
80 dev-setup.h
81 devnode-acl.h
82 discover-image.c
83 discover-image.h
84 dissect-image.c
85 dissect-image.h
86 dm-util.c
87 dm-util.h
88 dns-domain.c
89 dns-domain.h
90 dropin.c
91 dropin.h
92 efi-loader.c
93 efi-loader.h
94 enable-mempool.c
95 env-file-label.c
96 env-file-label.h
97 ethtool-util.c
98 ethtool-util.h
99 exec-util.c
100 exec-util.h
101 exit-status.c
102 exit-status.h
103 fdset.c
104 fdset.h
105 fileio-label.c
106 fileio-label.h
107 firewall-util-nft.c
108 firewall-util-private.h
109 firewall-util.c
110 firewall-util.h
111 format-table.c
112 format-table.h
113 fsck-util.h
114 fstab-util.c
115 fstab-util.h
116 generator.c
117 generator.h
118 geneve-util.c
119 geneve-util.h
120 gpt.c
121 gpt.h
122 group-record.c
123 group-record.h
124 hostname-setup.c
125 hostname-setup.h
126 id128-print.c
127 id128-print.h
128 idn-util.c
129 idn-util.h
130 ima-util.c
131 ima-util.h
132 import-util.c
133 import-util.h
134 initreq.h
135 install-printf.c
136 install-printf.h
137 install.c
138 install.h
139 ipvlan-util.c
140 ipvlan-util.h
141 ip-protocol-list.c
142 ip-protocol-list.h
143 journal-importer.c
144 journal-importer.h
145 journal-util.c
146 journal-util.h
147 json-internal.h
148 json.c
149 json.h
150 killall.c
151 killall.h
152 libcrypt-util.c
153 libcrypt-util.h
154 libfido2-util.c
155 libfido2-util.h
156 libmount-util.h
157 linux/auto_dev-ioctl.h
158 linux/bpf.h
159 linux/bpf_common.h
160 linux/bpf_insn.h
161 linux/dm-ioctl.h
162 linux/ethtool.h
163 local-addresses.c
164 local-addresses.h
165 lockfile-util.c
166 lockfile-util.h
167 log-link.h
168 logs-show.c
169 logs-show.h
170 loop-util.c
171 loop-util.h
172 loopback-setup.c
173 loopback-setup.h
174 machine-id-setup.c
175 machine-id-setup.h
176 machine-pool.c
177 machine-pool.h
178 macvlan-util.c
179 macvlan-util.h
180 main-func.h
181 mkfs-util.c
182 mkfs-util.h
183 module-util.h
184 mount-setup.c
185 mount-setup.h
186 mount-util.c
187 mount-util.h
188 net-condition.c
189 net-condition.h
190 netif-naming-scheme.c
191 netif-naming-scheme.h
192 nscd-flush.h
193 nsflags.c
194 nsflags.h
195 numa-util.c
196 numa-util.h
197 openssl-util.c
198 openssl-util.h
199 os-util.c
200 os-util.h
201 output-mode.c
202 output-mode.h
203 pager.c
204 pager.h
205 parse-argument.c
206 parse-argument.h
207 pe-header.h
208 pkcs11-util.c
209 pkcs11-util.h
210 pretty-print.c
211 pretty-print.h
212 psi-util.c
213 psi-util.h
214 ptyfwd.c
215 ptyfwd.h
216 pwquality-util.c
217 pwquality-util.h
218 qrcode-util.c
219 qrcode-util.h
220 reboot-util.c
221 reboot-util.h
222 resize-fs.c
223 resize-fs.h
224 resolve-util.c
225 resolve-util.h
226 seccomp-util.h
227 securebits-util.c
228 securebits-util.h
229 serialize.c
230 serialize.h
231 service-util.c
232 service-util.h
233 sleep-config.c
234 sleep-config.h
235 socket-netlink.c
236 socket-netlink.h
237 spawn-ask-password-agent.c
238 spawn-ask-password-agent.h
239 spawn-polkit-agent.c
240 spawn-polkit-agent.h
241 specifier.c
242 specifier.h
243 switch-root.c
244 switch-root.h
245 sysctl-util.c
246 sysctl-util.h
247 tmpfile-util-label.c
248 tmpfile-util-label.h
249 tomoyo-util.c
250 tomoyo-util.h
251 tpm2-util.c
252 tpm2-util.h
253 udev-util.c
254 udev-util.h
255 uid-range.c
256 uid-range.h
257 user-record-nss.c
258 user-record-nss.h
259 user-record-show.c
260 user-record-show.h
261 user-record.c
262 user-record.h
263 userdb.c
264 userdb.h
265 utmp-wtmp.h
266 varlink.c
267 varlink.h
268 verbs.c
269 verbs.h
270 vlan-util.c
271 vlan-util.h
272 volatile-util.c
273 volatile-util.h
274 watchdog.c
275 watchdog.h
276 web-util.c
277 web-util.h
278 wifi-util.c
279 wifi-util.h
280 xml.c
281 xml.h
282 '''.split())
283
284 if get_option('tests') != 'false'
285 shared_sources += files('''
286 test-tables.h
287 tests.c
288 tests.h
289 '''.split())
290 endif
291
292 generate_syscall_list = find_program('generate-syscall-list.py')
293 fname = 'syscall-list.h'
294 syscall_list_h = custom_target(
295 fname,
296 input : syscall_list_txt,
297 output : fname,
298 command : [generate_syscall_list,
299 '@INPUT@'],
300 capture : true)
301
302 if conf.get('HAVE_ACL') == 1
303 shared_sources += files('''
304 acl-util.c
305 devnode-acl.c
306 '''.split())
307 endif
308
309 if conf.get('ENABLE_UTMP') == 1
310 shared_sources += files('utmp-wtmp.c')
311 endif
312
313 if conf.get('HAVE_SECCOMP') == 1
314 shared_sources += files('seccomp-util.c')
315 shared_sources += syscall_list_h
316 endif
317
318 if conf.get('HAVE_LIBIPTC') == 1
319 shared_sources += files('firewall-util-iptables.c')
320 endif
321
322 if conf.get('HAVE_KMOD') == 1
323 shared_sources += files('module-util.c')
324 endif
325
326 if conf.get('HAVE_PAM') == 1
327 shared_sources += files(
328 'pam-util.c',
329 'pam-util.h')
330 endif
331
332 if conf.get('ENABLE_NSCD') == 1
333 shared_sources += files('nscd-flush.c')
334 endif
335
336 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
337 ip_protocol_list_txt = custom_target(
338 'ip-protocol-list.txt',
339 output : 'ip-protocol-list.txt',
340 command : [generate_ip_protocol_list, cpp],
341 capture : true)
342
343 fname = 'ip-protocol-from-name.gperf'
344 gperf_file = custom_target(
345 fname,
346 input : ip_protocol_list_txt,
347 output : fname,
348 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
349 capture : true)
350
351 fname = 'ip-protocol-from-name.h'
352 target1 = custom_target(
353 fname,
354 input : gperf_file,
355 output : fname,
356 command : [gperf,
357 '-L', 'ANSI-C', '-t', '--ignore-case',
358 '-N', 'lookup_ip_protocol',
359 '-H', 'hash_ip_protocol_name',
360 '-p', '-C',
361 '@INPUT@'],
362 capture : true)
363
364 fname = 'ip-protocol-to-name.h'
365 awkscript = 'ip-protocol-to-name.awk'
366 target2 = custom_target(
367 fname,
368 input : [awkscript, ip_protocol_list_txt],
369 output : fname,
370 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
371 capture : true)
372
373 shared_generated_gperf_headers = [target1, target2]
374 shared_sources += shared_generated_gperf_headers
375
376 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
377
378 libshared_deps = [threads,
379 libacl,
380 libblkid,
381 libcap,
382 libcrypt,
383 libgcrypt,
384 libiptc,
385 libkmod,
386 liblz4,
387 libmount,
388 libopenssl,
389 libp11kit,
390 libpam,
391 librt,
392 libseccomp,
393 libselinux,
394 libzstd,
395 libxz]
396
397 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
398
399 libshared_static = static_library(
400 libshared_name,
401 shared_sources,
402 include_directories : includes,
403 dependencies : libshared_deps,
404 c_args : ['-fvisibility=default'])
405
406 libshared = shared_library(
407 libshared_name,
408 include_directories : includes,
409 link_args : ['-shared',
410 '-Wl,--version-script=' + libshared_sym_path],
411 link_whole : [libshared_static,
412 libbasic,
413 libbasic_gcrypt,
414 libsystemd_static],
415 c_args : ['-fvisibility=default'],
416 dependencies : libshared_deps,
417 install : true,
418 install_dir : rootlibexecdir)