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