]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
Merge pull request #10935 from poettering/rlimit-nofile-safe
[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 seccomp-util.h
124 securebits-util.c
125 securebits-util.h
126 serialize.c
127 serialize.h
128 sleep-config.c
129 sleep-config.h
130 ip-protocol-list.c
131 ip-protocol-list.h
132 spawn-ask-password-agent.c
133 spawn-ask-password-agent.h
134 spawn-polkit-agent.c
135 spawn-polkit-agent.h
136 specifier.c
137 specifier.h
138 switch-root.c
139 switch-root.h
140 sysctl-util.c
141 sysctl-util.h
142 tmpfile-util-label.c
143 tmpfile-util-label.h
144 tomoyo-util.c
145 tomoyo-util.h
146 udev-util.c
147 udev-util.h
148 uid-range.c
149 uid-range.h
150 utmp-wtmp.h
151 verbs.c
152 verbs.h
153 vlan-util.c
154 vlan-util.h
155 volatile-util.c
156 volatile-util.h
157 watchdog.c
158 watchdog.h
159 web-util.c
160 web-util.h
161 wireguard-netlink.h
162 xml.c
163 xml.h
164 '''.split())
165
166 if get_option('tests') != 'false'
167 shared_sources += files('tests.c', 'tests.h')
168 endif
169
170 test_tables_h = files('test-tables.h')
171 shared_sources += test_tables_h
172
173 if conf.get('HAVE_ACL') == 1
174 shared_sources += files('acl-util.c')
175 endif
176
177 if conf.get('ENABLE_UTMP') == 1
178 shared_sources += files('utmp-wtmp.c')
179 endif
180
181 if conf.get('HAVE_SECCOMP') == 1
182 shared_sources += files('seccomp-util.c')
183 endif
184
185 if conf.get('HAVE_LIBIPTC') == 1
186 shared_sources += files('firewall-util.c')
187 endif
188
189 if conf.get('HAVE_KMOD') == 1
190 shared_sources += files('module-util.c')
191 endif
192
193 generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
194 ip_protocol_list_txt = custom_target(
195 'ip-protocol-list.txt',
196 output : 'ip-protocol-list.txt',
197 command : [generate_ip_protocol_list, cpp],
198 capture : true)
199
200 fname = 'ip-protocol-from-name.gperf'
201 gperf_file = custom_target(
202 fname,
203 input : ip_protocol_list_txt,
204 output : fname,
205 command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@'],
206 capture : true)
207
208 fname = 'ip-protocol-from-name.h'
209 target1 = custom_target(
210 fname,
211 input : gperf_file,
212 output : fname,
213 command : [gperf,
214 '-L', 'ANSI-C', '-t', '--ignore-case',
215 '-N', 'lookup_ip_protocol',
216 '-H', 'hash_ip_protocol_name',
217 '-p', '-C',
218 '@INPUT@'],
219 capture : true)
220
221 fname = 'ip-protocol-to-name.h'
222 awkscript = 'ip-protocol-to-name.awk'
223 target2 = custom_target(
224 fname,
225 input : [awkscript, ip_protocol_list_txt],
226 output : fname,
227 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
228 capture : true)
229
230 shared_generated_gperf_headers = [target1, target2]
231 shared_sources += shared_generated_gperf_headers
232
233 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
234
235 libshared_deps = [threads,
236 librt,
237 libcap,
238 libacl,
239 libcryptsetup,
240 libgcrypt,
241 libiptc,
242 libkmod,
243 libmount,
244 libseccomp,
245 libselinux,
246 libidn,
247 libxz,
248 liblz4,
249 libblkid]
250
251 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
252
253 libshared_static = static_library(
254 libshared_name,
255 shared_sources,
256 include_directories : includes,
257 dependencies : libshared_deps,
258 c_args : ['-fvisibility=default'])
259
260 libshared = shared_library(
261 libshared_name,
262 libudev_sources,
263 include_directories : includes,
264 link_args : ['-shared',
265 '-Wl,--version-script=' + libshared_sym_path],
266 link_whole : [libshared_static,
267 libbasic,
268 libbasic_gcrypt,
269 libsystemd_static,
270 libjournal_client],
271 c_args : ['-fvisibility=default'],
272 dependencies : libshared_deps,
273 install : true,
274 install_dir : rootlibexecdir)