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