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