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