summaryrefslogtreecommitdiffstats
path: root/httpd-2.1.10-apxs.patch
blob: 5881276c74319d9dfc3a4993a436a35b30e39dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

- remove unnecessary stuff which runs httpd during build
- drop unnecessary --libs output from ap?-?-config
- make multilib-safe

Upstream-Status: The is-mod_so-linked-in hack is done better on trunk.
		The multilib hack is awful and can't go upstream.

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