]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/meson.build
license: LGPL-2.1+ -> LGPL-2.1-or-later
[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
22 build.h
23 bus-label.c
24 bus-label.h
37efbbd8
ZJS
25 cap-list.c
26 cap-list.h
71e5200f
DM
27 capability-util.c
28 capability-util.h
37efbbd8
ZJS
29 cgroup-util.c
30 cgroup-util.h
31 chattr-util.c
32 chattr-util.h
37efbbd8
ZJS
33 conf-files.c
34 conf-files.h
35 copy.c
36 copy.h
37efbbd8
ZJS
37 def.h
38 device-nodes.c
39 device-nodes.h
40 dirent-util.c
41 dirent-util.h
49b19567 42 dlfcn-util.c
88d775b7 43 dlfcn-util.h
0bb2f0f1
ZJS
44 efivars.c
45 efivars.h
686d13b9
LP
46 env-file.c
47 env-file.h
37efbbd8
ZJS
48 env-util.c
49 env-util.h
50 errno-list.c
51 errno-list.h
2b2fec7d 52 errno-util.h
37efbbd8
ZJS
53 escape.c
54 escape.h
55 ether-addr-util.c
56 ether-addr-util.h
37efbbd8
ZJS
57 extract-word.c
58 extract-word.h
59 fd-util.c
60 fd-util.h
71e5200f
DM
61 fileio.c
62 fileio.h
7f686722 63 format-util.c
37efbbd8
ZJS
64 format-util.h
65 fs-util.c
66 fs-util.h
67 glob-util.c
68 glob-util.h
69 gunicode.c
70 gunicode.h
71 hash-funcs.c
72 hash-funcs.h
73 hashmap.c
74 hashmap.h
75 hexdecoct.c
76 hexdecoct.h
77 hostname-util.c
78 hostname-util.h
79 in-addr-util.c
80 in-addr-util.h
37efbbd8
ZJS
81 io-util.c
82 io-util.h
71e5200f 83 ioprio.h
f05e1d0d
LP
84 kbd-util.c
85 kbd-util.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
01234e1f
YW
116 linux/netlink.h
117 linux/rtnetlink.h
118 linux/wireguard.h
37efbbd8
ZJS
119 list.h
120 locale-util.c
121 locale-util.h
37efbbd8
ZJS
122 log.c
123 log.h
124 login-util.c
125 login-util.h
126 macro.h
127 memfd-util.c
128 memfd-util.h
0a970718
LP
129 memory-util.c
130 memory-util.h
37efbbd8
ZJS
131 mempool.c
132 mempool.h
0e7117d0 133 missing_audit.h
8ca2702f 134 missing_capability.h
5b139f86 135 missing_drm.h
dea72eda 136 missing_fcntl.h
503f480f 137 missing_fs.h
31c2ddab 138 missing_input.h
d7276b61 139 missing_keyctl.h
1e54f0ab 140 missing_magic.h
c8a363eb 141 missing_mman.h
475c18f0 142 missing_network.h
2a03bb3e 143 missing_prctl.h
b19bb111 144 missing_random.h
6c76de27 145 missing_resource.h
22332e33 146 missing_sched.h
3843e826 147 missing_securebits.h
66ffbdf9 148 missing_socket.h
e01819f8 149 missing_stat.h
470f348b 150 missing_stdlib.h
37efbbd8 151 missing_syscall.h
d7330b60 152 missing_timerfd.h
38e0c63d 153 missing_type.h
71e5200f 154 mkdir-label.c
37efbbd8
ZJS
155 mkdir.c
156 mkdir.h
049af8ad
ZJS
157 mountpoint-util.c
158 mountpoint-util.h
0cb8e3d1
LP
159 namespace-util.c
160 namespace-util.h
37efbbd8 161 nss-util.h
d8b4d14d
LP
162 nulstr-util.c
163 nulstr-util.h
37efbbd8
ZJS
164 ordered-set.c
165 ordered-set.h
166 parse-util.c
167 parse-util.h
09e6443e
ZJS
168 path-lookup.c
169 path-lookup.h
37efbbd8
ZJS
170 path-util.c
171 path-util.h
172 prioq.c
173 prioq.h
174 proc-cmdline.c
175 proc-cmdline.h
176 process-util.c
177 process-util.h
9aef9a67
LP
178 procfs-util.c
179 procfs-util.h
29d4392c 180 pthread-util.h
845a7c1f
LP
181 quota-util.c
182 quota-util.h
37efbbd8
ZJS
183 random-util.c
184 random-util.h
185 ratelimit.c
186 ratelimit.h
187 raw-clone.h
c52a937b 188 raw-reboot.h
37efbbd8
ZJS
189 replace-var.c
190 replace-var.h
3c069cda
LP
191 rlimit-util.c
192 rlimit-util.h
37efbbd8
ZJS
193 rm-rf.c
194 rm-rf.h
37efbbd8
ZJS
195 selinux-util.c
196 selinux-util.h
197 set.h
198 sigbus.c
199 sigbus.h
200 signal-util.c
201 signal-util.h
202 siphash24.c
203 siphash24.h
204 smack-util.c
205 smack-util.h
206 socket-label.c
207 socket-util.c
208 socket-util.h
760877e9
LP
209 sort-util.c
210 sort-util.h
37efbbd8
ZJS
211 sparse-endian.h
212 special.h
213 stat-util.c
214 stat-util.h
67e16c31 215 static-destruct.h
37efbbd8
ZJS
216 stdio-util.h
217 strbuf.c
218 strbuf.h
219 string-table.c
220 string-table.h
221 string-util.c
222 string-util.h
223 strv.c
224 strv.h
225 strxcpyx.c
226 strxcpyx.h
227 syslog-util.c
228 syslog-util.h
229 terminal-util.c
230 terminal-util.h
231 time-util.c
232 time-util.h
e4de7287
LP
233 tmpfile-util.c
234 tmpfile-util.h
37efbbd8
ZJS
235 umask-util.h
236 unaligned.h
523578aa
LP
237 unit-def.c
238 unit-def.h
18c528e9
LP
239 unit-name.c
240 unit-name.h
37efbbd8
ZJS
241 user-util.c
242 user-util.h
243 utf8.c
244 utf8.h
245 util.c
246 util.h
37efbbd8
ZJS
247 virt.c
248 virt.h
37efbbd8
ZJS
249 xattr-util.c
250 xattr-util.h
5c23128d
ZJS
251'''.split())
252
18bf324a 253missing_audit_h = files('missing_audit.h')
54480d64 254missing_capability_h = files('missing_capability.h')
0b7d48f5 255missing_socket_h = files('missing_socket.h')
5c23128d 256
5c23128d
ZJS
257generate_af_list = find_program('generate-af-list.sh')
258af_list_txt = custom_target(
37efbbd8
ZJS
259 'af-list.txt',
260 output : 'af-list.txt',
0b7d48f5 261 command : [generate_af_list, cpp, config_h, missing_socket_h],
37efbbd8 262 capture : true)
5c23128d
ZJS
263
264generate_arphrd_list = find_program('generate-arphrd-list.sh')
265arphrd_list_txt = custom_target(
37efbbd8
ZJS
266 'arphrd-list.txt',
267 output : 'arphrd-list.txt',
01234e1f 268 command : [generate_arphrd_list, cpp, config_h],
37efbbd8 269 capture : true)
5c23128d
ZJS
270
271generate_cap_list = find_program('generate-cap-list.sh')
272cap_list_txt = custom_target(
37efbbd8
ZJS
273 'cap-list.txt',
274 output : 'cap-list.txt',
54480d64 275 command : [generate_cap_list, cpp, config_h, missing_capability_h],
37efbbd8 276 capture : true)
5c23128d
ZJS
277
278generate_errno_list = find_program('generate-errno-list.sh')
279errno_list_txt = custom_target(
37efbbd8
ZJS
280 'errno-list.txt',
281 output : 'errno-list.txt',
282 command : [generate_errno_list, cpp],
283 capture : true)
5c23128d
ZJS
284
285generated_gperf_headers = []
286foreach item : [['af', af_list_txt, 'af', ''],
287 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
288 ['cap', cap_list_txt, 'capability', ''],
7b5e750d 289 ['errno', errno_list_txt, 'errno', '']]
5c23128d 290
37efbbd8
ZJS
291 fname = '@0@-from-name.gperf'.format(item[0])
292 gperf_file = custom_target(
293 fname,
294 input : item[1],
295 output : fname,
296 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
297 capture : true)
5c23128d 298
37efbbd8
ZJS
299 fname = '@0@-from-name.h'.format(item[0])
300 target1 = custom_target(
301 fname,
302 input : gperf_file,
303 output : fname,
304 command : [gperf,
305 '-L', 'ANSI-C', '-t', '--ignore-case',
306 '-N', 'lookup_@0@'.format(item[2]),
307 '-H', 'hash_@0@_name'.format(item[2]),
308 '-p', '-C',
309 '@INPUT@'],
310 capture : true)
5c23128d 311
37efbbd8
ZJS
312 fname = '@0@-to-name.h'.format(item[0])
313 awkscript = '@0@-to-name.awk'.format(item[0])
314 target2 = custom_target(
315 fname,
316 input : [awkscript, item[1]],
317 output : fname,
318 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
319 capture : true)
5c23128d 320
37efbbd8 321 generated_gperf_headers += [target1, target2]
5c23128d
ZJS
322endforeach
323
18bf324a 324basic_sources += generated_gperf_headers
975464e0
ZJS
325basic_gcrypt_sources = files(
326 'gcrypt-util.c',
327 'gcrypt-util.h')
5c23128d
ZJS
328
329libbasic = static_library(
37efbbd8
ZJS
330 'basic',
331 basic_sources,
332 include_directories : includes,
d1084aa2
LT
333 dependencies : [versiondep,
334 threads,
37efbbd8 335 libcap,
0bc2f071 336 libseccomp,
cd0b6c53 337 libselinux,
88d775b7
LP
338 libm,
339 libdl],
2d4ceca8 340 c_args : ['-fvisibility=default'],
37efbbd8 341 install : false)
34e221a5
ZJS
342
343# A convenience library that is separate from libbasic to avoid
344# unnecessary linking to libgcrypt.
345libbasic_gcrypt = static_library(
346 'basic-gcrypt',
975464e0 347 basic_gcrypt_sources,
34e221a5
ZJS
348 include_directories : includes,
349 dependencies : [libgcrypt],
350 c_args : ['-fvisibility=default'])