chiark / gitweb /
7aff69b11759c41649ab9a5fd17a13b5e86ed322
[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         cgroup-util.h
214         conf-files.c
215         conf-files.h
216         copy.c
217         copy.h
218         def.h
219         dirent-util.c
220         dirent-util.h
221         env-util.c
222         env-util.h
223         errno-list.c
224         errno-list.h
225         escape.c
226         escape.h
227         exec-util.c
228         exec-util.h
229         extract-word.c
230         extract-word.h
231         fd-util.c
232         fd-util.h
233         fileio.c
234         fileio.h
235         fileio-label.c
236         fileio-label.h
237         format-util.h
238         fs-util.c
239         fs-util.h
240         gunicode.c
241         gunicode.h
242         hash-funcs.c
243         hash-funcs.h
244         hashmap.c
245         hashmap.h
246         hexdecoct.c
247         hexdecoct.h
248         hostname-util.c
249         hostname-util.h
250         io-util.c
251         io-util.h
252         khash.c
253         khash.h
254         label.c
255         label.h
256         list.h
257         locale-util.c
258         locale-util.h
259         log.c
260         log.h
261         login-util.c
262         login-util.h
263         macro.h
264         memfd-util.c
265         memfd-util.h
266         mempool.c
267         mempool.h
268         missing_syscall.h
269         mkdir.c
270         mkdir.h
271         mkdir-label.c
272         mount-util.c
273         mount-util.h
274         parse-printf-format.c
275         parse-printf-format.h
276         parse-util.c
277         parse-util.h
278         path-util.c
279         path-util.h
280         prioq.c
281         prioq.h
282         proc-cmdline.c
283         proc-cmdline.h
284         process-util.c
285         process-util.h
286         random-util.c
287         random-util.h
288         refcnt.h
289         rm-rf.c
290         rm-rf.h
291         selinux-util.c
292         selinux-util.h
293         set.h
294         signal-util.c
295         signal-util.h
296         siphash24.c
297         siphash24.h
298         smack-util.c
299         smack-util.h
300         socket-util.c
301         socket-util.h
302         sparse-endian.h
303         stat-util.c
304         stat-util.h
305         stdio-util.h
306         string-table.c
307         string-table.h
308         string-util.c
309         string-util.h
310         strv.c
311         strv.h
312         syslog-util.c
313         syslog-util.h
314         terminal-util.c
315         terminal-util.h
316         time-util.c
317         time-util.h
318         umask-util.h
319         unaligned.h
320         unit-name.c
321         unit-name.h
322         user-util.c
323         user-util.h
324         utf8.c
325         utf8.h
326         util.c
327         util.h
328         verbs.c
329         verbs.h
330         virt.c
331         virt.h
332         xattr-util.c
333         xattr-util.h
334 '''.split())
335 #endif // 0
336
337 missing_h = files('missing.h')
338
339 generate_gperfs = find_program('generate-gperfs.py')
340
341 #if 0 /// elogind has only the errno list.
342 # generate_af_list = find_program('generate-af-list.sh')
343 # af_list_txt = custom_target(
344 #         'af-list.txt',
345 #         output : 'af-list.txt',
346 #         command : [generate_af_list, cpp],
347 #         capture : true)
348
349 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
350 # arphrd_list_txt = custom_target(
351 #         'arphrd-list.txt',
352 #         output : 'arphrd-list.txt',
353 #         command : [generate_arphrd_list, cpp],
354 #         capture : true)
355
356 # generate_cap_list = find_program('generate-cap-list.sh')
357 # cap_list_txt = custom_target(
358 #         'cap-list.txt',
359 #         output : 'cap-list.txt',
360 #         command : [generate_cap_list, cpp, config_h, missing_h],
361 #         capture : true)
362 #endif // 0
363
364 generate_errno_list = find_program('generate-errno-list.sh')
365 errno_list_txt = custom_target(
366         'errno-list.txt',
367         output : 'errno-list.txt',
368         command : [generate_errno_list, cpp],
369         capture : true)
370
371 generated_gperf_headers = []
372 #if 0 /// elogind has only the errno list.
373 # foreach item : [['af',     af_list_txt,     'af',         ''],
374 #                 ['arphrd', arphrd_list_txt, 'arphrd',     'ARPHRD_'],
375 #                 ['cap',    cap_list_txt,    'capability', ''],
376 #                 ['errno',  errno_list_txt,  'errno',      '']]
377 #else
378 foreach item : [['errno',  errno_list_txt,  'errno',      '']]
379 #endif // 0
380
381         fname = '@0@-from-name.gperf'.format(item[0])
382         gperf_file = custom_target(
383                 fname,
384                 input : item[1],
385                 output : fname,
386                 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
387                 capture : true)
388
389         fname = '@0@-from-name.h'.format(item[0])
390         target1 = custom_target(
391                 fname,
392                 input : gperf_file,
393                 output : fname,
394                 command : [gperf,
395                            '-L', 'ANSI-C', '-t', '--ignore-case',
396                            '-N', 'lookup_@0@'.format(item[2]),
397                            '-H', 'hash_@0@_name'.format(item[2]),
398                            '-p', '-C',
399                            '@INPUT@'],
400                 capture : true)
401
402         fname = '@0@-to-name.h'.format(item[0])
403         awkscript = '@0@-to-name.awk'.format(item[0])
404         target2 = custom_target(
405                 fname,
406                 input : [awkscript, item[1]],
407                 output : fname,
408                 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
409                 capture : true)
410
411         generated_gperf_headers += [target1, target2]
412 endforeach
413
414 basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers
415
416 libbasic = static_library(
417         'basic',
418         basic_sources,
419         include_directories : includes,
420         dependencies : [threads,
421                         libcap,
422 #if 0 /// no blkid in elogind
423 #                         libblkid,
424 #endif // 0
425                         libselinux,
426                        ],
427         install : false)