components/php-5_3/php-sapi/patches/015_php_sapi_apache2handler_config.m4.patch
author Craig Mohrman <craig.mohrman@oracle.com>
Thu, 31 May 2012 14:36:45 -0700
changeset 846 fe258446a1ae
permissions -rw-r--r--
6714149 integrate PHP 5.3 within OpenSolaris

--- php-5.3.10/sapi/apache2handler/config.m4_orig	Tue Mar 11 15:47:39 2008
+++ php-5.3.10/sapi/apache2handler/config.m4	Wed Feb  8 11:25:25 2012
@@ -6,6 +6,23 @@
 [  --with-apxs2[=FILE]     Build shared Apache 2.0 Handler module. FILE is the optional
                           pathname to the Apache apxs tool [apxs]], no, no)
 
+dnl PHP_AP2_EXTRACT_VERSION(/path/httpd)
+dnl
+dnl This macro is used to get a comparable
+dnl version for apache/2.
+dnl
+AC_DEFUN([PHP_AP2_EXTRACT_VERSION],[
+  ac_output=`env LD_LIBRARY_PATH=$APXS_LIBDIR $1 -v 2>&1 | grep version`
+  ac_IFS=$IFS
+IFS="- /.
+"
+  set $ac_output
+  IFS=$ac_IFS
+
+  APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
+])
+
+dnl
 AC_MSG_CHECKING([for Apache 2.0 handler-module support via DSO through APXS])
 
 if test "$PHP_APXS2" != "no"; then
@@ -36,6 +53,7 @@
 
   APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
   APXS_BINDIR=`$APXS -q BINDIR`
+  APXS_LIBDIR=`$APXS -q LIBDIR`
   APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
   APXS_CFLAGS=`$APXS -q CFLAGS`
   APXS_MPM=`$APXS -q MPM_NAME`
@@ -61,6 +79,7 @@
 
   # Test that we're trying to configure with apache 2.x
   PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
+  PHP_AP2_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 2000044; then