]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
path-util: make use of TAKE_PTR() where we can
[thirdparty/systemd.git] / src / basic / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
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.h
23 bus-label.c
24 bus-label.h
25 cap-list.c
26 cap-list.h
27 capability-util.c
28 capability-util.h
29 cgroup-util.c
30 cgroup-util.h
31 chattr-util.c
32 chattr-util.h
33 conf-files.c
34 conf-files.h
35 copy.c
36 copy.h
37 def.h
38 device-nodes.c
39 device-nodes.h
40 dirent-util.c
41 dirent-util.h
42 dlfcn-util.h
43 efivars.c
44 efivars.h
45 env-file.c
46 env-file.h
47 env-util.c
48 env-util.h
49 errno-list.c
50 errno-list.h
51 errno-util.h
52 escape.c
53 escape.h
54 ether-addr-util.c
55 ether-addr-util.h
56 extract-word.c
57 extract-word.h
58 fd-util.c
59 fd-util.h
60 fileio.c
61 fileio.h
62 format-util.c
63 format-util.h
64 fs-util.c
65 fs-util.h
66 glob-util.c
67 glob-util.h
68 gunicode.c
69 gunicode.h
70 hash-funcs.c
71 hash-funcs.h
72 hashmap.c
73 hashmap.h
74 hexdecoct.c
75 hexdecoct.h
76 hostname-util.c
77 hostname-util.h
78 in-addr-util.c
79 in-addr-util.h
80 io-util.c
81 io-util.h
82 ioprio.h
83 kbd-util.c
84 kbd-util.h
85 khash.c
86 khash.h
87 label.c
88 label.h
89 limits-util.c
90 limits-util.h
91 linux/btrfs.h
92 linux/btrfs_tree.h
93 linux/can/vxcan.h
94 linux/fib_rules.h
95 linux/fou.h
96 linux/if.h
97 linux/if_addr.h
98 linux/if_arp.h
99 linux/if_bonding.h
100 linux/if_bridge.h
101 linux/if_ether.h
102 linux/if_link.h
103 linux/if_macsec.h
104 linux/if_tun.h
105 linux/if_tunnel.h
106 linux/in.h
107 linux/in6.h
108 linux/l2tp.h
109 linux/libc-compat.h
110 linux/netdevice.h
111 linux/netlink.h
112 linux/rtnetlink.h
113 linux/wireguard.h
114 list.h
115 locale-util.c
116 locale-util.h
117 log.c
118 log.h
119 login-util.c
120 login-util.h
121 macro.h
122 memfd-util.c
123 memfd-util.h
124 memory-util.c
125 memory-util.h
126 mempool.c
127 mempool.h
128 missing_audit.h
129 missing_capability.h
130 missing_drm.h
131 missing_fcntl.h
132 missing_fs.h
133 missing_input.h
134 missing_keyctl.h
135 missing_magic.h
136 missing_mman.h
137 missing_network.h
138 missing_prctl.h
139 missing_random.h
140 missing_resource.h
141 missing_sched.h
142 missing_securebits.h
143 missing_socket.h
144 missing_stat.h
145 missing_stdlib.h
146 missing_syscall.h
147 missing_timerfd.h
148 missing_type.h
149 mkdir-label.c
150 mkdir.c
151 mkdir.h
152 mountpoint-util.c
153 mountpoint-util.h
154 namespace-util.c
155 namespace-util.h
156 nss-util.h
157 nulstr-util.c
158 nulstr-util.h
159 ordered-set.c
160 ordered-set.h
161 parse-util.c
162 parse-util.h
163 path-lookup.c
164 path-lookup.h
165 path-util.c
166 path-util.h
167 prioq.c
168 prioq.h
169 proc-cmdline.c
170 proc-cmdline.h
171 process-util.c
172 process-util.h
173 procfs-util.c
174 procfs-util.h
175 pthread-util.h
176 quota-util.c
177 quota-util.h
178 random-util.c
179 random-util.h
180 ratelimit.c
181 ratelimit.h
182 raw-clone.h
183 raw-reboot.h
184 replace-var.c
185 replace-var.h
186 rlimit-util.c
187 rlimit-util.h
188 rm-rf.c
189 rm-rf.h
190 selinux-util.c
191 selinux-util.h
192 set.h
193 sigbus.c
194 sigbus.h
195 signal-util.c
196 signal-util.h
197 siphash24.c
198 siphash24.h
199 smack-util.c
200 smack-util.h
201 socket-label.c
202 socket-util.c
203 socket-util.h
204 sort-util.c
205 sort-util.h
206 sparse-endian.h
207 special.h
208 stat-util.c
209 stat-util.h
210 static-destruct.h
211 stdio-util.h
212 strbuf.c
213 strbuf.h
214 string-table.c
215 string-table.h
216 string-util.c
217 string-util.h
218 strv.c
219 strv.h
220 strxcpyx.c
221 strxcpyx.h
222 syslog-util.c
223 syslog-util.h
224 terminal-util.c
225 terminal-util.h
226 time-util.c
227 time-util.h
228 tmpfile-util.c
229 tmpfile-util.h
230 umask-util.h
231 unaligned.h
232 unit-def.c
233 unit-def.h
234 unit-name.c
235 unit-name.h
236 user-util.c
237 user-util.h
238 utf8.c
239 utf8.h
240 util.c
241 util.h
242 virt.c
243 virt.h
244 xattr-util.c
245 xattr-util.h
246 '''.split())
247
248 missing_audit_h = files('missing_audit.h')
249 missing_capability_h = files('missing_capability.h')
250 missing_socket_h = files('missing_socket.h')
251
252 generate_af_list = find_program('generate-af-list.sh')
253 af_list_txt = custom_target(
254 'af-list.txt',
255 output : 'af-list.txt',
256 command : [generate_af_list, cpp, config_h, missing_socket_h],
257 capture : true)
258
259 generate_arphrd_list = find_program('generate-arphrd-list.sh')
260 arphrd_list_txt = custom_target(
261 'arphrd-list.txt',
262 output : 'arphrd-list.txt',
263 command : [generate_arphrd_list, cpp, config_h],
264 capture : true)
265
266 generate_cap_list = find_program('generate-cap-list.sh')
267 cap_list_txt = custom_target(
268 'cap-list.txt',
269 output : 'cap-list.txt',
270 command : [generate_cap_list, cpp, config_h, missing_capability_h],
271 capture : true)
272
273 generate_errno_list = find_program('generate-errno-list.sh')
274 errno_list_txt = custom_target(
275 'errno-list.txt',
276 output : 'errno-list.txt',
277 command : [generate_errno_list, cpp],
278 capture : true)
279
280 generated_gperf_headers = []
281 foreach item : [['af', af_list_txt, 'af', ''],
282 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
283 ['cap', cap_list_txt, 'capability', ''],
284 ['errno', errno_list_txt, 'errno', '']]
285
286 fname = '@0@-from-name.gperf'.format(item[0])
287 gperf_file = custom_target(
288 fname,
289 input : item[1],
290 output : fname,
291 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
292 capture : true)
293
294 fname = '@0@-from-name.h'.format(item[0])
295 target1 = custom_target(
296 fname,
297 input : gperf_file,
298 output : fname,
299 command : [gperf,
300 '-L', 'ANSI-C', '-t', '--ignore-case',
301 '-N', 'lookup_@0@'.format(item[2]),
302 '-H', 'hash_@0@_name'.format(item[2]),
303 '-p', '-C',
304 '@INPUT@'],
305 capture : true)
306
307 fname = '@0@-to-name.h'.format(item[0])
308 awkscript = '@0@-to-name.awk'.format(item[0])
309 target2 = custom_target(
310 fname,
311 input : [awkscript, item[1]],
312 output : fname,
313 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
314 capture : true)
315
316 generated_gperf_headers += [target1, target2]
317 endforeach
318
319 basic_sources += generated_gperf_headers
320 basic_gcrypt_sources = files(
321 'gcrypt-util.c',
322 'gcrypt-util.h')
323
324 libbasic = static_library(
325 'basic',
326 basic_sources,
327 include_directories : includes,
328 dependencies : [versiondep,
329 threads,
330 libcap,
331 libselinux,
332 libm,
333 libdl],
334 c_args : ['-fvisibility=default'],
335 install : false)
336
337 # A convenience library that is separate from libbasic to avoid
338 # unnecessary linking to libgcrypt.
339 libbasic_gcrypt = static_library(
340 'basic-gcrypt',
341 basic_gcrypt_sources,
342 include_directories : includes,
343 dependencies : [libgcrypt],
344 c_args : ['-fvisibility=default'])