Blame SOURCES/apr-1.2.7-pkgconf.patch

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