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