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