]> granicus.if.org Git - php/commitdiff
MFH: Fix for Apache version check.
authorfoobar <sniper@php.net>
Mon, 29 Jul 2002 02:15:19 +0000 (02:15 +0000)
committerfoobar <sniper@php.net>
Mon, 29 Jul 2002 02:15:19 +0000 (02:15 +0000)
acinclude.m4
sapi/apache/config.m4
sapi/apache2filter/config.m4

index 2c1b3b9406f4905e4504753cbb4e696f162489a5..b8b2a6c5cf9c3cfd5a0e4d8fc7f82030b1883165 100644 (file)
@@ -1264,3 +1264,20 @@ AC_DEFUN(PHP_SETUP_ICONV, [
 ifelse([$3],[],,[else $3])
   fi
 ])
+
+
+dnl
+dnl PHP_AP_EXTRACT_VERSION(/path/httpd)
+dnl This macro is used to get a comparable
+dnl version for apache1/2.
+dnl
+AC_DEFUN(PHP_AP_EXTRACT_VERSION,[
+  ac_output=`$1 -v 2>&1`
+  ac_IFS=$IFS
+IFS="- /.
+"
+  set $ac_output
+  IFS=$ac_IFS
+
+  APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
+])
index 8a883d9dfa5a675a47dbc2285033981d7fd12c54..09af36e8850ecc14951a9d150e7e477cf020e692 100644 (file)
@@ -36,7 +36,7 @@ AC_ARG_WITH(apxs,
   APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
 
   # Test that we're trying to configure with apache 1.x
-  APACHE_VERSION=`$APXS_HTTPD -v | head -1 | cut -f3 -d' ' | cut -f2 -d'/' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+  PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
   if test "$APACHE_VERSION" -ge 2000000; then
     AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) 
   fi
index f4bde0d3fc59eb3641f2113561aaa858ace5ec88..19dfcb584cbdb7bb8378390c023aecc0e568649d 100644 (file)
@@ -34,7 +34,7 @@ AC_ARG_WITH(apxs2,
   APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
 
   # Test that we're trying to configure with apache 2.x
-  APACHE_VERSION=`$APXS_HTTPD -v | head -1 | cut -f3 -d' ' | cut -f2 -d'/' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+  PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
   if test "$APACHE_VERSION" -le 2000000; then
     AC_MSG_ERROR([Use --with-apxs with Apache 1.3.x!])
   elif test "$APACHE_VERSION" -lt 2000035; then