]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
shared: add pkcs11-util.[ch]
[thirdparty/systemd.git] / src / shared / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
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
d284b82b
ZJS
15 bitmap.c
16 bitmap.h
17 blkid-util.h
37efbbd8
ZJS
18 boot-timestamps.c
19 boot-timestamps.h
7e87c7d9
ZJS
20 bootspec.c
21 bootspec.h
d284b82b
ZJS
22 bpf-program.c
23 bpf-program.h
9f717d42
LP
24 bus-unit-procs.c
25 bus-unit-procs.h
37efbbd8
ZJS
26 bus-unit-util.c
27 bus-unit-util.h
28 bus-util.c
29 bus-util.h
e45c81b8
LP
30 bus-wait-for-jobs.c
31 bus-wait-for-jobs.h
3572d3df
LP
32 bus-wait-for-units.c
33 bus-wait-for-units.h
d284b82b
ZJS
34 calendarspec.c
35 calendarspec.h
fdb3deca
ZJS
36 cgroup-setup.c
37 cgroup-setup.h
37efbbd8
ZJS
38 cgroup-show.c
39 cgroup-show.h
40 clean-ipc.c
41 clean-ipc.h
d284b82b
ZJS
42 clock-util.c
43 clock-util.h
37efbbd8
ZJS
44 condition.c
45 condition.h
46 conf-parser.c
47 conf-parser.h
d284b82b
ZJS
48 cpu-set-util.c
49 cpu-set-util.h
50 crypt-util.c
51 crypt-util.h
c157884f 52 daemon-util.h
37efbbd8
ZJS
53 dev-setup.c
54 dev-setup.h
55 dissect-image.c
56 dissect-image.h
a709a315
LP
57 dm-util.c
58 dm-util.h
37efbbd8
ZJS
59 dns-domain.c
60 dns-domain.h
61 dropin.c
62 dropin.h
0bb2f0f1
ZJS
63 efi-loader.c
64 efi-loader.h
a5d8835c 65 enable-mempool.c
686d13b9
LP
66 env-file-label.c
67 env-file-label.h
5c2316c6
YW
68 ethtool-util.c
69 ethtool-util.h
d284b82b
ZJS
70 exec-util.c
71 exec-util.h
72 exit-status.c
73 exit-status.h
37efbbd8
ZJS
74 fdset.c
75 fdset.h
d284b82b
ZJS
76 fileio-label.c
77 fileio-label.h
c3045943 78 firewall-util.h
d284b82b
ZJS
79 format-table.c
80 format-table.h
b67f05da 81 fsck-util.h
37efbbd8
ZJS
82 fstab-util.c
83 fstab-util.h
37efbbd8
ZJS
84 generator.c
85 generator.h
86 gpt.h
ff7dad48
ZJS
87 id128-print.c
88 id128-print.h
37efbbd8
ZJS
89 ima-util.c
90 ima-util.h
91 import-util.c
92 import-util.h
93 initreq.h
37efbbd8
ZJS
94 install-printf.c
95 install-printf.h
d68c645b
LP
96 install.c
97 install.h
f079c372
LP
98 ip-protocol-list.c
99 ip-protocol-list.h
d284b82b
ZJS
100 journal-importer.c
101 journal-importer.h
37efbbd8
ZJS
102 journal-util.c
103 journal-util.h
d284b82b
ZJS
104 json-internal.h
105 json.c
106 json.h
fb36b133 107 libmount-util.h
01234e1f
YW
108 linux/auto_dev-ioctl.h
109 linux/bpf.h
110 linux/bpf_common.h
111 linux/bpf_insn.h
112 linux/dm-ioctl.h
113 linux/ethtool.h
733cbd00
LP
114 local-addresses.c
115 local-addresses.h
d284b82b
ZJS
116 lockfile-util.c
117 lockfile-util.h
e67ae9f5 118 log-link.h
37efbbd8
ZJS
119 logs-show.c
120 logs-show.h
121 loop-util.c
122 loop-util.h
123 machine-image.c
124 machine-image.h
125 machine-pool.c
126 machine-pool.h
294bf0c3 127 main-func.h
3cb9b42a 128 module-util.h
77c772f2
ZJS
129 mount-util.c
130 mount-util.h
f079c372
LP
131 nscd-flush.c
132 nscd-flush.h
37efbbd8
ZJS
133 nsflags.c
134 nsflags.h
3f637019 135 openssl-util.h
d284b82b
ZJS
136 os-util.c
137 os-util.h
37efbbd8
ZJS
138 output-mode.c
139 output-mode.h
294bf0c3
ZJS
140 pager.c
141 pager.h
37efbbd8
ZJS
142 path-lookup.c
143 path-lookup.h
5e146a75 144 pe-header.h
839fddbe
LP
145 pkcs11-util.c
146 pkcs11-util.h
294bf0c3
ZJS
147 pretty-print.c
148 pretty-print.h
37efbbd8
ZJS
149 ptyfwd.c
150 ptyfwd.h
d284b82b
ZJS
151 reboot-util.c
152 reboot-util.h
28937bcc
LP
153 resize-fs.c
154 resize-fs.h
37efbbd8
ZJS
155 resolve-util.c
156 resolve-util.h
157 seccomp-util.h
d284b82b
ZJS
158 securebits-util.c
159 securebits-util.h
d68c645b
LP
160 serialize.c
161 serialize.h
37efbbd8
ZJS
162 sleep-config.c
163 sleep-config.h
164 spawn-ask-password-agent.c
165 spawn-ask-password-agent.h
166 spawn-polkit-agent.c
167 spawn-polkit-agent.h
168 specifier.c
169 specifier.h
170 switch-root.c
171 switch-root.h
172 sysctl-util.c
173 sysctl-util.h
e4de7287
LP
174 tmpfile-util-label.c
175 tmpfile-util-label.h
ed440f6b
SL
176 tomoyo-util.c
177 tomoyo-util.h
b237a168 178 udev-util.c
d68c645b 179 udev-util.h
37efbbd8
ZJS
180 uid-range.c
181 uid-range.h
5cfa33e0 182 unit-file.c
dfadc1f2 183 unit-file.h
37efbbd8 184 utmp-wtmp.h
d41bd96f
LP
185 varlink.c
186 varlink.h
d284b82b
ZJS
187 verbs.c
188 verbs.h
37efbbd8
ZJS
189 vlan-util.c
190 vlan-util.h
191 volatile-util.c
192 volatile-util.h
193 watchdog.c
194 watchdog.h
d284b82b
ZJS
195 web-util.c
196 web-util.h
b492aea0
ZJS
197 wifi-util.c
198 wifi-util.h
d284b82b
ZJS
199 xml.c
200 xml.h
975464e0 201'''.split())
5c23128d 202
b9fa9b71
MO
203if get_option('tests') != 'false'
204 shared_sources += files('tests.c', 'tests.h')
205endif
206
69e96427 207test_tables_h = files('test-tables.h')
5a8b1640 208shared_sources += test_tables_h
69e96427 209
349cc4a5 210if conf.get('HAVE_ACL') == 1
975464e0 211 shared_sources += files('acl-util.c')
5c23128d
ZJS
212endif
213
3211da4b 214if conf.get('ENABLE_UTMP') == 1
975464e0 215 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
216endif
217
349cc4a5 218if conf.get('HAVE_SECCOMP') == 1
975464e0 219 shared_sources += files('seccomp-util.c')
5c23128d
ZJS
220endif
221
349cc4a5 222if conf.get('HAVE_LIBIPTC') == 1
975464e0 223 shared_sources += files('firewall-util.c')
c3045943
MB
224endif
225
ba323bbe
YW
226if conf.get('HAVE_KMOD') == 1
227 shared_sources += files('module-util.c')
228endif
229
da96ad5a
YW
230generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
231ip_protocol_list_txt = custom_target(
232 'ip-protocol-list.txt',
233 output : 'ip-protocol-list.txt',
234 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
235 capture : true)
236
da96ad5a 237fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
238gperf_file = custom_target(
239 fname,
da96ad5a 240 input : ip_protocol_list_txt,
7b5e750d 241 output : fname,
da96ad5a 242 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
243 capture : true)
244
da96ad5a 245fname = 'ip-protocol-from-name.h'
7b5e750d
YW
246target1 = custom_target(
247 fname,
248 input : gperf_file,
249 output : fname,
250 command : [gperf,
251 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
252 '-N', 'lookup_ip_protocol',
253 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
254 '-p', '-C',
255 '@INPUT@'],
256 capture : true)
257
da96ad5a
YW
258fname = 'ip-protocol-to-name.h'
259awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
260target2 = custom_target(
261 fname,
da96ad5a 262 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
263 output : fname,
264 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
265 capture : true)
266
dca23091
YW
267shared_generated_gperf_headers = [target1, target2]
268shared_sources += shared_generated_gperf_headers
7b5e750d 269
5c23128d
ZJS
270libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
271
4b57a272 272libshared_deps = [threads,
4b57a272 273 libacl,
462255c6
LP
274 libblkid,
275 libcap,
4b57a272
ZJS
276 libcryptsetup,
277 libgcrypt,
462255c6 278 libidn,
4b57a272 279 libiptc,
3cb9b42a 280 libkmod,
462255c6 281 liblz4,
77c772f2 282 libmount,
839fddbe
LP
283 libopenssl,
284 libp11kit,
462255c6 285 librt,
4b57a272
ZJS
286 libseccomp,
287 libselinux,
462255c6 288 libxz]
4b57a272 289
4f5993c3
FS
290libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
291
2d4ceca8 292libshared_static = static_library(
37efbbd8
ZJS
293 libshared_name,
294 shared_sources,
2d4ceca8
ZJS
295 include_directories : includes,
296 dependencies : libshared_deps,
297 c_args : ['-fvisibility=default'])
298
299libshared = shared_library(
300 libshared_name,
8e899a92 301 libudev_sources,
37efbbd8 302 include_directories : includes,
4f5993c3 303 link_args : ['-shared',
2d4ceca8
ZJS
304 '-Wl,--version-script=' + libshared_sym_path],
305 link_whole : [libshared_static,
34e221a5 306 libbasic,
a8e559d4 307 libbasic_gcrypt,
5e3cec87
ZJS
308 libsystemd_static,
309 libjournal_client],
37efbbd8 310 c_args : ['-fvisibility=default'],
4b57a272 311 dependencies : libshared_deps,
37efbbd8
ZJS
312 install : true,
313 install_dir : rootlibexecdir)