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