Commit 12dcc892 by Jiri Slaby Committed by Stéphane Graber

configure: find seccomp using pkg-config

On suse we have the header in a subdir inside /usr/include, so pkgconfig has to be used to find out proper CFLAGS. Signed-off-by: 's avatarJiri Slaby <jslaby@suse.cz> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent baeebd0d
...@@ -229,9 +229,12 @@ fi ...@@ -229,9 +229,12 @@ fi
AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"]) AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
AM_COND_IF([ENABLE_SECCOMP], AM_COND_IF([ENABLE_SECCOMP],
[AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) [PKG_CHECK_MODULES([SECCOMP],[libseccomp],[],[
AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
AC_SUBST([SECCOMP_LIBS], [-lseccomp])]) AC_SUBST([SECCOMP_LIBS], [-lseccomp])
])
])
# Linux capabilities # Linux capabilities
AC_ARG_ENABLE([capabilities], AC_ARG_ENABLE([capabilities],
...@@ -248,7 +251,10 @@ AM_COND_IF([ENABLE_CAP], ...@@ -248,7 +251,10 @@ AM_COND_IF([ENABLE_CAP],
AC_SUBST([CAP_LIBS], [-lcap])]) AC_SUBST([CAP_LIBS], [-lcap])])
# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0 # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]]) AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
CFLAGS="$OLD_CFLAGS"
# Configuration examples # Configuration examples
AC_ARG_ENABLE([examples], AC_ARG_ENABLE([examples],
......
...@@ -131,7 +131,7 @@ AM_CFLAGS += -DUSE_CONFIGPATH_LOGS ...@@ -131,7 +131,7 @@ AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
endif endif
if ENABLE_SECCOMP if ENABLE_SECCOMP
AM_CFLAGS += -DHAVE_SECCOMP AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
liblxc_so_SOURCES += seccomp.c liblxc_so_SOURCES += seccomp.c
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment