]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
Merge pull request #21838 from lnussel/logind-refactor
[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 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
74 condition.c
75 condition.h
76 conf-parser.c
77 conf-parser.h
78 copy.c
79 copy.h
80 coredump-util.c
81 coredump-util.h
82 cpu-set-util.c
83 cpu-set-util.h
84 creds-util.c
85 creds-util.h
86 cryptsetup-util.c
87 cryptsetup-util.h
88 daemon-util.h
89 data-fd-util.c
90 data-fd-util.h
91 dev-setup.c
92 dev-setup.h
93 device-nodes.c
94 device-nodes.h
95 devnode-acl.h
96 discover-image.c
97 discover-image.h
98 dissect-image.c
99 dissect-image.h
100 dlfcn-util.c
101 dlfcn-util.h
102 dm-util.c
103 dm-util.h
104 dns-domain.c
105 dns-domain.h
106 dropin.c
107 dropin.h
108 efi-loader.c
109 efi-loader.h
110 elf-util.c
111 elf-util.h
112 enable-mempool.c
113 env-file-label.c
114 env-file-label.h
115 ethtool-util.c
116 ethtool-util.h
117 exec-util.c
118 exec-util.h
119 exit-status.c
120 exit-status.h
121 extension-release.c
122 extension-release.h
123 fdisk-util.h
124 fdset.c
125 fdset.h
126 fileio-label.c
127 fileio-label.h
128 firewall-util-nft.c
129 firewall-util-private.h
130 firewall-util.c
131 firewall-util.h
132 format-table.c
133 format-table.h
134 fsck-util.h
135 fstab-util.c
136 fstab-util.h
137 generator.c
138 generator.h
139 geneve-util.c
140 geneve-util.h
141 gpt.c
142 gpt.h
143 group-record.c
144 group-record.h
145 hostname-setup.c
146 hostname-setup.h
147 hwdb-util.c
148 hwdb-util.h
149 id128-print.c
150 id128-print.h
151 idn-util.c
152 idn-util.h
153 ima-util.c
154 ima-util.h
155 import-util.c
156 import-util.h
157 in-addr-prefix-util.c
158 in-addr-prefix-util.h
159 initreq.h
160 install-file.c
161 install-file.h
162 install-printf.c
163 install-printf.h
164 install.c
165 install.h
166 ip-protocol-list.c
167 ip-protocol-list.h
168 ipvlan-util.c
169 ipvlan-util.h
170 journal-importer.c
171 journal-importer.h
172 journal-util.c
173 journal-util.h
174 json-internal.h
175 json.c
176 json.h
177 kbd-util.c
178 kbd-util.h
179 keyring-util.h
180 keyring-util.c
181 killall.c
182 killall.h
183 label.c
184 label.h
185 libcrypt-util.c
186 libcrypt-util.h
187 libfido2-util.c
188 libfido2-util.h
189 libmount-util.h
190 linux/auto_dev-ioctl.h
191 linux/bpf.h
192 linux/bpf_common.h
193 linux/bpf_insn.h
194 linux/dm-ioctl.h
195 linux/ethtool.h
196 local-addresses.c
197 local-addresses.h
198 lockfile-util.c
199 lockfile-util.h
200 log-link.h
201 logs-show.c
202 logs-show.h
203 loop-util.c
204 loop-util.h
205 loopback-setup.c
206 loopback-setup.h
207 machine-id-setup.c
208 machine-id-setup.h
209 machine-pool.c
210 machine-pool.h
211 macvlan-util.c
212 macvlan-util.h
213 main-func.h
214 mkdir-label.c
215 mkdir-label.h
216 mkfs-util.c
217 mkfs-util.h
218 module-util.h
219 mount-setup.c
220 mount-setup.h
221 mount-util.c
222 mount-util.h
223 net-condition.c
224 net-condition.h
225 netif-naming-scheme.c
226 netif-naming-scheme.h
227 netif-sriov.c
228 netif-sriov.h
229 netif-util.c
230 netif-util.h
231 nscd-flush.h
232 nsflags.c
233 nsflags.h
234 numa-util.c
235 numa-util.h
236 openssl-util.c
237 openssl-util.h
238 output-mode.c
239 output-mode.h
240 pager.c
241 pager.h
242 parse-argument.c
243 parse-argument.h
244 parse-socket-bind-item.c
245 parse-socket-bind-item.h
246 pe-header.h
247 pkcs11-util.c
248 pkcs11-util.h
249 pretty-print.c
250 pretty-print.h
251 psi-util.c
252 psi-util.h
253 ptyfwd.c
254 ptyfwd.h
255 pwquality-util.c
256 pwquality-util.h
257 qrcode-util.c
258 qrcode-util.h
259 quota-util.c
260 quota-util.h
261 reboot-util.c
262 reboot-util.h
263 resize-fs.c
264 resize-fs.h
265 resolve-util.c
266 resolve-util.h
267 rm-rf.c
268 rm-rf.h
269 seccomp-util.h
270 securebits-util.c
271 securebits-util.h
272 selinux-util.c
273 selinux-util.h
274 serialize.c
275 serialize.h
276 service-util.c
277 service-util.h
278 sleep-config.c
279 sleep-config.h
280 smack-util.c
281 smack-util.h
282 socket-label.c
283 socket-netlink.c
284 socket-netlink.h
285 spawn-ask-password-agent.c
286 spawn-ask-password-agent.h
287 spawn-polkit-agent.c
288 spawn-polkit-agent.h
289 specifier.c
290 specifier.h
291 switch-root.c
292 switch-root.h
293 tmpfile-util-label.c
294 tmpfile-util-label.h
295 tomoyo-util.c
296 tomoyo-util.h
297 tpm2-util.c
298 tpm2-util.h
299 udev-util.c
300 udev-util.h
301 uid-alloc-range.c
302 uid-alloc-range.h
303 uid-range.c
304 uid-range.h
305 user-record-nss.c
306 user-record-nss.h
307 user-record-show.c
308 user-record-show.h
309 user-record.c
310 user-record.h
311 userdb-dropin.c
312 userdb-dropin.h
313 userdb.c
314 userdb.h
315 utmp-wtmp.h
316 varlink.c
317 varlink.h
318 verb-log-control.c
319 verb-log-control.h
320 verbs.c
321 verbs.h
322 vlan-util.c
323 vlan-util.h
324 volatile-util.c
325 volatile-util.h
326 watchdog.c
327 watchdog.h
328 web-util.c
329 web-util.h
330 wifi-util.c
331 wifi-util.h
332 xml.c
333 xml.h
334 '''.split())
335
336 if get_option('tests') != 'false'
337 shared_sources += files('''
338 test-tables.h
339 tests.c
340 tests.h
341 '''.split())
342 endif
343
344 generate_syscall_list = find_program('generate-syscall-list.py')
345 fname = 'syscall-list.h'
346 syscall_list_h = custom_target(
347 fname,
348 input : syscall_list_txt,
349 output : fname,
350 command : [generate_syscall_list,
351 '@INPUT@'],
352 capture : true)
353
354 if conf.get('HAVE_ACL') == 1
355 shared_sources += files('''
356 acl-util.c
357 devnode-acl.c
358 '''.split())
359 endif
360
361 if conf.get('ENABLE_UTMP') == 1
362 shared_sources += files('utmp-wtmp.c')
363 endif
364
365 if conf.get('HAVE_SECCOMP') == 1
366 shared_sources += files('seccomp-util.c')
367 shared_sources += syscall_list_h
368 endif
369
370 if conf.get('HAVE_LIBIPTC') == 1
371 shared_sources += files('firewall-util-iptables.c')
372 endif
373
374 if conf.get('HAVE_LIBBPF') == 1
375 shared_sources += files('''
376 bpf-link.c
377 bpf-link.h
378 '''.split())
379 endif
380
381 if conf.get('HAVE_KMOD') == 1
382 shared_sources += files('module-util.c')
383 endif
384
385 if conf.get('HAVE_PAM') == 1
386 shared_sources += files(
387 'pam-util.c',
388 'pam-util.h')
389 endif
390
391 if conf.get('ENABLE_NSCD') == 1
392 shared_sources += files('nscd-flush.c')
393 endif
394
395 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
396 ip_protocol_list_txt = custom_target(
397 'ip-protocol-list.txt',
398 output : 'ip-protocol-list.txt',
399 command : [generate_ip_protocol_list, cpp],
400 capture : true)
401
402 fname = 'ip-protocol-from-name.gperf'
403 gperf_file = custom_target(
404 fname,
405 input : ip_protocol_list_txt,
406 output : fname,
407 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
408 capture : true)
409
410 fname = 'ip-protocol-from-name.h'
411 target1 = custom_target(
412 fname,
413 input : gperf_file,
414 output : fname,
415 command : [gperf,
416 '-L', 'ANSI-C', '-t', '--ignore-case',
417 '-N', 'lookup_ip_protocol',
418 '-H', 'hash_ip_protocol_name',
419 '-p', '-C',
420 '@INPUT@'],
421 capture : true)
422
423 fname = 'ip-protocol-to-name.h'
424 awkscript = 'ip-protocol-to-name.awk'
425 target2 = custom_target(
426 fname,
427 input : [awkscript, ip_protocol_list_txt],
428 output : fname,
429 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
430 capture : true)
431
432 shared_generated_gperf_headers = [target1, target2]
433 shared_sources += shared_generated_gperf_headers
434
435 libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
436
437 libshared_deps = [threads,
438 libacl,
439 libblkid,
440 libcap,
441 libcrypt,
442 libdl,
443 libgcrypt,
444 libiptc,
445 libkmod,
446 liblz4,
447 libmount,
448 libopenssl,
449 libp11kit,
450 libpam,
451 librt,
452 libseccomp,
453 libselinux,
454 libzstd,
455 libxz]
456
457 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
458
459 libshared_static = static_library(
460 libshared_name,
461 shared_sources,
462 include_directories : includes,
463 dependencies : libshared_deps,
464 c_args : ['-fvisibility=default'],
465 build_by_default : false)
466
467 libshared = shared_library(
468 libshared_name,
469 include_directories : includes,
470 c_args : ['-fvisibility=default'],
471 link_args : ['-shared',
472 '-Wl,--version-script=' + libshared_sym_path],
473 link_whole : [libshared_static,
474 libbasic,
475 libbasic_gcrypt,
476 libsystemd_static],
477 dependencies : libshared_deps,
478 install : true,
479 install_dir : rootlibexecdir)