]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
96b2fb93 | 3 | # Copyright © 2017 Zbigniew Jędrzejewski-Szmek |
3a726fcd | 4 | |
2d4ceca8 | 5 | basic_sources = files(''' |
71e5200f DM |
6 | MurmurHash2.c |
7 | MurmurHash2.h | |
37efbbd8 ZJS |
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 | |
18c528e9 LP |
25 | blockdev-util.c |
26 | blockdev-util.h | |
71e5200f DM |
27 | bpf-program.c |
28 | bpf-program.h | |
37efbbd8 ZJS |
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 | |
37efbbd8 ZJS |
37 | cap-list.c |
38 | cap-list.h | |
71e5200f DM |
39 | capability-util.c |
40 | capability-util.h | |
37efbbd8 ZJS |
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 | |
691c2e2e | 53 | crypt-util.c |
294bd454 | 54 | crypt-util.h |
37efbbd8 ZJS |
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 | |
37efbbd8 ZJS |
76 | fileio-label.c |
77 | fileio-label.h | |
71e5200f DM |
78 | fileio.c |
79 | fileio.h | |
1960e736 LP |
80 | format-table.c |
81 | format-table.h | |
37efbbd8 ZJS |
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 | |
37efbbd8 ZJS |
99 | io-util.c |
100 | io-util.h | |
71e5200f | 101 | ioprio.h |
37efbbd8 ZJS |
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 | |
71e5200f | 123 | mkdir-label.c |
37efbbd8 ZJS |
124 | mkdir.c |
125 | mkdir.h | |
232ac0d6 | 126 | module-util.h |
37efbbd8 ZJS |
127 | mount-util.c |
128 | mount-util.h | |
37efbbd8 ZJS |
129 | nss-util.h |
130 | ordered-set.c | |
131 | ordered-set.h | |
a89e30ec LP |
132 | pager.c |
133 | pager.h | |
d58ad743 LP |
134 | os-util.c |
135 | os-util.h | |
37efbbd8 ZJS |
136 | parse-util.c |
137 | parse-util.h | |
138 | path-util.c | |
139 | path-util.h | |
140 | prioq.c | |
141 | prioq.h | |
142 | proc-cmdline.c | |
143 | proc-cmdline.h | |
144 | process-util.c | |
145 | process-util.h | |
9aef9a67 LP |
146 | procfs-util.c |
147 | procfs-util.h | |
37efbbd8 ZJS |
148 | random-util.c |
149 | random-util.h | |
150 | ratelimit.c | |
151 | ratelimit.h | |
152 | raw-clone.h | |
c52a937b | 153 | raw-reboot.h |
e3631d1c LP |
154 | reboot-util.c |
155 | reboot-util.h | |
37efbbd8 ZJS |
156 | refcnt.h |
157 | replace-var.c | |
158 | replace-var.h | |
159 | rlimit-util.c | |
160 | rlimit-util.h | |
161 | rm-rf.c | |
162 | rm-rf.h | |
07d46372 YW |
163 | securebits-util.c |
164 | securebits-util.h | |
71e5200f | 165 | securebits.h |
37efbbd8 ZJS |
166 | selinux-util.c |
167 | selinux-util.h | |
168 | set.h | |
169 | sigbus.c | |
170 | sigbus.h | |
171 | signal-util.c | |
172 | signal-util.h | |
173 | siphash24.c | |
174 | siphash24.h | |
175 | smack-util.c | |
176 | smack-util.h | |
177 | socket-label.c | |
e045e325 YW |
178 | socket-protocol-list.c |
179 | socket-protocol-list.h | |
37efbbd8 ZJS |
180 | socket-util.c |
181 | socket-util.h | |
182 | sparse-endian.h | |
183 | special.h | |
184 | stat-util.c | |
185 | stat-util.h | |
186 | stdio-util.h | |
187 | strbuf.c | |
188 | strbuf.h | |
189 | string-table.c | |
190 | string-table.h | |
191 | string-util.c | |
192 | string-util.h | |
193 | strv.c | |
194 | strv.h | |
195 | strxcpyx.c | |
196 | strxcpyx.h | |
197 | syslog-util.c | |
198 | syslog-util.h | |
199 | terminal-util.c | |
200 | terminal-util.h | |
201 | time-util.c | |
202 | time-util.h | |
203 | umask-util.h | |
204 | unaligned.h | |
523578aa LP |
205 | unit-def.c |
206 | unit-def.h | |
18c528e9 LP |
207 | unit-name.c |
208 | unit-name.h | |
37efbbd8 ZJS |
209 | user-util.c |
210 | user-util.h | |
211 | utf8.c | |
212 | utf8.h | |
213 | util.c | |
214 | util.h | |
215 | verbs.c | |
216 | verbs.h | |
217 | virt.c | |
218 | virt.h | |
219 | web-util.c | |
220 | web-util.h | |
221 | xattr-util.c | |
222 | xattr-util.h | |
223 | xml.c | |
224 | xml.h | |
5c23128d ZJS |
225 | '''.split()) |
226 | ||
227 | missing_h = files('missing.h') | |
228 | ||
229 | generate_gperfs = find_program('generate-gperfs.py') | |
230 | ||
231 | generate_af_list = find_program('generate-af-list.sh') | |
232 | af_list_txt = custom_target( | |
37efbbd8 ZJS |
233 | 'af-list.txt', |
234 | output : 'af-list.txt', | |
235 | command : [generate_af_list, cpp], | |
236 | capture : true) | |
5c23128d ZJS |
237 | |
238 | generate_arphrd_list = find_program('generate-arphrd-list.sh') | |
239 | arphrd_list_txt = custom_target( | |
37efbbd8 ZJS |
240 | 'arphrd-list.txt', |
241 | output : 'arphrd-list.txt', | |
242 | command : [generate_arphrd_list, cpp], | |
243 | capture : true) | |
5c23128d ZJS |
244 | |
245 | generate_cap_list = find_program('generate-cap-list.sh') | |
246 | cap_list_txt = custom_target( | |
37efbbd8 ZJS |
247 | 'cap-list.txt', |
248 | output : 'cap-list.txt', | |
249 | command : [generate_cap_list, cpp, config_h, missing_h], | |
250 | capture : true) | |
5c23128d ZJS |
251 | |
252 | generate_errno_list = find_program('generate-errno-list.sh') | |
253 | errno_list_txt = custom_target( | |
37efbbd8 ZJS |
254 | 'errno-list.txt', |
255 | output : 'errno-list.txt', | |
256 | command : [generate_errno_list, cpp], | |
257 | capture : true) | |
5c23128d | 258 | |
e045e325 YW |
259 | generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh') |
260 | socket_protocol_list_txt = custom_target( | |
261 | 'socket-protocol-list.txt', | |
262 | output : 'socket-protocol-list.txt', | |
263 | command : [generate_socket_protocol_list, cpp], | |
264 | capture : true) | |
265 | ||
5c23128d ZJS |
266 | generated_gperf_headers = [] |
267 | foreach item : [['af', af_list_txt, 'af', ''], | |
268 | ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'], | |
269 | ['cap', cap_list_txt, 'capability', ''], | |
e045e325 YW |
270 | ['errno', errno_list_txt, 'errno', ''], |
271 | ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']] | |
5c23128d | 272 | |
37efbbd8 ZJS |
273 | fname = '@0@-from-name.gperf'.format(item[0]) |
274 | gperf_file = custom_target( | |
275 | fname, | |
276 | input : item[1], | |
277 | output : fname, | |
278 | command : [generate_gperfs, item[2], item[3], '@INPUT@'], | |
279 | capture : true) | |
5c23128d | 280 | |
37efbbd8 ZJS |
281 | fname = '@0@-from-name.h'.format(item[0]) |
282 | target1 = custom_target( | |
283 | fname, | |
284 | input : gperf_file, | |
285 | output : fname, | |
286 | command : [gperf, | |
287 | '-L', 'ANSI-C', '-t', '--ignore-case', | |
288 | '-N', 'lookup_@0@'.format(item[2]), | |
289 | '-H', 'hash_@0@_name'.format(item[2]), | |
290 | '-p', '-C', | |
291 | '@INPUT@'], | |
292 | capture : true) | |
5c23128d | 293 | |
37efbbd8 ZJS |
294 | fname = '@0@-to-name.h'.format(item[0]) |
295 | awkscript = '@0@-to-name.awk'.format(item[0]) | |
296 | target2 = custom_target( | |
297 | fname, | |
298 | input : [awkscript, item[1]], | |
299 | output : fname, | |
300 | command : [awk, '-f', '@INPUT0@', '@INPUT1@'], | |
301 | capture : true) | |
5c23128d | 302 | |
37efbbd8 | 303 | generated_gperf_headers += [target1, target2] |
5c23128d ZJS |
304 | endforeach |
305 | ||
2d4ceca8 | 306 | basic_sources += [missing_h] + generated_gperf_headers |
975464e0 ZJS |
307 | basic_gcrypt_sources = files( |
308 | 'gcrypt-util.c', | |
309 | 'gcrypt-util.h') | |
5c23128d ZJS |
310 | |
311 | libbasic = static_library( | |
37efbbd8 ZJS |
312 | 'basic', |
313 | basic_sources, | |
314 | include_directories : includes, | |
315 | dependencies : [threads, | |
316 | libcap, | |
317 | libblkid, | |
9e7f941a | 318 | libmount, |
2d4ceca8 ZJS |
319 | libselinux], |
320 | c_args : ['-fvisibility=default'], | |
37efbbd8 | 321 | install : false) |
34e221a5 ZJS |
322 | |
323 | # A convenience library that is separate from libbasic to avoid | |
324 | # unnecessary linking to libgcrypt. | |
325 | libbasic_gcrypt = static_library( | |
326 | 'basic-gcrypt', | |
975464e0 | 327 | basic_gcrypt_sources, |
34e221a5 ZJS |
328 | include_directories : includes, |
329 | dependencies : [libgcrypt], | |
330 | c_args : ['-fvisibility=default']) |