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