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