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`
+])
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
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