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