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