Blame SOURCES/apr-1.2.7-pkgconf.patch

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