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