arrfab / rpms / httpd

Forked from rpms/httpd 5 years ago
Clone

Blame SOURCES/httpd-2.4.28-apxs.patch

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