[libvirt] [libvirt-sandbox][PATCH 1/4] virt-selinux.m4: Define SELINUX variables

Michal Privoznik mprivozn at redhat.com
Tue Nov 4 14:40:48 UTC 2014


Later in Makefile we are using SELINUX_{CFLAGS,LIBS} variables. But we
don't define them anywhere. As the result, if you don't have selinux
linked by default, you'll get linkage error.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 m4/virt-selinux.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4
index ef41721..610ff58 100644
--- a/m4/virt-selinux.m4
+++ b/m4/virt-selinux.m4
@@ -1,11 +1,15 @@
 AC_DEFUN([LIBVIRT_SANDBOX_SELINUX], [
   fail=0
+  SELINUX_CFLAGS=
+  SELINUX_LIBS=
   old_LIBS=$LIBS
   old_CFLAGS=$CFLAGS
   AC_CHECK_HEADER([selinux/selinux.h],[],[fail=1])
-  AC_CHECK_LIB([selinux], [fgetfilecon],[],[fail=1])
+  AC_CHECK_LIB([selinux], [fgetfilecon],[SELINUX_LIBS="$SELINUX_LIBS -lselinux"],[fail=1])
   LIBS=$old_LIBS
   CFLAGS=$old_CFLAGS
   test $fail = 1 &&
     AC_MSG_ERROR([You must install the libselinux development package in order to compile libvirt-sandbox])
+  AC_SUBST([SELINUX_CFLAGS])
+  AC_SUBST([SELINUX_LIBS])
 ])
-- 
2.0.4




More information about the libvir-list mailing list