]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/meson.build
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / basic / meson.build
CommitLineData
3a726fcd 1# SPDX-License-Identifier: LGPL-2.1+
3a726fcd 2
2d4ceca8 3basic_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-util.c
21 btrfs-util.h
22 build.h
23 bus-label.c
24 bus-label.h
37efbbd8
ZJS
25 cap-list.c
26 cap-list.h
71e5200f
DM
27 capability-util.c
28 capability-util.h
37efbbd8
ZJS
29 cgroup-util.c
30 cgroup-util.h
31 chattr-util.c
32 chattr-util.h
37efbbd8
ZJS
33 conf-files.c
34 conf-files.h
35 copy.c
36 copy.h
37efbbd8
ZJS
37 def.h
38 device-nodes.c
39 device-nodes.h
40 dirent-util.c
41 dirent-util.h
686d13b9
LP
42 env-file.c
43 env-file.h
37efbbd8
ZJS
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
37efbbd8
ZJS
52 extract-word.c
53 extract-word.h
54 fd-util.c
55 fd-util.h
71e5200f
DM
56 fileio.c
57 fileio.h
37efbbd8
ZJS
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
37efbbd8
ZJS
75 io-util.c
76 io-util.h
71e5200f 77 ioprio.h
37efbbd8
ZJS
78 khash.c
79 khash.h
80 label.c
81 label.h
82 list.h
83 locale-util.c
84 locale-util.h
37efbbd8
ZJS
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
18bf324a 94 missing.h
0e7117d0 95 missing_audit.h
b9683baf
YW
96 missing_btrfs.h
97 missing_btrfs_tree.h
8ca2702f 98 missing_capability.h
5b139f86 99 missing_drm.h
475c18f0 100 missing_ethtool.h
dea72eda 101 missing_fcntl.h
475c18f0
YW
102 missing_fib_rules.h
103 missing_fou.h
503f480f 104 missing_fs.h
475c18f0
YW
105 missing_if_bridge.h
106 missing_if_link.h
107 missing_if_tunnel.h
31c2ddab 108 missing_input.h
d7276b61 109 missing_keyctl.h
1e54f0ab 110 missing_magic.h
c8a363eb 111 missing_mman.h
475c18f0 112 missing_network.h
2a03bb3e 113 missing_prctl.h
b19bb111 114 missing_random.h
6c76de27 115 missing_resource.h
22332e33 116 missing_sched.h
3843e826 117 missing_securebits.h
66ffbdf9 118 missing_socket.h
e01819f8 119 missing_stat.h
470f348b 120 missing_stdlib.h
37efbbd8 121 missing_syscall.h
d7330b60 122 missing_timerfd.h
38e0c63d 123 missing_type.h
475c18f0 124 missing_vxcan.h
71e5200f 125 mkdir-label.c
37efbbd8
ZJS
126 mkdir.c
127 mkdir.h
049af8ad
ZJS
128 mountpoint-util.c
129 mountpoint-util.h
37efbbd8
ZJS
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
9aef9a67
LP
143 procfs-util.c
144 procfs-util.h
37efbbd8
ZJS
145 random-util.c
146 random-util.h
147 ratelimit.c
148 ratelimit.h
149 raw-clone.h
c52a937b 150 raw-reboot.h
37efbbd8
ZJS
151 refcnt.h
152 replace-var.c
153 replace-var.h
3c069cda
LP
154 rlimit-util.c
155 rlimit-util.h
37efbbd8
ZJS
156 rm-rf.c
157 rm-rf.h
37efbbd8
ZJS
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
67e16c31 176 static-destruct.h
37efbbd8
ZJS
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
e4de7287
LP
194 tmpfile-util.c
195 tmpfile-util.h
37efbbd8
ZJS
196 umask-util.h
197 unaligned.h
523578aa
LP
198 unit-def.c
199 unit-def.h
18c528e9
LP
200 unit-name.c
201 unit-name.h
37efbbd8
ZJS
202 user-util.c
203 user-util.h
204 utf8.c
205 utf8.h
206 util.c
207 util.h
37efbbd8
ZJS
208 virt.c
209 virt.h
37efbbd8
ZJS
210 xattr-util.c
211 xattr-util.h
5c23128d
ZJS
212'''.split())
213
18bf324a 214missing_audit_h = files('missing_audit.h')
54480d64 215missing_capability_h = files('missing_capability.h')
0b7d48f5
YW
216missing_network_h = files('missing_network.h')
217missing_socket_h = files('missing_socket.h')
5c23128d 218
5c23128d
ZJS
219generate_af_list = find_program('generate-af-list.sh')
220af_list_txt = custom_target(
37efbbd8
ZJS
221 'af-list.txt',
222 output : 'af-list.txt',
0b7d48f5 223 command : [generate_af_list, cpp, config_h, missing_socket_h],
37efbbd8 224 capture : true)
5c23128d
ZJS
225
226generate_arphrd_list = find_program('generate-arphrd-list.sh')
227arphrd_list_txt = custom_target(
37efbbd8
ZJS
228 'arphrd-list.txt',
229 output : 'arphrd-list.txt',
0b7d48f5 230 command : [generate_arphrd_list, cpp, config_h, missing_network_h],
37efbbd8 231 capture : true)
5c23128d
ZJS
232
233generate_cap_list = find_program('generate-cap-list.sh')
234cap_list_txt = custom_target(
37efbbd8
ZJS
235 'cap-list.txt',
236 output : 'cap-list.txt',
54480d64 237 command : [generate_cap_list, cpp, config_h, missing_capability_h],
37efbbd8 238 capture : true)
5c23128d
ZJS
239
240generate_errno_list = find_program('generate-errno-list.sh')
241errno_list_txt = custom_target(
37efbbd8
ZJS
242 'errno-list.txt',
243 output : 'errno-list.txt',
244 command : [generate_errno_list, cpp],
245 capture : true)
5c23128d
ZJS
246
247generated_gperf_headers = []
248foreach item : [['af', af_list_txt, 'af', ''],
249 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
250 ['cap', cap_list_txt, 'capability', ''],
7b5e750d 251 ['errno', errno_list_txt, 'errno', '']]
5c23128d 252
37efbbd8
ZJS
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)
5c23128d 260
37efbbd8
ZJS
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)
5c23128d 273
37efbbd8
ZJS
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)
5c23128d 282
37efbbd8 283 generated_gperf_headers += [target1, target2]
5c23128d
ZJS
284endforeach
285
18bf324a 286basic_sources += generated_gperf_headers
975464e0
ZJS
287basic_gcrypt_sources = files(
288 'gcrypt-util.c',
289 'gcrypt-util.h')
5c23128d
ZJS
290
291libbasic = static_library(
37efbbd8
ZJS
292 'basic',
293 basic_sources,
294 include_directories : includes,
d1084aa2
LT
295 dependencies : [versiondep,
296 threads,
37efbbd8 297 libcap,
cd0b6c53
LP
298 libselinux,
299 libm],
2d4ceca8 300 c_args : ['-fvisibility=default'],
37efbbd8 301 install : false)
34e221a5
ZJS
302
303# A convenience library that is separate from libbasic to avoid
304# unnecessary linking to libgcrypt.
305libbasic_gcrypt = static_library(
306 'basic-gcrypt',
975464e0 307 basic_gcrypt_sources,
34e221a5
ZJS
308 include_directories : includes,
309 dependencies : [libgcrypt],
310 c_args : ['-fvisibility=default'])