]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/meson.build
test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL
[thirdparty/systemd.git] / src / shared / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
3a726fcd 2
975464e0 3shared_sources = files('''
37efbbd8
ZJS
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
d284b82b
ZJS
11 barrier.c
12 barrier.h
37efbbd8
ZJS
13 base-filesystem.c
14 base-filesystem.h
d284b82b
ZJS
15 bitmap.c
16 bitmap.h
17 blkid-util.h
37efbbd8
ZJS
18 boot-timestamps.c
19 boot-timestamps.h
7e87c7d9
ZJS
20 bootspec.c
21 bootspec.h
d284b82b
ZJS
22 bpf-program.c
23 bpf-program.h
37efbbd8
ZJS
24 bus-unit-util.c
25 bus-unit-util.h
26 bus-util.c
27 bus-util.h
e45c81b8
LP
28 bus-wait-for-jobs.c
29 bus-wait-for-jobs.h
25b1d72d
LP
30 bus-unit-procs.c
31 bus-unit-procs.h
d284b82b
ZJS
32 calendarspec.c
33 calendarspec.h
37efbbd8
ZJS
34 cgroup-show.c
35 cgroup-show.h
36 clean-ipc.c
37 clean-ipc.h
d284b82b
ZJS
38 clock-util.c
39 clock-util.h
37efbbd8
ZJS
40 condition.c
41 condition.h
42 conf-parser.c
43 conf-parser.h
d284b82b
ZJS
44 cpu-set-util.c
45 cpu-set-util.h
46 crypt-util.c
47 crypt-util.h
c157884f 48 daemon-util.h
37efbbd8
ZJS
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
a5d8835c 59 enable-mempool.c
686d13b9
LP
60 env-file-label.c
61 env-file-label.h
d284b82b
ZJS
62 exec-util.c
63 exec-util.h
64 exit-status.c
65 exit-status.h
37efbbd8
ZJS
66 fdset.c
67 fdset.h
d284b82b
ZJS
68 fileio-label.c
69 fileio-label.h
c3045943 70 firewall-util.h
d284b82b
ZJS
71 format-table.c
72 format-table.h
37efbbd8
ZJS
73 fstab-util.c
74 fstab-util.h
37efbbd8
ZJS
75 generator.c
76 generator.h
77 gpt.h
ff7dad48
ZJS
78 id128-print.c
79 id128-print.h
37efbbd8
ZJS
80 ima-util.c
81 ima-util.h
82 import-util.c
83 import-util.h
84 initreq.h
37efbbd8
ZJS
85 install-printf.c
86 install-printf.h
d68c645b
LP
87 install.c
88 install.h
f079c372
LP
89 ip-protocol-list.c
90 ip-protocol-list.h
d284b82b
ZJS
91 journal-importer.c
92 journal-importer.h
37efbbd8
ZJS
93 journal-util.c
94 journal-util.h
d284b82b
ZJS
95 json-internal.h
96 json.c
97 json.h
98 lockfile-util.c
99 lockfile-util.h
e67ae9f5 100 log-link.h
37efbbd8
ZJS
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
294bf0c3 109 main-func.h
3cb9b42a 110 module-util.h
77c772f2
ZJS
111 mount-util.c
112 mount-util.h
f079c372
LP
113 nscd-flush.c
114 nscd-flush.h
37efbbd8
ZJS
115 nsflags.c
116 nsflags.h
d284b82b
ZJS
117 os-util.c
118 os-util.h
37efbbd8
ZJS
119 output-mode.c
120 output-mode.h
294bf0c3
ZJS
121 pager.c
122 pager.h
37efbbd8
ZJS
123 path-lookup.c
124 path-lookup.h
5e146a75 125 pe-header.h
294bf0c3
ZJS
126 pretty-print.c
127 pretty-print.h
37efbbd8
ZJS
128 ptyfwd.c
129 ptyfwd.h
d284b82b
ZJS
130 reboot-util.c
131 reboot-util.h
37efbbd8
ZJS
132 resolve-util.c
133 resolve-util.h
134 seccomp-util.h
d284b82b
ZJS
135 securebits-util.c
136 securebits-util.h
d68c645b
LP
137 serialize.c
138 serialize.h
37efbbd8
ZJS
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
e4de7287
LP
151 tmpfile-util-label.c
152 tmpfile-util-label.h
ed440f6b
SL
153 tomoyo-util.c
154 tomoyo-util.h
b237a168 155 udev-util.c
d68c645b 156 udev-util.h
37efbbd8
ZJS
157 uid-range.c
158 uid-range.h
159 utmp-wtmp.h
d284b82b
ZJS
160 verbs.c
161 verbs.h
37efbbd8
ZJS
162 vlan-util.c
163 vlan-util.h
164 volatile-util.c
165 volatile-util.h
166 watchdog.c
167 watchdog.h
d284b82b
ZJS
168 web-util.c
169 web-util.h
e5719363 170 wireguard-netlink.h
d284b82b
ZJS
171 xml.c
172 xml.h
975464e0 173'''.split())
5c23128d 174
b9fa9b71
MO
175if get_option('tests') != 'false'
176 shared_sources += files('tests.c', 'tests.h')
177endif
178
69e96427 179test_tables_h = files('test-tables.h')
5a8b1640 180shared_sources += test_tables_h
69e96427 181
349cc4a5 182if conf.get('HAVE_ACL') == 1
975464e0 183 shared_sources += files('acl-util.c')
5c23128d
ZJS
184endif
185
3211da4b 186if conf.get('ENABLE_UTMP') == 1
975464e0 187 shared_sources += files('utmp-wtmp.c')
5c23128d
ZJS
188endif
189
349cc4a5 190if conf.get('HAVE_SECCOMP') == 1
975464e0 191 shared_sources += files('seccomp-util.c')
5c23128d
ZJS
192endif
193
349cc4a5 194if conf.get('HAVE_LIBIPTC') == 1
975464e0 195 shared_sources += files('firewall-util.c')
c3045943
MB
196endif
197
ba323bbe
YW
198if conf.get('HAVE_KMOD') == 1
199 shared_sources += files('module-util.c')
200endif
201
da96ad5a
YW
202generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
203ip_protocol_list_txt = custom_target(
204 'ip-protocol-list.txt',
205 output : 'ip-protocol-list.txt',
206 command : [generate_ip_protocol_list, cpp],
7b5e750d
YW
207 capture : true)
208
da96ad5a 209fname = 'ip-protocol-from-name.gperf'
7b5e750d
YW
210gperf_file = custom_target(
211 fname,
da96ad5a 212 input : ip_protocol_list_txt,
7b5e750d 213 output : fname,
da96ad5a 214 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
7b5e750d
YW
215 capture : true)
216
da96ad5a 217fname = 'ip-protocol-from-name.h'
7b5e750d
YW
218target1 = custom_target(
219 fname,
220 input : gperf_file,
221 output : fname,
222 command : [gperf,
223 '-L', 'ANSI-C', '-t', '--ignore-case',
da96ad5a
YW
224 '-N', 'lookup_ip_protocol',
225 '-H', 'hash_ip_protocol_name',
7b5e750d
YW
226 '-p', '-C',
227 '@INPUT@'],
228 capture : true)
229
da96ad5a
YW
230fname = 'ip-protocol-to-name.h'
231awkscript = 'ip-protocol-to-name.awk'
7b5e750d
YW
232target2 = custom_target(
233 fname,
da96ad5a 234 input : [awkscript, ip_protocol_list_txt],
7b5e750d
YW
235 output : fname,
236 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
237 capture : true)
238
dca23091
YW
239shared_generated_gperf_headers = [target1, target2]
240shared_sources += shared_generated_gperf_headers
7b5e750d 241
5c23128d
ZJS
242libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
243
4b57a272
ZJS
244libshared_deps = [threads,
245 librt,
246 libcap,
247 libacl,
248 libcryptsetup,
249 libgcrypt,
250 libiptc,
3cb9b42a 251 libkmod,
77c772f2 252 libmount,
4b57a272
ZJS
253 libseccomp,
254 libselinux,
255 libidn,
256 libxz,
257 liblz4,
258 libblkid]
259
4f5993c3
FS
260libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
261
2d4ceca8 262libshared_static = static_library(
37efbbd8
ZJS
263 libshared_name,
264 shared_sources,
2d4ceca8
ZJS
265 include_directories : includes,
266 dependencies : libshared_deps,
267 c_args : ['-fvisibility=default'])
268
269libshared = shared_library(
270 libshared_name,
8e899a92 271 libudev_sources,
37efbbd8 272 include_directories : includes,
4f5993c3 273 link_args : ['-shared',
2d4ceca8
ZJS
274 '-Wl,--version-script=' + libshared_sym_path],
275 link_whole : [libshared_static,
34e221a5 276 libbasic,
a8e559d4 277 libbasic_gcrypt,
5e3cec87
ZJS
278 libsystemd_static,
279 libjournal_client],
37efbbd8 280 c_args : ['-fvisibility=default'],
4b57a272 281 dependencies : libshared_deps,
37efbbd8
ZJS
282 install : true,
283 install_dir : rootlibexecdir)