summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-07-11 08:44:42 +0000
committerSascha Schumann <sas@php.net>2002-07-11 08:44:42 +0000
commitee619493b3c2ee7eb57922cc4af8e71bf599b621 (patch)
tree608e4a090bcab67b90e7ff55cbeb0e43852b433b
parentecba0709e66e7fafdb8bd83059b701a6f8df5485 (diff)
downloadphp-git-ee619493b3c2ee7eb57922cc4af8e71bf599b621.tar.gz
Use a simple IFS; set step to interprete the httpd -v output
-rw-r--r--sapi/apache/config.m412
-rw-r--r--sapi/apache2filter/config.m42
2 files changed, 12 insertions, 2 deletions
diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4
index 90f4cdaedf..ec6101ede2 100644
--- a/sapi/apache/config.m4
+++ b/sapi/apache/config.m4
@@ -2,6 +2,16 @@ dnl
dnl $Id$
dnl
+AC_DEFUN(PHP_AP_EXTRACT_VERSION,[
+ ac_IFS=$IFS
+IFS="- /.
+"
+ set `$1 -v 2>&1`
+ IFS=$ac_IFS
+
+ APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
+])
+
AC_MSG_CHECKING(for Apache 1.x module support via DSO through APXS)
AC_ARG_WITH(apxs,
[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional
@@ -36,7 +46,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 | awk 'BEGIN { RS=" "; } /Apache/ { print $1; }' | cut -f2 -d'/' | cut -f1 -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([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2])
fi
diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4
index 86e4507dbf..776af54fe7 100644
--- a/sapi/apache2filter/config.m4
+++ b/sapi/apache2filter/config.m4
@@ -43,7 +43,7 @@ AC_ARG_WITH(apxs2,
done
# Test that we're trying to configure with apache 2.x
- APACHE_VERSION=`$APXS_HTTPD -v | head -1 | awk 'BEGIN { RS=" "; } /Apache/ { print $1; }' | cut -f2 -d'/' | cut -f1 -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([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)])
elif test "$APACHE_VERSION" -lt 2000040; then