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