]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
Merge pull request #25791 from keszybz/ukify-check-inputs
[thirdparty/systemd.git] / src / shared / meson.build
CommitLineData
db9ecf05 1# SPDX-License-Identifier: LGPL-2.1-or-later
3a726fcd 2
f1b98127
ZJS
3shared_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 'blockdev-util.c',
21 'blockdev-util.h',
22 'bond-util.c',
23 'bond-util.h',
24 'boot-timestamps.c',
25 'boot-timestamps.h',
26 'bootspec.c',
27 'bootspec.h',
28 'bpf-dlopen.c',
29 'bpf-dlopen.h',
30 'bpf-program.c',
31 'bpf-program.h',
32 'bridge-util.c',
33 'bridge-util.h',
34 'btrfs-util.c',
35 'btrfs-util.h',
36 'bus-get-properties.c',
37 'bus-get-properties.h',
38 'bus-locator.c',
39 'bus-locator.h',
40 'bus-log-control-api.c',
41 'bus-log-control-api.h',
42 'bus-map-properties.c',
43 'bus-map-properties.h',
44 'bus-message-util.c',
45 'bus-message-util.h',
46 'bus-object.c',
47 'bus-object.h',
48 'bus-polkit.c',
49 'bus-polkit.h',
50 'bus-print-properties.c',
51 'bus-print-properties.h',
52 'bus-unit-procs.c',
53 'bus-unit-procs.h',
54 'bus-unit-util.c',
55 'bus-unit-util.h',
56 'bus-util.c',
57 'bus-util.h',
58 'bus-wait-for-jobs.c',
59 'bus-wait-for-jobs.h',
60 'bus-wait-for-units.c',
61 'bus-wait-for-units.h',
62 'calendarspec.c',
63 'calendarspec.h',
64 'cgroup-setup.c',
65 'cgroup-setup.h',
66 'cgroup-show.c',
67 'cgroup-show.h',
68 'chown-recursive.c',
69 'chown-recursive.h',
70 'clean-ipc.c',
71 'clean-ipc.h',
72 'clock-util.c',
73 'clock-util.h',
a8835c11
LP
74 'compare-operator.c',
75 'compare-operator.h',
f1b98127
ZJS
76 'condition.c',
77 'condition.h',
78 'conf-parser.c',
79 'conf-parser.h',
80 'copy.c',
81 'copy.h',
82 'coredump-util.c',
83 'coredump-util.h',
84 'cpu-set-util.c',
85 'cpu-set-util.h',
86 'creds-util.c',
87 'creds-util.h',
88 'cryptsetup-util.c',
89 'cryptsetup-util.h',
50e23ac6 90 'daemon-util.c',
f1b98127
ZJS
91 'daemon-util.h',
92 'data-fd-util.c',
93 'data-fd-util.h',
94 'dev-setup.c',
95 'dev-setup.h',
96 'device-nodes.c',
97 'device-nodes.h',
98 'devnode-acl.h',
99 'discover-image.c',
100 'discover-image.h',
101 'dissect-image.c',
102 'dissect-image.h',
103 'dlfcn-util.c',
104 'dlfcn-util.h',
105 'dm-util.c',
106 'dm-util.h',
107 'dns-domain.c',
108 'dns-domain.h',
109 'dropin.c',
110 'dropin.h',
7be4b236
LP
111 'efi-api.c',
112 'efi-api.h',
f1b98127
ZJS
113 'efi-loader.c',
114 'efi-loader.h',
115 'elf-util.c',
116 'elf-util.h',
117 'enable-mempool.c',
118 'env-file-label.c',
119 'env-file-label.h',
120 'ethtool-util.c',
121 'ethtool-util.h',
122 'exec-util.c',
123 'exec-util.h',
124 'exit-status.c',
125 'exit-status.h',
126 'extension-release.c',
127 'extension-release.h',
f1b98127
ZJS
128 'fdset.c',
129 'fdset.h',
130 'fileio-label.c',
131 'fileio-label.h',
e94830c0
LP
132 'find-esp.c',
133 'find-esp.h',
f1b98127
ZJS
134 'firewall-util-nft.c',
135 'firewall-util-private.h',
136 'firewall-util.c',
137 'firewall-util.h',
138 'format-table.c',
139 'format-table.h',
140 'fsck-util.h',
141 'fstab-util.c',
142 'fstab-util.h',
143 'generator.c',
144 'generator.h',
145 'geneve-util.c',
146 'geneve-util.h',
147 'gpt.c',
148 'gpt.h',
149 'group-record.c',
150 'group-record.h',
151 'hostname-setup.c',
152 'hostname-setup.h',
153 'hwdb-util.c',
154 'hwdb-util.h',
155 'id128-print.c',
156 'id128-print.h',
157 'idn-util.c',
158 'idn-util.h',
159 'ima-util.c',
160 'ima-util.h',
161 'import-util.c',
162 'import-util.h',
163 'in-addr-prefix-util.c',
164 'in-addr-prefix-util.h',
165 'initreq.h',
166 'install-file.c',
167 'install-file.h',
168 'install-printf.c',
169 'install-printf.h',
170 'install.c',
171 'install.h',
172 'ip-protocol-list.c',
173 'ip-protocol-list.h',
174 'ipvlan-util.c',
175 'ipvlan-util.h',
176 'journal-importer.c',
177 'journal-importer.h',
178 'journal-util.c',
179 'journal-util.h',
180 'json-internal.h',
181 'json.c',
182 'json.h',
183 'kbd-util.c',
184 'kbd-util.h',
f1b98127 185 'keyring-util.c',
b7df2c78 186 'keyring-util.h',
f1b98127
ZJS
187 'killall.c',
188 'killall.h',
189 'label.c',
190 'label.h',
191 'libcrypt-util.c',
192 'libcrypt-util.h',
193 'libfido2-util.c',
194 'libfido2-util.h',
08221c57 195 'libmount-util.c',
f1b98127
ZJS
196 'libmount-util.h',
197 'linux/auto_dev-ioctl.h',
198 'linux/bpf.h',
199 'linux/bpf_common.h',
200 'linux/bpf_insn.h',
201 'linux/dm-ioctl.h',
202 'linux/ethtool.h',
203 'local-addresses.c',
204 'local-addresses.h',
3d36b5d7
YW
205 'locale-setup.c',
206 'locale-setup.h',
f1b98127
ZJS
207 'lockfile-util.c',
208 'lockfile-util.h',
209 'log-link.h',
210 'logs-show.c',
211 'logs-show.h',
212 'loop-util.c',
213 'loop-util.h',
214 'loopback-setup.c',
215 'loopback-setup.h',
216 'machine-id-setup.c',
217 'machine-id-setup.h',
218 'machine-pool.c',
219 'machine-pool.h',
220 'macvlan-util.c',
221 'macvlan-util.h',
222 'main-func.h',
223 'mkdir-label.c',
224 'mkdir-label.h',
225 'mkfs-util.c',
226 'mkfs-util.h',
227 'module-util.h',
228 'mount-setup.c',
229 'mount-setup.h',
230 'mount-util.c',
231 'mount-util.h',
232 'net-condition.c',
233 'net-condition.h',
234 'netif-naming-scheme.c',
235 'netif-naming-scheme.h',
236 'netif-sriov.c',
237 'netif-sriov.h',
238 'netif-util.c',
239 'netif-util.h',
240 'nscd-flush.h',
241 'nsflags.c',
242 'nsflags.h',
243 'numa-util.c',
244 'numa-util.h',
245 'openssl-util.c',
246 'openssl-util.h',
247 'output-mode.c',
248 'output-mode.h',
249 'pager.c',
250 'pager.h',
251 'parse-argument.c',
252 'parse-argument.h',
c3eaba2d
ZJS
253 'parse-helpers.c',
254 'parse-helpers.h',
e30c1d01
DDM
255 'pcre2-util.c',
256 'pcre2-util.h',
f1b98127
ZJS
257 'pe-header.h',
258 'pkcs11-util.c',
259 'pkcs11-util.h',
260 'pretty-print.c',
261 'pretty-print.h',
262 'psi-util.c',
263 'psi-util.h',
264 'ptyfwd.c',
265 'ptyfwd.h',
266 'pwquality-util.c',
267 'pwquality-util.h',
268 'qrcode-util.c',
269 'qrcode-util.h',
270 'quota-util.c',
271 'quota-util.h',
272 'reboot-util.c',
273 'reboot-util.h',
af72f975
ZJS
274 'recovery-key.c',
275 'recovery-key.h',
f1b98127
ZJS
276 'resize-fs.c',
277 'resize-fs.h',
278 'resolve-util.c',
279 'resolve-util.h',
280 'rm-rf.c',
281 'rm-rf.h',
282 'seccomp-util.h',
283 'securebits-util.c',
284 'securebits-util.h',
285 'selinux-util.c',
286 'selinux-util.h',
287 'serialize.c',
288 'serialize.h',
289 'service-util.c',
290 'service-util.h',
291 'sleep-config.c',
292 'sleep-config.h',
293 'smack-util.c',
294 'smack-util.h',
295 'socket-label.c',
296 'socket-netlink.c',
297 'socket-netlink.h',
298 'spawn-ask-password-agent.c',
299 'spawn-ask-password-agent.h',
300 'spawn-polkit-agent.c',
301 'spawn-polkit-agent.h',
302 'specifier.c',
303 'specifier.h',
304 'switch-root.c',
305 'switch-root.h',
306 'tmpfile-util-label.c',
307 'tmpfile-util-label.h',
308 'tomoyo-util.c',
309 'tomoyo-util.h',
310 'tpm2-util.c',
311 'tpm2-util.h',
312 'udev-util.c',
313 'udev-util.h',
314 'uid-alloc-range.c',
315 'uid-alloc-range.h',
f1b98127
ZJS
316 'user-record-nss.c',
317 'user-record-nss.h',
318 'user-record-show.c',
319 'user-record-show.h',
320 'user-record.c',
321 'user-record.h',
322 'userdb-dropin.c',
323 'userdb-dropin.h',
324 'userdb.c',
325 'userdb.h',
326 'utmp-wtmp.h',
327 'varlink.c',
328 'varlink.h',
008798e9 329 'varlink-internal.h',
f1b98127
ZJS
330 'verb-log-control.c',
331 'verb-log-control.h',
332 'verbs.c',
333 'verbs.h',
334 'vlan-util.c',
335 'vlan-util.h',
336 'volatile-util.c',
337 'volatile-util.h',
338 'watchdog.c',
339 'watchdog.h',
340 'web-util.c',
341 'web-util.h',
342 'wifi-util.c',
343 'wifi-util.h',
344 'xml.c',
2f492a73
ZJS
345 'xml.h',
346)
5c23128d 347
b9fa9b71 348if get_option('tests') != 'false'
f1b98127
ZJS
349 shared_sources += files(
350 'test-tables.h',
351 'tests.c',
2f492a73
ZJS
352 'tests.h',
353 )
b9fa9b71
MO
354endif
355
95aac012
ZJS
356generate_syscall_list = find_program('generate-syscall-list.py')
357fname = 'syscall-list.h'
358syscall_list_h = custom_target(
359 fname,
984b5296 360 input : syscall_list_txt,
95aac012
ZJS
361 output : fname,
362 command : [generate_syscall_list,
363 '@INPUT@'],
364 capture : true)
365
349cc4a5 366if conf.get('HAVE_ACL') == 1
f1b98127
ZJS
367 shared_sources += files(
368 'acl-util.c',
2f492a73
ZJS
369 'devnode-acl.c',
370 )
5c23128d
ZJS
371endif
372
3211da4b 373if conf.get('ENABLE_UTMP') == 1
975464e0 374 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
375endif
376
349cc4a5 377if conf.get('HAVE_SECCOMP') == 1
975464e0 378 shared_sources += files('seccomp-util.c')
95aac012 379 shared_sources += syscall_list_h
5c23128d
ZJS
380endif
381
349cc4a5 382if conf.get('HAVE_LIBIPTC') == 1
31220972 383 shared_sources += files('firewall-util-iptables.c')
c3045943
MB
384endif
385
43b3f0fb 386if conf.get('HAVE_LIBBPF') == 1
f1b98127
ZJS
387 shared_sources += files(
388 'bpf-link.c',
2f492a73
ZJS
389 'bpf-link.h',
390 )
43b3f0fb
JK
391endif
392
ba323bbe
YW
393if conf.get('HAVE_KMOD') == 1
394 shared_sources += files('module-util.c')
395endif
396
cef9f2a6 397if conf.get('HAVE_PAM') == 1
c5abccfa
YW
398 shared_sources += files(
399 'pam-util.c',
2f492a73
ZJS
400 'pam-util.h',
401 )
cef9f2a6
LP
402endif
403
7e0079f9
ZJS
404if conf.get('ENABLE_NSCD') == 1
405 shared_sources += files('nscd-flush.c')
406endif
407
da96ad5a
YW
408generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
409ip_protocol_list_txt = custom_target(
410 'ip-protocol-list.txt',
411 output : 'ip-protocol-list.txt',
412 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
413 capture : true)
414
da96ad5a 415fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
416gperf_file = custom_target(
417 fname,
da96ad5a 418 input : ip_protocol_list_txt,
7b5e750d 419 output : fname,
da96ad5a 420 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
421 capture : true)
422
da96ad5a 423fname = 'ip-protocol-from-name.h'
7b5e750d
YW
424target1 = custom_target(
425 fname,
426 input : gperf_file,
427 output : fname,
428 command : [gperf,
429 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
430 '-N', 'lookup_ip_protocol',
431 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
432 '-p', '-C',
433 '@INPUT@'],
434 capture : true)
435
da96ad5a
YW
436fname = 'ip-protocol-to-name.h'
437awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
438target2 = custom_target(
439 fname,
da96ad5a 440 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
441 output : fname,
442 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
443 capture : true)
444
dca23091
YW
445shared_generated_gperf_headers = [target1, target2]
446shared_sources += shared_generated_gperf_headers
7b5e750d 447
a2b0cd3f 448libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
5c23128d 449
4b57a272 450libshared_deps = [threads,
4b57a272 451 libacl,
462255c6
LP
452 libblkid,
453 libcap,
42f3b2f9 454 libcrypt,
c5fd89ad 455 libdl,
4b57a272
ZJS
456 libgcrypt,
457 libiptc,
3cb9b42a 458 libkmod,
462255c6 459 liblz4,
77c772f2 460 libmount,
839fddbe 461 libopenssl,
da035a3a 462 libp11kit_cflags,
cef9f2a6 463 libpam,
462255c6 464 librt,
4b57a272
ZJS
465 libseccomp,
466 libselinux,
a2ea44b7 467 libxenctrl,
ede5a78f 468 libxz,
c47511da
ZJS
469 libzstd,
470 versiondep]
4b57a272 471
4f5993c3
FS
472libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
473
2d4ceca8 474libshared_static = static_library(
37efbbd8
ZJS
475 libshared_name,
476 shared_sources,
2d4ceca8
ZJS
477 include_directories : includes,
478 dependencies : libshared_deps,
03f7ddf0
ZJS
479 c_args : ['-fvisibility=default'],
480 build_by_default : false)
2d4ceca8
ZJS
481
482libshared = shared_library(
483 libshared_name,
37efbbd8 484 include_directories : includes,
4287c855 485 c_args : ['-fvisibility=default'],
4f5993c3 486 link_args : ['-shared',
2d4ceca8
ZJS
487 '-Wl,--version-script=' + libshared_sym_path],
488 link_whole : [libshared_static,
34e221a5 489 libbasic,
a8e559d4 490 libbasic_gcrypt,
99b9f8fd 491 libsystemd_static],
4b57a272 492 dependencies : libshared_deps,
37efbbd8 493 install : true,
5fb22561 494 install_dir : rootpkglibdir)
f8cf3d19
LP
495
496shared_fdisk_sources = files(
497 'fdisk-util.h',
498 'fdisk-util.c',
499)
500
501if get_option('fdisk') != 'false'
502 libshared_fdisk = static_library(
503 'shared-fdisk',
504 shared_fdisk_sources,
505 include_directories : includes,
506 dependencies : [libfdisk],
507 c_args : ['-fvisibility=default'],
508 build_by_default : false)
509endif