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