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