httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [patch] bogus support for pre-'make install' use of apxs
Date Mon, 17 Mar 2003 01:39:24 GMT
It looks like nobody has used apxs when httpd wasn't installed yet.

The following code in apxs is bogus:

#allow apxs to be run from the source tree, before installation
if ($0 =~ m:support/apxs$:) {
     ($httpd = $0) =~ s:support/apxs$::;
}

This takes a path /foo/support/apxs and assigns /foo (a dir!) to be $httpd.

unless (-x "$httpd") {
	error("$httpd not found or not executable");
	exit 1;
}

This doesn't fail, because the directory /foo indeed exists and it's 
executable. Moreover the later check for mod_so, can't possibly work:

unless (grep /mod_so/, `. $envvars && $httpd -l`) {
  ...

because $envvars is a path which doesn't exist, before httpd is installed.

Here is an attempt to fix that. Please verify that it works for you. You will 
have to nuke (move) your installed httpd-2.0 in order to verify that it works.

Index: support/apxs.in
===================================================================
RCS file: /home/cvs/httpd-2.0/support/apxs.in,v
retrieving revision 1.53
diff -u -r1.53 apxs.in
--- support/apxs.in	19 Feb 2003 14:39:39 -0000	1.53
+++ support/apxs.in	17 Mar 2003 01:33:54 -0000
@@ -225,19 +225,23 @@
  ##
  ##  Initial shared object support check
  ##
-my $httpd = get_vars("sbindir") . "/" . get_vars("progname");
+my($httpd, $envvars);
+#allow apxs to be run from the source tree, before installation
+if ($0 =~ m:support/apxs$:) {
+    (my $base = $0) =~ s:support/apxs$::;
+    $httpd = "$base/" . get_vars("progname");
+    $envvars = "$base/support/envvars-std";
+} else {
+    my $base = get_vars("sbindir");
+    $httpd = "$base/" . get_vars("progname");
+    $envvars = "$base/envvars";
+}
  $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") {
+unless (-f $httpd && -x _) {
  	error("$httpd not found or not executable");
  	exit 1;
  }

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message