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