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