Blame SOURCES/apr-1.2.7-pkgconf.patch

9222d6
9222d6
This is a fugly hack to make apr-1-config libdir-agnostic, by using
9222d6
pkg-config to determine the libdir setting.  pkg-config will
9222d6
magically determine the appropriate libdir setting.
9222d6
9222d6
This allows apr-devel.i386 and apr-devel.x86_64 to be 
9222d6
installed in parallel.
9222d6
9222d6
--- apr-1.2.7/Makefile.in.pkgconf
9222d6
+++ apr-1.2.7/Makefile.in
9222d6
@@ -60,7 +60,7 @@
9222d6
 
9222d6
 # Create apr-config script suitable for the install tree
9222d6
 apr-config.out: $(APR_CONFIG)
9222d6
-	sed 's,^\(location=\).*$$,\1installed,' < $(APR_CONFIG) > $@
9222d6
+	sed 's,^\(location=\).*$$,\1installed,;s,^\(APR_.*_DIR\)=.*,\1="$${libdir}/build",' < $(APR_CONFIG) > $@
9222d6
 
9222d6
 # Create apr_rules.mk suitable for the install tree
9222d6
 build/apr_rules.out: build/apr_rules.mk
9222d6
--- apr-1.2.7/apr.pc.in.pkgconf
9222d6
+++ apr-1.2.7/apr.pc.in
9222d6
@@ -3,9 +3,10 @@
9222d6
 libdir=@libdir@
9222d6
 APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
9222d6
 includedir=@includedir@
9222d6
+CPPFLAGS=@EXTRA_CPPFLAGS@
9222d6
 
9222d6
 Name: APR
9222d6
 Description: The Apache Portable Runtime library
9222d6
 Version: @APR_DOTTED_VERSION@
9222d6
 Libs: -L${libdir} -l@APR_LIBNAME@ @EXTRA_LIBS@
9222d6
-Cflags: @EXTRA_CPPFLAGS@ @EXTRA_CFLAGS@ -I${includedir}
9222d6
+Cflags: ${CPPFLAGS} @EXTRA_CFLAGS@ -I${includedir}
9222d6
--- apr-1.2.7/apr-config.in.pkgconf
9222d6
+++ apr-1.2.7/apr-config.in
9222d6
@@ -24,16 +24,17 @@
9222d6
 prefix="@prefix@"
9222d6
 exec_prefix="@exec_prefix@"
9222d6
 bindir="@bindir@"
9222d6
-libdir="@libdir@"
9222d6
 datarootdir="@datadir@"
9222d6
 datadir="@datadir@"
9222d6
-installbuilddir="@installbuilddir@"
9222d6
 includedir="@includedir@"
9222d6
 
9222d6
+libdir=`pkg-config --variable=libdir apr-@APR_MAJOR_VERSION@`
9222d6
+installbuilddir="${libdir}/apr-@APR_MAJOR_VERSION@/build"
9222d6
+
9222d6
 CC="@CC@"
9222d6
 CPP="@CPP@"
9222d6
 SHELL="@SHELL@"
9222d6
-CPPFLAGS="@EXTRA_CPPFLAGS@"
9222d6
+CPPFLAGS=`pkg-config --variable=CPPFLAGS apr-@APR_MAJOR_VERSION@`
9222d6
 CFLAGS="@EXTRA_CFLAGS@"
9222d6
 LDFLAGS="@EXTRA_LDFLAGS@"
9222d6
 LIBS="@EXTRA_LIBS@"