]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
Merge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity
[thirdparty/systemd.git] / src / shared / meson.build
CommitLineData
db9ecf05 1# SPDX-License-Identifier: LGPL-2.1-or-later
3a726fcd 2
975464e0 3shared_sources = files('''
37efbbd8
ZJS
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
d284b82b
ZJS
11 barrier.c
12 barrier.h
37efbbd8
ZJS
13 base-filesystem.c
14 base-filesystem.h
965cc994
LP
15 binfmt-util.c
16 binfmt-util.h
d284b82b
ZJS
17 bitmap.c
18 bitmap.h
19 blkid-util.h
5fe5908e
SS
20 bond-util.c
21 bond-util.h
37efbbd8
ZJS
22 boot-timestamps.c
23 boot-timestamps.h
7e87c7d9
ZJS
24 bootspec.c
25 bootspec.h
d284b82b
ZJS
26 bpf-program.c
27 bpf-program.h
af94bb24
SS
28 bridge-util.c
29 bridge-util.h
40af3d02
LP
30 bus-get-properties.c
31 bus-get-properties.h
54e27bb5
VC
32 bus-locator.c
33 bus-locator.h
052740e2
LP
34 bus-log-control-api.c
35 bus-log-control-api.h
807542be
LP
36 bus-map-properties.c
37 bus-map-properties.h
97600989
YW
38 bus-message-util.c
39 bus-message-util.h
c664cf56
LP
40 bus-object.c
41 bus-object.h
052740e2
LP
42 bus-polkit.c
43 bus-polkit.h
9176326b
LP
44 bus-print-properties.c
45 bus-print-properties.h
9f717d42
LP
46 bus-unit-procs.c
47 bus-unit-procs.h
37efbbd8
ZJS
48 bus-unit-util.c
49 bus-unit-util.h
50 bus-util.c
51 bus-util.h
e45c81b8
LP
52 bus-wait-for-jobs.c
53 bus-wait-for-jobs.h
3572d3df
LP
54 bus-wait-for-units.c
55 bus-wait-for-units.h
d284b82b
ZJS
56 calendarspec.c
57 calendarspec.h
fdb3deca
ZJS
58 cgroup-setup.c
59 cgroup-setup.h
37efbbd8
ZJS
60 cgroup-show.c
61 cgroup-show.h
417a6eec
LP
62 chown-recursive.c
63 chown-recursive.h
37efbbd8
ZJS
64 clean-ipc.c
65 clean-ipc.h
d284b82b
ZJS
66 clock-util.c
67 clock-util.h
37efbbd8
ZJS
68 condition.c
69 condition.h
70 conf-parser.c
71 conf-parser.h
b34612bd
ZJS
72 coredump-util.c
73 coredump-util.h
d284b82b
ZJS
74 cpu-set-util.c
75 cpu-set-util.h
1e2f3230
LP
76 cryptsetup-util.c
77 cryptsetup-util.h
c157884f 78 daemon-util.h
37efbbd8
ZJS
79 dev-setup.c
80 dev-setup.h
81 dissect-image.c
82 dissect-image.h
a709a315
LP
83 dm-util.c
84 dm-util.h
37efbbd8
ZJS
85 dns-domain.c
86 dns-domain.h
87 dropin.c
88 dropin.h
0bb2f0f1
ZJS
89 efi-loader.c
90 efi-loader.h
a5d8835c 91 enable-mempool.c
686d13b9
LP
92 env-file-label.c
93 env-file-label.h
5c2316c6
YW
94 ethtool-util.c
95 ethtool-util.h
d284b82b
ZJS
96 exec-util.c
97 exec-util.h
98 exit-status.c
99 exit-status.h
37efbbd8
ZJS
100 fdset.c
101 fdset.h
d284b82b
ZJS
102 fileio-label.c
103 fileio-label.h
c3045943 104 firewall-util.h
d284b82b
ZJS
105 format-table.c
106 format-table.h
b67f05da 107 fsck-util.h
37efbbd8
ZJS
108 fstab-util.c
109 fstab-util.h
37efbbd8
ZJS
110 generator.c
111 generator.h
3039cc02
SS
112 geneve-util.c
113 geneve-util.h
19ce38ce 114 gpt.c
37efbbd8 115 gpt.h
71d0b9d4
LP
116 group-record.c
117 group-record.h
ff7dad48
ZJS
118 id128-print.c
119 id128-print.h
4917e7c7
LP
120 idn-util.c
121 idn-util.h
37efbbd8
ZJS
122 ima-util.c
123 ima-util.h
124 import-util.c
125 import-util.h
126 initreq.h
37efbbd8
ZJS
127 install-printf.c
128 install-printf.h
d68c645b
LP
129 install.c
130 install.h
35072050
SS
131 ipvlan-util.c
132 ipvlan-util.h
f079c372
LP
133 ip-protocol-list.c
134 ip-protocol-list.h
d284b82b
ZJS
135 journal-importer.c
136 journal-importer.h
37efbbd8
ZJS
137 journal-util.c
138 journal-util.h
d284b82b
ZJS
139 json-internal.h
140 json.c
141 json.h
42f3b2f9
LP
142 libcrypt-util.c
143 libcrypt-util.h
fb36b133 144 libmount-util.h
01234e1f
YW
145 linux/auto_dev-ioctl.h
146 linux/bpf.h
147 linux/bpf_common.h
148 linux/bpf_insn.h
149 linux/dm-ioctl.h
150 linux/ethtool.h
733cbd00
LP
151 local-addresses.c
152 local-addresses.h
d284b82b
ZJS
153 lockfile-util.c
154 lockfile-util.h
e67ae9f5 155 log-link.h
37efbbd8
ZJS
156 logs-show.c
157 logs-show.h
158 loop-util.c
159 loop-util.h
160 machine-image.c
161 machine-image.h
162 machine-pool.c
163 machine-pool.h
d5167480
SS
164 macvlan-util.c
165 macvlan-util.h
294bf0c3 166 main-func.h
c95f9a23
LP
167 mkfs-util.c
168 mkfs-util.h
3cb9b42a 169 module-util.h
77c772f2
ZJS
170 mount-util.c
171 mount-util.h
7e19cc54
YW
172 net-condition.c
173 net-condition.h
b355d0c9
LP
174 netif-naming-scheme.c
175 netif-naming-scheme.h
f079c372
LP
176 nscd-flush.c
177 nscd-flush.h
37efbbd8
ZJS
178 nsflags.c
179 nsflags.h
1808f768
MS
180 numa-util.c
181 numa-util.h
3f637019 182 openssl-util.h
d284b82b
ZJS
183 os-util.c
184 os-util.h
37efbbd8
ZJS
185 output-mode.c
186 output-mode.h
294bf0c3
ZJS
187 pager.c
188 pager.h
5e146a75 189 pe-header.h
839fddbe
LP
190 pkcs11-util.c
191 pkcs11-util.h
294bf0c3
ZJS
192 pretty-print.c
193 pretty-print.h
42b83e8e
AZ
194 psi-util.c
195 psi-util.h
37efbbd8
ZJS
196 ptyfwd.c
197 ptyfwd.h
679badd7
LP
198 pwquality-util.c
199 pwquality-util.h
f1b82359
ZJS
200 qrcode-util.c
201 qrcode-util.h
d284b82b
ZJS
202 reboot-util.c
203 reboot-util.h
28937bcc
LP
204 resize-fs.c
205 resize-fs.h
37efbbd8
ZJS
206 resolve-util.c
207 resolve-util.h
208 seccomp-util.h
d284b82b
ZJS
209 securebits-util.c
210 securebits-util.h
d68c645b
LP
211 serialize.c
212 serialize.h
53f7f7fc
ZJS
213 service-util.c
214 service-util.h
37efbbd8
ZJS
215 sleep-config.c
216 sleep-config.h
5c3fa98d
ZJS
217 socket-netlink.c
218 socket-netlink.h
37efbbd8
ZJS
219 spawn-ask-password-agent.c
220 spawn-ask-password-agent.h
221 spawn-polkit-agent.c
222 spawn-polkit-agent.h
223 specifier.c
224 specifier.h
225 switch-root.c
226 switch-root.h
227 sysctl-util.c
228 sysctl-util.h
e4de7287
LP
229 tmpfile-util-label.c
230 tmpfile-util-label.h
ed440f6b
SL
231 tomoyo-util.c
232 tomoyo-util.h
b237a168 233 udev-util.c
d68c645b 234 udev-util.h
37efbbd8
ZJS
235 uid-range.c
236 uid-range.h
5cfa33e0 237 unit-file.c
dfadc1f2 238 unit-file.h
9b2d9078
LP
239 user-record-nss.c
240 user-record-nss.h
295c1a6e
LP
241 user-record-show.c
242 user-record-show.h
71d0b9d4
LP
243 user-record.c
244 user-record.h
ec8e4a0e
LP
245 userdb.c
246 userdb.h
37efbbd8 247 utmp-wtmp.h
d41bd96f
LP
248 varlink.c
249 varlink.h
d284b82b
ZJS
250 verbs.c
251 verbs.h
37efbbd8
ZJS
252 vlan-util.c
253 vlan-util.h
254 volatile-util.c
255 volatile-util.h
256 watchdog.c
257 watchdog.h
d284b82b
ZJS
258 web-util.c
259 web-util.h
b492aea0
ZJS
260 wifi-util.c
261 wifi-util.h
d284b82b
ZJS
262 xml.c
263 xml.h
975464e0 264'''.split())
5c23128d 265
b9fa9b71
MO
266if get_option('tests') != 'false'
267 shared_sources += files('tests.c', 'tests.h')
268endif
269
69e96427 270test_tables_h = files('test-tables.h')
5a8b1640 271shared_sources += test_tables_h
69e96427 272
95aac012
ZJS
273generate_syscall_list = find_program('generate-syscall-list.py')
274fname = 'syscall-list.h'
275syscall_list_h = custom_target(
276 fname,
277 input : 'syscall-names.text',
278 output : fname,
279 command : [generate_syscall_list,
280 '@INPUT@'],
281 capture : true)
282
349cc4a5 283if conf.get('HAVE_ACL') == 1
975464e0 284 shared_sources += files('acl-util.c')
5c23128d
ZJS
285endif
286
3211da4b 287if conf.get('ENABLE_UTMP') == 1
975464e0 288 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
289endif
290
349cc4a5 291if conf.get('HAVE_SECCOMP') == 1
975464e0 292 shared_sources += files('seccomp-util.c')
95aac012 293 shared_sources += syscall_list_h
5c23128d
ZJS
294endif
295
349cc4a5 296if conf.get('HAVE_LIBIPTC') == 1
975464e0 297 shared_sources += files('firewall-util.c')
c3045943
MB
298endif
299
ba323bbe
YW
300if conf.get('HAVE_KMOD') == 1
301 shared_sources += files('module-util.c')
302endif
303
cef9f2a6
LP
304if conf.get('HAVE_PAM') == 1
305 shared_sources += files('''
306 pam-util.c
307 pam-util.h
308'''.split())
309endif
310
da96ad5a
YW
311generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
312ip_protocol_list_txt = custom_target(
313 'ip-protocol-list.txt',
314 output : 'ip-protocol-list.txt',
315 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
316 capture : true)
317
da96ad5a 318fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
319gperf_file = custom_target(
320 fname,
da96ad5a 321 input : ip_protocol_list_txt,
7b5e750d 322 output : fname,
da96ad5a 323 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
324 capture : true)
325
da96ad5a 326fname = 'ip-protocol-from-name.h'
7b5e750d
YW
327target1 = custom_target(
328 fname,
329 input : gperf_file,
330 output : fname,
331 command : [gperf,
332 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
333 '-N', 'lookup_ip_protocol',
334 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
335 '-p', '-C',
336 '@INPUT@'],
337 capture : true)
338
da96ad5a
YW
339fname = 'ip-protocol-to-name.h'
340awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
341target2 = custom_target(
342 fname,
da96ad5a 343 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
344 output : fname,
345 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
346 capture : true)
347
dca23091
YW
348shared_generated_gperf_headers = [target1, target2]
349shared_sources += shared_generated_gperf_headers
7b5e750d 350
5c23128d
ZJS
351libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
352
4b57a272 353libshared_deps = [threads,
4b57a272 354 libacl,
462255c6
LP
355 libblkid,
356 libcap,
42f3b2f9 357 libcrypt,
4b57a272
ZJS
358 libgcrypt,
359 libiptc,
3cb9b42a 360 libkmod,
462255c6 361 liblz4,
77c772f2 362 libmount,
839fddbe
LP
363 libopenssl,
364 libp11kit,
cef9f2a6 365 libpam,
462255c6 366 librt,
4b57a272
ZJS
367 libseccomp,
368 libselinux,
ef5924aa 369 libzstd,
462255c6 370 libxz]
4b57a272 371
4f5993c3
FS
372libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
373
2d4ceca8 374libshared_static = static_library(
37efbbd8
ZJS
375 libshared_name,
376 shared_sources,
2d4ceca8
ZJS
377 include_directories : includes,
378 dependencies : libshared_deps,
379 c_args : ['-fvisibility=default'])
380
381libshared = shared_library(
382 libshared_name,
8e899a92 383 libudev_sources,
37efbbd8 384 include_directories : includes,
4f5993c3 385 link_args : ['-shared',
2d4ceca8
ZJS
386 '-Wl,--version-script=' + libshared_sym_path],
387 link_whole : [libshared_static,
34e221a5 388 libbasic,
a8e559d4 389 libbasic_gcrypt,
5e3cec87
ZJS
390 libsystemd_static,
391 libjournal_client],
37efbbd8 392 c_args : ['-fvisibility=default'],
4b57a272 393 dependencies : libshared_deps,
37efbbd8
ZJS
394 install : true,
395 install_dir : rootlibexecdir)
47354b44
ZJS
396
397############################################################
398
399run_target(
400 'syscall-names-update',
401 command : [syscall_names_update_sh, meson.current_source_dir()])