Blame SOURCES/httpd-2.4.28-apxs.patch

59234c
diff --git a/support/apxs.in b/support/apxs.in
59234c
index ad1287f..efcfcf6 100644
59234c
--- a/support/apxs.in
59234c
+++ b/support/apxs.in
59234c
@@ -25,7 +25,18 @@ package apxs;
59234c
 
59234c
 my %config_vars = ();
59234c
 
59234c
-my $installbuilddir = "@exp_installbuilddir@";
59234c
+# Awful hack to make apxs libdir-agnostic:
59234c
+my $pkg_config = "/usr/bin/pkg-config";
59234c
+if (! -x "$pkg_config") {
59234c
+    error("$pkg_config not found!");
59234c
+    exit(1);
59234c
+}
59234c
+
59234c
+my $libdir = `pkg-config --variable=libdir apr-1`;
59234c
+chomp $libdir;
59234c
+
59234c
+my $installbuilddir = $libdir . "/httpd/build";
59234c
+
59234c
 get_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
59234c
 
59234c
 # read the configuration variables once
59234c
@@ -275,7 +286,7 @@ if ($opt_g) {
59234c
     $data =~ s|%NAME%|$name|sg;
59234c
     $data =~ s|%TARGET%|$CFG_TARGET|sg;
59234c
     $data =~ s|%PREFIX%|$prefix|sg;
59234c
-    $data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg;
59234c
+    $data =~ s|%LIBDIR%|$libdir|sg;
59234c
 
59234c
     my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s);
59234c
 
59234c
@@ -453,11 +464,11 @@ if ($opt_c) {
59234c
     my $ldflags = "$CFG_LDFLAGS";
59234c
     if ($opt_p == 1) {
59234c
         
59234c
-        my $apr_libs=`$apr_config --cflags --ldflags --link-libtool --libs`;
59234c
+        my $apr_libs=`$apr_config --cflags --ldflags --link-libtool`;
59234c
         chomp($apr_libs);
59234c
         my $apu_libs="";
59234c
         if ($apr_major_version < 2) {
59234c
-            $apu_libs=`$apu_config --ldflags --link-libtool --libs`;
59234c
+            $apu_libs=`$apu_config --ldflags --link-libtool`;
59234c
             chomp($apu_libs);
59234c
         }
59234c
         
59234c
@@ -672,8 +683,8 @@ __DATA__
59234c
 
59234c
 builddir=.
59234c
 top_srcdir=%PREFIX%
59234c
-top_builddir=%PREFIX%
59234c
-include %INSTALLBUILDDIR%/special.mk
59234c
+top_builddir=%LIBDIR%/httpd
59234c
+include %LIBDIR%/httpd/build/special.mk
59234c
 
59234c
 #   the used tools
59234c
 APACHECTL=apachectl