]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
configure: find seccomp using pkg-config
authorJiri Slaby <jslaby@suse.cz>
Wed, 24 Apr 2013 08:46:21 +0000 (10:46 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 7 Jan 2014 16:23:57 +0000 (11:23 -0500)
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: Jiri Slaby <jslaby@suse.cz>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
src/lxc/Makefile.am

index 6e33716a09fb7751fa73772d45a60f91936780ec..0ba1ca9b5d0b0d6087928dd2c3eb8f8f41e379ef 100644 (file)
@@ -229,9 +229,12 @@ fi
 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
 
 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])])
-       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])])
+       [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_SUBST([SECCOMP_LIBS], [-lseccomp])
+               ])
+       ])
 
 # Linux capabilities
 AC_ARG_ENABLE([capabilities],
@@ -248,7 +251,10 @@ AM_COND_IF([ENABLE_CAP],
        AC_SUBST([CAP_LIBS], [-lcap])])
 
 # 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>]])
+CFLAGS="$OLD_CFLAGS"
 
 # Configuration examples
 AC_ARG_ENABLE([examples],
index 9ad091cf6ec5c83a85bb6777b570f8cd2a66bfdd..1e0232b13c6f9c6363052477be70c3ac6c69ea38 100644 (file)
@@ -131,7 +131,7 @@ AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
 endif
 
 if ENABLE_SECCOMP
-AM_CFLAGS += -DHAVE_SECCOMP
+AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
 liblxc_so_SOURCES += seccomp.c
 endif