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