apr-1.2.7-pkgconf.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. This is a fugly hack to make apr-1-config libdir-agnostic, by using
  2. pkg-config to determine the libdir setting. pkg-config will
  3. magically determine the appropriate libdir setting.
  4. This allows apr-devel.i386 and apr-devel.x86_64 to be
  5. installed in parallel.
  6. --- apr-1.2.7/Makefile.in.pkgconf
  7. +++ apr-1.2.7/Makefile.in
  8. @@ -60,7 +60,7 @@
  9. # Create apr-config script suitable for the install tree
  10. apr-config.out: $(APR_CONFIG)
  11. - sed 's,^\(location=\).*$$,\1installed,' < $(APR_CONFIG) > $@
  12. + sed 's,^\(location=\).*$$,\1installed,;s,^\(APR_.*_DIR\)=.*,\1="$${libdir}/build",' < $(APR_CONFIG) > $@
  13. # Create apr_rules.mk suitable for the install tree
  14. build/apr_rules.out: build/apr_rules.mk
  15. --- apr-1.2.7/apr.pc.in.pkgconf
  16. +++ apr-1.2.7/apr.pc.in
  17. @@ -3,9 +3,10 @@
  18. libdir=@libdir@
  19. APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
  20. includedir=@includedir@
  21. +CPPFLAGS=@EXTRA_CPPFLAGS@
  22. Name: APR
  23. Description: The Apache Portable Runtime library
  24. Version: @APR_DOTTED_VERSION@
  25. Libs: -L${libdir} -l@APR_LIBNAME@ @EXTRA_LIBS@
  26. -Cflags: @EXTRA_CPPFLAGS@ @EXTRA_CFLAGS@ -I${includedir}
  27. +Cflags: ${CPPFLAGS} @EXTRA_CFLAGS@ -I${includedir}
  28. --- apr-1.2.7/apr-config.in.pkgconf
  29. +++ apr-1.2.7/apr-config.in
  30. @@ -24,16 +24,17 @@
  31. prefix="@prefix@"
  32. exec_prefix="@exec_prefix@"
  33. bindir="@bindir@"
  34. -libdir="@libdir@"
  35. datarootdir="@datadir@"
  36. datadir="@datadir@"
  37. -installbuilddir="@installbuilddir@"
  38. includedir="@includedir@"
  39. +libdir=`pkg-config --variable=libdir apr-@APR_MAJOR_VERSION@`
  40. +installbuilddir="${libdir}/apr-@APR_MAJOR_VERSION@/build"
  41. +
  42. CC="@CC@"
  43. CPP="@CPP@"
  44. SHELL="@SHELL@"
  45. -CPPFLAGS="@EXTRA_CPPFLAGS@"
  46. +CPPFLAGS=`pkg-config --variable=CPPFLAGS apr-@APR_MAJOR_VERSION@`
  47. CFLAGS="@EXTRA_CFLAGS@"
  48. LDFLAGS="@EXTRA_LDFLAGS@"
  49. LIBS="@EXTRA_LIBS@"