96e0b33
96e0b33
- remove unnecessary stuff which runs httpd during build
96e0b33
- drop unnecessary --libs output from ap?-?-config
48593e5
- make multilib-safe
96e0b33
48593e5
--- httpd-2.2.2/support/apxs.in.apxs
48593e5
+++ httpd-2.2.2/support/apxs.in
c1d7519
@@ -25,7 +25,18 @@
48593e5
 
48593e5
 my %config_vars = ();
48593e5
 
48593e5
-my $installbuilddir = "@exp_installbuilddir@";
48593e5
+# Awful hack to make apxs libdir-agnostic:
48593e5
+my $pkg_config = "/usr/bin/pkg-config";
48593e5
+if (! -x "$pkg_config") {
48593e5
+    error("$pkg_config not found!");
48593e5
+    exit(1);
48593e5
+}
48593e5
+
c1d7519
+my $libdir = `pkg-config --variable=libdir apr-1`;
c1d7519
+chomp $libdir;
c1d7519
+
c1d7519
+my $installbuilddir = $libdir . "/httpd/build";
48593e5
+
48593e5
 get_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
48593e5
 
48593e5
 # read the configuration variables once
c1d7519
@@ -184,34 +195,6 @@
96e0b33
     }
96e0b33
 }
96e0b33
 
96e0b33
-##
96e0b33
-##  Initial shared object support check
96e0b33
-##
96e0b33
-my $httpd = get_vars("sbindir") . "/" . get_vars("progname");
96e0b33
-$httpd = eval qq("$httpd");
96e0b33
-$httpd = eval qq("$httpd");
96e0b33
-my $envvars = get_vars("sbindir") . "/envvars";
96e0b33
-$envvars = eval qq("$envvars");
96e0b33
-$envvars = eval qq("$envvars");
96e0b33
-
96e0b33
-#allow apxs to be run from the source tree, before installation
96e0b33
-if ($0 =~ m:support/apxs$:) {
96e0b33
-    ($httpd = $0) =~ s:support/apxs$::;
96e0b33
-}
96e0b33
-
96e0b33
-unless (-x "$httpd") {
96e0b33
-	error("$httpd not found or not executable");
96e0b33
-	exit 1;
96e0b33
-}
96e0b33
-
96e0b33
-unless (grep /mod_so/, `. $envvars && $httpd -l`) {
96e0b33
-    error("Sorry, no shared object support for Apache");
96e0b33
-    error("available under your platform. Make sure");
96e0b33
-    error("the Apache module mod_so is compiled into");
96e0b33
-    error("your server binary `$httpd'.");
96e0b33
-    exit 1;
96e0b33
-}
96e0b33
-
96e0b33
 sub get_config_vars{
96e0b33
     my ($file, $rh_config) = @_;
96e0b33
 
c1d7519
@@ -291,7 +274,7 @@
c1d7519
     $data =~ s|%NAME%|$name|sg;
c1d7519
     $data =~ s|%TARGET%|$CFG_TARGET|sg;
c1d7519
     $data =~ s|%PREFIX%|$prefix|sg;
c1d7519
-    $data =~ s|%INSTALLBUILDDIR%|$installbuilddir|sg;
c1d7519
+    $data =~ s|%LIBDIR%|$libdir|sg;
c1d7519
 
c1d7519
     my ($mkf, $mods, $src) = ($data =~ m|^(.+)-=#=-\n(.+)-=#=-\n(.+)|s);
c1d7519
 
c1d7519
@@ -433,9 +416,9 @@
96e0b33
 
96e0b33
     if ($opt_p == 1) {
96e0b33
         
96e0b33
-        my $apr_libs=`$apr_config --cflags --ldflags --link-libtool --libs`;
96e0b33
+        my $apr_libs=`$apr_config --cflags --ldflags --link-libtool`;
96e0b33
         chomp($apr_libs);
96e0b33
-        my $apu_libs=`$apu_config --ldflags --link-libtool --libs`;
96e0b33
+        my $apu_libs=`$apu_config --ldflags --link-libtool`;
96e0b33
         chomp($apu_libs);
96e0b33
         
96e0b33
         $opt .= " ".$apu_libs." ".$apr_libs;
c1d7519
@@ -646,8 +629,8 @@
c1d7519
 
c1d7519
 builddir=.
c1d7519
 top_srcdir=%PREFIX%
c1d7519
-top_builddir=%PREFIX%
c1d7519
-include %INSTALLBUILDDIR%/special.mk
c1d7519
+top_builddir=%LIBDIR%/httpd
8395bae
+include %LIBDIR%/httpd/build/special.mk
c1d7519
 
c1d7519
 #   the used tools
c1d7519
 APXS=apxs