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