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