You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.9 KiB

  1. From 67cd8bde2d46983df8fa9f647e9fc0b96370ec29 Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <cotequeiroz@gmail.com>
  3. Date: Sat, 16 Jan 2021 13:54:07 -0300
  4. Subject: [PATCH 2/2] configure: skip libseccomp tests if it is disabled
  5. Move the block checking for libseccomp api compatibility inside
  6. AM_COND_IF([ENABLE_SECCOMP] ... ).
  7. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
  8. --- a/configure.ac
  9. +++ b/configure.ac
  10. @@ -284,6 +284,14 @@ AM_COND_IF([ENABLE_SECCOMP],
  11. AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
  12. AC_SUBST([SECCOMP_LIBS], [-lseccomp])
  13. ])
  14. + # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
  15. + OLD_CFLAGS="$CFLAGS"
  16. + CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
  17. + AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
  18. + AC_CHECK_DECLS([seccomp_notify_fd], [], [], [[#include <seccomp.h>]])
  19. + AC_CHECK_TYPES([struct seccomp_notif_sizes], [], [], [[#include <seccomp.h>]])
  20. + AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
  21. + CFLAGS="$OLD_CFLAGS"
  22. ])
  23. AC_MSG_CHECKING(for static libcap)
  24. @@ -331,15 +339,6 @@ AM_COND_IF([ENABLE_CAP],
  25. AC_CHECK_LIB(cap,cap_get_file, AC_DEFINE(LIBCAP_SUPPORTS_FILE_CAPABILITIES,1,[Have cap_get_file]),[],[])
  26. AC_SUBST([CAP_LIBS], [-lcap])])
  27. -# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
  28. -OLD_CFLAGS="$CFLAGS"
  29. -CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
  30. -AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
  31. -AC_CHECK_DECLS([seccomp_notify_fd], [], [], [[#include <seccomp.h>]])
  32. -AC_CHECK_TYPES([struct seccomp_notif_sizes], [], [], [[#include <seccomp.h>]])
  33. -AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
  34. -CFLAGS="$OLD_CFLAGS"
  35. -
  36. AC_CHECK_HEADERS([linux/bpf.h], [
  37. AC_CHECK_TYPES([struct bpf_cgroup_dev_ctx], [], [], [[#include <linux/bpf.h>]])
  38. ], [], [])