]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
missing: move statx related definitions to missing_stat.h
[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 env-file.c
43 env-file.h
44 env-util.c
45 env-util.h
46 errno-list.c
47 errno-list.h
48 escape.c
49 escape.h
50 ether-addr-util.c
51 ether-addr-util.h
52 extract-word.c
53 extract-word.h
54 fd-util.c
55 fd-util.h
56 fileio.c
57 fileio.h
58 format-util.h
59 fs-util.c
60 fs-util.h
61 glob-util.c
62 glob-util.h
63 gunicode.c
64 gunicode.h
65 hash-funcs.c
66 hash-funcs.h
67 hashmap.c
68 hashmap.h
69 hexdecoct.c
70 hexdecoct.h
71 hostname-util.c
72 hostname-util.h
73 in-addr-util.c
74 in-addr-util.h
75 io-util.c
76 io-util.h
77 ioprio.h
78 khash.c
79 khash.h
80 label.c
81 label.h
82 list.h
83 locale-util.c
84 locale-util.h
85 log.c
86 log.h
87 login-util.c
88 login-util.h
89 macro.h
90 memfd-util.c
91 memfd-util.h
92 mempool.c
93 mempool.h
94 missing_btrfs.h
95 missing_btrfs_tree.h
96 missing_ethtool.h
97 missing_fib_rules.h
98 missing_fou.h
99 missing_if_bridge.h
100 missing_if_link.h
101 missing_if_tunnel.h
102 missing_input.h
103 missing_keyctl.h
104 missing_magic.h
105 missing_network.h
106 missing_securebits.h
107 missing_stat.h
108 missing_syscall.h
109 missing_vxcan.h
110 mkdir-label.c
111 mkdir.c
112 mkdir.h
113 mountpoint-util.c
114 mountpoint-util.h
115 nss-util.h
116 ordered-set.c
117 ordered-set.h
118 parse-util.c
119 parse-util.h
120 path-util.c
121 path-util.h
122 prioq.c
123 prioq.h
124 proc-cmdline.c
125 proc-cmdline.h
126 process-util.c
127 process-util.h
128 procfs-util.c
129 procfs-util.h
130 random-util.c
131 random-util.h
132 ratelimit.c
133 ratelimit.h
134 raw-clone.h
135 raw-reboot.h
136 refcnt.h
137 replace-var.c
138 replace-var.h
139 rm-rf.c
140 rm-rf.h
141 selinux-util.c
142 selinux-util.h
143 set.h
144 sigbus.c
145 sigbus.h
146 signal-util.c
147 signal-util.h
148 siphash24.c
149 siphash24.h
150 smack-util.c
151 smack-util.h
152 socket-label.c
153 socket-util.c
154 socket-util.h
155 sparse-endian.h
156 special.h
157 stat-util.c
158 stat-util.h
159 static-destruct.h
160 stdio-util.h
161 strbuf.c
162 strbuf.h
163 string-table.c
164 string-table.h
165 string-util.c
166 string-util.h
167 strv.c
168 strv.h
169 strxcpyx.c
170 strxcpyx.h
171 syslog-util.c
172 syslog-util.h
173 terminal-util.c
174 terminal-util.h
175 time-util.c
176 time-util.h
177 tmpfile-util.c
178 tmpfile-util.h
179 umask-util.h
180 unaligned.h
181 unit-def.c
182 unit-def.h
183 unit-name.c
184 unit-name.h
185 user-util.c
186 user-util.h
187 utf8.c
188 utf8.h
189 util.c
190 util.h
191 virt.c
192 virt.h
193 xattr-util.c
194 xattr-util.h
195 '''.split())
196
197 missing_h = files('missing.h')
198
199 generate_af_list = find_program('generate-af-list.sh')
200 af_list_txt = custom_target(
201 'af-list.txt',
202 output : 'af-list.txt',
203 command : [generate_af_list, cpp],
204 capture : true)
205
206 generate_arphrd_list = find_program('generate-arphrd-list.sh')
207 arphrd_list_txt = custom_target(
208 'arphrd-list.txt',
209 output : 'arphrd-list.txt',
210 command : [generate_arphrd_list, cpp],
211 capture : true)
212
213 generate_cap_list = find_program('generate-cap-list.sh')
214 cap_list_txt = custom_target(
215 'cap-list.txt',
216 output : 'cap-list.txt',
217 command : [generate_cap_list, cpp, config_h, missing_h],
218 capture : true)
219
220 generate_errno_list = find_program('generate-errno-list.sh')
221 errno_list_txt = custom_target(
222 'errno-list.txt',
223 output : 'errno-list.txt',
224 command : [generate_errno_list, cpp],
225 capture : true)
226
227 generated_gperf_headers = []
228 foreach item : [['af', af_list_txt, 'af', ''],
229 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
230 ['cap', cap_list_txt, 'capability', ''],
231 ['errno', errno_list_txt, 'errno', '']]
232
233 fname = '@0@-from-name.gperf'.format(item[0])
234 gperf_file = custom_target(
235 fname,
236 input : item[1],
237 output : fname,
238 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
239 capture : true)
240
241 fname = '@0@-from-name.h'.format(item[0])
242 target1 = custom_target(
243 fname,
244 input : gperf_file,
245 output : fname,
246 command : [gperf,
247 '-L', 'ANSI-C', '-t', '--ignore-case',
248 '-N', 'lookup_@0@'.format(item[2]),
249 '-H', 'hash_@0@_name'.format(item[2]),
250 '-p', '-C',
251 '@INPUT@'],
252 capture : true)
253
254 fname = '@0@-to-name.h'.format(item[0])
255 awkscript = '@0@-to-name.awk'.format(item[0])
256 target2 = custom_target(
257 fname,
258 input : [awkscript, item[1]],
259 output : fname,
260 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
261 capture : true)
262
263 generated_gperf_headers += [target1, target2]
264 endforeach
265
266 basic_sources += [missing_h] + generated_gperf_headers
267 basic_gcrypt_sources = files(
268 'gcrypt-util.c',
269 'gcrypt-util.h')
270
271 libbasic = static_library(
272 'basic',
273 basic_sources,
274 include_directories : includes,
275 dependencies : [threads,
276 libcap,
277 libselinux,
278 libm],
279 c_args : ['-fvisibility=default'],
280 install : false)
281
282 # A convenience library that is separate from libbasic to avoid
283 # unnecessary linking to libgcrypt.
284 libbasic_gcrypt = static_library(
285 'basic-gcrypt',
286 basic_gcrypt_sources,
287 include_directories : includes,
288 dependencies : [libgcrypt],
289 c_args : ['-fvisibility=default'])