summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch')
-rw-r--r--recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch b/recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch
new file mode 100644
index 00000000..7ba992f6
--- /dev/null
+++ b/recipes-containers/lxc/files/configure-skip-libseccomp-tests-if-it-is-disabled.patch
@@ -0,0 +1,51 @@
1From 67cd8bde2d46983df8fa9f647e9fc0b96370ec29 Mon Sep 17 00:00:00 2001
2From: Eneas U de Queiroz <cotequeiroz@gmail.com>
3Date: Sat, 16 Jan 2021 13:54:07 -0300
4Subject: [PATCH] configure: skip libseccomp tests if it is disabled
5
6Move the block checking for libseccomp api compatibility inside
7AM_COND_IF([ENABLE_SECCOMP] ... ).
8
9Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
10---
11 configure.ac | 17 ++++++++---------
12 1 file changed, 8 insertions(+), 9 deletions(-)
13
14diff --git a/configure.ac b/configure.ac
15index f58487f5d..ce6363136 100644
16--- a/configure.ac
17+++ b/configure.ac
18@@ -312,6 +312,14 @@ AM_COND_IF([ENABLE_SECCOMP],
19 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
20 AC_SUBST([SECCOMP_LIBS], [-lseccomp])
21 ])
22+ # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
23+ OLD_CFLAGS="$CFLAGS"
24+ CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
25+ AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
26+ AC_CHECK_DECLS([seccomp_notify_fd], [], [], [[#include <seccomp.h>]])
27+ AC_CHECK_TYPES([struct seccomp_notif_sizes], [], [], [[#include <seccomp.h>]])
28+ AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
29+ CFLAGS="$OLD_CFLAGS"
30 ])
31
32 AC_MSG_CHECKING(for static libcap)
33@@ -359,15 +367,6 @@ AM_COND_IF([ENABLE_CAP],
34 AC_CHECK_LIB(cap,cap_get_file, AC_DEFINE(LIBCAP_SUPPORTS_FILE_CAPABILITIES,1,[Have cap_get_file]),[],[])
35 AC_SUBST([CAP_LIBS], [-lcap])])
36
37-# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
38-OLD_CFLAGS="$CFLAGS"
39-CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
40-AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
41-AC_CHECK_DECLS([seccomp_notify_fd], [], [], [[#include <seccomp.h>]])
42-AC_CHECK_TYPES([struct seccomp_notif_sizes], [], [], [[#include <seccomp.h>]])
43-AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
44-CFLAGS="$OLD_CFLAGS"
45-
46 AC_CHECK_HEADERS([linux/bpf.h], [
47 AC_CHECK_TYPES([struct bpf_cgroup_dev_ctx], [], [], [[#include <linux/bpf.h>]])
48 ], [], [])
49--
502.17.1
51