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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]