]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
0b0982d54313bb6aa32b194e8c15218dc6cbcd53
[thirdparty/systemd.git] / src / basic / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 basic_sources = files('''
4 MurmurHash2.c
5 MurmurHash2.h
6 af-list.c
7 af-list.h
8 alloc-util.c
9 alloc-util.h
10 architecture.c
11 architecture.h
12 arphrd-list.c
13 arphrd-list.h
14 async.c
15 async.h
16 audit-util.c
17 audit-util.h
18 blockdev-util.c
19 blockdev-util.h
20 btrfs-util.c
21 btrfs-util.h
22 build.c
23 build.h
24 bus-label.c
25 bus-label.h
26 cap-list.c
27 cap-list.h
28 capability-util.c
29 capability-util.h
30 cgroup-util.c
31 cgroup-util.h
32 chattr-util.c
33 chattr-util.h
34 conf-files.c
35 conf-files.h
36 copy.c
37 copy.h
38 def.h
39 device-nodes.c
40 device-nodes.h
41 dirent-util.c
42 dirent-util.h
43 dlfcn-util.c
44 dlfcn-util.h
45 dns-def.h
46 efivars.c
47 efivars.h
48 env-file.c
49 env-file.h
50 env-util.c
51 env-util.h
52 errno-list.c
53 errno-list.h
54 errno-util.h
55 escape.c
56 escape.h
57 ether-addr-util.c
58 ether-addr-util.h
59 extract-word.c
60 extract-word.h
61 fd-util.c
62 fd-util.h
63 fileio.c
64 fileio.h
65 format-util.c
66 format-util.h
67 fs-util.c
68 fs-util.h
69 glob-util.c
70 glob-util.h
71 gunicode.c
72 gunicode.h
73 hash-funcs.c
74 hash-funcs.h
75 hashmap.c
76 hashmap.h
77 hexdecoct.c
78 hexdecoct.h
79 hostname-util.c
80 hostname-util.h
81 in-addr-util.c
82 in-addr-util.h
83 io-util.c
84 io-util.h
85 ioprio.h
86 kbd-util.c
87 kbd-util.h
88 khash.c
89 khash.h
90 label.c
91 label.h
92 limits-util.c
93 limits-util.h
94 linux/btrfs.h
95 linux/btrfs_tree.h
96 linux/can/netlink.h
97 linux/can/vxcan.h
98 linux/fib_rules.h
99 linux/fou.h
100 linux/hdlc/ioctl.h
101 linux/if.h
102 linux/if_addr.h
103 linux/if_arp.h
104 linux/if_bonding.h
105 linux/if_bridge.h
106 linux/if_ether.h
107 linux/if_link.h
108 linux/if_macsec.h
109 linux/if_tun.h
110 linux/if_tunnel.h
111 linux/in.h
112 linux/in6.h
113 linux/ipv6_route.h
114 linux/l2tp.h
115 linux/libc-compat.h
116 linux/loadavg.h
117 linux/netdevice.h
118 linux/netfilter/nf_tables.h
119 linux/netfilter/nfnetlink.h
120 linux/netlink.h
121 linux/nexthop.h
122 linux/nl80211.h
123 linux/pkt_sched.h
124 linux/rtnetlink.h
125 linux/wireguard.h
126 list.h
127 locale-util.c
128 locale-util.h
129 log.c
130 log.h
131 login-util.c
132 login-util.h
133 macro.h
134 memfd-util.c
135 memfd-util.h
136 memory-util.c
137 memory-util.h
138 mempool.c
139 mempool.h
140 missing_audit.h
141 missing_capability.h
142 missing_drm.h
143 missing_fcntl.h
144 missing_fs.h
145 missing_input.h
146 missing_keyctl.h
147 missing_magic.h
148 missing_mman.h
149 missing_network.h
150 missing_prctl.h
151 missing_random.h
152 missing_resource.h
153 missing_sched.h
154 missing_securebits.h
155 missing_socket.h
156 missing_stat.h
157 missing_stdlib.h
158 missing_syscall.h
159 missing_timerfd.h
160 missing_type.h
161 mkdir-label.c
162 mkdir.c
163 mkdir.h
164 mountpoint-util.c
165 mountpoint-util.h
166 namespace-util.c
167 namespace-util.h
168 nss-util.h
169 nulstr-util.c
170 nulstr-util.h
171 ordered-set.c
172 ordered-set.h
173 parse-util.c
174 parse-util.h
175 path-lookup.c
176 path-lookup.h
177 path-util.c
178 path-util.h
179 prioq.c
180 prioq.h
181 proc-cmdline.c
182 proc-cmdline.h
183 process-util.c
184 process-util.h
185 procfs-util.c
186 procfs-util.h
187 pthread-util.h
188 quota-util.c
189 quota-util.h
190 random-util.c
191 random-util.h
192 ratelimit.c
193 ratelimit.h
194 raw-clone.h
195 raw-reboot.h
196 recovery-key.c
197 recovery-key.h
198 replace-var.c
199 replace-var.h
200 rlimit-util.c
201 rlimit-util.h
202 rm-rf.c
203 rm-rf.h
204 selinux-util.c
205 selinux-util.h
206 set.h
207 sigbus.c
208 sigbus.h
209 signal-util.c
210 signal-util.h
211 siphash24.c
212 siphash24.h
213 smack-util.c
214 smack-util.h
215 socket-label.c
216 socket-util.c
217 socket-util.h
218 sort-util.c
219 sort-util.h
220 sparse-endian.h
221 special.h
222 stat-util.c
223 stat-util.h
224 static-destruct.h
225 stdio-util.h
226 strbuf.c
227 strbuf.h
228 string-table.c
229 string-table.h
230 string-util.c
231 string-util.h
232 strv.c
233 strv.h
234 strxcpyx.c
235 strxcpyx.h
236 syslog-util.c
237 syslog-util.h
238 terminal-util.c
239 terminal-util.h
240 time-util.c
241 time-util.h
242 tmpfile-util.c
243 tmpfile-util.h
244 umask-util.h
245 unaligned.h
246 unit-def.c
247 unit-def.h
248 unit-file.c
249 unit-file.h
250 unit-name.c
251 unit-name.h
252 user-util.c
253 user-util.h
254 utf8.c
255 utf8.h
256 util.c
257 util.h
258 virt.c
259 virt.h
260 xattr-util.c
261 xattr-util.h
262 '''.split())
263
264 missing_audit_h = files('missing_audit.h')
265 missing_capability_h = files('missing_capability.h')
266 missing_socket_h = files('missing_socket.h')
267
268 missing_syscall_def_h = files('missing_syscall_def.h')
269 basic_sources += missing_syscall_def_h
270
271 generate_af_list = find_program('generate-af-list.sh')
272 af_list_txt = custom_target(
273 'af-list.txt',
274 output : 'af-list.txt',
275 command : [generate_af_list, cpp, config_h, missing_socket_h],
276 capture : true)
277
278 generate_arphrd_list = find_program('generate-arphrd-list.sh')
279 arphrd_list_txt = custom_target(
280 'arphrd-list.txt',
281 output : 'arphrd-list.txt',
282 command : [generate_arphrd_list, cpp, config_h],
283 capture : true)
284
285 generate_cap_list = find_program('generate-cap-list.sh')
286 cap_list_txt = custom_target(
287 'cap-list.txt',
288 output : 'cap-list.txt',
289 command : [generate_cap_list, cpp, config_h, missing_capability_h],
290 capture : true)
291
292 generate_errno_list = find_program('generate-errno-list.sh')
293 errno_list_txt = custom_target(
294 'errno-list.txt',
295 output : 'errno-list.txt',
296 command : [generate_errno_list, cpp],
297 capture : true)
298
299 generated_gperf_headers = []
300 foreach item : [['af', af_list_txt, 'af', ''],
301 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
302 ['cap', cap_list_txt, 'capability', ''],
303 ['errno', errno_list_txt, 'errno', '']]
304
305 fname = '@0@-from-name.gperf'.format(item[0])
306 gperf_file = custom_target(
307 fname,
308 input : item[1],
309 output : fname,
310 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
311 capture : true)
312
313 fname = '@0@-from-name.h'.format(item[0])
314 target1 = custom_target(
315 fname,
316 input : gperf_file,
317 output : fname,
318 command : [gperf,
319 '-L', 'ANSI-C', '-t', '--ignore-case',
320 '-N', 'lookup_@0@'.format(item[2]),
321 '-H', 'hash_@0@_name'.format(item[2]),
322 '-p', '-C',
323 '@INPUT@'],
324 capture : true)
325
326 fname = '@0@-to-name.h'.format(item[0])
327 awkscript = '@0@-to-name.awk'.format(item[0])
328 target2 = custom_target(
329 fname,
330 input : [awkscript, item[1]],
331 output : fname,
332 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
333 capture : true)
334
335 generated_gperf_headers += [target1, target2]
336 endforeach
337
338 basic_sources += generated_gperf_headers
339
340 ############################################################
341
342 arch_list = [
343 'alpha',
344 'arc',
345 'arm',
346 'arm64',
347 'i386',
348 'ia64',
349 'm68k',
350 'mips64',
351 'mips64n32',
352 'mipso32',
353 'powerpc',
354 'powerpc64',
355 's390',
356 's390x',
357 'sparc',
358 'x86_64']
359
360 run_target(
361 'update-syscall-tables',
362 command : [update_syscall_tables_sh, meson.current_source_dir()] + arch_list)
363
364 syscall_list_txt = files('syscall-list.txt')
365
366 syscall_lists = []
367 foreach arch: arch_list
368 syscall_lists += files('syscalls-@0@.txt'.format(arch))
369 endforeach
370
371 missing_syscalls_py = find_program('missing_syscalls.py')
372
373 run_target(
374 'update-syscall-header',
375 command : [missing_syscalls_py,
376 missing_syscall_def_h,
377 syscall_lists])
378
379 ############################################################
380
381 libbasic = static_library(
382 'basic',
383 basic_sources,
384 fundamental_sources,
385 include_directories : basic_includes,
386 dependencies : [versiondep,
387 threads,
388 libcap,
389 libseccomp,
390 libselinux,
391 libm,
392 libdl],
393 c_args : ['-fvisibility=default'],
394 install : false)
395
396 ############################################################
397
398 basic_gcrypt_sources = files(
399 'gcrypt-util.c',
400 'gcrypt-util.h')
401
402 # A convenience library that is separate from libbasic to avoid
403 # unnecessary linking to libgcrypt.
404 libbasic_gcrypt = static_library(
405 'basic-gcrypt',
406 basic_gcrypt_sources,
407 include_directories : basic_includes,
408 dependencies : [libgcrypt],
409 c_args : ['-fvisibility=default'])