The libvirt_setuid_rpc_client_la depends on vircommand.c, in which we
are conditionally calling aa_change_profile() - an AppArmor helper
function. However, in linking the libvirt-setuid-rpc-client.la we have
forgot to link AppArmor libraries leaving us with following error:
make[3]: Entering directory `/home/zippy/work/libvirt/libvirt.git/tools'
CCLD virsh
CCLD virt-host-validate
CCLD virt-login-shell
../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In
function `virExec':
/home/zippy/work/libvirt/libvirt.git/src/util/vircommand.c:653: undefined reference to
`aa_change_profile'
collect2: error: ld returned 1 exit status
make[3]: *** [virt-login-shell] Error 1
make[3]: *** Waiting for unfinished jobs....
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/Makefile.am | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 9dab4df..688c34c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2027,15 +2027,19 @@ libvirt_setuid_rpc_client_la_SOURCES = \
libvirt_setuid_rpc_client_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LIBXML_LIBS) \
- $(SELINUX_LIBS) \
- $(NULL)
+ $(SELINUX_LIBS)
libvirt_setuid_rpc_client_la_CFLAGS = \
-DLIBVIRT_SETUID_RPC_CLIENT \
-I$(top_srcdir)/src/conf \
-I$(top_srcdir)/src/rpc \
$(AM_CFLAGS) \
- $(SELINUX_CFLAGS) \
- $(NULL)
+ $(SELINUX_CFLAGS)
+
+if WITH_SECDRIVER_APPARMOR
+libvirt_setuid_rpc_client_la_LDFLAGS += $(APPARMOR_LIBS)
+libvirt_setuid_rpc_client_la_CFLAGS += $(APPARMOR_CFLAGS)
+endif WITH_SECDRIVER_APPARMOR
+
endif WITH_LXC
lockdriverdir = $(libdir)/libvirt/lock-driver
--
1.8.1.5