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