Merge branch 'R_2_1'
[m6w6/ext-http] / config9.m4
index 457e59859d8776f9abc6b03972d4fc9bb7e0a957..9ca835630506f1a608fcfb7b75bb994e917dff50 100644 (file)
@@ -68,7 +68,6 @@ if test "$PHP_HTTP" != "no"; then
        AC_DEFUN([HTTP_HAVE_PHP_EXT], [
                extname=$1
                haveext=$[PHP_]translit($1,a-z_-,A-Z__)
-               
                AC_MSG_CHECKING([for ext/$extname support])
                if test -x "$PHP_EXECUTABLE"; then
                        grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
@@ -96,13 +95,11 @@ if test "$PHP_HTTP" != "no"; then
 dnl ----
 dnl STDC
 dnl ----
+       AC_TYPE_OFF_T
+       dnl getdomainname() is declared in netdb.h on some platforms: AIX, OSF
        AC_CHECK_HEADERS([netdb.h unistd.h])
        PHP_CHECK_FUNC(gethostname, nsl)
        PHP_CHECK_FUNC(getdomainname, nsl)
-       PHP_CHECK_FUNC(getservbyport, nsl)
-       PHP_CHECK_FUNC(getservbyport_r, nsl)
-       PHP_CHECK_FUNC(getservbyname, nsl)
-       PHP_CHECK_FUNC(getservbyname_r, nsl)
 
 dnl ----
 dnl ZLIB
@@ -252,6 +249,25 @@ dnl ----
                        else
                                AC_MSG_RESULT([no])
                        fi
+                       
+                       AC_MSG_CHECKING([for ares support in libcurl])
+                       AC_TRY_RUN([
+                               #include <curl/curl.h>
+                               int main(int argc, char *argv[]) {
+                                       curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+                                       if (data && data->ares && data->ares_num0) {
+                                               return 0;
+                                       }
+                                       return 1;
+                               }
+                       ], [
+                               AC_MSG_RESULT([yes])
+                               AC_DEFINE([PHP_HTTP_HAVE_ARES], [1], [ ])
+                       ], [
+                               AC_MSG_RESULT([no])
+                       ], [
+                               AC_MSG_RESULT([no])
+                       ])
                
                        INCLUDES="$save_INCLUDES"
                        LIBS="$save_LIBS"
@@ -312,7 +328,7 @@ dnl ----
                        AC_MSG_CHECKING([for libevent version, roughly])
                        
                        if test -f "$EVENT_DIR/include/event2/event.h"; then
-                               EVENT_VER="`$EGREP _EVENT_VERSION $EVENT_DIR/include/event2/event-config.h | $AWK '{print $3}'`"
+                               EVENT_VER="`$AWK '/_EVENT_VERSION/ {gsub(/\"/,\"\",$3); print $3}' < $EVENT_DIR/include/event2/event-config.h`"
                                AC_DEFINE([PHP_HTTP_HAVE_EVENT2], [1], [ ])
                        else
                                AC_DEFINE([PHP_HTTP_HAVE_EVENT2], [0], [ ])
@@ -360,7 +376,7 @@ dnl ----
                        PHP_ADD_INCLUDE([$HTTP_EXT_RAPHF_INCDIR])
                fi
        ], [
-               AC_MSG_ERROR([Please install pecl/raphf])
+               AC_MSG_ERROR([Please install pecl/raphf and activate extension=raphf.$SHLIB_DL_SUFFIX_NAME in your php.ini])
        ])
 
 dnl ----
@@ -388,7 +404,7 @@ dnl ----
                        PHP_ADD_INCLUDE([$HTTP_EXT_PROPRO_INCDIR])
                fi
        ], [
-               AC_MSG_ERROR([Please install pecl/propro])
+               AC_MSG_ERROR([Please install pecl/propro and activate extension=propro.$SHLIB_DL_SUFFIX_NAME in your php.ini])
        ])
 
 PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared],