]>
Commit | Line | Data |
---|---|---|
9b9d56e6 CB |
1 | # SPDX-License-Identifier: LGPL-2.1-or-later |
2 | ||
3 | project('lxc', 'c', | |
4 | version : '4.0.0', | |
5 | license : 'LGPLv2+', | |
6 | default_options: [ | |
25dff4d1 | 7 | 'b_lto=true', |
66d7d503 | 8 | 'b_lto_mode=thin', |
455dae78 | 9 | 'b_colorout=always', |
5e0a302b | 10 | 'b_asneeded=true', |
98f3b527 | 11 | 'b_pie=true', |
66d7d503 | 12 | 'b_staticpic=true', |
9b9d56e6 CB |
13 | 'c_std=gnu11', |
14 | 'warning_level=2', | |
15 | ], | |
5c26176d | 16 | meson_version : '>= 0.48', |
9b9d56e6 CB |
17 | ) |
18 | ||
19 | liblxc_version = '4.0.0' | |
20 | ||
21 | conf = configuration_data() | |
22 | conf.set_quoted('PROJECT_URL', 'https://linuxcontainers.org/lxc/introduction/') | |
23 | conf.set('PROJECT_VERSION', meson.project_version(), | |
24 | description : 'Numerical project version (used where a simple number is expected)') | |
7172b98c | 25 | conf.set('PACKAGE_VERSION', meson.project_version()) |
297e5f96 | 26 | conf.set('_GNU_SOURCE', true) |
5bd35027 | 27 | conf.set('_FILE_OFFSET_BITS', 64) |
297e5f96 | 28 | conf.set('__STDC_FORMAT_MACROS', true) |
9b9d56e6 CB |
29 | |
30 | version_data = configuration_data() | |
31 | version_data.set('LXC_VERSION_MAJOR', '4') | |
32 | version_data.set('LXC_VERSION_MINOR', '0') | |
33 | version_data.set('LXC_VERSION_MICRO', '7') | |
34 | version_data.set('LXC_ABI', '4.0.7') | |
35 | version_data.set('LXC_DEVEL', '1') | |
36 | version_data.set('LXC_VERSION', '4.0.7-devel') | |
37 | ||
38 | project_source_root = meson.current_source_dir() | |
39 | project_build_root = meson.current_build_dir() | |
40 | ||
41 | # join_paths ignores the preceding arguments if an absolute component is | |
42 | # encountered, so this should canonicalize various paths when they are | |
43 | # absolute or relative. | |
44 | prefixdir = get_option('prefix') | |
9b9d56e6 | 45 | bindir = join_paths(prefixdir, get_option('bindir')) |
bf1f3470 CB |
46 | datadir = join_paths(prefixdir, get_option('datadir')) |
47 | docdir = join_paths(prefixdir, get_option('docdir')) | |
9b9d56e6 CB |
48 | includedir = join_paths(prefixdir, get_option('includedir')) |
49 | libdir = join_paths(prefixdir, get_option('libdir')) | |
50 | libexecdir = join_paths(prefixdir, get_option('libexecdir')) | |
9b9d56e6 | 51 | localstatedir = join_paths('/', get_option('localstatedir')) |
bf1f3470 CB |
52 | sbindir = join_paths(prefixdir, get_option('sbindir')) |
53 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) | |
54 | ||
9b9d56e6 | 55 | apparmorcachedir = get_option('apparmor-cache-dir') |
9b9d56e6 | 56 | cgrouppattern = get_option('cgroup-pattern') |
9b9d56e6 CB |
57 | globalconfig = get_option('global-config') |
58 | ||
bf1f3470 CB |
59 | logpath = get_option('log-path') |
60 | lxcpathprefix = get_option('config-path') | |
61 | rootfsmount = get_option('rootfs-mount-dir') | |
62 | runtimepath = join_paths(prefixdir, get_option('runtime-path')) | |
747bc634 | 63 | wants_io_uring = get_option('io-uring-event-loop') |
bf1f3470 | 64 | |
9b9d56e6 | 65 | conf.set_quoted('BINDIR', bindir) |
bf1f3470 | 66 | conf.set_quoted('DATADIR', datadir) |
dcfe4e13 | 67 | conf.set_quoted('DOCDIR', docdir) |
9b9d56e6 | 68 | conf.set_quoted('INCLUDEDIR', includedir) |
dcfe4e13 | 69 | conf.set_quoted('LOCALSTATEDIR', localstatedir) |
9b9d56e6 CB |
70 | conf.set_quoted('LIBDIR', libdir) |
71 | conf.set_quoted('LIBEXECDIR', libexecdir) | |
bf1f3470 | 72 | conf.set_quoted('SBINDIR', sbindir) |
9b9d56e6 | 73 | conf.set_quoted('SYSCONFDIR', sysconfdir) |
bf1f3470 CB |
74 | |
75 | conf.set_quoted('LXCINITDIR', libexecdir) | |
9b9d56e6 CB |
76 | conf.set_quoted('DEFAULT_CGROUP_PATTERN', cgrouppattern) |
77 | conf.set_quoted('RUNTIME_PATH', runtimepath) | |
bf1f3470 CB |
78 | |
79 | lxcdefaultconfig = join_paths(sysconfdir, 'lxc/default.conf') | |
80 | conf.set_quoted('LXC_DEFAULT_CONFIG', lxcdefaultconfig) | |
81 | ||
82 | lxcapparmorcachedir = join_paths(localstatedir, apparmorcachedir) | |
83 | conf.set_quoted('APPARMOR_CACHE_DIR', lxcapparmorcachedir) | |
84 | ||
85 | lxcrootfsmount = join_paths(prefixdir, rootfsmount) | |
86 | conf.set_quoted('LXCROOTFSMOUNT', lxcrootfsmount) | |
87 | ||
88 | lxcglobalconfig = join_paths(sysconfdir, globalconfig) | |
89 | conf.set_quoted('LXC_GLOBAL_CONF', lxcglobalconfig) | |
90 | ||
91 | lxclogpath = join_paths(localstatedir, logpath) | |
92 | conf.set_quoted('LOGPATH', lxclogpath) | |
93 | ||
94 | lxcpath = join_paths(localstatedir, lxcpathprefix) | |
95 | conf.set_quoted('LXCPATH', lxcpath) | |
96 | ||
97 | lxctemplateconfig = join_paths(datadir, 'lxc/config') | |
98 | conf.set_quoted('LXCTEMPLATECONFIG', lxctemplateconfig) | |
99 | ||
100 | lxctemplatedir = join_paths(datadir, 'lxc/templates') | |
101 | conf.set_quoted('LXCTEMPLATEDIR', lxctemplatedir) | |
102 | ||
103 | lxchookdir = join_paths(datadir, 'lxc/hooks') | |
104 | conf.set_quoted('LXCHOOKDIR', lxchookdir) | |
105 | ||
106 | lxchookbindir = join_paths(libexecdir, 'lxc/hooks') | |
107 | conf.set_quoted('LXCBINHOOKDIR', lxchookbindir) | |
9b9d56e6 | 108 | |
72f1c44a CB |
109 | user_network_conf_opt = get_option('user-network-conf') |
110 | lxc_user_network_conf = join_paths(sysconfdir, user_network_conf_opt) | |
111 | conf.set_quoted('LXC_USERNIC_CONF', lxc_user_network_conf) | |
112 | ||
113 | user_network_db_opt = get_option('user-network-db') | |
114 | lxc_user_network_db = join_paths(runtimepath, user_network_db_opt) | |
115 | conf.set_quoted('LXC_USERNIC_DB', lxc_user_network_db) | |
116 | ||
9b9d56e6 | 117 | # AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} '+%Y-%m-%d')") |
9b9d56e6 CB |
118 | # AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db") |
119 | # AS_AC_EXPAND(LXC_DISTRO_SYSCONF, "$distrosysconf") | |
9b9d56e6 CB |
120 | |
121 | cc = meson.get_compiler('c') | |
122 | pkgconfig = import('pkgconfig') | |
123 | ||
124 | possible_cc_flags = [ | |
9b9d56e6 | 125 | '-Wvla', |
9b9d56e6 CB |
126 | '-Wimplicit-fallthrough=5', |
127 | '-Wcast-align', | |
128 | '-Wstrict-prototypes', | |
129 | '-fno-strict-aliasing', | |
130 | '-fstack-clash-protection', | |
131 | '-fstack-protector-strong', | |
132 | '--param=ssp-buffer-size=4', | |
133 | '--mcet -fcf-protection', | |
134 | '-Werror=implicit-function-declaration', | |
135 | '-Wlogical-op', | |
136 | '-Wmissing-include-dirs', | |
137 | '-Wold-style-definition', | |
138 | '-Winit-self', | |
139 | '-Wunused-but-set-variable', | |
140 | '-Wno-unused-parameter', | |
141 | '-Wfloat-equal', | |
142 | '-Wsuggest-attribute=noreturn', | |
143 | '-Werror=return-type', | |
144 | '-Werror=incompatible-pointer-types', | |
145 | '-Wformat=2', | |
146 | '-Wshadow', | |
147 | '-Wendif-labels', | |
148 | '-Werror=overflow', | |
149 | '-fdiagnostics-show-option', | |
150 | '-Werror=shift-count-overflow', | |
151 | '-Werror=shift-overflow=2', | |
152 | '-Wdate-time', | |
153 | '-Wnested-externs', | |
154 | '-fasynchronous-unwind-tables', | |
155 | '-fexceptions', | |
156 | '-Warray-bounds', | |
157 | '-Wrestrict', | |
158 | '-Wreturn-local-addr', | |
159 | '-fsanitize=cfi', | |
160 | '-Wstringop-overflow', | |
161 | ] | |
162 | ||
163 | possible_link_flags = [ | |
9b9d56e6 CB |
164 | '-Wl,--gc-sections', |
165 | '-Wl,-z,relro', | |
166 | '-Wl,-z,now', | |
9b9d56e6 CB |
167 | '-Wl,-fuse-ld=gold', |
168 | ] | |
169 | ||
170 | if meson.version().version_compare('>=0.46') | |
171 | add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c') | |
172 | else | |
173 | add_project_link_arguments(possible_link_flags, language : 'c') | |
174 | endif | |
175 | ||
176 | add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c') | |
177 | ||
178 | foreach header : ['sys/resource.h', | |
179 | 'sys/memfd.h', | |
180 | 'sys/personality.h', | |
181 | 'sys/signalfd.h', | |
182 | 'sys/timerfd.h', | |
183 | 'pty.h', | |
184 | 'utmpx.h', | |
185 | ] | |
186 | ||
187 | conf.set10('HAVE_' + header.underscorify().to_upper(), | |
188 | cc.has_header(header)) | |
189 | endforeach | |
190 | ||
191 | decl_headers = ''' | |
192 | #include <uchar.h> | |
193 | #include <sys/mount.h> | |
194 | #include <sys/stat.h> | |
195 | #include <linux/fs.h> | |
196 | #include <linux/types.h> | |
197 | #include <linux/openat2.h> | |
198 | #include <linux/sched.h> | |
199 | ''' | |
200 | ||
201 | foreach decl : [ | |
202 | '__aligned_u64', | |
203 | 'struct mount_attr', | |
204 | 'struct open_how', | |
205 | 'struct clone_args', | |
206 | ] | |
207 | ||
208 | # We get -1 if the size cannot be determined | |
4ad3a929 CB |
209 | if cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 |
210 | conf.set10('HAVE_' + decl.underscorify().to_upper(), true) | |
c597905e CB |
211 | else |
212 | conf.set10('HAVE_' + decl.underscorify().to_upper(), false) | |
9b9d56e6 CB |
213 | endif |
214 | endforeach | |
215 | ||
216 | foreach ident : [ | |
7a7f9a14 CB |
217 | ['bpf', '''#include <sys/syscall.h> |
218 | #include <unistd.h>'''], | |
219 | ['close_range', '''#include <unistd.h>'''], | |
220 | ['execveat', '''#include <unistd.h>'''], | |
db4af8c5 CB |
221 | ['endmntent', '''#include <stdio.h> |
222 | #include <mntent.h>'''], | |
7a7f9a14 CB |
223 | ['faccessat', '''#include <fcntl.h> |
224 | #include <unistd.h>'''], | |
225 | ['fexecve', '''#include <unistd.h>'''], | |
db4af8c5 | 226 | ['fgetln', '''#include <stdio.h>'''], |
7a7f9a14 CB |
227 | ['fsconfig', '''#include <sys/mount.h>'''], |
228 | ['fsmount', '''#include <sys/mount.h>'''], | |
229 | ['fsopen', '''#include <sys/mount.h>'''], | |
230 | ['fspick', '''#include <sys/mount.h>'''], | |
db4af8c5 CB |
231 | ['getgrgid_r', '''#include <sys/types.h> |
232 | #include <grp.h>'''], | |
233 | ['getline', '''#include <stdio.h>'''], | |
234 | ['getsubopt', '''#include <stdlib.h>'''], | |
7a7f9a14 CB |
235 | ['gettid', '''#include <sys/types.h> |
236 | #include <unistd.h>'''], | |
db4af8c5 CB |
237 | ['hasmntopt', '''#include <stdio.h> |
238 | #include <mntent.h>'''], | |
7a7f9a14 CB |
239 | ['kcmp', '''#include <linux/kcmp.h>'''], |
240 | ['keyctl', '''#include <sys/types.h> | |
241 | #include <keyutils.h>'''], | |
242 | ['memfd_create', '''#include <sys/mman.h>'''], | |
243 | ['mount_setattr', '''#include <sys/mount.h>'''], | |
244 | ['move_mount', '''#include <sys/mount.h>'''], | |
245 | ['openat2', '''#include <sys/types.h> | |
246 | #include <sys/stat.h> | |
247 | #include <fctnl.h>'''], | |
248 | ['open_tree', '''#include <sys/mount.h>'''], | |
249 | ['personality', '''#include <sys/personality.h>'''], | |
250 | ['pidfd_open', '''#include <stdlib.h> | |
251 | #include <unistd.h> | |
252 | #include <signal.h> | |
253 | #include <sys/wait.h>'''], | |
254 | ['pidfd_send_signal', '''#include <stdlib.h> | |
255 | #include <unistd.h> | |
256 | #include <signal.h> | |
257 | #include <sys/wait.h>'''], | |
258 | ['pivot_root', '''#include <stdlib.h> | |
259 | #include <unistd.h>'''], # no known header declares pivot_root | |
260 | ['prlimit', '''#include <sys/time.h> | |
261 | #include <sys/resource.h>'''], | |
262 | ['prlimit64', '''#include <sys/time.h> | |
263 | #include <sys/resource.h>'''], | |
264 | ['renameat2', '''#include <stdio.h> | |
265 | #include <fcntl.h>'''], | |
266 | ['sethostname', '''#include <unistd.h>'''], | |
db4af8c5 CB |
267 | ['setmntent', '''#include <stdio.h> |
268 | #include <mntent.h>'''], | |
7a7f9a14 | 269 | ['setns', '''#include <sched.h>'''], |
ea0e384f | 270 | ['sigdescr_np', '''#include <string.h>'''], |
7a7f9a14 CB |
271 | ['signalfd', '''#include <sys/signalfd.h>'''], |
272 | ['statx', '''#include <sys/types.h> | |
273 | #include <sys/stat.h> | |
274 | #include <unistd.h>'''], | |
db4af8c5 | 275 | ['strchrnul', '''#include <string.h>'''], |
7a7f9a14 CB |
276 | ['strlcat', '''#include <string.h>'''], |
277 | ['strlcpy', '''#include <string.h>'''], | |
278 | ['unshare', '''#include <sched.h>'''], | |
9b9d56e6 CB |
279 | ] |
280 | ||
db4af8c5 CB |
281 | have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') |
282 | conf.set10('HAVE_' + ident[0].to_upper(), have) | |
9b9d56e6 CB |
283 | endforeach |
284 | ||
747bc634 CB |
285 | if wants_io_uring == true |
286 | liburing = dependency('liburing') | |
5c9baf45 CB |
287 | if cc.has_function('io_uring_prep_poll_add', prefix : '#include <liburing.h>', dependencies: liburing) == false |
288 | error('liburing version does not support IORING_POLL_ADD_MULTI') | |
289 | endif | |
290 | conf.set10('HAVE_LIBURING', true) | |
747bc634 CB |
291 | endif |
292 | ||
ea6da257 CB |
293 | sh = find_program('sh') |
294 | git = find_program('git', required : false) | |
295 | time_epoch = run_command(sh, '-c', 'echo "$SOURCE_DATE_EPOCH"').stdout().strip() | |
296 | if time_epoch == '' and git.found() and run_command('test', '-e', '.git').returncode() == 0 | |
297 | # If we're in a git repository, use the creation time of the latest git tag. | |
298 | latest_tag = run_command(git, 'describe', '--abbrev=0', '--tags').stdout().strip() | |
299 | time_epoch = run_command(git, 'log', '--no-show-signature', '-1', '--format=%at', latest_tag).stdout() | |
300 | endif | |
301 | time_epoch = time_epoch.to_int() | |
302 | conf.set('TIME_EPOCH', time_epoch) | |
303 | ||
9b9d56e6 | 304 | threads = dependency('threads') |
e4384f1c | 305 | libseccomp = dependency('libseccomp') |
c597905e | 306 | conf.set10('HAVE_SECCOMP', libseccomp.found()) |
9b9d56e6 | 307 | if libseccomp.found() |
e4384f1c CB |
308 | if libseccomp.version().version_compare('>=2.5.0') |
309 | # https://github.com/seccomp/libseccomp/commit/dead12bc788b259b148cc4d93b970ef0bd602b1a | |
310 | conf.set10('HAVE_DECL_SECCOMP_NOTIFY_FD', true) | |
c597905e CB |
311 | else |
312 | conf.set10('HAVE_DECL_SECCOMP_NOTIFY_FD', false) | |
9b9d56e6 CB |
313 | endif |
314 | ||
e4384f1c CB |
315 | if libseccomp.version().version_compare('>=2.0.0') |
316 | # https://github.com/seccomp/libseccomp/commit/6220c8c0fc479d97b6d3e3166a4e46fbfe25a3c0 | |
317 | conf.set10('HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH', true) | |
c597905e CB |
318 | else |
319 | conf.set10('HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH', false) | |
9b9d56e6 CB |
320 | endif |
321 | ||
e4384f1c CB |
322 | seccomp_headers = ''' |
323 | #include <seccomp.h> | |
324 | ''' | |
9b9d56e6 CB |
325 | foreach decl : [ |
326 | 'scmp_filter_ctx', | |
327 | 'struct seccomp_notif_sizes', | |
328 | 'struct clone_args', | |
329 | ] | |
330 | ||
331 | # We get -1 if the size cannot be determined | |
4ad3a929 CB |
332 | if cc.sizeof(decl, prefix : seccomp_headers, args : '-D_GNU_SOURCE') > 0 |
333 | conf.set10('HAVE_' + decl.underscorify().to_upper(), true) | |
c597905e CB |
334 | else |
335 | conf.set10('HAVE_' + decl.underscorify().to_upper(), false) | |
9b9d56e6 CB |
336 | endif |
337 | endforeach | |
338 | endif | |
339 | ||
e4384f1c | 340 | libselinux = dependency('libselinux', required : false) |
c597905e | 341 | conf.set10('HAVE_SELINUX', libselinux.found()) |
9b9d56e6 | 342 | |
e4384f1c | 343 | libapparmor = dependency('libapparmor', required : false) |
c597905e | 344 | conf.set10('HAVE_APPARMOR', libapparmor.found()) |
9b9d56e6 CB |
345 | |
346 | libopenssl = dependency('openssl', required : false) | |
c597905e | 347 | conf.set10('HAVE_OPENSSL', libopenssl.found()) |
9b9d56e6 CB |
348 | |
349 | libcap = dependency('libcap', required : false) | |
350 | if not libcap.found() | |
351 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file | |
4ce4aac4 | 352 | libcap = cc.find_library('cap', required : false) |
9b9d56e6 | 353 | endif |
c597905e | 354 | conf.set10('HAVE_LIBCAP', libcap.found()) |
9b9d56e6 | 355 | |
d0a16061 CB |
356 | libcap_static = dependency('libcap', required : false, static : true) |
357 | if not libcap_static.found() | |
358 | # Compat with Ubuntu 14.04 which ships libcap w/o .pc file | |
359 | libcap_static = cc.find_library('cap', required : false, static : true) | |
360 | endif | |
c597905e | 361 | conf.set10('HAVE_STATIC_LIBCAP', libcap_static.found()) |
d0a16061 | 362 | |
db4af8c5 CB |
363 | have = cc.has_function('strchrnul', prefix : '#include <string.h>', args : '-D_GNU_SOURCE') |
364 | conf.set10('HAVE_STRCHRNUL', have) | |
365 | ||
366 | have = cc.has_function('openpty', prefix : '#include <pty.h>', args : '-D_GNU_SOURCE') | |
367 | conf.set10('HAVE_OPENPTY', have) | |
368 | ||
ae13cb3b CB |
369 | foreach ccattr : ['fallthrough', |
370 | 'nonnull', | |
371 | 'returns_nonnull', | |
372 | ] | |
373 | ||
374 | conf.set10('HAVE_COMPILER_ATTR_' + ccattr.underscorify().to_upper(), cc.has_function_attribute(ccattr)) | |
375 | endforeach | |
5c26176d | 376 | |
db4af8c5 CB |
377 | config_h = configure_file( |
378 | output : 'config.h', | |
379 | configuration : conf) | |
380 | ||
381 | add_project_arguments('-include', 'config.h', language : 'c') | |
382 | ||
9b9d56e6 | 383 | basic_includes = include_directories( |
db4af8c5 | 384 | '.', |
9b9d56e6 | 385 | 'src', |
db4af8c5 | 386 | 'src/include') |
9b9d56e6 CB |
387 | |
388 | liblxc_includes = [basic_includes, include_directories( | |
389 | 'src/lxc/cgroups', | |
390 | 'src/lxc/lsm', | |
391 | 'src/lxc/storage')] | |
392 | ||
9b9d56e6 | 393 | subdir('src/include') |
db4af8c5 | 394 | subdir('src/lxc/tools/include') |
9b9d56e6 | 395 | subdir('src/lxc') |
9b9d56e6 | 396 | |
747bc634 CB |
397 | liblxc_dependencies = [threads, |
398 | libseccomp, | |
399 | libcap, | |
400 | libopenssl, | |
401 | libselinux, | |
402 | libapparmor] | |
403 | ||
404 | if wants_io_uring == true | |
405 | liblxc_dependencies += [liburing] | |
406 | endif | |
407 | ||
9b9d56e6 CB |
408 | liblxc = shared_library( |
409 | 'lxc', | |
410 | version : liblxc_version, | |
db4af8c5 | 411 | include_directories: liblxc_includes, |
305490ba CB |
412 | link_args : ['-DPIC'], |
413 | c_args : ['-DPIC'], | |
9b9d56e6 | 414 | link_whole : [liblxc_static], |
747bc634 | 415 | dependencies: liblxc_dependencies, |
e8ef4dea | 416 | install : true) |
297e5f96 | 417 | |
c6ea1dec CB |
418 | liblxc_dep = declare_dependency( |
419 | link_with: liblxc, | |
747bc634 | 420 | dependencies: liblxc_dependencies) |
c6ea1dec | 421 | |
659611a3 CB |
422 | dummy_config_data = configuration_data() |
423 | dummy_config_data.set_quoted('DUMMY_VARIABLE', '1') | |
424 | ||
7172b98c CB |
425 | hook_programs = [] |
426 | subdir('hooks') | |
427 | ||
428 | template_scripts = [] | |
429 | subdir('templates') | |
430 | ||
d0a16061 | 431 | cmd_programs = [] |
db4af8c5 CB |
432 | subdir('src/lxc/cmd') |
433 | ||
434 | public_programs = [] | |
435 | subdir('src/lxc/tools') | |
d0a16061 | 436 | |
ea6da257 CB |
437 | found_syscalls = [] |
438 | missing_syscalls = [] | |
439 | ||
440 | foreach tuple : [ | |
7a7f9a14 CB |
441 | ['bpf'], |
442 | ['close_range'], | |
db4af8c5 | 443 | ['endmntent'], |
7a7f9a14 CB |
444 | ['execveat'], |
445 | ['faccessat'], | |
db4af8c5 CB |
446 | ['strchrnul'], |
447 | ['fgetln'], | |
7a7f9a14 CB |
448 | ['fsconfig'], |
449 | ['fsmount'], | |
450 | ['fsopen'], | |
451 | ['fspick'], | |
db4af8c5 CB |
452 | ['getgrgid_r'], |
453 | ['getline'], | |
454 | ['getsubopt'], | |
ea6da257 | 455 | ['gettid'], |
db4af8c5 | 456 | ['hasmntopt'], |
ea6da257 CB |
457 | ['kcmp'], |
458 | ['keyctl'], | |
7a7f9a14 | 459 | ['memfd_create'], |
ea6da257 CB |
460 | ['mount_setattr'], |
461 | ['move_mount'], | |
7a7f9a14 | 462 | ['openat2'], |
ea6da257 | 463 | ['open_tree'], |
7a7f9a14 CB |
464 | ['personality'], |
465 | ['pidfd_open'], | |
466 | ['pidfd_send_signal'], | |
467 | ['pivot_root'], | |
ea6da257 CB |
468 | ['prlimit'], |
469 | ['prlimit64'], | |
7a7f9a14 CB |
470 | ['renameat2'], |
471 | ['sethostname'], | |
db4af8c5 | 472 | ['setmntent'], |
7a7f9a14 | 473 | ['setns'], |
ea0e384f | 474 | ['sigdescr_np'], |
7a7f9a14 CB |
475 | ['signalfd'], |
476 | ['statx'], | |
477 | ['strlcat'], | |
478 | ['strlcpy'], | |
479 | ['unshare'], | |
ea6da257 CB |
480 | ] |
481 | ||
482 | if tuple.length() >= 2 | |
483 | cond = tuple[1] | |
484 | else | |
485 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() | |
486 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
487 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 | |
488 | endif | |
489 | if cond | |
490 | found_syscalls += tuple[0] | |
491 | else | |
492 | missing_syscalls += tuple[0] | |
493 | endif | |
494 | endforeach | |
495 | ||
496 | found_types = [] | |
497 | missing_types = [] | |
498 | ||
499 | foreach tuple : [ | |
500 | ['scmp_filter_ctx'], | |
501 | ['struct seccomp_notif_sizes'], | |
502 | ['struct clone_args'], | |
503 | ['__aligned_u64'], | |
504 | ['struct mount_attr'], | |
505 | ['struct open_how'], | |
506 | ] | |
507 | ||
508 | if tuple.length() >= 2 | |
509 | cond = tuple[1] | |
510 | else | |
511 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() | |
512 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
513 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 | |
514 | endif | |
515 | if cond | |
516 | found_types += tuple[0] | |
517 | else | |
518 | missing_types += tuple[0] | |
519 | endif | |
520 | endforeach | |
521 | ||
522 | found_headers = [] | |
523 | missing_headers = [] | |
524 | ||
525 | foreach tuple : [ | |
526 | ['sys/resource.h'], | |
527 | ['sys/memfd.h'], | |
528 | ['sys/personality.h'], | |
529 | ['sys/signalfd.h'], | |
530 | ['sys/timerfd.h'], | |
531 | ['pty.h'], | |
532 | ['utmpx.h' ], | |
533 | ] | |
534 | ||
535 | if tuple.length() >= 2 | |
536 | cond = tuple[1] | |
537 | else | |
538 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() | |
539 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
540 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 | |
541 | endif | |
542 | if cond | |
543 | found_headers += tuple[0] | |
544 | else | |
545 | missing_headers += tuple[0] | |
546 | endif | |
547 | endforeach | |
548 | ||
549 | found_deps = [] | |
550 | missing_deps = [] | |
551 | ||
552 | foreach tuple : [ | |
553 | ['AppArmor'], | |
554 | ['SECCOMP'], | |
555 | ['SELinux'], | |
556 | ['libcap'], | |
860ab933 | 557 | ['static libcap'], |
ea6da257 | 558 | ['openssl'], |
747bc634 | 559 | ['liburing'], |
ea6da257 CB |
560 | ] |
561 | ||
562 | if tuple.length() >= 2 | |
563 | cond = tuple[1] | |
564 | else | |
565 | ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() | |
566 | ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() | |
567 | cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 | |
568 | endif | |
569 | if cond | |
570 | found_deps += tuple[0] | |
571 | else | |
572 | missing_deps += tuple[0] | |
573 | endif | |
574 | endforeach | |
575 | ||
bf1f3470 CB |
576 | status = [ |
577 | '@0@ @1@'.format(meson.project_name(), meson.project_version()), | |
578 | ||
e282c460 CB |
579 | 'Meson version: @0@'.format(meson.version()), |
580 | ||
bf1f3470 CB |
581 | 'prefix directory: @0@'.format(prefixdir), |
582 | 'bin directory: @0@'.format(bindir), | |
583 | 'data directory: @0@'.format(datadir), | |
584 | 'doc directory: @0@'.format(docdir), | |
585 | 'include directory: @0@'.format(includedir), | |
586 | 'lib directory: @0@'.format(libdir), | |
587 | 'libexec directory: @0@'.format(libexecdir), | |
588 | 'local state directory: @0@'.format(localstatedir), | |
589 | 'sbin directory: @0@'.format(sbindir), | |
590 | 'sysconf directory: @0@'.format(sysconfdir), | |
591 | ||
592 | 'lxc cgroup pattern: @0@'.format(cgrouppattern), | |
593 | 'lxc init directory: @0@'.format(libexecdir), | |
594 | 'runtime path: @0@'.format(runtimepath), | |
595 | ||
596 | 'lxc default config: @0@'.format(lxcdefaultconfig), | |
597 | 'lxc global config: @0@'.format(lxcglobalconfig), | |
598 | 'lxc hook directory: @0@'.format(lxchookdir), | |
599 | 'lxc hook bin directory: @0@'.format(lxchookbindir), | |
600 | 'lxc rootfs mount directory: @0@'.format(lxcrootfsmount), | |
601 | 'log path: @0@'.format(lxclogpath), | |
602 | 'lxc path: @0@'.format(lxcpath), | |
603 | 'lxc template config: @0@'.format(lxctemplateconfig), | |
72f1c44a CB |
604 | 'lxc template directory: @0@'.format(lxctemplatedir), |
605 | 'lxc user network config: @0@'.format(lxc_user_network_conf), | |
606 | 'lxc user network database: @0@'.format(lxc_user_network_db)] | |
bf1f3470 | 607 | |
ea6da257 CB |
608 | alt_time_epoch = run_command('date', '-Is', '-u', '-d', |
609 | '@@0@'.format(time_epoch)).stdout().strip() | |
610 | status += [ | |
611 | 'time epoch: @0@ (@1@)'.format(time_epoch, alt_time_epoch)] | |
612 | ||
613 | status += [ | |
614 | '', | |
615 | 'supported dependencies: @0@'.format(', '.join(found_deps)), | |
616 | '', | |
617 | 'unsupported dependencies: @0@'.format(', '.join(missing_deps)), | |
618 | ''] | |
619 | ||
620 | status += [ | |
621 | '', | |
622 | 'supported headers: @0@'.format(', '.join(found_headers)), | |
623 | '', | |
624 | 'unsupported headers: @0@'.format(', '.join(missing_headers)), | |
625 | ''] | |
626 | ||
627 | status += [ | |
628 | '', | |
629 | 'supported calls: @0@'.format(', '.join(found_syscalls)), | |
630 | '', | |
631 | 'unsupported calls: @0@'.format(', '.join(missing_syscalls)), | |
632 | ''] | |
633 | ||
634 | status += [ | |
635 | '', | |
636 | 'supported types: @0@'.format(', '.join(found_types)), | |
637 | '', | |
638 | 'unsupported types: @0@'.format(', '.join(missing_types)), | |
639 | ''] | |
640 | ||
bf1f3470 | 641 | message('\n '.join(status)) |