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