]> granicus.if.org Git - php/commitdiff
MFH: fix bug: #16791 (more reliable version check)
authorfoobar <sniper@php.net>
Fri, 26 Apr 2002 03:13:00 +0000 (03:13 +0000)
committerfoobar <sniper@php.net>
Fri, 26 Apr 2002 03:13:00 +0000 (03:13 +0000)
sapi/apache/config.m4
sapi/apache2filter/config.m4

index 4e79763f9010bac185603651a838d61eebe7d7b9..8a883d9dfa5a675a47dbc2285033981d7fd12c54 100644 (file)
@@ -33,6 +33,14 @@ AC_ARG_WITH(apxs,
   APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@"
   APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
   APXS_CFLAGS=`$APXS -q CFLAGS`
+  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;}'`
+  if test "$APACHE_VERSION" -ge 2000000; then
+    AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) 
+  fi
+
   for flag in $APXS_CFLAGS; do
     case $flag in
     -D*) CPPFLAGS="$CPPFLAGS $flag";;
@@ -40,11 +48,6 @@ AC_ARG_WITH(apxs,
   done
   PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
 
-  # Test that we're trying to configure with apache 1.x
-  if test -f "$APXS_INCLUDEDIR/ap_mpm.h"; then
-    AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) 
-  fi
-
   PHP_SAPI=apache
 
   # Test whether apxs support -S option
index 354a5f97ca9b9beba372d3f459cd0203fdede00b..f4bde0d3fc59eb3641f2113561aaa858ace5ec88 100644 (file)
@@ -31,6 +31,16 @@ AC_ARG_WITH(apxs2,
     AC_MSG_ERROR([Aborting])
   fi 
 
+  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;}'`
+  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
+    AC_MSG_ERROR([Apache version >= 2.0.35 required.])
+  fi
+
   APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
   APXS_CFLAGS=`$APXS -q CFLAGS`
   for flag in $APXS_CFLAGS; do
@@ -38,11 +48,6 @@ AC_ARG_WITH(apxs2,
     -D*) CPPFLAGS="$CPPFLAGS $flag";;
     esac
   done
-  
-  # Test that we're trying to configure with apache 2.x
-  if test ! -f "$APXS_INCLUDEDIR/ap_mpm.h"; then
-    AC_MSG_ERROR([Use --with-apxs with Apache 1.3.x!])
-  fi
 
   PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
   PHP_SAPI=apache2filter