]>
Commit | Line | Data |
---|---|---|
3a726fcd | 1 | # SPDX-License-Identifier: LGPL-2.1+ |
3a726fcd | 2 | |
2d4ceca8 | 3 | basic_sources = files(''' |
71e5200f DM |
4 | MurmurHash2.c |
5 | MurmurHash2.h | |
37efbbd8 ZJS |
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 | |
18c528e9 LP |
18 | blockdev-util.c |
19 | blockdev-util.h | |
37efbbd8 ZJS |
20 | btrfs-ctree.h |
21 | btrfs-util.c | |
22 | btrfs-util.h | |
23 | build.h | |
24 | bus-label.c | |
25 | bus-label.h | |
37efbbd8 ZJS |
26 | cap-list.c |
27 | cap-list.h | |
71e5200f DM |
28 | capability-util.c |
29 | capability-util.h | |
37efbbd8 ZJS |
30 | cgroup-util.c |
31 | cgroup-util.h | |
32 | chattr-util.c | |
33 | chattr-util.h | |
37efbbd8 ZJS |
34 | conf-files.c |
35 | conf-files.h | |
36 | copy.c | |
37 | copy.h | |
37efbbd8 ZJS |
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 | |
37efbbd8 ZJS |
51 | extract-word.c |
52 | extract-word.h | |
53 | fd-util.c | |
54 | fd-util.h | |
71e5200f DM |
55 | fileio.c |
56 | fileio.h | |
37efbbd8 ZJS |
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 | |
37efbbd8 ZJS |
74 | io-util.c |
75 | io-util.h | |
71e5200f | 76 | ioprio.h |
37efbbd8 ZJS |
77 | khash.c |
78 | khash.h | |
79 | label.c | |
80 | label.h | |
81 | list.h | |
82 | locale-util.c | |
83 | locale-util.h | |
37efbbd8 ZJS |
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 | |
71e5200f | 94 | mkdir-label.c |
37efbbd8 ZJS |
95 | mkdir.c |
96 | mkdir.h | |
37efbbd8 ZJS |
97 | mount-util.c |
98 | mount-util.h | |
37efbbd8 ZJS |
99 | nss-util.h |
100 | ordered-set.c | |
101 | ordered-set.h | |
a6484177 LP |
102 | pager.c |
103 | pager.h | |
37efbbd8 ZJS |
104 | parse-util.c |
105 | parse-util.h | |
106 | path-util.c | |
107 | path-util.h | |
108 | prioq.c | |
109 | prioq.h | |
110 | proc-cmdline.c | |
111 | proc-cmdline.h | |
112 | process-util.c | |
113 | process-util.h | |
9aef9a67 LP |
114 | procfs-util.c |
115 | procfs-util.h | |
37efbbd8 ZJS |
116 | random-util.c |
117 | random-util.h | |
118 | ratelimit.c | |
119 | ratelimit.h | |
120 | raw-clone.h | |
c52a937b | 121 | raw-reboot.h |
37efbbd8 ZJS |
122 | refcnt.h |
123 | replace-var.c | |
124 | replace-var.h | |
37efbbd8 ZJS |
125 | rm-rf.c |
126 | rm-rf.h | |
71e5200f | 127 | securebits.h |
37efbbd8 ZJS |
128 | selinux-util.c |
129 | selinux-util.h | |
130 | set.h | |
131 | sigbus.c | |
132 | sigbus.h | |
133 | signal-util.c | |
134 | signal-util.h | |
135 | siphash24.c | |
136 | siphash24.h | |
137 | smack-util.c | |
138 | smack-util.h | |
139 | socket-label.c | |
140 | socket-util.c | |
141 | socket-util.h | |
142 | sparse-endian.h | |
143 | special.h | |
144 | stat-util.c | |
145 | stat-util.h | |
67e16c31 | 146 | static-destruct.h |
37efbbd8 ZJS |
147 | stdio-util.h |
148 | strbuf.c | |
149 | strbuf.h | |
150 | string-table.c | |
151 | string-table.h | |
152 | string-util.c | |
153 | string-util.h | |
154 | strv.c | |
155 | strv.h | |
156 | strxcpyx.c | |
157 | strxcpyx.h | |
158 | syslog-util.c | |
159 | syslog-util.h | |
160 | terminal-util.c | |
161 | terminal-util.h | |
162 | time-util.c | |
163 | time-util.h | |
164 | umask-util.h | |
165 | unaligned.h | |
523578aa LP |
166 | unit-def.c |
167 | unit-def.h | |
18c528e9 LP |
168 | unit-name.c |
169 | unit-name.h | |
37efbbd8 ZJS |
170 | user-util.c |
171 | user-util.h | |
172 | utf8.c | |
173 | utf8.h | |
174 | util.c | |
175 | util.h | |
37efbbd8 ZJS |
176 | virt.c |
177 | virt.h | |
37efbbd8 ZJS |
178 | xattr-util.c |
179 | xattr-util.h | |
5c23128d ZJS |
180 | '''.split()) |
181 | ||
182 | missing_h = files('missing.h') | |
183 | ||
184 | generate_gperfs = find_program('generate-gperfs.py') | |
185 | ||
186 | generate_af_list = find_program('generate-af-list.sh') | |
187 | af_list_txt = custom_target( | |
37efbbd8 ZJS |
188 | 'af-list.txt', |
189 | output : 'af-list.txt', | |
190 | command : [generate_af_list, cpp], | |
191 | capture : true) | |
5c23128d ZJS |
192 | |
193 | generate_arphrd_list = find_program('generate-arphrd-list.sh') | |
194 | arphrd_list_txt = custom_target( | |
37efbbd8 ZJS |
195 | 'arphrd-list.txt', |
196 | output : 'arphrd-list.txt', | |
197 | command : [generate_arphrd_list, cpp], | |
198 | capture : true) | |
5c23128d ZJS |
199 | |
200 | generate_cap_list = find_program('generate-cap-list.sh') | |
201 | cap_list_txt = custom_target( | |
37efbbd8 ZJS |
202 | 'cap-list.txt', |
203 | output : 'cap-list.txt', | |
204 | command : [generate_cap_list, cpp, config_h, missing_h], | |
205 | capture : true) | |
5c23128d ZJS |
206 | |
207 | generate_errno_list = find_program('generate-errno-list.sh') | |
208 | errno_list_txt = custom_target( | |
37efbbd8 ZJS |
209 | 'errno-list.txt', |
210 | output : 'errno-list.txt', | |
211 | command : [generate_errno_list, cpp], | |
212 | capture : true) | |
5c23128d | 213 | |
e045e325 YW |
214 | generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh') |
215 | socket_protocol_list_txt = custom_target( | |
216 | 'socket-protocol-list.txt', | |
217 | output : 'socket-protocol-list.txt', | |
218 | command : [generate_socket_protocol_list, cpp], | |
219 | capture : true) | |
220 | ||
5c23128d ZJS |
221 | generated_gperf_headers = [] |
222 | foreach item : [['af', af_list_txt, 'af', ''], | |
223 | ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'], | |
224 | ['cap', cap_list_txt, 'capability', ''], | |
e045e325 YW |
225 | ['errno', errno_list_txt, 'errno', ''], |
226 | ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']] | |
5c23128d | 227 | |
37efbbd8 ZJS |
228 | fname = '@0@-from-name.gperf'.format(item[0]) |
229 | gperf_file = custom_target( | |
230 | fname, | |
231 | input : item[1], | |
232 | output : fname, | |
233 | command : [generate_gperfs, item[2], item[3], '@INPUT@'], | |
234 | capture : true) | |
5c23128d | 235 | |
37efbbd8 ZJS |
236 | fname = '@0@-from-name.h'.format(item[0]) |
237 | target1 = custom_target( | |
238 | fname, | |
239 | input : gperf_file, | |
240 | output : fname, | |
241 | command : [gperf, | |
242 | '-L', 'ANSI-C', '-t', '--ignore-case', | |
243 | '-N', 'lookup_@0@'.format(item[2]), | |
244 | '-H', 'hash_@0@_name'.format(item[2]), | |
245 | '-p', '-C', | |
246 | '@INPUT@'], | |
247 | capture : true) | |
5c23128d | 248 | |
37efbbd8 ZJS |
249 | fname = '@0@-to-name.h'.format(item[0]) |
250 | awkscript = '@0@-to-name.awk'.format(item[0]) | |
251 | target2 = custom_target( | |
252 | fname, | |
253 | input : [awkscript, item[1]], | |
254 | output : fname, | |
255 | command : [awk, '-f', '@INPUT0@', '@INPUT1@'], | |
256 | capture : true) | |
5c23128d | 257 | |
37efbbd8 | 258 | generated_gperf_headers += [target1, target2] |
5c23128d ZJS |
259 | endforeach |
260 | ||
2d4ceca8 | 261 | basic_sources += [missing_h] + generated_gperf_headers |
975464e0 ZJS |
262 | basic_gcrypt_sources = files( |
263 | 'gcrypt-util.c', | |
264 | 'gcrypt-util.h') | |
5c23128d ZJS |
265 | |
266 | libbasic = static_library( | |
37efbbd8 ZJS |
267 | 'basic', |
268 | basic_sources, | |
269 | include_directories : includes, | |
270 | dependencies : [threads, | |
271 | libcap, | |
272 | libblkid, | |
9e7f941a | 273 | libmount, |
cd0b6c53 LP |
274 | libselinux, |
275 | libm], | |
2d4ceca8 | 276 | c_args : ['-fvisibility=default'], |
37efbbd8 | 277 | install : false) |
34e221a5 ZJS |
278 | |
279 | # A convenience library that is separate from libbasic to avoid | |
280 | # unnecessary linking to libgcrypt. | |
281 | libbasic_gcrypt = static_library( | |
282 | 'basic-gcrypt', | |
975464e0 | 283 | basic_gcrypt_sources, |
34e221a5 ZJS |
284 | include_directories : includes, |
285 | dependencies : [libgcrypt], | |
286 | c_args : ['-fvisibility=default']) |