]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
124a3e9f847edd9423331f1ef7ef9b8a80106d71
[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 umask-util.h
163 unaligned.h
164 unit-def.c
165 unit-def.h
166 unit-name.c
167 unit-name.h
168 user-util.c
169 user-util.h
170 utf8.c
171 utf8.h
172 util.c
173 util.h
174 virt.c
175 virt.h
176 xattr-util.c
177 xattr-util.h
178 '''.split())
179
180 missing_h = files('missing.h')
181
182 generate_af_list = find_program('generate-af-list.sh')
183 af_list_txt = custom_target(
184 'af-list.txt',
185 output : 'af-list.txt',
186 command : [generate_af_list, cpp],
187 capture : true)
188
189 generate_arphrd_list = find_program('generate-arphrd-list.sh')
190 arphrd_list_txt = custom_target(
191 'arphrd-list.txt',
192 output : 'arphrd-list.txt',
193 command : [generate_arphrd_list, cpp],
194 capture : true)
195
196 generate_cap_list = find_program('generate-cap-list.sh')
197 cap_list_txt = custom_target(
198 'cap-list.txt',
199 output : 'cap-list.txt',
200 command : [generate_cap_list, cpp, config_h, missing_h],
201 capture : true)
202
203 generate_errno_list = find_program('generate-errno-list.sh')
204 errno_list_txt = custom_target(
205 'errno-list.txt',
206 output : 'errno-list.txt',
207 command : [generate_errno_list, cpp],
208 capture : true)
209
210 generated_gperf_headers = []
211 foreach item : [['af', af_list_txt, 'af', ''],
212 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
213 ['cap', cap_list_txt, 'capability', ''],
214 ['errno', errno_list_txt, 'errno', '']]
215
216 fname = '@0@-from-name.gperf'.format(item[0])
217 gperf_file = custom_target(
218 fname,
219 input : item[1],
220 output : fname,
221 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
222 capture : true)
223
224 fname = '@0@-from-name.h'.format(item[0])
225 target1 = custom_target(
226 fname,
227 input : gperf_file,
228 output : fname,
229 command : [gperf,
230 '-L', 'ANSI-C', '-t', '--ignore-case',
231 '-N', 'lookup_@0@'.format(item[2]),
232 '-H', 'hash_@0@_name'.format(item[2]),
233 '-p', '-C',
234 '@INPUT@'],
235 capture : true)
236
237 fname = '@0@-to-name.h'.format(item[0])
238 awkscript = '@0@-to-name.awk'.format(item[0])
239 target2 = custom_target(
240 fname,
241 input : [awkscript, item[1]],
242 output : fname,
243 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
244 capture : true)
245
246 generated_gperf_headers += [target1, target2]
247 endforeach
248
249 basic_sources += [missing_h] + generated_gperf_headers
250 basic_gcrypt_sources = files(
251 'gcrypt-util.c',
252 'gcrypt-util.h')
253
254 libbasic = static_library(
255 'basic',
256 basic_sources,
257 include_directories : includes,
258 dependencies : [threads,
259 libcap,
260 libselinux,
261 libm],
262 c_args : ['-fvisibility=default'],
263 install : false)
264
265 # A convenience library that is separate from libbasic to avoid
266 # unnecessary linking to libgcrypt.
267 libbasic_gcrypt = static_library(
268 'basic-gcrypt',
269 basic_gcrypt_sources,
270 include_directories : includes,
271 dependencies : [libgcrypt],
272 c_args : ['-fvisibility=default'])