In a clean build system (Ubuntu 14.04), the viridentitytest failed to compile.
Even if all the SELINUX libraries and depedencies are installed. See the error
message below:
[...]
CC viridentitytest.o
CCLD viridentitytest
/usr/bin/ld: viridentitytest.o: undefined reference to symbol
'security_disable'
//lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
from command line
collect2: error: ld returned 1 exit status
make: *** [viridentitytest] Error 1
Simply adding the variable SELINUX_LIBS in viridentitytest rules of
Makefile.am to include SELINUX libraries into viridentitytest solved that
compilation issue. A conditional was added to consider when libvirt is using
or not SELINUX.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tests/Makefile.am | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c3d4ef..363c902 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -926,11 +926,13 @@ virstoragetest_LDADD = $(LDADDS) \
viridentitytest_SOURCES = \
viridentitytest.c testutils.h testutils.c
-viridentitytest_LDADD = $(LDADDS)
if WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS) $(SELINUX_LIBS)
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
-endif WITH_SELINUX
+else ! WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS)
+endif ! WITH_SELINUX
viriscsitest_SOURCES = \
viriscsitest.c testutils.h testutils.c
--
1.9.1