From 0edae73a9ae499273bb19a1a84b98a645636b030 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Thu, 17 Mar 2011 23:32:34 -0700 Subject: [PATCH] This fixes the apparmor apache2 module to link correctly against the built libapparmor, as well as working around libtool so that the libapparmor library build directory does not get added as an rpath to the module. Bug: https://launchpad.net/bugs/737074 --- changehat/mod_apparmor/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/changehat/mod_apparmor/Makefile b/changehat/mod_apparmor/Makefile index 5d5dbc33c..6e6b9f2e5 100644 --- a/changehat/mod_apparmor/Makefile +++ b/changehat/mod_apparmor/Makefile @@ -41,12 +41,15 @@ APXS:=$(shell if [ -x "/usr/sbin/apxs2" ] ; then \ fi ) APXS_INSTALL_DIR=$(shell ${APXS} -q LIBEXECDIR) DESTDIR= -LIBAPPARMOR_FLAGS="-I../../libraries/libapparmor/src -L../../libraries/libapparmor/src/.libs -lapparmor" +# Need to pass -Wl twice here to get past both apxs2 and libtool, as +# libtool will add the path to the RPATH of the library if passed -L/some/path +LIBAPPARMOR_FLAGS=-I../../libraries/libapparmor/src -Wl,-Wl,-L../../libraries/libapparmor/src/.libs +LDLIBS=-lapparmor all: $(TARGET) ${MANPAGES} ${HTMLMANPAGES} %.so: %.c - ${APXS} ${LIBAPPARMOR_FLAGS} -c $< + ${APXS} ${LIBAPPARMOR_FLAGS} -c $< ${LDLIBS} mv .libs/$@ . .PHONY: install