chiark / gitweb /
Prep v235: Added cap-list, which is needed now.
[elogind.git] / src / basic / meson.build
1 #if 0 /// elogind has a shorter list
2 # basic_sources_plain = files('''
3 #         af-list.c
4 #         af-list.h
5 #         alloc-util.c
6 #         alloc-util.h
7 #         architecture.c
8 #         architecture.h
9 #         arphrd-list.c
10 #         arphrd-list.h
11 #         async.c
12 #         async.h
13 #         audit-util.c
14 #         audit-util.h
15 #         barrier.c
16 #         barrier.h
17 #         bitmap.c
18 #         bitmap.h
19 #         blkid-util.h
20 #         btrfs-ctree.h
21 #         btrfs-util.c
22 #         btrfs-util.h
23 #         build.h
24 #         bus-label.c
25 #         bus-label.h
26 #         calendarspec.c
27 #         calendarspec.h
28 #         capability-util.c
29 #         capability-util.h
30 #         cap-list.c
31 #         cap-list.h
32 #         cgroup-util.c
33 #         cgroup-util.h
34 #         chattr-util.c
35 #         chattr-util.h
36 #         clock-util.c
37 #         clock-util.h
38 #         conf-files.c
39 #         conf-files.h
40 #         copy.c
41 #         copy.h
42 #         cpu-set-util.c
43 #         cpu-set-util.h
44 #         def.h
45 #         device-nodes.c
46 #         device-nodes.h
47 #         dirent-util.c
48 #         dirent-util.h
49 #         env-util.c
50 #         env-util.h
51 #         errno-list.c
52 #         errno-list.h
53 #         escape.c
54 #         escape.h
55 #         ether-addr-util.c
56 #         ether-addr-util.h
57 #         exec-util.c
58 #         exec-util.h
59 #         exit-status.c
60 #         exit-status.h
61 #         extract-word.c
62 #         extract-word.h
63 #         fd-util.c
64 #         fd-util.h
65 #         fileio.c
66 #         fileio.h
67 #         fileio-label.c
68 #         fileio-label.h
69 #         format-util.h
70 #         fs-util.c
71 #         fs-util.h
72 #         glob-util.c
73 #         glob-util.h
74 #         gunicode.c
75 #         gunicode.h
76 #         hash-funcs.c
77 #         hash-funcs.h
78 #         hashmap.c
79 #         hashmap.h
80 #         hexdecoct.c
81 #         hexdecoct.h
82 #         hostname-util.c
83 #         hostname-util.h
84 #         in-addr-util.c
85 #         in-addr-util.h
86 #         ioprio.h
87 #         io-util.c
88 #         io-util.h
89 #         journal-importer.c
90 #         journal-importer.h
91 #         khash.c
92 #         khash.h
93 #         label.c
94 #         label.h
95 #         list.h
96 #         locale-util.c
97 #         locale-util.h
98 #         lockfile-util.c
99 #         lockfile-util.h
100 #         log.c
101 #         log.h
102 #         login-util.c
103 #         login-util.h
104 #         macro.h
105 #         memfd-util.c
106 #         memfd-util.h
107 #         mempool.c
108 #         mempool.h
109 #         missing_syscall.h
110 #         mkdir.c
111 #         mkdir.h
112 #         mkdir-label.c
113 #         mount-util.c
114 #         mount-util.h
115 #         MurmurHash2.c
116 #         MurmurHash2.h
117 #         nss-util.h
118 #         ordered-set.c
119 #         ordered-set.h
120 #         parse-util.c
121 #         parse-util.h
122 #         path-util.c
123 #         path-util.h
124 #         prioq.c
125 #         prioq.h
126 #         proc-cmdline.c
127 #         proc-cmdline.h
128 #         process-util.c
129 #         process-util.h
130 #         random-util.c
131 #         random-util.h
132 #         ratelimit.c
133 #         ratelimit.h
134 #         raw-clone.h
135 #         refcnt.h
136 #         replace-var.c
137 #         replace-var.h
138 #         rlimit-util.c
139 #         rlimit-util.h
140 #         rm-rf.c
141 #         rm-rf.h
142 #         securebits.h
143 #         securebits-util.c
144 #         securebits-util.h
145 #         selinux-util.c
146 #         selinux-util.h
147 #         set.h
148 #         sigbus.c
149 #         sigbus.h
150 #         signal-util.c
151 #         signal-util.h
152 #         siphash24.c
153 #         siphash24.h
154 #         smack-util.c
155 #         smack-util.h
156 #         socket-label.c
157 #         socket-util.c
158 #         socket-util.h
159 #         sparse-endian.h
160 #         special.h
161 #         stat-util.c
162 #         stat-util.h
163 #         stdio-util.h
164 #         strbuf.c
165 #         strbuf.h
166 #         string-table.c
167 #         string-table.h
168 #         string-util.c
169 #         string-util.h
170 #         strv.c
171 #         strv.h
172 #         strxcpyx.c
173 #         strxcpyx.h
174 #         syslog-util.c
175 #         syslog-util.h
176 #         terminal-util.c
177 #         terminal-util.h
178 #         time-util.c
179 #         time-util.h
180 #         umask-util.h
181 #         unaligned.h
182 #         unit-name.c
183 #         unit-name.h
184 #         user-util.c
185 #         user-util.h
186 #         utf8.c
187 #         utf8.h
188 #         util.c
189 #         util.h
190 #         verbs.c
191 #         verbs.h
192 #         virt.c
193 #         virt.h
194 #         web-util.c
195 #         web-util.h
196 #         xattr-util.c
197 #         xattr-util.h
198 #         xml.c
199 #         xml.h
200 # '''.split())
201 #else
202 basic_sources_plain = files('''
203         alloc-util.c
204         alloc-util.h
205         audit-util.c
206         audit-util.h
207         build.h
208         bus-label.c
209         bus-label.h
210         capability-util.c
211         capability-util.h
212         cgroup-util.c
213         cap-list.c
214         cap-list.h
215         cgroup-util.h
216         conf-files.c
217         conf-files.h
218         copy.c
219         copy.h
220         def.h
221         dirent-util.c
222         dirent-util.h
223         env-util.c
224         env-util.h
225         errno-list.c
226         errno-list.h
227         escape.c
228         escape.h
229         exec-util.c
230         exec-util.h
231         extract-word.c
232         extract-word.h
233         fd-util.c
234         fd-util.h
235         fileio.c
236         fileio.h
237         fileio-label.c
238         fileio-label.h
239         format-util.h
240         fs-util.c
241         fs-util.h
242         gunicode.c
243         gunicode.h
244         hash-funcs.c
245         hash-funcs.h
246         hashmap.c
247         hashmap.h
248         hexdecoct.c
249         hexdecoct.h
250         hostname-util.c
251         hostname-util.h
252         io-util.c
253         io-util.h
254         khash.c
255         khash.h
256         label.c
257         label.h
258         list.h
259         locale-util.c
260         locale-util.h
261         log.c
262         log.h
263         login-util.c
264         login-util.h
265         macro.h
266         memfd-util.c
267         memfd-util.h
268         mempool.c
269         mempool.h
270         missing_syscall.h
271         mkdir.c
272         mkdir.h
273         mkdir-label.c
274         mount-util.c
275         mount-util.h
276         parse-printf-format.c
277         parse-printf-format.h
278         parse-util.c
279         parse-util.h
280         path-util.c
281         path-util.h
282         prioq.c
283         prioq.h
284         proc-cmdline.c
285         proc-cmdline.h
286         process-util.c
287         process-util.h
288         random-util.c
289         random-util.h
290         refcnt.h
291         rm-rf.c
292         rm-rf.h
293         selinux-util.c
294         selinux-util.h
295         set.h
296         signal-util.c
297         signal-util.h
298         siphash24.c
299         siphash24.h
300         smack-util.c
301         smack-util.h
302         socket-util.c
303         socket-util.h
304         sparse-endian.h
305         stat-util.c
306         stat-util.h
307         stdio-util.h
308         string-table.c
309         string-table.h
310         string-util.c
311         string-util.h
312         strv.c
313         strv.h
314         syslog-util.c
315         syslog-util.h
316         terminal-util.c
317         terminal-util.h
318         time-util.c
319         time-util.h
320         umask-util.h
321         unaligned.h
322         unit-name.c
323         unit-name.h
324         user-util.c
325         user-util.h
326         utf8.c
327         utf8.h
328         util.c
329         util.h
330         verbs.c
331         verbs.h
332         virt.c
333         virt.h
334         xattr-util.c
335         xattr-util.h
336 '''.split())
337 #endif // 0
338
339 missing_h = files('missing.h')
340
341 generate_gperfs = find_program('generate-gperfs.py')
342
343 #if 0 /// elogind has only the cap and errno list.
344 # generate_af_list = find_program('generate-af-list.sh')
345 # af_list_txt = custom_target(
346 #         'af-list.txt',
347 #         output : 'af-list.txt',
348 #         command : [generate_af_list, cpp],
349 #         capture : true)
350
351 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
352 # arphrd_list_txt = custom_target(
353 #         'arphrd-list.txt',
354 #         output : 'arphrd-list.txt',
355 #         command : [generate_arphrd_list, cpp],
356 #         capture : true)
357 #endif // 0
358
359 generate_cap_list = find_program('generate-cap-list.sh')
360 cap_list_txt = custom_target(
361         'cap-list.txt',
362         output : 'cap-list.txt',
363         command : [generate_cap_list, cpp, config_h, missing_h],
364         capture : true)
365
366 generate_errno_list = find_program('generate-errno-list.sh')
367 errno_list_txt = custom_target(
368         'errno-list.txt',
369         output : 'errno-list.txt',
370         command : [generate_errno_list, cpp],
371         capture : true)
372
373 generated_gperf_headers = []
374 #if 0 /// elogind has only the cap and errno list.
375 # foreach item : [['af',     af_list_txt,     'af',         ''],
376 #                 ['arphrd', arphrd_list_txt, 'arphrd',     'ARPHRD_'],
377 #                 ['cap',    cap_list_txt,    'capability', ''],
378 #                 ['errno',  errno_list_txt,  'errno',      '']]
379 #else
380 foreach item : [['cap',    cap_list_txt,    'capability', ''],
381                 ['errno',  errno_list_txt,  'errno',      '']]
382 #endif // 0
383
384         fname = '@0@-from-name.gperf'.format(item[0])
385         gperf_file = custom_target(
386                 fname,
387                 input : item[1],
388                 output : fname,
389                 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
390                 capture : true)
391
392         fname = '@0@-from-name.h'.format(item[0])
393         target1 = custom_target(
394                 fname,
395                 input : gperf_file,
396                 output : fname,
397                 command : [gperf,
398                            '-L', 'ANSI-C', '-t', '--ignore-case',
399                            '-N', 'lookup_@0@'.format(item[2]),
400                            '-H', 'hash_@0@_name'.format(item[2]),
401                            '-p', '-C',
402                            '@INPUT@'],
403                 capture : true)
404
405         fname = '@0@-to-name.h'.format(item[0])
406         awkscript = '@0@-to-name.awk'.format(item[0])
407         target2 = custom_target(
408                 fname,
409                 input : [awkscript, item[1]],
410                 output : fname,
411                 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
412                 capture : true)
413
414         generated_gperf_headers += [target1, target2]
415 endforeach
416
417 basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers
418
419 libbasic = static_library(
420         'basic',
421         basic_sources,
422         include_directories : includes,
423         dependencies : [threads,
424                         libcap,
425 #if 0 /// no blkid in elogind
426 #                         libblkid,
427 #endif // 0
428                         libselinux,
429                        ],
430         install : false)