]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/meson.build
Update version and finalize NEWS for 256~rc4
[thirdparty/systemd.git] / src / basic / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 basic_sources = files(
4 'MurmurHash2.c',
5 'af-list.c',
6 'alloc-util.c',
7 'architecture.c',
8 'argv-util.c',
9 'arphrd-util.c',
10 'audit-util.c',
11 'btrfs.c',
12 'build.c',
13 'build-path.c',
14 'bus-label.c',
15 'cap-list.c',
16 'capability-util.c',
17 'cgroup-util.c',
18 'chase.c',
19 'chattr-util.c',
20 'compress.c',
21 'conf-files.c',
22 'confidential-virt.c',
23 'devnum-util.c',
24 'dirent-util.c',
25 'dlfcn-util.c',
26 'efivars.c',
27 'env-file.c',
28 'env-util.c',
29 'errno-list.c',
30 'escape.c',
31 'ether-addr-util.c',
32 'extract-word.c',
33 'fd-util.c',
34 'fileio.c',
35 'filesystems.c',
36 'format-util.c',
37 'fs-util.c',
38 'gcrypt-util.c',
39 'glob-util.c',
40 'glyph-util.c',
41 'gunicode.c',
42 'hash-funcs.c',
43 'hashmap.c',
44 'hexdecoct.c',
45 'hmac.c',
46 'hostname-util.c',
47 'in-addr-util.c',
48 'initrd-util.c',
49 'inotify-util.c',
50 'io-util.c',
51 'ioprio-util.c',
52 'iovec-util.c',
53 'iovec-wrapper.c',
54 'label.c',
55 'limits-util.c',
56 'locale-util.c',
57 'lock-util.c',
58 'log.c',
59 'login-util.c',
60 'keyring-util.c',
61 'memfd-util.c',
62 'memory-util.c',
63 'mempool.c',
64 'memstream-util.c',
65 'mkdir.c',
66 'mountpoint-util.c',
67 'namespace-util.c',
68 'nulstr-util.c',
69 'ordered-set.c',
70 'os-util.c',
71 'parse-util.c',
72 'path-lookup.c',
73 'path-util.c',
74 'percent-util.c',
75 'pidref.c',
76 'prioq.c',
77 'proc-cmdline.c',
78 'process-util.c',
79 'procfs-util.c',
80 'psi-util.c',
81 'random-util.c',
82 'ratelimit.c',
83 'recurse-dir.c',
84 'replace-var.c',
85 'rlimit-util.c',
86 'runtime-scope.c',
87 'sha256.c',
88 'sigbus.c',
89 'signal-util.c',
90 'siphash24.c',
91 'socket-util.c',
92 'sort-util.c',
93 'stat-util.c',
94 'strbuf.c',
95 'string-table.c',
96 'string-util.c',
97 'strv.c',
98 'strxcpyx.c',
99 'sync-util.c',
100 'sysctl-util.c',
101 'syslog-util.c',
102 'terminal-util.c',
103 'time-util.c',
104 'tmpfile-util.c',
105 'uid-classification.c',
106 'uid-range.c',
107 'unit-def.c',
108 'unit-file.c',
109 'unit-name.c',
110 'user-util.c',
111 'utf8.c',
112 'virt.c',
113 'xattr-util.c',
114 )
115
116 missing_audit_h = files('missing_audit.h')
117 missing_capability_h = files('missing_capability.h')
118 missing_socket_h = files('missing_socket.h')
119
120 missing_syscall_def_h = files('missing_syscall_def.h')
121 basic_sources += missing_syscall_def_h
122
123 generate_af_list = find_program('generate-af-list.sh')
124 af_list_txt = custom_target(
125 'af-list.txt',
126 output : 'af-list.txt',
127 command : [generate_af_list, cpp, config_h, missing_socket_h],
128 capture : true)
129
130 generate_arphrd_list = find_program('generate-arphrd-list.sh')
131 arphrd_list_txt = custom_target(
132 'arphrd-list.txt',
133 output : 'arphrd-list.txt',
134 command : [generate_arphrd_list, cpp, config_h],
135 capture : true)
136
137 generate_cap_list = find_program('generate-cap-list.sh')
138 cap_list_txt = custom_target(
139 'cap-list.txt',
140 output : 'cap-list.txt',
141 command : [generate_cap_list, cpp, config_h, missing_capability_h],
142 capture : true)
143
144 generate_errno_list = find_program('generate-errno-list.sh')
145 errno_list_txt = custom_target(
146 'errno-list.txt',
147 output : 'errno-list.txt',
148 command : [generate_errno_list, cpp],
149 capture : true)
150
151 generated_gperf_headers = []
152 foreach item : [['af', af_list_txt, 'af', ''],
153 ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
154 ['cap', cap_list_txt, 'capability', ''],
155 ['errno', errno_list_txt, 'errno', '']]
156
157 fname = '@0@-from-name.gperf'.format(item[0])
158 gperf_file = custom_target(
159 fname,
160 input : item[1],
161 output : fname,
162 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
163 capture : true)
164
165 fname = '@0@-from-name.h'.format(item[0])
166 target1 = custom_target(
167 fname,
168 input : gperf_file,
169 output : fname,
170 command : [gperf,
171 '-L', 'ANSI-C', '-t', '--ignore-case',
172 '-N', 'lookup_@0@'.format(item[2]),
173 '-H', 'hash_@0@_name'.format(item[2]),
174 '-p', '-C',
175 '@INPUT@'],
176 capture : true)
177
178 fname = '@0@-to-name.h'.format(item[0])
179 awkscript = '@0@-to-name.awk'.format(item[0])
180 target2 = custom_target(
181 fname,
182 input : [awkscript, item[1]],
183 output : fname,
184 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
185 capture : true)
186
187 generated_gperf_headers += [target1, target2]
188 endforeach
189
190 basic_sources += generated_gperf_headers
191
192 ############################################################
193
194 arch_list = [
195 'alpha',
196 'arc',
197 'arm',
198 'arm64',
199 'i386',
200 'ia64',
201 'loongarch64',
202 'm68k',
203 'mips64',
204 'mips64n32',
205 'mipso32',
206 'parisc',
207 'powerpc',
208 'powerpc64',
209 'riscv32',
210 'riscv64',
211 's390',
212 's390x',
213 'sparc',
214 'x86_64'
215 ]
216
217 run_target(
218 'update-syscall-tables',
219 command : [update_syscall_tables_sh, meson.current_source_dir()] + arch_list)
220
221 syscall_list_txt = files('syscall-list.txt')
222
223 syscall_lists = []
224 foreach arch: arch_list
225 syscall_lists += files('syscalls-@0@.txt'.format(arch))
226 endforeach
227
228 missing_syscalls_py = find_program('missing_syscalls.py')
229
230 run_target(
231 'update-syscall-header',
232 command : [missing_syscalls_py,
233 missing_syscall_def_h,
234 syscall_lists])
235
236 ############################################################
237
238 filesystem_includes = files(
239 'linux/magic.h',
240 'missing_magic.h',
241 )
242
243 check_filesystems = find_program('check-filesystems.sh')
244 r = run_command([check_filesystems, cpp, files('filesystems-gperf.gperf')] + filesystem_includes, check: false)
245 if r.returncode() != 0
246 warning('Unknown filesystems defined in kernel headers:\n\n' + r.stdout())
247 endif
248
249 filesystems_gperf_h = custom_target(
250 'filesystems-gperf.h',
251 input : 'filesystems-gperf.gperf',
252 output : 'filesystems-gperf.h',
253 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
254
255 generate_filesystem_list = find_program('generate-filesystem-list.py')
256 fname = 'filesystem-list.h'
257 filesystem_list_h = custom_target(
258 fname,
259 input : 'filesystems-gperf.gperf',
260 output : fname,
261 command : [generate_filesystem_list,
262 '@INPUT@'],
263 capture : true)
264
265 generate_filesystem_switch_case_h = find_program('generate-filesystem-switch-case.py')
266 fname = 'filesystem-switch-case.h'
267 filesystem_switch_case_h = custom_target(
268 fname,
269 input : 'filesystems-gperf.gperf',
270 output : 'filesystem-switch-case.h',
271 command : [generate_filesystem_switch_case_h,
272 '@INPUT@'],
273 capture : true)
274
275 basic_sources += [filesystem_list_h, filesystem_switch_case_h, filesystems_gperf_h]
276
277 libbasic = static_library(
278 'basic',
279 basic_sources,
280 fundamental_sources,
281 include_directories : basic_includes,
282 dependencies : [libcap,
283 libdl,
284 libgcrypt_cflags,
285 liblz4_cflags,
286 libm,
287 librt,
288 libxz_cflags,
289 libzstd_cflags,
290 threads,
291 userspace],
292 c_args : ['-fvisibility=default'],
293 build_by_default : false)