]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
set: drop unused set_make() function (#8879)
[thirdparty/systemd.git] / src / basic / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
4
5 basic_sources = files('''
6 MurmurHash2.c
7 MurmurHash2.h
8 af-list.c
9 af-list.h
10 alloc-util.c
11 alloc-util.h
12 architecture.c
13 architecture.h
14 arphrd-list.c
15 arphrd-list.h
16 async.c
17 async.h
18 audit-util.c
19 audit-util.h
20 barrier.c
21 barrier.h
22 bitmap.c
23 bitmap.h
24 blkid-util.h
25 blockdev-util.c
26 blockdev-util.h
27 bpf-program.c
28 bpf-program.h
29 btrfs-ctree.h
30 btrfs-util.c
31 btrfs-util.h
32 build.h
33 bus-label.c
34 bus-label.h
35 calendarspec.c
36 calendarspec.h
37 cap-list.c
38 cap-list.h
39 capability-util.c
40 capability-util.h
41 cgroup-util.c
42 cgroup-util.h
43 chattr-util.c
44 chattr-util.h
45 clock-util.c
46 clock-util.h
47 conf-files.c
48 conf-files.h
49 copy.c
50 copy.h
51 cpu-set-util.c
52 cpu-set-util.h
53 crypt-util.c
54 crypt-util.h
55 def.h
56 device-nodes.c
57 device-nodes.h
58 dirent-util.c
59 dirent-util.h
60 env-util.c
61 env-util.h
62 errno-list.c
63 errno-list.h
64 escape.c
65 escape.h
66 ether-addr-util.c
67 ether-addr-util.h
68 exec-util.c
69 exec-util.h
70 exit-status.c
71 exit-status.h
72 extract-word.c
73 extract-word.h
74 fd-util.c
75 fd-util.h
76 fileio-label.c
77 fileio-label.h
78 fileio.c
79 fileio.h
80 format-table.c
81 format-table.h
82 format-util.h
83 fs-util.c
84 fs-util.h
85 glob-util.c
86 glob-util.h
87 gunicode.c
88 gunicode.h
89 hash-funcs.c
90 hash-funcs.h
91 hashmap.c
92 hashmap.h
93 hexdecoct.c
94 hexdecoct.h
95 hostname-util.c
96 hostname-util.h
97 in-addr-util.c
98 in-addr-util.h
99 io-util.c
100 io-util.h
101 ioprio.h
102 journal-importer.c
103 journal-importer.h
104 khash.c
105 khash.h
106 label.c
107 label.h
108 list.h
109 locale-util.c
110 locale-util.h
111 lockfile-util.c
112 lockfile-util.h
113 log.c
114 log.h
115 login-util.c
116 login-util.h
117 macro.h
118 memfd-util.c
119 memfd-util.h
120 mempool.c
121 mempool.h
122 missing_syscall.h
123 mkdir-label.c
124 mkdir.c
125 mkdir.h
126 module-util.h
127 mount-util.c
128 mount-util.h
129 nss-util.h
130 ordered-set.c
131 ordered-set.h
132 pager.c
133 pager.h
134 parse-util.c
135 parse-util.h
136 path-util.c
137 path-util.h
138 prioq.c
139 prioq.h
140 proc-cmdline.c
141 proc-cmdline.h
142 process-util.c
143 process-util.h
144 procfs-util.c
145 procfs-util.h
146 random-util.c
147 random-util.h
148 ratelimit.c
149 ratelimit.h
150 raw-clone.h
151 raw-reboot.h
152 reboot-util.c
153 reboot-util.h
154 refcnt.h
155 replace-var.c
156 replace-var.h
157 rlimit-util.c
158 rlimit-util.h
159 rm-rf.c
160 rm-rf.h
161 securebits-util.c
162 securebits-util.h
163 securebits.h
164 selinux-util.c
165 selinux-util.h
166 set.h
167 sigbus.c
168 sigbus.h
169 signal-util.c
170 signal-util.h
171 siphash24.c
172 siphash24.h
173 smack-util.c
174 smack-util.h
175 socket-label.c
176 socket-protocol-list.c
177 socket-protocol-list.h
178 socket-util.c
179 socket-util.h
180 sparse-endian.h
181 special.h
182 stat-util.c
183 stat-util.h
184 stdio-util.h
185 strbuf.c
186 strbuf.h
187 string-table.c
188 string-table.h
189 string-util.c
190 string-util.h
191 strv.c
192 strv.h
193 strxcpyx.c
194 strxcpyx.h
195 syslog-util.c
196 syslog-util.h
197 terminal-util.c
198 terminal-util.h
199 time-util.c
200 time-util.h
201 umask-util.h
202 unaligned.h
203 unit-def.c
204 unit-def.h
205 unit-name.c
206 unit-name.h
207 user-util.c
208 user-util.h
209 utf8.c
210 utf8.h
211 util.c
212 util.h
213 verbs.c
214 verbs.h
215 virt.c
216 virt.h
217 web-util.c
218 web-util.h
219 xattr-util.c
220 xattr-util.h
221 xml.c
222 xml.h
223 '''.split())
224
225 missing_h = files('missing.h')
226
227 generate_gperfs = find_program('generate-gperfs.py')
228
229 generate_af_list = find_program('generate-af-list.sh')
230 af_list_txt = custom_target(
231 'af-list.txt',
232 output : 'af-list.txt',
233 command : [generate_af_list, cpp],
234 capture : true)
235
236 generate_arphrd_list = find_program('generate-arphrd-list.sh')
237 arphrd_list_txt = custom_target(
238 'arphrd-list.txt',
239 output : 'arphrd-list.txt',
240 command : [generate_arphrd_list, cpp],
241 capture : true)
242
243 generate_cap_list = find_program('generate-cap-list.sh')
244 cap_list_txt = custom_target(
245 'cap-list.txt',
246 output : 'cap-list.txt',
247 command : [generate_cap_list, cpp, config_h, missing_h],
248 capture : true)
249
250 generate_errno_list = find_program('generate-errno-list.sh')
251 errno_list_txt = custom_target(
252 'errno-list.txt',
253 output : 'errno-list.txt',
254 command : [generate_errno_list, cpp],
255 capture : true)
256
257 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
258 socket_protocol_list_txt = custom_target(
259 'socket-protocol-list.txt',
260 output : 'socket-protocol-list.txt',
261 command : [generate_socket_protocol_list, cpp],
262 capture : true)
263
264 generated_gperf_headers = []
265 foreach item : [['af', af_list_txt, 'af', ''],
266 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
267 ['cap', cap_list_txt, 'capability', ''],
268 ['errno', errno_list_txt, 'errno', ''],
269 ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']]
270
271 fname = '@0@-from-name.gperf'.format(item[0])
272 gperf_file = custom_target(
273 fname,
274 input : item[1],
275 output : fname,
276 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
277 capture : true)
278
279 fname = '@0@-from-name.h'.format(item[0])
280 target1 = custom_target(
281 fname,
282 input : gperf_file,
283 output : fname,
284 command : [gperf,
285 '-L', 'ANSI-C', '-t', '--ignore-case',
286 '-N', 'lookup_@0@'.format(item[2]),
287 '-H', 'hash_@0@_name'.format(item[2]),
288 '-p', '-C',
289 '@INPUT@'],
290 capture : true)
291
292 fname = '@0@-to-name.h'.format(item[0])
293 awkscript = '@0@-to-name.awk'.format(item[0])
294 target2 = custom_target(
295 fname,
296 input : [awkscript, item[1]],
297 output : fname,
298 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
299 capture : true)
300
301 generated_gperf_headers += [target1, target2]
302 endforeach
303
304 basic_sources += [missing_h] + generated_gperf_headers
305
306 libbasic = static_library(
307 'basic',
308 basic_sources,
309 include_directories : includes,
310 dependencies : [threads,
311 libcap,
312 libblkid,
313 libmount,
314 libselinux],
315 c_args : ['-fvisibility=default'],
316 install : false)
317
318 # A convenience library that is separate from libbasic to avoid
319 # unnecessary linking to libgcrypt.
320 libbasic_gcrypt = static_library(
321 'basic-gcrypt',
322 'gcrypt-util.c',
323 'gcrypt-util.h',
324 include_directories : includes,
325 dependencies : [libgcrypt],
326 c_args : ['-fvisibility=default'])