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