From a1bbc6469b94cc02e5c409efdf3f364931d79e7e Mon Sep 17 00:00:00 2001 From: mhei Date: Mon, 29 Aug 2011 19:43:23 +0000 Subject: [PATCH] [packages] php5: PECL: include support for http git-svn-id: svn://svn.openwrt.org/openwrt/packages@28123 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- lang/php5/Makefile | 14 +- lang/php5/patches/030-PECL-add-http.patch | 29802 ++++++ .../php5/patches/900-prevent_buildconf_force.patch | 95187 ++++++++++++++++--- 3 files changed, 112597 insertions(+), 12406 deletions(-) create mode 100644 lang/php5/patches/030-PECL-add-http.patch diff --git a/lang/php5/Makefile b/lang/php5/Makefile index d93b3cabc..a0dc128ab 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=php PKG_VERSION:=5.3.6 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.php.net/distributions/ @@ -26,7 +26,7 @@ PHP5_MODULES = \ exif \ ftp \ gettext gd gmp \ - hash \ + hash http \ iconv \ json \ ldap libevent \ @@ -240,6 +240,15 @@ else CONFIGURE_ARGS+= --disable-hash endif +ifneq ($(CONFIG_PACKAGE_php5-mod-http),) + CONFIGURE_ARGS+= \ + --enable-http=shared \ + --without-http-shared-deps \ + --with-http-curl-requests="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= --disable-http +endif + ifneq ($(CONFIG_PACKAGE_php5-mod-iconv),) CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)" else @@ -495,6 +504,7 @@ $(eval $(call BuildModule,gettext,Gettext,+libintl-full)) $(eval $(call BuildModule,gd,GD graphics,+libgd)) $(eval $(call BuildModule,gmp,GMP,+libgmp)) $(eval $(call BuildModule,hash,Hash)) +$(eval $(call BuildModule,http,HTTP,+libcurl +librt)) $(eval $(call BuildModule,iconv,iConv,+libiconv)) $(eval $(call BuildModule,json,JSON)) $(eval $(call BuildModule,ldap,LDAP,+libopenldap +libsasl2)) diff --git a/lang/php5/patches/030-PECL-add-http.patch b/lang/php5/patches/030-PECL-add-http.patch new file mode 100644 index 000000000..825034348 --- /dev/null +++ b/lang/php5/patches/030-PECL-add-http.patch @@ -0,0 +1,29802 @@ +--- /dev/null ++++ b/ext/http/CREDITS +@@ -0,0 +1,2 @@ ++HTTP extension for PHP ++Michael Wallner +--- /dev/null ++++ b/ext/http/KnownIssues.txt +@@ -0,0 +1,33 @@ ++Known Issues ++============ ++$Id: KnownIssues.txt 292753 2009-12-29 12:30:43Z mike $ ++ ++PHP < 5.1.3: ++ HttpResponse::getHeader() does not work with Apache2 SAPIs. ++ Using an encoding stream filter on a stream you read from doesn't work. ++ ++Windows: ++ If you keep getting "SSL connect error" when trying to issue ++ requests, try another (newer) libeay32.dll/ssleay32.dll pair. ++ ++Internals: ++ Our http_urlencode_hash() does not differentiate between prefixes ++ for numeric or string keys. ++ Inflating raw deflated data causes a re-initialization of the inflate ++ stream where the corresponding window bits are modified to tell libz ++ to not check for zlib header bytes. This is not preventable AFAICS. ++ LFS dependant parts of libcurl are left out because of off_t, ++ respectively off64_t confusion. ++ Persistent handles and "cookiestore" request option do interfere, ++ as libcurl saves the cookies to the file on curl_easy_destroy(), ++ cookies are not saved until the CURL handle will be recycled. ++ Thus one would either need to ++ * run PHP with http.persistent.handles.limit = 0 ++ * call http_persistent_handles_clean() every request ++ * call $HttpRequest->flushCookies(), which is available ++ since libcurl v7.17.1 and does not work with the ++ procedural API ++ Anyway, none of these options is really perfect. ++ HTTP and Proxy authentication information (username/password) can not be ++ unset with NULL prior libcurl v7.19.6 and separate options for setting ++ username and password--which work--are only available since v7.19.6. +--- /dev/null ++++ b/ext/http/LICENSE +@@ -0,0 +1,47 @@ ++Copyright (c) 2004-2010, Michael Wallner . ++All rights reserved. ++ ++Redistribution and use in source and binary forms, with or without ++modification, are permitted provided that the following conditions are met: ++ ++ * Redistributions of source code must retain the above copyright notice, ++ this list of conditions and the following disclaimer. ++ * Redistributions in binary form must reproduce the above copyright ++ notice, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE ++FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ++OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++=============================================================================== ++ ++The date parser in file http_date_api.c is derived from the implementation ++found in the original libcurl source, licensed under the following conditions: ++ ++Copyright (c) 1996 - 2006, Daniel Stenberg, . ++All rights reserved. ++ ++Permission to use, copy, modify, and distribute this software for any purpose ++with or without fee is hereby granted, provided that the above copyright ++notice and this permission notice appear in all copies. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN ++NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, ++DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ++OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE ++OR OTHER DEALINGS IN THE SOFTWARE. ++ ++Except as contained in this notice, the name of a copyright holder shall not ++be used in advertising or otherwise to promote the sale, use or other dealings ++in this Software without prior written authorization of the copyright holder. ++ +--- /dev/null ++++ b/ext/http/Makefile.frag +@@ -0,0 +1,23 @@ ++# vim: noet ts=1 sw=1 ++ ++phpincludedir=$(prefix)/include/php ++ ++install-http: install install-http-headers ++ ++install-http-headers: ++ @echo "Installing HTTP headers: $(INSTALL_ROOT)$(phpincludedir)/ext/http/" ++ @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http ++ @for f in $(PHP_HTTP_HEADERS); do \ ++ if test -f "$(top_srcdir)/$$f"; then \ ++ $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_builddir)/$$f"; then \ ++ $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_srcdir)/ext/http/$$f"; then \ ++ $(INSTALL_DATA) $(top_srcdir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ elif test -f "$(top_builddir)/ext/http/$$f"; then \ ++ $(INSTALL_DATA) $(top_builddir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \ ++ else \ ++ echo "WTF? $$f"; \ ++ fi \ ++ done; ++ +--- /dev/null ++++ b/ext/http/ThanksTo.txt +@@ -0,0 +1,20 @@ ++Thanks To ++========= ++$Id: ThanksTo.txt 275653 2009-02-12 13:11:05Z mike $ ++ ++People who repeatedly reported issues with this extension in a manner ++so they could be fixed in a reasonable way, or suggested useful features ++to implement, in alphabetical order: ++ ++ Ilia Alshanetsky (ilia at php dot net) ++ Petr Czaderna (petr at hroch dot info) ++ David James (james82 at gmail dot com) ++ Thomas Landro Johnsen (thomas dot l dot johnsen at gmail dot com) ++ Clay Loveless (clay at killersoft dot com) ++ Felipe Pena (felipe at php dot net) ++ David Sklar (sklar at sklar dot com) ++ Travis Swicegood (travis at mashery dot com) ++ Alexey Zakhlestin (indeyets at gmail dot com) ++ Alexander Zhuravlev (zaa at zaa dot pp dot ru) ++ ++Thanks a lot! +--- /dev/null ++++ b/ext/http/config.m4 +@@ -0,0 +1,5 @@ ++dnl phpize stub of config9.m4 for pecl/http ++dnl $Id: config.m4 214417 2006-06-07 21:05:34Z mike $ ++dnl vim: noet ts=1 sw=1 ++ ++sinclude(config9.m4) +--- /dev/null ++++ b/ext/http/config.w32 +@@ -0,0 +1,129 @@ ++// config.w32 for pecl/http ++// $Id: config.w32 287971 2009-09-02 14:36:08Z pajoye $ ++ ++ARG_ENABLE("http", "whether to enable extended HTTP support", "no"); ++ ++function check_for_main_ext(ext, header) ++{ ++ if (!header) { ++ header = "php_"+ ext +".h"; ++ } ++ ++ /* When in configure, we're always in the root of PHP source */ ++ var ext_path = "ext\\" + ext; ++ ++ STDOUT.Write("Checking for ext/"+ ext +" ... "); ++ ++ if (FSO.FileExists(ext_path + "\\" + header)) { ++ STDOUT.WriteLine(ext_path); ++ return ext_path; ++ } ++ ++ STDOUT.WriteLine(""); ++ return false; ++} ++ ++function check_for_pecl_ext(ext, header) ++{ ++ if (!header) { ++ header = "php_"+ ext +".h"; ++ } ++ ++ var g; ++ var s = ext +"\\"+ header; ++ ++ STDOUT.Write("Checking for pecl/"+ ext +" ... "); ++ if ( (g = glob(configure_module_dirname +"\\..\\"+ s)) || ++ (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) { ++ var f = g[0].substr(0, g[0].length - header.length - 1); ++ STDOUT.WriteLine(f); ++ return f; ++ } ++ STDOUT.WriteLine(""); ++ return false; ++} ++ ++if (PHP_HTTP != "no") { ++ ++ EXTENSION("http", ++ "missing.c http.c http_functions.c http_exception_object.c "+ ++ "http_util_object.c http_message_object.c http_requestpool_object.c "+ ++ "http_request_object.c http_response_object.c "+ ++ "http_api.c http_cache_api.c http_request_pool_api.c "+ ++ "http_request_api.c http_date_api.c http_headers_api.c "+ ++ "http_message_api.c http_send_api.c http_url_api.c "+ ++ "http_info_api.c http_request_method_api.c http_encoding_api.c "+ ++ "http_filter_api.c http_request_body_api.c http_querystring_object.c "+ ++ "http_deflatestream_object.c http_inflatestream_object.c "+ ++ "http_cookie_api.c http_querystring_api.c http_request_datashare_api.c "+ ++ "http_requestdatashare_object.c http_request_info.c http_persistent_handle_api.c", ++ null, ++ "/I\"" + configure_module_dirname + "/phpstr\""); ++ ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http"); ++ AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support"); ++ AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions"); ++ ++ AC_DEFINE("HAVE_GETHOSTNAME", 1); ++ AC_DEFINE("HAVE_GETSERVBYPORT", 1); ++ AC_DEFINE("HAVE_GETSERVBYNAME", 1); ++ ++ if (PHP_DEBUG != "no") { ++ ADD_FLAG("CFLAGS_HTTP", "/W3"); ++ } ++ ++ if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) { ++ AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library"); ++ ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE"); ++ } else { ++ WARNING("zlib encoding functions not enabled; libraries and headers not found"); ++ } ++ ++ if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") { ++ var f; ++ ++ if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) { ++ ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1'); ++ ADD_EXTENSION_DEP("http", "hash", true); ++ } ++ } ++ ++ if (PHP_SESSION != "no") { ++ ADD_EXTENSION_DEP("http", "session", true); ++ } ++ ++ if (PHP_ICONV != "no") { ++ ADD_EXTENSION_DEP("http", "iconv", true); ++ } ++ ++ CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib"); ++ if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") && ++ CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") && ++ CHECK_LIB(CURL_LIB, "http", PHP_HTTP) && ++ CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) && ++ CHECK_LIB("libeay32.lib", "http", PHP_HTTP) && ++ CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) && ++ CHECK_LIB("winmm.lib", "http", PHP_HTTP)) { ++ AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library"); ++ AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL"); ++ AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_SHARE_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, ""); ++ AC_DEFINE("HAVE_CURL_EASY_RESET", 1, ""); ++ AC_DEFINE("HAVE_CURL_GETFORMDATA", 1, ""); ++ AC_DEFINE("HAVE_CURL_FORMGET", 1, ""); ++ AC_DEFINE("HAVE_CURL_MULTI_SETOPT", 1, ""); ++ AC_DEFINE("HAVE_CURL_MULTI_TIMEOUT", 1, ""); ++ } else { ++ WARNING("curl convenience functions not enabled; libraries and headers not found"); ++ } ++/* ++// MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib"; ++// if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") && ++// CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) { ++// AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library"); ++// AC_DEFINE("USE_MAGIC_STATIC", "", ""); ++// } else { ++// WARNING("content type guessing not enabled; libraries and headers not found"); ++// } ++*/ ++} +--- /dev/null ++++ b/ext/http/config9.m4 +@@ -0,0 +1,468 @@ ++dnl config.m4 for pecl/http ++dnl $Id: config9.m4 242664 2007-09-18 19:13:37Z mike $ ++dnl vim: noet ts=1 sw=1 ++ ++PHP_ARG_ENABLE([http], [whether to enable extended HTTP support], ++[ --enable-http Enable extended HTTP support]) ++PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared], ++[ --with-http-shared-deps ++ HTTP: disable to not depend on extensions like hash, ++ iconv and session (when built shared)], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP request support], ++[ --with-http-curl-requests[=LIBCURLDIR] ++ HTTP: with cURL request support], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-curl-libevent], [whether to enable libevent support fur cURL], ++[ --with-http-curl-libevent[=LIBEVENTDIR] ++ HTTP: libevent install directory], $PHP_HTTP_CURL_REQUESTS, "") ++PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support], ++[ --with-http-zlib-compression[=LIBZDIR] ++ HTTP: with zlib encodings support], $PHP_HTTP, $PHP_HTTP) ++PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing], ++[ --with-http-magic-mime[=LIBMAGICDIR] ++ HTTP: with magic mime response content type guessing], "no", "no") ++ ++if test "$PHP_HTTP" != "no"; then ++ ++ ifdef([AC_PROG_EGREP], [ ++ AC_PROG_EGREP ++ ], [ ++ AC_CHECK_PROG(EGREP, egrep, egrep) ++ ]) ++ ifdef([AC_PROG_SED], [ ++ AC_PROG_SED ++ ], [ ++ ifdef([LT_AC_PROG_SED], [ ++ LT_AC_PROG_SED ++ ], [ ++ AC_CHECK_PROG(SED, sed, sed) ++ ]) ++ ]) ++ ++ AC_PROG_CPP ++ ++ if test "$PHP_HTTP_SHARED_DEPS" != "no"; then ++ AC_DEFINE([HTTP_SHARED_DEPS], [1], [ ]) ++ else ++ AC_DEFINE([HTTP_SHARED_DEPS], [0], [ ]) ++ fi ++ ++ dnl ++ dnl HTTP_SHARED_DEP(name[, code-if-yes[, code-if-not]]) ++ dnl ++ AC_DEFUN([HTTP_SHARED_DEP], [ ++ extname=$1 ++ haveext=$[HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__) ++ ++ AC_MSG_CHECKING([whether to add a dependency on ext/$extname]) ++ if test "$PHP_HTTP_SHARED_DEPS" = "no"; then ++ AC_MSG_RESULT([no]) ++ $3 ++ elif test "$haveext"; then ++ AC_MSG_RESULT([yes]) ++ ifdef([PHP_ADD_EXTENSION_DEP], [ ++ PHP_ADD_EXTENSION_DEP([http], $1, true) ++ ]) ++ $2 ++ else ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ ]) ++ ++ dnl ++ dnl HTTP_HAVE_PHP_EXT(name[, code-if-yes[, code-if-not]]) ++ dnl ++ 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\$` ++ if test "$grepext" = "$extname"; then ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1 ++ AC_MSG_RESULT([yes]) ++ $2 ++ else ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)= ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1 ++ AC_MSG_RESULT([yes]) ++ $2 ++ else ++ [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)= ++ AC_MSG_RESULT([no]) ++ $3 ++ fi ++ ]) ++ ++ dnl ++ dnl odd PHP4 fix ++ dnl ++ if test "x$PHP_LIBDIR" = "x"; then ++ PHP_LIBDIR=lib ++ fi ++ ++dnl ---- ++dnl STDC ++dnl ---- ++ 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(getservbyname, nsl) ++ ++dnl ---- ++dnl ZLIB ++dnl ---- ++ if test "$PHP_HTTP_ZLIB_COMPRESSION" != "no"; then ++ AC_MSG_CHECKING([for zlib.h]) ++ ZLIB_DIR= ++ for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do ++ if test -f "$i/include/zlib.h"; then ++ ZLIB_DIR=$i ++ break; ++ fi ++ done ++ if test "x$ZLIB_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find zlib.h]) ++ else ++ AC_MSG_RESULT([found in $ZLIB_DIR]) ++ AC_MSG_CHECKING([for zlib version >= 1.2.0.4]) ++ ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'` ++ AC_MSG_RESULT([$ZLIB_VERSION]) ++ if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then ++ AC_MSG_ERROR([libz version greater or equal to 1.2.0.4 required]) ++ else ++ PHP_ADD_INCLUDE($ZLIB_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(z, $ZLIB_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_ZLIB], [1], [Have zlib support]) ++ fi ++ fi ++ fi ++ ++dnl ---- ++dnl CURL ++dnl ---- ++ if test "$PHP_HTTP_CURL_REQUESTS" != "no"; then ++ AC_MSG_CHECKING([for curl/curl.h]) ++ CURL_DIR= ++ for i in "$PHP_HTTP_CURL_REQUESTS" /usr/local /usr /opt; do ++ if test -f "$i/include/curl/curl.h"; then ++ CURL_DIR=$i ++ break ++ fi ++ done ++ if test "x$CURL_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find curl/curl.h]) ++ else ++ AC_MSG_RESULT([found in $CURL_DIR]) ++ fi ++ ++ AC_MSG_CHECKING([for curl-config]) ++ CURL_CONFIG= ++ for i in "$CURL_DIR/bin/curl-config" "$CURL_DIR/curl-config" `which curl-config`; do ++ if test -x "$i"; then ++ CURL_CONFIG=$i ++ break ++ fi ++ done ++ if test "x$CURL_CONFIG" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find curl-config]) ++ else ++ AC_MSG_RESULT([found: $CURL_CONFIG]) ++ fi ++ ++ dnl Debian stable has currently 7.13.2 (this is not a typo) ++ AC_MSG_CHECKING([for curl version >= 7.12.3]) ++ CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[[^0-9\.]]//g'` ++ AC_MSG_RESULT([$CURL_VERSION]) ++ if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71203; then ++ AC_MSG_ERROR([libcurl version greater or equal to 7.12.3 required]) ++ fi ++ ++ dnl ++ dnl compile tests ++ dnl ++ ++ save_INCLUDES="$INCLUDES" ++ INCLUDES= ++ save_LIBS="$LIBS" ++ LIBS= ++ save_CFLAGS="$CFLAGS" ++ CFLAGS=`$CURL_CONFIG --cflags` ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS=`$CURL_CONFIG --libs` ++ LDFLAGS="$LDFLAGS $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR" ++ ++ AC_MSG_CHECKING([for SSL support in libcurl]) ++ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` ++ if test "$CURL_SSL" = "SSL"; then ++ AC_MSG_RESULT([yes]) ++ AC_DEFINE([HTTP_HAVE_SSL], [1], [ ]) ++ ++ AC_MSG_CHECKING([for openssl support in libcurl]) ++ AC_TRY_RUN([ ++ #include ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); ++ } ++ return 1; ++ } ++ ], [ ++ AC_MSG_RESULT([yes]) ++ AC_CHECK_HEADER([openssl/crypto.h], [ ++ AC_DEFINE([HTTP_HAVE_OPENSSL], [1], [ ]) ++ ]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ]) ++ ++ AC_MSG_CHECKING([for gnutls support in libcurl]) ++ AC_TRY_RUN([ ++ #include ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); ++ } ++ return 1; ++ } ++ ], [ ++ AC_MSG_RESULT([yes]) ++ AC_CHECK_HEADER([gcrypt.h], [ ++ AC_DEFINE([HTTP_HAVE_GNUTLS], [1], [ ]) ++ ]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ]) ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ ++ INCLUDES="$save_INCLUDES" ++ LIBS="$save_LIBS" ++ CFLAGS="$save_CFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ ++ dnl end compile tests ++ ++ AC_MSG_CHECKING([for bundled SSL CA info]) ++ CURL_CAINFO= ++ for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do ++ if test -f "$i"; then ++ CURL_CAINFO="$i" ++ break ++ fi ++ done ++ if test "x$CURL_CAINFO" = "x"; then ++ AC_MSG_RESULT([not found]) ++ else ++ AC_MSG_RESULT([$CURL_CAINFO]) ++ AC_DEFINE_UNQUOTED([HTTP_CURL_CAINFO], ["$CURL_CAINFO"], [path to bundled SSL CA info]) ++ fi ++ ++ PHP_ADD_INCLUDE($CURL_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ PHP_EVAL_LIBLINE(`$CURL_CONFIG --libs`, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_CURL], [1], [Have cURL support]) ++ ++ PHP_CHECK_LIBRARY(curl, curl_share_strerror, ++ [AC_DEFINE([HAVE_CURL_SHARE_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_strerror, ++ [AC_DEFINE([HAVE_CURL_MULTI_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_easy_strerror, ++ [AC_DEFINE([HAVE_CURL_EASY_STRERROR], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_easy_reset, ++ [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_formget, ++ [AC_DEFINE([HAVE_CURL_FORMGET], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_setopt, ++ [AC_DEFINE([HAVE_CURL_MULTI_SETOPT], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ PHP_CHECK_LIBRARY(curl, curl_multi_timeout, ++ [AC_DEFINE([HAVE_CURL_MULTI_TIMEOUT], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ ++ dnl ---- ++ dnl EVENT ++ dnl ---- ++ ++ if test "$PHP_HTTP_CURL_LIBEVENT" != "no"; then ++ HTTP_HAVE_PHP_EXT([event], [ ++ AC_MSG_WARN([event support is incompatible with pecl/event; continuing without libevent support]) ++ ], [ ++ AC_MSG_CHECKING([for event.h]) ++ EVENT_DIR= ++ for i in "$PHP_HTTP_CURL_LIBEVENT" /usr/local /usr /opt; do ++ if test -f "$i/include/event.h"; then ++ EVENT_DIR=$i ++ break ++ fi ++ done ++ if test "x$EVENT_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_WARN([continuing without libevent support]) ++ else ++ AC_MSG_RESULT([found in $EVENT_DIR]) ++ ++ AC_MSG_CHECKING([for libevent version, roughly]) ++ EVENT_VER="1.1b or lower" ++ if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then ++ if test -f "$EVENT_DIR/include/evrpc.h"; then ++ EVENT_VER="1.4 or greater" ++ else ++ EVENT_VER="1.2 or greater" ++ fi ++ fi ++ AC_DEFINE_UNQUOTED([HTTP_EVENT_VERSION], ["$EVENT_VER"], [ ]) ++ AC_MSG_RESULT([$EVENT_VER]) ++ ++ AC_MSG_CHECKING([for libcurl version >= 7.16.0]) ++ AC_MSG_RESULT([$CURL_VERSION]) ++ if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then ++ AC_MSG_WARN([libcurl version greater or equal to 7.16.0 required; continuing without libevent support]) ++ else ++ PHP_ADD_INCLUDE($EVENT_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(event, $EVENT_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_EVENT], [1], [Have libevent support for cURL]) ++ PHP_CHECK_LIBRARY(curl, curl_multi_socket_action, ++ [AC_DEFINE([HAVE_CURL_MULTI_SOCKET_ACTION], [1], [ ])], [ ], ++ [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ++ ) ++ fi ++ fi ++ ]) ++ fi ++ fi ++ ++dnl ---- ++dnl MAGIC ++dnl ---- ++ if test "$PHP_HTTP_MAGIC_MIME" != "no"; then ++ AC_MSG_CHECKING([for magic.h]) ++ MAGIC_DIR= ++ for i in "$PHP_HTTP_MAGIC_MIME" /usr/local /usr /opt; do ++ if test -f "$i/include/magic.h"; then ++ MAGIC_DIR=$i ++ break ++ fi ++ done ++ if test "x$MAGIC_DIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ AC_MSG_ERROR([could not find magic.h]) ++ else ++ AC_MSG_RESULT([found in $MAGIC_DIR]) ++ fi ++ ++ PHP_ADD_INCLUDE($MAGIC_DIR/include) ++ PHP_ADD_LIBRARY_WITH_PATH(magic, $MAGIC_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD) ++ AC_DEFINE([HTTP_HAVE_MAGIC], [1], [Have magic mime support]) ++ fi ++ ++dnl ---- ++dnl HASH ++dnl ---- ++ HTTP_HAVE_PHP_EXT([hash], [ ++ AC_MSG_CHECKING([for php_hash.h]) ++ HTTP_EXT_HASH_INCDIR= ++ for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../hash; do ++ if test -d $i; then ++ if test -f $i/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i ++ break ++ elif test -f $i/ext/hash/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i/ext/hash ++ break ++ fi ++ fi ++ done ++ if test "x$HTTP_EXT_HASH_INCDIR" = "x"; then ++ AC_MSG_RESULT([not found]) ++ else ++ AC_MSG_RESULT([$HTTP_EXT_HASH_INCDIR]) ++ AC_DEFINE([HTTP_HAVE_PHP_HASH_H], [1], [Have ext/hash support]) ++ PHP_ADD_INCLUDE([$HTTP_EXT_HASH_INCDIR]) ++ fi ++ ]) ++ ++dnl ---- ++dnl ICONV ++dnl ---- ++ HTTP_HAVE_PHP_EXT([iconv]) ++ ++dnl ---- ++dnl SESSION ++dnl ---- ++ HTTP_HAVE_PHP_EXT([session]) ++ ++dnl ---- ++dnl DONE ++dnl ---- ++ PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \ ++ http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \ ++ http_response_object.c http_exception_object.c http_requestpool_object.c \ ++ http_api.c http_cache_api.c http_request_api.c http_request_info.c http_date_api.c \ ++ http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \ ++ http_info_api.c http_request_method_api.c http_encoding_api.c \ ++ http_filter_api.c http_request_body_api.c http_querystring_object.c \ ++ http_deflatestream_object.c http_inflatestream_object.c http_cookie_api.c \ ++ http_querystring_api.c http_request_datashare_api.c http_requestdatashare_object.c \ ++ http_persistent_handle_api.c" ++ ++ PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, $ext_shared) ++ ++ dnl shared extension deps ++ HTTP_SHARED_DEP([hash]) ++ HTTP_SHARED_DEP([iconv]) ++ HTTP_SHARED_DEP([session]) ++ ++ PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1) ++ PHP_SUBST([HTTP_SHARED_LIBADD]) ++ ++ PHP_HTTP_HEADERS="php_http_std_defs.h php_http.h php_http_api.h php_http_cache_api.h \ ++ php_http_date_api.h php_http_headers_api.h php_http_info_api.h php_http_message_api.h \ ++ php_http_request_api.h php_http_request_method_api.h php_http_send_api.h php_http_url_api.h \ ++ php_http_encoding_api.h phpstr/phpstr.h missing.h php_http_request_body_api.h \ ++ php_http_exception_object.h php_http_message_object.h php_http_request_object.h \ ++ php_http_requestpool_object.h php_http_response_object.h php_http_util_object.h \ ++ php_http_querystring_object.h php_http_deflatestream_object.h php_http_inflatestream_object.h \ ++ php_http_cookie_api.h php_http_querystring_api.h php_http_request_datashare_api.h php_http_requestdatashare_object.h \ ++ php_http_persistent_handle_api.h" ++ ifdef([PHP_INSTALL_HEADERS], [ ++ PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS) ++ ], [ ++ PHP_SUBST([PHP_HTTP_HEADERS]) ++ PHP_ADD_MAKEFILE_FRAGMENT ++ ]) ++ ++ AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support]) ++fi +--- /dev/null ++++ b/ext/http/docs/examples/tutorial.txt +@@ -0,0 +1,175 @@ ++ ++A Beginners Tutorial ++-------------------- ++$Revision: 208773 $ ++ ++ ++- GET Queries ++ ++ The HttpRequest class can be used to execute any HTTP request method. ++ The following example shows a simple GET request where a few query ++ parameters are supplied. Additionally potential cookies will be ++ read from and written to a file. ++ ++setOptions( ++ array( 'cookiestore' => 'google.txt', ++ ) ++); ++ ++$r->setQueryData( ++ array( 'q' => '+"pecl_http" -msg -cvs -list', ++ 'hl' => 'de' ++ ) ++); ++ ++// HttpRequest::send() returns an HttpMessage object ++// of type HttpMessage::TYPE_RESPONSE or throws an exception ++try { ++ print $r->send()->getBody(); ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Multipart Posts ++ ++ The following example shows an multipart POST request, with two form ++ fields and an image that's supposed to be uploaded to the server. ++ It's a bad habit as well as common practice to issue a redirect after ++ an received POST request, so we'll allow a redirect by enabling the ++ redirect option. ++ ++setOptions( ++ array( 'cookies' => array('MyCookie' => 'has a value'), ++ 'redirect' => true, ++ ) ++); ++ ++// common form data ++$r->setPostFields( ++ array( 'name' => 'Mike', ++ 'mail' => 'mike@php.net', ++ ) ++); ++// add the file to post (form name, file name, file type) ++touch('profile.jpg'); ++$r->addPostFile('image', 'profile.jpg', 'image/jpeg'); ++ ++try { ++ print $r->send()->getBody(); ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Parallel Requests ++ ++ It's possible to execute several HttpRequests in parallel with the ++ HttpRequestPool class. HttpRequests to send, do not need to perform ++ the same request method, but can only be attached to one HttpRequestPool ++ at the same time. ++ ++attach(new HttpRequest('http://pear.php.net', HTTP_METH_HEAD)); ++ $p->attach(new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD)); ++} catch (HttpException $e) { ++ print $e; ++ exit; ++} ++ ++try { ++ $p->send(); ++ // HttpRequestPool implements an iterator over attached HttpRequest objects ++ foreach ($p as $r) { ++ echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; ++ } ++} catch (HttpException $e) { ++ print $e; ++} ++?> ++ ++- Parallel Requests? ++ ++ You can use a more advanced approach by using the protected interface of ++ the HttpRequestPool class. This allows you to perform some other tasks ++ while the requests are executed. ++ ++socketPerform(); $i++) { ++ $i % 10 or print "."; ++ if (!$this->socketSelect()) { ++ throw new HttpException("Socket error!"); ++ } ++ } ++ print "\nDone!\n"; ++ } ++} ++ ++try { ++ foreach (new Pool as $r) { ++ echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; ++ } ++} catch (HttpException $ex) { ++ print $e; ++} ++?> ++ ++- Cached Responses ++ ++ One of the main key features of HttpResponse is HTTP caching. HttpResponse ++ will calculate an ETag based on the http.etag_mode INI setting as well as ++ it will determine the last modification time of the sent entity. It uses ++ those two indicators to decide if the cache entry on the client side is ++ still valid and will emit an "304 Not Modified" response if applicable. ++ ++ ++ ++- Bandwidth Throttling ++ ++ HttpResponse supports a basic throttling mechanism, which is enabled by ++ setting a throttle delay and a buffer size. PHP will sleep the specified ++ amount of seconds after each sent chunk of specified bytes. ++ ++ +--- /dev/null ++++ b/ext/http/docs/http.ini +@@ -0,0 +1,61 @@ ++; example INI file for pecl/http ++; $Id: http.ini 229420 2007-02-09 14:19:40Z mike $ ++ ++[http] ++; enable if you want to transform all errors to exceptions (PHP >= 5 only) ++;http.only_exceptions = 1 ++ ++; disable if you don't want php to exit in case of redirects and cache hits; ++; a "NULL" output handler will be started instead, which discards all output ++;http.force_exit = 0 ++ ++; disable if you don't want 404 Not found status messages being sent, ++; if a file attempted to be sent with http_send_file() etc. cannot be found ++;http.send.not_found_404 = 0 ++ ++; the hashing algorithm with wich ETags are generated (MD5, SHA1, CRC32B); ++; if ext/hash is available, this can be set to any hash algorithm ext/hash supports ++; MD5 is the default and fallback algorithm ++;http.etag.mode = "MD5" ++ ++; allowed request methods ++; by default PHP ignores unkown request methods ++; PHP will exit with a response status of 405 and an Allow header ++; if it encounters a request method not contained in the specified list ++;http.request.methods.allowed = "HEAD, GET, POST" ++ ++; custom request methods ++;http.request.methods.custom = "KICK, BANN" ++ ++; log file for positive cache hits ++;http.log.cache = ++ ++; log file for redirects ++;http.log.redirect = ++ ++; log file for responses with http_send_file() etc. where the file's not been found ++;http.log.not_found = ++ ++; log file for requests with an unallowed request method ++;http.log.allowed_methods = ++ ++; composite log file (i.e. log all messages to this file) ++;http.log.composite = ++ ++; automatically deflate content if requested/supported by client ++;http.send.deflate.start_auto = 1 ++;http.send.deflate.start_flags = HTTP_DEFLATE_LEVEL_DEF ++ ++; automatically inflate sent content ++;http.send.inflate.start_auto = 0 ++;http.send.inflate.start_flags = ++ ++; global HttpRequestDataShare settings ++;http.request.datashare.cookie = 0 ++;http.request.datashare.dns = 1 ++ ++; limit of idle persistent handles per provider ++;http.persistent.handles.limit = -1 ++ ++; default ident of persistent handles ++;http.persistent.handles.ident = "GLOBAL" +--- /dev/null ++++ b/ext/http/http.c +@@ -0,0 +1,546 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http.c 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_EVENT ++#define HTTP_WANT_ZLIB ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#include "php_ini.h" ++#include "ext/standard/info.h" ++#include "zend_extensions.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_filter_api.h" ++#include "php_http_message_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_request_method_api.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++#include "php_http_deflatestream_object.h" ++#include "php_http_exception_object.h" ++#include "php_http_inflatestream_object.h" ++#include "php_http_message_object.h" ++#include "php_http_querystring_object.h" ++#include "php_http_request_object.h" ++#include "php_http_requestdatashare_object.h" ++#include "php_http_requestpool_object.h" ++#include "php_http_response_object.h" ++#include "php_http_util_object.h" ++ ++ZEND_DECLARE_MODULE_GLOBALS(http); ++HTTP_DECLARE_ARG_PASS_INFO(); ++ ++#ifdef COMPILE_DL_HTTP ++ZEND_GET_MODULE(http) ++#endif ++ ++/* {{{ http_functions[] */ ++zend_function_entry http_functions[] = { ++ PHP_FE(http_date, NULL) ++ PHP_FE(http_build_url, http_arg_pass_ref_4) ++ PHP_FE(http_build_str, NULL) ++#ifndef ZEND_ENGINE_2 ++ PHP_FALIAS(http_build_query, http_build_str, NULL) ++#endif ++ PHP_FE(http_negotiate_language, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate_charset, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate_content_type, http_arg_pass_ref_2) ++ PHP_FE(http_negotiate, http_arg_pass_ref_3) ++ PHP_FE(http_redirect, NULL) ++ PHP_FE(http_throttle, NULL) ++ PHP_FE(http_send_status, NULL) ++ PHP_FE(http_send_last_modified, NULL) ++ PHP_FE(http_send_content_type, NULL) ++ PHP_FE(http_send_content_disposition, NULL) ++ PHP_FE(http_match_modified, NULL) ++ PHP_FE(http_match_etag, NULL) ++ PHP_FE(http_cache_last_modified, NULL) ++ PHP_FE(http_cache_etag, NULL) ++ PHP_FE(http_send_data, NULL) ++ PHP_FE(http_send_file, NULL) ++ PHP_FE(http_send_stream, NULL) ++ PHP_FE(http_chunked_decode, NULL) ++ PHP_FE(http_parse_message, NULL) ++ PHP_FE(http_parse_headers, NULL) ++ PHP_FE(http_parse_cookie, NULL) ++ PHP_FE(http_build_cookie, NULL) ++ PHP_FE(http_parse_params, NULL) ++ PHP_FE(http_get_request_headers, NULL) ++ PHP_FE(http_get_request_body, NULL) ++ PHP_FE(http_get_request_body_stream, NULL) ++ PHP_FE(http_match_request_header, NULL) ++ PHP_FE(http_persistent_handles_count, NULL) ++ PHP_FE(http_persistent_handles_clean, NULL) ++ PHP_FE(http_persistent_handles_ident, NULL) ++#ifdef HTTP_HAVE_CURL ++ PHP_FE(http_get, http_arg_pass_ref_3) ++ PHP_FE(http_head, http_arg_pass_ref_3) ++ PHP_FE(http_post_data, http_arg_pass_ref_4) ++ PHP_FE(http_post_fields, http_arg_pass_ref_5) ++ PHP_FE(http_put_data, http_arg_pass_ref_4) ++ PHP_FE(http_put_file, http_arg_pass_ref_4) ++ PHP_FE(http_put_stream, http_arg_pass_ref_4) ++ PHP_FE(http_request, http_arg_pass_ref_5) ++ PHP_FE(http_request_body_encode, NULL) ++#endif ++ PHP_FE(http_request_method_register, NULL) ++ PHP_FE(http_request_method_unregister, NULL) ++ PHP_FE(http_request_method_exists, NULL) ++ PHP_FE(http_request_method_name, NULL) ++ PHP_FE(ob_etaghandler, NULL) ++#ifdef HTTP_HAVE_ZLIB ++ PHP_FE(http_deflate, NULL) ++ PHP_FE(http_inflate, NULL) ++ PHP_FE(ob_deflatehandler, NULL) ++ PHP_FE(ob_inflatehandler, NULL) ++#endif ++ PHP_FE(http_support, NULL) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++/* }}} */ ++ ++PHP_MINIT_FUNCTION(http); ++PHP_MSHUTDOWN_FUNCTION(http); ++PHP_RINIT_FUNCTION(http); ++PHP_RSHUTDOWN_FUNCTION(http); ++PHP_MINFO_FUNCTION(http); ++ ++/* {{{ http_module_dep */ ++#if ZEND_EXTENSION_API_NO >= 220050617 ++static zend_module_dep http_module_deps[] = { ++# ifdef HTTP_HAVE_SPL ++ ZEND_MOD_REQUIRED("spl") ++# endif ++# ifdef HTTP_HAVE_HASH ++ ZEND_MOD_REQUIRED("hash") ++# endif ++# ifdef HTTP_HAVE_SESSION ++ ZEND_MOD_REQUIRED("session") ++# endif ++# ifdef HTTP_HAVE_ICONV ++ ZEND_MOD_REQUIRED("iconv") ++# endif ++# ifdef HTTP_HAVE_EVENT ++ ZEND_MOD_CONFLICTS("event") ++#endif ++ {NULL, NULL, NULL, 0} ++}; ++#endif ++/* }}} */ ++ ++/* {{{ http_module_entry */ ++zend_module_entry http_module_entry = { ++#if ZEND_EXTENSION_API_NO >= 220050617 ++ STANDARD_MODULE_HEADER_EX, NULL, ++ http_module_deps, ++#else ++ STANDARD_MODULE_HEADER, ++#endif ++ "http", ++ http_functions, ++ PHP_MINIT(http), ++ PHP_MSHUTDOWN(http), ++ PHP_RINIT(http), ++ PHP_RSHUTDOWN(http), ++ PHP_MINFO(http), ++ PHP_HTTP_VERSION, ++ STANDARD_MODULE_PROPERTIES ++}; ++/* }}} */ ++ ++int http_module_number; ++ ++/* {{{ http_globals */ ++static void http_globals_init_once(zend_http_globals *G) ++{ ++ memset(G, 0, sizeof(zend_http_globals)); ++} ++ ++#define http_globals_init(g) _http_globals_init((g) TSRMLS_CC) ++static inline void _http_globals_init(zend_http_globals *G TSRMLS_DC) ++{ ++#ifdef HTTP_HAVE_SAPI_RTIME ++ G->request.time = sapi_get_request_time(TSRMLS_C); ++#else ++ G->request.time = time(NULL); ++#endif ++ G->send.buffer_size = 0; ++ G->read_post_data = 0; ++} ++ ++#define http_globals_free(g) _http_globals_free((g) TSRMLS_CC) ++static inline void _http_globals_free(zend_http_globals *G TSRMLS_DC) ++{ ++ if (G->request.headers) { ++ zend_hash_destroy(G->request.headers); ++ FREE_HASHTABLE(G->request.headers); ++ G->request.headers = NULL; ++ } ++ STR_SET(G->send.content_type, NULL); ++ STR_SET(G->send.unquoted_etag, NULL); ++ if (G->server_var) { ++ zval_ptr_dtor(&G->server_var); ++ G->server_var = NULL; ++ } ++} ++ ++#if defined(ZTS) && defined(PHP_DEBUG) ++#if ZTS && PHP_DEBUG ++zend_http_globals *http_globals(void) ++{ ++ TSRMLS_FETCH(); ++ return HTTP_G; ++} ++#endif ++#endif ++/* }}} */ ++ ++/* {{{ static inline void http_check_allowed_methods(char *) */ ++#define http_check_allowed_methods(m) _http_check_allowed_methods((m) TSRMLS_CC) ++static inline void _http_check_allowed_methods(const char *methods TSRMLS_DC) ++{ ++ if (*methods && SG(request_info).request_method) { ++ if (SUCCESS != http_check_method_ex(SG(request_info).request_method, methods)) { ++ char *header; ++ spprintf(&header, 0, "Allow: %s", methods); ++ http_exit(405, header); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ PHP_INI */ ++PHP_INI_MH(http_update_allowed_methods) ++{ ++ if (*new_value) { ++ http_check_allowed_methods(new_value); ++ } ++ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); ++} ++PHP_INI_MH(http_update_persistent_handle_ident) ++{ ++ HTTP_G->persistent.handles.ident.h = zend_hash_func(new_value, HTTP_G->persistent.handles.ident.l = new_value_length+1); ++ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); ++} ++ ++#ifndef ZEND_ENGINE_2 ++# define OnUpdateLong OnUpdateInt ++#endif ++ ++PHP_INI_BEGIN() ++ HTTP_PHP_INI_ENTRY("http.etag.mode", "MD5", PHP_INI_ALL, OnUpdateString, etag.mode) ++ HTTP_PHP_INI_ENTRY("http.log.cache", "", PHP_INI_ALL, OnUpdateString, log.cache) ++ HTTP_PHP_INI_ENTRY("http.log.redirect", "", PHP_INI_ALL, OnUpdateString, log.redirect) ++ HTTP_PHP_INI_ENTRY("http.log.not_found", "", PHP_INI_ALL, OnUpdateString, log.not_found) ++ HTTP_PHP_INI_ENTRY("http.log.allowed_methods", "", PHP_INI_ALL, OnUpdateString, log.allowed_methods) ++ HTTP_PHP_INI_ENTRY("http.log.composite", "", PHP_INI_ALL, OnUpdateString, log.composite) ++ HTTP_PHP_INI_ENTRY("http.request.methods.allowed", "", PHP_INI_ALL, http_update_allowed_methods, request.methods.allowed) ++ HTTP_PHP_INI_ENTRY("http.request.methods.custom", "", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, request.methods.custom) ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.cookie", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.cookie) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.dns", "1", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.dns) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.ssl", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.ssl) ++ HTTP_PHP_INI_ENTRY("http.request.datashare.connect", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.connect) ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ HTTP_PHP_INI_ENTRY("http.send.inflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.inflate.start_auto) ++ HTTP_PHP_INI_ENTRY("http.send.inflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.inflate.start_flags) ++ HTTP_PHP_INI_ENTRY("http.send.deflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.deflate.start_auto) ++ HTTP_PHP_INI_ENTRY("http.send.deflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.deflate.start_flags) ++#endif ++ HTTP_PHP_INI_ENTRY("http.persistent.handles.limit", "-1", PHP_INI_SYSTEM, OnUpdateLong, persistent.handles.limit) ++ HTTP_PHP_INI_ENTRY("http.persistent.handles.ident", "GLOBAL", PHP_INI_ALL, http_update_persistent_handle_ident, persistent.handles.ident.s) ++ HTTP_PHP_INI_ENTRY("http.send.not_found_404", "1", PHP_INI_ALL, OnUpdateBool, send.not_found_404) ++#ifdef ZEND_ENGINE_2 ++ HTTP_PHP_INI_ENTRY("http.only_exceptions", "0", PHP_INI_ALL, OnUpdateBool, only_exceptions) ++#endif ++ HTTP_PHP_INI_ENTRY("http.force_exit", "1", PHP_INI_ALL, OnUpdateBool, force_exit) ++PHP_INI_END() ++/* }}} */ ++ ++/* {{{ PHP_MINIT_FUNCTION */ ++PHP_MINIT_FUNCTION(http) ++{ ++ http_module_number = module_number; ++ ZEND_INIT_MODULE_GLOBALS(http, http_globals_init_once, NULL); ++ REGISTER_INI_ENTRIES(); ++ ++ if (0 ++ || SUCCESS != PHP_MINIT_CALL(http_persistent_handle) /* first */ ++ || SUCCESS != PHP_MINIT_CALL(http_cookie) ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_MINIT_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MINIT_CALL(http_request) ++# ifdef ZEND_ENGINE_2 ++# endif ++#endif ++ || SUCCESS != PHP_MINIT_CALL(http_request_method) ++ || SUCCESS != PHP_MINIT_CALL(http_send) ++ || SUCCESS != PHP_MINIT_CALL(http_support) ++ || SUCCESS != PHP_MINIT_CALL(http_url) ++ ++#ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_MINIT_CALL(http_filter) ++ || SUCCESS != PHP_MINIT_CALL(http_exception_object) ++# ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_MINIT_CALL(http_deflatestream_object) ++ || SUCCESS != PHP_MINIT_CALL(http_inflatestream_object) ++# endif ++ || SUCCESS != PHP_MINIT_CALL(http_message_object) ++ || SUCCESS != PHP_MINIT_CALL(http_querystring_object) ++# ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MINIT_CALL(http_request_datashare) ++ || SUCCESS != PHP_MINIT_CALL(http_request_pool) ++ || SUCCESS != PHP_MINIT_CALL(http_request_object) ++ || SUCCESS != PHP_MINIT_CALL(http_requestdatashare_object) ++ || SUCCESS != PHP_MINIT_CALL(http_requestpool_object) ++# endif ++# ifndef WONKY ++ || SUCCESS != PHP_MINIT_CALL(http_response_object) ++# endif ++ || SUCCESS != PHP_MINIT_CALL(http_util_object) ++#endif ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_MSHUTDOWN_FUNCTION */ ++PHP_MSHUTDOWN_FUNCTION(http) ++{ ++ UNREGISTER_INI_ENTRIES(); ++ ++ if (0 ++#ifdef HTTP_HAVE_CURL ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_request) ++# ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_message_object) ++ || SUCCESS != PHP_MSHUTDOWN_CALL(http_persistent_handle) /* last */ ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RINIT_FUNCTION */ ++PHP_RINIT_FUNCTION(http) ++{ ++ http_globals_init(HTTP_G); ++ ++ if (HTTP_G->request.methods.allowed && *HTTP_G->request.methods.allowed) { ++ http_check_allowed_methods(HTTP_G->request.methods.allowed); ++ } ++ ++ if (0 ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_RINIT_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++# ifdef HTTP_HAVE_EVENT ++ || SUCCESS != PHP_RINIT_CALL(http_request_pool) ++# endif ++ || SUCCESS != PHP_RINIT_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_RINIT_CALL(http_request_method) ++ ) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ PHP_RSHUTDOWN_FUNCTION */ ++PHP_RSHUTDOWN_FUNCTION(http) ++{ ++ STATUS status = SUCCESS; ++ ++ if (0 ++#ifdef HTTP_HAVE_ZLIB ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_encoding) ++#endif ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_datashare) ++# endif ++#endif ++ || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_method) ++ ) { ++ status = FAILURE; ++ } ++ ++ http_globals_free(HTTP_G); ++ return status; ++} ++/* }}} */ ++ ++/* {{{ PHP_MINFO_FUNCTION */ ++PHP_MINFO_FUNCTION(http) ++{ ++ php_info_print_table_start(); ++ { ++ php_info_print_table_header(2, "HTTP Support", "enabled"); ++ php_info_print_table_row(2, "Extension Version", PHP_HTTP_VERSION); ++ php_info_print_table_row(2, "Registered Classes", ++#ifndef ZEND_ENGINE_2 ++ "none" ++#else ++ "HttpUtil, " ++ "HttpMessage, " ++# ifdef HTTP_HAVE_CURL ++ "HttpRequest, " ++ "HttpRequestPool, " ++ "HttpRequestDataShare, " ++# endif ++# ifdef HTTP_HAVE_ZLIB ++ "HttpDeflateStream, " ++ "HttpInflateStream, " ++# endif ++# ifndef WONKY ++ "HttpResponse, " ++# endif ++ "HttpQueryString" ++#endif ++ ); ++ php_info_print_table_row(2, "Output Handlers", "ob_deflatehandler, ob_inflatehandler, ob_etaghandler"); ++ php_info_print_table_row(2, "Stream Filters", ++#ifndef ZEND_ENGINE_2 ++ "none" ++#else ++ "http.chunked_decode, http.chunked_encode, http.deflate, http.inflate" ++#endif ++ ); ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_header(3, "Used Library", "Compiled", "Linked"); ++ { ++#ifdef HTTP_HAVE_CURL ++ curl_version_info_data *cv = curl_version_info(CURLVERSION_NOW); ++ php_info_print_table_row(3, "libcurl", LIBCURL_VERSION, cv->version); ++#else ++ php_info_print_table_row(2, "libcurl", "disabled", "disabled"); ++#endif ++#ifdef HTTP_HAVE_EVENT ++ php_info_print_table_row(3, "libevent", HTTP_EVENT_VERSION, event_get_version()); ++#else ++ php_info_print_table_row(3, "libevent", "disabled", "disabled"); ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion()); ++#else ++ php_info_print_table_row(3, "libz", "disabled", "disabled"); ++#endif ++#if defined(HTTP_HAVE_MAGIC) ++ php_info_print_table_row(3, "libmagic", "unknown", "unknown"); ++#else ++ php_info_print_table_row(3, "libmagic", "disabled", "disabled"); ++#endif ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_colspan_header(4, "Persistent Handles"); ++ php_info_print_table_header(4, "Provider", "Ident", "Used", "Free"); ++ { ++ HashTable *ht; ++ HashPosition pos1, pos2; ++ HashKey provider = initHashKey(0), ident = initHashKey(0); ++ zval **val, **sub, **zused, **zfree; ++ ++ if ((ht = http_persistent_handle_statall()) && zend_hash_num_elements(ht)) { ++ FOREACH_HASH_KEYVAL(pos1, ht, provider, val) { ++ if (zend_hash_num_elements(Z_ARRVAL_PP(val))) { ++ FOREACH_KEYVAL(pos2, *val, ident, sub) { ++ if ( SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("used"), (void *) &zused) && ++ SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("free"), (void *) &zfree)) { ++ zval *used = http_zsep(IS_STRING, *zused); ++ zval *free = http_zsep(IS_STRING, *zfree); ++ php_info_print_table_row(4, provider.str, ident.str, Z_STRVAL_P(used), Z_STRVAL_P(free)); ++ zval_ptr_dtor(&used); ++ zval_ptr_dtor(&free); ++ } else { ++ php_info_print_table_row(4, provider.str, ident.str, "0", "0"); ++ } ++ } ++ } else { ++ php_info_print_table_row(4, provider.str, "N/A", "0", "0"); ++ } ++ } ++ } else { ++ php_info_print_table_row(4, "N/A", "N/A", "0", "0"); ++ } ++ if (ht) { ++ zend_hash_destroy(ht); ++ FREE_HASHTABLE(ht); ++ } ++ } ++ php_info_print_table_end(); ++ ++ php_info_print_table_start(); ++ php_info_print_table_colspan_header(2, "Request Methods"); ++ { ++ HashPosition pos; ++ phpstr *methods = phpstr_new(); ++ char **name; ++ ++ FOREACH_HASH_VAL(pos, &HTTP_G->request.methods.registered, name) { ++ if (pos->h) { ++ phpstr_appendf(methods, "%s, ", *name); ++ } ++ } ++ phpstr_fix(methods); ++ php_info_print_table_row(2, "Registered", PHPSTR_VAL(methods)); ++ php_info_print_table_row(2, "Allowed", *HTTP_G->request.methods.allowed ? HTTP_G->request.methods.allowed : "(ANY)"); ++ phpstr_free(&methods); ++ } ++ php_info_print_table_end(); ++ ++ DISPLAY_INI_ENTRIES(); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http.dsp +@@ -0,0 +1,257 @@ ++# Microsoft Developer Studio Project File - Name="http" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 ++ ++CFG=http - Win32 Release_TS ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "http.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "http.mak" CFG="http - Win32 Release_TS" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "http - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") ++!MESSAGE "http - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++MTL=midl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "http - Win32 Release_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release_TS" ++# PROP BASE Intermediate_Dir "Release_TS" ++# PROP BASE Ignore_Export_Lib 0 ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release_TS" ++# PROP Intermediate_Dir "Release_TS" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c ++# ADD CPP /nologo /Gd /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /FR /YX /FD /c ++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 ++# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_http.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline" ++ ++!ELSEIF "$(CFG)" == "http - Win32 Debug_TS" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Debug_TS" ++# PROP BASE Intermediate_Dir "Debug_TS" ++# PROP BASE Ignore_Export_Lib 0 ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Debug_TS" ++# PROP Intermediate_Dir "Debug_TS" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c ++# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /YX /FD /c ++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD BASE RSC /l 0x406 /d "NDEBUG" ++# ADD RSC /l 0x406 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 ++# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/http.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "http - Win32 Release_TS" ++# Name "http - Win32 Debug_TS" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\http.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_encoding_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_info.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_body_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_request_method_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_functions.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_persistent_handle_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_cache_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_cookie_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_date_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_headers_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_message_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_send_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_url_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_querystring_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\http_info_api.c ++# End Source File ++# Begin Source File ++ ++SOURCE=.\phpstr\phpstr.c ++# End Source File ++# End Group ++# Begin Group "Header Files" ++ ++# PROP Default_Filter "h;hpp;hxx;hm;inl" ++# Begin Source File ++ ++SOURCE=.\php_http.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_encoding_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_int.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_body_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_request_method_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_persistent_handle_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_cache_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_cookie_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_date_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_message_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_send_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_headers_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_url_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_querystring_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_info_api.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\php_http_std_defs.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\phpstr\phpstr.h ++# End Source File ++# End Group ++# Begin Group "Resource Files" ++ ++# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" ++# End Group ++# End Target ++# End Project +--- /dev/null ++++ b/ext/http/http_api.c +@@ -0,0 +1,745 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_api.c 310302 2011-04-18 08:24:49Z rrichards $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_output.h" ++#include "ext/standard/url.h" ++#include "ext/standard/php_lcg.h" ++ ++#include "php_http_api.h" ++#include "php_http_send_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++# include "php_http_exception_object.h" ++#endif ++ ++PHP_MINIT_FUNCTION(http_support) ++{ ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT", HTTP_SUPPORT); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_REQUESTS", HTTP_SUPPORT_REQUESTS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_MAGICMIME", HTTP_SUPPORT_MAGICMIME); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_ENCODINGS", HTTP_SUPPORT_ENCODINGS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_SSLREQUESTS", HTTP_SUPPORT_SSLREQUESTS); ++ HTTP_LONG_CONSTANT("HTTP_SUPPORT_EVENTS", HTTP_SUPPORT_EVENTS); ++ ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_COMMA", HTTP_PARAMS_ALLOW_COMMA); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_FAILURE", HTTP_PARAMS_ALLOW_FAILURE); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_RAISE_ERROR", HTTP_PARAMS_RAISE_ERROR); ++ HTTP_LONG_CONSTANT("HTTP_PARAMS_DEFAULT", HTTP_PARAMS_DEFAULT); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API long _http_support(long feature) ++{ ++ long support = HTTP_SUPPORT; ++ ++#ifdef HTTP_HAVE_CURL ++ support |= HTTP_SUPPORT_REQUESTS; ++# ifdef HTTP_HAVE_SSL ++ support |= HTTP_SUPPORT_SSLREQUESTS; ++# endif ++# ifdef HTTP_HAVE_EVENT ++ support |= HTTP_SUPPORT_EVENTS; ++# endif ++#endif ++#ifdef HTTP_HAVE_MAGIC ++ support |= HTTP_SUPPORT_MAGICMIME; ++#endif ++#ifdef HTTP_HAVE_ZLIB ++ support |= HTTP_SUPPORT_ENCODINGS; ++#endif ++ ++ if (feature) { ++ return (feature == (support & feature)); ++ } ++ return support; ++} ++ ++/* char *pretty_key(char *, size_t, zend_bool, zend_bool) */ ++char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen) ++{ ++ size_t i; ++ int wasalpha; ++ ++ if (key && key_len) { ++ if ((wasalpha = HTTP_IS_CTYPE(alpha, key[0]))) { ++ key[0] = (char) (uctitle ? HTTP_TO_CTYPE(upper, key[0]) : HTTP_TO_CTYPE(lower, key[0])); ++ } ++ for (i = 1; i < key_len; i++) { ++ if (HTTP_IS_CTYPE(alpha, key[i])) { ++ key[i] = (char) (((!wasalpha) && uctitle) ? HTTP_TO_CTYPE(upper, key[i]) : HTTP_TO_CTYPE(lower, key[i])); ++ wasalpha = 1; ++ } else { ++ if (xhyphen && (key[i] == '_')) { ++ key[i] = '-'; ++ } ++ wasalpha = 0; ++ } ++ } ++ } ++ return key; ++} ++/* }}} */ ++ ++/* {{{ http_boundary(char *, size_t) */ ++size_t _http_boundary(char *buf, size_t buf_len TSRMLS_DC) ++{ ++ return snprintf(buf, buf_len, "%lu%0.9f", (ulong) HTTP_G->request.time, (float) php_combined_lcg(TSRMLS_C)); ++} ++/* }}} */ ++ ++/* {{{ void http_error(long, long, char*) */ ++void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...) ++{ ++ va_list args; ++ ++ va_start(args, format); ++#ifdef ZEND_ENGINE_2 ++ if ((type == E_THROW) || (GLOBAL_ERROR_HANDLING == EH_THROW)) { ++ char *message; ++ zend_class_entry *ce = http_exception_get_for_code(code); ++ ++ http_try { ++ vspprintf(&message, 0, format, args); ++ zend_throw_exception(ce, message, code TSRMLS_CC); ++ efree(message); ++ } http_catch(GLOBAL_EXCEPTION_CLASS ? GLOBAL_EXCEPTION_CLASS : HTTP_EX_DEF_CE); ++ } else ++#endif ++ php_verror(NULL, "", type, format, args TSRMLS_CC); ++ va_end(args); ++} ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2 ++static inline void copy_bt_args(zval *from, zval *to TSRMLS_DC) ++{ ++ zval **args, **trace_0, *old_trace_0, *trace = NULL; ++ ++ if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) { ++ if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ++ old_trace_0 = *trace_0; ++ if (Z_TYPE_PP(trace_0) == IS_ARRAY && SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) { ++ if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) { ++ if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ++ ZVAL_ADDREF(*args); ++ add_assoc_zval(*trace_0, "args", *args); ++ } ++ } ++ } ++ } ++ } ++} ++ ++/* {{{ zval *http_exception_wrap(zval *, zval *, zend_class_entry *) */ ++zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC) ++{ ++ int inner = 1; ++ char *message; ++ zval *sub_exception, *tmp_exception; ++ ++ if (!new_exception) { ++ MAKE_STD_ZVAL(new_exception); ++ object_init_ex(new_exception, ce); ++ ++ zend_update_property(ce, new_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC); ++ copy_bt_args(old_exception, new_exception TSRMLS_CC); ++ ++ sub_exception = old_exception; ++ ++ while ((sub_exception = zend_read_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(sub_exception) == IS_OBJECT) { ++ ++inner; ++ } ++ ++ spprintf(&message, 0, "Exception caused by %d inner exception(s)", inner); ++ zend_update_property_string(ZEND_EXCEPTION_GET_DEFAULT(), new_exception, "message", lenof("message"), message TSRMLS_CC); ++ efree(message); ++ } else { ++ sub_exception = new_exception; ++ tmp_exception = new_exception; ++ ++ while ((tmp_exception = zend_read_property(Z_OBJCE_P(tmp_exception), tmp_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(tmp_exception) == IS_OBJECT) { ++ sub_exception = tmp_exception; ++ } ++ ++ zend_update_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC); ++ copy_bt_args(old_exception, new_exception TSRMLS_CC); ++ copy_bt_args(old_exception, sub_exception TSRMLS_CC); ++ } ++#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 ++ Z_ADDREF_P(old_exception); ++ zend_exception_set_previous(new_exception, old_exception TSRMLS_CC); ++#endif ++ zval_ptr_dtor(&old_exception); ++ return new_exception; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_object_new(zend_object_value *, const char *, uint, http_object_new_t, zend_class_entry *, void *, void **) */ ++STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname_len, http_object_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC) ++{ ++ zend_class_entry *ce = parent_ce; ++ ++ if (cname_str && cname_len) { ++ if (!(ce = zend_fetch_class(HTTP_ZAPI_CONST_CAST(char *) cname_str, cname_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC))) { ++ return FAILURE; ++ } ++ if (!instanceof_function(ce, parent_ce TSRMLS_CC)) { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Class %s does not extend %s", cname_str, parent_ce->name); ++ return FAILURE; ++ } ++ } ++ ++ *ov = create(ce, intern_ptr, obj_ptr TSRMLS_CC); ++ return SUCCESS; ++} ++/* }}} */ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* {{{ void http_log(char *, char *, char *) */ ++void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC) ++{ ++ time_t now; ++ struct tm nowtm; ++ char datetime[20] = {0}; ++ ++ now = HTTP_G->request.time; ++ strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm)); ++ ++#define HTTP_LOG_WRITE(file, type, msg) \ ++ if (file && *file) { \ ++ php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \ ++ \ ++ if (log) { \ ++ php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \ ++ php_stream_close(log); \ ++ } \ ++ \ ++ } ++ ++ HTTP_LOG_WRITE(file, ident, message); ++ HTTP_LOG_WRITE(HTTP_G->log.composite, ident, message); ++} ++/* }}} */ ++ ++static void http_ob_blackhole(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ *handled_output = ecalloc(1,1); ++ *handled_output_len = 0; ++} ++ ++/* {{{ STATUS http_exit(int, char*, char*) */ ++STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC) ++{ ++ if ( (send_header && (SUCCESS != http_send_status_header(status, header))) || ++ (status && (SUCCESS != http_send_status(status)))) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, STR_PTR(header)); ++ STR_FREE(header); ++ STR_FREE(body); ++ return FAILURE; ++ } ++ ++ if (!php_ob_handler_used("zlib output compression") && !php_ob_handler_used("ob_gzhandler") && !OG(ob_lock)) { ++ php_end_ob_buffers(0 TSRMLS_CC); ++ } ++ if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) { ++ PHPWRITE(body, strlen(body)); ++ } ++ ++ switch (status) { ++ case 301: http_log(HTTP_G->log.redirect, "301-REDIRECT", header); break; ++ case 302: http_log(HTTP_G->log.redirect, "302-REDIRECT", header); break; ++ case 303: http_log(HTTP_G->log.redirect, "303-REDIRECT", header); break; ++ case 305: http_log(HTTP_G->log.redirect, "305-REDIRECT", header); break; ++ case 307: http_log(HTTP_G->log.redirect, "307-REDIRECT", header); break; ++ case 304: http_log(HTTP_G->log.cache, "304-CACHE", header); break; ++ case 404: http_log(HTTP_G->log.not_found, "404-NOTFOUND", NULL); break; ++ case 405: http_log(HTTP_G->log.allowed_methods, "405-ALLOWED", header); break; ++ default: http_log(NULL, header, body); break; ++ } ++ ++ STR_FREE(header); ++ STR_FREE(body); ++ ++ if (HTTP_G->force_exit) { ++ zend_bailout(); ++ } else { ++ php_ob_set_internal_handler(http_ob_blackhole, 4096, "blackhole", 0 TSRMLS_CC); ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_check_method(char *) */ ++STATUS _http_check_method_ex(const char *method, const char *methods) ++{ ++ const char *found; ++ ++ if ( (found = strstr(methods, method)) && ++ (found == method || !HTTP_IS_CTYPE(alpha, found[-1])) && ++ (strlen(found) >= strlen(method) && !HTTP_IS_CTYPE(alpha, found[strlen(method)]))) { ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ zval *http_get_server_var_ex(char *, size_t) */ ++PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend_bool check TSRMLS_DC) ++{ ++ zval **hsv, **var; ++ char *env; ++ ++ /* if available, this is a lot faster than accessing $_SERVER */ ++ if (sapi_module.getenv) { ++ if ((!(env = sapi_module.getenv((char *) key, key_len TSRMLS_CC))) || (check && !*env)) { ++ return NULL; ++ } ++ if (HTTP_G->server_var) { ++ zval_ptr_dtor(&HTTP_G->server_var); ++ } ++ MAKE_STD_ZVAL(HTTP_G->server_var); ++ ZVAL_STRING(HTTP_G->server_var, env, 1); ++ return HTTP_G->server_var; ++ } ++ ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ ++ if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { ++ return NULL; ++ } ++ if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), HTTP_ZAPI_CONST_CAST(char *) key, key_len + 1, (void *) &var))) { ++ return NULL; ++ } ++ if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) { ++ return NULL; ++ } ++ return *var; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_get_request_body(char **, size_t *) */ ++PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC) ++{ ++ *length = 0; ++ *body = NULL; ++ ++ if (SG(request_info).raw_post_data) { ++ *length = SG(request_info).raw_post_data_length; ++ *body = SG(request_info).raw_post_data; ++ ++ if (dup) { ++ *body = estrndup(*body, *length); ++ } ++ return SUCCESS; ++ } else if (sapi_module.read_post && !HTTP_G->read_post_data) { ++ char *buf = emalloc(4096); ++ int len; ++ ++ HTTP_G->read_post_data = 1; ++ ++ while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) { ++ SG(read_post_bytes) += len; ++ *body = erealloc(*body, *length + len + 1); ++ memcpy(*body + *length, buf, len); ++ *length += len; ++ (*body)[*length] = '\0'; ++ if (len < 4096) { ++ break; ++ } ++ } ++ efree(buf); ++ ++ /* check for error */ ++ if (len < 0) { ++ STR_FREE(*body); ++ *length = 0; ++ return FAILURE; ++ } ++ ++ SG(request_info).raw_post_data = *body; ++ SG(request_info).raw_post_data_length = *length; ++ ++ if (dup) { ++ *body = estrndup(*body, *length); ++ } ++ return SUCCESS; ++ } ++ ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ php_stream *http_get_request_body_stream(void) */ ++PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D) ++{ ++ php_stream *s = NULL; ++ ++ if (SG(request_info).raw_post_data) { ++ s = php_stream_open_wrapper("php://input", "rb", 0, NULL); ++ } else if (sapi_module.read_post && !HTTP_G->read_post_data) { ++ HTTP_G->read_post_data = 1; ++ ++ if ((s = php_stream_temp_new())) { ++ char *buf = emalloc(4096); ++ int len; ++ ++ while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) { ++ php_stream_write(s, buf, len); ++ if (len < 4096) { ++ break; ++ } ++ } ++ efree(buf); ++ ++ if (len < 0) { ++ php_stream_close(s); ++ s = NULL; ++ } else { ++ php_stream_rewind(s); ++ } ++ } ++ } ++ ++ return s; ++} ++/* }}} */ ++ ++/* {{{ void http_parse_params_default_callback(...) */ ++PHP_HTTP_API void _http_parse_params_default_callback(void *arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC) ++{ ++ char *kdup; ++ zval tmp, *entry; ++ HashTable *ht = (HashTable *) arg; ++ ++ if (ht) { ++ INIT_ZARR(tmp, ht); ++ ++ if (vallen) { ++ MAKE_STD_ZVAL(entry); ++ array_init(entry); ++ if (keylen) { ++ kdup = estrndup(key, keylen); ++ add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1); ++ efree(kdup); ++ } else { ++ add_next_index_stringl(entry, (char *) val, vallen, 1); ++ } ++ add_next_index_zval(&tmp, entry); ++ } else { ++ add_next_index_stringl(&tmp, (char *) key, keylen, 1); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_parse_params(const char *, HashTable *) */ ++PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC) ++{ ++#define ST_QUOTE 1 ++#define ST_VALUE 2 ++#define ST_KEY 3 ++#define ST_ASSIGN 4 ++#define ST_ADD 5 ++ ++ int st = ST_KEY, keylen = 0, vallen = 0; ++ char *s, *c, *key = NULL, *val = NULL; ++ ++ for(c = s = estrdup(param);;) { ++ continued: ++#if 0 ++ { ++ char *tk = NULL, *tv = NULL; ++ ++ if (key) { ++ if (keylen) { ++ tk= estrndup(key, keylen); ++ } else { ++ tk = ecalloc(1, 7); ++ memcpy(tk, key, 3); ++ tk[3]='.'; tk[4]='.'; tk[5]='.'; ++ } ++ } ++ if (val) { ++ if (vallen) { ++ tv = estrndup(val, vallen); ++ } else { ++ tv = ecalloc(1, 7); ++ memcpy(tv, val, 3); ++ tv[3]='.'; tv[4]='.'; tv[5]='.'; ++ } ++ } ++ fprintf(stderr, "[%6s] %c \"%s=%s\"\n", ++ ( ++ st == ST_QUOTE ? "QUOTE" : ++ st == ST_VALUE ? "VALUE" : ++ st == ST_KEY ? "KEY" : ++ st == ST_ASSIGN ? "ASSIGN" : ++ st == ST_ADD ? "ADD": ++ "HUH?" ++ ), *c?*c:'0', tk, tv ++ ); ++ STR_FREE(tk); STR_FREE(tv); ++ } ++#endif ++ switch (st) { ++ case ST_QUOTE: ++ quote: ++ if (*c == '"') { ++ if (*(c-1) == '\\') { ++ memmove(c-1, c, strlen(c)+1); ++ goto quote; ++ } else { ++ goto add; ++ } ++ } else { ++ if (!val) { ++ val = c; ++ } ++ if (!*c) { ++ --val; ++ st = ST_ADD; ++ } ++ } ++ break; ++ ++ case ST_VALUE: ++ switch (*c) { ++ case '"': ++ if (!val) { ++ st = ST_QUOTE; ++ } ++ break; ++ ++ case ' ': ++ break; ++ ++ case ';': ++ case '\0': ++ goto add; ++ break; ++ case ',': ++ if (flags & HTTP_PARAMS_ALLOW_COMMA) { ++ goto add; ++ } ++ default: ++ if (!val) { ++ val = c; ++ } ++ break; ++ } ++ break; ++ ++ case ST_KEY: ++ switch (*c) { ++ case ',': ++ if (flags & HTTP_PARAMS_ALLOW_COMMA) { ++ goto allow_comma; ++ } ++ case '\r': ++ case '\n': ++ case '\t': ++ case '\013': ++ case '\014': ++ goto failure; ++ break; ++ ++ case ' ': ++ if (key) { ++ keylen = c - key; ++ st = ST_ASSIGN; ++ } ++ break; ++ ++ case ';': ++ case '\0': ++ allow_comma: ++ if (key) { ++ keylen = c-- - key; ++ st = ST_ADD; ++ } ++ break; ++ ++ case ':': ++ if (!(flags & HTTP_PARAMS_COLON_SEPARATOR)) { ++ goto not_separator; ++ } ++ if (key) { ++ keylen = c - key; ++ st = ST_VALUE; ++ } else { ++ goto failure; ++ } ++ break; ++ ++ case '=': ++ if (flags & HTTP_PARAMS_COLON_SEPARATOR) { ++ goto not_separator; ++ } ++ if (key) { ++ keylen = c - key; ++ st = ST_VALUE; ++ } else { ++ goto failure; ++ } ++ break; ++ ++ default: ++ not_separator: ++ if (!key) { ++ key = c; ++ } ++ break; ++ } ++ break; ++ ++ case ST_ASSIGN: ++ if (*c == '=') { ++ st = ST_VALUE; ++ } else if (!*c || *c == ';' || ((flags & HTTP_PARAMS_ALLOW_COMMA) && *c == ',')) { ++ st = ST_ADD; ++ } else if (*c != ' ') { ++ goto failure; ++ } ++ break; ++ ++ case ST_ADD: ++ add: ++ if (val) { ++ vallen = c - val; ++ if (st != ST_QUOTE) { ++ while (val[vallen-1] == ' ') --vallen; ++ } ++ } else { ++ val = ""; ++ vallen = 0; ++ } ++ ++ cb(cb_arg, key, keylen, val, vallen TSRMLS_CC); ++ ++ st = ST_KEY; ++ key = val = NULL; ++ keylen = vallen = 0; ++ break; ++ } ++ if (*c) { ++ ++c; ++ } else if (st == ST_ADD) { ++ goto add; ++ } else { ++ break; ++ } ++ } ++ ++ efree(s); ++ return SUCCESS; ++ ++failure: ++ if (flags & HTTP_PARAMS_RAISE_ERROR) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Unexpected character (%c) at pos %tu of %zu", *c, c-s, strlen(s)); ++ } ++ if (flags & HTTP_PARAMS_ALLOW_FAILURE) { ++ if (st == ST_KEY) { ++ if (key) { ++ keylen = c - key; ++ } else { ++ key = c; ++ } ++ } else { ++ --c; ++ } ++ st = ST_ADD; ++ goto continued; ++ } ++ efree(s); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ array_join */ ++int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ int flags; ++ char *key = NULL; ++ HashTable *dst; ++ zval **data = NULL, **value = (zval **) pDest; ++ ++ dst = va_arg(args, HashTable *); ++ flags = va_arg(args, int); ++ ++ if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) { ++ if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) { ++ key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1); ++ zend_hash_find(dst, key, hash_key->nKeyLength, (void *) &data); ++ } else { ++ zend_hash_quick_find(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) &data); ++ } ++ ++ ZVAL_ADDREF(*value); ++ if (data) { ++ add_next_index_zval(http_zset(IS_ARRAY, *data), *value); ++ } else if (key) { ++ zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL); ++ } else { ++ zend_hash_quick_add(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, value, sizeof(zval *), NULL); ++ } ++ ++ if (key) { ++ efree(key); ++ } ++ } ++ ++ return ZEND_HASH_APPLY_KEEP; ++} ++ ++int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ int flags; ++ char *key = NULL; ++ HashTable *dst; ++ zval **value = (zval **) pDest; ++ ++ dst = va_arg(args, HashTable *); ++ flags = va_arg(args, int); ++ ++ if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) { ++ ZVAL_ADDREF(*value); ++ if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) { ++ key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1); ++ zend_hash_update(dst, key, hash_key->nKeyLength, (void *) value, sizeof(zval *), NULL); ++ efree(key); ++ } else { ++ zend_hash_quick_update(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) value, sizeof(zval *), NULL); ++ } ++ } ++ ++ return ZEND_HASH_APPLY_KEEP; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_cache_api.c +@@ -0,0 +1,256 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_cache_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_output.h" ++#include "php_streams.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_date_api.h" ++#include "php_http_send_api.h" ++ ++/* {{{ char *http_etag(void *, size_t, http_send_mode) */ ++PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC) ++{ ++ void *ctx = http_etag_init(); ++ ++ if (data_mode == SEND_DATA) { ++ http_etag_update(ctx, data_ptr, data_len); ++ } else { ++ STATUS ss = FAILURE; ++ php_stream_statbuf ssb; ++ ++ if (data_mode == SEND_RSRC) { ++ ss = php_stream_stat((php_stream *) data_ptr, &ssb); ++ } else { ++ ss = php_stream_stat_path((char *) data_ptr, &ssb); ++ } ++ ++ if (SUCCESS != ss) { ++ efree(ctx); ++ return NULL; ++ } else { ++ size_t ssb_len; ++ char ssb_buf[128]; ++ ++ ssb_len = snprintf(ssb_buf, sizeof(ssb_buf), "%ld=%ld=%ld", (long) ssb.sb.st_mtime, ++ (long) ssb.sb.st_ino, ++ (long) ssb.sb.st_size); ++ http_etag_update(ctx, ssb_buf, ssb_len); ++ } ++ } ++ ++ return http_etag_finish(ctx); ++} ++/* }}} */ ++ ++/* {{{ time_t http_last_modified(void *, http_send_mode) */ ++PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC) ++{ ++ php_stream_statbuf ssb; ++ ++ switch (data_mode) { ++ case SEND_DATA: return HTTP_G->request.time; ++ case SEND_RSRC: return php_stream_stat((php_stream *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime; ++ default: return php_stream_stat_path((char *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime; ++ } ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_last_modified(char *, time_t) */ ++PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC) ++{ ++ zend_bool retval; ++ zval *zmodified; ++ char *modified, *chr_ptr; ++ ++ if (!(zmodified = http_get_server_var(entry, 1))) { ++ return !enforce_presence; ++ } ++ ++ modified = estrndup(Z_STRVAL_P(zmodified), Z_STRLEN_P(zmodified)); ++ if ((chr_ptr = strrchr(modified, ';'))) { ++ chr_ptr = 0; ++ } ++ ++ retval = (t <= http_parse_date_ex(modified, 1)); ++ efree(modified); ++ return retval; ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_etag(char *, char *) */ ++PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC) ++{ ++ zval *zetag; ++ char *quoted_etag; ++ zend_bool result; ++ ++ if (!(zetag = http_get_server_var_ex(entry, strlen(entry)+1, 1))) { ++ return !enforce_presence; ++ } ++ ++ if (NULL != strchr(Z_STRVAL_P(zetag), '*')) { ++ return 1; ++ } ++ ++ spprintf("ed_etag, 0, "\"%s\"", etag); ++ if (!strchr(Z_STRVAL_P(zetag), ',')) { ++ result = !strcmp(Z_STRVAL_P(zetag), quoted_etag); ++ } else { ++ result = (NULL != strstr(Z_STRVAL_P(zetag), quoted_etag)); ++ } ++ efree(quoted_etag); ++ ++ return result; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_cache_last_modified(time_t, time_t, char *, size_t) */ ++PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, ++ time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC) ++{ ++ char *sent_header = NULL; ++ ++ if (SG(headers_sent)) { ++ return FAILURE; ++ } ++ ++ if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { ++ return FAILURE; ++ } ++ ++ if (SUCCESS != http_send_last_modified_ex(send_modified, &sent_header)) { ++ return FAILURE; ++ } ++ ++ if (http_match_last_modified("HTTP_IF_MODIFIED_SINCE", last_modified)) { ++ http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_cache_etag(char *, size_t, char *, size_t) */ ++PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, ++ const char *cache_control, size_t cc_len TSRMLS_DC) ++{ ++ char *sent_header = NULL; ++ ++ if (SG(headers_sent)) { ++ return FAILURE; ++ } ++ ++ if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { ++ return FAILURE; ++ } ++ ++ if (etag_len) { ++ if (SUCCESS != http_send_etag_ex(etag, etag_len, &sent_header)) { ++ return FAILURE; ++ } ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ } ++ return SUCCESS; ++ } ++ ++ /* start ob_etaghandler */ ++ return http_start_ob_etaghandler(); ++} ++/* }}} */ ++ ++PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D) ++{ ++ /* already running? */ ++ if (php_ob_handler_used("ob_etaghandler" TSRMLS_CC)) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once"); ++ return FAILURE; ++ } ++ ++ HTTP_G->etag.started = 1; ++ return php_start_ob_buffer_named("ob_etaghandler", HTTP_G->send.buffer_size, 0 TSRMLS_CC); ++} ++ ++PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D) ++{ ++ if (HTTP_G->etag.started) { ++ HTTP_G->etag.started = 0; ++ if (HTTP_G->etag.ctx) { ++ efree(HTTP_G->etag.ctx); ++ HTTP_G->etag.ctx = NULL; ++ } ++ return 1; ++ } ++ return 0; ++} ++ ++/* {{{ void http_ob_etaghandler(char *, uint, char **, uint *, int) */ ++void _http_ob_etaghandler(char *output, uint output_len, ++ char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ /* passthru */ ++ *handled_output_len = output_len; ++ *handled_output = estrndup(output, output_len); ++ ++ /* are we supposed to run? */ ++ if (HTTP_G->etag.started) { ++ /* initialize the etag context */ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ HTTP_G->etag.ctx = http_etag_init(); ++ } ++ ++ /* update */ ++ http_etag_update(HTTP_G->etag.ctx, output, output_len); ++ ++ /* finish */ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *sent_header = NULL; ++ char *etag = http_etag_finish(HTTP_G->etag.ctx); ++ ++ HTTP_G->etag.ctx = NULL; ++ ++ http_send_cache_control(HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL)); ++ http_send_etag_ex(etag, strlen(etag), &sent_header); ++ ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ /* force exit; ob within ob does not work */ ++ HTTP_G->force_exit = 1; ++ http_exit_ex(304, sent_header, etag, 0); ++ } ++ ++ STR_FREE(sent_header); ++ STR_FREE(etag); ++ } ++ } ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_cookie_api.c +@@ -0,0 +1,371 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_cookie_api.c 298662 2010-04-27 13:42:32Z mike $ */ ++ ++#include "php_http.h" ++#include "php_http_api.h" ++#include "php_http_date_api.h" ++#include "php_http_cookie_api.h" ++ ++#include "ext/standard/url.h" ++ ++/* {{{ PHP_MINIT_FUNCTION(http_cookie) */ ++PHP_MINIT_FUNCTION(http_cookie) ++{ ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_PARSE_RAW", HTTP_COOKIE_PARSE_RAW); ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_SECURE", HTTP_COOKIE_SECURE); ++ HTTP_LONG_CONSTANT("HTTP_COOKIE_HTTPONLY", HTTP_COOKIE_HTTPONLY); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_cookie_list_init(http_cookie_list *) */ ++PHP_HTTP_API http_cookie_list *_http_cookie_list_init(http_cookie_list *list ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (!list) { ++ list = emalloc_rel(sizeof(http_cookie_list)); ++ } ++ ++ zend_hash_init(&list->cookies, 0, NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_init(&list->extras, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ list->path = NULL; ++ list->domain = NULL; ++ list->expires = 0; ++ list->flags = 0; ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_dtor(http_cookie_list *) */ ++PHP_HTTP_API void _http_cookie_list_dtor(http_cookie_list *list TSRMLS_DC) ++{ ++ if (list) { ++ zend_hash_destroy(&list->cookies); ++ zend_hash_destroy(&list->extras); ++ ++ STR_SET(list->path, NULL); ++ STR_SET(list->domain, NULL); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_free(http_cookie_list **) */ ++PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC) ++{ ++ if (list) { ++ http_cookie_list_dtor(*list); ++ efree(*list); ++ *list = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ const char *http_cookie_list_get_cookie(http_cookie_list *, const char*, size_t) */ ++PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) ++{ ++ zval **cookie = NULL; ++ if ((SUCCESS != zend_hash_find(&list->cookies, HTTP_ZAPI_CONST_CAST(char *) name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { ++ return NULL; ++ } ++ return Z_STRVAL_PP(cookie); ++} ++/* }}} */ ++ ++/* {{{ const char *http_cookie_list_get_extra(http_cookie_list *, const char *, size_t) */ ++PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) ++{ ++ zval **extra = NULL; ++ if ((SUCCESS != zend_hash_find(&list->extras, HTTP_ZAPI_CONST_CAST(char *) name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { ++ return NULL; ++ } ++ return Z_STRVAL_PP(extra); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_add_cookie(http_cookie_list *, const char *, size_t, const char *, size_t) */ ++PHP_HTTP_API void _http_cookie_list_add_cookie(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC) ++{ ++ zval *cookie_value; ++ char *key = estrndup(name, name_len); ++ MAKE_STD_ZVAL(cookie_value); ++ ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); ++ zend_hash_update(&list->cookies, key, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); ++ efree(key); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_add_extr(http_cookie_list *, const char *, size_t, const char *, size_t) */ ++PHP_HTTP_API void _http_cookie_list_add_extra(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC) ++{ ++ zval *cookie_value; ++ char *key = estrndup(name, name_len); ++ MAKE_STD_ZVAL(cookie_value); ++ ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); ++ zend_hash_update(&list->extras, key, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); ++ efree(key); ++} ++/* }}} */ ++ ++typedef struct _http_parse_param_cb_arg_t { ++ http_cookie_list *list; ++ long flags; ++ char **allowed_extras; ++} http_parse_param_cb_arg; ++ ++/* {{{ static void http_parse_cookie_callback */ ++static void http_parse_cookie_callback(void *ptr, const char *key, int keylen, const char *val, int vallen TSRMLS_DC) ++{ ++ http_parse_param_cb_arg *arg = (http_parse_param_cb_arg *) ptr; ++ ++#define _KEY_IS(s) (keylen == lenof(s) && !strncasecmp(key, (s), keylen)) ++ if _KEY_IS("path") { ++ STR_SET(arg->list->path, estrndup(val, vallen)); ++ } else if _KEY_IS("domain") { ++ STR_SET(arg->list->domain, estrndup(val, vallen)); ++ } else if _KEY_IS("expires") { ++ char *date = estrndup(val, vallen); ++ arg->list->expires = http_parse_date(date); ++ efree(date); ++ } else if _KEY_IS("secure") { ++ arg->list->flags |= HTTP_COOKIE_SECURE; ++ } else if _KEY_IS("httpOnly") { ++ arg->list->flags |= HTTP_COOKIE_HTTPONLY; ++ } else { ++ /* check for extra */ ++ if (arg->allowed_extras) { ++ char **ae = arg->allowed_extras; ++ ++ for (; *ae; ++ae) { ++ if ((size_t) keylen == strlen(*ae) && !strncasecmp(key, *ae, keylen)) { ++ if (arg->flags & HTTP_COOKIE_PARSE_RAW) { ++ http_cookie_list_add_extra(arg->list, key, keylen, val, vallen); ++ } else { ++ char *dec = estrndup(val, vallen); ++ int declen = php_url_decode(dec, vallen); ++ ++ http_cookie_list_add_extra(arg->list, key, keylen, dec, declen); ++ efree(dec); ++ } ++ return; ++ } ++ } ++ } ++ /* new cookie */ ++ if (arg->flags & HTTP_COOKIE_PARSE_RAW) { ++ http_cookie_list_add_cookie(arg->list, key, keylen, val, vallen); ++ } else { ++ char *dec = estrndup(val, vallen); ++ int declen = php_url_decode(dec, vallen); ++ ++ http_cookie_list_add_cookie(arg->list, key, keylen, dec, declen); ++ efree(dec); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_parse_cookie(char *, long) */ ++PHP_HTTP_API http_cookie_list *_http_parse_cookie_ex(http_cookie_list *list, const char *string, long flags, char **allowed_extras TSRMLS_DC) ++{ ++ int free_list = !list; ++ http_parse_param_cb_arg arg; ++ ++ list = http_cookie_list_init(list); ++ ++ arg.list = list; ++ arg.flags = flags; ++ arg.allowed_extras = allowed_extras; ++ ++ if (SUCCESS != http_parse_params_ex(string, HTTP_PARAMS_RAISE_ERROR, http_parse_cookie_callback, &arg)) { ++ if (free_list) { ++ http_cookie_list_free(&list); ++ } else { ++ http_cookie_list_dtor(list); ++ } ++ list = NULL; ++ } ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_tostruct(http_cookie_list *, zval *) */ ++PHP_HTTP_API void _http_cookie_list_tostruct(http_cookie_list *list, zval *strct TSRMLS_DC) ++{ ++ zval array, *cookies, *extras; ++ ++ INIT_ZARR(array, HASH_OF(strct)); ++ ++ MAKE_STD_ZVAL(cookies); ++ array_init(cookies); ++ zend_hash_copy(Z_ARRVAL_P(cookies), &list->cookies, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&array, "cookies", cookies); ++ ++ MAKE_STD_ZVAL(extras); ++ array_init(extras); ++ zend_hash_copy(Z_ARRVAL_P(extras), &list->extras, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&array, "extras", extras); ++ ++ add_assoc_long(&array, "flags", list->flags); ++ add_assoc_long(&array, "expires", (long) list->expires); ++ add_assoc_string(&array, "path", STR_PTR(list->path), 1); ++ add_assoc_string(&array, "domain", STR_PTR(list->domain), 1); ++} ++/* }}} */ ++ ++/* {{{ http_cookie_list *http_cookie_list_fromstruct(http_cookie_list *, zval *strct) */ ++PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *list, zval *strct TSRMLS_DC) ++{ ++ zval **tmp, *cpy; ++ HashTable *ht = HASH_OF(strct); ++ ++ list = http_cookie_list_init(list); ++ ++ if (SUCCESS == zend_hash_find(ht, "cookies", sizeof("cookies"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_ARRAY) { ++ zend_hash_copy(&list->cookies, Z_ARRVAL_PP(tmp), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "extras", sizeof("extras"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_ARRAY) { ++ zend_hash_copy(&list->extras, Z_ARRVAL_PP(tmp), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "flags", sizeof("flags"), (void *) &tmp)) { ++ switch (Z_TYPE_PP(tmp)) { ++ case IS_LONG: ++ list->flags = Z_LVAL_PP(tmp); ++ break; ++ case IS_DOUBLE: ++ list->flags = (long) Z_DVAL_PP(tmp); ++ break; ++ case IS_STRING: ++ cpy = http_zsep(IS_LONG, *tmp); ++ list->flags = Z_LVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++ break; ++ default: ++ break; ++ } ++ } ++ if (SUCCESS == zend_hash_find(ht, "expires", sizeof("expires"), (void *) &tmp)) { ++ switch (Z_TYPE_PP(tmp)) { ++ case IS_LONG: ++ list->expires = Z_LVAL_PP(tmp); ++ break; ++ case IS_DOUBLE: ++ list->expires = (long) Z_DVAL_PP(tmp); ++ break; ++ case IS_STRING: ++ cpy = http_zsep(IS_LONG, *tmp); ++ if (Z_LVAL_P(cpy)) { ++ list->expires = Z_LVAL_P(cpy); ++ } else { ++ time_t expires = http_parse_date(Z_STRVAL_PP(tmp)); ++ if (expires > 0) { ++ list->expires = expires; ++ } ++ } ++ zval_ptr_dtor(&cpy); ++ break; ++ default: ++ break; ++ } ++ } ++ if (SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) { ++ list->path = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "domain", sizeof("domain"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) { ++ list->domain = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); ++ } ++ ++ return list; ++} ++/* }}} */ ++ ++/* {{{ inline append_encoded */ ++static inline void append_encoded(phpstr *buf, const char *key, size_t key_len, const char *val, size_t val_len) ++{ ++ char *enc_str[2]; ++ int enc_len[2]; ++ ++ enc_str[0] = php_url_encode(key, key_len, &enc_len[0]); ++ enc_str[1] = php_url_encode(val, val_len, &enc_len[1]); ++ ++ phpstr_append(buf, enc_str[0], enc_len[0]); ++ phpstr_appends(buf, "="); ++ phpstr_append(buf, enc_str[1], enc_len[1]); ++ phpstr_appends(buf, "; "); ++ ++ efree(enc_str[0]); ++ efree(enc_str[1]); ++} ++/* }}} */ ++ ++/* {{{ void http_cookie_list_tostring(http_cookie_list *, char **, size_t *) */ ++PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str, size_t *len TSRMLS_DC) ++{ ++ phpstr buf; ++ zval **val; ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ ++ phpstr_init(&buf); ++ ++ FOREACH_HASH_KEYVAL(pos, &list->cookies, key, val) { ++ if (key.type == HASH_KEY_IS_STRING && key.len) { ++ zval *tmp = http_zsep(IS_STRING, *val); ++ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); ++ zval_ptr_dtor(&tmp); ++ } ++ } ++ ++ if (list->domain && *list->domain) { ++ phpstr_appendf(&buf, "domain=%s; ", list->domain); ++ } ++ if (list->path && *list->path) { ++ phpstr_appendf(&buf, "path=%s; ", list->path); ++ } ++ if (list->expires) { ++ char *date = http_date(list->expires); ++ phpstr_appendf(&buf, "expires=%s; ", date); ++ efree(date); ++ } ++ ++ FOREACH_HASH_KEYVAL(pos, &list->extras, key, val) { ++ if (key.type == HASH_KEY_IS_STRING && key.len) { ++ zval *tmp = http_zsep(IS_STRING, *val); ++ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); ++ } ++ } ++ ++ if (list->flags & HTTP_COOKIE_SECURE) { ++ phpstr_appends(&buf, "secure; "); ++ } ++ if (list->flags & HTTP_COOKIE_HTTPONLY) { ++ phpstr_appends(&buf, "httpOnly; "); ++ } ++ ++ phpstr_fix(&buf); ++ *str = PHPSTR_VAL(&buf); ++ *len = PHPSTR_LEN(&buf); ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_date_api.c +@@ -0,0 +1,357 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_date_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_date_api.h" ++ ++static inline int check_day(const char *day, size_t len); ++static inline int check_month(const char *month); ++static inline int check_tzone(const char *tzone); ++static inline time_t parse_date(const char *month); ++ ++/* {{{ day/month names */ ++static const char *days[] = { ++ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ++}; ++static const char *wkdays[] = { ++ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ++}; ++static const char *weekdays[] = { ++ "Monday", "Tuesday", "Wednesday", ++ "Thursday", "Friday", "Saturday", "Sunday" ++}; ++static const char *months[] = { ++ "Jan", "Feb", "Mar", "Apr", "May", "Jun", ++ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ++}; ++enum assume_next { ++ DATE_MDAY, ++ DATE_YEAR, ++ DATE_TIME ++}; ++#define DS -60 ++static const struct time_zone { ++ const char *name; ++ const int offset; ++} time_zones[] = { ++ {"GMT", 0}, /* Greenwich Mean */ ++ {"UTC", 0}, /* Universal (Coordinated) */ ++ {"WET", 0}, /* Western European */ ++ {"BST", 0 DS}, /* British Summer */ ++ {"WAT", 60}, /* West Africa */ ++ {"AST", 240}, /* Atlantic Standard */ ++ {"ADT", 240 DS},/* Atlantic Daylight */ ++ {"EST", 300}, /* Eastern Standard */ ++ {"EDT", 300 DS},/* Eastern Daylight */ ++ {"CST", 360}, /* Central Standard */ ++ {"CDT", 360 DS},/* Central Daylight */ ++ {"MST", 420}, /* Mountain Standard */ ++ {"MDT", 420 DS},/* Mountain Daylight */ ++ {"PST", 480}, /* Pacific Standard */ ++ {"PDT", 480 DS},/* Pacific Daylight */ ++ {"YST", 540}, /* Yukon Standard */ ++ {"YDT", 540 DS},/* Yukon Daylight */ ++ {"HST", 600}, /* Hawaii Standard */ ++ {"HDT", 600 DS},/* Hawaii Daylight */ ++ {"CAT", 600}, /* Central Alaska */ ++ {"AHST", 600}, /* Alaska-Hawaii Standard */ ++ {"NT", 660}, /* Nome */ ++ {"IDLW", 720}, /* International Date Line West */ ++ {"CET", -60}, /* Central European */ ++ {"MET", -60}, /* Middle European */ ++ {"MEWT", -60}, /* Middle European Winter */ ++ {"MEST", -60 DS},/* Middle European Summer */ ++ {"CEST", -60 DS},/* Central European Summer */ ++ {"MESZ", -60 DS},/* Middle European Summer */ ++ {"FWT", -60}, /* French Winter */ ++ {"FST", -60 DS},/* French Summer */ ++ {"EET", -120}, /* Eastern Europe, USSR Zone 1 */ ++ {"WAST", -420}, /* West Australian Standard */ ++ {"WADT", -420 DS},/* West Australian Daylight */ ++ {"CCT", -480}, /* China Coast, USSR Zone 7 */ ++ {"JST", -540}, /* Japan Standard, USSR Zone 8 */ ++ {"EAST", -600}, /* Eastern Australian Standard */ ++ {"EADT", -600 DS},/* Eastern Australian Daylight */ ++ {"GST", -600}, /* Guam Standard, USSR Zone 9 */ ++ {"NZT", -720}, /* New Zealand */ ++ {"NZST", -720}, /* New Zealand Standard */ ++ {"NZDT", -720 DS},/* New Zealand Daylight */ ++ {"IDLE", -720}, /* International Date Line East */ ++}; ++/* }}} */ ++ ++/* {{{ Day/Month/TZ checks for http_parse_date() ++ Originally by libcurl, Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. */ ++static inline int check_day(const char *day, size_t len) ++{ ++ int i; ++ const char * const *check = (len > 3) ? &weekdays[0] : &wkdays[0]; ++ for (i = 0; i < 7; i++) { ++ if (!strcmp(day, check[0])) { ++ return i; ++ } ++ check++; ++ } ++ return -1; ++} ++ ++static inline int check_month(const char *month) ++{ ++ int i; ++ const char * const *check = &months[0]; ++ for (i = 0; i < 12; i++) { ++ if (!strcmp(month, check[0])) { ++ return i; ++ } ++ check++; ++ } ++ return -1; ++} ++ ++/* return the time zone offset between GMT and the input one, in number ++ of seconds or -1 if the timezone wasn't found/legal */ ++ ++static inline int check_tzone(const char *tzone) ++{ ++ unsigned i; ++ const struct time_zone *check = time_zones; ++ for (i = 0; i < sizeof(time_zones) / sizeof(time_zones[0]); i++) { ++ if (!strcmp(tzone, check->name)) { ++ return check->offset * 60; ++ } ++ check++; ++ } ++ return -1; ++} ++/* }}} */ ++ ++/* {{{ char *http_date(time_t) */ ++PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC) ++{ ++ char *date = NULL; ++ struct tm *gmtime = NULL, tmbuf; ++ ++ memset(&tmbuf, 0, sizeof(tmbuf)); ++ if ((gmtime = php_gmtime_r(&t, &tmbuf))) { ++ spprintf(&date, 0, ++ "%s, %02d %s %04d %02d:%02d:%02d GMT", ++ days[gmtime->tm_wday], gmtime->tm_mday, ++ months[gmtime->tm_mon], gmtime->tm_year + 1900, ++ gmtime->tm_hour, gmtime->tm_min, gmtime->tm_sec ++ ); ++ } ++ ++ return date; ++} ++/* }}} */ ++ ++/* {{{ time_t http_parse_date(char *) */ ++PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC) ++{ ++ time_t t = parse_date(date); ++ ++ if (-1 == t && !silent) { ++ http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Could not parse date: %s", date); ++ } ++ ++ return t; ++} ++/* }}} */ ++ ++/* time_t parse_date(char *) ++ Originally by libcurl, Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. */ ++static inline time_t parse_date(const char *date) ++{ ++ time_t t = 0; ++ int tz_offset = -1, year = -1, month = -1, monthday = -1, weekday = -1, ++ hours = -1, minutes = -1, seconds = -1; ++ struct tm tm; ++ enum assume_next dignext = DATE_MDAY; ++ const char *indate = date; ++ ++ int part = 0; /* max 6 parts */ ++ ++ while (*date && (part < 6)) { ++ int found = 0; ++ ++ while (*date && !HTTP_IS_CTYPE(alnum, *date)) { ++ date++; ++ } ++ ++ if (HTTP_IS_CTYPE(alpha, *date)) { ++ /* a name coming up */ ++ char buf[32] = ""; ++ size_t len; ++ sscanf(date, "%31[A-Za-z]", buf); ++ len = strlen(buf); ++ ++ if (weekday == -1) { ++ weekday = check_day(buf, len); ++ if (weekday != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found && (month == -1)) { ++ month = check_month(buf); ++ if (month != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found && (tz_offset == -1)) { ++ /* this just must be a time zone string */ ++ tz_offset = check_tzone(buf); ++ if (tz_offset != -1) { ++ found = 1; ++ } ++ } ++ ++ if (!found) { ++ return -1; /* bad string */ ++ } ++ date += len; ++ } ++ else if (HTTP_IS_CTYPE(digit, *date)) { ++ /* a digit */ ++ int val; ++ char *end; ++ if ((seconds == -1) && ++ (3 == sscanf(date, "%02d:%02d:%02d", &hours, &minutes, &seconds))) { ++ /* time stamp! */ ++ date += 8; ++ found = 1; ++ } ++ else { ++ val = (int) strtol(date, &end, 10); ++ ++ if ((tz_offset == -1) && ((end - date) == 4) && (val < 1300) && ++ (indate < date) && ((date[-1] == '+' || date[-1] == '-'))) { ++ /* four digits and a value less than 1300 and it is preceeded with ++ a plus or minus. This is a time zone indication. */ ++ found = 1; ++ tz_offset = (val / 100 * 60 + val % 100) * 60; ++ ++ /* the + and - prefix indicates the local time compared to GMT, ++ this we need ther reversed math to get what we want */ ++ tz_offset = date[-1] == '+' ? -tz_offset : tz_offset; ++ } ++ ++ if (((end - date) == 8) && (year == -1) && (month == -1) && (monthday == -1)) { ++ /* 8 digits, no year, month or day yet. This is YYYYMMDD */ ++ found = 1; ++ year = val / 10000; ++ month = (val % 10000) / 100 - 1; /* month is 0 - 11 */ ++ monthday = val % 100; ++ } ++ ++ if (!found && (dignext == DATE_MDAY) && (monthday == -1)) { ++ if ((val > 0) && (val < 32)) { ++ monthday = val; ++ found = 1; ++ } ++ dignext = DATE_YEAR; ++ } ++ ++ if (!found && (dignext == DATE_YEAR) && (year == -1)) { ++ year = val; ++ found = 1; ++ if (year < 1900) { ++ year += year > 70 ? 1900 : 2000; ++ } ++ if(monthday == -1) { ++ dignext = DATE_MDAY; ++ } ++ } ++ ++ if (!found) { ++ return -1; ++ } ++ ++ date = end; ++ } ++ } ++ ++ part++; ++ } ++ ++ if (-1 == seconds) { ++ seconds = minutes = hours = 0; /* no time, make it zero */ ++ } ++ ++ if ((-1 == monthday) || (-1 == month) || (-1 == year)) { ++ /* lacks vital info, fail */ ++ return -1; ++ } ++ ++ if (sizeof(time_t) < 5) { ++ /* 32 bit time_t can only hold dates to the beginning of 2038 */ ++ if (year > 2037) { ++ return 0x7fffffff; ++ } ++ } ++ ++ tm.tm_sec = seconds; ++ tm.tm_min = minutes; ++ tm.tm_hour = hours; ++ tm.tm_mday = monthday; ++ tm.tm_mon = month; ++ tm.tm_year = year - 1900; ++ tm.tm_wday = 0; ++ tm.tm_yday = 0; ++ tm.tm_isdst = 0; ++ ++ t = mktime(&tm); ++ ++ /* time zone adjust */ ++ if (t != -1) { ++ struct tm *gmt, keeptime2; ++ long delta; ++ time_t t2; ++ ++ if((gmt = php_gmtime_r(&t, &keeptime2))) { ++ tm = *gmt; /* MSVC quirks */ ++ } else { ++ return -1; /* illegal date/time */ ++ } ++ ++ t2 = mktime(&tm); ++ ++ /* Add the time zone diff (between the given timezone and GMT) and the ++ diff between the local time zone and GMT. */ ++ delta = (tz_offset != -1 ? tz_offset : 0) + (t - t2); ++ ++ if((delta > 0) && (t + delta < t)) { ++ return -1; /* time_t overflow */ ++ } ++ ++ t += delta; ++ } ++ ++ return t; ++} ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_deflatestream_object.c +@@ -0,0 +1,312 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_deflatestream_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_ZLIB) ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_deflatestream_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpDeflateStream, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpDeflateStream, method, 0) ++#define HTTP_DEFLATE_ME(method, visibility) PHP_ME(HttpDeflateStream, method, HTTP_ARGS(HttpDeflateStream, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(update, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(flush, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(finish, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++#define THIS_CE http_deflatestream_object_ce ++zend_class_entry *http_deflatestream_object_ce; ++zend_function_entry http_deflatestream_object_fe[] = { ++ HTTP_DEFLATE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_DEFLATE_ME(update, ZEND_ACC_PUBLIC) ++ HTTP_DEFLATE_ME(flush, ZEND_ACC_PUBLIC) ++ HTTP_DEFLATE_ME(finish, ZEND_ACC_PUBLIC) ++ ++ HTTP_DEFLATE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_deflatestream_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_deflatestream_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpDeflateStream, http_deflatestream_object, NULL, 0); ++ http_deflatestream_object_handlers.clone_obj = _http_deflatestream_object_clone_obj; ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_GZIP")-1, HTTP_DEFLATE_TYPE_GZIP TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_ZLIB")-1, HTTP_DEFLATE_TYPE_ZLIB TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_RAW")-1, HTTP_DEFLATE_TYPE_RAW TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_DEF")-1, HTTP_DEFLATE_LEVEL_DEF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_MIN")-1, HTTP_DEFLATE_LEVEL_MIN TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("LEVEL_MAX")-1, HTTP_DEFLATE_LEVEL_MAX TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_DEF")-1, HTTP_DEFLATE_STRATEGY_DEF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_FILT")-1, HTTP_DEFLATE_STRATEGY_FILT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_HUFF")-1, HTTP_DEFLATE_STRATEGY_HUFF TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_RLE")-1, HTTP_DEFLATE_STRATEGY_RLE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("STRATEGY_FIXED")-1, HTTP_DEFLATE_STRATEGY_FIXED TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_NONE")-1, HTTP_ENCODING_STREAM_FLUSH_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_SYNC")-1, HTTP_ENCODING_STREAM_FLUSH_SYNC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_FULL")-1, HTTP_ENCODING_STREAM_FLUSH_FULL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_deflatestream_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_deflatestream_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_deflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_deflatestream_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_deflatestream_object *o; ++ ++ o = ecalloc(1, sizeof(http_deflatestream_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (s) { ++ o->stream = s; ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_deflatestream_object, o); ++ ov.handlers = &http_deflatestream_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_deflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ http_encoding_stream *s; ++ zend_object_value new_ov; ++ http_deflatestream_object *new_obj = NULL; ++ getObject(http_deflatestream_object, old_obj); ++ ++ s = ecalloc(1, sizeof(http_encoding_stream)); ++ s->flags = old_obj->stream->flags; ++ deflateCopy(&s->stream, &old_obj->stream->stream); ++ s->stream.opaque = phpstr_dup(s->stream.opaque); ++ ++ new_ov = http_deflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_deflatestream_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_deflatestream_object *o = (http_deflatestream_object *) object; ++ ++ if (o->stream) { ++ http_encoding_deflate_stream_free(&o->stream); ++ } ++ freeObject(o); ++} ++ ++/* {{{ proto void HttpDeflateStream::__construct([int flags = 0]) ++ Creates a new HttpDeflateStream object instance. */ ++PHP_METHOD(HttpDeflateStream, __construct) ++{ ++ long flags = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) { ++ getObject(http_deflatestream_object, obj); ++ ++ if (!obj->stream) { ++ obj->stream = http_encoding_deflate_stream_init(NULL, flags & 0x0fffffff); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "HttpDeflateStream cannot be initialized twice"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpDeflateStream HttpDeflateStream::factory([int flags[, string class = "HttpDeflateStream"]]) ++ Creates a new HttpDeflateStream object instance. */ ++PHP_METHOD(HttpDeflateStream, factory) ++{ ++ long flags = 0; ++ char *cn = NULL; ++ int cl = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &flags, &cn, &cl)) { ++ zend_object_value ov; ++ http_encoding_stream *s = http_encoding_deflate_stream_init(NULL, flags & 0x0fffffff); ++ ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_deflatestream_object_new_ex, http_deflatestream_object_ce, s, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::update(string data) ++ Passes more data through the deflate stream. */ ++PHP_METHOD(HttpDeflateStream, update) ++{ ++ int data_len; ++ size_t encoded_len = 0; ++ char *data, *encoded = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_update(obj->stream, data, data_len, &encoded, &encoded_len)) { ++ RETURN_STRINGL(encoded, encoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::flush([string data]) ++ Flushes the deflate stream. */ ++PHP_METHOD(HttpDeflateStream, flush) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, encoded_len = 0; ++ char *updated = NULL, *encoded = NULL, *data = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_deflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_flush(obj->stream, &encoded, &encoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + encoded_len + 1); ++ updated[updated_len + encoded_len] = '\0'; ++ memcpy(updated + updated_len, encoded, encoded_len); ++ STR_FREE(encoded); ++ updated_len += encoded_len; ++ RETURN_STRINGL(updated, updated_len, 0); ++ } else if (encoded) { ++ RETVAL_STRINGL(encoded, encoded_len, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ } else { ++ RETVAL_FALSE; ++ } ++ STR_FREE(updated); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpDeflateStream::finish([string data]) ++ Finalizes the deflate stream. The deflate stream can be reused after finalizing. */ ++PHP_METHOD(HttpDeflateStream, finish) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, encoded_len = 0; ++ char *updated = NULL, *encoded = NULL, *data = NULL; ++ getObject(http_deflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_deflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_deflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_deflate_stream_finish(obj->stream, &encoded, &encoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + encoded_len + 1); ++ updated[updated_len + encoded_len] = '\0'; ++ memcpy(updated + updated_len, encoded, encoded_len); ++ STR_FREE(encoded); ++ updated_len += encoded_len; ++ RETVAL_STRINGL(updated, updated_len, 0); ++ } else { ++ STR_FREE(updated); ++ RETVAL_STRINGL(encoded, encoded_len, 0); ++ } ++ } else { ++ STR_FREE(updated); ++ RETVAL_FALSE; ++ } ++ ++ http_encoding_deflate_stream_dtor(obj->stream); ++ http_encoding_deflate_stream_init(obj->stream, obj->stream->flags); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_ZLIB*/ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_encoding_api.c +@@ -0,0 +1,780 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_encoding_api.c 305668 2010-11-22 20:17:41Z iliaa $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_send_api.h" ++#include "php_http_headers_api.h" ++ ++/* {{{ */ ++#ifdef HTTP_HAVE_ZLIB ++PHP_MINIT_FUNCTION(http_encoding) ++{ ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_ZLIB", HTTP_DEFLATE_TYPE_ZLIB); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_GZIP", HTTP_DEFLATE_TYPE_GZIP); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_TYPE_RAW", HTTP_DEFLATE_TYPE_RAW); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE); ++ HTTP_LONG_CONSTANT("HTTP_DEFLATE_STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED); ++ ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_NONE", HTTP_ENCODING_STREAM_FLUSH_NONE); ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_SYNC", HTTP_ENCODING_STREAM_FLUSH_SYNC); ++ HTTP_LONG_CONSTANT("HTTP_ENCODING_STREAM_FLUSH_FULL", HTTP_ENCODING_STREAM_FLUSH_FULL); ++ ++ return SUCCESS; ++} ++ ++PHP_RINIT_FUNCTION(http_encoding) ++{ ++ if (HTTP_G->send.inflate.start_auto) { ++ php_ob_set_internal_handler(_http_ob_inflatehandler, HTTP_INFLATE_BUFFER_SIZE, "http inflate", 0 TSRMLS_CC); ++ } ++ if (HTTP_G->send.deflate.start_auto) { ++ php_ob_set_internal_handler(_http_ob_deflatehandler, HTTP_DEFLATE_BUFFER_SIZE, "http deflate", 0 TSRMLS_CC); ++ } ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_encoding) ++{ ++ if (HTTP_G->send.deflate.stream) { ++ http_encoding_deflate_stream_free((http_encoding_stream **) &HTTP_G->send.deflate.stream); ++ } ++ if (HTTP_G->send.inflate.stream) { ++ http_encoding_inflate_stream_free((http_encoding_stream **) &HTTP_G->send.inflate.stream); ++ } ++ return SUCCESS; ++} ++#endif ++/* }}} */ ++ ++/* {{{ eol_match(char **, int *) */ ++static inline int eol_match(char **line, int *eol_len) ++{ ++ char *ptr = *line; ++ ++ while (' ' == *ptr) ++ptr; ++ ++ if (ptr == http_locate_eol(*line, eol_len)) { ++ *line = ptr; ++ return 1; ++ } else { ++ return 0; ++ } ++} ++/* }}} */ ++ ++/* {{{ char *http_encoding_dechunk(char *, size_t, char **, size_t *) */ ++PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC) ++{ ++ int eol_len = 0; ++ char *n_ptr = NULL; ++ const char *e_ptr = encoded; ++ ++ *decoded_len = 0; ++ *decoded = ecalloc(1, encoded_len); ++ ++ while ((encoded + encoded_len - e_ptr) > 0) { ++ ulong chunk_len = 0, rest; ++ ++ chunk_len = strtoul(e_ptr, &n_ptr, 16); ++ ++ /* we could not read in chunk size */ ++ if (n_ptr == e_ptr) { ++ /* ++ * if this is the first turn and there doesn't seem to be a chunk ++ * size at the begining of the body, do not fail on apparently ++ * not encoded data and return a copy ++ */ ++ if (e_ptr == encoded) { ++ http_error(HE_NOTICE, HTTP_E_ENCODING, "Data does not seem to be chunked encoded"); ++ memcpy(*decoded, encoded, encoded_len); ++ *decoded_len = encoded_len; ++ return encoded + encoded_len; ++ } else { ++ efree(*decoded); ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected chunk size at pos %tu of %zu but got trash", n_ptr - encoded, encoded_len); ++ return NULL; ++ } ++ } ++ ++ /* reached the end */ ++ if (!chunk_len) { ++ /* move over '0' chunked encoding terminator */ ++ while (*e_ptr == '0') ++e_ptr; ++ break; ++ } ++ ++ /* there should be CRLF after the chunk size, but we'll ignore SP+ too */ ++ if (*n_ptr && !eol_match(&n_ptr, &eol_len)) { ++ if (eol_len == 2) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected CRLF at pos %tu of %zu but got 0x%02X 0x%02X", n_ptr - encoded, encoded_len, *n_ptr, *(n_ptr + 1)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected LF at pos %tu of %zu but got 0x%02X", n_ptr - encoded, encoded_len, *n_ptr); ++ } ++ } ++ n_ptr += eol_len; ++ ++ /* chunk size pretends more data than we actually got, so it's probably a truncated message */ ++ if (chunk_len > (rest = encoded + encoded_len - n_ptr)) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Truncated message: chunk size %lu exceeds remaining data size %lu at pos %tu of %zu", chunk_len, rest, n_ptr - encoded, encoded_len); ++ chunk_len = rest; ++ } ++ ++ /* copy the chunk */ ++ memcpy(*decoded + *decoded_len, n_ptr, chunk_len); ++ *decoded_len += chunk_len; ++ ++ if (chunk_len == rest) { ++ e_ptr = n_ptr + chunk_len; ++ break; ++ } else { ++ /* advance to next chunk */ ++ e_ptr = n_ptr + chunk_len + eol_len; ++ } ++ } ++ ++ return e_ptr; ++} ++/* }}} */ ++ ++/* {{{ int http_encoding_response_start(size_t) */ ++PHP_HTTP_API int _http_encoding_response_start(size_t content_length, zend_bool ignore_http_ohandler TSRMLS_DC) ++{ ++ int response = HTTP_G->send.deflate.response; ++ int ohandler = php_ob_handler_used("ob_gzhandler" TSRMLS_CC) || php_ob_handler_used("zlib output compression" TSRMLS_CC); ++ ++ if (!ohandler && !ignore_http_ohandler) { ++ ohandler = php_ob_handler_used("ob_deflatehandler" TSRMLS_CC) || php_ob_handler_used("http deflate" TSRMLS_CC); ++ } ++ ++ if (response && !ohandler) { ++#ifdef HTTP_HAVE_ZLIB ++ HashTable *selected; ++ zval zsupported; ++ ++ HTTP_G->send.deflate.encoding = 0; ++ ++ INIT_PZVAL(&zsupported); ++ array_init(&zsupported); ++ add_next_index_stringl(&zsupported, "gzip", lenof("gzip"), 1); ++ add_next_index_stringl(&zsupported, "x-gzip", lenof("x-gzip"), 1); ++ add_next_index_stringl(&zsupported, "deflate", lenof("deflate"), 1); ++ ++ if ((selected = http_negotiate_encoding(&zsupported))) { ++ STATUS hs = FAILURE; ++ char *encoding = NULL; ++ ulong idx; ++ ++ if (HASH_KEY_IS_STRING == zend_hash_get_current_key(selected, &encoding, &idx, 0) && encoding) { ++ if (!strcmp(encoding, "gzip") || !strcmp(encoding, "x-gzip")) { ++ if (SUCCESS == (hs = http_send_header_string("Content-Encoding: gzip"))) { ++ HTTP_G->send.deflate.encoding = HTTP_ENCODING_GZIP; ++ } ++ } else if (!strcmp(encoding, "deflate")) { ++ if (SUCCESS == (hs = http_send_header_string("Content-Encoding: deflate"))) { ++ HTTP_G->send.deflate.encoding = HTTP_ENCODING_DEFLATE; ++ } ++ } ++ if (SUCCESS == hs) { ++ http_send_header_string("Vary: Accept-Encoding"); ++ } ++ } ++ ++ zend_hash_destroy(selected); ++ FREE_HASHTABLE(selected); ++ } ++ ++ zval_dtor(&zsupported); ++#else ++ HTTP_G->send.deflate.encoding = 0; ++ php_start_ob_buffer_named("ob_gzhandler", 0, 0 TSRMLS_CC); ++#endif /* HTTP_HAVE_ZLIB */ ++ } else if (content_length && !ohandler) { ++ /* emit a content-length header */ ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Length: %zu", content_length); ++ phpstr_fix(&header); ++ http_send_header_string_ex(PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ } else { ++ HTTP_G->send.deflate.encoding = 0; ++ } ++ ++ return HTTP_G->send.deflate.encoding; ++} ++/* }}} */ ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++/* {{{ inline int http_inflate_rounds */ ++static inline int http_inflate_rounds(z_stream *Z, int flush, char **buf, size_t *len) ++{ ++ int status = 0, round = 0; ++ phpstr buffer; ++ ++ *buf = NULL; ++ *len = 0; ++ ++ phpstr_init_ex(&buffer, Z->avail_in, PHPSTR_INIT_PREALLOC); ++ ++ do { ++ if (PHPSTR_NOMEM == phpstr_resize_ex(&buffer, buffer.size, 0, 1)) { ++ status = Z_MEM_ERROR; ++ } else { ++ Z->avail_out = buffer.free; ++ Z->next_out = (Bytef *) buffer.data + buffer.used; ++#if 0 ++ fprintf(stderr, "\n%3d: %3d PRIOR: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); ++#endif ++ status = inflate(Z, flush); ++ ++ buffer.used += buffer.free - Z->avail_out; ++ buffer.free = Z->avail_out; ++#if 0 ++ fprintf(stderr, "%3d: %3d AFTER: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); ++#endif ++ HTTP_INFLATE_BUFFER_SIZE_ALIGN(buffer.size); ++ } ++ } while ((Z_BUF_ERROR == status || (Z_OK == status && Z->avail_in)) && ++round < HTTP_INFLATE_ROUNDS); ++ ++ if (status == Z_OK || status == Z_STREAM_END) { ++ phpstr_shrink(&buffer); ++ phpstr_fix(&buffer); ++ *buf = buffer.data; ++ *len = buffer.used; ++ } else { ++ phpstr_dtor(&buffer); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate(int, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, level, wbits, strategy; ++ z_stream Z; ++ ++ HTTP_DEFLATE_LEVEL_SET(flags, level); ++ HTTP_DEFLATE_WBITS_SET(flags, wbits); ++ HTTP_DEFLATE_STRATEGY_SET(flags, strategy); ++ ++ memset(&Z, 0, sizeof(z_stream)); ++ *encoded = NULL; ++ *encoded_len = 0; ++ ++ status = deflateInit2(&Z, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, strategy); ++ if (Z_OK == status) { ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE_GUESS(data_len); ++ *encoded = emalloc_rel(*encoded_len); ++ ++ Z.next_in = (Bytef *) data; ++ Z.next_out = (Bytef *) *encoded; ++ Z.avail_in = data_len; ++ Z.avail_out = *encoded_len; ++ ++ status = deflate(&Z, Z_FINISH); ++ deflateEnd(&Z); ++ ++ if (Z_STREAM_END == status) { ++ /* size buffer down to actual length */ ++ *encoded = erealloc_rel(*encoded, Z.total_out + 1); ++ (*encoded)[*encoded_len = Z.total_out] = '\0'; ++ return SUCCESS; ++ } else { ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ } ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not deflate data: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate(char *, size_t, char **, size_t) */ ++PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ z_stream Z; ++ int status, wbits = HTTP_WINDOW_BITS_ANY; ++ ++ memset(&Z, 0, sizeof(z_stream)); ++ ++retry_raw_inflate: ++ status = inflateInit2(&Z, wbits); ++ if (Z_OK == status) { ++ Z.next_in = (Bytef *) data; ++ Z.avail_in = data_len; ++ ++ switch (status = http_inflate_rounds(&Z, Z_NO_FLUSH, decoded, decoded_len)) { ++ case Z_STREAM_END: ++ inflateEnd(&Z); ++ return SUCCESS; ++ ++ case Z_OK: ++ status = Z_DATA_ERROR; ++ break; ++ ++ case Z_DATA_ERROR: ++ /* raw deflated data? */ ++ if (HTTP_WINDOW_BITS_ANY == wbits) { ++ inflateEnd(&Z); ++ wbits = HTTP_WINDOW_BITS_RAW; ++ goto retry_raw_inflate; ++ } ++ } ++ inflateEnd(&Z); ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not inflate data: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *, int) */ ++PHP_HTTP_API http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, level, wbits, strategy, free_stream; ++ ++ if ((free_stream = !s)) { ++ s = pemalloc_rel(sizeof(http_encoding_stream), (flags & HTTP_ENCODING_STREAM_PERSISTENT)); ++ } ++ memset(s, 0, sizeof(http_encoding_stream)); ++ s->flags = flags; ++ ++ HTTP_DEFLATE_LEVEL_SET(flags, level); ++ HTTP_DEFLATE_WBITS_SET(flags, wbits); ++ HTTP_DEFLATE_STRATEGY_SET(flags, strategy); ++ ++ if (Z_OK == (status = deflateInit2(&s->stream, level, Z_DEFLATED, wbits, MAX_MEM_LEVEL, strategy))) { ++ int p = (flags & HTTP_ENCODING_STREAM_PERSISTENT) ? PHPSTR_INIT_PERSISTENT:0; ++ ++ if ((s->stream.opaque = phpstr_init_ex(NULL, HTTP_DEFLATE_BUFFER_SIZE, p))) { ++ return s; ++ } ++ deflateEnd(&s->stream); ++ status = Z_MEM_ERROR; ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to initialize deflate encoding stream: %s", zError(status)); ++ if (free_stream) { ++ efree(s); ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ http_encoding_stream *http_encoding_inflate_stream_init(http_encoding_stream *, int) */ ++PHP_HTTP_API http_encoding_stream *_http_encoding_inflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status, wbits, free_stream; ++ ++ if ((free_stream = !s)) { ++ s = pemalloc_rel(sizeof(http_encoding_stream), (flags & HTTP_ENCODING_STREAM_PERSISTENT)); ++ } ++ memset(s, 0, sizeof(http_encoding_stream)); ++ s->flags = flags; ++ ++ HTTP_INFLATE_WBITS_SET(flags, wbits); ++ ++ if (Z_OK == (status = inflateInit2(&s->stream, wbits))) { ++ int p = (flags & HTTP_ENCODING_STREAM_PERSISTENT) ? PHPSTR_INIT_PERSISTENT:0; ++ ++ if ((s->stream.opaque = phpstr_init_ex(NULL, HTTP_DEFLATE_BUFFER_SIZE, p))) { ++ return s; ++ } ++ inflateEnd(&s->stream); ++ status = Z_MEM_ERROR; ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to initialize inflate stream: %s", zError(status)); ++ if (free_stream) { ++ efree(s); ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_update(http_encoding_stream *, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ /* append input to our buffer */ ++ phpstr_append(PHPSTR(s->stream.opaque), data, data_len); ++ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ /* deflate */ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE_GUESS(data_len); ++ *encoded = emalloc_rel(*encoded_len); ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ switch (status = deflate(&s->stream, HTTP_ENCODING_STREAM_FLUSH_FLAG(s->flags))) { ++ case Z_OK: ++ case Z_STREAM_END: ++ /* cut processed chunk off the buffer */ ++ if (s->stream.avail_in) { ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ } else { ++ phpstr_reset(PHPSTR(s->stream.opaque)); ++ } ++ ++ /* size buffer down to actual size */ ++ *encoded_len -= s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to update deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_stream_update(http_encoding_stream *, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ /* append input to buffer */ ++ phpstr_append(PHPSTR(s->stream.opaque), data, data_len); ++ ++retry_raw_inflate: ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ switch (status = http_inflate_rounds(&s->stream, HTTP_ENCODING_STREAM_FLUSH_FLAG(s->flags), decoded, decoded_len)) { ++ case Z_OK: ++ case Z_STREAM_END: ++ /* cut off */ ++ if (s->stream.avail_in) { ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ } else { ++ phpstr_reset(PHPSTR(s->stream.opaque)); ++ } ++ return SUCCESS; ++ ++ case Z_DATA_ERROR: ++ /* raw deflated data ? */ ++ if (!(s->flags & HTTP_INFLATE_TYPE_RAW) && !s->stream.total_out) { ++ inflateEnd(&s->stream); ++ s->flags |= HTTP_INFLATE_TYPE_RAW; ++ inflateInit2(&s->stream, HTTP_WINDOW_BITS_RAW); ++ goto retry_raw_inflate; ++ } ++ } ++ ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to update inflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_flush(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE; ++ *encoded = emalloc_rel(*encoded_len); ++ ++ s->stream.avail_in = 0; ++ s->stream.next_in = NULL; ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ switch (status = deflate(&s->stream, Z_FULL_FLUSH)) { ++ case Z_OK: ++ case Z_STREAM_END: ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE - s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to flush deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_straem_flush(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_flush(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ /* noop */ ++ *decoded = estrndup("", *decoded_len = 0); ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_deflate_stream_finish(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ *encoded_len = HTTP_DEFLATE_BUFFER_SIZE; ++ *encoded = emalloc_rel(*encoded_len); ++ ++ /* deflate remaining input */ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ s->stream.avail_out = *encoded_len; ++ s->stream.next_out = (Bytef *) *encoded; ++ ++ do { ++ status = deflate(&s->stream, Z_FINISH); ++ } while (Z_OK == status); ++ ++ if (Z_STREAM_END == status) { ++ /* cut processed intp off */ ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ ++ /* size down */ ++ *encoded_len -= s->stream.avail_out; ++ *encoded = erealloc_rel(*encoded, *encoded_len + 1); ++ (*encoded)[*encoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*encoded, NULL); ++ *encoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to finish deflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_encoding_inflate_stream_finish(http_encoding_stream *, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ int status; ++ ++ if (!PHPSTR_LEN(s->stream.opaque)) { ++ *decoded = NULL; ++ *decoded_len = 0; ++ return SUCCESS; ++ } ++ ++ *decoded_len = (PHPSTR_LEN(s->stream.opaque) + 1) * HTTP_INFLATE_ROUNDS; ++ *decoded = emalloc_rel(*decoded_len); ++ ++ /* inflate remaining input */ ++ s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque); ++ s->stream.avail_in = PHPSTR_LEN(s->stream.opaque); ++ ++ s->stream.avail_out = *decoded_len; ++ s->stream.next_out = (Bytef *) *decoded; ++ ++ if (Z_STREAM_END == (status = inflate(&s->stream, Z_FINISH))) { ++ /* cut processed input off */ ++ phpstr_cut(PHPSTR(s->stream.opaque), 0, PHPSTR_LEN(s->stream.opaque) - s->stream.avail_in); ++ ++ /* size down */ ++ *decoded_len -= s->stream.avail_out; ++ *decoded = erealloc_rel(*decoded, *decoded_len + 1); ++ (*decoded)[*decoded_len] = '\0'; ++ return SUCCESS; ++ } ++ ++ STR_SET(*decoded, NULL); ++ *decoded_len = 0; ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Failed to finish inflate stream: %s", zError(status)); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_deflate_stream_dtor(http_encoding_stream *) */ ++PHP_HTTP_API void _http_encoding_deflate_stream_dtor(http_encoding_stream *s TSRMLS_DC) ++{ ++ if (s) { ++ if (s->stream.opaque) { ++ phpstr_free((phpstr **) &s->stream.opaque); ++ } ++ deflateEnd(&s->stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_inflate_stream_dtor(http_encoding_stream *) */ ++PHP_HTTP_API void _http_encoding_inflate_stream_dtor(http_encoding_stream *s TSRMLS_DC) ++{ ++ if (s) { ++ if (s->stream.opaque) { ++ phpstr_free((phpstr **) &s->stream.opaque); ++ } ++ inflateEnd(&s->stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_deflate_stream_free(http_encoding_stream **) */ ++PHP_HTTP_API void _http_encoding_deflate_stream_free(http_encoding_stream **s TSRMLS_DC) ++{ ++ if (s) { ++ http_encoding_deflate_stream_dtor(*s); ++ if (*s) { ++ pefree(*s, (*s)->flags & HTTP_ENCODING_STREAM_PERSISTENT); ++ } ++ *s = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_encoding_inflate_stream_free(http_encoding_stream **) */ ++PHP_HTTP_API void _http_encoding_inflate_stream_free(http_encoding_stream **s TSRMLS_DC) ++{ ++ if (s) { ++ http_encoding_inflate_stream_dtor(*s); ++ if (*s) { ++ pefree(*s, (*s)->flags & HTTP_ENCODING_STREAM_PERSISTENT); ++ } ++ *s = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_ob_deflatehandler(char *, uint, char **, uint *, int) */ ++void _http_ob_deflatehandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ int encoding; ++ ++ *handled_output = NULL; ++ *handled_output_len = 0; ++ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ int flags; ++ ++ if (HTTP_G->send.deflate.stream) { ++ zend_error(E_ERROR, "ob_deflatehandler() can only be used once"); ++ return; ++ } ++ ++ HTTP_G->send.deflate.response = 1; ++ encoding = http_encoding_response_start(0, 1); ++ HTTP_G->send.deflate.response = 0; ++ ++ switch (encoding) { ++ case HTTP_ENCODING_GZIP: ++ flags = HTTP_DEFLATE_TYPE_GZIP; ++ break; ++ ++ case HTTP_ENCODING_DEFLATE: ++ flags = HTTP_DEFLATE_TYPE_ZLIB; ++ break; ++ ++ default: ++ goto deflate_passthru_plain; ++ } ++ ++ flags |= (HTTP_G->send.deflate.start_flags &~ 0xf0); ++ HTTP_G->send.deflate.stream = http_encoding_deflate_stream_init(NULL, flags); ++ } ++ ++ if (HTTP_G->send.deflate.stream) { ++ if (output_len) { ++ size_t tmp_len; ++ ++ http_encoding_deflate_stream_update((http_encoding_stream *) HTTP_G->send.deflate.stream, output, output_len, handled_output, &tmp_len); ++ *handled_output_len = tmp_len; ++ } ++ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *remaining = NULL; ++ size_t remaining_len = 0; ++ ++ http_encoding_deflate_stream_finish((http_encoding_stream *) HTTP_G->send.deflate.stream, &remaining, &remaining_len); ++ http_encoding_deflate_stream_free((http_encoding_stream **) &HTTP_G->send.deflate.stream); ++ if (remaining) { ++ *handled_output = erealloc(*handled_output, *handled_output_len + remaining_len + 1); ++ memcpy(*handled_output + *handled_output_len, remaining, remaining_len); ++ (*handled_output)[*handled_output_len += remaining_len] = '\0'; ++ efree(remaining); ++ } ++ } ++ } else { ++deflate_passthru_plain: ++ *handled_output = estrndup(output, *handled_output_len = output_len); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_ob_inflatehandler(char *, uint, char **, uint *, int) */ ++void _http_ob_inflatehandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) ++{ ++ *handled_output = NULL; ++ *handled_output_len = 0; ++ ++ if (mode & PHP_OUTPUT_HANDLER_START) { ++ if (HTTP_G->send.inflate.stream) { ++ zend_error(E_ERROR, "ob_inflatehandler() can only be used once"); ++ return; ++ } ++ HTTP_G->send.inflate.stream = http_encoding_inflate_stream_init(NULL, (HTTP_G->send.inflate.start_flags &~ 0xf0)); ++ } ++ ++ if (HTTP_G->send.inflate.stream) { ++ if (output_len) { ++ size_t tmp_len; ++ ++ http_encoding_inflate_stream_update((http_encoding_stream *) HTTP_G->send.inflate.stream, output, output_len, handled_output, &tmp_len); ++ *handled_output_len = tmp_len; ++ } ++ ++ if (mode & PHP_OUTPUT_HANDLER_END) { ++ char *remaining = NULL; ++ size_t remaining_len = 0; ++ ++ http_encoding_inflate_stream_finish((http_encoding_stream *) HTTP_G->send.inflate.stream, &remaining, &remaining_len); ++ http_encoding_inflate_stream_free((http_encoding_stream **) &HTTP_G->send.inflate.stream); ++ if (remaining) { ++ *handled_output = erealloc(*handled_output, *handled_output_len + remaining_len + 1); ++ memcpy(*handled_output + *handled_output_len, remaining, remaining_len); ++ (*handled_output)[*handled_output_len += remaining_len] = '\0'; ++ efree(remaining); ++ } ++ } ++ } else { ++ *handled_output = estrndup(output, *handled_output_len = output_len); ++ } ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_exception_object.c +@@ -0,0 +1,186 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_exception_object.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#ifndef HTTP_DBG_EXCEPTIONS ++# define HTTP_DBG_EXCEPTIONS 0 ++#endif ++ ++#include "zend_interfaces.h" ++#include "zend_exceptions.h" ++#include "php_http_exception_object.h" ++ ++zend_class_entry *http_exception_object_ce; ++zend_class_entry *HTTP_EX_CE(runtime); ++zend_class_entry *HTTP_EX_CE(header); ++zend_class_entry *HTTP_EX_CE(malformed_headers); ++zend_class_entry *HTTP_EX_CE(request_method); ++zend_class_entry *HTTP_EX_CE(message_type); ++zend_class_entry *HTTP_EX_CE(invalid_param); ++zend_class_entry *HTTP_EX_CE(encoding); ++zend_class_entry *HTTP_EX_CE(request); ++zend_class_entry *HTTP_EX_CE(request_pool); ++zend_class_entry *HTTP_EX_CE(socket); ++zend_class_entry *HTTP_EX_CE(response); ++zend_class_entry *HTTP_EX_CE(url); ++zend_class_entry *HTTP_EX_CE(querystring); ++ ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpException, method, 0) ++#define HTTP_EXCEPTION_ME(method, visibility) PHP_ME(HttpException, method, HTTP_ARGS(HttpException, method), visibility) ++ ++HTTP_EMPTY_ARGS(__toString); ++ ++zend_function_entry http_exception_object_fe[] = { ++ HTTP_EXCEPTION_ME(__toString, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++#if HTTP_DBG_EXCEPTIONS ++static void http_exception_hook(zval *ex TSRMLS_DC) ++{ ++ if (ex) { ++ zval *m = zend_read_property(Z_OBJCE_P(ex), ex, "message", lenof("message"), 0 TSRMLS_CC); ++ fprintf(stderr, "*** Threw exception '%s'\n", Z_STRVAL_P(m)); ++ } else { ++ fprintf(stderr, "*** Threw NULL exception\n"); ++ } ++} ++#endif ++ ++PHP_MINIT_FUNCTION(http_exception_object) ++{ ++ HTTP_REGISTER_CLASS(HttpException, http_exception_object, ZEND_EXCEPTION_GET_DEFAULT(), 0); ++ ++ zend_declare_property_null(HTTP_EX_DEF_CE, "innerException", lenof("innerException"), ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ HTTP_REGISTER_EXCEPTION(HttpRuntimeException, HTTP_EX_CE(runtime), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpInvalidParamException, HTTP_EX_CE(invalid_param), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpHeaderException, HTTP_EX_CE(header), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpMalformedHeadersException, HTTP_EX_CE(malformed_headers), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpRequestMethodException, HTTP_EX_CE(request_method), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpMessageTypeException, HTTP_EX_CE(message_type), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpEncodingException, HTTP_EX_CE(encoding), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpRequestException, HTTP_EX_CE(request), HTTP_EX_DEF_CE); ++ ++ zend_declare_property_long(HTTP_EX_CE(request), "curlCode", lenof("curlCode"), 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ HTTP_REGISTER_EXCEPTION(HttpRequestPoolException, HTTP_EX_CE(request_pool), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpSocketException, HTTP_EX_CE(socket), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpResponseException, HTTP_EX_CE(response), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpUrlException, HTTP_EX_CE(url), HTTP_EX_DEF_CE); ++ HTTP_REGISTER_EXCEPTION(HttpQueryStringException, HTTP_EX_CE(querystring), HTTP_EX_DEF_CE); ++ ++ HTTP_LONG_CONSTANT("HTTP_E_RUNTIME", HTTP_E_RUNTIME); ++ HTTP_LONG_CONSTANT("HTTP_E_INVALID_PARAM", HTTP_E_INVALID_PARAM); ++ HTTP_LONG_CONSTANT("HTTP_E_HEADER", HTTP_E_HEADER); ++ HTTP_LONG_CONSTANT("HTTP_E_MALFORMED_HEADERS", HTTP_E_MALFORMED_HEADERS); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST_METHOD", HTTP_E_REQUEST_METHOD); ++ HTTP_LONG_CONSTANT("HTTP_E_MESSAGE_TYPE", HTTP_E_MESSAGE_TYPE); ++ HTTP_LONG_CONSTANT("HTTP_E_ENCODING", HTTP_E_ENCODING); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST", HTTP_E_REQUEST); ++ HTTP_LONG_CONSTANT("HTTP_E_REQUEST_POOL", HTTP_E_REQUEST_POOL); ++ HTTP_LONG_CONSTANT("HTTP_E_SOCKET", HTTP_E_SOCKET); ++ HTTP_LONG_CONSTANT("HTTP_E_RESPONSE", HTTP_E_RESPONSE); ++ HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL); ++ HTTP_LONG_CONSTANT("HTTP_E_QUERYSTRING", HTTP_E_QUERYSTRING); ++ ++#if HTTP_DBG_EXCEPTIONS ++ zend_throw_exception_hook=http_exception_hook; ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_class_entry *_http_exception_get_default() ++{ ++ return http_exception_object_ce; ++} ++ ++zend_class_entry *_http_exception_get_for_code(long code) ++{ ++ zend_class_entry *ex = http_exception_object_ce; ++ ++ switch (code) { ++ case HTTP_E_RUNTIME: ex = HTTP_EX_CE(runtime); break; ++ case HTTP_E_INVALID_PARAM: ex = HTTP_EX_CE(invalid_param); break; ++ case HTTP_E_HEADER: ex = HTTP_EX_CE(header); break; ++ case HTTP_E_MALFORMED_HEADERS: ex = HTTP_EX_CE(malformed_headers); break; ++ case HTTP_E_REQUEST_METHOD: ex = HTTP_EX_CE(request_method); break; ++ case HTTP_E_MESSAGE_TYPE: ex = HTTP_EX_CE(message_type); break; ++ case HTTP_E_ENCODING: ex = HTTP_EX_CE(encoding); break; ++ case HTTP_E_REQUEST: ex = HTTP_EX_CE(request); break; ++ case HTTP_E_REQUEST_POOL: ex = HTTP_EX_CE(request_pool); break; ++ case HTTP_E_SOCKET: ex = HTTP_EX_CE(socket); break; ++ case HTTP_E_RESPONSE: ex = HTTP_EX_CE(response); break; ++ case HTTP_E_URL: ex = HTTP_EX_CE(url); break; ++ case HTTP_E_QUERYSTRING: ex = HTTP_EX_CE(querystring); break; ++ } ++ ++ return ex; ++} ++ ++PHP_METHOD(HttpException, __toString) ++{ ++ phpstr full_str; ++ zend_class_entry *ce; ++ zval *zobj = getThis(), *retval = NULL, *m, *f, *l; ++ ++ phpstr_init(&full_str); ++ ++ do { ++ ce = Z_OBJCE_P(zobj); ++ ++ m = zend_read_property(ce, zobj, "message", lenof("message"), 0 TSRMLS_CC); ++ f = zend_read_property(ce, zobj, "file", lenof("file"), 0 TSRMLS_CC); ++ l = zend_read_property(ce, zobj, "line", lenof("line"), 0 TSRMLS_CC); ++ ++ if (m && f && l && Z_TYPE_P(m) == IS_STRING && Z_TYPE_P(f) == IS_STRING && Z_TYPE_P(l) == IS_LONG) { ++ if (zobj != getThis()) { ++ phpstr_appends(&full_str, " inner "); ++ } ++ ++ phpstr_appendf(&full_str, "exception '%.*s' with message '%.*s' in %.*s:%ld" PHP_EOL, ++ ce->name_length, ce->name, Z_STRLEN_P(m), Z_STRVAL_P(m), Z_STRLEN_P(f), Z_STRVAL_P(f), Z_LVAL_P(l) ++ ); ++ } else { ++ break; ++ } ++ ++ zobj = zend_read_property(ce, zobj, "innerException", lenof("innerException"), 0 TSRMLS_CC); ++ } while (Z_TYPE_P(zobj) == IS_OBJECT); ++ ++ if (zend_call_method_with_0_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "gettraceasstring", &retval) && Z_TYPE_P(retval) == IS_STRING) { ++ phpstr_appends(&full_str, "Stack trace:" PHP_EOL); ++ phpstr_append(&full_str, Z_STRVAL_P(retval), Z_STRLEN_P(retval)); ++ zval_ptr_dtor(&retval); ++ } ++ ++ RETURN_PHPSTR_VAL(&full_str); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_filter_api.c +@@ -0,0 +1,534 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_filter_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_streams.h" ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_filter_api.h" ++ ++PHP_MINIT_FUNCTION(http_filter) ++{ ++ php_stream_filter_register_factory("http.*", &http_filter_factory TSRMLS_CC); ++ return SUCCESS; ++} ++ ++/* ++ - ++*/ ++ ++#define HTTP_FILTER_PARAMS \ ++ php_stream *stream, \ ++ php_stream_filter *this, \ ++ php_stream_bucket_brigade *buckets_in, \ ++ php_stream_bucket_brigade *buckets_out, \ ++ size_t *bytes_consumed, int flags \ ++ TSRMLS_DC ++#define HTTP_FILTER_OP(filter) \ ++ http_filter_op_ ##filter ++#define HTTP_FILTER_OPS(filter) \ ++ php_stream_filter_ops HTTP_FILTER_OP(filter) ++#define HTTP_FILTER_DTOR(filter) \ ++ http_filter_ ##filter## _dtor ++#define HTTP_FILTER_DESTRUCTOR(filter) \ ++ void HTTP_FILTER_DTOR(filter)(php_stream_filter *this TSRMLS_DC) ++#define HTTP_FILTER_FUNC(filter) \ ++ http_filter_ ##filter ++#define HTTP_FILTER_FUNCTION(filter) \ ++ php_stream_filter_status_t HTTP_FILTER_FUNC(filter)(HTTP_FILTER_PARAMS) ++#define HTTP_FILTER_BUFFER(filter) \ ++ http_filter_ ##filter## _buffer ++ ++#define NEW_BUCKET(data, length) \ ++ { \ ++ char *__data; \ ++ php_stream_bucket *__buck; \ ++ \ ++ __data = pemalloc(length, this->is_persistent); \ ++ if (!__data) { \ ++ return PSFS_ERR_FATAL; \ ++ } \ ++ memcpy(__data, data, length); \ ++ \ ++ __buck = php_stream_bucket_new(stream, __data, length, 1, this->is_persistent TSRMLS_CC); \ ++ if (!__buck) { \ ++ pefree(__data, this->is_persistent); \ ++ return PSFS_ERR_FATAL; \ ++ } \ ++ \ ++ php_stream_bucket_append(buckets_out, __buck TSRMLS_CC); \ ++ } ++ ++typedef struct _http_chunked_decode_filter_buffer_t { ++ phpstr buffer; ++ ulong hexlen; ++} HTTP_FILTER_BUFFER(chunked_decode); ++ ++#ifdef HTTP_HAVE_ZLIB ++typedef http_encoding_stream HTTP_FILTER_BUFFER(deflate); ++typedef http_encoding_stream HTTP_FILTER_BUFFER(inflate); ++#endif /* HTTP_HAVE_ZLIB */ ++ ++ ++static HTTP_FILTER_FUNCTION(chunked_decode) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(chunked_decode) *buffer = (HTTP_FILTER_BUFFER(chunked_decode) *) (this->abstract); ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (PHPSTR_NOMEM == phpstr_append(PHPSTR(buffer), ptr->buf, ptr->buflen)) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ if (!phpstr_fix(PHPSTR(buffer))) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ /* we have data in our buffer */ ++ while (PHPSTR_LEN(buffer)) { ++ ++ /* we already know the size of the chunk and are waiting for data */ ++ if (buffer->hexlen) { ++ ++ /* not enough data buffered */ ++ if (PHPSTR_LEN(buffer) < buffer->hexlen) { ++ ++ /* flush anyway? */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ ++ /* flush all data (should only be chunk data) */ ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), PHPSTR_LEN(buffer)); ++ ++ /* waiting for less data now */ ++ buffer->hexlen -= PHPSTR_LEN(buffer); ++ /* no more buffered data */ ++ phpstr_reset(PHPSTR(buffer)); ++ /* break */ ++ } ++ ++ /* we have too less data and don't need to flush */ ++ else { ++ break; ++ } ++ } ++ ++ /* we seem to have all data of the chunk */ ++ else { ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), buffer->hexlen); ++ ++ /* remove outgoing data from the buffer */ ++ phpstr_cut(PHPSTR(buffer), 0, buffer->hexlen); ++ /* reset hexlen */ ++ buffer->hexlen = 0; ++ /* continue */ ++ } ++ } ++ ++ /* we don't know the length of the chunk yet */ ++ else { ++ size_t off = 0; ++ ++ /* ignore preceeding CRLFs (too loose?) */ ++ while (off < PHPSTR_LEN(buffer) && ( ++ PHPSTR_VAL(buffer)[off] == '\n' || ++ PHPSTR_VAL(buffer)[off] == '\r')) { ++ ++off; ++ } ++ if (off) { ++ phpstr_cut(PHPSTR(buffer), 0, off); ++ } ++ ++ /* still data there? */ ++ if (PHPSTR_LEN(buffer)) { ++ int eollen; ++ const char *eolstr; ++ ++ /* we need eol, so we can be sure we have all hex digits */ ++ phpstr_fix(PHPSTR(buffer)); ++ if ((eolstr = http_locate_eol(PHPSTR_VAL(buffer), &eollen))) { ++ char *stop = NULL; ++ ++ /* read in chunk size */ ++ buffer->hexlen = strtoul(PHPSTR_VAL(buffer), &stop, 16); ++ ++ /* if strtoul() stops at the beginning of the buffered data ++ there's domething oddly wrong, i.e. bad input */ ++ if (stop == PHPSTR_VAL(buffer)) { ++ return PSFS_ERR_FATAL; ++ } ++ ++ /* cut out */ ++ phpstr_cut(PHPSTR(buffer), 0, eolstr + eollen - PHPSTR_VAL(buffer)); ++ /* buffer->hexlen is 0 now or contains the size of the next chunk */ ++ /* continue */ ++ } else { ++ /* we have not enough data buffered to read in chunk size */ ++ break; ++ } ++ } ++ /* break */ ++ } ++ } ++ ++ /* flush before close, but only if we are already waiting for more data */ ++ if ((flags & PSFS_FLAG_FLUSH_CLOSE) && buffer->hexlen && PHPSTR_LEN(buffer)) { ++ out_avail = 1; ++ NEW_BUCKET(PHPSTR_VAL(buffer), PHPSTR_LEN(buffer)); ++ phpstr_reset(PHPSTR(buffer)); ++ buffer->hexlen = 0; ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_DESTRUCTOR(chunked_decode) ++{ ++ HTTP_FILTER_BUFFER(chunked_decode) *b = (HTTP_FILTER_BUFFER(chunked_decode) *) (this->abstract); ++ ++ phpstr_dtor(PHPSTR(b)); ++ pefree(b, this->is_persistent); ++} ++ ++static HTTP_FILTER_FUNCTION(chunked_encode) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ phpstr buf; ++ out_avail = 1; ++ ++ phpstr_init(&buf); ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ phpstr_appendf(&buf, "%x" HTTP_CRLF, ptr->buflen); ++ phpstr_append(&buf, ptr->buf, ptr->buflen); ++ phpstr_appends(&buf, HTTP_CRLF); ++ ++ /* pass through */ ++ NEW_BUCKET(PHPSTR_VAL(&buf), PHPSTR_LEN(&buf)); ++ /* reset */ ++ phpstr_reset(&buf); ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ ++ /* free buffer */ ++ phpstr_dtor(&buf); ++ } ++ ++ /* terminate with "0" */ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ out_avail = 1; ++ NEW_BUCKET("0" HTTP_CRLF, lenof("0" HTTP_CRLF)); ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_OPS(chunked_decode) = { ++ HTTP_FILTER_FUNC(chunked_decode), ++ HTTP_FILTER_DTOR(chunked_decode), ++ "http.chunked_decode" ++}; ++ ++static HTTP_FILTER_OPS(chunked_encode) = { ++ HTTP_FILTER_FUNC(chunked_encode), ++ NULL, ++ "http.chunked_encode" ++}; ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++static HTTP_FILTER_FUNCTION(deflate) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(deflate) *) this->abstract; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (ptr->buflen) { ++ http_encoding_deflate_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ ++ /* flush & close */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ http_encoding_deflate_stream_flush(buffer, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ ++ http_encoding_deflate_stream_finish(buffer, &encoded, &encoded_len); ++ if (encoded) { ++ if (encoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(encoded, encoded_len); ++ } ++ efree(encoded); ++ } ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_FUNCTION(inflate) ++{ ++ int out_avail = 0; ++ php_stream_bucket *ptr, *nxt; ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(inflate) *) this->abstract; ++ ++ if (bytes_consumed) { ++ *bytes_consumed = 0; ++ } ++ ++ /* new data available? */ ++ if (buckets_in->head) { ++ ++ /* fetch available bucket data */ ++ for (ptr = buckets_in->head; ptr; ptr = nxt) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ nxt = ptr->next; ++ if (bytes_consumed) { ++ *bytes_consumed += ptr->buflen; ++ } ++ ++ if (ptr->buflen) { ++ http_encoding_inflate_stream_update(buffer, ptr->buf, ptr->buflen, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ php_stream_bucket_unlink(ptr TSRMLS_CC); ++ php_stream_bucket_delref(ptr TSRMLS_CC); ++ } ++ } ++ ++ /* flush & close */ ++ if (flags & PSFS_FLAG_FLUSH_INC) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ http_encoding_inflate_stream_flush(buffer, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ if (flags & PSFS_FLAG_FLUSH_CLOSE) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ http_encoding_inflate_stream_finish(buffer, &decoded, &decoded_len); ++ if (decoded) { ++ if (decoded_len) { ++ out_avail = 1; ++ NEW_BUCKET(decoded, decoded_len); ++ } ++ efree(decoded); ++ } ++ } ++ ++ return out_avail ? PSFS_PASS_ON : PSFS_FEED_ME; ++} ++ ++static HTTP_FILTER_DESTRUCTOR(deflate) ++{ ++ HTTP_FILTER_BUFFER(deflate) *buffer = (HTTP_FILTER_BUFFER(deflate) *) this->abstract; ++ http_encoding_deflate_stream_free(&buffer); ++} ++ ++static HTTP_FILTER_DESTRUCTOR(inflate) ++{ ++ HTTP_FILTER_BUFFER(inflate) *buffer = (HTTP_FILTER_BUFFER(inflate) *) this->abstract; ++ http_encoding_inflate_stream_free(&buffer); ++} ++ ++static HTTP_FILTER_OPS(deflate) = { ++ HTTP_FILTER_FUNC(deflate), ++ HTTP_FILTER_DTOR(deflate), ++ "http.deflate" ++}; ++ ++static HTTP_FILTER_OPS(inflate) = { ++ HTTP_FILTER_FUNC(inflate), ++ HTTP_FILTER_DTOR(inflate), ++ "http.inflate" ++}; ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++static php_stream_filter *http_filter_create(const char *name, zval *params, int p TSRMLS_DC) ++{ ++ zval **tmp = ¶ms; ++ php_stream_filter *f = NULL; ++ ++ if (!strcasecmp(name, "http.chunked_decode")) { ++ HTTP_FILTER_BUFFER(chunked_decode) *b = NULL; ++ ++ if ((b = pecalloc(1, sizeof(HTTP_FILTER_BUFFER(chunked_decode)), p))) { ++ phpstr_init_ex(PHPSTR(b), 4096, p ? PHPSTR_INIT_PERSISTENT : 0); ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(chunked_decode), b, p))) { ++ pefree(b, p); ++ } ++ } ++ } else ++ ++ if (!strcasecmp(name, "http.chunked_encode")) { ++ f = php_stream_filter_alloc(&HTTP_FILTER_OP(chunked_encode), NULL, p); ++#ifdef HTTP_HAVE_ZLIB ++ } else ++ ++ if (!strcasecmp(name, "http.inflate")) { ++ int flags = p ? HTTP_ENCODING_STREAM_PERSISTENT : 0; ++ HTTP_FILTER_BUFFER(inflate) *b = NULL; ++ ++ if ((b = http_encoding_inflate_stream_init(NULL, flags))) { ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(inflate), b, p))) { ++ http_encoding_inflate_stream_free(&b); ++ } ++ } ++ } else ++ ++ if (!strcasecmp(name, "http.deflate")) { ++ int flags = p ? HTTP_ENCODING_STREAM_PERSISTENT : 0; ++ HTTP_FILTER_BUFFER(deflate) *b = NULL; ++ ++ if (params) { ++ switch (Z_TYPE_P(params)) { ++ case IS_ARRAY: ++ case IS_OBJECT: ++ if (SUCCESS != zend_hash_find(HASH_OF(params), "flags", sizeof("flags"), (void *) &tmp)) { ++ break; ++ } ++ default: ++ { ++ zval *num = http_zsep(IS_LONG, *tmp); ++ ++ flags |= (Z_LVAL_P(num) & 0x0fffffff); ++ zval_ptr_dtor(&num); ++ } ++ } ++ } ++ if ((b = http_encoding_deflate_stream_init(NULL, flags))) { ++ if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(deflate), b, p))) { ++ http_encoding_deflate_stream_free(&b); ++ } ++ } ++#endif /* HTTP_HAVE_ZLIB */ ++ } ++ ++ return f; ++} ++ ++php_stream_filter_factory http_filter_factory = { ++ http_filter_create ++}; ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_functions.c +@@ -0,0 +1,1424 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_functions.c 300301 2010-06-09 08:30:34Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_ini.h" ++#include "ext/standard/php_string.h" ++#include "zend_operators.h" ++ ++#ifdef HTTP_HAVE_SESSION ++# include "ext/session/php_session.h" ++#endif ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_date_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_message_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_method_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++/* {{{ proto string http_date([int timestamp]) ++ Compose a valid HTTP date regarding RFC 1123 looking like: "Wed, 22 Dec 2004 11:34:47 GMT" */ ++PHP_FUNCTION(http_date) ++{ ++ long t = -1; ++ char *date; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &t) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ if (!(date = http_date(t))) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Could not compose date of timestamp %ld", t); ++ RETURN_FALSE; ++ } ++ ++ RETURN_STRING(date, 0); ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_url([mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE|HTTP_URL_FROM_ENV[, array &new_url]]]]) ++ Build an URL. */ ++PHP_FUNCTION(http_build_url) ++{ ++ char *url_str = NULL; ++ size_t url_len = 0; ++ long flags = HTTP_URL_REPLACE|HTTP_URL_FROM_ENV; ++ zval *z_old_url = NULL, *z_new_url = NULL, *z_composed_url = NULL; ++ php_url *old_url = NULL, *new_url = NULL, *composed_url = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/z!/lz", &z_old_url, &z_new_url, &flags, &z_composed_url) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (z_new_url) { ++ if (Z_TYPE_P(z_new_url) == IS_ARRAY || Z_TYPE_P(z_new_url) == IS_OBJECT) { ++ new_url = http_url_from_struct(NULL, HASH_OF(z_new_url)); ++ } else { ++ convert_to_string(z_new_url); ++ if (!(new_url = php_url_parse_ex(Z_STRVAL_P(z_new_url), Z_STRLEN_P(z_new_url)))) { ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_new_url)); ++ RETURN_FALSE; ++ } ++ } ++ } ++ ++ if (z_old_url) { ++ if (Z_TYPE_P(z_old_url) == IS_ARRAY || Z_TYPE_P(z_old_url) == IS_OBJECT) { ++ old_url = http_url_from_struct(NULL, HASH_OF(z_old_url)); ++ } else { ++ convert_to_string(z_old_url); ++ if (!(old_url = php_url_parse_ex(Z_STRVAL_P(z_old_url), Z_STRLEN_P(z_old_url)))) { ++ if (new_url) { ++ php_url_free(new_url); ++ } ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_old_url)); ++ RETURN_FALSE; ++ } ++ } ++ } ++ ++ if (z_composed_url) { ++ http_build_url(flags, old_url, new_url, &composed_url, &url_str, &url_len); ++ http_url_tostruct(composed_url, z_composed_url); ++ php_url_free(composed_url); ++ } else { ++ http_build_url(flags, old_url, new_url, NULL, &url_str, &url_len); ++ } ++ ++ if (new_url) { ++ php_url_free(new_url); ++ } ++ if (old_url) { ++ php_url_free(old_url); ++ } ++ ++ RETURN_STRINGL(url_str, url_len, 0); ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_str(array query [, string prefix[, string arg_separator]]) ++ Opponent to parse_str(). */ ++PHP_FUNCTION(http_build_str) ++{ ++ zval *formdata; ++ char *prefix = NULL, *arg_sep = INI_STR("arg_separator.output"); ++ int prefix_len = 0, arg_sep_len = strlen(arg_sep); ++ phpstr formstr; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (!arg_sep_len) { ++ arg_sep = HTTP_URL_ARGSEP; ++ arg_sep_len = lenof(HTTP_URL_ARGSEP); ++ } ++ ++ phpstr_init(&formstr); ++ if (SUCCESS != http_urlencode_hash_recursive(HASH_OF(formdata), &formstr, arg_sep, arg_sep_len, prefix, prefix_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!formstr.used) { ++ phpstr_dtor(&formstr); ++ RETURN_NULL(); ++ } ++ ++ RETURN_PHPSTR_VAL(&formstr); ++} ++/* }}} */ ++ ++#define HTTP_DO_NEGOTIATE_DEFAULT(supported) \ ++ { \ ++ zval **value; \ ++ \ ++ zend_hash_internal_pointer_reset(Z_ARRVAL_P(supported)); \ ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(supported), (void *) &value)) { \ ++ RETVAL_ZVAL(*value, 1, 0); \ ++ } else { \ ++ RETVAL_NULL(); \ ++ } \ ++ } ++ ++#define HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array) \ ++ HTTP_DO_NEGOTIATE_DEFAULT(supported); \ ++ if (rs_array) { \ ++ HashPosition pos; \ ++ zval **value_ptr; \ ++ \ ++ FOREACH_VAL(pos, supported, value_ptr) { \ ++ zval *value = http_zsep(IS_STRING, *value_ptr); \ ++ add_assoc_double(rs_array, Z_STRVAL_P(value), 1.0); \ ++ zval_ptr_dtor(&value); \ ++ } \ ++ } ++ ++#define HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array) \ ++ { \ ++ char *key; \ ++ uint key_len; \ ++ ulong idx; \ ++ \ ++ if (zend_hash_num_elements(result) && HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(result, &key, &key_len, &idx, 1, NULL)) { \ ++ RETVAL_STRINGL(key, key_len-1, 0); \ ++ } else { \ ++ HTTP_DO_NEGOTIATE_DEFAULT(supported); \ ++ } \ ++ \ ++ if (rs_array) { \ ++ zend_hash_copy(Z_ARRVAL_P(rs_array), result, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); \ ++ } \ ++ \ ++ zend_hash_destroy(result); \ ++ FREE_HASHTABLE(result); \ ++ } ++ ++#define HTTP_DO_NEGOTIATE(type, supported, rs_array) \ ++ { \ ++ HashTable *result; \ ++ if ((result = http_negotiate_ ##type(supported))) { \ ++ HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array); \ ++ } else { \ ++ HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array); \ ++ } \ ++ } ++ ++/* {{{ proto string http_negotiate_language(array supported[, array &result]) ++ Negotiate the clients preferred language. */ ++PHP_FUNCTION(http_negotiate_language) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(language, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate_charset(array supported[, array &result]) ++ Negotiate the clients preferred charset. */ ++PHP_FUNCTION(http_negotiate_charset) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(charset, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate_content_type(array supported[, array &result]) ++ Negotiate the clients preferred content type. */ ++PHP_FUNCTION(http_negotiate_content_type) ++{ ++ zval *supported, *rs_array = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z", &supported, &rs_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ HTTP_DO_NEGOTIATE(content_type, supported, rs_array); ++} ++/* }}} */ ++ ++/* {{{ proto string http_negotiate(mixed value, array supported[, array &result]) ++ Negotiate the user supplied value. */ ++PHP_FUNCTION(http_negotiate) ++{ ++ zval *value, *supported, *rs_array = NULL; ++ HashTable *rs; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|z", &value, &supported, &rs_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (rs_array) { ++ zval_dtor(rs_array); ++ array_init(rs_array); ++ } ++ ++ if ((rs = http_negotiate_z(value, Z_ARRVAL_P(supported), http_negotiate_default_func))) { ++ HTTP_DO_NEGOTIATE_HANDLE_RESULT(rs, supported, rs_array); ++ } else { ++ HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_status(int status) ++ Send HTTP status code. */ ++PHP_FUNCTION(http_send_status) ++{ ++ long status = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ if (status < 100 || status > 510) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Invalid HTTP status code (100-510): %d", status); ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_status(status)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_last_modified([int timestamp]) ++ Send a "Last-Modified" header with a valid HTTP date. */ ++PHP_FUNCTION(http_send_last_modified) ++{ ++ long t = -1; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &t) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ RETURN_SUCCESS(http_send_last_modified(t)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_content_type([string content_type = 'application/x-octetstream']) ++ Send the Content-Type of the sent entity. This is particularly important if you use the http_send() API. */ ++PHP_FUNCTION(http_send_content_type) ++{ ++ char *ct = "application/x-octetstream"; ++ int ct_len = lenof("application/x-octetstream"); ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ct, &ct_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_content_type(ct, ct_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_content_disposition(string filename[, bool inline = false]) ++ Send the Content-Disposition. */ ++PHP_FUNCTION(http_send_content_disposition) ++{ ++ char *filename; ++ int f_len; ++ zend_bool send_inline = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &f_len, &send_inline) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(http_send_content_disposition(filename, f_len, send_inline)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_modified([int timestamp[, bool for_range = false]]) ++ Matches the given unix timestamp against the clients "If-Modified-Since" resp. "If-Unmodified-Since" HTTP headers. */ ++PHP_FUNCTION(http_match_modified) ++{ ++ long t = -1; ++ zend_bool for_range = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", &t, &for_range) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ // current time if not supplied (senseless though) ++ if (t == -1) { ++ t = HTTP_G->request.time; ++ } ++ ++ if (for_range) { ++ RETURN_BOOL(http_match_last_modified("HTTP_IF_UNMODIFIED_SINCE", t)); ++ } ++ RETURN_BOOL(http_match_last_modified("HTTP_IF_MODIFIED_SINCE", t)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_etag(string etag[, bool for_range = false]) ++ Matches the given ETag against the clients "If-Match" resp. "If-None-Match" HTTP headers. */ ++PHP_FUNCTION(http_match_etag) ++{ ++ int etag_len; ++ char *etag; ++ zend_bool for_range = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &etag, &etag_len, &for_range) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (for_range) { ++ RETURN_BOOL(http_match_etag("HTTP_IF_MATCH", etag)); ++ } ++ RETURN_BOOL(http_match_etag("HTTP_IF_NONE_MATCH", etag)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_cache_last_modified([int timestamp_or_expires]]) ++ Attempts to cache the sent entity by its last modification date. */ ++PHP_FUNCTION(http_cache_last_modified) ++{ ++ long last_modified = 0, send_modified = 0, t; ++ zval *zlm; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &last_modified) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ t = HTTP_G->request.time; ++ ++ /* 0 or omitted */ ++ if (!last_modified) { ++ /* does the client have? (att: caching "forever") */ ++ if ((zlm = http_get_server_var("HTTP_IF_MODIFIED_SINCE", 1))) { ++ last_modified = send_modified = http_parse_date(Z_STRVAL_P(zlm)); ++ /* send current time */ ++ } else { ++ send_modified = t; ++ } ++ /* negative value is supposed to be expiration time */ ++ } else if (last_modified < 0) { ++ last_modified += t; ++ send_modified = t; ++ /* send supplied time explicitly */ ++ } else { ++ send_modified = last_modified; ++ } ++ ++ RETURN_SUCCESS(http_cache_last_modified(last_modified, send_modified, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_cache_etag([string etag]) ++ Attempts to cache the sent entity by its ETag, either supplied or generated by the hash algorithm specified by the INI setting "http.etag.mode". */ ++PHP_FUNCTION(http_cache_etag) ++{ ++ char *etag = NULL; ++ int etag_len = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &etag, &etag_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ RETURN_SUCCESS(http_cache_etag(etag, etag_len, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); ++} ++/* }}} */ ++ ++/* {{{ proto string ob_etaghandler(string data, int mode) ++ For use with ob_start(). Output buffer handler generating an ETag with the hash algorithm specified with the INI setting "http.etag.mode". */ ++PHP_FUNCTION(ob_etaghandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ Z_TYPE_P(return_value) = IS_STRING; ++ http_ob_etaghandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++} ++/* }}} */ ++ ++/* {{{ proto void http_throttle(double sec[, int bytes = 40960]) ++ Sets the throttle delay and send buffer size for use with http_send() API. */ ++PHP_FUNCTION(http_throttle) ++{ ++ long chunk_size = HTTP_SENDBUF_SIZE; ++ double interval; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &interval, &chunk_size)) { ++ return; ++ } ++ ++ HTTP_G->send.throttle_delay = interval; ++ HTTP_G->send.buffer_size = chunk_size; ++} ++/* }}} */ ++ ++/* {{{ proto void http_redirect([string url[, array params[, bool session = false[, int status = 302]]]]) ++ Redirect to the given url. */ ++PHP_FUNCTION(http_redirect) ++{ ++ int url_len = 0; ++ size_t query_len = 0; ++ zend_bool session = 0, free_params = 0; ++ zval *params = NULL; ++ long status = HTTP_REDIRECT; ++ char *query = NULL, *url = NULL, *URI, *LOC, *RED = NULL; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sa!/bl", &url, &url_len, ¶ms, &session, &status) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++#ifdef HTTP_HAVE_SESSION ++ /* append session info */ ++ if (session) { ++ if (!params) { ++ free_params = 1; ++ MAKE_STD_ZVAL(params); ++ array_init(params); ++ } ++ if (PS(session_status) == php_session_active) { ++ if (add_assoc_string(params, PS(session_name), PS(id), 1) != SUCCESS) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not append session information"); ++ } ++ } ++ } ++#endif ++ ++ /* treat params array with http_build_query() */ ++ if (params) { ++ if (SUCCESS != http_urlencode_hash_ex(Z_ARRVAL_P(params), 0, NULL, 0, &query, &query_len)) { ++ if (free_params) { ++ zval_dtor(params); ++ FREE_ZVAL(params); ++ } ++ if (query) { ++ efree(query); ++ } ++ RETURN_FALSE; ++ } ++ } ++ ++ URI = http_absolute_url_ex(url, HTTP_URL_FROM_ENV); ++ ++ if (query_len) { ++ spprintf(&LOC, 0, "Location: %s?%s", URI, query); ++ if (status != 300) { ++ spprintf(&RED, 0, "Redirecting to %s?%s.\n", URI, query, URI, query); ++ } ++ } else { ++ spprintf(&LOC, 0, "Location: %s", URI); ++ if (status != 300) { ++ spprintf(&RED, 0, "Redirecting to %s.\n", URI, URI); ++ } ++ } ++ ++ efree(URI); ++ if (query) { ++ efree(query); ++ } ++ if (free_params) { ++ zval_dtor(params); ++ FREE_ZVAL(params); ++ } ++ ++ switch (status) { ++ case 300: ++ RETVAL_SUCCESS(http_send_status_header(status, LOC)); ++ efree(LOC); ++ return; ++ ++ case HTTP_REDIRECT_PERM: ++ case HTTP_REDIRECT_FOUND: ++ case HTTP_REDIRECT_POST: ++ case HTTP_REDIRECT_PROXY: ++ case HTTP_REDIRECT_TEMP: ++ break; ++ ++ case 306: ++ default: ++ http_error_ex(HE_NOTICE, HTTP_E_RUNTIME, "Unsupported redirection status code: %ld", status); ++ case HTTP_REDIRECT: ++ if ( SG(request_info).request_method && ++ strcasecmp(SG(request_info).request_method, "HEAD") && ++ strcasecmp(SG(request_info).request_method, "GET")) { ++ status = HTTP_REDIRECT_POST; ++ } else { ++ status = HTTP_REDIRECT_FOUND; ++ } ++ break; ++ } ++ ++ RETURN_SUCCESS(http_exit_ex(status, LOC, RED, 1)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_data(string data) ++ Sends raw data with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_data) ++{ ++ int data_len; ++ char *data_buf; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data_buf, &data_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_data(data_buf, data_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_file(string file) ++ Sends a file with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_file) ++{ ++ char *file; ++ int flen = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &flen) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ if (!flen) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_send_file(file)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_send_stream(resource stream) ++ Sends an already opened stream with support for (multiple) range requests. */ ++PHP_FUNCTION(http_send_stream) ++{ ++ zval *zstream; ++ php_stream *file; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(file, &zstream); ++ RETURN_SUCCESS(http_send_stream(file)); ++} ++/* }}} */ ++ ++/* {{{ proto string http_chunked_decode(string encoded) ++ Decodes a string that was HTTP-chunked encoded. */ ++PHP_FUNCTION(http_chunked_decode) ++{ ++ char *encoded = NULL, *decoded = NULL; ++ size_t decoded_len = 0; ++ int encoded_len = 0; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoded, &encoded_len) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (NULL != http_encoding_dechunk(encoded, encoded_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, (int) decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto object http_parse_message(string message) ++ Parses (a) http_message(s) into a simple recursive object structure. */ ++PHP_FUNCTION(http_parse_message) ++{ ++ char *message; ++ int message_len; ++ http_message *msg = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &message, &message_len)) { ++ RETURN_NULL(); ++ } ++ ++ if ((msg = http_message_parse(message, message_len))) { ++ object_init(return_value); ++ http_message_tostruct_recursive(msg, return_value); ++ http_message_free(&msg); ++ } else { ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array http_parse_headers(string header) ++ Parses HTTP headers into an associative array. */ ++PHP_FUNCTION(http_parse_headers) ++{ ++ char *header; ++ int header_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &header, &header_len)) { ++ RETURN_FALSE; ++ } ++ ++ array_init(return_value); ++ if (SUCCESS != http_parse_headers(header, return_value)) { ++ zval_dtor(return_value); ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Failed to parse headers"); ++ RETURN_FALSE; ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto object http_parse_cookie(string cookie[, int flags[, array allowed_extras]]) ++ Parses HTTP cookies like sent in a response into a struct. */ ++PHP_FUNCTION(http_parse_cookie) ++{ ++ char *cookie, **allowed_extras = NULL; ++ int i = 0, cookie_len; ++ long flags = 0; ++ zval *allowed_extras_array = NULL, **entry = NULL; ++ HashPosition pos; ++ http_cookie_list list; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la!", &cookie, &cookie_len, &flags, &allowed_extras_array)) { ++ RETURN_FALSE; ++ } ++ ++ if (allowed_extras_array) { ++ allowed_extras = ecalloc(zend_hash_num_elements(Z_ARRVAL_P(allowed_extras_array)) + 1, sizeof(char *)); ++ FOREACH_VAL(pos, allowed_extras_array, entry) { ++ zval *data = http_zsep(IS_STRING, *entry); ++ allowed_extras[i++] = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); ++ zval_ptr_dtor(&data); ++ } ++ } ++ ++ if (http_parse_cookie_ex(&list, cookie, flags, allowed_extras)) { ++ object_init(return_value); ++ http_cookie_list_tostruct(&list, return_value); ++ http_cookie_list_dtor(&list); ++ } else { ++ RETVAL_FALSE; ++ } ++ ++ if (allowed_extras) { ++ for (i = 0; allowed_extras[i]; ++i) { ++ efree(allowed_extras[i]); ++ } ++ efree(allowed_extras); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_build_cookie(array cookie) ++ Build a cookie string from an array/object like returned by http_parse_cookie(). */ ++PHP_FUNCTION(http_build_cookie) ++{ ++ char *str = NULL; ++ size_t len = 0; ++ zval *strct; ++ http_cookie_list list; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &strct)) { ++ RETURN_FALSE; ++ } ++ ++ http_cookie_list_fromstruct(&list, strct); ++ http_cookie_list_tostring(&list, &str, &len); ++ http_cookie_list_dtor(&list); ++ ++ RETURN_STRINGL(str, len, 0); ++} ++/* }}} */ ++ ++/* {{{ proto object http_parse_params(string param[, int flags = HTTP_PARAMS_DEFAULT]) ++ Parse parameter list. */ ++PHP_FUNCTION(http_parse_params) ++{ ++ char *param; ++ int param_len; ++ zval *params; ++ long flags = HTTP_PARAMS_DEFAULT; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", ¶m, ¶m_len, &flags)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(params); ++ array_init(params); ++ if (SUCCESS != http_parse_params(param, flags, Z_ARRVAL_P(params))) { ++ zval_ptr_dtor(¶ms); ++ RETURN_FALSE; ++ } ++ ++ object_init(return_value); ++ add_property_zval(return_value, "params", params); ++#ifdef ZEND_ENGINE_2 ++ zval_ptr_dtor(¶ms); ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto array http_get_request_headers(void) ++ Get a list of incoming HTTP headers. */ ++PHP_FUNCTION(http_get_request_headers) ++{ ++ NO_ARGS; ++ ++ array_init(return_value); ++ http_get_request_headers(Z_ARRVAL_P(return_value)); ++} ++/* }}} */ ++ ++/* {{{ proto string http_get_request_body(void) ++ Get the raw request body (e.g. POST or PUT data). */ ++PHP_FUNCTION(http_get_request_body) ++{ ++ char *body; ++ size_t length; ++ ++ NO_ARGS; ++ ++ if (SUCCESS == http_get_request_body(&body, &length)) { ++ RETURN_STRINGL(body, (int) length, 0); ++ } else { ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto resource http_get_request_body_stream(void) ++ Create a stream to read the raw request body (e.g. POST or PUT data). This function can only be used once if the request method was another than POST. */ ++PHP_FUNCTION(http_get_request_body_stream) ++{ ++ php_stream *s; ++ ++ NO_ARGS; ++ ++ if ((s = http_get_request_body_stream())) { ++ php_stream_to_zval(s, return_value); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Failed to create request body stream"); ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool http_match_request_header(string header, string value[, bool match_case = false]) ++ Match an incoming HTTP header. */ ++PHP_FUNCTION(http_match_request_header) ++{ ++ char *header, *value; ++ int header_len, value_len; ++ zend_bool match_case = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &header, &header_len, &value, &value_len, &match_case)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_BOOL(http_match_request_header_ex(header, value, match_case)); ++} ++/* }}} */ ++ ++/* {{{ proto object http_persistent_handles_count() */ ++PHP_FUNCTION(http_persistent_handles_count) ++{ ++ NO_ARGS; ++ object_init(return_value); ++ if (!http_persistent_handle_statall_ex(HASH_OF(return_value))) { ++ zval_dtor(return_value); ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void http_persistent_handles_clean([string name]) */ ++PHP_FUNCTION(http_persistent_handles_clean) ++{ ++ char *name_str = NULL; ++ int name_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name_str, &name_len)) { ++ http_persistent_handle_cleanup_ex(name_str, name_len, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_persistent_handles_ident([string ident]) */ ++PHP_FUNCTION(http_persistent_handles_ident) ++{ ++ char *ident_str = NULL; ++ int ident_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ident_str, &ident_len)) { ++ RETVAL_STRING(zend_ini_string(ZEND_STRS("http.persistent.handles.ident"), 0), 1); ++ if (ident_str && ident_len) { ++ zend_alter_ini_entry(ZEND_STRS("http.persistent.handles.ident"), ident_str, ident_len, ZEND_INI_USER, PHP_INI_STAGE_RUNTIME); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ HAVE_CURL */ ++#ifdef HTTP_HAVE_CURL ++ ++#define RETVAL_RESPONSE_OR_BODY(request) \ ++ { \ ++ zval **bodyonly; \ ++ \ ++ /* check if only the body should be returned */ \ ++ if (options && (SUCCESS == zend_hash_find(Z_ARRVAL_P(options), "bodyonly", sizeof("bodyonly"), (void *) &bodyonly)) && i_zend_is_true(*bodyonly)) { \ ++ http_message *msg = http_message_parse(PHPSTR_VAL(&request.conv.response), PHPSTR_LEN(&request.conv.response)); \ ++ \ ++ if (msg) { \ ++ RETVAL_STRINGL(PHPSTR_VAL(&msg->body), PHPSTR_LEN(&msg->body), 1); \ ++ http_message_free(&msg); \ ++ } \ ++ } else { \ ++ RETVAL_STRINGL(request.conv.response.data, request.conv.response.used, 1); \ ++ } \ ++ } ++ ++/* {{{ proto string http_get(string url[, array options[, array &info]]) ++ Performs an HTTP GET request on the supplied url. */ ++PHP_FUNCTION(http_get) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a/!z", &URL, &URL_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_GET, URL); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_head(string url[, array options[, array &info]]) ++ Performs an HTTP HEAD request on the supplied url. */ ++PHP_FUNCTION(http_head) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a/!z", &URL, &URL_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_HEAD, URL); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_post_data(string url, string data[, array options[, array &info]]) ++ Performs an HTTP POST request on the supplied url. */ ++PHP_FUNCTION(http_post_data) ++{ ++ zval *options = NULL, *info = NULL; ++ char *URL, *postdata; ++ int postdata_len, URL_len; ++ http_request_body body; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &postdata, &postdata_len, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_POST, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, postdata, postdata_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_post_fields(string url, array data[, array files[, array options[, array &info]]]) ++ Performs an HTTP POST request on the supplied url. */ ++PHP_FUNCTION(http_post_fields) ++{ ++ zval *options = NULL, *info = NULL, *fields = NULL, *files = NULL; ++ char *URL; ++ int URL_len; ++ http_request_body body; ++ http_request request; ++ ++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa!|a!a/!z", &URL, &URL_len, &fields, &files, &options, &info) != SUCCESS) { ++ RETURN_FALSE; ++ } ++ ++ if (!http_request_body_fill(&body, fields ? Z_ARRVAL_P(fields) : NULL, files ? Z_ARRVAL_P(files) : NULL)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_POST, URL); ++ request.body = &body; ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_file(string url, string file[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_file) ++{ ++ char *URL, *file; ++ int URL_len, f_len; ++ zval *options = NULL, *info = NULL; ++ php_stream *stream; ++ php_stream_statbuf ssb; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &file, &f_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (!(stream = php_stream_open_wrapper_ex(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT))) { ++ RETURN_FALSE; ++ } ++ if (php_stream_stat(stream, &ssb)) { ++ php_stream_close(stream); ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_stream(string url, resource stream[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_stream) ++{ ++ zval *resource, *options = NULL, *info = NULL; ++ char *URL; ++ int URL_len; ++ php_stream *stream; ++ php_stream_statbuf ssb; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sr|a/!z", &URL, &URL_len, &resource, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(stream, &resource); ++ if (php_stream_stat(stream, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_put_data(string url, string data[, array options[, array &info]]) ++ Performs an HTTP PUT request on the supplied url. */ ++PHP_FUNCTION(http_put_data) ++{ ++ char *URL, *data; ++ int URL_len, data_len; ++ zval *options = NULL, *info = NULL; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|a/!z", &URL, &URL_len, &data, &data_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, HTTP_PUT, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, data, data_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_request(int method, string url[, string body[, array options[, array &info]]]) ++ Performs a custom HTTP request on the supplied url. */ ++PHP_FUNCTION(http_request) ++{ ++ long meth; ++ char *URL, *data = NULL; ++ int URL_len, data_len = 0; ++ zval *options = NULL, *info = NULL; ++ http_request_body body; ++ http_request request; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|sa/!z", &meth, &URL, &URL_len, &data, &data_len, &options, &info)) { ++ RETURN_FALSE; ++ } ++ ++ if (info) { ++ zval_dtor(info); ++ array_init(info); ++ } ++ ++ RETVAL_FALSE; ++ ++ http_request_init_ex(&request, NULL, meth, URL); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, data, data_len, 0); ++ if (SUCCESS == http_request_prepare(&request, options?Z_ARRVAL_P(options):NULL)) { ++ http_request_exec(&request); ++ if (info) { ++ http_request_info(&request, Z_ARRVAL_P(info)); ++ } ++ RETVAL_RESPONSE_OR_BODY(request); ++ } ++ http_request_dtor(&request); ++} ++/* }}} */ ++ ++/* {{{ proto string http_request_body_encode(array fields, array files) ++ Generate x-www-form-urlencoded resp. form-data encoded request body. */ ++PHP_FUNCTION(http_request_body_encode) ++{ ++ zval *fields = NULL, *files = NULL; ++ HashTable *fields_ht, *files_ht; ++ http_request_body body; ++ char *buf; ++ size_t len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!", &fields, &files)) { ++ RETURN_FALSE; ++ } ++ ++ fields_ht = (fields && Z_TYPE_P(fields) == IS_ARRAY) ? Z_ARRVAL_P(fields) : NULL; ++ files_ht = (files && Z_TYPE_P(files) == IS_ARRAY) ? Z_ARRVAL_P(files) : NULL; ++ if (http_request_body_fill(&body, fields_ht, files_ht) && (SUCCESS == http_request_body_encode(&body, &buf, &len))) { ++ RETVAL_STRINGL(buf, len, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not encode request body"); ++ RETVAL_FALSE; ++ } ++ http_request_body_dtor(&body); ++} ++#endif /* HTTP_HAVE_CURL */ ++/* }}} HAVE_CURL */ ++ ++/* {{{ proto int http_request_method_register(string method) ++ Register a custom request method. */ ++PHP_FUNCTION(http_request_method_register) ++{ ++ char *method; ++ int method_len; ++ ulong existing; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) { ++ RETURN_FALSE; ++ } ++ if ((existing = http_request_method_exists(1, 0, method))) { ++ RETURN_LONG((long) existing); ++ } ++ ++ RETVAL_LONG((long) http_request_method_register(method, method_len)); ++} ++/* }}} */ ++ ++/* {{{ proto bool http_request_method_unregister(mixed method) ++ Unregister a previously registered custom request method. */ ++PHP_FUNCTION(http_request_method_unregister) ++{ ++ zval *method; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) { ++ RETURN_FALSE; ++ } ++ ++ switch (Z_TYPE_P(method)) { ++ case IS_OBJECT: ++ convert_to_string(method); ++ case IS_STRING: ++ if (is_numeric_string(Z_STRVAL_P(method), Z_STRLEN_P(method), NULL, NULL, 1)) { ++ convert_to_long(method); ++ } else { ++ int mn; ++ if (!(mn = http_request_method_exists(1, 0, Z_STRVAL_P(method)))) { ++ RETURN_FALSE; ++ } ++ zval_dtor(method); ++ ZVAL_LONG(method, (long)mn); ++ } ++ case IS_LONG: ++ RETURN_SUCCESS(http_request_method_unregister(Z_LVAL_P(method))); ++ default: ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int http_request_method_exists(mixed method) ++ Check if a request method is registered (or available by default). */ ++PHP_FUNCTION(http_request_method_exists) ++{ ++ if (return_value_used) { ++ zval *method; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) { ++ RETURN_FALSE; ++ } ++ ++ switch (Z_TYPE_P(method)) { ++ case IS_OBJECT: ++ convert_to_string(method); ++ case IS_STRING: ++ if (is_numeric_string(Z_STRVAL_P(method), Z_STRLEN_P(method), NULL, NULL, 1)) { ++ convert_to_long(method); ++ } else { ++ RETURN_LONG((long) http_request_method_exists(1, 0, Z_STRVAL_P(method))); ++ } ++ case IS_LONG: ++ RETURN_LONG((long) http_request_method_exists(0, (int) Z_LVAL_P(method), NULL)); ++ default: ++ RETURN_FALSE; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_request_method_name(int method) ++ Get the literal string representation of a standard or registered request method. */ ++PHP_FUNCTION(http_request_method_name) ++{ ++ if (return_value_used) { ++ long method; ++ ++ if ((SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method)) || (method < 0)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_STRING(estrdup(http_request_method_name((int) method)), 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ */ ++#ifdef HTTP_HAVE_ZLIB ++ ++/* {{{ proto string http_deflate(string data[, int flags = 0]) ++ Compress data with gzip, zlib AKA deflate or raw deflate encoding. */ ++PHP_FUNCTION(http_deflate) ++{ ++ char *data; ++ int data_len; ++ long flags = 0; ++ ++ RETVAL_NULL(); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags)) { ++ char *encoded; ++ size_t encoded_len; ++ ++ if (SUCCESS == http_encoding_deflate(flags, data, data_len, &encoded, &encoded_len)) { ++ RETURN_STRINGL(encoded, (int) encoded_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string http_inflate(string data) ++ Decompress data compressed with either gzip, deflate AKA zlib or raw deflate encoding. */ ++PHP_FUNCTION(http_inflate) ++{ ++ char *data; ++ int data_len; ++ ++ RETVAL_NULL(); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ char *decoded; ++ size_t decoded_len; ++ ++ if (SUCCESS == http_encoding_inflate(data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, (int) decoded_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string ob_deflatehandler(string data, int mode) ++ For use with ob_start(). The deflate output buffer handler can only be used once. */ ++PHP_FUNCTION(ob_deflatehandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ http_ob_deflatehandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++ Z_TYPE_P(return_value) = Z_STRVAL_P(return_value) ? IS_STRING : IS_NULL; ++} ++/* }}} */ ++ ++/* {{{ proto string ob_inflatehandler(string data, int mode) ++ For use with ob_start(). Same restrictions as with ob_deflatehandler apply. */ ++PHP_FUNCTION(ob_inflatehandler) ++{ ++ char *data; ++ int data_len; ++ long mode; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &data, &data_len, &mode)) { ++ RETURN_FALSE; ++ } ++ ++ http_ob_inflatehandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode); ++ Z_TYPE_P(return_value) = Z_STRVAL_P(return_value) ? IS_STRING : IS_NULL; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_ZLIB */ ++/* }}} */ ++ ++/* {{{ proto int http_support([int feature = 0]) ++ Check for feature that require external libraries. */ ++PHP_FUNCTION(http_support) ++{ ++ long feature = 0; ++ ++ RETVAL_LONG(0L); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &feature)) { ++ RETVAL_LONG(http_support(feature)); ++ } ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_headers_api.c +@@ -0,0 +1,534 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_headers_api.c 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "ext/standard/url.h" ++#include "ext/standard/php_string.h" ++ ++#include "php_http_api.h" ++#include "php_http_headers_api.h" ++ ++#ifndef HTTP_DBG_NEG ++# define HTTP_DBG_NEG 0 ++#endif ++ ++/* {{{ static void http_grab_response_headers(void *, void *) */ ++static void http_grab_response_headers(void *data, void *arg TSRMLS_DC) ++{ ++ phpstr_appendl(PHPSTR(arg), ((sapi_header_struct *)data)->header); ++ phpstr_appends(PHPSTR(arg), HTTP_CRLF); ++} ++/* }}} */ ++ ++/* {{{ static int http_sort_q(const void *, const void *) */ ++static int http_sort_q(const void *a, const void *b TSRMLS_DC) ++{ ++ Bucket *f, *s; ++ zval result, *first, *second; ++ ++ f = *((Bucket **) a); ++ s = *((Bucket **) b); ++ ++ first = *((zval **) f->pData); ++ second= *((zval **) s->pData); ++ ++ if (numeric_compare_function(&result, first, second TSRMLS_CC) != SUCCESS) { ++ return 0; ++ } ++ return (Z_LVAL(result) > 0 ? -1 : (Z_LVAL(result) < 0 ? 1 : 0)); ++} ++/* }}} */ ++ ++/* {{{ char *http_negotiate_language_func */ ++char *_http_negotiate_language_func(const char *test, double *quality, HashTable *supported TSRMLS_DC) ++{ ++ zval **value; ++ HashPosition pos; ++ const char *dash_test; ++ ++ FOREACH_HASH_VAL(pos, supported, value) { ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strcasecmp('%s', '%s')\n", Z_STRVAL_PP(value), test); ++#endif ++ if (!strcasecmp(Z_STRVAL_PP(value), test)) { ++ return Z_STRVAL_PP(value); ++ } ++ } ++ ++ /* no distinct match found, so try primaries */ ++ if ((dash_test = strchr(test, '-'))) { ++ FOREACH_HASH_VAL(pos, supported, value) { ++ int len = dash_test - test; ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strncasecmp('%s', '%s', %d)\n", Z_STRVAL_PP(value), test, len); ++#endif ++ if ( (!strncasecmp(Z_STRVAL_PP(value), test, len)) && ++ ( (Z_STRVAL_PP(value)[len] == '\0') || ++ (Z_STRVAL_PP(value)[len] == '-'))) { ++ *quality *= .9; ++ return Z_STRVAL_PP(value); ++ } ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ char *http_negotiate_default_func */ ++char *_http_negotiate_default_func(const char *test, double *quality, HashTable *supported TSRMLS_DC) ++{ ++ zval **value; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, supported, value) { ++#if HTTP_DBG_NEG ++ fprintf(stderr, "strcasecmp('%s', '%s')\n", Z_STRVAL_PP(value), test); ++#endif ++ if (!strcasecmp(Z_STRVAL_PP(value), test)) { ++ return Z_STRVAL_PP(value); ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ HashTable *http_negotiate_z(zval *, HashTable *, negotiate_func_t) */ ++PHP_HTTP_API HashTable *_http_negotiate_z(zval *value, HashTable *supported, negotiate_func_t neg TSRMLS_DC) ++{ ++ zval *accept = http_zsep(IS_STRING, value); ++ HashTable *result = NULL; ++ ++ if (Z_STRLEN_P(accept)) { ++ zval ex_arr, ex_del; ++ ++ INIT_PZVAL(&ex_del); ++ INIT_PZVAL(&ex_arr); ++ ZVAL_STRINGL(&ex_del, ",", 1, 0); ++ array_init(&ex_arr); ++ ++ php_explode(&ex_del, accept, &ex_arr, INT_MAX); ++ ++ if (zend_hash_num_elements(Z_ARRVAL(ex_arr)) > 0) { ++ int i = 0; ++ HashPosition pos; ++ zval **entry, array; ++ ++ INIT_PZVAL(&array); ++ array_init(&array); ++ ++ FOREACH_HASH_VAL(pos, Z_ARRVAL(ex_arr), entry) { ++ int ident_len; ++ double quality; ++ char *selected, *identifier, *freeme; ++ const char *separator; ++ ++#if HTTP_DBG_NEG ++ fprintf(stderr, "Checking %s\n", Z_STRVAL_PP(entry)); ++#endif ++ ++ if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) { ++ const char *ptr = separator; ++ ++ while (*++ptr && !HTTP_IS_CTYPE(digit, *ptr) && '.' != *ptr); ++ ++ quality = zend_strtod(ptr, NULL); ++ identifier = estrndup(Z_STRVAL_PP(entry), ident_len = separator - Z_STRVAL_PP(entry)); ++ } else { ++ quality = 1000.0 - i++; ++ identifier = estrndup(Z_STRVAL_PP(entry), ident_len = Z_STRLEN_PP(entry)); ++ } ++ freeme = identifier; ++ ++ while (HTTP_IS_CTYPE(space, *identifier)) { ++ ++identifier; ++ --ident_len; ++ } ++ while (ident_len && HTTP_IS_CTYPE(space, identifier[ident_len - 1])) { ++ identifier[--ident_len] = '\0'; ++ } ++ ++ if ((selected = neg(identifier, &quality, supported TSRMLS_CC))) { ++ /* don't overwrite previously set with higher quality */ ++ if (!zend_hash_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) { ++ add_assoc_double(&array, selected, quality); ++ } ++ } ++ ++ efree(freeme); ++ } ++ ++ result = Z_ARRVAL(array); ++ zend_hash_sort(result, zend_qsort, http_sort_q, 0 TSRMLS_CC); ++ } ++ ++ zval_dtor(&ex_arr); ++ } ++ ++ zval_ptr_dtor(&accept); ++ ++ return result; ++} ++/* }}} */ ++ ++/* {{{ HashTable *http_negotiate_q(const char *, HashTable *, negotiate_func_t) */ ++PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *supported, negotiate_func_t neg TSRMLS_DC) ++{ ++ zval *accept; ++ ++#if HTTP_DBG_NEG ++ fprintf(stderr, "Reading header %s: ", header); ++#endif ++ if (!(accept = http_get_server_var(header, 1))) { ++ return NULL; ++ } ++#if HTTP_DBG_NEG ++ fprintf(stderr, "%s\n", Z_STRVAL_P(accept)); ++#endif ++ ++ return http_negotiate_z(accept, supported, neg); ++} ++/* }}} */ ++ ++/* {{{ http_range_status http_get_request_ranges(HashTable *ranges, size_t) */ ++PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_t length TSRMLS_DC) ++{ ++ zval *zrange; ++ char *range, c; ++ long begin = -1, end = -1, *ptr; ++ ++ if ( !(zrange = http_get_server_var("HTTP_RANGE", 1)) || ++ (size_t) Z_STRLEN_P(zrange) < lenof("bytes=") || strncmp(Z_STRVAL_P(zrange), "bytes=", lenof("bytes="))) { ++ return RANGE_NO; ++ } ++ range = Z_STRVAL_P(zrange) + lenof("bytes="); ++ ptr = &begin; ++ ++ do { ++ switch (c = *(range++)) { ++ case '0': ++ /* allow 000... - shall we? */ ++ if (*ptr != -10) { ++ *ptr *= 10; ++ } ++ break; ++ ++ case '1': case '2': case '3': ++ case '4': case '5': case '6': ++ case '7': case '8': case '9': ++ /* ++ * If the value of the pointer is already set (non-negative) ++ * then multiply its value by ten and add the current value, ++ * else initialise the pointers value with the current value ++ * -- ++ * This let us recognize empty fields when validating the ++ * ranges, i.e. a "-10" for begin and "12345" for the end ++ * was the following range request: "Range: bytes=0-12345"; ++ * While a "-1" for begin and "12345" for the end would ++ * have been: "Range: bytes=-12345". ++ */ ++ if (*ptr > 0) { ++ *ptr *= 10; ++ *ptr += c - '0'; ++ } else { ++ *ptr = c - '0'; ++ } ++ break; ++ ++ case '-': ++ ptr = &end; ++ break; ++ ++ case ' ': ++ break; ++ ++ case 0: ++ case ',': ++ ++ if (length) { ++ /* validate ranges */ ++ switch (begin) { ++ /* "0-12345" */ ++ case -10: ++ switch (end) { ++ /* "0-" */ ++ case -1: ++ return RANGE_NO; ++ ++ /* "0-0" */ ++ case -10: ++ end = 0; ++ break; ++ ++ default: ++ if (length <= (size_t) end) { ++ return RANGE_ERR; ++ } ++ break; ++ } ++ begin = 0; ++ break; ++ ++ /* "-12345" */ ++ case -1: ++ /* "-", "-0" or overflow */ ++ if (end == -1 || end == -10 || length <= (size_t) end) { ++ return RANGE_ERR; ++ } ++ begin = length - end; ++ end = length - 1; ++ break; ++ ++ /* "12345-(xxx)" */ ++ default: ++ switch (end) { ++ /* "12345-0" */ ++ case -10: ++ return RANGE_ERR; ++ ++ /* "12345-" */ ++ case -1: ++ if (length <= (size_t) begin) { ++ return RANGE_ERR; ++ } ++ end = length - 1; ++ break; ++ ++ /* "12345-67890" */ ++ default: ++ if ( (length <= (size_t) begin) || ++ (length <= (size_t) end) || ++ (end < begin)) { ++ return RANGE_ERR; ++ } ++ break; ++ } ++ break; ++ } ++ } ++ { ++ zval *zentry; ++ MAKE_STD_ZVAL(zentry); ++ array_init(zentry); ++ add_index_long(zentry, 0, begin); ++ add_index_long(zentry, 1, end); ++ zend_hash_next_index_insert(ranges, &zentry, sizeof(zval *), NULL); ++ ++ begin = -1; ++ end = -1; ++ ptr = &begin; ++ } ++ break; ++ ++ default: ++ return RANGE_NO; ++ } ++ } while (c != 0); ++ ++ return RANGE_OK; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_parse_headers(char *, HashTable *, zend_bool) */ ++PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *headers, zend_bool prettify, ++ http_info_callback callback_func, void **callback_data TSRMLS_DC) ++{ ++ const char *colon = NULL, *line = NULL; ++ zval array; ++ ++ INIT_ZARR(array, headers); ++ ++ /* skip leading ws */ ++ while (HTTP_IS_CTYPE(space, *header)) ++header; ++ line = header; ++ ++#define MORE_HEADERS (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r'))) ++ do { ++ int value_len = 0; ++ ++ switch (*line++) { ++ case ':': ++ if (!colon) { ++ colon = line - 1; ++ } ++ break; ++ ++ case 0: ++ --value_len; /* we don't have CR so value length is one char less */ ++ case '\n': ++ if ((!*(line - 1)) || ((*line != ' ') && (*line != '\t'))) { ++ http_info i; ++ ++ if (SUCCESS == http_info_parse(header, &i)) { ++ /* response/request line */ ++ callback_func(callback_data, &headers, &i TSRMLS_CC); ++ http_info_dtor(&i); ++ Z_ARRVAL(array) = headers; ++ } else if (colon) { ++ /* "header: value" pair */ ++ if (header != colon) { ++ int keylen = colon - header; ++ const char *key = header; ++ ++ /* skip leading ws */ ++ while (keylen && HTTP_IS_CTYPE(space, *key)) --keylen, ++key; ++ /* skip trailing ws */ ++ while (keylen && HTTP_IS_CTYPE(space, key[keylen - 1])) --keylen; ++ ++ if (keylen > 0) { ++ zval **previous = NULL; ++ char *value; ++ char *keydup = estrndup(key, keylen); ++ ++ if (prettify) { ++ keydup = pretty_key(keydup, keylen, 1, 1); ++ } ++ ++ value_len += line - colon - 1; ++ ++ /* skip leading ws */ ++ while (HTTP_IS_CTYPE(space, *(++colon))) --value_len; ++ /* skip trailing ws */ ++ while (HTTP_IS_CTYPE(space, colon[value_len - 1])) --value_len; ++ ++ if (value_len > 0) { ++ value = estrndup(colon, value_len); ++ } else { ++ value = estrdup(""); ++ value_len = 0; ++ } ++ ++ /* if we already have got such a header make an array of those */ ++ if (SUCCESS == zend_hash_find(headers, keydup, keylen + 1, (void *) &previous)) { ++ /* convert to array */ ++ if (Z_TYPE_PP(previous) != IS_ARRAY) { ++ convert_to_array(*previous); ++ } ++ add_next_index_stringl(*previous, value, value_len, 0); ++ } else { ++ add_assoc_stringl(&array, keydup, value, value_len, 0); ++ } ++ efree(keydup); ++ } else { ++ /* empty key (" : ...") */ ++ return FAILURE; ++ } ++ } else { ++ /* empty key (": ...") */ ++ return FAILURE; ++ } ++ } else if (MORE_HEADERS) { ++ /* a line without a colon */ ++ return FAILURE; ++ } ++ colon = NULL; ++ value_len = 0; ++ header += line - header; ++ } ++ break; ++ } ++ } while (MORE_HEADERS); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_get_request_headers(HashTable *) */ ++PHP_HTTP_API void _http_get_request_headers(HashTable *headers TSRMLS_DC) ++{ ++ HashKey key = initHashKey(0); ++ zval **hsv, **header; ++ HashPosition pos; ++ ++ if (!HTTP_G->request.headers) { ++ ALLOC_HASHTABLE(HTTP_G->request.headers); ++ zend_hash_init(HTTP_G->request.headers, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ ++ if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv) && Z_TYPE_PP(hsv) == IS_ARRAY) { ++ FOREACH_KEY(pos, *hsv, key) { ++ if (key.type == HASH_KEY_IS_STRING && key.len > 6 && !strncmp(key.str, "HTTP_", 5)) { ++ key.len -= 5; ++ key.str = pretty_key(estrndup(key.str + 5, key.len - 1), key.len - 1, 1, 1); ++ ++ zend_hash_get_current_data_ex(Z_ARRVAL_PP(hsv), (void *) &header, &pos); ++ ZVAL_ADDREF(*header); ++ zend_hash_add(HTTP_G->request.headers, key.str, key.len, (void *) header, sizeof(zval *), NULL); ++ ++ efree(key.str); ++ } ++ } ++ } ++ } ++ ++ if (headers) { ++ zend_hash_copy(headers, HTTP_G->request.headers, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_get_response_headers(HashTable *) */ ++PHP_HTTP_API STATUS _http_get_response_headers(HashTable *headers_ht TSRMLS_DC) ++{ ++ STATUS status; ++ phpstr headers; ++ ++ phpstr_init(&headers); ++ zend_llist_apply_with_argument(&SG(sapi_headers).headers, http_grab_response_headers, &headers TSRMLS_CC); ++ phpstr_fix(&headers); ++ ++ status = http_parse_headers_ex(PHPSTR_VAL(&headers), headers_ht, 1); ++ phpstr_dtor(&headers); ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ zend_bool http_match_request_header(char *, char *) */ ++PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const char *value, zend_bool match_case TSRMLS_DC) ++{ ++ char *name; ++ uint name_len = strlen(header); ++ zend_bool result = 0; ++ zval **data, *zvalue; ++ ++ http_get_request_headers(NULL); ++ name = pretty_key(estrndup(header, name_len), name_len, 1, 1); ++ if (SUCCESS == zend_hash_find(HTTP_G->request.headers, name, name_len+1, (void *) &data)) { ++ zvalue = http_zsep(IS_STRING, *data); ++ result = (match_case ? strcmp(Z_STRVAL_P(zvalue), value) : strcasecmp(Z_STRVAL_P(zvalue), value)) ? 0 : 1; ++ zval_ptr_dtor(&zvalue); ++ } ++ efree(name); ++ ++ return result; ++} ++/* }}} */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_inflatestream_object.c +@@ -0,0 +1,292 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_inflatestream_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_ZLIB) ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_inflatestream_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpInflateStream, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpInflateStream, method, 0) ++#define HTTP_INFLATE_ME(method, visibility) PHP_ME(HttpInflateStream, method, HTTP_ARGS(HttpInflateStream, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(update, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(flush, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(finish, 0) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++#define THIS_CE http_inflatestream_object_ce ++zend_class_entry *http_inflatestream_object_ce; ++zend_function_entry http_inflatestream_object_fe[] = { ++ HTTP_INFLATE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_INFLATE_ME(update, ZEND_ACC_PUBLIC) ++ HTTP_INFLATE_ME(flush, ZEND_ACC_PUBLIC) ++ HTTP_INFLATE_ME(finish, ZEND_ACC_PUBLIC) ++ ++ HTTP_INFLATE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_inflatestream_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_inflatestream_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpInflateStream, http_inflatestream_object, NULL, 0); ++ http_inflatestream_object_handlers.clone_obj = _http_inflatestream_object_clone_obj; ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_NONE")-1, HTTP_ENCODING_STREAM_FLUSH_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_SYNC")-1, HTTP_ENCODING_STREAM_FLUSH_SYNC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("FLUSH_FULL")-1, HTTP_ENCODING_STREAM_FLUSH_FULL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_inflatestream_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_inflatestream_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_inflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_inflatestream_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_inflatestream_object *o; ++ ++ o = ecalloc(1, sizeof(http_inflatestream_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (s) { ++ o->stream = s; ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_inflatestream_object, o); ++ ov.handlers = &http_inflatestream_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_inflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ http_encoding_stream *s; ++ zend_object_value new_ov; ++ http_inflatestream_object *new_obj = NULL; ++ getObject(http_inflatestream_object, old_obj); ++ ++ s = ecalloc(1, sizeof(http_encoding_stream)); ++ s->flags = old_obj->stream->flags; ++ inflateCopy(&s->stream, &old_obj->stream->stream); ++ s->stream.opaque = phpstr_dup(s->stream.opaque); ++ ++ new_ov = http_inflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_inflatestream_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_inflatestream_object *o = (http_inflatestream_object *) object; ++ ++ if (o->stream) { ++ http_encoding_inflate_stream_free(&o->stream); ++ } ++ freeObject(o); ++} ++ ++/* {{{ proto void HttpInflateStream::__construct([int flags = 0]) ++ Creates a new HttpInflateStream object instance. */ ++PHP_METHOD(HttpInflateStream, __construct) ++{ ++ long flags = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) { ++ getObject(http_inflatestream_object, obj); ++ ++ if (!obj->stream) { ++ obj->stream = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "HttpInflateStream cannot be initialized twice"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpInflateStream HttpInflateStream::factory([int flags[, string class = "HttpInflateStream"]]) ++ Creates a new HttpInflateStream object instance. */ ++PHP_METHOD(HttpInflateStream, factory) ++{ ++ long flags = 0; ++ char *cn = NULL; ++ int cl = 0; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &flags, &cn, &cl)) { ++ zend_object_value ov; ++ http_encoding_stream *s = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff); ++ ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_inflatestream_object_new_ex, http_inflatestream_object_ce, s, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::update(string data) ++ Passes more data through the inflate stream. */ ++PHP_METHOD(HttpInflateStream, update) ++{ ++ int data_len; ++ size_t decoded_len = 0; ++ char *data, *decoded = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!data_len) { ++ RETURN_STRING("", 1); ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (SUCCESS == http_encoding_inflate_stream_update(obj->stream, data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::flush([string data]) ++ Flush the inflate stream. */ ++PHP_METHOD(HttpInflateStream, flush) ++{ ++ int data_len = 0; ++ size_t decoded_len = 0; ++ char *decoded = NULL, *data = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ /* flushing the inflate stream is a no-op */ ++ if (!data_len) { ++ RETURN_STRINGL("", 0, 1); ++ } else if (SUCCESS == http_encoding_inflate_stream_update(obj->stream, data, data_len, &decoded, &decoded_len)) { ++ RETURN_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpInflateStream::finish([string data]) ++ Finalizes the inflate stream. The inflate stream can be reused after finalizing. */ ++PHP_METHOD(HttpInflateStream, finish) ++{ ++ int data_len = 0; ++ size_t updated_len = 0, decoded_len = 0; ++ char *updated = NULL, *decoded = NULL, *data = NULL; ++ getObject(http_inflatestream_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ if (SUCCESS != http_encoding_inflate_stream_update(obj->stream, data, data_len, &updated, &updated_len)) { ++ RETURN_FALSE; ++ } ++ } ++ ++ if (SUCCESS == http_encoding_inflate_stream_finish(obj->stream, &decoded, &decoded_len)) { ++ if (updated_len) { ++ updated = erealloc(updated, updated_len + decoded_len + 1); ++ updated[updated_len + decoded_len] = '\0'; ++ memcpy(updated + updated_len, decoded, decoded_len); ++ STR_FREE(decoded); ++ updated_len += decoded_len; ++ RETVAL_STRINGL(updated, updated_len, 0); ++ } else if (decoded) { ++ STR_FREE(updated); ++ RETVAL_STRINGL(decoded, decoded_len, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ } else { ++ STR_FREE(updated); ++ RETVAL_FALSE; ++ } ++ ++ http_encoding_inflate_stream_dtor(obj->stream); ++ http_encoding_inflate_stream_init(obj->stream, obj->stream->flags); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_ZLIB*/ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_info_api.c +@@ -0,0 +1,155 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_info_api.c 304921 2010-10-26 15:27:36Z iliaa $ */ ++ ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_info_api.h" ++ ++PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC) ++{ ++ zval array; ++ ++ INIT_ZARR(array, *headers); ++ ++ switch (info->type) { ++ case IS_HTTP_REQUEST: ++ add_assoc_string(&array, "Request Method", HTTP_INFO(info).request.method, 1); ++ add_assoc_string(&array, "Request Url", HTTP_INFO(info).request.url, 1); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ add_assoc_long(&array, "Response Code", (long) HTTP_INFO(info).response.code); ++ if (HTTP_INFO(info).response.status) { ++ add_assoc_string(&array, "Response Status", HTTP_INFO(info).response.status, 1); ++ } ++ break; ++ } ++} ++ ++PHP_HTTP_API void _http_info_dtor(http_info *i) ++{ ++ switch (i->type) { ++ case IS_HTTP_REQUEST: ++ STR_SET(HTTP_INFO(i).request.method, NULL); ++ STR_SET(HTTP_INFO(i).request.url, NULL); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ STR_SET(HTTP_INFO(i).response.status, NULL); ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, zend_bool silent TSRMLS_DC) ++{ ++ const char *end, *http; ++ ++ /* sane parameter */ ++ if ((!pre_header) || (!*pre_header)) { ++ return FAILURE; ++ } ++ ++ /* where's the end of the line */ ++ if (!(end = http_locate_eol(pre_header, NULL))) { ++ end = pre_header + strlen(pre_header); ++ } ++ ++ /* there must be HTTP/1.x in the line */ ++ if (!(http = http_locate_str(pre_header, end - pre_header, "HTTP/1.", lenof("HTTP/1.")))) { ++ return FAILURE; ++ } ++ ++ /* and nothing than SPACE or NUL after HTTP/1.x */ ++ if ( (!HTTP_IS_CTYPE(digit, http[lenof("HTTP/1.")])) || ++ (http[lenof("HTTP/1.1")] && (!HTTP_IS_CTYPE(space, http[lenof("HTTP/1.1")])))) { ++ if (!silent) { ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Invalid HTTP/1.x protocol identification"); ++ } ++ return FAILURE; ++ } ++ ++#if 0 ++ { ++ char *line = estrndup(pre_header, end - pre_header); ++ fprintf(stderr, "http_parse_info('%s')\n", line); ++ efree(line); ++ } ++#endif ++ ++ info->http.version = zend_strtod(http + lenof("HTTP/"), NULL); ++ ++ /* is response */ ++ if (pre_header == http) { ++ char *status = NULL; ++ const char *code = http + sizeof("HTTP/1.1"); ++ ++ info->type = IS_HTTP_RESPONSE; ++ while (' ' == *code) ++code; ++ if (code && end > code) { ++ HTTP_INFO(info).response.code = strtol(code, &status, 10); ++ } else { ++ HTTP_INFO(info).response.code = 0; ++ } ++ if (status && end > status) { ++ while (' ' == *status) ++status; ++ HTTP_INFO(info).response.status = estrndup(status, end - status); ++ } else { ++ HTTP_INFO(info).response.status = NULL; ++ } ++ ++ return SUCCESS; ++ } ++ ++ /* is request */ ++ else if (!http[lenof("HTTP/1.x")] || http[lenof("HTTP/1.x")] == '\r' || http[lenof("HTTP/1.x")] == '\n') { ++ const char *url = strchr(pre_header, ' '); ++ ++ info->type = IS_HTTP_REQUEST; ++ if (url && http > url) { ++ HTTP_INFO(info).request.method = estrndup(pre_header, url - pre_header); ++ while (' ' == *url) ++url; ++ while (' ' == *(http-1)) --http; ++ if (http > url) { ++ HTTP_INFO(info).request.url = estrndup(url, http - url); ++ } else { ++ efree(HTTP_INFO(info).request.method); ++ return FAILURE; ++ } ++ } else { ++ HTTP_INFO(info).request.method = NULL; ++ HTTP_INFO(info).request.url = NULL; ++ } ++ ++ return SUCCESS; ++ } ++ ++ /* some darn header containing HTTP/1.x */ ++ else { ++ return FAILURE; ++ } ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_message_api.c +@@ -0,0 +1,735 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_message_api.c 298689 2010-04-28 06:50:06Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_ZLIB ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_message_api.h" ++#include "php_http_request_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++ ++#define http_message_info_callback _http_message_info_callback ++static void _http_message_info_callback(http_message **message, HashTable **headers, http_info *info TSRMLS_DC) ++{ ++ http_message *old = *message; ++ ++ /* advance message */ ++ if (old->type || zend_hash_num_elements(&old->hdrs) || PHPSTR_LEN(old)) { ++ (*message) = http_message_new(); ++ (*message)->parent = old; ++ (*headers) = &((*message)->hdrs); ++ } ++ ++ http_message_set_info(*message, info); ++} ++ ++#define http_message_init_type _http_message_init_type ++static inline void _http_message_init_type(http_message *message, http_message_type type) ++{ ++ message->http.version = .0; ++ ++ switch (message->type = type) { ++ case HTTP_MSG_RESPONSE: ++ message->http.info.response.code = 0; ++ message->http.info.response.status = NULL; ++ break; ++ ++ case HTTP_MSG_REQUEST: ++ message->http.info.request.method = NULL; ++ message->http.info.request.url = NULL; ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ break; ++ } ++} ++ ++PHP_HTTP_API http_message *_http_message_init_ex(http_message *message, http_message_type type ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ++{ ++ if (!message) { ++ message = ecalloc_rel(1, sizeof(http_message)); ++ } ++ ++ http_message_init_type(message, type); ++ message->parent = NULL; ++ phpstr_init(&message->body); ++ zend_hash_init(&message->hdrs, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ return message; ++} ++ ++PHP_HTTP_API http_message *_http_message_init_env(http_message *message, http_message_type type TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ++{ ++ int free_msg; ++ http_info inf; ++ zval *sval, tval; ++ char *body_str; ++ size_t body_len; ++ ++ if ((free_msg = !message)) { ++ message = http_message_init_rel(NULL, HTTP_MSG_NONE); ++ } ++ ++ memset(&inf, 0, sizeof(http_info)); ++ switch (inf.type = type) { ++ case HTTP_MSG_REQUEST: ++ if ((sval = http_get_server_var("SERVER_PROTOCOL", 1)) && !strncmp(Z_STRVAL_P(sval), "HTTP/", lenof("HTTP/"))) { ++ inf.http.version = zend_strtod(Z_STRVAL_P(sval) + lenof("HTTP/"), NULL); ++ } else { ++ inf.http.version = 1.1; ++ } ++ if ((sval = http_get_server_var("REQUEST_METHOD", 1))) { ++ inf.http.info.request.method = estrdup(Z_STRVAL_P(sval)); ++ } ++ if ((sval = http_get_server_var("REQUEST_URI", 1))) { ++ inf.http.info.request.url = estrdup(Z_STRVAL_P(sval)); ++ } ++ ++ http_message_set_info(message, &inf); ++ http_get_request_headers(&message->hdrs); ++ if (SUCCESS == http_get_request_body_ex(&body_str, &body_len, 0)) { ++ phpstr_from_string_ex(&message->body, body_str, body_len); ++ } ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ if (!SG(sapi_headers).http_status_line || SUCCESS != http_info_parse_ex(SG(sapi_headers).http_status_line, &inf, 0)) { ++ inf.http.version = 1.1; ++ inf.http.info.response.code = 200; ++ inf.http.info.response.status = estrdup("Ok"); ++ } ++ ++ http_message_set_info(message, &inf); ++ http_get_response_headers(&message->hdrs); ++ if (SUCCESS == php_ob_get_buffer(&tval TSRMLS_CC)) { ++ message->body.data = Z_STRVAL(tval); ++ message->body.used = Z_STRLEN(tval); ++ message->body.free = 1; /* "\0" */ ++ } ++ break; ++ ++ default: ++ if (free_msg) { ++ http_message_free(&message); ++ } else { ++ message = NULL; ++ } ++ break; ++ } ++ http_info_dtor(&inf); ++ ++ return message; ++} ++ ++PHP_HTTP_API void _http_message_set_type(http_message *message, http_message_type type) ++{ ++ /* just act if different */ ++ if (type != message->type) { ++ ++ /* free request info */ ++ switch (message->type) { ++ case HTTP_MSG_REQUEST: ++ STR_FREE(message->http.info.request.method); ++ STR_FREE(message->http.info.request.url); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ STR_FREE(message->http.info.response.status); ++ break; ++ ++ default: ++ break; ++ } ++ ++ /* init */ ++ http_message_init_type(message, type); ++ } ++} ++ ++PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info) ++{ ++ http_message_set_type(message, info->type); ++ message->http.version = info->http.version; ++ switch (message->type) { ++ case IS_HTTP_REQUEST: ++ STR_SET(HTTP_INFO(message).request.url, HTTP_INFO(info).request.url ? estrdup(HTTP_INFO(info).request.url) : NULL); ++ STR_SET(HTTP_INFO(message).request.method, HTTP_INFO(info).request.method ? estrdup(HTTP_INFO(info).request.method) : NULL); ++ break; ++ ++ case IS_HTTP_RESPONSE: ++ HTTP_INFO(message).response.code = HTTP_INFO(info).response.code; ++ STR_SET(HTTP_INFO(message).response.status, HTTP_INFO(info).response.status ? estrdup(HTTP_INFO(info).response.status) : NULL); ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++#define http_message_body_parse(m, ms, ml, c) _http_message_body_parse((m), (ms), (ml), (c) TSRMLS_CC) ++static inline void _http_message_body_parse(http_message *msg, const char *message, size_t message_length, const char **continue_at TSRMLS_DC) ++{ ++ zval *c; ++ size_t remaining; ++ const char *body; ++ ++ *continue_at = NULL; ++ if ((body = http_locate_body(message))) { ++ remaining = message + message_length - body; ++ ++ if ((c = http_message_header(msg, "Transfer-Encoding"))) { ++ if (strstr(Z_STRVAL_P(c), "chunked")) { ++ /* message has chunked transfer encoding */ ++ char *decoded; ++ size_t decoded_len; ++ ++ /* decode and replace Transfer-Encoding with Content-Length header */ ++ if ((*continue_at = http_encoding_dechunk(body, message + message_length - body, &decoded, &decoded_len))) { ++ zval *len; ++ char *tmp; ++ int tmp_len; ++ ++ tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); ++ MAKE_STD_ZVAL(len); ++ ZVAL_STRINGL(len, tmp, tmp_len, 0); ++ ++ ZVAL_ADDREF(c); ++ zend_hash_update(&msg->hdrs, "X-Original-Transfer-Encoding", sizeof("X-Original-Transfer-Encoding"), (void *) &c, sizeof(zval *), NULL); ++ zend_hash_del(&msg->hdrs, "Transfer-Encoding", sizeof("Transfer-Encoding")); ++ zend_hash_del(&msg->hdrs, "Content-Length", sizeof("Content-Length")); ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ ++ phpstr_from_string_ex(PHPSTR(msg), decoded, decoded_len); ++ efree(decoded); ++ } ++ } ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at && (c = http_message_header(msg, "Content-Length"))) { ++ /* message has content-length header */ ++ ulong len = strtoul(Z_STRVAL_P(c), NULL, 10); ++ if (len > remaining) { ++ http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Length header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining); ++ len = remaining; ++ } ++ phpstr_from_string_ex(PHPSTR(msg), body, len); ++ *continue_at = body + len; ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at && (c = http_message_header(msg, "Content-Range"))) { ++ /* message has content-range header */ ++ ulong total = 0, start = 0, end = 0, len = 0; ++ ++ if (!strncasecmp(Z_STRVAL_P(c), "bytes", lenof("bytes")) && ++ ( Z_STRVAL_P(c)[lenof("bytes")] == ':' || ++ Z_STRVAL_P(c)[lenof("bytes")] == ' ' || ++ Z_STRVAL_P(c)[lenof("bytes")] == '=')) { ++ char *total_at = NULL, *end_at = NULL; ++ char *start_at = Z_STRVAL_P(c) + sizeof("bytes"); ++ ++ start = strtoul(start_at, &end_at, 10); ++ if (end_at) { ++ end = strtoul(end_at + 1, &total_at, 10); ++ if (total_at && strncmp(total_at + 1, "*", 1)) { ++ total = strtoul(total_at + 1, NULL, 10); ++ } ++ if ((len = (end + 1 - start)) > remaining) { ++ http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Range header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining); ++ len = remaining; ++ } ++ if (end >= start && (!total || end < total)) { ++ phpstr_from_string_ex(PHPSTR(msg), body, len); ++ *continue_at = body + len; ++ } ++ } ++ } ++ ++ if (!*continue_at) { ++ http_error_ex(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Invalid Content-Range header: %s", Z_STRVAL_P(c)); ++ } ++ zval_ptr_dtor(&c); ++ } ++ ++ if (!*continue_at) { ++ /* no headers that indicate content length */ ++ if (HTTP_MSG_TYPE(RESPONSE, msg)) { ++ phpstr_from_string_ex(PHPSTR(msg), body, remaining); ++ } else { ++ *continue_at = body; ++ } ++ } ++ ++#ifdef HTTP_HAVE_ZLIB ++ /* check for compressed data */ ++ if ((c = http_message_header(msg, "Content-Encoding"))) { ++ char *decoded = NULL; ++ size_t decoded_len = 0; ++ ++ if ( !strcasecmp(Z_STRVAL_P(c), "gzip") || ++ !strcasecmp(Z_STRVAL_P(c), "x-gzip") || ++ !strcasecmp(Z_STRVAL_P(c), "deflate")) { ++ http_encoding_inflate(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); ++ } ++ ++ if (decoded) { ++ zval *len, **original_len; ++ char *tmp; ++ int tmp_len; ++ ++ tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); ++ MAKE_STD_ZVAL(len); ++ ZVAL_STRINGL(len, tmp, tmp_len, 0); ++ ++ ZVAL_ADDREF(c); ++ zend_hash_update(&msg->hdrs, "X-Original-Content-Encoding", sizeof("X-Original-Content-Encoding"), (void *) &c, sizeof(zval *), NULL); ++ zend_hash_del(&msg->hdrs, "Content-Encoding", sizeof("Content-Encoding")); ++ if (SUCCESS == zend_hash_find(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &original_len)) { ++ ZVAL_ADDREF(*original_len); ++ zend_hash_update(&msg->hdrs, "X-Original-Content-Length", sizeof("X-Original-Content-Length"), (void *) original_len, sizeof(zval *), NULL); ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ } else { ++ zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); ++ } ++ ++ phpstr_dtor(PHPSTR(msg)); ++ PHPSTR(msg)->data = decoded; ++ PHPSTR(msg)->used = decoded_len; ++ PHPSTR(msg)->free = 1; ++ } ++ ++ zval_ptr_dtor(&c); ++ } ++#endif /* HTTP_HAVE_ZLIB */ ++ } ++} ++ ++PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char *message, size_t message_length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ const char *continue_at; ++ zend_bool free_msg = msg ? 0 : 1; ++ ++ if ((!message) || (message_length < HTTP_MSG_MIN_SIZE)) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Empty or too short HTTP message: '%s'", message); ++ return NULL; ++ } ++ ++ msg = http_message_init_rel(msg, 0); ++ ++ if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void *) &msg)) { ++ if (free_msg) { ++ http_message_free(&msg); ++ } ++ http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Failed to parse message headers"); ++ return NULL; ++ } ++ ++ http_message_body_parse(msg, message, message_length, &continue_at); ++ ++ /* check for following messages */ ++ if (continue_at && (continue_at < (message + message_length))) { ++ while (HTTP_IS_CTYPE(space, *continue_at)) ++continue_at; ++ if (continue_at < (message + message_length)) { ++ http_message *next = NULL, *most = NULL; ++ ++ /* set current message to parent of most parent following messages and return deepest */ ++ if ((most = next = http_message_parse_rel(NULL, continue_at, message + message_length - continue_at))) { ++ while (most->parent) most = most->parent; ++ most->parent = msg; ++ msg = next; ++ } ++ } ++ } ++ ++ return msg; ++} ++ ++PHP_HTTP_API void _http_message_tostring(http_message *msg, char **string, size_t *length) ++{ ++ phpstr str; ++ HashKey key = initHashKey(0); ++ zval **header; ++ char *data; ++ HashPosition pos1; ++ ++ phpstr_init_ex(&str, 4096, 0); ++ ++ switch (msg->type) { ++ case HTTP_MSG_REQUEST: ++ phpstr_appendf(&str, HTTP_INFO_REQUEST_FMT_ARGS(&msg->http, HTTP_CRLF)); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ phpstr_appendf(&str, HTTP_INFO_RESPONSE_FMT_ARGS(&msg->http, HTTP_CRLF)); ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ break; ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &msg->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ HashPosition pos2; ++ zval **single_header; ++ ++ switch (Z_TYPE_PP(header)) { ++ case IS_BOOL: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_BVAL_PP(header)?"true":"false"); ++ break; ++ ++ case IS_LONG: ++ phpstr_appendf(&str, "%s: %ld" HTTP_CRLF, key.str, Z_LVAL_PP(header)); ++ break; ++ ++ case IS_DOUBLE: ++ phpstr_appendf(&str, "%s: %f" HTTP_CRLF, key.str, Z_DVAL_PP(header)); ++ break; ++ ++ case IS_STRING: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_STRVAL_PP(header)); ++ break; ++ ++ case IS_ARRAY: ++ FOREACH_VAL(pos2, *header, single_header) { ++ switch (Z_TYPE_PP(single_header)) { ++ case IS_BOOL: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_BVAL_PP(single_header)?"true":"false"); ++ break; ++ ++ case IS_LONG: ++ phpstr_appendf(&str, "%s: %ld" HTTP_CRLF, key.str, Z_LVAL_PP(single_header)); ++ break; ++ ++ case IS_DOUBLE: ++ phpstr_appendf(&str, "%s: %f" HTTP_CRLF, key.str, Z_DVAL_PP(single_header)); ++ break; ++ ++ case IS_STRING: ++ phpstr_appendf(&str, "%s: %s" HTTP_CRLF, key.str, Z_STRVAL_PP(single_header)); ++ break; ++ } ++ } ++ break; ++ } ++ } ++ } ++ ++ if (PHPSTR_LEN(msg)) { ++ phpstr_appends(&str, HTTP_CRLF); ++ phpstr_append(&str, PHPSTR_VAL(msg), PHPSTR_LEN(msg)); ++ phpstr_appends(&str, HTTP_CRLF); ++ } ++ ++ data = phpstr_data(&str, string, length); ++ if (!string) { ++ efree(data); ++ } ++ ++ phpstr_dtor(&str); ++} ++ ++PHP_HTTP_API void _http_message_serialize(http_message *message, char **string, size_t *length) ++{ ++ char *buf; ++ size_t len; ++ phpstr str; ++ ++ phpstr_init(&str); ++ ++ do { ++ http_message_tostring(message, &buf, &len); ++ phpstr_prepend(&str, buf, len); ++ efree(buf); ++ } while ((message = message->parent)); ++ ++ buf = phpstr_data(&str, string, length); ++ if (!string) { ++ efree(buf); ++ } ++ ++ phpstr_dtor(&str); ++} ++ ++PHP_HTTP_API http_message *_http_message_reverse(http_message *msg) ++{ ++ int i, c; ++ ++ http_message_count(c, msg); ++ ++ if (c > 1) { ++ http_message *tmp = msg, **arr = ecalloc(c, sizeof(http_message *)); ++ ++ for (i = 0; i < c; ++i) { ++ arr[i] = tmp; ++ tmp = tmp->parent; ++ } ++ arr[0]->parent = NULL; ++ for (i = 0; i < c-1; ++i) { ++ arr[i+1]->parent = arr[i]; ++ } ++ ++ msg = arr[c-1]; ++ efree(arr); ++ } ++ ++ return msg; ++} ++ ++PHP_HTTP_API http_message *_http_message_interconnect(http_message *m1, http_message *m2) ++{ ++ if (m1 && m2) { ++ int i = 0, c1, c2; ++ http_message *t1 = m1, *t2 = m2, *p1, *p2; ++ ++ http_message_count(c1, m1); ++ http_message_count(c2, m2); ++ ++ while (i++ < (c1 - c2)) { ++ t1 = t1->parent; ++ } ++ while (i++ <= c1) { ++ p1 = t1->parent; ++ p2 = t2->parent; ++ t1->parent = t2; ++ t2->parent = p1; ++ t1 = p1; ++ t2 = p2; ++ } ++ } else if (!m1 && m2) { ++ m1 = m2; ++ } ++ return m1; ++} ++ ++PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *obj TSRMLS_DC) ++{ ++ zval strct; ++ zval *headers; ++ ++ INIT_ZARR(strct, HASH_OF(obj)); ++ ++ add_assoc_long(&strct, "type", msg->type); ++ add_assoc_double(&strct, "httpVersion", msg->http.version); ++ switch (msg->type) ++ { ++ case HTTP_MSG_RESPONSE: ++ add_assoc_long(&strct, "responseCode", msg->http.info.response.code); ++ add_assoc_string(&strct, "responseStatus", STR_PTR(msg->http.info.response.status), 1); ++ break; ++ ++ case HTTP_MSG_REQUEST: ++ add_assoc_string(&strct, "requestMethod", STR_PTR(msg->http.info.request.method), 1); ++ add_assoc_string(&strct, "requestUrl", STR_PTR(msg->http.info.request.url), 1); ++ break; ++ ++ case HTTP_MSG_NONE: ++ /* avoid compiler warning */ ++ break; ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(&strct, "headers", headers); ++ ++ add_assoc_stringl(&strct, "body", PHPSTR_VAL(msg), PHPSTR_LEN(msg), 1); ++ ++ if (msg->parent) { ++ zval *parent; ++ ++ MAKE_STD_ZVAL(parent); ++ if (Z_TYPE_P(obj) == IS_ARRAY) { ++ array_init(parent); ++ } else { ++ object_init(parent); ++ } ++ add_assoc_zval(&strct, "parentMessage", parent); ++ http_message_tostruct_recursive(msg->parent, parent); ++ } else { ++ add_assoc_null(&strct, "parentMessage"); ++ } ++} ++ ++PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC) ++{ ++ STATUS rs = FAILURE; ++ ++ switch (message->type) { ++ case HTTP_MSG_RESPONSE: ++ { ++ HashKey key = initHashKey(0); ++ zval **val; ++ HashPosition pos; ++ ++ FOREACH_HASH_KEYVAL(pos, &message->hdrs, key, val) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ http_send_header_zval_ex(key.str, key.len-1, val, 1); ++ } ++ } ++ rs = SUCCESS == http_send_status(message->http.info.response.code) && ++ SUCCESS == http_send_data(PHPSTR_VAL(message), PHPSTR_LEN(message)) ? ++ SUCCESS : FAILURE; ++ break; ++ } ++ ++ case HTTP_MSG_REQUEST: ++ { ++#ifdef HTTP_HAVE_CURL ++ char *uri = NULL; ++ http_request request; ++ zval **zhost, *options, *headers; ++ ++ MAKE_STD_ZVAL(options); ++ MAKE_STD_ZVAL(headers); ++ array_init(options); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(options, "headers", headers); ++ ++ /* check host header */ ++ if (SUCCESS == zend_hash_find(&message->hdrs, "Host", sizeof("Host"), (void *) &zhost) && Z_TYPE_PP(zhost) == IS_STRING) { ++ char *colon = NULL; ++ php_url parts, *url = php_url_parse(message->http.info.request.url); ++ ++ memset(&parts, 0, sizeof(php_url)); ++ ++ /* check for port */ ++ if ((colon = strchr(Z_STRVAL_PP(zhost), ':'))) { ++ parts.port = atoi(colon + 1); ++ parts.host = estrndup(Z_STRVAL_PP(zhost), (Z_STRVAL_PP(zhost) - colon - 1)); ++ } else { ++ parts.host = estrndup(Z_STRVAL_PP(zhost), Z_STRLEN_PP(zhost)); ++ } ++ ++ http_build_url(HTTP_URL_REPLACE, url, &parts, NULL, &uri, NULL); ++ php_url_free(url); ++ efree(parts.host); ++ } else { ++ uri = http_absolute_url(message->http.info.request.url); ++ } ++ ++ if ((request.meth = http_request_method_exists(1, 0, message->http.info.request.method))) { ++ http_request_body body; ++ ++ http_request_init_ex(&request, NULL, request.meth, uri); ++ request.body = http_request_body_init_ex(&body, HTTP_REQUEST_BODY_CSTRING, PHPSTR_VAL(message), PHPSTR_LEN(message), 0); ++ if (SUCCESS == (rs = http_request_prepare(&request, Z_ARRVAL_P(options)))) { ++ http_request_exec(&request); ++ } ++ http_request_dtor(&request); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, ++ "Cannot send HttpMessage. Request method %s not supported", ++ message->http.info.request.method); ++ } ++ efree(uri); ++ zval_ptr_dtor(&options); ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HTTP requests not supported - ext/http was not linked against libcurl."); ++#endif ++ break; ++ } ++ ++ case HTTP_MSG_NONE: ++ default: ++ http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is neither of type HTTP_MSG_REQUEST nor HTTP_MSG_RESPONSE"); ++ break; ++ } ++ ++ return rs; ++} ++ ++PHP_HTTP_API http_message *_http_message_dup(http_message *orig TSRMLS_DC) ++{ ++ http_message *temp, *copy = NULL; ++ http_info info; ++ ++ if (orig) { ++ info.type = orig->type; ++ info.http = orig->http; ++ ++ copy = temp = http_message_new(); ++ http_message_set_info(temp, &info); ++ zend_hash_copy(&temp->hdrs, &orig->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&temp->body, orig->body.data, orig->body.used); ++ ++ while (orig->parent) { ++ info.type = orig->parent->type; ++ info.http = orig->parent->http; ++ ++ temp->parent = http_message_new(); ++ http_message_set_info(temp->parent, &info); ++ zend_hash_copy(&temp->parent->hdrs, &orig->parent->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&temp->parent->body, orig->parent->body.data, orig->parent->body.used); ++ ++ temp = temp->parent; ++ orig = orig->parent; ++ } ++ } ++ ++ return copy; ++} ++ ++PHP_HTTP_API void _http_message_dtor(http_message *message) ++{ ++ if (message) { ++ zend_hash_destroy(&message->hdrs); ++ phpstr_dtor(PHPSTR(message)); ++ ++ switch (message->type) { ++ case HTTP_MSG_REQUEST: ++ STR_SET(message->http.info.request.method, NULL); ++ STR_SET(message->http.info.request.url, NULL); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ STR_SET(message->http.info.response.status, NULL); ++ break; ++ ++ default: ++ break; ++ } ++ } ++} ++ ++PHP_HTTP_API void _http_message_free(http_message **message) ++{ ++ if (*message) { ++ if ((*message)->parent) { ++ http_message_free(&(*message)->parent); ++ } ++ http_message_dtor(*message); ++ efree(*message); ++ *message = NULL; ++ } ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_message_object.c +@@ -0,0 +1,1546 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_message_object.c 309640 2011-03-24 09:26:11Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "zend_interfaces.h" ++#include "ext/standard/url.h" ++#include "php_variables.h" ++ ++#include "php_http_api.h" ++#include "php_http_send_api.h" ++#include "php_http_url_api.h" ++#include "php_http_message_api.h" ++#include "php_http_message_object.h" ++#include "php_http_exception_object.h" ++#include "php_http_response_object.h" ++#include "php_http_request_method_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_headers_api.h" ++ ++#if defined(HTTP_HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpMessage, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpMessage, method, 0) ++#define HTTP_MESSAGE_ME(method, visibility) PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(message, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(message, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(fromEnv, 1) ++ HTTP_ARG_VAL(type, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBody); ++HTTP_BEGIN_ARGS(setBody, 1) ++ HTTP_ARG_VAL(body, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getHeader, 1) ++ HTTP_ARG_VAL(header, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHeaders); ++HTTP_BEGIN_ARGS(setHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++ HTTP_ARG_VAL(append, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getType); ++HTTP_BEGIN_ARGS(setType, 1) ++ HTTP_ARG_VAL(type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getInfo); ++HTTP_BEGIN_ARGS(setInfo, 1) ++ HTTP_ARG_VAL(http_info, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseCode); ++HTTP_BEGIN_ARGS(setResponseCode, 1) ++ HTTP_ARG_VAL(response_code, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseStatus); ++HTTP_BEGIN_ARGS(setResponseStatus, 1) ++ HTTP_ARG_VAL(response_status, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestMethod); ++HTTP_BEGIN_ARGS(setRequestMethod, 1) ++ HTTP_ARG_VAL(request_method, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestUrl); ++HTTP_BEGIN_ARGS(setRequestUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHttpVersion); ++HTTP_BEGIN_ARGS(setHttpVersion, 1) ++ HTTP_ARG_VAL(http_version, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(guessContentType, 1) ++ HTTP_ARG_VAL(magic_file, 0) ++ HTTP_ARG_VAL(magic_mode, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getParentMessage); ++HTTP_EMPTY_ARGS(send); ++HTTP_EMPTY_ARGS(__toString); ++HTTP_BEGIN_ARGS(toString, 0) ++ HTTP_ARG_VAL(include_parent, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(toMessageTypeObject); ++ ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_EMPTY_ARGS(serialize); ++HTTP_BEGIN_ARGS(unserialize, 1) ++ HTTP_ARG_VAL(serialized, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(rewind); ++HTTP_EMPTY_ARGS(valid); ++HTTP_EMPTY_ARGS(key); ++HTTP_EMPTY_ARGS(current); ++HTTP_EMPTY_ARGS(next); ++ ++HTTP_EMPTY_ARGS(detach); ++HTTP_BEGIN_ARGS(prepend, 1) ++ HTTP_ARG_OBJ(HttpMessage, message, 0) ++HTTP_END_ARGS; ++HTTP_EMPTY_ARGS(reverse); ++ ++#define http_message_object_read_prop _http_message_object_read_prop ++static zval *_http_message_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_write_prop _http_message_object_write_prop ++static void _http_message_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_get_prop_ptr _http_message_object_get_prop_ptr ++static zval **_http_message_object_get_prop_ptr(zval *object, zval *member ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_message_object_get_props _http_message_object_get_props ++static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC); ++ ++#define THIS_CE http_message_object_ce ++zend_class_entry *http_message_object_ce; ++zend_function_entry http_message_object_fe[] = { ++ HTTP_MESSAGE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_MESSAGE_ME(getBody, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setBody, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHeader, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(addHeaders, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getInfo, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setInfo, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getRequestMethod, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setRequestMethod, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getRequestUrl, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setRequestUrl, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getHttpVersion, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(setHttpVersion, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(guessContentType, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(getParentMessage, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(toString, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(toMessageTypeObject, ZEND_ACC_PUBLIC) ++ ++ /* implements Countable */ ++ HTTP_MESSAGE_ME(count, ZEND_ACC_PUBLIC) ++ ++ /* implements Serializable */ ++ HTTP_MESSAGE_ME(serialize, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(unserialize, ZEND_ACC_PUBLIC) ++ ++ /* implements Iterator */ ++ HTTP_MESSAGE_ME(rewind, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(valid, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(current, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(key, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(next, ZEND_ACC_PUBLIC) ++ ++ ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, __toString), ZEND_ACC_PUBLIC) ++ ++ HTTP_MESSAGE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ZEND_MALIAS(HttpMessage, fromString, factory, HTTP_ARGS(HttpMessage, factory), ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ HTTP_MESSAGE_ME(fromEnv, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ HTTP_MESSAGE_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(prepend, ZEND_ACC_PUBLIC) ++ HTTP_MESSAGE_ME(reverse, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_message_object_handlers; ++ ++static HashTable http_message_object_prophandlers; ++ ++typedef void (*http_message_object_prophandler_func)(http_message_object *o, zval *v TSRMLS_DC); ++ ++typedef struct _http_message_object_prophandler { ++ http_message_object_prophandler_func read; ++ http_message_object_prophandler_func write; ++} http_message_object_prophandler; ++ ++static STATUS http_message_object_add_prophandler(const char *prop_str, size_t prop_len, http_message_object_prophandler_func read, http_message_object_prophandler_func write) { ++ http_message_object_prophandler h = { read, write }; ++ return zend_hash_add(&http_message_object_prophandlers, prop_str, prop_len, (void *) &h, sizeof(h), NULL); ++} ++static STATUS http_message_object_get_prophandler(const char *prop_str, size_t prop_len, http_message_object_prophandler **handler) { ++ return zend_hash_find(&http_message_object_prophandlers, prop_str, prop_len, (void *) handler); ++} ++static void http_message_object_prophandler_get_type(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ RETVAL_LONG(obj->message->type); ++} ++static void http_message_object_prophandler_set_type(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_LONG, value); ++ http_message_set_type(obj->message, Z_LVAL_P(cpy)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_body(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ phpstr_fix(PHPSTR(obj->message)); ++ RETVAL_PHPSTR(PHPSTR(obj->message), 0, 1); ++} ++static void http_message_object_prophandler_set_body(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ phpstr_dtor(PHPSTR(obj->message)); ++ phpstr_from_string_ex(PHPSTR(obj->message), Z_STRVAL_P(cpy), Z_STRLEN_P(cpy)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_request_method(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message) && obj->message->http.info.request.method) { ++ RETVAL_STRING(obj->message->http.info.request.method, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_request_method(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.request.method, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_request_url(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message) && obj->message->http.info.request.url) { ++ RETVAL_STRING(obj->message->http.info.request.url, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_request_url(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(REQUEST, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.request.url, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_response_status(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message) && obj->message->http.info.response.status) { ++ RETVAL_STRING(obj->message->http.info.response.status, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_response_status(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ zval *cpy = http_zsep(IS_STRING, value); ++ STR_SET(obj->message->http.info.response.status, estrndup(Z_STRVAL_P(cpy), Z_STRLEN_P(cpy))); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_response_code(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ RETVAL_LONG(obj->message->http.info.response.code); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_response_code(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (HTTP_MSG_TYPE(RESPONSE, obj->message)) { ++ zval *cpy = http_zsep(IS_LONG, value); ++ obj->message->http.info.response.code = Z_LVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++ } ++} ++static void http_message_object_prophandler_get_http_version(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ RETVAL_DOUBLE(obj->message->http.version); ++} ++static void http_message_object_prophandler_set_http_version(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_DOUBLE, value); ++ obj->message->http.version = Z_DVAL_P(cpy); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_headers(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ array_init(return_value); ++ zend_hash_copy(Z_ARRVAL_P(return_value), &obj->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++} ++static void http_message_object_prophandler_set_headers(http_message_object *obj, zval *value TSRMLS_DC) { ++ zval *cpy = http_zsep(IS_ARRAY, value); ++ zend_hash_clean(&obj->message->hdrs); ++ zend_hash_copy(&obj->message->hdrs, Z_ARRVAL_P(cpy), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ zval_ptr_dtor(&cpy); ++} ++static void http_message_object_prophandler_get_parent_message(http_message_object *obj, zval *return_value TSRMLS_DC) { ++ if (obj->message->parent) { ++ RETVAL_OBJVAL(obj->parent, 1); ++ } else { ++ RETVAL_NULL(); ++ } ++} ++static void http_message_object_prophandler_set_parent_message(http_message_object *obj, zval *value TSRMLS_DC) { ++ if (Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), http_message_object_ce TSRMLS_CC)) { ++ if (obj->message->parent) { ++ zval tmp; ++ tmp.value.obj = obj->parent; ++ Z_OBJ_DELREF(tmp); ++ } ++ Z_OBJ_ADDREF_P(value); ++ obj->parent = value->value.obj; ++ } ++} ++ ++PHP_MINIT_FUNCTION(http_message_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0); ++ ++#ifndef WONKY ++# ifdef HTTP_HAVE_SPL ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator); ++# else ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_iterator); ++# endif ++#else ++ zend_class_implements(http_message_object_ce TSRMLS_CC, 1, zend_ce_iterator); ++#endif ++ ++ http_message_object_handlers.clone_obj = _http_message_object_clone_obj; ++ http_message_object_handlers.read_property = http_message_object_read_prop; ++ http_message_object_handlers.write_property = http_message_object_write_prop; ++ http_message_object_handlers.get_properties = http_message_object_get_props; ++ http_message_object_handlers.get_property_ptr_ptr = http_message_object_get_prop_ptr; ++ ++ zend_hash_init(&http_message_object_prophandlers, 9, NULL, NULL, 1); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("type")-1, HTTP_MSG_NONE, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("type")-1, http_message_object_prophandler_get_type, http_message_object_prophandler_set_type); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("body")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("body")-1, http_message_object_prophandler_get_body, http_message_object_prophandler_set_body); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestMethod")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("requestMethod")-1, http_message_object_prophandler_get_request_method, http_message_object_prophandler_set_request_method); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestUrl")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("requestUrl")-1, http_message_object_prophandler_get_request_url, http_message_object_prophandler_set_request_url); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("responseStatus")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("responseStatus")-1, http_message_object_prophandler_get_response_status, http_message_object_prophandler_set_response_status); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("responseCode")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("responseCode")-1, http_message_object_prophandler_get_response_code, http_message_object_prophandler_set_response_code); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("httpVersion")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("httpVersion")-1, http_message_object_prophandler_get_http_version, http_message_object_prophandler_set_http_version); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("headers")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("headers")-1, http_message_object_prophandler_get_headers, http_message_object_prophandler_set_headers); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("parentMessage")-1, ZEND_ACC_PROTECTED TSRMLS_CC); ++ http_message_object_add_prophandler(ZEND_STRS("parentMessage")-1, http_message_object_prophandler_get_parent_message, http_message_object_prophandler_set_parent_message); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_NONE")-1, HTTP_MSG_NONE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_REQUEST")-1, HTTP_MSG_REQUEST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_RESPONSE")-1, HTTP_MSG_RESPONSE TSRMLS_CC); ++#endif ++ ++ HTTP_LONG_CONSTANT("HTTP_MSG_NONE", HTTP_MSG_NONE); ++ HTTP_LONG_CONSTANT("HTTP_MSG_REQUEST", HTTP_MSG_REQUEST); ++ HTTP_LONG_CONSTANT("HTTP_MSG_RESPONSE", HTTP_MSG_RESPONSE); ++ ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_message_object) ++{ ++ zend_hash_destroy(&http_message_object_prophandlers); ++ ++ return SUCCESS; ++} ++ ++void _http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC) ++{ ++ int i; ++ getObject(http_message_object, obj); ++ ++ /* count */ ++ http_message_count(i, obj->message); ++ ++ if (i > 1) { ++ zval o; ++ zend_object_value *ovalues = NULL; ++ http_message_object **objects = NULL; ++ int last = i - 1; ++ ++ objects = ecalloc(i, sizeof(http_message_object *)); ++ ovalues = ecalloc(i, sizeof(zend_object_value)); ++ ++ /* we are the first message */ ++ objects[0] = obj; ++ ovalues[0] = getThis()->value.obj; ++ ++ /* fetch parents */ ++ INIT_PZVAL(&o); ++ o.type = IS_OBJECT; ++ for (i = 1; obj->parent.handle; ++i) { ++ o.value.obj = obj->parent; ++ ovalues[i] = o.value.obj; ++ objects[i] = obj = zend_object_store_get_object(&o TSRMLS_CC); ++ } ++ ++ /* reorder parents */ ++ for (last = --i; i; --i) { ++ objects[i]->message->parent = objects[i-1]->message; ++ objects[i]->parent = ovalues[i-1]; ++ } ++ objects[0]->message->parent = NULL; ++ objects[0]->parent.handle = 0; ++ objects[0]->parent.handlers = NULL; ++ ++ /* add ref (why?) */ ++ Z_OBJ_ADDREF_P(getThis()); ++ RETVAL_OBJVAL(ovalues[last], 1); ++ ++ efree(objects); ++ efree(ovalues); ++ } else { ++ RETURN_ZVAL(getThis(), 1, 0); ++ } ++} ++ ++void _http_message_object_prepend_ex(zval *this_ptr, zval *prepend, zend_bool top TSRMLS_DC) ++{ ++ zval m; ++ http_message *save_parent_msg = NULL; ++ zend_object_value save_parent_obj = {0, NULL}; ++ getObject(http_message_object, obj); ++ getObjectEx(http_message_object, prepend_obj, prepend); ++ ++ INIT_PZVAL(&m); ++ m.type = IS_OBJECT; ++ ++ if (!top) { ++ save_parent_obj = obj->parent; ++ save_parent_msg = obj->message->parent; ++ } else { ++ /* iterate to the most parent object */ ++ while (obj->parent.handle) { ++ m.value.obj = obj->parent; ++ obj = zend_object_store_get_object(&m TSRMLS_CC); ++ } ++ } ++ ++ /* prepend */ ++ obj->parent = prepend->value.obj; ++ obj->message->parent = prepend_obj->message; ++ ++ /* add ref */ ++ zend_objects_store_add_ref(prepend TSRMLS_CC); ++ while (prepend_obj->parent.handle) { ++ m.value.obj = prepend_obj->parent; ++ zend_objects_store_add_ref(&m TSRMLS_CC); ++ prepend_obj = zend_object_store_get_object(&m TSRMLS_CC); ++ } ++ ++ if (!top) { ++ prepend_obj->parent = save_parent_obj; ++ prepend_obj->message->parent = save_parent_msg; ++ } ++} ++ ++zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_message_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_message_object_new_ex(zend_class_entry *ce, http_message *msg, http_message_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_message_object *o; ++ ++ o = ecalloc(1, sizeof(http_message_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ if (msg) { ++ o->message = msg; ++ if (msg->parent) { ++ o->parent = http_message_object_new_ex(ce, msg->parent, NULL); ++ } ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_message_object, o); ++ ov.handlers = &http_message_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_message_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ zend_object_value new_ov; ++ http_message_object *new_obj = NULL; ++ getObject(http_message_object, old_obj); ++ ++ new_ov = http_message_object_new_ex(old_obj->zo.ce, http_message_dup(old_obj->message), &new_obj); ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ ++ return new_ov; ++} ++ ++void _http_message_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_message_object *o = (http_message_object *) object; ++ ++ if (o->iterator) { ++ zval_ptr_dtor(&o->iterator); ++ o->iterator = NULL; ++ } ++ if (o->message) { ++ http_message_dtor(o->message); ++ efree(o->message); ++ } ++ if (o->parent.handle) { ++ zval p; ++ ++ INIT_PZVAL(&p); ++ p.type = IS_OBJECT; ++ p.value.obj = o->parent; ++ zend_objects_store_del_ref(&p TSRMLS_CC); ++ } ++ freeObject(o); ++} ++ ++static zval **_http_message_object_get_prop_ptr(zval *object, zval *member ZEND_LITERAL_KEY_DC TSRMLS_DC) { ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ return zend_get_std_object_handlers()->get_property_ptr_ptr(object, member ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++static zval *_http_message_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ zval *return_value; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ if (type == BP_VAR_W) { ++ zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ ALLOC_ZVAL(return_value); ++#ifdef Z_SET_REFCOUNT ++ Z_SET_REFCOUNT_P(return_value, 0); ++ Z_UNSET_ISREF_P(return_value); ++#else ++ return_value->refcount = 0; ++ return_value->is_ref = 0; ++#endif ++ ++ handler->read(obj, return_value TSRMLS_CC); ++ ++ } else { ++ return_value = zend_get_std_object_handlers()->read_property(object, member, type ZEND_LITERAL_KEY_CC TSRMLS_CC); ++ } ++ ++ return return_value; ++} ++ ++static void _http_message_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ getObjectEx(http_message_object, obj, object); ++ http_message_object_prophandler *handler; ++ ++ if (SUCCESS == http_message_object_get_prophandler(Z_STRVAL_P(member), Z_STRLEN_P(member), &handler)) { ++ handler->write(obj, value TSRMLS_CC); ++ } else { ++ zend_get_std_object_handlers()->write_property(object, member, value ZEND_LITERAL_KEY_CC TSRMLS_CC); ++ } ++} ++ ++static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC) ++{ ++ zval *headers; ++ getObjectEx(http_message_object, obj, object); ++ http_message *msg = obj->message; ++ HashTable *props = OBJ_PROP(obj); ++ zval array, *parent; ++ ++ INIT_ZARR(array, props); ++ ++#define ASSOC_PROP(array, ptype, name, val) \ ++ { \ ++ char *m_prop_name; \ ++ int m_prop_len; \ ++ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ ++ add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+3, val); \ ++ efree(m_prop_name); \ ++ } ++#define ASSOC_STRING(array, name, val) ASSOC_STRINGL(array, name, val, strlen(val)) ++#define ASSOC_STRINGL(array, name, val, len) \ ++ { \ ++ char *m_prop_name; \ ++ int m_prop_len; \ ++ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \ ++ add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+3, val, len, 1); \ ++ efree(m_prop_name); \ ++ } ++ ++ ASSOC_PROP(array, long, "type", msg->type); ++ ASSOC_PROP(array, double, "httpVersion", msg->http.version); ++ ++ switch (msg->type) { ++ case HTTP_MSG_REQUEST: ++ ASSOC_PROP(array, long, "responseCode", 0); ++ ASSOC_STRINGL(array, "responseStatus", "", 0); ++ ASSOC_STRING(array, "requestMethod", STR_PTR(msg->http.info.request.method)); ++ ASSOC_STRING(array, "requestUrl", STR_PTR(msg->http.info.request.url)); ++ break; ++ ++ case HTTP_MSG_RESPONSE: ++ ASSOC_PROP(array, long, "responseCode", msg->http.info.response.code); ++ ASSOC_STRING(array, "responseStatus", STR_PTR(msg->http.info.response.status)); ++ ASSOC_STRINGL(array, "requestMethod", "", 0); ++ ASSOC_STRINGL(array, "requestUrl", "", 0); ++ break; ++ ++ case HTTP_MSG_NONE: ++ default: ++ ASSOC_PROP(array, long, "responseCode", 0); ++ ASSOC_STRINGL(array, "responseStatus", "", 0); ++ ASSOC_STRINGL(array, "requestMethod", "", 0); ++ ASSOC_STRINGL(array, "requestUrl", "", 0); ++ break; ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ASSOC_PROP(array, zval, "headers", headers); ++ ASSOC_STRINGL(array, "body", PHPSTR_VAL(msg), PHPSTR_LEN(msg)); ++ ++ MAKE_STD_ZVAL(parent); ++ if (msg->parent) { ++ ZVAL_OBJVAL(parent, obj->parent, 1); ++ } else { ++ ZVAL_NULL(parent); ++ } ++ ASSOC_PROP(array, zval, "parentMessage", parent); ++ ++ return OBJ_PROP(obj); ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpMessage::__construct([string message]) ++ Create a new HttpMessage object instance. */ ++PHP_METHOD(HttpMessage, __construct) ++{ ++ int length = 0; ++ char *message = NULL; ++ ++ getObject(http_message_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &message, &length) && message && length) { ++ http_message *msg = obj->message; ++ ++ http_message_dtor(msg); ++ if ((obj->message = http_message_parse_ex(msg, message, length))) { ++ if (obj->message->parent) { ++ obj->parent = http_message_object_new_ex(Z_OBJCE_P(getThis()), obj->message->parent, NULL); ++ } ++ } else { ++ obj->message = http_message_init(msg); ++ } ++ } ++ if (!obj->message) { ++ obj->message = http_message_new(); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto static HttpMessage HttpMessage::factory([string raw_message[, string class_name = "HttpMessage"]]) ++ Create a new HttpMessage object instance. */ ++PHP_METHOD(HttpMessage, factory) ++{ ++ char *string = NULL, *cn = NULL; ++ int length = 0, cl = 0; ++ http_message *msg = NULL; ++ zend_object_value ov; ++ http_message_object *obj = NULL; ++ ++ RETVAL_NULL(); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &string, &length, &cn, &cl)) { ++ if (length) { ++ msg = http_message_parse(string, length); ++ } ++ if ((msg || !length) && SUCCESS == http_object_new(&ov, cn, cl, _http_message_object_new_ex, http_message_object_ce, msg, &obj)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ if (obj && !obj->message) { ++ obj->message = http_message_new(); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto static HttpMessage HttpMessage::fromEnv(int type[, string class_name = "HttpMessage"]) ++ Create a new HttpMessage object from environment representing either current request or response */ ++PHP_METHOD(HttpMessage, fromEnv) ++{ ++ char *cn = NULL; ++ int cl = 0; ++ long type; ++ http_message_object *obj = NULL; ++ zend_object_value ov; ++ ++ RETVAL_NULL(); ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &type, &cn, &cl)) { ++ if (SUCCESS == http_object_new(&ov, cn, cl, _http_message_object_new_ex, http_message_object_ce, http_message_init_env(NULL, type), &obj)) { ++ RETVAL_OBJVAL(ov, 0); ++ } ++ if (obj && !obj->message) { ++ obj->message = http_message_new(); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getBody() ++ Get the body of the parsed HttpMessage. */ ++PHP_METHOD(HttpMessage, getBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ RETURN_PHPSTR(&obj->message->body, PHPSTR_FREE_NOT, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setBody(string body) ++ Set the body of the HttpMessage. NOTE: Don't forget to update any headers accordingly. */ ++PHP_METHOD(HttpMessage, setBody) ++{ ++ char *body; ++ int len; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &body, &len)) { ++ phpstr_dtor(PHPSTR(obj->message)); ++ phpstr_from_string_ex(PHPSTR(obj->message), body, len); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getHeader(string header) ++ Get message header. */ ++PHP_METHOD(HttpMessage, getHeader) ++{ ++ zval *header; ++ char *orig_header, *nice_header; ++ int header_len; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &orig_header, &header_len)) { ++ RETURN_FALSE; ++ } ++ ++ nice_header = pretty_key(estrndup(orig_header, header_len), header_len, 1, 1); ++ if ((header = http_message_header_ex(obj->message, nice_header, header_len + 1, 0))) { ++ RETVAL_ZVAL(header, 1, 1); ++ } ++ efree(nice_header); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpMessage::getHeaders() ++ Get Message Headers. */ ++PHP_METHOD(HttpMessage, getHeaders) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ array_init(return_value); ++ array_copy(&obj->message->hdrs, Z_ARRVAL_P(return_value)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setHeaders(array headers) ++ Sets new headers. */ ++PHP_METHOD(HttpMessage, setHeaders) ++{ ++ zval *new_headers = NULL; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", &new_headers)) { ++ return; ++ } ++ ++ zend_hash_clean(&obj->message->hdrs); ++ if (new_headers) { ++ array_copy(Z_ARRVAL_P(new_headers), &obj->message->hdrs); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::addHeaders(array headers[, bool append = false]) ++ Add headers. If append is true, headers with the same name will be separated, else overwritten. */ ++PHP_METHOD(HttpMessage, addHeaders) ++{ ++ zval *new_headers; ++ zend_bool append = 0; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &new_headers, &append)) { ++ return; ++ } ++ ++ array_join(Z_ARRVAL_P(new_headers), &obj->message->hdrs, append, ARRAY_JOIN_STRONLY|ARRAY_JOIN_PRETTIFY); ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::getType() ++ Get Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE) */ ++PHP_METHOD(HttpMessage, getType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ RETURN_LONG(obj->message->type); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::setType(int type) ++ Set Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE) */ ++PHP_METHOD(HttpMessage, setType) ++{ ++ long type; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type)) { ++ return; ++ } ++ http_message_set_type(obj->message, type); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getInfo(void) ++ Get the HTTP request/response line */ ++PHP_METHOD(HttpMessage, getInfo) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ switch (obj->message->type) { ++ case HTTP_MSG_REQUEST: ++ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_REQUEST_FMT_ARGS(&obj->message->http, "")); ++ break; ++ case HTTP_MSG_RESPONSE: ++ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_RESPONSE_FMT_ARGS(&obj->message->http, "")); ++ break; ++ default: ++ RETURN_NULL(); ++ break; ++ } ++ Z_TYPE_P(return_value) = IS_STRING; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setInfo(string http_info) ++ Set type and request or response info with a standard HTTP request or response line */ ++PHP_METHOD(HttpMessage, setInfo) ++{ ++ char *str; ++ int len; ++ http_info inf; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &len) && SUCCESS == http_info_parse_ex(str, &inf, 0)) { ++ getObject(http_message_object, obj); ++ ++ http_message_set_info(obj->message, &inf); ++ http_info_dtor(&inf); ++ RETURN_TRUE; ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::getResponseCode() ++ Get the Response Code of the Message. */ ++PHP_METHOD(HttpMessage, getResponseCode) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ RETURN_LONG(obj->message->http.info.response.code); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setResponseCode(int code) ++ Set the response code of an HTTP Response Message. */ ++PHP_METHOD(HttpMessage, setResponseCode) ++{ ++ long code; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code)) { ++ RETURN_FALSE; ++ } ++ if (code < 100 || code > 599) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid response code (100-599): %ld", code); ++ RETURN_FALSE; ++ } ++ ++ obj->message->http.info.response.code = code; ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getResponseStatus() ++ Get the Response Status of the message (i.e. the string following the response code). */ ++PHP_METHOD(HttpMessage, getResponseStatus) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.response.status) { ++ RETURN_STRING(obj->message->http.info.response.status, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setResponseStatus(string status) ++ Set the Response Status of the HTTP message (i.e. the string following the response code). */ ++PHP_METHOD(HttpMessage, setResponseStatus) ++{ ++ char *status; ++ int status_len; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &status, &status_len)) { ++ RETURN_FALSE; ++ } ++ STR_SET(obj->message->http.info.response.status, estrndup(status, status_len)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getRequestMethod() ++ Get the Request Method of the Message. */ ++PHP_METHOD(HttpMessage, getRequestMethod) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.request.method) { ++ RETURN_STRING(obj->message->http.info.request.method, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setRequestMethod(string method) ++ Set the Request Method of the HTTP Message. */ ++PHP_METHOD(HttpMessage, setRequestMethod) ++{ ++ char *method; ++ int method_len; ++ getObject(http_message_object, obj); ++ ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) { ++ RETURN_FALSE; ++ } ++ if (method_len < 1) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestMethod to an empty string"); ++ RETURN_FALSE; ++ } ++ if (!http_request_method_exists(1, 0, method)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unknown request method: %s", method); ++ RETURN_FALSE; ++ } ++ ++ STR_SET(obj->message->http.info.request.method, estrndup(method, method_len)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getRequestUrl() ++ Get the Request URL of the Message. */ ++PHP_METHOD(HttpMessage, getRequestUrl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (obj->message->http.info.request.url) { ++ RETURN_STRING(obj->message->http.info.request.url, 1); ++ } else { ++ RETURN_EMPTY_STRING(); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setRequestUrl(string url) ++ Set the Request URL of the HTTP Message. */ ++PHP_METHOD(HttpMessage, setRequestUrl) ++{ ++ char *URI; ++ int URIlen; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URI, &URIlen)) { ++ RETURN_FALSE; ++ } ++ HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); ++ if (URIlen < 1) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Cannot set HttpMessage::requestUrl to an empty string"); ++ RETURN_FALSE; ++ } ++ ++ STR_SET(obj->message->http.info.request.url, estrndup(URI, URIlen)); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::getHttpVersion() ++ Get the HTTP Protocol Version of the Message. */ ++PHP_METHOD(HttpMessage, getHttpVersion) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ char *version; ++ getObject(http_message_object, obj); ++ ++ spprintf(&version, 0, "%1.1F", obj->message->http.version); ++ RETURN_STRING(version, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::setHttpVersion(string version) ++ Set the HTTP Protocol version of the Message. */ ++PHP_METHOD(HttpMessage, setHttpVersion) ++{ ++ zval *zv; ++ char *version; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &zv)) { ++ return; ++ } ++ ++ convert_to_double(zv); ++ spprintf(&version, 0, "%1.1F", Z_DVAL_P(zv)); ++ if (strcmp(version, "1.0") && strcmp(version, "1.1")) { ++ efree(version); ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %g", Z_DVAL_P(zv)); ++ RETURN_FALSE; ++ } ++ efree(version); ++ obj->message->http.version = Z_DVAL_P(zv); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME]) ++ Attempts to guess the content type of supplied payload through libmagic. */ ++PHP_METHOD(HttpMessage, guessContentType) ++{ ++#ifdef HTTP_HAVE_MAGIC ++ char *magic_file, *ct = NULL; ++ int magic_file_len; ++ long magic_mode = MAGIC_MIME; ++ ++ RETVAL_FALSE; ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &magic_file, &magic_file_len, &magic_mode)) { ++ getObject(http_message_object, obj); ++ if ((ct = http_guess_content_type(magic_file, magic_mode, PHPSTR_VAL(&obj->message->body), PHPSTR_LEN(&obj->message->body), SEND_DATA))) { ++ RETVAL_STRING(ct, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++#else ++ http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++ RETURN_FALSE; ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::getParentMessage() ++ Get parent Message. */ ++PHP_METHOD(HttpMessage, getParentMessage) ++{ ++ SET_EH_THROW_HTTP(); ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->message->parent) { ++ RETVAL_OBJVAL(obj->parent, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpMessage does not have a parent message"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::send() ++ Send the Message according to its type as Response or Request. */ ++PHP_METHOD(HttpMessage, send) ++{ ++ getObject(http_message_object, obj); ++ ++ NO_ARGS; ++ ++ RETURN_SUCCESS(http_message_send(obj->message)); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::toString([bool include_parent = false]) ++ Get the string representation of the Message. */ ++PHP_METHOD(HttpMessage, toString) ++{ ++ if (return_value_used) { ++ char *string; ++ size_t length; ++ zend_bool include_parent = 0; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &include_parent)) { ++ RETURN_FALSE; ++ } ++ ++ if (include_parent) { ++ http_message_serialize(obj->message, &string, &length); ++ } else { ++ http_message_tostring(obj->message, &string, &length); ++ } ++ RETURN_STRINGL(string, length, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest|HttpResponse HttpMessage::toMessageTypeObject(void) ++ Creates an object regarding to the type of the message. Returns either an HttpRequest or HttpResponse object on success, or NULL on failure. */ ++PHP_METHOD(HttpMessage, toMessageTypeObject) ++{ ++ SET_EH_THROW_HTTP(); ++ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_message_object, obj); ++ ++ switch (obj->message->type) { ++ case HTTP_MSG_REQUEST: ++ { ++#ifdef HTTP_HAVE_CURL ++ int method; ++ char *url; ++ zval post, body, *array, *headers, *host = http_message_header(obj->message, "Host"); ++ php_url hurl, *purl = php_url_parse(STR_PTR(obj->message->http.info.request.url)); ++ ++ MAKE_STD_ZVAL(array); ++ array_init(array); ++ ++ memset(&hurl, 0, sizeof(php_url)); ++ if (host) { ++ hurl.host = Z_STRVAL_P(host); ++ zval_ptr_dtor(&host); ++ } ++ http_build_url(HTTP_URL_REPLACE, purl, &hurl, NULL, &url, NULL); ++ php_url_free(purl); ++ add_assoc_string(array, "url", url, 0); ++ ++ if ( obj->message->http.info.request.method && ++ ((method = http_request_method_exists(1, 0, obj->message->http.info.request.method)) || ++ (method = http_request_method_register(obj->message->http.info.request.method, strlen(obj->message->http.info.request.method))))) { ++ add_assoc_long(array, "method", method); ++ } ++ ++ if (10 == (int) (obj->message->http.version * 10)) { ++ add_assoc_long(array, "protocol", CURL_HTTP_VERSION_1_0); ++ } ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ array_copy(&obj->message->hdrs, Z_ARRVAL_P(headers)); ++ add_assoc_zval(array, "headers", headers); ++ ++ object_init_ex(return_value, http_request_object_ce); ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setoptions", NULL, array); ++ zval_ptr_dtor(&array); ++ ++ if (PHPSTR_VAL(obj->message) && PHPSTR_LEN(obj->message)) { ++ phpstr_fix(PHPSTR(obj->message)); ++ INIT_PZVAL(&body); ++ ZVAL_STRINGL(&body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message), 0); ++ if (method != HTTP_POST) { ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setbody", NULL, &body); ++ } else { ++ INIT_PZVAL(&post); ++ array_init(&post); ++ ++ zval_copy_ctor(&body); ++ sapi_module.treat_data(PARSE_STRING, Z_STRVAL(body), &post TSRMLS_CC); ++ zend_call_method_with_1_params(&return_value, http_request_object_ce, NULL, "setpostfields", NULL, &post); ++ zval_dtor(&post); ++ } ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot transform HttpMessage to HttpRequest (missing curl support)"); ++#endif ++ break; ++ } ++ ++ case HTTP_MSG_RESPONSE: ++ { ++#ifndef WONKY ++ HashPosition pos1, pos2; ++ HashKey key = initHashKey(0); ++ zval **header, **h, *body; ++ ++ if (obj->message->http.info.response.code) { ++ http_send_status(obj->message->http.info.response.code); ++ } ++ ++ object_init_ex(return_value, http_response_object_ce); ++ ++ FOREACH_HASH_KEYVAL(pos1, &obj->message->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ zval *zkey; ++ ++ MAKE_STD_ZVAL(zkey); ++ ZVAL_STRINGL(zkey, key.str, key.len - 1, 1); ++ ++ switch (Z_TYPE_PP(header)) { ++ case IS_ARRAY: ++ case IS_OBJECT: ++ FOREACH_HASH_VAL(pos2, HASH_OF(*header), h) { ++ ZVAL_ADDREF(*h); ++ zend_call_method_with_2_params(&return_value, http_response_object_ce, NULL, "setheader", NULL, zkey, *h); ++ zval_ptr_dtor(h); ++ } ++ break; ++ ++ default: ++ ZVAL_ADDREF(*header); ++ zend_call_method_with_2_params(&return_value, http_response_object_ce, NULL, "setheader", NULL, zkey, *header); ++ zval_ptr_dtor(header); ++ break; ++ } ++ zval_ptr_dtor(&zkey); ++ } ++ } ++ ++ MAKE_STD_ZVAL(body); ++ ZVAL_STRINGL(body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message), 1); ++ zend_call_method_with_1_params(&return_value, http_response_object_ce, NULL, "setdata", NULL, body); ++ zval_ptr_dtor(&body); ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot transform HttpMessage to HttpResponse (need PHP 5.1+)"); ++#endif ++ break; ++ } ++ ++ default: ++ http_error(HE_WARNING, HTTP_E_MESSAGE_TYPE, "HttpMessage is neither of type HttpMessage::TYPE_REQUEST nor HttpMessage::TYPE_RESPONSE"); ++ break; ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::count() ++ Implements Countable::count(). Returns the number of parent messages + 1. */ ++PHP_METHOD(HttpMessage, count) ++{ ++ NO_ARGS { ++ long i; ++ getObject(http_message_object, obj); ++ ++ http_message_count(i, obj->message); ++ RETURN_LONG(i); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpMessage::serialize() ++ Implements Serializable::serialize(). Returns the serialized representation of the HttpMessage. */ ++PHP_METHOD(HttpMessage, serialize) ++{ ++ NO_ARGS { ++ char *string; ++ size_t length; ++ getObject(http_message_object, obj); ++ ++ http_message_serialize(obj->message, &string, &length); ++ RETURN_STRINGL(string, length, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::unserialize(string serialized) ++ Implements Serializable::unserialize(). Re-constructs the HttpMessage based upon the serialized string. */ ++PHP_METHOD(HttpMessage, unserialize) ++{ ++ int length; ++ char *serialized; ++ getObject(http_message_object, obj); ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &serialized, &length)) { ++ http_message *msg; ++ ++ http_message_dtor(obj->message); ++ if ((msg = http_message_parse_ex(obj->message, serialized, (size_t) length))) { ++ obj->message = msg; ++ } else { ++ http_message_init(obj->message); ++ http_error(HE_ERROR, HTTP_E_RUNTIME, "Could not unserialize HttpMessage"); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::detach(void) ++ Returns a clone of an HttpMessage object detached from any parent messages. */ ++PHP_METHOD(HttpMessage, detach) ++{ ++ http_info info; ++ http_message *msg; ++ getObject(http_message_object, obj); ++ ++ NO_ARGS; ++ ++ info.type = obj->message->type; ++ memcpy(&HTTP_INFO(&info), &HTTP_INFO(obj->message), sizeof(struct http_info)); ++ ++ msg = http_message_new(); ++ http_message_set_info(msg, &info); ++ ++ zend_hash_copy(&msg->hdrs, &obj->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ phpstr_append(&msg->body, PHPSTR_VAL(obj->message), PHPSTR_LEN(obj->message)); ++ ++ RETVAL_OBJVAL(http_message_object_new_ex(Z_OBJCE_P(getThis()), msg, NULL), 0); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::prepend(HttpMessage message[, bool top = true]) ++ Prepends message(s) to the HTTP message. Throws HttpInvalidParamException if the message is located within the same message chain. */ ++PHP_METHOD(HttpMessage, prepend) ++{ ++ zval *prepend; ++ zend_bool top = 1; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &prepend, http_message_object_ce, &top)) { ++ http_message *msg[2]; ++ getObject(http_message_object, obj); ++ getObjectEx(http_message_object, prepend_obj, prepend); ++ ++ /* safety check */ ++ for (msg[0] = obj->message; msg[0]; msg[0] = msg[0]->parent) { ++ for (msg[1] = prepend_obj->message; msg[1]; msg[1] = msg[1]->parent) { ++ if (msg[0] == msg[1]) { ++ http_error(HE_THROW, HTTP_E_INVALID_PARAM, "Cannot prepend a message located within the same message chain"); ++ return; ++ } ++ } ++ } ++ ++ http_message_object_prepend_ex(getThis(), prepend, top); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::reverse() ++ Reorders the message chain in reverse order. Returns the most parent HttpMessage object. */ ++PHP_METHOD(HttpMessage, reverse) ++{ ++ NO_ARGS { ++ http_message_object_reverse(getThis(), return_value); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::rewind(void) ++ Implements Iterator::rewind(). */ ++PHP_METHOD(HttpMessage, rewind) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->iterator) { ++ zval_ptr_dtor(&obj->iterator); ++ } ++ ZVAL_ADDREF(getThis()); ++ obj->iterator = getThis(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpMessage::valid(void) ++ Implements Iterator::valid(). */ ++PHP_METHOD(HttpMessage, valid) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ RETURN_BOOL(obj->iterator != NULL); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpMessage::next(void) ++ Implements Iterator::next(). */ ++PHP_METHOD(HttpMessage, next) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ if (obj->iterator) { ++ getObjectEx(http_message_object, itr, obj->iterator); ++ ++ if (itr && itr->parent.handle) { ++ zval *old = obj->iterator; ++ MAKE_STD_ZVAL(obj->iterator); ++ ZVAL_OBJVAL(obj->iterator, itr->parent, 1); ++ zval_ptr_dtor(&old); ++ } else { ++ zval_ptr_dtor(&obj->iterator); ++ obj->iterator = NULL; ++ } ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpMessage::key(void) ++ Implements Iterator::key(). */ ++PHP_METHOD(HttpMessage, key) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ RETURN_LONG(obj->iterator ? obj->iterator->value.obj.handle:0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpMessage::current(void) ++ Implements Iterator::current(). */ ++PHP_METHOD(HttpMessage, current) ++{ ++ NO_ARGS { ++ getObject(http_message_object, obj); ++ ++ if (obj->iterator) { ++ RETURN_ZVAL(obj->iterator, 1, 0); ++ } ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_persistent_handle_api.c +@@ -0,0 +1,388 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_persistent_handle_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++#include "php_http_api.h" ++ ++#include "php_http_persistent_handle_api.h" ++ ++#ifndef HTTP_DEBUG_PHANDLES ++# define HTTP_DEBUG_PHANDLES 0 ++#endif ++#if HTTP_DEBUG_PHANDLES ++# undef inline ++# define inline ++#endif ++ ++static HashTable http_persistent_handles_hash; ++#ifdef ZTS ++# define LOCK() tsrm_mutex_lock(http_persistent_handles_lock) ++# define UNLOCK() tsrm_mutex_unlock(http_persistent_handles_lock) ++static MUTEX_T http_persistent_handles_lock; ++#else ++# define LOCK() ++# define UNLOCK() ++#endif ++ ++typedef struct _http_persistent_handle_list_t { ++ HashTable free; ++ ulong used; ++} http_persistent_handle_list; ++ ++typedef struct _http_persistent_handle_provider_t { ++ http_persistent_handle_list list; /* "ident" => array(handles) entries */ ++ http_persistent_handle_ctor ctor; ++ http_persistent_handle_dtor dtor; ++ http_persistent_handle_copy copy; ++} http_persistent_handle_provider; ++ ++static inline http_persistent_handle_list *http_persistent_handle_list_init(http_persistent_handle_list *list) ++{ ++ int free_list; ++ ++ if ((free_list = !list)) { ++ list = pemalloc(sizeof(http_persistent_handle_list), 1); ++ } ++ ++ list->used = 0; ++ ++ if (SUCCESS != zend_hash_init(&list->free, 0, NULL, NULL, 1)) { ++ if (free_list) { ++ pefree(list, 1); ++ } ++ list = NULL; ++ } ++ ++ return list; ++} ++ ++static inline void http_persistent_handle_list_dtor(http_persistent_handle_list *list, http_persistent_handle_dtor dtor) ++{ ++ HashPosition pos; ++ void **handle; ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTDTOR: %p\n", list); ++#endif ++ FOREACH_HASH_VAL(pos, &list->free, handle) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "DESTROY: %p\n", *handle); ++#endif ++ ++ dtor(*handle); ++ } ++ zend_hash_destroy(&list->free); ++} ++ ++static inline void http_persistent_handle_list_free(http_persistent_handle_list **list, http_persistent_handle_dtor dtor) ++{ ++ http_persistent_handle_list_dtor(*list, dtor); ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFREE: %p\n", *list); ++#endif ++ pefree(*list, 1); ++ *list = NULL; ++} ++ ++static inline http_persistent_handle_list *http_persistent_handle_list_find(http_persistent_handle_provider *provider TSRMLS_DC) ++{ ++ http_persistent_handle_list **list, *new_list; ++ ++ if (SUCCESS == zend_hash_quick_find(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &list)) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFIND: %p\n", *list); ++#endif ++ return *list; ++ } ++ ++ if ((new_list = http_persistent_handle_list_init(NULL))) { ++ if (SUCCESS == zend_hash_quick_add(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &new_list, sizeof(http_persistent_handle_list *), (void *) &list)) { ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "LSTFIND: %p (new)\n", *list); ++#endif ++ return *list; ++ } ++ http_persistent_handle_list_free(&new_list, provider->dtor); ++ } ++ ++ return NULL; ++} ++ ++static inline STATUS http_persistent_handle_do_acquire(http_persistent_handle_provider *provider, void **handle TSRMLS_DC) ++{ ++ ulong index; ++ void **handle_ptr; ++ http_persistent_handle_list *list; ++ ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ zend_hash_internal_pointer_end(&list->free); ++ if (HASH_KEY_NON_EXISTANT != zend_hash_get_current_key(&list->free, NULL, &index, 0) && SUCCESS == zend_hash_get_current_data(&list->free, (void *) &handle_ptr)) { ++ *handle = *handle_ptr; ++ zend_hash_index_del(&list->free, index); ++ } else { ++ *handle = provider->ctor(); ++ } ++ ++ if (*handle) { ++ ++provider->list.used; ++ ++list->used; ++ return SUCCESS; ++ } ++ } else { ++ *handle = NULL; ++ } ++ ++ return FAILURE; ++} ++ ++static inline STATUS http_persistent_handle_do_release(http_persistent_handle_provider *provider, void **handle TSRMLS_DC) ++{ ++ http_persistent_handle_list *list; ++ ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ if (provider->list.used >= HTTP_G->persistent.handles.limit) { ++ provider->dtor(*handle); ++ } else { ++ if (SUCCESS != zend_hash_next_index_insert(&list->free, (void *) handle, sizeof(void *), NULL)) { ++ return FAILURE; ++ } ++ } ++ ++ *handle = NULL; ++ --provider->list.used; ++ --list->used; ++ return SUCCESS; ++ } ++ ++ return FAILURE; ++} ++ ++static inline STATUS http_persistent_handle_do_accrete(http_persistent_handle_provider *provider, void *old_handle, void **new_handle TSRMLS_DC) ++{ ++ http_persistent_handle_list *list; ++ ++ if (provider->copy && (*new_handle = provider->copy(old_handle))) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ ++list->used; ++ } ++ ++provider->list.used; ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++ ++static void http_persistent_handles_hash_dtor(void *p) ++{ ++ http_persistent_handle_provider *provider = (http_persistent_handle_provider *) p; ++ http_persistent_handle_list **list, *list_tmp; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, &provider->list.free, list) { ++ /* fix shutdown crash in PHP4 */ ++ list_tmp = *list; ++ http_persistent_handle_list_free(&list_tmp, provider->dtor); ++ } ++ ++ zend_hash_destroy(&provider->list.free); ++} ++ ++PHP_MINIT_FUNCTION(http_persistent_handle) ++{ ++ zend_hash_init(&http_persistent_handles_hash, 0, NULL, http_persistent_handles_hash_dtor, 1); ++#ifdef ZTS ++ http_persistent_handles_lock = tsrm_mutex_alloc(); ++#endif ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_persistent_handle) ++{ ++ zend_hash_destroy(&http_persistent_handles_hash); ++#ifdef ZTS ++ tsrm_mutex_free(http_persistent_handles_lock); ++#endif ++ return SUCCESS; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_provide_ex(const char *name_str, size_t name_len, http_persistent_handle_ctor ctor, http_persistent_handle_dtor dtor, http_persistent_handle_copy copy) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider provider; ++ ++ LOCK(); ++ if (http_persistent_handle_list_init(&provider.list)) { ++ provider.ctor = ctor; ++ provider.dtor = dtor; ++ provider.copy = copy; ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "PROVIDE: %s\n", name_str); ++#endif ++ ++ if (SUCCESS == zend_hash_add(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider, sizeof(http_persistent_handle_provider), NULL)) { ++ status = SUCCESS; ++ } ++ } ++ UNLOCK(); ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_acquire_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++ ++ *handle = NULL; ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_acquire(provider, handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "ACQUIRE: %p (%s)\n", *handle, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++#if HTTP_DEBUG_PHANDLES ++ void *handle_tmp = *handle; ++#endif ++ ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_release(provider, handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "RELEASE: %p (%s)\n", handle_tmp, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API STATUS _http_persistent_handle_accrete_ex(const char *name_str, size_t name_len, void *old_handle, void **new_handle TSRMLS_DC) ++{ ++ STATUS status = FAILURE; ++ http_persistent_handle_provider *provider; ++ ++ *new_handle = NULL; ++ LOCK(); ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ status = http_persistent_handle_do_accrete(provider, old_handle, new_handle TSRMLS_CC); ++ } ++ UNLOCK(); ++ ++#if HTTP_DEBUG_PHANDLES ++ fprintf(stderr, "ACCRETE: %p > %p (%s)\n", old_handle, *new_handle, name_str); ++#endif ++ ++ return status; ++} ++ ++PHP_HTTP_API void _http_persistent_handle_cleanup_ex(const char *name_str, size_t name_len, int current_ident_only TSRMLS_DC) ++{ ++ http_persistent_handle_provider *provider; ++ http_persistent_handle_list *list, **listp; ++ HashPosition pos1, pos2; ++ ++ LOCK(); ++ if (name_str && name_len) { ++ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) { ++ if (current_ident_only) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ http_persistent_handle_list_dtor(list, provider->dtor); ++ http_persistent_handle_list_init(list); ++ } ++ } else { ++ FOREACH_HASH_VAL(pos1, &provider->list.free, listp) { ++ http_persistent_handle_list_dtor(*listp, provider->dtor); ++ http_persistent_handle_list_init(*listp); ++ } ++ } ++ } ++ } else { ++ FOREACH_HASH_VAL(pos1, &http_persistent_handles_hash, provider) { ++ if (current_ident_only) { ++ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) { ++ http_persistent_handle_list_dtor(list, provider->dtor); ++ http_persistent_handle_list_init(list); ++ } ++ } else { ++ FOREACH_HASH_VAL(pos2, &provider->list.free, listp) { ++ http_persistent_handle_list_dtor(*listp, provider->dtor); ++ http_persistent_handle_list_init(*listp); ++ } ++ } ++ } ++ } ++ UNLOCK(); ++} ++ ++PHP_HTTP_API HashTable *_http_persistent_handle_statall_ex(HashTable *ht TSRMLS_DC) ++{ ++ zval *zentry[2]; ++ HashPosition pos1, pos2; ++ HashKey key1 = initHashKey(0), key2 = initHashKey(0); ++ http_persistent_handle_provider *provider; ++ http_persistent_handle_list **list; ++ ++ LOCK(); ++ if (zend_hash_num_elements(&http_persistent_handles_hash)) { ++ if (!ht) { ++ ALLOC_HASHTABLE(ht); ++ zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &http_persistent_handles_hash, key1, provider) { ++ MAKE_STD_ZVAL(zentry[0]); ++ array_init(zentry[0]); ++ ++ FOREACH_HASH_KEYVAL(pos2, &provider->list.free, key2, list) { ++ MAKE_STD_ZVAL(zentry[1]); ++ array_init(zentry[1]); ++ add_assoc_long_ex(zentry[1], ZEND_STRS("used"), (*list)->used); ++ add_assoc_long_ex(zentry[1], ZEND_STRS("free"), zend_hash_num_elements(&(*list)->free)); ++ ++ /* use zend_hash_* not add_assoc_* (which is zend_symtable_*) as we want a string even for numbers */ ++ zend_hash_add(Z_ARRVAL_P(zentry[0]), key2.str, key2.len, &zentry[1], sizeof(zval *), NULL); ++ } ++ ++ zend_hash_add(ht, key1.str, key1.len, &zentry[0], sizeof(zval *), NULL); ++ } ++ } else if (ht) { ++ ht = NULL; ++ } ++ UNLOCK(); ++ ++ return ht; ++} ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_querystring_api.c +@@ -0,0 +1,220 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_querystring_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#include "php_variables.h" ++#ifdef HTTP_HAVE_ICONV ++# undef PHP_ATOM_INC ++# include "ext/iconv/php_iconv.h" ++# include "ext/standard/url.h" ++#endif ++ ++#include "php_http_api.h" ++#include "php_http_url_api.h" ++#include "php_http_querystring_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++#define THIS_CE http_querystring_object_ce ++extern zend_class_entry *http_querystring_object_ce; ++#endif ++ ++ ++#define http_querystring_modify_array_ex(q, t, k, kl, i, pe) _http_querystring_modify_array_ex((q), (t), (k), (kl), (i), (pe) TSRMLS_CC) ++static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC); ++#define http_querystring_modify_array(q, p) _http_querystring_modify_array((q), (p) TSRMLS_CC) ++static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC); ++ ++ ++#ifdef HTTP_HAVE_ICONV ++PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC) ++{ ++ HashPosition pos; ++ zval **entry = NULL; ++ char *xlate_str = NULL, *xkey; ++ size_t xlate_len = 0, xlen; ++ HashKey key = initHashKey(0); ++ ++ FOREACH_KEYVAL(pos, param, key, entry) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(key.str, key.len-1, &xkey, &xlen, oe, ie)) { ++ http_error_ex(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to convert '%.*s' from '%s' to '%s'", key.len-1, key.str, ie, oe); ++ return FAILURE; ++ } ++ } ++ ++ if (Z_TYPE_PP(entry) == IS_STRING) { ++ if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), &xlate_str, &xlate_len, oe, ie)) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ http_error_ex(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to convert '%.*s' from '%s' to '%s'", Z_STRLEN_PP(entry), Z_STRVAL_PP(entry), ie, oe); ++ return FAILURE; ++ } ++ if (key.type == HASH_KEY_IS_STRING) { ++ add_assoc_stringl_ex(array, xkey, xlen+1, xlate_str, xlate_len, 0); ++ } else { ++ add_index_stringl(array, key.num, xlate_str, xlate_len, 0); ++ } ++ } else if (Z_TYPE_PP(entry) == IS_ARRAY) { ++ zval *subarray; ++ ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ if (key.type == HASH_KEY_IS_STRING) { ++ add_assoc_zval_ex(array, xkey, xlen+1, subarray); ++ } else { ++ add_index_zval(array, key.num, subarray); ++ } ++ if (SUCCESS != http_querystring_xlate(subarray, *entry, ie, oe)) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ return FAILURE; ++ } ++ } ++ ++ if (key.type == HASH_KEY_IS_STRING) { ++ efree(xkey); ++ } ++ } ++ return SUCCESS; ++} ++#endif /* HAVE_ICONV */ ++ ++PHP_HTTP_API void _http_querystring_update(zval *qarray, zval *qstring TSRMLS_DC) ++{ ++ char *s = NULL; ++ size_t l = 0; ++ ++ if (Z_TYPE_P(qarray) != IS_ARRAY) { ++ convert_to_array(qarray); ++ } ++ if (SUCCESS == http_urlencode_hash_ex(Z_ARRVAL_P(qarray), 0, NULL, 0, &s, &l)) { ++ zval_dtor(qstring); ++ ZVAL_STRINGL(qstring, s, l, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Failed to update query string"); ++ } ++} ++ ++PHP_HTTP_API int _http_querystring_modify(zval *qarray, zval *params TSRMLS_DC) ++{ ++ if (Z_TYPE_P(params) == IS_ARRAY) { ++ return http_querystring_modify_array(qarray, params); ++ } else if (Z_TYPE_P(params) == IS_OBJECT) { ++#ifdef ZEND_ENGINE_2 ++ if (instanceof_function(Z_OBJCE_P(params), http_querystring_object_ce TSRMLS_CC)) { ++ return http_querystring_modify_array(qarray, zend_read_property(THIS_CE, params, ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)); ++ } else { ++#endif ++ return http_querystring_modify_array(qarray, params); ++#ifdef ZEND_ENGINE_2 ++ } ++#endif ++ } else { ++ int rv; ++ zval array; ++ zval *qstring = http_zsep(IS_STRING, params); ++ ++ INIT_PZVAL(&array); ++ array_init(&array); ++ ++ sapi_module.treat_data(PARSE_STRING, estrdup(Z_STRVAL_P(qstring)), &array TSRMLS_CC); ++ zval_ptr_dtor(&qstring); ++ ++ rv = http_querystring_modify_array(qarray, &array); ++ zval_dtor(&array); ++ return rv; ++ } ++} ++ ++static inline int _http_querystring_modify_array(zval *qarray, zval *params TSRMLS_DC) ++{ ++ int rv = 0; ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ zval **params_entry = NULL; ++ ++ FOREACH_HASH_KEYVAL(pos, HASH_OF(params), key, params_entry) { ++ /* only public properties */ ++ if ((key.type != HASH_KEY_IS_STRING || *key.str) && http_querystring_modify_array_ex(qarray, key.type, key.str, key.len, key.num, *params_entry)) { ++ rv = 1; ++ } ++ } ++ ++ return rv; ++} ++ ++static inline int _http_querystring_modify_array_ex(zval *qarray, int key_type, char *key, int keylen, ulong idx, zval *params_entry TSRMLS_DC) ++{ ++ zval **qarray_entry; ++ ++ /* ensure array type */ ++ if (Z_TYPE_P(qarray) != IS_ARRAY) { ++ convert_to_array(qarray); ++ } ++ ++ /* delete */ ++ if (Z_TYPE_P(params_entry) == IS_NULL) { ++ if (key_type == HASH_KEY_IS_STRING) { ++ return (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarray), key, keylen)); ++ } else { ++ return (SUCCESS == zend_hash_index_del(Z_ARRVAL_P(qarray), idx)); ++ } ++ } ++ ++ /* update */ ++ if ( ((key_type == HASH_KEY_IS_STRING) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), key, keylen, (void *) &qarray_entry))) || ++ ((key_type == HASH_KEY_IS_LONG) && (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(qarray), idx, (void *) &qarray_entry)))) { ++ zval equal; ++ ++ /* recursive */ ++ if (Z_TYPE_P(params_entry) == IS_ARRAY || Z_TYPE_P(params_entry) == IS_OBJECT) { ++ return http_querystring_modify(*qarray_entry, params_entry); ++ } ++ /* equal */ ++ if ((SUCCESS == is_equal_function(&equal, *qarray_entry, params_entry TSRMLS_CC)) && Z_BVAL(equal)) { ++ return 0; ++ } ++ } ++ ++ /* add */ ++ if (Z_TYPE_P(params_entry) == IS_OBJECT) { ++ zval *new_array; ++ ++ MAKE_STD_ZVAL(new_array); ++ array_init(new_array); ++ http_querystring_modify_array(new_array, params_entry); ++ params_entry = new_array; ++ } else { ++ ZVAL_ADDREF(params_entry); ++ } ++ if (key_type == HASH_KEY_IS_STRING) { ++ add_assoc_zval_ex(qarray, key, keylen, params_entry); ++ } else { ++ add_index_zval(qarray, idx, params_entry); ++ } ++ return 1; ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_querystring_object.c +@@ -0,0 +1,628 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_querystring_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_variables.h" ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_querystring_api.h" ++#include "php_http_querystring_object.h" ++#include "php_http_exception_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpQueryString, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpQueryString, method, 0) ++#define HTTP_QUERYSTRING_ME(method, visibility) PHP_ME(HttpQueryString, method, HTTP_ARGS(HttpQueryString, method), visibility) ++#define HTTP_QUERYSTRING_GME(method, visibility) PHP_ME(HttpQueryString, method, HTTP_ARGS(HttpQueryString, __getter), visibility) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++#ifndef WONKY ++HTTP_BEGIN_ARGS(singleton, 0) ++ HTTP_ARG_VAL(global, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(params, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(toArray); ++HTTP_EMPTY_ARGS(toString); ++ ++HTTP_BEGIN_ARGS(get, 0) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(type, 0) ++ HTTP_ARG_VAL(defval, 0) ++ HTTP_ARG_VAL(delete, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(set, 1) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(mod, 0) ++ HTTP_ARG_VAL(params, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(__getter, 1) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(defval, 0) ++ HTTP_ARG_VAL(delete, 0) ++HTTP_END_ARGS; ++ ++#ifdef HTTP_HAVE_ICONV ++HTTP_BEGIN_ARGS(xlate, 2) ++ HTTP_ARG_VAL(from_encoding, 0) ++ HTTP_ARG_VAL(to_encoding, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_EMPTY_ARGS(serialize); ++HTTP_BEGIN_ARGS(unserialize, 1) ++ HTTP_ARG_VAL(serialized, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetGet, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetSet, 2) ++ HTTP_ARG_VAL(offset, 0) ++ HTTP_ARG_VAL(value, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetExists, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(offsetUnset, 1) ++ HTTP_ARG_VAL(offset, 0) ++HTTP_END_ARGS; ++ ++ ++#define THIS_CE http_querystring_object_ce ++zend_class_entry *http_querystring_object_ce; ++zend_function_entry http_querystring_object_fe[] = { ++ HTTP_QUERYSTRING_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL) ++ ++ HTTP_QUERYSTRING_ME(toArray, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(toString, ZEND_ACC_PUBLIC) ++ ZEND_MALIAS(HttpQueryString, __toString, toString, HTTP_ARGS(HttpQueryString, toString), ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_ME(get, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(set, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(mod, ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_GME(getBool, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getInt, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getFloat, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getString, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getArray, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_GME(getObject, ZEND_ACC_PUBLIC) ++ ++ HTTP_QUERYSTRING_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#ifndef WONKY ++ HTTP_QUERYSTRING_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#endif ++#ifdef HTTP_HAVE_ICONV ++ HTTP_QUERYSTRING_ME(xlate, ZEND_ACC_PUBLIC) ++#endif ++ ++ /* Implements Serializable */ ++ HTTP_QUERYSTRING_ME(serialize, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(unserialize, ZEND_ACC_PUBLIC) ++ ++ /* Implements ArrayAccess */ ++ HTTP_QUERYSTRING_ME(offsetGet, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetSet, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetExists, ZEND_ACC_PUBLIC) ++ HTTP_QUERYSTRING_ME(offsetUnset, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_querystring_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_querystring_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpQueryString, http_querystring_object, NULL, 0); ++ ++#ifndef WONKY ++ zend_class_implements(http_querystring_object_ce TSRMLS_CC, 2, zend_ce_serializable, zend_ce_arrayaccess); ++#endif ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("instance")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("queryArray")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("queryString")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_BOOL")-1, HTTP_QUERYSTRING_TYPE_BOOL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_INT")-1, HTTP_QUERYSTRING_TYPE_INT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_FLOAT")-1, HTTP_QUERYSTRING_TYPE_FLOAT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_STRING")-1, HTTP_QUERYSTRING_TYPE_STRING TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_ARRAY")-1, HTTP_QUERYSTRING_TYPE_ARRAY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("TYPE_OBJECT")-1, HTTP_QUERYSTRING_TYPE_OBJECT TSRMLS_CC); ++#endif ++ ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_BOOL", HTTP_QUERYSTRING_TYPE_BOOL); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_INT", HTTP_QUERYSTRING_TYPE_INT); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_FLOAT", HTTP_QUERYSTRING_TYPE_FLOAT); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_STRING", HTTP_QUERYSTRING_TYPE_STRING); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_ARRAY", HTTP_QUERYSTRING_TYPE_ARRAY); ++ HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_OBJECT", HTTP_QUERYSTRING_TYPE_OBJECT); ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_querystring_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_querystring_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_querystring_object_new_ex(zend_class_entry *ce, void *nothing, http_querystring_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_querystring_object *o; ++ ++ o = ecalloc(1, sizeof(http_querystring_object)); ++ o->zo.ce = ce; ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_querystring_object, o); ++ ov.handlers = &http_querystring_object_handlers; ++ ++ return ov; ++} ++ ++void _http_querystring_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_querystring_object *o = (http_querystring_object *) object; ++ ++ freeObject(o); ++} ++ ++/* {{{ querystring helpers */ ++#define http_querystring_instantiate(t, g, p, u) _http_querystring_instantiate((t), (g), (p), (u) TSRMLS_CC) ++static inline zval *_http_querystring_instantiate(zval *this_ptr, zend_bool global, zval *params, zend_bool defer_update TSRMLS_DC) ++{ ++ zval *qarray = NULL, *qstring = NULL, **_SERVER = NULL, **_GET = NULL, **QUERY_STRING = NULL;; ++ ++ if (!this_ptr) { ++ MAKE_STD_ZVAL(this_ptr); ++ Z_TYPE_P(this_ptr) = IS_OBJECT; ++ this_ptr->value.obj = http_querystring_object_new(http_querystring_object_ce); ++ } ++ if (global) { ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); ++#endif ++ if ( (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &_SERVER)) && ++ (Z_TYPE_PP(_SERVER) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void *) &QUERY_STRING))) { ++ ++ qstring = *QUERY_STRING; ++#ifdef ZEND_ENGINE_2 ++ zend_is_auto_global("_GET", lenof("_GET") TSRMLS_CC); ++#endif ++ if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void *) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) { ++ qarray = *_GET; ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Could not acquire reference to superglobal GET array"); ++ } ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Could not acquire reference to QUERY_STRING"); ++ } ++ ++ if (qarray && qstring) { ++ if (Z_TYPE_P(qstring) != IS_STRING) { ++ convert_to_string(qstring); ++ } ++ ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, qstring TSRMLS_CC); ++#ifdef Z_SET_ISREF ++ Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)); ++ Z_SET_ISREF_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++#else ++ zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)->is_ref = 1; ++ zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)->is_ref = 1; ++#endif ++ ++ if (params) { ++ http_querystring_modify(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), params); ++ } ++ if (!defer_update) { ++ http_querystring_update(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++ } else { ++ MAKE_STD_ZVAL(qarray); ++ array_init(qarray); ++ ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, qarray TSRMLS_CC); ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryString")-1, "", 0 TSRMLS_CC); ++ ++ if (params && http_querystring_modify(qarray, params) && !defer_update) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ ++ zval_ptr_dtor(&qarray); ++ } ++ ++ return this_ptr; ++} ++ ++#define http_querystring_get(o, t, n, l, def, del, r) _http_querystring_get((o), (t), (n), (l), (def), (del), (r) TSRMLS_CC) ++static inline void _http_querystring_get(zval *this_ptr, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value TSRMLS_DC) ++{ ++ zval **arrval, *qarray = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ ++ if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) { ++ if (type) { ++ zval *value = http_zsep(type, *arrval); ++ RETVAL_ZVAL(value, 1, 1); ++ } else { ++ RETVAL_ZVAL(*arrval, 1, 0); ++ } ++ ++ if (del && (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarray), name, name_len + 1))) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } else if(defval) { ++ RETURN_ZVAL(defval, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto final void HttpQueryString::__construct([bool global = true[, mixed add]) ++ Creates a new HttpQueryString object instance. Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE. */ ++PHP_METHOD(HttpQueryString, __construct) ++{ ++ zend_bool global = 1; ++ zval *params = NULL; ++ ++ SET_EH_THROW_HTTP(); ++ if (!sapi_module.treat_data) { ++ http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered"); ++ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, ¶ms)) { ++ http_querystring_instantiate(getThis(), global, params, 0); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpQueryString HttpQueryString::factory([bool global = TRUE[, mixed params[, string class_name = "HttpQueryString"]) ++ Creates a new HttpQueryString object instance. */ ++PHP_METHOD(HttpQueryString, factory) ++{ ++ zend_bool global = 1; ++ zval *params = NULL; ++ char *cn = NULL; ++ int cl = 0; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if (!sapi_module.treat_data) { ++ http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered"); ++ } else if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bzs", &global, ¶ms, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_querystring_object_new_ex, http_querystring_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ http_querystring_instantiate(return_value, global, params, 0); ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto string HttpQueryString::toString() ++ Returns the string representation. */ ++PHP_METHOD(HttpQueryString, toString) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryString); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpQueryString::toArray() ++ Returns the array representation. */ ++PHP_METHOD(HttpQueryString, toArray) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryArray); ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpQueryString::get([string key[, mixed type = 0[, mixed defval = NULL[, bool delete = false]]]]) ++ Get (part of) the query string. The type parameter is either one of the HttpQueryString::TYPE_* constants or a type abbreviation like "b" for bool, "i" for int, "f" for float, "s" for string, "a" for array and "o" for a stdClass object. */ ++PHP_METHOD(HttpQueryString, get) ++{ ++ char *name = NULL; ++ int name_len = 0; ++ long type = 0; ++ zend_bool del = 0; ++ zval *ztype = NULL, *defval = NULL; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szzb", &name, &name_len, &ztype, &defval, &del)) { ++ if (name && name_len) { ++ if (ztype) { ++ if (Z_TYPE_P(ztype) == IS_LONG) { ++ type = Z_LVAL_P(ztype); ++ } else if(Z_TYPE_P(ztype) == IS_STRING) { ++ switch (Z_STRVAL_P(ztype)[0]) { ++ case 'B': ++ case 'b': type = HTTP_QUERYSTRING_TYPE_BOOL; break; ++ case 'I': ++ case 'i': type = HTTP_QUERYSTRING_TYPE_INT; break; ++ case 'F': ++ case 'f': type = HTTP_QUERYSTRING_TYPE_FLOAT; break; ++ case 'S': ++ case 's': type = HTTP_QUERYSTRING_TYPE_STRING; break; ++ case 'A': ++ case 'a': type = HTTP_QUERYSTRING_TYPE_ARRAY; break; ++ case 'O': ++ case 'o': type = HTTP_QUERYSTRING_TYPE_OBJECT; break; ++ } ++ } ++ } ++ http_querystring_get(getThis(), type, name, name_len, defval, del, return_value); ++ } else { ++ RETURN_PROP(queryString); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpQueryString::set(mixed params) ++ Set query string entry/entries. NULL values will unset the variable. */ ++PHP_METHOD(HttpQueryString, set) ++{ ++ zval *params; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶ms)) { ++ zval *qarray = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ if (http_querystring_modify(qarray, params)) { ++ http_querystring_update(qarray, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++ ++ if (return_value_used) { ++ RETURN_PROP(queryString); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpQueryString HttpQueryString::mod(mixed params) ++ Copies the query string object and sets provided params at the clone. */ ++PHP_METHOD(HttpQueryString, mod) ++{ ++ zval *zobj, *qarr, *qstr, *params; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶ms)) { ++ zobj = http_querystring_instantiate(NULL, 0, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), 1); ++ qarr = zend_read_property(THIS_CE, zobj, ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ qstr = zend_read_property(THIS_CE, zobj, ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ ++ http_querystring_modify(qarr, params); ++ http_querystring_update(qarr, qstr); ++ ++ RETURN_ZVAL(zobj, 1, 1); ++ } ++} ++/* }}} */ ++ ++#ifndef WONKY ++/* {{{ proto static HttpQueryString HttpQueryString::singleton([bool global = true]) ++ Get a single instance (differentiates between the global setting). */ ++PHP_METHOD(HttpQueryString, singleton) ++{ ++ zend_bool global = 1; ++ zval *instance = *zend_std_get_static_property(THIS_CE, ZEND_STRS("instance")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &global)) { ++ zval **zobj_ptr = NULL, *zobj = NULL; ++ ++ if (Z_TYPE_P(instance) == IS_ARRAY) { ++ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) { ++ RETVAL_ZVAL(*zobj_ptr, 1, 0); ++ } else { ++ zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ } ++ } else { ++ MAKE_STD_ZVAL(instance); ++ array_init(instance); ++ ++ zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ ++ zend_update_static_property(THIS_CE, ZEND_STRS("instance")-1, instance TSRMLS_CC); ++ zval_ptr_dtor(&instance); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++#endif ++ ++/* {{{ Getters by type */ ++#define HTTP_QUERYSTRING_GETTER(method, TYPE) \ ++PHP_METHOD(HttpQueryString, method) \ ++{ \ ++ char *name; \ ++ int name_len; \ ++ zval *defval = NULL; \ ++ zend_bool del = 0; \ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zb", &name, &name_len, &defval, &del)) { \ ++ http_querystring_get(getThis(), TYPE, name, name_len, defval, del, return_value); \ ++ } \ ++} ++HTTP_QUERYSTRING_GETTER(getBool, IS_BOOL); ++HTTP_QUERYSTRING_GETTER(getInt, IS_LONG); ++HTTP_QUERYSTRING_GETTER(getFloat, IS_DOUBLE); ++HTTP_QUERYSTRING_GETTER(getString, IS_STRING); ++HTTP_QUERYSTRING_GETTER(getArray, IS_ARRAY); ++HTTP_QUERYSTRING_GETTER(getObject, IS_OBJECT); ++/* }}} */ ++ ++#ifdef HTTP_HAVE_ICONV ++/* {{{ proto bool HttpQueryString::xlate(string ie, string oe) ++ Converts the query string from the source encoding ie to the target encoding oe. WARNING: Don't use any character set that can contain NUL bytes like UTF-16. */ ++PHP_METHOD(HttpQueryString, xlate) ++{ ++ char *ie, *oe; ++ int ie_len, oe_len; ++ zval xa, *qa, *qs; ++ STATUS rs; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ie, &ie_len, &oe, &oe_len)) { ++ RETURN_FALSE; ++ } ++ ++ qa = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ qs = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ INIT_PZVAL(&xa); ++ array_init(&xa); ++ ++ if (SUCCESS == (rs = http_querystring_xlate(&xa, qa, ie, oe))) { ++ zend_hash_clean(Z_ARRVAL_P(qa)); ++ zend_hash_copy(Z_ARRVAL_P(qa), Z_ARRVAL(xa), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ http_querystring_update(qa, qs); ++ } ++ zval_dtor(&xa); ++ ++ RETURN_SUCCESS(rs); ++} ++/* }}} */ ++#endif /* HAVE_ICONV */ ++ ++/* {{{ proto string HttpQueryString::serialize() ++ Implements Serializable::serialize(). */ ++PHP_METHOD(HttpQueryString, serialize) ++{ ++ NO_ARGS; ++ RETURN_PROP(queryString); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::unserialize(string serialized) ++ Implements Serializable::unserialize(). */ ++PHP_METHOD(HttpQueryString, unserialize) ++{ ++ zval *serialized; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &serialized)) { ++ if (Z_TYPE_P(serialized) == IS_STRING) { ++ http_querystring_instantiate(getThis(), 0, serialized, 0); ++ } else { ++ http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Expected a string as parameter"); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpQueryString::offsetGet(string offset) ++ Implements ArrayAccess::offsetGet(). */ ++PHP_METHOD(HttpQueryString, offsetGet) ++{ ++ char *offset_str; ++ int offset_len; ++ zval **value; ++ ++ if ( (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)), offset_str, offset_len + 1, (void *) &value))) { ++ RETVAL_ZVAL(*value, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::offsetSet(string offset, mixed value) ++ Implements ArrayAccess::offsetGet(). */ ++PHP_METHOD(HttpQueryString, offsetSet) ++{ ++ char *offset_str; ++ int offset_len; ++ zval *value; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &offset_str, &offset_len, &value)) { ++ zval *qarr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC), *qstr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC); ++ ++ ZVAL_ADDREF(value); ++ add_assoc_zval_ex(qarr, offset_str, offset_len + 1, value); ++ http_querystring_update(qarr, qstr); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpQueryString::offsetExists(string offset) ++ Implements ArrayAccess::offsetExists(). */ ++PHP_METHOD(HttpQueryString, offsetExists) ++{ ++ char *offset_str; ++ int offset_len; ++ zval **value; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) { ++ RETURN_BOOL((SUCCESS == zend_hash_find(Z_ARRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC)), offset_str, offset_len + 1, (void *) &value)) && (Z_TYPE_PP(value) != IS_NULL)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpQueryString::offsetUnset(string offset) ++ Implements ArrayAccess::offsetUnset(). */ ++PHP_METHOD(HttpQueryString, offsetUnset) ++{ ++ char *offset_str; ++ int offset_len; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &offset_str, &offset_len)) { ++ zval *qarr = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryArray")-1, 0 TSRMLS_CC); ++ ++ if (SUCCESS == zend_hash_del(Z_ARRVAL_P(qarr), offset_str, offset_len + 1)) { ++ http_querystring_update(qarr, zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryString")-1, 0 TSRMLS_CC)); ++ } ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_api.c +@@ -0,0 +1,1326 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_api.c 310775 2011-05-05 06:02:50Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_url_api.h" ++ ++#ifdef ZEND_ENGINE_2 ++# include "php_http_request_object.h" ++#endif ++ ++#include "php_http_request_int.h" ++ ++/* {{{ cruft for thread safe SSL crypto locks */ ++#ifdef HTTP_NEED_OPENSSL_TSL ++static MUTEX_T *http_openssl_tsl = NULL; ++ ++static void http_openssl_thread_lock(int mode, int n, const char * file, int line) ++{ ++ if (mode & CRYPTO_LOCK) { ++ tsrm_mutex_lock(http_openssl_tsl[n]); ++ } else { ++ tsrm_mutex_unlock(http_openssl_tsl[n]); ++ } ++} ++ ++static ulong http_openssl_thread_id(void) ++{ ++ return (ulong) tsrm_thread_id(); ++} ++#endif ++#ifdef HTTP_NEED_GNUTLS_TSL ++static int http_gnutls_mutex_create(void **m) ++{ ++ if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) { ++ return SUCCESS; ++ } else { ++ return FAILURE; ++ } ++} ++ ++static int http_gnutls_mutex_destroy(void **m) ++{ ++ tsrm_mutex_free(*((MUTEX_T *) m)); ++ return SUCCESS; ++} ++ ++static int http_gnutls_mutex_lock(void **m) ++{ ++ return tsrm_mutex_lock(*((MUTEX_T *) m)); ++} ++ ++static int http_gnutls_mutex_unlock(void **m) ++{ ++ return tsrm_mutex_unlock(*((MUTEX_T *) m)); ++} ++ ++static struct gcry_thread_cbs http_gnutls_tsl = { ++ GCRY_THREAD_OPTION_USER, ++ NULL, ++ http_gnutls_mutex_create, ++ http_gnutls_mutex_destroy, ++ http_gnutls_mutex_lock, ++ http_gnutls_mutex_unlock ++}; ++#endif ++/* }}} */ ++ ++/* safe curl wrappers */ ++#define init_curl_storage(ch) \ ++ {\ ++ http_request_storage *st = pecalloc(1, sizeof(http_request_storage), 1); \ ++ curl_easy_setopt(ch, CURLOPT_PRIVATE, st); \ ++ curl_easy_setopt(ch, CURLOPT_ERRORBUFFER, st->errorbuffer); \ ++ } ++ ++static void *safe_curl_init(void) ++{ ++ CURL *ch; ++ ++ if ((ch = curl_easy_init())) { ++ init_curl_storage(ch); ++ return ch; ++ } ++ return NULL; ++} ++static void *safe_curl_copy(void *p) ++{ ++ CURL *ch; ++ ++ if ((ch = curl_easy_duphandle(p))) { ++ init_curl_storage(ch); ++ return ch; ++ } ++ return NULL; ++} ++static void safe_curl_dtor(void *p) { ++ http_request_storage *st = http_request_storage_get(p); ++ ++ curl_easy_cleanup(p); ++ ++ if (st) { ++ if (st->url) { ++ pefree(st->url, 1); ++ } ++ if (st->cookiestore) { ++ pefree(st->cookiestore, 1); ++ } ++ pefree(st, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ MINIT */ ++PHP_MINIT_FUNCTION(http_request) ++{ ++#ifdef HTTP_NEED_OPENSSL_TSL ++ /* mod_ssl, libpq or ext/curl might already have set thread lock callbacks */ ++ if (!CRYPTO_get_id_callback()) { ++ int i, c = CRYPTO_num_locks(); ++ ++ http_openssl_tsl = malloc(c * sizeof(MUTEX_T)); ++ ++ for (i = 0; i < c; ++i) { ++ http_openssl_tsl[i] = tsrm_mutex_alloc(); ++ } ++ ++ CRYPTO_set_id_callback(http_openssl_thread_id); ++ CRYPTO_set_locking_callback(http_openssl_thread_lock); ++ } ++#endif ++#ifdef HTTP_NEED_GNUTLS_TSL ++ gcry_control(GCRYCTL_SET_THREAD_CBS, &http_gnutls_tsl); ++#endif ++ ++ if (CURLE_OK != curl_global_init(CURL_GLOBAL_ALL)) { ++ return FAILURE; ++ } ++ ++ if (SUCCESS != http_persistent_handle_provide("http_request", safe_curl_init, safe_curl_dtor, safe_curl_copy)) { ++ return FAILURE; ++ } ++ ++ HTTP_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST); ++#if HTTP_CURL_VERSION(7,19,3) ++ HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST_IE", CURLAUTH_DIGEST_IE); ++#endif ++ HTTP_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_GSSNEG", CURLAUTH_GSSNEGOTIATE); ++ HTTP_LONG_CONSTANT("HTTP_AUTH_ANY", CURLAUTH_ANY); ++ ++ HTTP_LONG_CONSTANT("HTTP_VERSION_NONE", CURL_HTTP_VERSION_NONE); /* to be removed */ ++ HTTP_LONG_CONSTANT("HTTP_VERSION_1_0", CURL_HTTP_VERSION_1_0); ++ HTTP_LONG_CONSTANT("HTTP_VERSION_1_1", CURL_HTTP_VERSION_1_1); ++ HTTP_LONG_CONSTANT("HTTP_VERSION_ANY", CURL_HTTP_VERSION_NONE); ++ ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_TLSv1", CURL_SSLVERSION_TLSv1); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_SSLv2", CURL_SSLVERSION_SSLv2); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_SSLv3", CURL_SSLVERSION_SSLv3); ++ HTTP_LONG_CONSTANT("HTTP_SSL_VERSION_ANY", CURL_SSLVERSION_DEFAULT); ++ ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V4", CURL_IPRESOLVE_V4); ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V6", CURL_IPRESOLVE_V6); ++ HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_ANY", CURL_IPRESOLVE_WHATEVER); ++ ++#if HTTP_CURL_VERSION(7,15,2) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4", CURLPROXY_SOCKS4); ++#endif ++#if HTTP_CURL_VERSION(7,18,0) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4A", CURLPROXY_SOCKS4A); ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5_HOSTNAME", CURLPROXY_SOCKS5_HOSTNAME); ++#endif ++ HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS5", CURLPROXY_SOCKS5); ++ HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP", CURLPROXY_HTTP); ++#if HTTP_CURL_VERSION(7,19,4) ++ HTTP_LONG_CONSTANT("HTTP_PROXY_HTTP_1_0", CURLPROXY_HTTP_1_0); ++#endif ++ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_301", CURL_REDIR_POST_301); ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_302", CURL_REDIR_POST_302); ++ HTTP_LONG_CONSTANT("HTTP_POSTREDIR_ALL", CURL_REDIR_POST_ALL); ++#endif ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ MSHUTDOWN */ ++PHP_MSHUTDOWN_FUNCTION(http_request) ++{ ++ curl_global_cleanup(); ++#ifdef HTTP_NEED_OPENSSL_TSL ++ if (http_openssl_tsl) { ++ int i, c = CRYPTO_num_locks(); ++ ++ CRYPTO_set_id_callback(NULL); ++ CRYPTO_set_locking_callback(NULL); ++ ++ for (i = 0; i < c; ++i) { ++ tsrm_mutex_free(http_openssl_tsl[i]); ++ } ++ ++ free(http_openssl_tsl); ++ http_openssl_tsl = NULL; ++ } ++#endif ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ forward declarations */ ++#define http_request_option(r, o, k, t) _http_request_option_ex((r), (o), (k), sizeof(k), (t) TSRMLS_CC) ++#define http_request_option_ex(r, o, k, l, t) _http_request_option_ex((r), (o), (k), (l), (t) TSRMLS_CC) ++static inline zval *_http_request_option_ex(http_request *request, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC); ++#define http_request_option_cache(r, k, z) _http_request_option_cache_ex((r), (k), sizeof(k), 0, (z) TSRMLS_CC) ++#define http_request_option_cache_ex(r, k, kl, h, z) _http_request_option_cache_ex((r), (k), (kl), (h), (z) TSRMLS_CC) ++static inline zval *_http_request_option_cache_ex(http_request *r, char *key, size_t keylen, ulong h, zval *opt TSRMLS_DC); ++ ++#define http_request_cookies_enabled(r) _http_request_cookies_enabled((r)) ++static inline int _http_request_cookies_enabled(http_request *r); ++ ++static size_t http_curl_read_callback(void *, size_t, size_t, void *); ++static int http_curl_progress_callback(void *, double, double, double, double); ++static int http_curl_raw_callback(CURL *, curl_infotype, char *, size_t, void *); ++static int http_curl_dummy_callback(char *data, size_t n, size_t l, void *s) { return n*l; } ++static curlioerr http_curl_ioctl_callback(CURL *, curliocmd, void *); ++/* }}} */ ++ ++/* {{{ CURL *http_curl_init(http_request *) */ ++PHP_HTTP_API CURL * _http_curl_init_ex(CURL *ch, http_request *request TSRMLS_DC) ++{ ++ if (ch || (SUCCESS == http_persistent_handle_acquire("http_request", &ch))) { ++#if defined(ZTS) ++ curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L); ++#endif ++ curl_easy_setopt(ch, CURLOPT_HEADER, 0L); ++ curl_easy_setopt(ch, CURLOPT_FILETIME, 1L); ++ curl_easy_setopt(ch, CURLOPT_AUTOREFERER, 1L); ++ curl_easy_setopt(ch, CURLOPT_VERBOSE, 1L); ++ curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, NULL); ++ curl_easy_setopt(ch, CURLOPT_DEBUGFUNCTION, http_curl_raw_callback); ++ curl_easy_setopt(ch, CURLOPT_READFUNCTION, http_curl_read_callback); ++ curl_easy_setopt(ch, CURLOPT_IOCTLFUNCTION, http_curl_ioctl_callback); ++ curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, http_curl_dummy_callback); ++ ++ /* set context */ ++ if (request) { ++ curl_easy_setopt(ch, CURLOPT_DEBUGDATA, request); ++ ++ /* attach curl handle */ ++ request->ch = ch; ++ /* set defaults (also in http_request_reset()) */ ++ http_request_defaults(request); ++ } ++ } ++ ++ return ch; ++} ++/* }}} */ ++ ++/* {{{ CURL *http_curl_copy(CURL *) */ ++PHP_HTTP_API CURL *_http_curl_copy(CURL *ch TSRMLS_DC) ++{ ++ CURL *copy; ++ ++ if (SUCCESS == http_persistent_handle_accrete("http_request", ch, ©)) { ++ return copy; ++ } ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ void http_curl_free(CURL **) */ ++PHP_HTTP_API void _http_curl_free(CURL **ch TSRMLS_DC) ++{ ++ if (*ch) { ++ curl_easy_setopt(*ch, CURLOPT_NOPROGRESS, 1L); ++ curl_easy_setopt(*ch, CURLOPT_PROGRESSFUNCTION, NULL); ++ curl_easy_setopt(*ch, CURLOPT_VERBOSE, 0L); ++ curl_easy_setopt(*ch, CURLOPT_DEBUGFUNCTION, NULL); ++ ++ http_persistent_handle_release("http_request", ch); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_request *http_request_init(http_request *) */ ++PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ http_request *r; ++ ++ if (request) { ++ r = request; ++ } else { ++ r = emalloc_rel(sizeof(http_request)); ++ } ++ memset(r, 0, sizeof(http_request)); ++ ++ r->ch = ch; ++ r->url = (url) ? http_absolute_url(url) : NULL; ++ r->meth = (meth > 0) ? meth : HTTP_GET; ++ ++ phpstr_init(&r->conv.request); ++ phpstr_init_ex(&r->conv.response, HTTP_CURLBUF_SIZE, 0); ++ phpstr_init(&r->_cache.cookies); ++ zend_hash_init(&r->_cache.options, 0, NULL, ZVAL_PTR_DTOR, 0); ++ ++ TSRMLS_SET_CTX(r->tsrm_ls); ++ ++ return r; ++} ++/* }}} */ ++ ++/* {{{ void http_request_dtor(http_request *) */ ++PHP_HTTP_API void _http_request_dtor(http_request *request) ++{ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ http_request_reset(request); ++ http_curl_free(&request->ch); ++ ++ phpstr_dtor(&request->_cache.cookies); ++ zend_hash_destroy(&request->_cache.options); ++ if (request->_cache.headers) { ++ curl_slist_free_all(request->_cache.headers); ++ request->_cache.headers = NULL; ++ } ++ if (request->_progress_callback) { ++ zval_ptr_dtor(&request->_progress_callback); ++ request->_progress_callback = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_free(http_request **) */ ++PHP_HTTP_API void _http_request_free(http_request **request) ++{ ++ if (*request) { ++ TSRMLS_FETCH_FROM_CTX((*request)->tsrm_ls); ++ http_request_body_free(&(*request)->body); ++ http_request_dtor(*request); ++ efree(*request); ++ *request = NULL; ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_reset(http_request *) */ ++PHP_HTTP_API void _http_request_reset(http_request *request) ++{ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ STR_SET(request->url, NULL); ++ request->conv.last_type = 0; ++ phpstr_dtor(&request->conv.request); ++ phpstr_dtor(&request->conv.response); ++ http_request_body_dtor(request->body); ++ http_request_defaults(request); ++ ++ if (request->ch) { ++ http_request_storage *st = http_request_storage_get(request->ch); ++ ++ if (st) { ++ if (st->url) { ++ pefree(st->url, 1); ++ st->url = NULL; ++ } ++ if (st->cookiestore) { ++ pefree(st->cookiestore, 1); ++ st->cookiestore = NULL; ++ } ++ st->errorbuffer[0] = '\0'; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_enable_cookies(http_request *) */ ++PHP_HTTP_API STATUS _http_request_enable_cookies(http_request *request) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized && (http_request_cookies_enabled(request) || (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIEFILE, "")))) { ++ return SUCCESS; ++ } ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not enable cookies for this session"); ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_reset_cookies(http_request *, int) */ ++PHP_HTTP_API STATUS _http_request_reset_cookies(http_request *request, int session_only) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized) { ++ if (!http_request_cookies_enabled(request)) { ++ if (SUCCESS != http_request_enable_cookies(request)) { ++ return FAILURE; ++ } ++ } ++ if (session_only) { ++#if HTTP_CURL_VERSION(7,15,4) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "SESS")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not reset session cookies (need libcurl >= v7.15.4)"); ++#endif ++ } else { ++#if HTTP_CURL_VERSION(7,14,1) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "ALL")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not reset cookies (need libcurl >= v7.14.1)"); ++#endif ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++PHP_HTTP_API STATUS _http_request_flush_cookies(http_request *request) ++{ ++ int initialized = 1; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0); ++ if (initialized) { ++ if (!http_request_cookies_enabled(request)) { ++ return FAILURE; ++ } ++#if HTTP_CURL_VERSION(7,17,1) ++ if (CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "FLUSH")) { ++ return SUCCESS; ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not flush cookies (need libcurl >= v7.17.1)"); ++#endif ++ } ++ return FAILURE; ++} ++ ++/* {{{ void http_request_defaults(http_request *) */ ++PHP_HTTP_API void _http_request_defaults(http_request *request) ++{ ++ if (request->ch) { ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, NULL); ++ HTTP_CURL_OPT(CURLOPT_URL, NULL); ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 1L); ++#if HTTP_CURL_VERSION(7,19,4) ++ HTTP_CURL_OPT(CURLOPT_NOPROXY, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_PROXY, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROXYPORT, 0L); ++ HTTP_CURL_OPT(CURLOPT_PROXYTYPE, 0L); ++ /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_PROXYUSERNAME, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROXYPASSWORD, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 0L); ++ HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, 60L); ++ HTTP_CURL_OPT(CURLOPT_IPRESOLVE, 0); ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L); ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, 0L); ++#if HTTP_CURL_VERSION(7,15,5) ++ /* LFS weirdance ++ HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) 0); ++ HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) 0); ++ */ ++#endif ++ /* crashes ++ HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, 5L); */ ++ HTTP_CURL_OPT(CURLOPT_FRESH_CONNECT, 0L); ++ HTTP_CURL_OPT(CURLOPT_FORBID_REUSE, 0L); ++ HTTP_CURL_OPT(CURLOPT_INTERFACE, NULL); ++ HTTP_CURL_OPT(CURLOPT_PORT, 0L); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, 0L); ++#endif ++#if HTTP_CURL_VERSION(7,15,2) ++ HTTP_CURL_OPT(CURLOPT_LOCALPORT, 0L); ++ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, 0L); ++#endif ++ /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_USERNAME, NULL); ++ HTTP_CURL_OPT(CURLOPT_PASSWORD, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_HTTPAUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_ENCODING, NULL); ++#if HTTP_CURL_VERSION(7,16,2) ++ /* we do this ourself anyway */ ++ HTTP_CURL_OPT(CURLOPT_HTTP_CONTENT_DECODING, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTP_TRANSFER_DECODING, 0L); ++#endif ++ HTTP_CURL_OPT(CURLOPT_FOLLOWLOCATION, 0L); ++#if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_POSTREDIR, 0L); ++#elif HTTP_CURL_VERSION(7,17,1) ++ HTTP_CURL_OPT(CURLOPT_POST301, 0L); ++#endif ++ HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, 0L); ++ HTTP_CURL_OPT(CURLOPT_REFERER, NULL); ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, "PECL::HTTP/" PHP_HTTP_VERSION " (PHP/" PHP_VERSION ")"); ++ HTTP_CURL_OPT(CURLOPT_HTTPHEADER, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIE, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIESESSION, 0L); ++ /* these options would enable curl's cookie engine by default which we don't want ++ HTTP_CURL_OPT(CURLOPT_COOKIEFILE, NULL); ++ HTTP_CURL_OPT(CURLOPT_COOKIEJAR, NULL); */ ++#if HTTP_CURL_VERSION(7,14,1) ++ HTTP_CURL_OPT(CURLOPT_COOKIELIST, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_RANGE, NULL); ++ HTTP_CURL_OPT(CURLOPT_RESUME_FROM, 0L); ++ HTTP_CURL_OPT(CURLOPT_MAXFILESIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, 0L); ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT, 0L); ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT, 3); ++ HTTP_CURL_OPT(CURLOPT_SSLCERT, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLCERTTYPE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLCERTPASSWD, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEY, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEYTYPE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLKEYPASSWD, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLENGINE, NULL); ++ HTTP_CURL_OPT(CURLOPT_SSLVERSION, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_VERIFYPEER, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_VERIFYHOST, 0L); ++ HTTP_CURL_OPT(CURLOPT_SSL_CIPHER_LIST, NULL); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT(CURLOPT_ISSUERCERT, NULL); ++ #if defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT(CURLOPT_CRLFILE, NULL); ++ #endif ++#endif ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT(CURLOPT_CERTINFO, NULL); ++#endif ++#ifdef HTTP_CURL_CAINFO ++ HTTP_CURL_OPT(CURLOPT_CAINFO, HTTP_CURL_CAINFO); ++#else ++ HTTP_CURL_OPT(CURLOPT_CAINFO, NULL); ++#endif ++ HTTP_CURL_OPT(CURLOPT_CAPATH, NULL); ++ HTTP_CURL_OPT(CURLOPT_RANDOM_FILE, NULL); ++ HTTP_CURL_OPT(CURLOPT_EGDSOCKET, NULL); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDS, NULL); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDSIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPPOST, NULL); ++ HTTP_CURL_OPT(CURLOPT_IOCTLDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_READDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_INFILESIZE, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_NONE); ++ HTTP_CURL_OPT(CURLOPT_CUSTOMREQUEST, NULL); ++ HTTP_CURL_OPT(CURLOPT_NOBODY, 0L); ++ HTTP_CURL_OPT(CURLOPT_POST, 0L); ++ HTTP_CURL_OPT(CURLOPT_UPLOAD, 0L); ++ HTTP_CURL_OPT(CURLOPT_HTTPGET, 1L); ++ } ++} ++/* }}} */ ++ ++PHP_HTTP_API void _http_request_set_progress_callback(http_request *request, zval *cb) ++{ ++ if (request->_progress_callback) { ++ zval_ptr_dtor(&request->_progress_callback); ++ } ++ if ((request->_progress_callback = cb)) { ++ ZVAL_ADDREF(cb); ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 0); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSDATA, request); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, http_curl_progress_callback); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_NOPROGRESS, 1); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSDATA, NULL); ++ HTTP_CURL_OPT(CURLOPT_PROGRESSFUNCTION, NULL); ++ } ++} ++ ++/* {{{ STATUS http_request_prepare(http_request *, HashTable *) */ ++PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options) ++{ ++ zval *zoption; ++ zend_bool range_req = 0; ++ http_request_storage *storage; ++ ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init(request), return FAILURE); ++ ++ if (!request->url) { ++ return FAILURE; ++ } ++ if (!(storage = http_request_storage_get(request->ch))) { ++ return FAILURE; ++ } ++ storage->errorbuffer[0] = '\0'; ++ /* set options */ ++ if (storage->url) { ++ pefree(storage->url, 1); ++ } ++ storage->url = pestrdup(request->url, 1); ++ HTTP_CURL_OPT(CURLOPT_URL, storage->url); ++ ++ /* progress callback */ ++ if ((zoption = http_request_option(request, options, "onprogress", -1))) { ++ http_request_set_progress_callback(request, zoption); ++ } ++ ++ /* proxy */ ++ if ((zoption = http_request_option(request, options, "proxyhost", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_PROXY, Z_STRVAL_P(zoption)); ++ /* type */ ++ if ((zoption = http_request_option(request, options, "proxytype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYTYPE, Z_LVAL_P(zoption)); ++ } ++ /* port */ ++ if ((zoption = http_request_option(request, options, "proxyport", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYPORT, Z_LVAL_P(zoption)); ++ } ++ /* user:pass */ ++ if ((zoption = http_request_option(request, options, "proxyauth", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_PROXYUSERPWD, Z_STRVAL_P(zoption)); ++ } ++ /* auth method */ ++ if ((zoption = http_request_option(request, options, "proxyauthtype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PROXYAUTH, Z_LVAL_P(zoption)); ++ } ++ /* tunnel */ ++ if ((zoption = http_request_option(request, options, "proxytunnel", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 1L); ++ } ++ } ++#if HTTP_CURL_VERSION(7,19,4) ++ if ((zoption = http_request_option(request, options, "noproxy", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_NOPROXY, Z_STRVAL_P(zoption)); ++ } ++#endif ++ ++ /* dns */ ++ if ((zoption = http_request_option(request, options, "dns_cache_timeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "ipresolve", IS_LONG)) && Z_LVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_IPRESOLVE, Z_LVAL_P(zoption)); ++ } ++ ++ /* limits */ ++ if ((zoption = http_request_option(request, options, "low_speed_limit", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "low_speed_time", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, Z_LVAL_P(zoption)); ++ } ++#if HTTP_CURL_VERSION(7,15,5) ++ /* LSF weirdance ++ if ((zoption = http_request_option(request, options, "max_send_speed", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "max_recv_speed", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption)); ++ } ++ */ ++#endif ++ /* crashes ++ if ((zoption = http_request_option(request, options, "maxconnects", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, Z_LVAL_P(zoption)); ++ } */ ++ if ((zoption = http_request_option(request, options, "fresh_connect", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_FRESH_CONNECT, 1L); ++ } ++ if ((zoption = http_request_option(request, options, "forbid_reuse", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_FORBID_REUSE, 1L); ++ } ++ ++ /* outgoing interface */ ++ if ((zoption = http_request_option(request, options, "interface", IS_STRING))) { ++ HTTP_CURL_OPT(CURLOPT_INTERFACE, Z_STRVAL_P(zoption)); ++ ++#if HTTP_CURL_VERSION(7,15,2) ++ if ((zoption = http_request_option(request, options, "portrange", IS_ARRAY))) { ++ zval **prs, **pre; ++ ++ zend_hash_internal_pointer_reset(Z_ARRVAL_P(zoption)); ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &prs)) { ++ zend_hash_move_forward(Z_ARRVAL_P(zoption)); ++ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &pre)) { ++ zval *prs_cpy = http_zsep(IS_LONG, *prs); ++ zval *pre_cpy = http_zsep(IS_LONG, *pre); ++ ++ if (Z_LVAL_P(prs_cpy) && Z_LVAL_P(pre_cpy)) { ++ HTTP_CURL_OPT(CURLOPT_LOCALPORT, MIN(Z_LVAL_P(prs_cpy), Z_LVAL_P(pre_cpy))); ++ HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, labs(Z_LVAL_P(prs_cpy)-Z_LVAL_P(pre_cpy))+1L); ++ } ++ zval_ptr_dtor(&prs_cpy); ++ zval_ptr_dtor(&pre_cpy); ++ } ++ } ++ } ++#endif ++ } ++ ++ /* another port */ ++ if ((zoption = http_request_option(request, options, "port", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_PORT, Z_LVAL_P(zoption)); ++ } ++ ++ /* RFC4007 zone_id */ ++#if HTTP_CURL_VERSION(7,19,0) ++ if ((zoption = http_request_option(request, options, "address_scope", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, Z_LVAL_P(zoption)); ++ } ++#endif ++ ++ /* auth */ ++ if ((zoption = http_request_option(request, options, "httpauth", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_USERPWD, Z_STRVAL_P(zoption)); ++ } ++ if ((zoption = http_request_option(request, options, "httpauthtype", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_HTTPAUTH, Z_LVAL_P(zoption)); ++ } ++ ++ /* redirects, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "redirect", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_FOLLOWLOCATION, Z_LVAL_P(zoption) ? 1L : 0L); ++ HTTP_CURL_OPT(CURLOPT_MAXREDIRS, Z_LVAL_P(zoption)); ++ if ((zoption = http_request_option(request, options, "unrestrictedauth", IS_BOOL))) { ++ HTTP_CURL_OPT(CURLOPT_UNRESTRICTED_AUTH, Z_LVAL_P(zoption)); ++ } ++#if HTTP_CURL_VERSION(7,17,1) ++ if ((zoption = http_request_option(request, options, "postredir", IS_BOOL))) { ++# if HTTP_CURL_VERSION(7,19,1) ++ HTTP_CURL_OPT(CURLOPT_POSTREDIR, Z_BVAL_P(zoption) ? 1L : 0L); ++# else ++ HTTP_CURL_OPT(CURLOPT_POST301, Z_BVAL_P(zoption) ? 1L : 0L); ++# endif ++ } ++#endif ++ } ++ ++ /* retries, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "retrycount", IS_LONG))) { ++ request->_retry.count = Z_LVAL_P(zoption); ++ if ((zoption = http_request_option(request, options, "retrydelay", IS_DOUBLE))) { ++ request->_retry.delay = Z_DVAL_P(zoption); ++ } else { ++ request->_retry.delay = 0; ++ } ++ } else { ++ request->_retry.count = 0; ++ } ++ ++ /* referer */ ++ if ((zoption = http_request_option(request, options, "referer", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_REFERER, Z_STRVAL_P(zoption)); ++ } ++ ++ /* useragent, default "PECL::HTTP/version (PHP/version)" */ ++ if ((zoption = http_request_option(request, options, "useragent", IS_STRING))) { ++ /* allow to send no user agent, not even default one */ ++ if (Z_STRLEN_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, Z_STRVAL_P(zoption)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_USERAGENT, NULL); ++ } ++ } ++ ++ /* resume */ ++ if ((zoption = http_request_option(request, options, "resume", IS_LONG)) && (Z_LVAL_P(zoption) > 0)) { ++ range_req = 1; ++ HTTP_CURL_OPT(CURLOPT_RESUME_FROM, Z_LVAL_P(zoption)); ++ } ++ /* or range of kind array(array(0,499), array(100,1499)) */ ++ else if ((zoption = http_request_option(request, options, "range", IS_ARRAY)) && zend_hash_num_elements(Z_ARRVAL_P(zoption))) { ++ HashPosition pos1, pos2; ++ zval **rr, **rb, **re; ++ phpstr rs; ++ ++ phpstr_init(&rs); ++ FOREACH_VAL(pos1, zoption, rr) { ++ if (Z_TYPE_PP(rr) == IS_ARRAY) { ++ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(rr), &pos2); ++ if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &rb, &pos2)) { ++ zend_hash_move_forward_ex(Z_ARRVAL_PP(rr), &pos2); ++ if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &re, &pos2)) { ++ if ( ((Z_TYPE_PP(rb) == IS_LONG) || ((Z_TYPE_PP(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(rb), Z_STRLEN_PP(rb), NULL, NULL, 1))) && ++ ((Z_TYPE_PP(re) == IS_LONG) || ((Z_TYPE_PP(re) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(re), Z_STRLEN_PP(re), NULL, NULL, 1)))) { ++ zval *rbl = http_zsep(IS_LONG, *rb); ++ zval *rel = http_zsep(IS_LONG, *re); ++ ++ if ((Z_LVAL_P(rbl) >= 0) && (Z_LVAL_P(rel) >= 0)) { ++ phpstr_appendf(&rs, "%ld-%ld,", Z_LVAL_P(rbl), Z_LVAL_P(rel)); ++ } ++ zval_ptr_dtor(&rbl); ++ zval_ptr_dtor(&rel); ++ } ++ } ++ } ++ } ++ } ++ ++ if (PHPSTR_LEN(&rs)) { ++ zval *cached_range; ++ ++ /* ditch last comma */ ++ PHPSTR_VAL(&rs)[PHPSTR_LEN(&rs)-- -1] = '\0'; ++ /* cache string */ ++ MAKE_STD_ZVAL(cached_range); ++ ZVAL_STRINGL(cached_range, PHPSTR_VAL(&rs), PHPSTR_LEN(&rs), 0); ++ HTTP_CURL_OPT(CURLOPT_RANGE, Z_STRVAL_P(http_request_option_cache(request, "range", cached_range))); ++ zval_ptr_dtor(&cached_range); ++ } ++ } ++ ++ /* additional headers, array('name' => 'value') */ ++ if (request->_cache.headers) { ++ curl_slist_free_all(request->_cache.headers); ++ request->_cache.headers = NULL; ++ } ++ if ((zoption = http_request_option(request, options, "headers", IS_ARRAY))) { ++ HashKey header_key = initHashKey(0); ++ zval **header_val; ++ HashPosition pos; ++ phpstr header; ++ ++ phpstr_init(&header); ++ FOREACH_KEYVAL(pos, zoption, header_key, header_val) { ++ if (header_key.type == HASH_KEY_IS_STRING) { ++ zval *header_cpy = http_zsep(IS_STRING, *header_val); ++ ++ if (!strcasecmp(header_key.str, "range")) { ++ range_req = 1; ++ } ++ ++ phpstr_appendf(&header, "%s: %s", header_key.str, Z_STRVAL_P(header_cpy)); ++ phpstr_fix(&header); ++ request->_cache.headers = curl_slist_append(request->_cache.headers, PHPSTR_VAL(&header)); ++ phpstr_reset(&header); ++ ++ zval_ptr_dtor(&header_cpy); ++ } ++ } ++ phpstr_dtor(&header); ++ } ++ /* etag */ ++ if ((zoption = http_request_option(request, options, "etag", IS_STRING)) && Z_STRLEN_P(zoption)) { ++ zend_bool is_quoted = !((Z_STRVAL_P(zoption)[0] != '"') || (Z_STRVAL_P(zoption)[Z_STRLEN_P(zoption)-1] != '"')); ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, is_quoted?"%s: %s":"%s: \"%s\"", range_req?"If-Match":"If-None-Match", Z_STRVAL_P(zoption)); ++ phpstr_fix(&header); ++ request->_cache.headers = curl_slist_append(request->_cache.headers, PHPSTR_VAL(&header)); ++ phpstr_dtor(&header); ++ } ++ /* compression */ ++ if ((zoption = http_request_option(request, options, "compress", IS_BOOL)) && Z_LVAL_P(zoption)) { ++ request->_cache.headers = curl_slist_append(request->_cache.headers, "Accept-Encoding: gzip;q=1.0,deflate;q=0.5"); ++ } ++ HTTP_CURL_OPT(CURLOPT_HTTPHEADER, request->_cache.headers); ++ ++ /* lastmodified */ ++ if ((zoption = http_request_option(request, options, "lastmodified", IS_LONG))) { ++ if (Z_LVAL_P(zoption)) { ++ if (Z_LVAL_P(zoption) > 0) { ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, Z_LVAL_P(zoption)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_TIMEVALUE, (long) HTTP_G->request.time + Z_LVAL_P(zoption)); ++ } ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, (long) (range_req ? CURL_TIMECOND_IFUNMODSINCE : CURL_TIMECOND_IFMODSINCE)); ++ } else { ++ HTTP_CURL_OPT(CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE); ++ } ++ } ++ ++ /* cookies, array('name' => 'value') */ ++ if ((zoption = http_request_option(request, options, "cookies", IS_ARRAY))) { ++ phpstr_dtor(&request->_cache.cookies); ++ if (zend_hash_num_elements(Z_ARRVAL_P(zoption))) { ++ zval *urlenc_cookies = NULL; ++ /* check whether cookies should not be urlencoded; default is to urlencode them */ ++ if ((!(urlenc_cookies = http_request_option(request, options, "encodecookies", IS_BOOL))) || Z_BVAL_P(urlenc_cookies)) { ++ if (SUCCESS == http_urlencode_hash_recursive(HASH_OF(zoption), &request->_cache.cookies, "; ", lenof("; "), NULL, 0)) { ++ phpstr_fix(&request->_cache.cookies); ++ HTTP_CURL_OPT(CURLOPT_COOKIE, request->_cache.cookies.data); ++ } ++ } else { ++ HashPosition pos; ++ HashKey cookie_key = initHashKey(0); ++ zval **cookie_val; ++ ++ FOREACH_KEYVAL(pos, zoption, cookie_key, cookie_val) { ++ if (cookie_key.type == HASH_KEY_IS_STRING) { ++ zval *val = http_zsep(IS_STRING, *cookie_val); ++ phpstr_appendf(&request->_cache.cookies, "%s=%s; ", cookie_key.str, Z_STRVAL_P(val)); ++ zval_ptr_dtor(&val); ++ } ++ } ++ ++ phpstr_fix(&request->_cache.cookies); ++ if (PHPSTR_LEN(&request->_cache.cookies)) { ++ HTTP_CURL_OPT(CURLOPT_COOKIE, PHPSTR_VAL(&request->_cache.cookies)); ++ } ++ } ++ } ++ } ++ ++ /* don't load session cookies from cookiestore */ ++ if ((zoption = http_request_option(request, options, "cookiesession", IS_BOOL)) && Z_BVAL_P(zoption)) { ++ HTTP_CURL_OPT(CURLOPT_COOKIESESSION, 1L); ++ } ++ ++ /* cookiestore, read initial cookies from that file and store cookies back into that file */ ++ if ((zoption = http_request_option(request, options, "cookiestore", IS_STRING))) { ++ if (Z_STRLEN_P(zoption)) { ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(zoption), return FAILURE); ++ } ++ if (storage->cookiestore) { ++ pefree(storage->cookiestore, 1); ++ } ++ storage->cookiestore = pestrndup(Z_STRVAL_P(zoption), Z_STRLEN_P(zoption), 1); ++ HTTP_CURL_OPT(CURLOPT_COOKIEFILE, storage->cookiestore); ++ HTTP_CURL_OPT(CURLOPT_COOKIEJAR, storage->cookiestore); ++ } ++ ++ /* maxfilesize */ ++ if ((zoption = http_request_option(request, options, "maxfilesize", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_MAXFILESIZE, Z_LVAL_P(zoption)); ++ } ++ ++ /* http protocol */ ++ if ((zoption = http_request_option(request, options, "protocol", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_HTTP_VERSION, Z_LVAL_P(zoption)); ++ } ++ ++#if HTTP_CURL_VERSION(7,16,2) ++ /* timeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "timeout", IS_DOUBLE))) { ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT_MS, (long)(Z_DVAL_P(zoption)*1000)); ++ } ++ /* connecttimeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "connecttimeout", IS_DOUBLE))) { ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT_MS, (long)(Z_DVAL_P(zoption)*1000)); ++ } ++#else ++ /* timeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "timeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_TIMEOUT, Z_LVAL_P(zoption)); ++ } ++ /* connecttimeout, defaults to 0 */ ++ if ((zoption = http_request_option(request, options, "connecttimeout", IS_LONG))) { ++ HTTP_CURL_OPT(CURLOPT_CONNECTTIMEOUT, Z_LVAL_P(zoption)); ++ } ++#endif ++ ++ /* ssl */ ++ if ((zoption = http_request_option(request, options, "ssl", IS_ARRAY))) { ++ HashKey key = initHashKey(0); ++ zval **param; ++ HashPosition pos; ++ ++ FOREACH_KEYVAL(pos, zoption, key, param) { ++ if (key.type == HASH_KEY_IS_STRING) { ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERT, 0, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERTTYPE, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLCERTPASSWD, 0, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEY, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEYTYPE, 0, 0); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLKEYPASSWD, 0, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_SSLENGINE, 0, 0); ++ HTTP_CURL_OPT_LONG(CURLOPT_SSLVERSION, 0); ++ ++ HTTP_CURL_OPT_LONG(CURLOPT_SSL_VERIFYPEER, 1); ++ HTTP_CURL_OPT_LONG(CURLOPT_SSL_VERIFYHOST, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_SSL_CIPHER_LIST, 1, 0); ++ ++ HTTP_CURL_OPT_STRING(CURLOPT_CAINFO, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_CAPATH, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_RANDOM_FILE, -3, 1); ++ HTTP_CURL_OPT_STRING(CURLOPT_EGDSOCKET, -3, 1); ++#if HTTP_CURL_VERSION(7,19,0) ++ HTTP_CURL_OPT_STRING(CURLOPT_ISSUERCERT, -3, 1); ++ #if defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT_STRING(CURLOPT_CRLFILE, -3, 1); ++ #endif ++#endif ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ HTTP_CURL_OPT_LONG(CURLOPT_CERTINFO, -3); ++#endif ++ } ++ } ++ } ++ ++ /* request method */ ++ switch (request->meth) { ++ case HTTP_GET: ++ HTTP_CURL_OPT(CURLOPT_HTTPGET, 1L); ++ break; ++ ++ case HTTP_HEAD: ++ HTTP_CURL_OPT(CURLOPT_NOBODY, 1L); ++ break; ++ ++ case HTTP_POST: ++ HTTP_CURL_OPT(CURLOPT_POST, 1L); ++ break; ++ ++ case HTTP_PUT: ++ HTTP_CURL_OPT(CURLOPT_UPLOAD, 1L); ++ break; ++ ++ default: ++ if (http_request_method_exists(0, request->meth, NULL)) { ++ HTTP_CURL_OPT(CURLOPT_CUSTOMREQUEST, http_request_method_name(request->meth)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Unsupported request method: %d (%s)", request->meth, request->url); ++ return FAILURE; ++ } ++ break; ++ } ++ ++ /* attach request body */ ++ if (request->body && (request->meth != HTTP_GET) && (request->meth != HTTP_HEAD) && (request->meth != HTTP_OPTIONS)) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_EMPTY: ++ /* nothing */ ++ break; ++ ++ case HTTP_REQUEST_BODY_CURLPOST: ++ HTTP_CURL_OPT(CURLOPT_HTTPPOST, (struct curl_httppost *) request->body->data); ++ break; ++ ++ case HTTP_REQUEST_BODY_CSTRING: ++ if (request->meth != HTTP_PUT) { ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDS, request->body->data); ++ HTTP_CURL_OPT(CURLOPT_POSTFIELDSIZE, request->body->size); ++ break; ++ } ++ /* fallthrough, PUT/UPLOAD _needs_ READDATA */ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ HTTP_CURL_OPT(CURLOPT_IOCTLDATA, request); ++ HTTP_CURL_OPT(CURLOPT_READDATA, request); ++ HTTP_CURL_OPT(CURLOPT_INFILESIZE, request->body->size); ++ break; ++ ++ default: ++ /* shouldn't ever happen */ ++ http_error_ex(HE_ERROR, 0, "Unknown request body type: %d (%s)", request->body->type, request->url); ++ return FAILURE; ++ } ++ } ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_request_exec(http_request *) */ ++PHP_HTTP_API void _http_request_exec(http_request *request) ++{ ++ uint tries = 0; ++ CURLcode result; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++retry: ++ if (CURLE_OK != (result = curl_easy_perform(request->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(result), http_request_storage_get(request->ch)->errorbuffer, request->url); ++#ifdef ZEND_ENGINE_2 ++ if ((HTTP_G->only_exceptions || GLOBAL_ERROR_HANDLING == EH_THROW) && EG(exception)) { ++ add_property_long(EG(exception), "curlCode", result); ++ } ++#endif ++ ++ if (request->_retry.count > tries++) { ++ switch (result) { ++ case CURLE_COULDNT_RESOLVE_PROXY: ++ case CURLE_COULDNT_RESOLVE_HOST: ++ case CURLE_COULDNT_CONNECT: ++ case CURLE_WRITE_ERROR: ++ case CURLE_READ_ERROR: ++ case CURLE_OPERATION_TIMEDOUT: ++ case CURLE_SSL_CONNECT_ERROR: ++ case CURLE_GOT_NOTHING: ++ case CURLE_SSL_ENGINE_SETFAILED: ++ case CURLE_SEND_ERROR: ++ case CURLE_RECV_ERROR: ++ case CURLE_SSL_ENGINE_INITFAILED: ++ case CURLE_LOGIN_DENIED: ++ if (request->_retry.delay >= HTTP_DIFFSEC) { ++ http_sleep(request->_retry.delay); ++ } ++ goto retry; ++ default: ++ break; ++ } ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ static size_t http_curl_read_callback(void *, size_t, size_t, void *) */ ++static size_t http_curl_read_callback(void *data, size_t len, size_t n, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ if (request->body) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ { ++ size_t out = MIN(len * n, request->body->size - request->body->priv); ++ ++ if (out) { ++ memcpy(data, ((char *) request->body->data) + request->body->priv, out); ++ request->body->priv += out; ++ return out; ++ } ++ break; ++ } ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ return php_stream_read((php_stream *) request->body->data, data, len * n); ++ } ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static int http_curl_progress_callback(void *, double, double, double, double) */ ++static int http_curl_progress_callback(void *ctx, double dltotal, double dlnow, double ultotal, double ulnow) ++{ ++ zval *param, retval; ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ INIT_PZVAL(&retval); ++ ZVAL_NULL(&retval); ++ ++ MAKE_STD_ZVAL(param); ++ array_init(param); ++ add_assoc_double(param, "dltotal", dltotal); ++ add_assoc_double(param, "dlnow", dlnow); ++ add_assoc_double(param, "ultotal", ultotal); ++ add_assoc_double(param, "ulnow", ulnow); ++ ++ with_error_handling(EH_NORMAL, NULL) { ++ request->_in_progress_cb = 1; ++ call_user_function(EG(function_table), NULL, request->_progress_callback, &retval, 1, ¶m TSRMLS_CC); ++ request->_in_progress_cb = 0; ++ } end_error_handling(); ++ ++ zval_ptr_dtor(¶m); ++ zval_dtor(&retval); ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static curlioerr http_curl_ioctl_callback(CURL *, curliocmd, void *) */ ++static curlioerr http_curl_ioctl_callback(CURL *ch, curliocmd cmd, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); ++ ++ if (cmd != CURLIOCMD_RESTARTREAD) { ++ return CURLIOE_UNKNOWNCMD; ++ } ++ ++ if (request->body) { ++ switch (request->body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ request->body->priv = 0; ++ return CURLIOE_OK; ++ break; ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ if (SUCCESS == php_stream_rewind((php_stream *) request->body->data)) { ++ return CURLIOE_OK; ++ } ++ break; ++ } ++ } ++ ++ return CURLIOE_FAILRESTART; ++} ++/* }}} */ ++ ++/* {{{ static int http_curl_raw_callback(CURL *, curl_infotype, char *, size_t, void *) */ ++static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size_t length, void *ctx) ++{ ++ http_request *request = (http_request *) ctx; ++ ++#define EMPTY_HEADER(d, l) (!l || (l == 1 && d[0] == '\n') || (l == 2 && d[0] == '\r' && d[1] == '\n')) ++ switch (type) { ++ case CURLINFO_DATA_IN: ++ if (request->conv.last_type == CURLINFO_HEADER_IN) { ++ phpstr_appends(&request->conv.response, HTTP_CRLF); ++ } ++ phpstr_append(&request->conv.response, data, length); ++ break; ++ case CURLINFO_HEADER_IN: ++ if (!EMPTY_HEADER(data, length)) { ++ phpstr_append(&request->conv.response, data, length); ++ } ++ break; ++ case CURLINFO_DATA_OUT: ++ case CURLINFO_HEADER_OUT: ++ phpstr_append(&request->conv.request, data, length); ++ break; ++ default: ++ break; ++ } ++ ++#if 0 ++ { ++ const char _sym[] = "><><><"; ++ if (type) { ++ for (fprintf(stderr, "%c ", _sym[type-1]); length--; data++) { ++ fprintf(stderr, HTTP_IS_CTYPE(print, *data)?"%c":"\\x%02X", (int) *data); ++ if (*data == '\n' && length) { ++ fprintf(stderr, "\n%c ", _sym[type-1]); ++ } ++ } ++ fprintf(stderr, "\n"); ++ } else { ++ fprintf(stderr, "# %s", data); ++ } ++ } ++#endif ++ ++ if (type) { ++ request->conv.last_type = type; ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static inline zval *http_request_option(http_request *, HashTable *, char *, size_t, int) */ ++static inline zval *_http_request_option_ex(http_request *r, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC) ++{ ++ if (options) { ++ zval **zoption; ++ ulong h = zend_hash_func(key, keylen); ++ ++ if (SUCCESS == zend_hash_quick_find(options, key, keylen, h, (void *) &zoption)) { ++ zval *option, *cached; ++ ++ option = http_zsep(type, *zoption); ++ cached = http_request_option_cache_ex(r, key, keylen, h, option); ++ ++ zval_ptr_dtor(&option); ++ return cached; ++ } ++ } ++ ++ return NULL; ++} ++/* }}} */ ++ ++/* {{{ static inline zval *http_request_option_cache(http_request *, char *key, zval *) */ ++static inline zval *_http_request_option_cache_ex(http_request *r, char *key, size_t keylen, ulong h, zval *opt TSRMLS_DC) ++{ ++ ZVAL_ADDREF(opt); ++ ++ if (h) { ++ zend_hash_quick_update(&r->_cache.options, key, keylen, h, &opt, sizeof(zval *), NULL); ++ } else { ++ zend_hash_update(&r->_cache.options, key, keylen, &opt, sizeof(zval *), NULL); ++ } ++ ++ return opt; ++} ++/* }}} */ ++ ++/* {{{ static inline int http_request_cookies_enabled(http_request *) */ ++static inline int _http_request_cookies_enabled(http_request *request) { ++ http_request_storage *st; ++ ++ if (request->ch && (st = http_request_storage_get(request->ch)) && st->cookiestore) { ++ /* cookies are enabled */ ++ return 1; ++ } ++ return 0; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_body_api.c +@@ -0,0 +1,332 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_body_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_api.h" ++#include "php_http_url_api.h" ++#include "php_http_request_body_api.h" ++ ++/* {{{ */ ++typedef struct curl_httppost *post_data[2]; ++static STATUS recursive_fields(post_data http_post_data, HashTable *fields, const char *prefix TSRMLS_DC); ++static STATUS recursive_files(post_data http_post_data, HashTable *files, const char *prefix TSRMLS_DC); ++/* }}} */ ++ ++/* {{{ http_request_body *http_request_body_new() */ ++PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void *data, size_t size, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (!body) { ++ body = emalloc_rel(sizeof(http_request_body)); ++ } ++ ++ body->type = type; ++ body->free = free; ++ body->priv = 0; ++ body->data = data; ++ body->size = size; ++ ++ return body; ++} ++/* }}} */ ++ ++/* {{{ http_request_body *http_request_body_fill(http_request_body *body, HashTable *, HashTable *) */ ++PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, HashTable *fields, HashTable *files ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC) ++{ ++ if (files && (zend_hash_num_elements(files) > 0)) { ++ struct curl_httppost *http_post_data[2] = {NULL, NULL}; ++ ++ if (fields && SUCCESS != recursive_fields(http_post_data, fields, NULL TSRMLS_CC)) { ++ return NULL; ++ } ++ if (SUCCESS != recursive_files(http_post_data, files, NULL TSRMLS_CC)) { ++ return NULL; ++ } ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CURLPOST, http_post_data[0], 0, 1); ++ } else if (fields) { ++ char *encoded; ++ size_t encoded_len; ++ ++ if (SUCCESS != http_urlencode_hash_ex(fields, 1, NULL, 0, &encoded, &encoded_len)) { ++ http_error(HE_WARNING, HTTP_E_ENCODING, "Could not encode post data"); ++ return NULL; ++ } ++ ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CSTRING, encoded, encoded_len, 1); ++ } else { ++ return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CSTRING, estrndup("", 0), 0, 1); ++ } ++} ++ ++/* STATUS http_request_body_encode(http_request_body *, char**, size_t *) */ ++PHP_HTTP_API STATUS _http_request_body_encode(http_request_body *body, char **buf, size_t *len TSRMLS_DC) ++{ ++ switch (body->type) { ++ case HTTP_REQUEST_BODY_CURLPOST: ++ { ++#ifdef HAVE_CURL_FORMGET ++ phpstr str; ++ ++ phpstr_init_ex(&str, 0x8000, 0); ++ if (curl_formget(body->data, &str, (curl_formget_callback) phpstr_append)) { ++ phpstr_dtor(&str); ++ } else { ++ phpstr_fix(&str); ++ *buf = PHPSTR_VAL(&str); ++ *len = PHPSTR_LEN(&str); ++ return SUCCESS; ++ } ++#endif ++ break; ++ } ++ ++ case HTTP_REQUEST_BODY_CSTRING: ++ *buf = estrndup(body->data, *len = body->size); ++ return SUCCESS; ++ ++ default: ++ break; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_request_body_dtor(http_request_body *) */ ++PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC) ++{ ++ if (body) { ++ if (body->free) { ++ switch (body->type) { ++ case HTTP_REQUEST_BODY_CSTRING: ++ if (body->data) { ++ efree(body->data); ++ } ++ break; ++ ++ case HTTP_REQUEST_BODY_CURLPOST: ++ curl_formfree(body->data); ++ break; ++ ++ case HTTP_REQUEST_BODY_UPLOADFILE: ++ php_stream_close(body->data); ++ break; ++ } ++ } ++ memset(body, 0, sizeof(http_request_body)); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_body_free(http_request_body *) */ ++PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC) ++{ ++ if (*body) { ++ http_request_body_dtor(*body); ++ efree(*body); ++ *body = NULL; ++ } ++} ++/* }}} */ ++ ++static inline char *format_key(uint type, char *str, ulong num, const char *prefix, int numeric_key_for_empty_prefix) { ++ char *new_key = NULL; ++ ++ if (prefix && *prefix) { ++ if (type == HASH_KEY_IS_STRING) { ++ spprintf(&new_key, 0, "%s[%s]", prefix, str); ++ } else { ++ spprintf(&new_key, 0, "%s[%lu]", prefix, num); ++ } ++ } else if (type == HASH_KEY_IS_STRING) { ++ new_key = estrdup(str); ++ } else if (numeric_key_for_empty_prefix) { ++ spprintf(&new_key, 0, "%lu", num); ++ } ++ ++ return new_key; ++} ++ ++/* {{{ static STATUS recursive_fields(post_data d, HashTable *f, const char *p TSRMLS_DC) */ ++static STATUS recursive_fields(post_data http_post_data, HashTable *fields, const char *prefix TSRMLS_DC) { ++ HashKey key = initHashKey(0); ++ zval **data_ptr; ++ HashPosition pos; ++ char *new_key = NULL; ++ CURLcode err = 0; ++ ++ if (fields && !fields->nApplyCount) { ++ FOREACH_HASH_KEYVAL(pos, fields, key, data_ptr) { ++ if (key.type != HASH_KEY_IS_STRING || *key.str) { ++ new_key = format_key(key.type, key.str, key.num, prefix, 1); ++ ++ switch (Z_TYPE_PP(data_ptr)) { ++ case IS_ARRAY: ++ case IS_OBJECT: { ++ STATUS status; ++ ++ ++fields->nApplyCount; ++ status = recursive_fields(http_post_data, HASH_OF(*data_ptr), new_key TSRMLS_CC); ++ --fields->nApplyCount; ++ ++ if (SUCCESS != status) { ++ goto error; ++ } ++ break; ++ } ++ ++ default: { ++ zval *data = http_zsep(IS_STRING, *data_ptr); ++ ++ err = curl_formadd(&http_post_data[0], &http_post_data[1], ++ CURLFORM_COPYNAME, new_key, ++ CURLFORM_COPYCONTENTS, Z_STRVAL_P(data), ++ CURLFORM_CONTENTSLENGTH, (long) Z_STRLEN_P(data), ++ CURLFORM_END ++ ); ++ ++ zval_ptr_dtor(&data); ++ ++ if (CURLE_OK != err) { ++ goto error; ++ } ++ break; ++ } ++ } ++ STR_FREE(new_key); ++ } ++ } ++ } ++ ++ return SUCCESS; ++ ++error: ++ if (new_key) { ++ efree(new_key); ++ } ++ if (http_post_data[0]) { ++ curl_formfree(http_post_data[0]); ++ } ++ if (err) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post fields: %s", curl_easy_strerror(err)); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post fields: unknown error"); ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ static STATUS recursive_files(post_data d, HashTable *f, const char *p TSRMLS_DC) */ ++static STATUS recursive_files(post_data http_post_data, HashTable *files, const char *prefix TSRMLS_DC) { ++ HashKey key = initHashKey(0); ++ zval **data_ptr; ++ HashPosition pos; ++ char *new_key = NULL; ++ CURLcode err = 0; ++ ++ if (files && !files->nApplyCount) { ++ FOREACH_HASH_KEYVAL(pos, files, key, data_ptr) { ++ zval **file_ptr, **type_ptr, **name_ptr; ++ ++ if (key.type != HASH_KEY_IS_STRING || *key.str) { ++ new_key = format_key(key.type, key.str, key.num, prefix, 0); ++ ++ if (Z_TYPE_PP(data_ptr) != IS_ARRAY && Z_TYPE_PP(data_ptr) != IS_OBJECT) { ++ if (new_key || key.type == HASH_KEY_IS_STRING) { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Unrecognized type of post file array entry '%s'", new_key ? new_key : key.str); ++ } else { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Unrecognized type of post file array entry '%lu'", key.num); ++ } ++ } else if ( SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "name", sizeof("name"), (void *) &name_ptr) || ++ SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "type", sizeof("type"), (void *) &type_ptr) || ++ SUCCESS != zend_hash_find(HASH_OF(*data_ptr), "file", sizeof("file"), (void *) &file_ptr)) { ++ STATUS status; ++ ++ ++files->nApplyCount; ++ status = recursive_files(http_post_data, HASH_OF(*data_ptr), new_key TSRMLS_CC); ++ --files->nApplyCount; ++ ++ if (SUCCESS != status) { ++ goto error; ++ } ++ } else { ++ const char *path; ++ zval *file = http_zsep(IS_STRING, *file_ptr); ++ zval *type = http_zsep(IS_STRING, *type_ptr); ++ zval *name = http_zsep(IS_STRING, *name_ptr); ++ ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(file), goto error); ++ ++ /* this is blatant but should be sufficient for most cases */ ++ if (strncasecmp(Z_STRVAL_P(file), "file://", lenof("file://"))) { ++ path = Z_STRVAL_P(file); ++ } else { ++ path = Z_STRVAL_P(file) + lenof("file://"); ++ } ++ ++ if (new_key) { ++ char *tmp_key = format_key(HASH_KEY_IS_STRING, Z_STRVAL_P(name), 0, new_key, 0); ++ STR_SET(new_key, tmp_key); ++ } ++ ++ err = curl_formadd(&http_post_data[0], &http_post_data[1], ++ CURLFORM_COPYNAME, new_key ? new_key : Z_STRVAL_P(name), ++ CURLFORM_FILE, path, ++ CURLFORM_CONTENTTYPE, Z_STRVAL_P(type), ++ CURLFORM_END ++ ); ++ ++ zval_ptr_dtor(&file); ++ zval_ptr_dtor(&type); ++ zval_ptr_dtor(&name); ++ ++ if (CURLE_OK != err) { ++ goto error; ++ } ++ } ++ STR_FREE(new_key); ++ } ++ } ++ } ++ ++ return SUCCESS; ++ ++error: ++ if (new_key) { ++ efree(new_key); ++ } ++ if (http_post_data[0]) { ++ curl_formfree(http_post_data[0]); ++ } ++ if (err) { ++ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not encode post files: %s", curl_easy_strerror(err)); ++ } else { ++ http_error(HE_WARNING, HTTP_E_ENCODING, "Could not encode post files: unknown error"); ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_request_datashare_api.c +@@ -0,0 +1,288 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_datashare_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "php_http_api.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++ ++static HashTable http_request_datashare_options; ++static http_request_datashare http_request_datashare_global; ++static int http_request_datashare_compare_handles(void *h1, void *h2); ++static void http_request_datashare_destroy_handles(void *el); ++#ifdef ZTS ++static void *http_request_datashare_locks_init(void); ++static void http_request_datashare_locks_dtor(void *l); ++static void http_request_datashare_lock_func(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr); ++static void http_request_datashare_unlock_func(CURL *handle, curl_lock_data data, void *userptr); ++#endif ++ ++http_request_datashare *_http_request_datashare_global_get(void) ++{ ++ return &http_request_datashare_global; ++} ++ ++PHP_MINIT_FUNCTION(http_request_datashare) ++{ ++ curl_lock_data val; ++ ++ if (SUCCESS != http_persistent_handle_provide("http_request_datashare", curl_share_init, (http_persistent_handle_dtor) curl_share_cleanup, NULL)) { ++ return FAILURE; ++ } ++#ifdef ZTS ++ if (SUCCESS != http_persistent_handle_provide("http_request_datashare_lock", http_request_datashare_locks_init, http_request_datashare_locks_dtor, NULL)) { ++ return FAILURE; ++ } ++#endif ++ ++ if (!http_request_datashare_init_ex(&http_request_datashare_global, 1)) { ++ return FAILURE; ++ } ++ ++ zend_hash_init(&http_request_datashare_options, 4, NULL, NULL, 1); ++#define ADD_DATASHARE_OPT(name, opt) \ ++ val = opt; \ ++ zend_hash_add(&http_request_datashare_options, name, sizeof(name), &val, sizeof(curl_lock_data), NULL) ++ ADD_DATASHARE_OPT("cookie", CURL_LOCK_DATA_COOKIE); ++ ADD_DATASHARE_OPT("dns", CURL_LOCK_DATA_DNS); ++ ADD_DATASHARE_OPT("ssl", CURL_LOCK_DATA_SSL_SESSION); ++ ADD_DATASHARE_OPT("connect", CURL_LOCK_DATA_CONNECT); ++ ++ return SUCCESS; ++} ++ ++PHP_MSHUTDOWN_FUNCTION(http_request_datashare) ++{ ++ http_request_datashare_dtor(&http_request_datashare_global); ++ zend_hash_destroy(&http_request_datashare_options); ++ ++ return SUCCESS; ++} ++ ++PHP_RINIT_FUNCTION(http_request_datashare) ++{ ++ zend_llist_init(&HTTP_G->request.datashare.handles, sizeof(zval *), http_request_datashare_destroy_handles, 0); ++ ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_request_datashare) ++{ ++ zend_llist_destroy(&HTTP_G->request.datashare.handles); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API http_request_datashare *_http_request_datashare_init_ex(http_request_datashare *share, zend_bool persistent TSRMLS_DC) ++{ ++ zend_bool free_share; ++ ++ if ((free_share = !share)) { ++ share = pemalloc(sizeof(http_request_datashare), persistent); ++ } ++ memset(share, 0, sizeof(http_request_datashare)); ++ ++ if (SUCCESS != http_persistent_handle_acquire("http_request_datashare", &share->ch)) { ++ if (free_share) { ++ pefree(share, persistent); ++ } ++ return NULL; ++ } ++ ++ if (!(share->persistent = persistent)) { ++ share->handle.list = emalloc(sizeof(zend_llist)); ++ zend_llist_init(share->handle.list, sizeof(zval *), ZVAL_PTR_DTOR, 0); ++#ifdef ZTS ++ } else { ++ if (SUCCESS == http_persistent_handle_acquire("http_request_datashare_lock", (void *) &share->handle.locks)) { ++ curl_share_setopt(share->ch, CURLSHOPT_LOCKFUNC, http_request_datashare_lock_func); ++ curl_share_setopt(share->ch, CURLSHOPT_UNLOCKFUNC, http_request_datashare_unlock_func); ++ curl_share_setopt(share->ch, CURLSHOPT_USERDATA, share->handle.locks); ++ } ++#endif ++ } ++ ++ return share; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_attach(http_request_datashare *share, zval *request TSRMLS_DC) ++{ ++ CURLcode rc; ++ getObjectEx(http_request_object, obj, request); ++ ++ if (obj->share) { ++ if (obj->share == share) { ++ return SUCCESS; ++ } else if (SUCCESS != http_request_datashare_detach(obj->share, request)) { ++ return FAILURE; ++ } ++ } ++ ++ HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init_ex(obj->request->ch, obj->request), return FAILURE); ++ if (CURLE_OK != (rc = curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, share->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not attach HttpRequest object(#%d) to the HttpRequestDataShare: %s", Z_OBJ_HANDLE_P(request), curl_easy_strerror(rc)); ++ return FAILURE; ++ } ++ ++ obj->share = share; ++ ZVAL_ADDREF(request); ++ zend_llist_add_element(HTTP_RSHARE_HANDLES(share), (void *) &request); ++ ++ return SUCCESS; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_detach(http_request_datashare *share, zval *request TSRMLS_DC) ++{ ++ CURLcode rc; ++ getObjectEx(http_request_object, obj, request); ++ ++ if (!obj->share) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "HttpRequest object(#%d) is not attached to any HttpRequestDataShare", Z_OBJ_HANDLE_P(request)); ++ } else if (obj->share != share) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "HttpRequest object(#%d) is not attached to this HttpRequestDataShare", Z_OBJ_HANDLE_P(request)); ++ } else if (CURLE_OK != (rc = curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, NULL))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not detach HttpRequest object(#%d) from the HttpRequestDataShare: %s", Z_OBJ_HANDLE_P(request), curl_share_strerror(rc)); ++ } else { ++ obj->share = NULL; ++ zend_llist_del_element(HTTP_RSHARE_HANDLES(share), request, http_request_datashare_compare_handles); ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++ ++PHP_HTTP_API void _http_request_datashare_detach_all(http_request_datashare *share TSRMLS_DC) ++{ ++ zval **r; ++ ++ while ((r = zend_llist_get_first(HTTP_RSHARE_HANDLES(share)))) { ++ http_request_datashare_detach(share, *r); ++ } ++} ++ ++PHP_HTTP_API void _http_request_datashare_dtor(http_request_datashare *share TSRMLS_DC) ++{ ++ if (!share->persistent) { ++ zend_llist_destroy(share->handle.list); ++ efree(share->handle.list); ++ } ++ http_persistent_handle_release("http_request_datashare", &share->ch); ++#ifdef ZTS ++ if (share->persistent) { ++ http_persistent_handle_release("http_request_datashare_lock", (void *) &share->handle.locks); ++ } ++#endif ++} ++ ++PHP_HTTP_API void _http_request_datashare_free(http_request_datashare **share TSRMLS_DC) ++{ ++ http_request_datashare_dtor(*share); ++ pefree(*share, (*share)->persistent); ++ *share = NULL; ++} ++ ++PHP_HTTP_API STATUS _http_request_datashare_set(http_request_datashare *share, const char *option, size_t option_len, zend_bool enable TSRMLS_DC) ++{ ++ curl_lock_data *opt; ++ CURLSHcode rc; ++ ++ if (SUCCESS == zend_hash_find(&http_request_datashare_options, (char *) option, option_len + 1, (void *) &opt)) { ++ if (CURLSHE_OK == (rc = curl_share_setopt(share->ch, enable ? CURLSHOPT_SHARE : CURLSHOPT_UNSHARE, *opt))) { ++ return SUCCESS; ++ } ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not %s sharing of %s data: %s", enable ? "enable" : "disable", option, curl_share_strerror(rc)); ++ } ++ return FAILURE; ++} ++ ++static int http_request_datashare_compare_handles(void *h1, void *h2) ++{ ++ return (Z_OBJ_HANDLE_PP((zval **) h1) == Z_OBJ_HANDLE_P((zval *) h2)); ++} ++ ++static void http_request_datashare_destroy_handles(void *el) ++{ ++ zval **r = (zval **) el; ++ TSRMLS_FETCH(); ++ ++ { /* gcc 2.95 needs these braces */ ++ getObjectEx(http_request_object, obj, *r); ++ ++ curl_easy_setopt(obj->request->ch, CURLOPT_SHARE, NULL); ++ zval_ptr_dtor(r); ++ } ++} ++ ++#ifdef ZTS ++static void *http_request_datashare_locks_init(void) ++{ ++ int i; ++ http_request_datashare_lock *locks = pecalloc(CURL_LOCK_DATA_LAST, sizeof(http_request_datashare_lock), 1); ++ ++ if (locks) { ++ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) { ++ locks[i].mx = tsrm_mutex_alloc(); ++ } ++ } ++ ++ return locks; ++} ++ ++static void http_request_datashare_locks_dtor(void *l) ++{ ++ int i; ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) l; ++ ++ for (i = 0; i < CURL_LOCK_DATA_LAST; ++i) { ++ tsrm_mutex_free(locks[i].mx); ++ } ++ pefree(locks, 1); ++} ++ ++static void http_request_datashare_lock_func(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr) ++{ ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) userptr; ++ ++ /* TSRM can't distinguish shared/exclusive locks */ ++ tsrm_mutex_lock(locks[data].mx); ++ locks[data].ch = handle; ++} ++ ++static void http_request_datashare_unlock_func(CURL *handle, curl_lock_data data, void *userptr) ++{ ++ http_request_datashare_lock *locks = (http_request_datashare_lock *) userptr; ++ ++ if (locks[data].ch == handle) { ++ tsrm_mutex_unlock(locks[data].mx); ++ } ++} ++#endif ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_info.c +@@ -0,0 +1,198 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_info.c 293136 2010-01-05 08:48:52Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#ifdef HTTP_HAVE_CURL ++#include "php_http_request_api.h" ++ ++/* {{{ void http_request_info(http_request *, HashTable *) */ ++PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info) ++{ ++ char *c; ++ long l; ++ double d; ++ struct curl_slist *s, *p; ++ zval *subarray, array; ++ INIT_ZARR(array, info); ++ ++ /* BEGIN */ ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_EFFECTIVE_URL, &c)) { ++ add_assoc_string_ex(&array, "effective_url", sizeof("effective_url"), c ? c : "", 1); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_RESPONSE_CODE, &l)) { ++ add_assoc_long_ex(&array, "response_code", sizeof("response_code"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_TOTAL_TIME, &d)) { ++ add_assoc_double_ex(&array, "total_time", sizeof("total_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_NAMELOOKUP_TIME, &d)) { ++ add_assoc_double_ex(&array, "namelookup_time", sizeof("namelookup_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONNECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "connect_time", sizeof("connect_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRETRANSFER_TIME, &d)) { ++ add_assoc_double_ex(&array, "pretransfer_time", sizeof("pretransfer_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SIZE_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "size_upload", sizeof("size_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SIZE_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "size_download", sizeof("size_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SPEED_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "speed_download", sizeof("speed_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SPEED_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "speed_upload", sizeof("speed_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HEADER_SIZE, &l)) { ++ add_assoc_long_ex(&array, "header_size", sizeof("header_size"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REQUEST_SIZE, &l)) { ++ add_assoc_long_ex(&array, "request_size", sizeof("request_size"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SSL_VERIFYRESULT, &l)) { ++ add_assoc_long_ex(&array, "ssl_verifyresult", sizeof("ssl_verifyresult"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_FILETIME, &l)) { ++ add_assoc_long_ex(&array, "filetime", sizeof("filetime"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d)) { ++ add_assoc_double_ex(&array, "content_length_download", sizeof("content_length_download"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_LENGTH_UPLOAD, &d)) { ++ add_assoc_double_ex(&array, "content_length_upload", sizeof("content_length_upload"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_STARTTRANSFER_TIME, &d)) { ++ add_assoc_double_ex(&array, "starttransfer_time", sizeof("starttransfer_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONTENT_TYPE, &c)) { ++ add_assoc_string_ex(&array, "content_type", sizeof("content_type"), c ? c : "", 1); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "redirect_time", sizeof("redirect_time"), d); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_COUNT, &l)) { ++ add_assoc_long_ex(&array, "redirect_count", sizeof("redirect_count"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HTTP_CONNECTCODE, &l)) { ++ add_assoc_long_ex(&array, "connect_code", sizeof("connect_code"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_HTTPAUTH_AVAIL, &l)) { ++ add_assoc_long_ex(&array, "httpauth_avail", sizeof("httpauth_avail"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PROXYAUTH_AVAIL, &l)) { ++ add_assoc_long_ex(&array, "proxyauth_avail", sizeof("proxyauth_avail"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_OS_ERRNO, &l)) { ++ add_assoc_long_ex(&array, "os_errno", sizeof("os_errno"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_NUM_CONNECTS, &l)) { ++ add_assoc_long_ex(&array, "num_connects", sizeof("num_connects"), l); ++ } ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_SSL_ENGINES, &s)) { ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ add_assoc_zval_ex(&array, "ssl_engines", sizeof("ssl_engines"), subarray); ++ curl_slist_free_all(s); ++ } ++#if HTTP_CURL_VERSION(7,14,1) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_COOKIELIST, &s)) { ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ add_assoc_zval_ex(&array, "cookies", sizeof("cookies"), subarray); ++ curl_slist_free_all(s); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,18,2) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_URL, &c)) { ++ add_assoc_string_ex(&array, "redirect_url", sizeof("redirect_url"), c ? c : "", 1); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_IP, &c)) { ++ add_assoc_string_ex(&array, "primary_ip", sizeof("primary_ip"), c ? c : "", 1); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,0) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_APPCONNECT_TIME, &d)) { ++ add_assoc_double_ex(&array, "appconnect_time", sizeof("appconnect_time"), d); ++ } ++#endif ++#if HTTP_CURL_VERSION(7,19,4) ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CONDITION_UNMET, &l)) { ++ add_assoc_long_ex(&array, "condition_unmet", sizeof("condition_unmet"), l); ++ } ++#endif ++/* END */ ++#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) ++ { ++ int i; ++ zval *ci_array; ++ struct curl_certinfo *ci; ++ char *colon, *keyname; ++ ++ if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CERTINFO, &ci)) { ++ MAKE_STD_ZVAL(ci_array); ++ array_init(ci_array); ++ ++ for (i = 0; i < ci->num_of_certs; ++i) { ++ s = ci->certinfo[i]; ++ ++ MAKE_STD_ZVAL(subarray); ++ array_init(subarray); ++ for (p = s; p; p = p->next) { ++ if (p->data) { ++ if ((colon = strchr(p->data, ':'))) { ++ keyname = estrndup(p->data, colon - p->data); ++ add_assoc_string_ex(subarray, keyname, colon - p->data + 1, colon + 1, 1); ++ efree(keyname); ++ } else { ++ add_next_index_string(subarray, p->data, 1); ++ } ++ } ++ } ++ add_next_index_zval(ci_array, subarray); ++ } ++ add_assoc_zval_ex(&array, "certinfo", sizeof("certinfo"), ci_array); ++ } ++ } ++#endif ++ add_assoc_string_ex(&array, "error", sizeof("error"), http_request_storage_get(request->ch)->errorbuffer, 1); ++} ++/* }}} */ ++ ++#endif /* HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/http_request_method_api.c +@@ -0,0 +1,321 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_method_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#include "php_http_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_method_api.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++# include "php_http_request_object.h" ++#endif ++ ++/* {{{ char *http_request_methods[] */ ++static const char *const http_request_methods[] = { ++ "UNKNOWN", ++ /* HTTP/1.1 */ ++ "GET", ++ "HEAD", ++ "POST", ++ "PUT", ++ "DELETE", ++ "OPTIONS", ++ "TRACE", ++ "CONNECT", ++ /* WebDAV - RFC 2518 */ ++ "PROPFIND", ++ "PROPPATCH", ++ "MKCOL", ++ "COPY", ++ "MOVE", ++ "LOCK", ++ "UNLOCK", ++ /* WebDAV Versioning - RFC 3253 */ ++ "VERSION-CONTROL", ++ "REPORT", ++ "CHECKOUT", ++ "CHECKIN", ++ "UNCHECKOUT", ++ "MKWORKSPACE", ++ "UPDATE", ++ "LABEL", ++ "MERGE", ++ "BASELINE-CONTROL", ++ "MKACTIVITY", ++ /* WebDAV Access Control - RFC 3744 */ ++ "ACL", ++ NULL ++}; ++/* }}} */ ++ ++/* {{{ */ ++PHP_MINIT_FUNCTION(http_request_method) ++{ ++ /* HTTP/1.1 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_GET", HTTP_GET); ++ HTTP_LONG_CONSTANT("HTTP_METH_HEAD", HTTP_HEAD); ++ HTTP_LONG_CONSTANT("HTTP_METH_POST", HTTP_POST); ++ HTTP_LONG_CONSTANT("HTTP_METH_PUT", HTTP_PUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_DELETE", HTTP_DELETE); ++ HTTP_LONG_CONSTANT("HTTP_METH_OPTIONS", HTTP_OPTIONS); ++ HTTP_LONG_CONSTANT("HTTP_METH_TRACE", HTTP_TRACE); ++ HTTP_LONG_CONSTANT("HTTP_METH_CONNECT", HTTP_CONNECT); ++ /* WebDAV - RFC 2518 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_PROPFIND", HTTP_PROPFIND); ++ HTTP_LONG_CONSTANT("HTTP_METH_PROPPATCH", HTTP_PROPPATCH); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKCOL", HTTP_MKCOL); ++ HTTP_LONG_CONSTANT("HTTP_METH_COPY", HTTP_COPY); ++ HTTP_LONG_CONSTANT("HTTP_METH_MOVE", HTTP_MOVE); ++ HTTP_LONG_CONSTANT("HTTP_METH_LOCK", HTTP_LOCK); ++ HTTP_LONG_CONSTANT("HTTP_METH_UNLOCK", HTTP_UNLOCK); ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_VERSION_CONTROL", HTTP_VERSION_CONTROL); ++ HTTP_LONG_CONSTANT("HTTP_METH_REPORT", HTTP_REPORT); ++ HTTP_LONG_CONSTANT("HTTP_METH_CHECKOUT", HTTP_CHECKOUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_CHECKIN", HTTP_CHECKIN); ++ HTTP_LONG_CONSTANT("HTTP_METH_UNCHECKOUT", HTTP_UNCHECKOUT); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKWORKSPACE", HTTP_MKWORKSPACE); ++ HTTP_LONG_CONSTANT("HTTP_METH_UPDATE", HTTP_UPDATE); ++ HTTP_LONG_CONSTANT("HTTP_METH_LABEL", HTTP_LABEL); ++ HTTP_LONG_CONSTANT("HTTP_METH_MERGE", HTTP_MERGE); ++ HTTP_LONG_CONSTANT("HTTP_METH_BASELINE_CONTROL", HTTP_BASELINE_CONTROL); ++ HTTP_LONG_CONSTANT("HTTP_METH_MKACTIVITY", HTTP_MKACTIVITY); ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_LONG_CONSTANT("HTTP_METH_ACL", HTTP_ACL); ++ ++ return SUCCESS; ++} ++ ++static void free_method(void *el) ++{ ++ efree(*(char **)el); ++} ++ ++static void unregister_method(const char *name TSRMLS_DC) ++{ ++ char *ptr, tmp[sizeof("HTTP_METH_") + HTTP_REQUEST_METHOD_MAXLEN] = "HTTP_METH_"; ++ ++ strlcpy(tmp + lenof("HTTP_METH_"), name, HTTP_REQUEST_METHOD_MAXLEN); ++ for (ptr = tmp + lenof("HTTP_METH_"); *ptr; ++ptr) { ++ if (*ptr == '-') { ++ *ptr = '_'; ++ } ++ } ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++ if (SUCCESS != zend_hash_del(&http_request_object_ce->constants_table, tmp + lenof("HTTP_"), strlen(tmp + lenof("HTTP_")) + 1)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: HttpRequest::%s", tmp + lenof("HTTP_")); ++ } ++#endif ++ if (SUCCESS != zend_hash_del(EG(zend_constants), tmp, strlen(tmp) + 1)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: %s", tmp); ++ } ++} ++ ++PHP_RINIT_FUNCTION(http_request_method) ++{ ++ HashTable ht; ++ ++ zend_hash_init(&HTTP_G->request.methods.registered, 0, NULL, free_method, 0); ++#define HTTP_METH_REG(m) \ ++ { \ ++ char *_m=estrdup(m); \ ++ zend_hash_next_index_insert(&HTTP_G->request.methods.registered, (void *) &_m, sizeof(char *), NULL); \ ++ } ++ HTTP_METH_REG("UNKNOWN"); ++ /* HTTP/1.1 */ ++ HTTP_METH_REG("GET"); ++ HTTP_METH_REG("HEAD"); ++ HTTP_METH_REG("POST"); ++ HTTP_METH_REG("PUT"); ++ HTTP_METH_REG("DELETE"); ++ HTTP_METH_REG("OPTIONS"); ++ HTTP_METH_REG("TRACE"); ++ HTTP_METH_REG("CONNECT"); ++ /* WebDAV - RFC 2518 */ ++ HTTP_METH_REG("PROPFIND"); ++ HTTP_METH_REG("PROPPATCH"); ++ HTTP_METH_REG("MKCOL"); ++ HTTP_METH_REG("COPY"); ++ HTTP_METH_REG("MOVE"); ++ HTTP_METH_REG("LOCK"); ++ HTTP_METH_REG("UNLOCK"); ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_METH_REG("VERSION-CONTROL"); ++ HTTP_METH_REG("REPORT"); ++ HTTP_METH_REG("CHECKOUT"); ++ HTTP_METH_REG("CHECKIN"); ++ HTTP_METH_REG("UNCHECKOUT"); ++ HTTP_METH_REG("MKWORKSPACE"); ++ HTTP_METH_REG("UPDATE"); ++ HTTP_METH_REG("LABEL"); ++ HTTP_METH_REG("MERGE"); ++ HTTP_METH_REG("BASELINE-CONTROL"); ++ HTTP_METH_REG("MKACTIVITY"); ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_METH_REG("ACL"); ++ ++ zend_hash_init(&ht, 0, NULL, ZVAL_PTR_DTOR, 0); ++ if (*HTTP_G->request.methods.custom && SUCCESS == http_parse_params(HTTP_G->request.methods.custom, HTTP_PARAMS_DEFAULT, &ht)) { ++ HashPosition pos; ++ zval **val; ++ ++ FOREACH_HASH_VAL(pos, &ht, val) { ++ if (Z_TYPE_PP(val) == IS_STRING) { ++ http_request_method_register(Z_STRVAL_PP(val), Z_STRLEN_PP(val)); ++ } ++ } ++ } ++ zend_hash_destroy(&ht); ++ ++ return SUCCESS; ++} ++ ++PHP_RSHUTDOWN_FUNCTION(http_request_method) ++{ ++ char **name; ++ int i, c = zend_hash_next_free_element(&HTTP_G->request.methods.registered); ++ ++ for (i = HTTP_MAX_REQUEST_METHOD; i < c; ++i) { ++ if (SUCCESS == zend_hash_index_find(&HTTP_G->request.methods.registered, i, (void *) &name)) { ++ unregister_method(*name TSRMLS_CC); ++ } ++ } ++ ++ zend_hash_destroy(&HTTP_G->request.methods.registered); ++ return SUCCESS; ++} ++ ++#define http_request_method_cncl(m, c) _http_request_method_cncl_ex((m), strlen(m), (c) TSRMLS_CC) ++#define http_request_method_cncl_ex(m, l, c) _http_request_method_cncl_ex((m), (l), (c) TSRMLS_CC) ++static STATUS _http_request_method_cncl_ex(const char *method_name, int method_name_len, char **cnst TSRMLS_DC) ++{ ++ int i; ++ char *cncl; ++ ++ if (method_name_len >= HTTP_REQUEST_METHOD_MAXLEN) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method too long (%s)", method_name); ++ } ++ cncl = emalloc(method_name_len + 1); ++ ++ for (i = 0; i < method_name_len; ++i) { ++ switch (method_name[i]) { ++ case '-': ++ cncl[i] = '-'; ++ break; ++ ++ default: ++ if (!HTTP_IS_CTYPE(alnum, method_name[i])) { ++ efree(cncl); ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method contains illegal characters (%s)", method_name); ++ return FAILURE; ++ } ++ cncl[i] = HTTP_TO_CTYPE(upper, method_name[i]); ++ break; ++ } ++ } ++ cncl[method_name_len] = '\0'; ++ ++ *cnst = cncl; ++ return SUCCESS; ++} ++ ++PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC) ++{ ++ char **name; ++ ++ if (SUCCESS == zend_hash_index_find(&HTTP_G->request.methods.registered, m, (void *) &name)) { ++ return *name; ++ } ++ return "UNKNOWN"; ++} ++ ++PHP_HTTP_API int _http_request_method_exists(int by_name, http_request_method id_num, const char *id_str TSRMLS_DC) ++{ ++ char *id_dup; ++ ++ if (by_name && (SUCCESS == http_request_method_cncl(id_str, &id_dup))) { ++ char **name; ++ HashPosition pos; ++ HashKey key = initHashKey(0); ++ ++ FOREACH_HASH_KEYVAL(pos, &HTTP_G->request.methods.registered, key, name) { ++ if (key.type == HASH_KEY_IS_LONG && !strcmp(*name, id_dup)) { ++ efree(id_dup); ++ return key.num; ++ } ++ } ++ efree(id_dup); ++ } else if (zend_hash_index_exists(&HTTP_G->request.methods.registered, id_num)){ ++ return id_num; ++ } ++ return 0; ++} ++ ++PHP_HTTP_API int _http_request_method_register(const char *method_str, int method_len TSRMLS_DC) ++{ ++ char *method_dup, *ptr, tmp[sizeof("HTTP_METH_") + HTTP_REQUEST_METHOD_MAXLEN] = "HTTP_METH_"; ++ int method_num = http_request_method_exists(1, 0, method_str); ++ ++ if (!method_num && (SUCCESS == http_request_method_cncl_ex(method_str, method_len, &method_dup))) { ++ method_num = zend_hash_next_free_element(&HTTP_G->request.methods.registered); ++ zend_hash_index_update(&HTTP_G->request.methods.registered, method_num, (void *) &method_dup, sizeof(char *), NULL); ++ ++ strlcpy(tmp + lenof("HTTP_METH_"), method_dup, HTTP_REQUEST_METHOD_MAXLEN); ++ for (ptr = tmp + lenof("HTTP_METH_"); *ptr; ++ptr) { ++ if (*ptr == '-') { ++ *ptr = '_'; ++ } ++ } ++ ++ zend_register_long_constant(tmp, strlen(tmp) + 1, method_num, CONST_CS, http_module_number TSRMLS_CC); ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) ++ zend_declare_class_constant_long(http_request_object_ce, tmp + lenof("HTTP_"), strlen(tmp + lenof("HTTP_")), method_num TSRMLS_CC); ++#endif ++ } ++ ++ return method_num; ++} ++ ++PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC) ++{ ++ char **name; ++ ++ if (HTTP_STD_REQUEST_METHOD(method)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Standard request methods cannot be unregistered"); ++ return FAILURE; ++ } ++ ++ if (SUCCESS != zend_hash_index_find(&HTTP_G->request.methods.registered, method, (void *) &name)) { ++ http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Custom request method with id %d does not exist", method); ++ return FAILURE; ++ } ++ ++ unregister_method(*name TSRMLS_CC); ++ ++ zend_hash_index_del(&HTTP_G->request.methods.registered, method); ++ return SUCCESS; ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_object.c +@@ -0,0 +1,1922 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_cookie_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_message_api.h" ++#include "php_http_message_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_url_api.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequest, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequest, method, 0) ++#define HTTP_REQUEST_ME(method, visibility) PHP_ME(HttpRequest, method, HTTP_ARGS(HttpRequest, method), visibility) ++#define HTTP_REQUEST_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpRequest, method)) ++#define HTTP_REQUEST_MALIAS(me, al, vis) ZEND_FENTRY(me, ZEND_MN(HttpRequest_##al), HTTP_ARGS(HttpRequest, al), vis) ++ ++HTTP_BEGIN_ARGS(__construct, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(method, 0) ++ HTTP_ARG_VAL(options, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(method, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getOptions); ++HTTP_BEGIN_ARGS(setOptions, 0) ++ HTTP_ARG_VAL(options, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getSslOptions); ++HTTP_BEGIN_ARGS(setSslOptions, 0) ++ HTTP_ARG_VAL(ssl_options, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addSslOptions, 0) ++ HTTP_ARG_VAL(ssl_optins, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getHeaders); ++HTTP_BEGIN_ARGS(setHeaders, 0) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addHeaders, 1) ++ HTTP_ARG_VAL(headers, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCookies); ++HTTP_BEGIN_ARGS(setCookies, 0) ++ HTTP_ARG_VAL(cookies, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addCookies, 1) ++ HTTP_ARG_VAL(cookies, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(enableCookies); ++HTTP_BEGIN_ARGS(resetCookies, 0) ++ HTTP_ARG_VAL(session_only, 0) ++HTTP_END_ARGS; ++HTTP_EMPTY_ARGS(flushCookies); ++ ++HTTP_EMPTY_ARGS(getUrl); ++HTTP_BEGIN_ARGS(setUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getMethod); ++HTTP_BEGIN_ARGS(setMethod, 1) ++ HTTP_ARG_VAL(request_method, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentType); ++HTTP_BEGIN_ARGS(setContentType, 1) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getQueryData); ++HTTP_BEGIN_ARGS(setQueryData, 0) ++ HTTP_ARG_VAL(query_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addQueryData, 1) ++ HTTP_ARG_VAL(query_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPostFields); ++HTTP_BEGIN_ARGS(setPostFields, 0) ++ HTTP_ARG_VAL(post_fields, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPostFields, 1) ++ HTTP_ARG_VAL(post_fields, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPostFiles); ++HTTP_BEGIN_ARGS(setPostFiles, 0) ++ HTTP_ARG_VAL(post_files, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPostFile, 2) ++ HTTP_ARG_VAL(formname, 0) ++ HTTP_ARG_VAL(filename, 0) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBody); ++HTTP_BEGIN_ARGS(setBody, 0) ++ HTTP_ARG_VAL(request_body_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addBody, 1) ++ HTTP_ARG_VAL(request_body_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPutFile); ++HTTP_BEGIN_ARGS(setPutFile, 0) ++ HTTP_ARG_VAL(filename, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getPutData); ++HTTP_BEGIN_ARGS(setPutData, 0) ++ HTTP_ARG_VAL(put_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(addPutData, 1) ++ HTTP_ARG_VAL(put_data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseData); ++HTTP_BEGIN_ARGS(getResponseHeader, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getResponseCookies, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(allowed_extras, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseBody); ++HTTP_EMPTY_ARGS(getResponseCode); ++HTTP_EMPTY_ARGS(getResponseStatus); ++HTTP_BEGIN_ARGS(getResponseInfo, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getMessageClass); ++HTTP_BEGIN_ARGS(setMessageClass, 1) ++ HTTP_ARG_VAL(message_class_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getResponseMessage); ++HTTP_EMPTY_ARGS(getRawResponseMessage); ++HTTP_EMPTY_ARGS(getRequestMessage); ++HTTP_EMPTY_ARGS(getRawRequestMessage); ++HTTP_EMPTY_ARGS(getHistory); ++HTTP_EMPTY_ARGS(clearHistory); ++HTTP_EMPTY_ARGS(send); ++ ++HTTP_BEGIN_ARGS(get, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(head, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(postData, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(postFields, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putData, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(data, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putFile, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(file, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(putStream, 2) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(stream, 0) ++ HTTP_ARG_VAL(options, 0) ++ HTTP_ARG_VAL(info, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodRegister, 1) ++ HTTP_ARG_VAL(method_name, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodUnregister, 1) ++ HTTP_ARG_VAL(method, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodName, 1) ++ HTTP_ARG_VAL(method_id, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(methodExists, 1) ++ HTTP_ARG_VAL(method, 0) ++HTTP_END_ARGS; ++ ++#ifdef HAVE_CURL_FORMGET ++HTTP_BEGIN_ARGS(encodeBody, 2) ++ HTTP_ARG_VAL(fields, 0) ++ HTTP_ARG_VAL(files, 0) ++HTTP_END_ARGS; ++#endif ++ ++#define THIS_CE http_request_object_ce ++zend_class_entry *http_request_object_ce; ++zend_function_entry http_request_object_fe[] = { ++ HTTP_REQUEST_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ ++ HTTP_REQUEST_ME(setOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setSslOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getSslOptions, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addSslOptions, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(addHeaders, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getHeaders, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setHeaders, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(addCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setCookies, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(enableCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(resetCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(flushCookies, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setMethod, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getMethod, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setUrl, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getUrl, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setContentType, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setQueryData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getQueryData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addQueryData, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPostFields, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPostFields, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPostFields, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_MALIAS(setRawPostData, setBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ HTTP_REQUEST_MALIAS(getRawPostData, getBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ HTTP_REQUEST_MALIAS(addRawPostData, addBody, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) ++ ++ HTTP_REQUEST_ME(setPostFiles, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPostFile, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPostFiles, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPutFile, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPutFile, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(setPutData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getPutData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(addPutData, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(send, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(getResponseData, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseHeader, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseCookies, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseCode, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseStatus, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseBody, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseInfo, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRawResponseMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getRawRequestMessage, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(clearHistory, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(getMessageClass, ZEND_ACC_PUBLIC) ++ HTTP_REQUEST_ME(setMessageClass, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQUEST_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++ ++ HTTP_REQUEST_ALIAS(get, http_get) ++ HTTP_REQUEST_ALIAS(head, http_head) ++ HTTP_REQUEST_ALIAS(postData, http_post_data) ++ HTTP_REQUEST_ALIAS(postFields, http_post_fields) ++ HTTP_REQUEST_ALIAS(putData, http_put_data) ++ HTTP_REQUEST_ALIAS(putFile, http_put_file) ++ HTTP_REQUEST_ALIAS(putStream, http_put_stream) ++ ++ HTTP_REQUEST_ALIAS(methodRegister, http_request_method_register) ++ HTTP_REQUEST_ALIAS(methodUnregister, http_request_method_unregister) ++ HTTP_REQUEST_ALIAS(methodName, http_request_method_name) ++ HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists) ++#ifdef HAVE_CURL_FORMGET ++ HTTP_REQUEST_ALIAS(encodeBody, http_request_body_encode) ++#endif ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_request_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_request_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0); ++ http_request_object_handlers.clone_obj = _http_request_object_clone_obj; ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("options")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("postFields")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("postFiles")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("responseInfo")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("responseMessage")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("responseCode")-1, 0, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("responseStatus")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("method")-1, HTTP_GET, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("url")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("contentType")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("requestBody")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("queryData")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("putFile")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("putData")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("history")-1, ZEND_ACC_PRIVATE TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("recordHistory")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_string(THIS_CE, ZEND_STRS("messageClass")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC); ++ ++#ifndef WONKY ++ /* ++ * Request Method Constants ++ */ ++ /* HTTP/1.1 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_GET")-1, HTTP_GET TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_HEAD")-1, HTTP_HEAD TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_POST")-1, HTTP_POST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PUT")-1, HTTP_PUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_DELETE")-1, HTTP_DELETE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_OPTIONS")-1, HTTP_OPTIONS TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_TRACE")-1, HTTP_TRACE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CONNECT")-1, HTTP_CONNECT TSRMLS_CC); ++ /* WebDAV - RFC 2518 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PROPFIND")-1, HTTP_PROPFIND TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_PROPPATCH")-1, HTTP_PROPPATCH TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKCOL")-1, HTTP_MKCOL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_COPY")-1, HTTP_COPY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MOVE")-1, HTTP_MOVE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_LOCK")-1, HTTP_LOCK TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UNLOCK")-1, HTTP_UNLOCK TSRMLS_CC); ++ /* WebDAV Versioning - RFC 3253 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_VERSION_CONTROL")-1, HTTP_VERSION_CONTROL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_REPORT")-1, HTTP_REPORT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CHECKOUT")-1, HTTP_CHECKOUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_CHECKIN")-1, HTTP_CHECKIN TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UNCHECKOUT")-1, HTTP_UNCHECKOUT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKWORKSPACE")-1, HTTP_MKWORKSPACE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_UPDATE")-1, HTTP_UPDATE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_LABEL")-1, HTTP_LABEL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MERGE")-1, HTTP_MERGE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_BASELINE_CONTROL")-1, HTTP_BASELINE_CONTROL TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_MKACTIVITY")-1, HTTP_MKACTIVITY TSRMLS_CC); ++ /* WebDAV Access Control - RFC 3744 */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("METH_ACL")-1, HTTP_ACL TSRMLS_CC); ++ ++ /* ++ * HTTP Protocol Version Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_1_0")-1, CURL_HTTP_VERSION_1_0 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_1_1")-1, CURL_HTTP_VERSION_1_1 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_NONE")-1, CURL_HTTP_VERSION_NONE TSRMLS_CC); /* to be removed */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("VERSION_ANY")-1, CURL_HTTP_VERSION_NONE TSRMLS_CC); ++ ++ /* ++ * SSL Version Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_TLSv1")-1, CURL_SSLVERSION_TLSv1 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_SSLv2")-1, CURL_SSLVERSION_SSLv2 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_SSLv3")-1, CURL_SSLVERSION_SSLv3 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("SSL_VERSION_ANY")-1, CURL_SSLVERSION_DEFAULT TSRMLS_CC); ++ ++ /* ++ * DNS IPvX resolving ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_V4")-1, CURL_IPRESOLVE_V4 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_V6")-1, CURL_IPRESOLVE_V6 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("IPRESOLVE_ANY")-1, CURL_IPRESOLVE_WHATEVER TSRMLS_CC); ++ ++ /* ++ * Auth Constants ++ */ ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_BASIC")-1, CURLAUTH_BASIC TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_DIGEST")-1, CURLAUTH_DIGEST TSRMLS_CC); ++#if HTTP_CURL_VERSION(7,19,3) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_DIGEST_IE")-1, CURLAUTH_DIGEST_IE TSRMLS_CC); ++#endif ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_NTLM")-1, CURLAUTH_NTLM TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_GSSNEG")-1, CURLAUTH_GSSNEGOTIATE TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("AUTH_ANY")-1, CURLAUTH_ANY TSRMLS_CC); ++ ++ /* ++ * Proxy Type Constants ++ */ ++# if HTTP_CURL_VERSION(7,15,2) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS4")-1, CURLPROXY_SOCKS4 TSRMLS_CC); ++# endif ++#if HTTP_CURL_VERSION(7,18,0) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS4A")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS5_HOSTNAME")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++#endif ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_SOCKS5")-1, CURLPROXY_SOCKS5 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_HTTP")-1, CURLPROXY_HTTP TSRMLS_CC); ++# if HTTP_CURL_VERSION(7,19,4) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("PROXY_HTTP_1_0")-1, CURLPROXY_HTTP_1_0 TSRMLS_CC); ++# endif ++#endif /* WONKY */ ++ ++ /* ++ * Post Redirection Constants ++ */ ++#if HTTP_CURL_VERSION(7,19,1) ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_301")-1, CURL_REDIR_POST_301 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_302")-1, CURL_REDIR_POST_302 TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("POSTREDIR_ALL")-1, CURL_REDIR_POST_ALL TSRMLS_CC); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_request_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_request_object *o; ++ ++ o = ecalloc(1, sizeof(http_request_object)); ++ o->zo.ce = ce; ++ o->request = http_request_init_ex(NULL, ch, 0, NULL); ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_request_object, o); ++ ov.handlers = &http_request_object_handlers; ++ ++ return ov; ++} ++ ++zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC) ++{ ++ zend_object_value new_ov; ++ http_request_object *new_obj; ++ getObject(http_request_object, old_obj); ++ ++ new_ov = http_request_object_new_ex(old_obj->zo.ce, NULL, &new_obj); ++ if (old_obj->request->ch) { ++ http_curl_init_ex(http_curl_copy(old_obj->request->ch), new_obj->request); ++ } ++ ++ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); ++ phpstr_append(&new_obj->request->conv.request, old_obj->request->conv.request.data, old_obj->request->conv.request.used); ++ phpstr_append(&new_obj->request->conv.response, old_obj->request->conv.response.data, old_obj->request->conv.response.used); ++ ++ return new_ov; ++} ++ ++void _http_request_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_request_object *o = (http_request_object *) object; ++ ++ http_request_free(&o->request); ++ freeObject(o); ++} ++ ++#define http_request_object_check_request_content_type(t) _http_request_object_check_request_content_type((t) TSRMLS_CC) ++static inline void _http_request_object_check_request_content_type(zval *this_ptr TSRMLS_DC) ++{ ++ zval *ctype = zend_read_property(THIS_CE, getThis(), ZEND_STRS("contentType")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(ctype)) { ++ zval **headers, *opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ ++ if ( (Z_TYPE_P(opts) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void *) &headers)) && ++ (Z_TYPE_PP(headers) == IS_ARRAY)) { ++ zval **ct_header; ++ ++ /* only override if not already set */ ++ if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void *) &ct_header))) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } else ++ /* or not a string, zero length string or a string of spaces */ ++ if ((Z_TYPE_PP(ct_header) != IS_STRING) || !Z_STRLEN_PP(ct_header)) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } else { ++ int i, only_space = 1; ++ ++ /* check for spaces only */ ++ for (i = 0; i < Z_STRLEN_PP(ct_header); ++i) { ++ if (!HTTP_IS_CTYPE(space, Z_STRVAL_PP(ct_header)[i])) { ++ only_space = 0; ++ break; ++ } ++ } ++ if (only_space) { ++ add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ } ++ } ++ } else { ++ zval *headers; ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ add_assoc_stringl(headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addheaders", NULL, headers); ++ zval_ptr_dtor(&headers); ++ } ++ } ++} ++ ++#define http_request_object_message(zo, msg) _http_request_object_message((zo), (msg) TSRMLS_CC) ++static inline zend_object_value _http_request_object_message(zval *this_ptr, http_message *msg TSRMLS_DC) ++{ ++ zend_object_value ov; ++ zval *zcn = zend_read_property(THIS_CE, getThis(), ZEND_STRS("messageClass")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(zcn) && (SUCCESS == http_object_new(&ov, Z_STRVAL_P(zcn), Z_STRLEN_P(zcn), _http_message_object_new_ex, http_message_object_ce, msg, NULL))) { ++ return ov; ++ } else { ++ return http_message_object_new_ex(http_message_object_ce, msg, NULL); ++ } ++} ++ ++STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) ++{ ++ STATUS status = SUCCESS; ++ char *url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); ++ ++ if (!url) { ++ return FAILURE; ++ } ++ ++ http_request_reset(obj->request); ++ obj->request->url = url; ++ HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init(obj->request), return FAILURE); ++ ++ switch (obj->request->meth = Z_LVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("method")-1, 0 TSRMLS_CC))) ++ { ++ case HTTP_GET: ++ case HTTP_HEAD: ++ break; ++ ++ case HTTP_PUT: ++ { ++ zval *put_file = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putFile")-1, 0 TSRMLS_CC); ++ ++ http_request_object_check_request_content_type(getThis()); ++ ++ if (Z_STRLEN_P(put_file)) { ++ php_stream_statbuf ssb; ++ php_stream *stream = php_stream_open_wrapper_ex(Z_STRVAL_P(put_file), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); ++ ++ if (stream && SUCCESS == php_stream_stat(stream, &ssb)) { ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); ++ } else { ++ status = FAILURE; ++ } ++ } else { ++ zval *put_data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putData")-1, 0 TSRMLS_CC); ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_CSTRING, ++ estrndup(Z_STRVAL_P(put_data), Z_STRLEN_P(put_data)), Z_STRLEN_P(put_data), 1); ++ } ++ break; ++ } ++ ++ case HTTP_POST: ++ default: ++ { ++ /* check for raw request body */ ++ zval *raw_data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(raw_data)) { ++ http_request_object_check_request_content_type(getThis()); ++ obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_CSTRING, ++ estrndup(Z_STRVAL_P(raw_data), Z_STRLEN_P(raw_data)), Z_STRLEN_P(raw_data), 1); ++ } else { ++ zval *zfields = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, 0 TSRMLS_CC), *zfiles = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, 0 TSRMLS_CC); ++ HashTable *fields; ++ HashTable *files; ++ ++ fields = (Z_TYPE_P(zfields) == IS_ARRAY) ? Z_ARRVAL_P(zfields) : NULL; ++ files = (Z_TYPE_P(zfiles) == IS_ARRAY) ? Z_ARRVAL_P(zfiles) : NULL; ++ ++ if ((fields && zend_hash_num_elements(fields)) || (files && zend_hash_num_elements(files))) { ++ if (!(obj->request->body = http_request_body_fill(obj->request->body, fields, files))) { ++ status = FAILURE; ++ } ++ } ++ } ++ break; ++ } ++ } ++ ++ if (status == SUCCESS) { ++ zval *qdata = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryData")-1, 0 TSRMLS_CC); ++ zval *options = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(qdata)) { ++ if (!strchr(obj->request->url, '?')) { ++ strlcat(obj->request->url, "?", HTTP_URL_MAXLEN); ++ } else { ++ strlcat(obj->request->url, "&", HTTP_URL_MAXLEN); ++ } ++ strlcat(obj->request->url, Z_STRVAL_P(qdata), HTTP_URL_MAXLEN); ++ } ++ ++ http_request_prepare(obj->request, Z_ARRVAL_P(options)); ++ ++ /* check if there's a onProgress method and add it as progress callback if one isn't already set */ ++ if (zend_hash_exists(&Z_OBJCE_P(getThis())->function_table, "onprogress", sizeof("onprogress"))) { ++ zval **entry, *pcb; ++ ++ if ( (Z_TYPE_P(options) != IS_ARRAY) ++ || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void *) &entry) ++ || (!IS_CALLABLE(*entry, 0, NULL)))) { ++ MAKE_STD_ZVAL(pcb); ++ array_init(pcb); ++ ZVAL_ADDREF(getThis()); ++ add_next_index_zval(pcb, getThis()); ++ add_next_index_stringl(pcb, "onprogress", lenof("onprogress"), 1); ++ http_request_set_progress_callback(obj->request, pcb); ++ zval_ptr_dtor(&pcb); ++ } ++ } ++ } ++ ++ return status; ++} ++ ++STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) ++{ ++ STATUS ret; ++ zval *info; ++ http_message *msg; ++ ++ /* always fetch info */ ++ MAKE_STD_ZVAL(info); ++ array_init(info); ++ http_request_info(obj->request, Z_ARRVAL_P(info)); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseInfo")-1, info TSRMLS_CC); ++ zval_ptr_dtor(&info); ++ ++ /* parse response message */ ++ phpstr_fix(&obj->request->conv.request); ++ phpstr_fix(&obj->request->conv.response); ++ ++ if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.response), PHPSTR_LEN(&obj->request->conv.response)))) { ++ zval *message; ++ ++ if (i_zend_is_true(zend_read_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, 0 TSRMLS_CC))) { ++ zval *hist, *history = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ http_message *response = http_message_parse(PHPSTR_VAL(&obj->request->conv.response), PHPSTR_LEN(&obj->request->conv.response)); ++ http_message *request = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)); ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_OBJVAL(hist, http_request_object_message(getThis(), http_message_interconnect(response, request)), 0); ++ if (Z_TYPE_P(history) == IS_OBJECT) { ++ http_message_object_prepend(hist, history); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("responseCode")-1, msg->http.info.response.code TSRMLS_CC); ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("responseStatus")-1, STR_PTR(msg->http.info.response.status) TSRMLS_CC); ++ ++ MAKE_STD_ZVAL(message); ++ ZVAL_OBJVAL(message, http_request_object_message(getThis(), msg), 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, message TSRMLS_CC); ++ zval_ptr_dtor(&message); ++ ++ ret = SUCCESS; ++ } else { ++ /* update properties with empty values*/ ++ zval *znull; ++ ++ MAKE_STD_ZVAL(znull); ++ ZVAL_NULL(znull); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, znull TSRMLS_CC); ++ zval_ptr_dtor(&znull); ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("responseCode")-1, 0 TSRMLS_CC); ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("responseStatus")-1, "" TSRMLS_CC); ++ ++ /* append request message to history */ ++ if (i_zend_is_true(zend_read_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, 0 TSRMLS_CC))) { ++ http_message *request; ++ ++ if ((request = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) { ++ zval *hist, *history = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_OBJVAL(hist, http_request_object_message(getThis(), request), 0); ++ if (Z_TYPE_P(history) == IS_OBJECT) { ++ http_message_object_prepend(hist, history); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++ } ++ ++ ret = FAILURE; ++ } ++ ++ http_request_set_progress_callback(obj->request, NULL); ++ ++ if (!EG(exception) && zend_hash_exists(&Z_OBJCE_P(getThis())->function_table, "onfinish", sizeof("onfinish"))) { ++ zval *param; ++ ++ MAKE_STD_ZVAL(param); ++ ZVAL_BOOL(param, ret == SUCCESS); ++ with_error_handling(EH_NORMAL, NULL) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "onfinish", NULL, param); ++ } end_error_handling(); ++ zval_ptr_dtor(¶m); ++ } ++ ++ return ret; ++} ++ ++static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) ++{ ++ if (hash_key->arKey && hash_key->nKeyLength > 1) { ++ hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength); ++ } ++ return ZEND_HASH_APPLY_KEEP; ++} ++ ++#define http_request_object_set_options_subr(key, ow, pk) \ ++ _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAM_PASSTHRU, (key), sizeof(key), (ow), (pk)) ++static inline void _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAMETERS, char *key, size_t len, int overwrite, int prettify_keys) ++{ ++ zval *old_opts, *new_opts, *opts = NULL, **entry = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a/!", &opts)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(new_opts); ++ array_init(new_opts); ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts)); ++ } ++ ++ if (SUCCESS == zend_hash_find(Z_ARRVAL_P(new_opts), key, len, (void *) &entry)) { ++ if (overwrite) { ++ zend_hash_clean(Z_ARRVAL_PP(entry)); ++ } ++ if (opts && zend_hash_num_elements(Z_ARRVAL_P(opts))) { ++ if (overwrite) { ++ array_copy(Z_ARRVAL_P(opts), Z_ARRVAL_PP(entry)); ++ } else { ++ array_join(Z_ARRVAL_P(opts), Z_ARRVAL_PP(entry), 0, prettify_keys ? ARRAY_JOIN_PRETTIFY : 0); ++ } ++ } ++ } else if (opts) { ++ if (prettify_keys) { ++ zend_hash_apply_with_arguments(Z_ARRVAL_P(opts) HTTP_ZAPI_HASH_TSRMLS_CC, apply_pretty_key, 0, NULL); ++ } ++ ZVAL_ADDREF(opts); ++ add_assoc_zval_ex(new_opts, key, len, opts); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ ++ RETURN_TRUE; ++} ++ ++#define http_request_object_get_options_subr(key) \ ++ _http_request_get_options_subr(INTERNAL_FUNCTION_PARAM_PASSTHRU, (key), sizeof(key)) ++static inline void _http_request_get_options_subr(INTERNAL_FUNCTION_PARAMETERS, char *key, size_t len) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *opts, **options; ++ ++ opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ array_init(return_value); ++ ++ if ( (Z_TYPE_P(opts) == IS_ARRAY) && ++ (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) { ++ convert_to_array(*options); ++ array_copy(Z_ARRVAL_PP(options), Z_ARRVAL_P(return_value)); ++ } ++ } ++} ++ ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]]) ++ Create a new HttpRequest object instance. */ ++PHP_METHOD(HttpRequest, __construct) ++{ ++ char *URL = NULL; ++ int URL_len; ++ long meth = -1; ++ zval *options = NULL; ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla!", &URL, &URL_len, &meth, &options)) { ++ if (URL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ } ++ if (meth > -1) { ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ } ++ if (options) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setoptions", NULL, options); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest HttpRequest::factory([string url[, int request_method HTTP_METH_GET[, array options[, string class_name = "HttpRequest"]]]]) ++ Create a new HttpRequest object instance. */ ++PHP_METHOD(HttpRequest, factory) ++{ ++ char *cn = NULL, *URL = NULL; ++ int cl = 0, URL_len = 0; ++ long meth = -1; ++ zval *options = NULL; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sla!s", &URL, &URL_len, &meth, &options, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_request_object_new_ex, http_request_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ getThis() = return_value; ++ if (URL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ } ++ if (meth > -1) { ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ } ++ if (options) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setoptions", NULL, options); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setOptions([array options]) ++ Set the request options to use. See http_get() for a full list of available options. */ ++PHP_METHOD(HttpRequest, setOptions) ++{ ++ HashKey key = initHashKey(0); ++ HashPosition pos; ++ zval *opts = NULL, *old_opts, *new_opts, *add_opts, **opt; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!/", &opts)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(new_opts); ++ array_init(new_opts); ++ ++ if (!opts || !zend_hash_num_elements(Z_ARRVAL_P(opts))) { ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ RETURN_TRUE; ++ } ++ ++ MAKE_STD_ZVAL(add_opts); ++ array_init(add_opts); ++ /* some options need extra attention -- thus cannot use array_merge() directly */ ++ FOREACH_KEYVAL(pos, opts, key, opt) { ++ if (key.type == HASH_KEY_IS_STRING) { ++#define KEYMATCH(k, s) ((sizeof(s)==k.len) && !strcasecmp(k.str, s)) ++ if (KEYMATCH(key, "headers")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addheaders", NULL, *opt); ++ } else if (KEYMATCH(key, "cookies")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addcookies", NULL, *opt); ++ } else if (KEYMATCH(key, "ssl")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addssloptions", NULL, *opt); ++ } else if (KEYMATCH(key, "url") || KEYMATCH(key, "uri")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "seturl", NULL, *opt); ++ } else if (KEYMATCH(key, "method")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmethod", NULL, *opt); ++ } else if (KEYMATCH(key, "flushcookies")) { ++ getObject(http_request_object, obj); ++ if (i_zend_is_true(*opt)) { ++ http_request_flush_cookies(obj->request); ++ } ++ } else if (KEYMATCH(key, "resetcookies")) { ++ getObject(http_request_object, obj); ++ http_request_reset_cookies(obj->request, (zend_bool) i_zend_is_true(*opt)); ++ } else if (KEYMATCH(key, "enablecookies")) { ++ getObject(http_request_object, obj); ++ http_request_enable_cookies(obj->request); ++ } else if (KEYMATCH(key, "recordHistory")) { ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, *opt TSRMLS_CC); ++ } else if (KEYMATCH(key, "messageClass")) { ++ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmessageclass", NULL, *opt); ++ } else if (Z_TYPE_PP(opt) == IS_NULL) { ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ zend_hash_del(Z_ARRVAL_P(old_opts), key.str, key.len); ++ } ++ } else { ++ ZVAL_ADDREF(*opt); ++ add_assoc_zval_ex(add_opts, key.str, key.len, *opt); ++ } ++ } ++ } ++ ++ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_opts) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts)); ++ } ++ array_join(Z_ARRVAL_P(add_opts), Z_ARRVAL_P(new_opts), 0, 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC); ++ zval_ptr_dtor(&new_opts); ++ zval_ptr_dtor(&add_opts); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getOptions() ++ Get currently set options. */ ++PHP_METHOD(HttpRequest, getOptions) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(options); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setSslOptions([array options]) ++ Set SSL options. */ ++PHP_METHOD(HttpRequest, setSslOptions) ++{ ++ http_request_object_set_options_subr("ssl", 1, 0); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addSslOptions(array options) ++ Set additional SSL options. */ ++PHP_METHOD(HttpRequest, addSslOptions) ++{ ++ http_request_object_set_options_subr("ssl", 0, 0); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getSslOtpions() ++ Get previously set SSL options. */ ++PHP_METHOD(HttpRequest, getSslOptions) ++{ ++ http_request_object_get_options_subr("ssl"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addHeaders(array headers) ++ Add request header name/value pairs. */ ++PHP_METHOD(HttpRequest, addHeaders) ++{ ++ http_request_object_set_options_subr("headers", 0, 1); ++} ++ ++/* {{{ proto bool HttpRequest::setHeaders([array headers]) ++ Set request header name/value pairs. */ ++PHP_METHOD(HttpRequest, setHeaders) ++{ ++ http_request_object_set_options_subr("headers", 1, 1); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getHeaders() ++ Get previously set request headers. */ ++PHP_METHOD(HttpRequest, getHeaders) ++{ ++ http_request_object_get_options_subr("headers"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setCookies([array cookies]) ++ Set cookies. */ ++PHP_METHOD(HttpRequest, setCookies) ++{ ++ http_request_object_set_options_subr("cookies", 1, 0); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addCookies(array cookies) ++ Add cookies. */ ++PHP_METHOD(HttpRequest, addCookies) ++{ ++ http_request_object_set_options_subr("cookies", 0, 0); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getCookies() ++ Get previously set cookies. */ ++PHP_METHOD(HttpRequest, getCookies) ++{ ++ http_request_object_get_options_subr("cookies"); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::enableCookies() ++ Enable automatic sending of received cookies. Note that customly set cookies will be sent anyway. */ ++PHP_METHOD(HttpRequest, enableCookies) ++{ ++ NO_ARGS { ++ getObject(http_request_object, obj); ++ RETURN_SUCCESS(http_request_enable_cookies(obj->request)); ++ } ++ ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::resetCookies([bool session_only = FALSE]) ++ Reset all automatically received/sent cookies. Note that customly set cookies are not affected. */ ++PHP_METHOD(HttpRequest, resetCookies) ++{ ++ zend_bool session_only = 0; ++ getObject(http_request_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &session_only)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(http_request_reset_cookies(obj->request, session_only)); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::flushCookies() ++ Flush internal cookies to the cookiestore file */ ++PHP_METHOD(HttpRequest, flushCookies) ++{ ++ NO_ARGS { ++ getObject(http_request_object, obj); ++ RETURN_SUCCESS(http_request_flush_cookies(obj->request)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setUrl(string url) ++ Set the request URL. */ ++PHP_METHOD(HttpRequest, setUrl) ++{ ++ char *URL = NULL; ++ int URL_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URL, &URL_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getUrl() ++ Get the previously set request URL. */ ++PHP_METHOD(HttpRequest, getUrl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(url); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setMethod(int request_method) ++ Set the request method. */ ++PHP_METHOD(HttpRequest, setMethod) ++{ ++ long meth; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &meth)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequest::getMethod() ++ Get the previously set request method. */ ++PHP_METHOD(HttpRequest, getMethod) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(method); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setContentType(string content_type) ++ Set the content type the post request should have. */ ++PHP_METHOD(HttpRequest, setContentType) ++{ ++ char *ctype; ++ int ct_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (ct_len) { ++ HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE); ++ } ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("contentType")-1, ctype, ct_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getContentType() ++ Get the previously content type. */ ++PHP_METHOD(HttpRequest, getContentType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(contentType); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setQueryData([mixed query_data]) ++ Set the URL query parameters to use, overwriting previously set query parameters. */ ++PHP_METHOD(HttpRequest, setQueryData) ++{ ++ zval *qdata = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!", &qdata)) { ++ RETURN_FALSE; ++ } ++ ++ if ((!qdata) || Z_TYPE_P(qdata) == IS_NULL) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, "", 0 TSRMLS_CC); ++ } else if ((Z_TYPE_P(qdata) == IS_ARRAY) || (Z_TYPE_P(qdata) == IS_OBJECT)) { ++ char *query_data = NULL; ++ ++ if (SUCCESS != http_urlencode_hash(HASH_OF(qdata), &query_data)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data TSRMLS_CC); ++ efree(query_data); ++ } else { ++ zval *data = http_zsep(IS_STRING, qdata); ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, Z_STRVAL_P(data), Z_STRLEN_P(data) TSRMLS_CC); ++ zval_ptr_dtor(&data); ++ } ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getQueryData() ++ Get the current query data in form of an urlencoded query string. */ ++PHP_METHOD(HttpRequest, getQueryData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(queryData); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addQueryData(array query_params) ++ Add parameters to the query parameter list, leaving previously set unchanged. */ ++PHP_METHOD(HttpRequest, addQueryData) ++{ ++ zval *qdata, *old_qdata; ++ char *query_data = NULL; ++ size_t query_data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &qdata)) { ++ RETURN_FALSE; ++ } ++ ++ old_qdata = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryData")-1, 0 TSRMLS_CC); ++ ++ if (SUCCESS != http_urlencode_hash_ex(HASH_OF(qdata), 1, Z_STRVAL_P(old_qdata), Z_STRLEN_P(old_qdata), &query_data, &query_data_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data, query_data_len TSRMLS_CC); ++ efree(query_data); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPostFields(array post_data) ++ Adds POST data entries, leaving previously set unchanged, unless a post entry with the same name already exists. */ ++PHP_METHOD(HttpRequest, addPostFields) ++{ ++ zval *post_data, *old_post, *new_post; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &post_data)) { ++ RETURN_FALSE; ++ } ++ ++ if (zend_hash_num_elements(Z_ARRVAL_P(post_data))) { ++ MAKE_STD_ZVAL(new_post); ++ array_init(new_post); ++ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_post) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post)); ++ } ++ array_join(Z_ARRVAL_P(post_data), Z_ARRVAL_P(new_post), 0, 0); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, new_post TSRMLS_CC); ++ zval_ptr_dtor(&new_post); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPostFields([array post_data]) ++ Set the POST data entries, overwriting previously set POST data. */ ++PHP_METHOD(HttpRequest, setPostFields) ++{ ++ zval *post, *post_data = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", &post_data)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(post); ++ array_init(post); ++ if (post_data && zend_hash_num_elements(Z_ARRVAL_P(post_data))) { ++ array_copy(Z_ARRVAL_P(post_data), Z_ARRVAL_P(post)); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, post TSRMLS_CC); ++ zval_ptr_dtor(&post); ++ ++ RETURN_TRUE; ++} ++/* }}}*/ ++ ++/* {{{ proto array HttpRequest::getPostFields() ++ Get previously set POST data. */ ++PHP_METHOD(HttpRequest, getPostFields) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(postFields); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setBody([string request_body_data]) ++ Set request body to send, overwriting previously set request body. Don't forget to specify a content type. */ ++PHP_METHOD(HttpRequest, setBody) ++{ ++ char *raw_data = NULL; ++ int data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &raw_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!raw_data) { ++ raw_data = ""; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addBody(string request_body_data) ++ Add request body data, leaving previously set request body data unchanged. */ ++PHP_METHOD(HttpRequest, addBody) ++{ ++ char *raw_data; ++ int data_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(data)) { ++ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1); ++ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0'; ++ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, raw_data, data_len); ++ } else { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC); ++ } ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getBody() ++ Get previously set request body data. */ ++PHP_METHOD(HttpRequest, getBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(requestBody); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPostFile(string name, string file[, string content_type = "application/x-octetstream"]) ++ Add a file to the POST request, leaving previously set files unchanged. */ ++PHP_METHOD(HttpRequest, addPostFile) ++{ ++ zval *entry, *old_post, *new_post; ++ char *name, *file, *type = NULL; ++ int name_len, file_len, type_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &name, &name_len, &file, &file_len, &type, &type_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (type_len) { ++ HTTP_CHECK_CONTENT_TYPE(type, RETURN_FALSE); ++ } else { ++ type = "application/x-octetstream"; ++ type_len = sizeof("application/x-octetstream") - 1; ++ } ++ ++ MAKE_STD_ZVAL(entry); ++ array_init(entry); ++ ++ add_assoc_stringl(entry, "name", name, name_len, 1); ++ add_assoc_stringl(entry, "type", type, type_len, 1); ++ add_assoc_stringl(entry, "file", file, file_len, 1); ++ ++ MAKE_STD_ZVAL(new_post); ++ array_init(new_post); ++ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(old_post) == IS_ARRAY) { ++ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post)); ++ } ++ add_next_index_zval(new_post, entry); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, new_post TSRMLS_CC); ++ zval_ptr_dtor(&new_post); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPostFiles([array post_files]) ++ Set files to post, overwriting previously set post files. */ ++PHP_METHOD(HttpRequest, setPostFiles) ++{ ++ zval *files = NULL, *post; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!/", &files)) { ++ RETURN_FALSE; ++ } ++ ++ MAKE_STD_ZVAL(post); ++ array_init(post); ++ if (files && (Z_TYPE_P(files) == IS_ARRAY)) { ++ array_copy(Z_ARRVAL_P(files), Z_ARRVAL_P(post)); ++ } ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, post TSRMLS_CC); ++ zval_ptr_dtor(&post); ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getPostFiles() ++ Get all previously added POST files. */ ++PHP_METHOD(HttpRequest, getPostFiles) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(postFiles); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPutFile([string file]) ++ Set file to put. Affects only PUT requests. */ ++PHP_METHOD(HttpRequest, setPutFile) ++{ ++ char *file = ""; ++ int file_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &file, &file_len)) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putFile")-1, file, file_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getPutFile() ++ Get previously set put file. */ ++PHP_METHOD(HttpRequest, getPutFile) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(putFile); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::setPutData([string put_data]) ++ Set PUT data to send, overwriting previously set PUT data. */ ++PHP_METHOD(HttpRequest, setPutData) ++{ ++ char *put_data = NULL; ++ int data_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &put_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (!put_data) { ++ put_data = ""; ++ } ++ ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequest::addPutData(string put_data) ++ Add PUT data, leaving previously set PUT data unchanged. */ ++PHP_METHOD(HttpRequest, addPutData) ++{ ++ char *put_data; ++ int data_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &put_data, &data_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (data_len) { ++ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putData")-1, 0 TSRMLS_CC); ++ ++ if (Z_STRLEN_P(data)) { ++ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1); ++ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0'; ++ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, put_data, data_len); ++ } else { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC); ++ } ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getPutData() ++ Get previously set PUT data. */ ++PHP_METHOD(HttpRequest, getPutData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(putData); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getResponseData() ++ Get all response data after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ char *body; ++ size_t body_len; ++ zval *headers, *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ array_init(return_value); ++ ++ MAKE_STD_ZVAL(headers); ++ array_init(headers); ++ zend_hash_copy(Z_ARRVAL_P(headers), &msg->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ add_assoc_zval(return_value, "headers", headers); ++ ++ phpstr_data(PHPSTR(msg->message), &body, &body_len); ++ add_assoc_stringl(return_value, "body", body, body_len, 0); ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpRequest::getResponseHeader([string name]) ++ Get response header(s) after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseHeader) ++{ ++ if (return_value_used) { ++ zval *header; ++ char *header_name = NULL; ++ int header_len = 0; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &header_name, &header_len)) { ++ zval *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ if (header_len) { ++ if ((header = http_message_header_ex(msg->message, pretty_key(header_name, header_len, 1, 1), header_len + 1, 0))) { ++ RETURN_ZVAL(header, 1, 1); ++ } ++ } else { ++ array_init(return_value); ++ zend_hash_copy(Z_ARRVAL_P(return_value), &msg->message->hdrs, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ return; ++ } ++ } ++ } ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequest::getResponseCookies([int flags[, array allowed_extras]]) ++ Get response cookie(s) after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseCookies) ++{ ++ if (return_value_used) { ++ long flags = 0; ++ zval *allowed_extras_array = NULL; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|la!", &flags, &allowed_extras_array)) { ++ int i = 0; ++ HashKey key = initHashKey(0); ++ char **allowed_extras = NULL; ++ zval **header = NULL, **entry = NULL, *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ HashPosition pos, pos1, pos2; ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ ++ array_init(return_value); ++ ++ if (allowed_extras_array) { ++ allowed_extras = ecalloc(zend_hash_num_elements(Z_ARRVAL_P(allowed_extras_array)) + 1, sizeof(char *)); ++ FOREACH_VAL(pos, allowed_extras_array, entry) { ++ zval *data = http_zsep(IS_STRING, *entry); ++ allowed_extras[i++] = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); ++ zval_ptr_dtor(&data); ++ } ++ } ++ ++ FOREACH_HASH_KEYVAL(pos1, &msg->message->hdrs, key, header) { ++ if (key.type == HASH_KEY_IS_STRING && !strcasecmp(key.str, "Set-Cookie")) { ++ http_cookie_list list; ++ ++ if (Z_TYPE_PP(header) == IS_ARRAY) { ++ zval **single_header; ++ ++ FOREACH_VAL(pos2, *header, single_header) { ++ zval *data = http_zsep(IS_STRING, *single_header); ++ ++ if (http_parse_cookie_ex(&list, Z_STRVAL_P(data), flags, allowed_extras)) { ++ zval *cookie; ++ ++ MAKE_STD_ZVAL(cookie); ++ object_init(cookie); ++ http_cookie_list_tostruct(&list, cookie); ++ add_next_index_zval(return_value, cookie); ++ http_cookie_list_dtor(&list); ++ } ++ zval_ptr_dtor(&data); ++ } ++ } else { ++ zval *data = http_zsep(IS_STRING, *header); ++ if (http_parse_cookie_ex(&list, Z_STRVAL_P(data), flags, allowed_extras)) { ++ zval *cookie; ++ ++ MAKE_STD_ZVAL(cookie); ++ object_init(cookie); ++ http_cookie_list_tostruct(&list, cookie); ++ add_next_index_zval(return_value, cookie); ++ http_cookie_list_dtor(&list); ++ } ++ zval_ptr_dtor(&data); ++ } ++ } ++ } ++ ++ if (allowed_extras) { ++ for (i = 0; allowed_extras[i]; ++i) { ++ efree(allowed_extras[i]); ++ } ++ efree(allowed_extras); ++ } ++ ++ return; ++ } ++ } ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getResponseBody() ++ Get the response body after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseBody) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ getObjectEx(http_message_object, msg, message); ++ RETURN_PHPSTR_DUP(&msg->message->body); ++ } else { ++ RETURN_FALSE; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequest::getResponseCode() ++ Get the response code after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseCode) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(responseCode); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getResponseStatus() ++ Get the response status (i.e. the string after the response code) after the message has been sent. */ ++PHP_METHOD(HttpRequest, getResponseStatus) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP(responseStatus); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto mixed HttpRequest::getResponseInfo([string name]) ++ Get response info after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseInfo) ++{ ++ if (return_value_used) { ++ zval *info, **infop; ++ char *info_name = NULL; ++ int info_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &info_name, &info_len)) { ++ RETURN_FALSE; ++ } ++ ++ info = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseInfo")-1, 0 TSRMLS_CC); ++ ++ if (Z_TYPE_P(info) != IS_ARRAY) { ++ RETURN_FALSE; ++ } ++ ++ if (info_len && info_name) { ++ if (SUCCESS == zend_hash_find(Z_ARRVAL_P(info), pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) { ++ RETURN_ZVAL(*infop, 1, 0); ++ } else { ++ http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Could not find response info named %s", info_name); ++ RETURN_FALSE; ++ } ++ } else { ++ RETURN_ZVAL(info, 1, 0); ++ } ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto HttpMessage HttpRequest::getResponseMessage() ++ Get the full response as HttpMessage object after the request has been sent. */ ++PHP_METHOD(HttpRequest, getResponseMessage) ++{ ++ NO_ARGS { ++ zval *message; ++ ++ SET_EH_THROW_HTTP(); ++ message = zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(message) == IS_OBJECT) { ++ RETVAL_OBJECT(message, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "HttpRequest does not contain a response message"); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::getRequestMessage() ++ Get sent HTTP message. */ ++PHP_METHOD(HttpRequest, getRequestMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ http_message *msg; ++ getObject(http_request_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) { ++ RETVAL_OBJVAL(http_request_object_message(getThis(), msg), 0); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getRawRequestMessage() ++ Get sent HTTP message. */ ++PHP_METHOD(HttpRequest, getRawRequestMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_request_object, obj); ++ ++ RETURN_PHPSTR_DUP(&obj->request->conv.request); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getRawResponseMessage() ++ Get the entire HTTP response. */ ++PHP_METHOD(HttpRequest, getRawResponseMessage) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_request_object, obj); ++ ++ RETURN_PHPSTR_DUP(&obj->request->conv.response); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::getHistory() ++ Get all sent requests and received responses as an HttpMessage object. */ ++PHP_METHOD(HttpRequest, getHistory) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *hist; ++ ++ SET_EH_THROW_HTTP(); ++ hist = zend_read_property(THIS_CE, getThis(), ZEND_STRS("history")-1, 0 TSRMLS_CC); ++ if (Z_TYPE_P(hist) == IS_OBJECT) { ++ RETVAL_OBJECT(hist, 1); ++ } else { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "The history is empty"); ++ } ++ SET_EH_NORMAL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequest::clearHistory() ++ Clear the history. */ ++PHP_METHOD(HttpRequest, clearHistory) ++{ ++ NO_ARGS { ++ zval *hist; ++ ++ MAKE_STD_ZVAL(hist); ++ ZVAL_NULL(hist); ++ zend_update_property(THIS_CE, getThis(), ZEND_STRS("history")-1, hist TSRMLS_CC); ++ zval_ptr_dtor(&hist); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto string HttpRequest::getMessageClass() ++ Get the message class name. */ ++PHP_METHOD(HttpRequest, getMessageClass) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ RETURN_PROP("messageClass"); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void setMessageClass(string class_name) ++ Set the message class name. */ ++PHP_METHOD(HttpRequest, setMessageClass) ++{ ++ char *cn; ++ int cl; ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &cn, &cl)) { ++ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("messageClass")-1, cn, cl TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpMessage HttpRequest::send() ++ Send the HTTP request. */ ++PHP_METHOD(HttpRequest, send) ++{ ++ getObject(http_request_object, obj); ++ ++ NO_ARGS; ++ ++ SET_EH_THROW_HTTP(); ++ ++ RETVAL_FALSE; ++ ++ if (obj->pool) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot perform HttpRequest::send() while attached to an HttpRequestPool"); ++ } else if (SUCCESS == http_request_object_requesthandler(obj, getThis())) { ++ http_request_exec(obj->request); ++ if (SUCCESS == http_request_object_responsehandler(obj, getThis())) { ++ RETVAL_OBJECT(zend_read_property(THIS_CE, getThis(), ZEND_STRS("responseMessage")-1, 0 TSRMLS_CC), 1); ++ } ++ } ++ ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_request_pool_api.c +@@ -0,0 +1,660 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_request_pool_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#define HTTP_WANT_EVENT ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_persistent_handle_api.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_requestpool_object.h" ++ ++#ifndef HTTP_DEBUG_REQPOOLS ++# define HTTP_DEBUG_REQPOOLS 0 ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++typedef struct _http_request_pool_event_t { ++ struct event evnt; ++ http_request_pool *pool; ++} http_request_pool_event; ++ ++static void http_request_pool_timeout_callback(int socket, short action, void *event_data); ++static void http_request_pool_event_callback(int socket, short action, void *event_data); ++static int http_request_pool_socket_callback(CURL *easy, curl_socket_t s, int action, void *, void *); ++static void http_request_pool_timer_callback(CURLM *multi, long timeout_ms, void *timer_data); ++#endif ++ ++static int http_request_pool_compare_handles(void *h1, void *h2); ++ ++PHP_MINIT_FUNCTION(http_request_pool) ++{ ++ if (SUCCESS != http_persistent_handle_provide("http_request_pool", curl_multi_init, (http_persistent_handle_dtor) curl_multi_cleanup, NULL)) { ++ return FAILURE; ++ } ++ return SUCCESS; ++} ++ ++#ifdef HTTP_HAVE_EVENT ++PHP_RINIT_FUNCTION(http_request_pool) ++{ ++ if (!HTTP_G->request.pool.event.base && !(HTTP_G->request.pool.event.base = event_init())) { ++ return FAILURE; ++ } ++ ++ return SUCCESS; ++} ++#endif ++ ++/* {{{ http_request_pool *http_request_pool_init(http_request_pool *) */ ++PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC) ++{ ++ zend_bool free_pool; ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Initializing request pool %p\n", pool); ++#endif ++ ++ if ((free_pool = (!pool))) { ++ pool = emalloc(sizeof(http_request_pool)); ++ pool->ch = NULL; ++ } ++ ++ if (SUCCESS != http_persistent_handle_acquire("http_request_pool", &pool->ch)) { ++ if (free_pool) { ++ efree(pool); ++ } ++ return NULL; ++ } ++ ++ TSRMLS_SET_CTX(pool->tsrm_ls); ++ ++#ifdef HTTP_HAVE_EVENT ++ pool->timeout = ecalloc(1, sizeof(struct event)); ++ curl_multi_setopt(pool->ch, CURLMOPT_SOCKETDATA, pool); ++ curl_multi_setopt(pool->ch, CURLMOPT_SOCKETFUNCTION, http_request_pool_socket_callback); ++ curl_multi_setopt(pool->ch, CURLMOPT_TIMERDATA, pool); ++ curl_multi_setopt(pool->ch, CURLMOPT_TIMERFUNCTION, http_request_pool_timer_callback); ++#endif ++ ++ pool->unfinished = 0; ++ zend_llist_init(&pool->finished, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0); ++ zend_llist_init(&pool->handles, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Initialized request pool %p\n", pool); ++#endif ++ ++ return pool; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_attach(http_request_pool *, zval *) */ ++PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request) ++{ ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, req, request); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Attaching HttpRequest(#%d) %p to pool %p\n", Z_OBJ_HANDLE_P(request), req, pool); ++#endif ++ ++ if (req->pool) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is already member of %s HttpRequestPool", Z_OBJ_HANDLE_P(request), req->pool == pool ? "this" : "another"); ++ } else if (SUCCESS != http_request_object_requesthandler(req, request)) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not initialize HttpRequest object(#%d) for attaching to the HttpRequestPool", Z_OBJ_HANDLE_P(request)); ++ } else { ++ CURLMcode code = curl_multi_add_handle(pool->ch, req->request->ch); ++ ++ if (CURLM_OK != code) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not attach HttpRequest object(#%d) to the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code)); ++ } else { ++ req->pool = pool; ++ ++ ZVAL_ADDREF(request); ++ zend_llist_add_element(&pool->handles, &request); ++ ++pool->unfinished; ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "> %d HttpRequests attached to pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_detach(http_request_pool *, zval *) */ ++PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request) ++{ ++ CURLMcode code; ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, req, request); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Detaching HttpRequest(#%d) %p from pool %p\n", Z_OBJ_HANDLE_P(request), req, pool); ++#endif ++ ++ if (!req->pool) { ++ /* not attached to any pool */ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "HttpRequest object(#%d) %p is not attached to any HttpRequestPool\n", Z_OBJ_HANDLE_P(request), req); ++#endif ++ } else if (req->pool != pool) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is not attached to this HttpRequestPool", Z_OBJ_HANDLE_P(request)); ++ } else if (req->request->_in_progress_cb) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback", Z_OBJ_HANDLE_P(request)); ++ } else if (CURLM_OK != (code = curl_multi_remove_handle(pool->ch, req->request->ch))) { ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not detach HttpRequest object(#%d) from the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code)); ++ } else { ++ req->pool = NULL; ++ zend_llist_del_element(&pool->finished, request, http_request_pool_compare_handles); ++ zend_llist_del_element(&pool->handles, request, http_request_pool_compare_handles); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ ++ return SUCCESS; ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_apply(http_request_pool *, http_request_pool_apply_func) */ ++PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb) ++{ ++ int count = zend_llist_count(&pool->handles); ++ ++ if (count) { ++ int i = 0; ++ zend_llist_position pos; ++ zval **handle, **handles = emalloc(count * sizeof(zval *)); ++ ++ for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) { ++ handles[i++] = *handle; ++ } ++ ++ /* should never happen */ ++ if (i != count) { ++ zend_error(E_ERROR, "number of fetched request handles do not match overall count"); ++ count = i; ++ } ++ ++ for (i = 0; i < count; ++i) { ++ if (cb(pool, handles[i])) { ++ break; ++ } ++ } ++ efree(handles); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_apply_with_arg(http_request_pool *, http_request_pool_apply_with_arg_func, void *) */ ++PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg) ++{ ++ int count = zend_llist_count(&pool->handles); ++ ++ if (count) { ++ int i = 0; ++ zend_llist_position pos; ++ zval **handle, **handles = emalloc(count * sizeof(zval *)); ++ ++ for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) { ++ handles[i++] = *handle; ++ } ++ ++ /* should never happen */ ++ if (i != count) { ++ zend_error(E_ERROR, "number of fetched request handles do not match overall count"); ++ count = i; ++ } ++ ++ for (i = 0; i < count; ++i) { ++ if (cb(pool, handles[i], arg)) { ++ break; ++ } ++ } ++ efree(handles); ++ } ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_detach_all(http_request_pool *) */ ++PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool) ++{ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Detaching %d requests from pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ http_request_pool_apply(pool, _http_request_pool_detach); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_send(http_request_pool *) */ ++PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Attempt to send %d requests of pool %p\n", zend_llist_count(&pool->handles), pool); ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ do { ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "& Starting event dispatcher of pool %p\n", pool); ++#endif ++ event_base_dispatch(HTTP_G->request.pool.event.base); ++ } while (pool->unfinished); ++ } else ++#endif ++ { ++ while (http_request_pool_perform(pool)) { ++ if (SUCCESS != http_request_pool_select(pool)) { ++#ifdef PHP_WIN32 ++ /* see http://msdn.microsoft.com/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp */ ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "WinSock error: %d", WSAGetLastError()); ++#else ++ http_error(HE_WARNING, HTTP_E_SOCKET, strerror(errno)); ++#endif ++ return FAILURE; ++ } ++ } ++ } ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Finished sending %d HttpRequests of pool %p (still unfinished: %d)\n", zend_llist_count(&pool->handles), pool, pool->unfinished); ++#endif ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_dtor(http_request_pool *) */ ++PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Destructing request pool %p\n", pool); ++#endif ++ ++#ifdef HTTP_HAVE_EVENT ++ efree(pool->timeout); ++#endif ++ ++ http_request_pool_detach_all(pool); ++ ++ pool->unfinished = 0; ++ zend_llist_clean(&pool->finished); ++ zend_llist_clean(&pool->handles); ++ http_persistent_handle_release("http_request_pool", &pool->ch); ++} ++/* }}} */ ++ ++#ifdef PHP_WIN32 ++# define SELECT_ERROR SOCKET_ERROR ++#else ++# define SELECT_ERROR -1 ++#endif ++ ++/* {{{ STATUS http_request_pool_select(http_request_pool *) */ ++PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool) ++{ ++ return http_request_pool_select_ex(pool, NULL); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_request_pool_select_ex(http_request_pool *, struct timeval *) */ ++PHP_HTTP_API STATUS _http_request_pool_select_ex(http_request_pool *pool, struct timeval *custom_timeout) ++{ ++ int MAX; ++ fd_set R, W, E; ++ struct timeval timeout; ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest callbacks"); ++ return FAILURE; ++ } ++#endif ++ ++ if (custom_timeout && timerisset(custom_timeout)) { ++ timeout = *custom_timeout; ++ } else { ++ http_request_pool_timeout(pool, &timeout); ++ } ++ ++ FD_ZERO(&R); ++ FD_ZERO(&W); ++ FD_ZERO(&E); ++ ++ if (CURLM_OK == curl_multi_fdset(pool->ch, &R, &W, &E, &MAX)) { ++ if (MAX == -1) { ++ http_sleep((double) timeout.tv_sec + (double) (timeout.tv_usec / HTTP_MCROSEC)); ++ return SUCCESS; ++ } else if (SELECT_ERROR != select(MAX + 1, &R, &W, &E, &timeout)) { ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ int http_request_pool_perform(http_request_pool *) */ ++PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool) ++{ ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#ifdef HTTP_HAVE_EVENT ++ if (pool->useevents) { ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest callbacks"); ++ return FAILURE; ++ } ++#endif ++ ++ while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(pool->ch, &pool->unfinished)); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "%u unfinished requests of pool %p remaining\n", pool->unfinished, pool); ++#endif ++ ++ http_request_pool_responsehandler(pool); ++ ++ return pool->unfinished; ++} ++/* }}} */ ++ ++/* {{{ void http_request_pool_responsehandler(http_request_pool *) */ ++void _http_request_pool_responsehandler(http_request_pool *pool) ++{ ++ CURLMsg *msg; ++ int remaining = 0; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++ do { ++ msg = curl_multi_info_read(pool->ch, &remaining); ++ if (msg && CURLMSG_DONE == msg->msg) { ++ if (CURLE_OK != msg->data.result) { ++ http_request_storage *st = http_request_storage_get(msg->easy_handle); ++ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), st?st->errorbuffer:"", st?st->url:""); ++ } ++ http_request_pool_apply_with_arg(pool, _http_request_pool_apply_responsehandler, msg->easy_handle); ++ } ++ } while (remaining); ++} ++/* }}} */ ++ ++/* {{{ int http_request_pool_apply_responsehandler(http_request_pool *, zval *, void *) */ ++int _http_request_pool_apply_responsehandler(http_request_pool *pool, zval *req, void *ch) ++{ ++#ifdef ZTS ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++#endif ++ getObjectEx(http_request_object, obj, req); ++ ++ if ((!ch) || obj->request->ch == (CURL *) ch) { ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Fetching data from HttpRequest(#%d) %p of pool %p\n", Z_OBJ_HANDLE_P(req), obj, obj->pool); ++#endif ++ ++ ZVAL_ADDREF(req); ++ zend_llist_add_element(&obj->pool->finished, &req); ++ http_request_object_responsehandler(obj, req); ++ return 1; ++ } ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ struct timeval *_http_request_pool_timeout(http_request_pool *, struct timeval *) */ ++struct timeval *_http_request_pool_timeout(http_request_pool *pool, struct timeval *timeout) ++{ ++#ifdef HAVE_CURL_MULTI_TIMEOUT ++ long max_tout = 1000; ++ ++ if ((CURLM_OK == curl_multi_timeout(pool->ch, &max_tout)) && (max_tout > 0)) { ++ timeout->tv_sec = max_tout / 1000; ++ timeout->tv_usec = (max_tout % 1000) * 1000; ++ } else { ++#endif ++ timeout->tv_sec = 0; ++ timeout->tv_usec = 1000; ++#ifdef HAVE_CURL_MULTI_TIMEOUT ++ } ++#endif ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Calculating timeout (%lu, %lu) of pool %p\n", (ulong) timeout->tv_sec, (ulong) timeout->tv_usec, pool); ++#endif ++ ++ return timeout; ++} ++/* }}} */ ++ ++/*#*/ ++ ++/* {{{ static int http_request_pool_compare_handles(void *, void *) */ ++static int http_request_pool_compare_handles(void *h1, void *h2) ++{ ++ return (Z_OBJ_HANDLE_PP((zval **) h1) == Z_OBJ_HANDLE_P((zval *) h2)); ++} ++/* }}} */ ++ ++#ifdef HTTP_HAVE_EVENT ++/* {{{ static void http_request_pool_timeout_callback(int, short, void *) */ ++static void http_request_pool_timeout_callback(int socket, short action, void *event_data) ++{ ++ http_request_pool *pool = event_data; ++ ++ if (pool->useevents) { ++ CURLMcode rc; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Timeout occurred of pool %p\n", pool); ++#endif ++ ++ while (CURLM_CALL_MULTI_PERFORM == (rc = curl_multi_socket(pool->ch, CURL_SOCKET_TIMEOUT, &pool->unfinished))); ++ ++ if (CURLM_OK != rc) { ++ http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc)); ++ } ++ ++ http_request_pool_responsehandler(pool); ++ } ++} ++/* }}} */ ++ ++/* {{{ static void http_request_pool_event_callback(int, short, void *) */ ++static void http_request_pool_event_callback(int socket, short action, void *event_data) ++{ ++ http_request_pool_event *ev = event_data; ++ http_request_pool *pool = ev->pool; ++ ++ if (pool->useevents) { ++ CURLMcode rc = CURLE_OK; ++ TSRMLS_FETCH_FROM_CTX(ev->pool->tsrm_ls); ++ ++#if HTTP_DEBUG_REQPOOLS ++ { ++ static const char event_strings[][20] = {"NONE","TIMEOUT","READ","TIMEOUT|READ","WRITE","TIMEOUT|WRITE","READ|WRITE","TIMEOUT|READ|WRITE","SIGNAL"}; ++ fprintf(stderr, "Event on socket %d (%s) event %p of pool %p\n", socket, event_strings[action], ev, pool); ++ } ++#endif ++ ++ /* don't use 'ev' below this loop as it might 've been freed in the socket callback */ ++ do { ++#ifdef HAVE_CURL_MULTI_SOCKET_ACTION ++ switch (action & (EV_READ|EV_WRITE)) { ++ case EV_READ: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_IN, &pool->unfinished); ++ break; ++ case EV_WRITE: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_OUT, &pool->unfinished); ++ break; ++ case EV_READ|EV_WRITE: ++ rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_IN|CURL_CSELECT_OUT, &pool->unfinished); ++ break; ++ default: ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "Unknown event %d", (int) action); ++ return; ++ } ++#else ++ rc = curl_multi_socket(pool->ch, socket, &pool->unfinished); ++#endif ++ } while (CURLM_CALL_MULTI_PERFORM == rc); ++ ++ switch (rc) { ++ case CURLM_BAD_SOCKET: ++#if 0 ++ fprintf(stderr, "!!! Bad socket: %d (%d)\n", socket, (int) action); ++#endif ++ case CURLM_OK: ++ break; ++ default: ++ http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc)); ++ break; ++ } ++ ++ http_request_pool_responsehandler(pool); ++ ++ /* remove timeout if there are no transfers left */ ++ if (!pool->unfinished && event_initialized(pool->timeout) && event_pending(pool->timeout, EV_TIMEOUT, NULL)) { ++ event_del(pool->timeout); ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Removed timeout of pool %p\n", pool); ++#endif ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ static int http_request_pool_socket_callback(CURL *, curl_socket_t, int, void *, void *) */ ++static int http_request_pool_socket_callback(CURL *easy, curl_socket_t sock, int action, void *socket_data, void *assign_data) ++{ ++ http_request_pool *pool = socket_data; ++ ++ if (pool->useevents) { ++ int events = EV_PERSIST; ++ http_request_pool_event *ev = assign_data; ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ ++ if (!ev) { ++ ev = ecalloc(1, sizeof(http_request_pool_event)); ++ ev->pool = pool; ++ curl_multi_assign(pool->ch, sock, ev); ++ event_base_set(HTTP_G->request.pool.event.base, &ev->evnt); ++ } else { ++ event_del(&ev->evnt); ++ } ++ ++#if HTTP_DEBUG_REQPOOLS ++ { ++ static const char action_strings[][8] = {"NONE", "IN", "OUT", "INOUT", "REMOVE"}; ++ http_request *r; ++ curl_easy_getinfo(easy, CURLINFO_PRIVATE, &r); ++ fprintf(stderr, "Callback on socket %2d (%8s) event %p of pool %p (%d)\n", (int) sock, action_strings[action], ev, pool, pool->unfinished); ++ } ++#endif ++ ++ switch (action) { ++ case CURL_POLL_IN: ++ events |= EV_READ; ++ break; ++ case CURL_POLL_OUT: ++ events |= EV_WRITE; ++ break; ++ case CURL_POLL_INOUT: ++ events |= EV_READ|EV_WRITE; ++ break; ++ ++ case CURL_POLL_REMOVE: ++ efree(ev); ++ case CURL_POLL_NONE: ++ return 0; ++ ++ default: ++ http_error_ex(HE_WARNING, HTTP_E_SOCKET, "Unknown socket action %d", action); ++ return -1; ++ } ++ ++ event_set(&ev->evnt, sock, events, http_request_pool_event_callback, ev); ++ event_add(&ev->evnt, NULL); ++ } ++ ++ return 0; ++} ++/* }}} */ ++ ++/* {{{ static void http_request_pool_timer_callback(CURLM *, long, void*) */ ++static void http_request_pool_timer_callback(CURLM *multi, long timeout_ms, void *timer_data) ++{ ++ http_request_pool *pool = timer_data; ++ ++ if (pool->useevents) { ++ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls); ++ struct timeval timeout; ++ ++ if (!event_initialized(pool->timeout)) { ++ event_set(pool->timeout, -1, 0, http_request_pool_timeout_callback, pool); ++ event_base_set(HTTP_G->request.pool.event.base, pool->timeout); ++ } else if (event_pending(pool->timeout, EV_TIMEOUT, NULL)) { ++ event_del(pool->timeout); ++ } ++ ++ if (timeout_ms > 0) { ++ timeout.tv_sec = timeout_ms / 1000; ++ timeout.tv_usec = (timeout_ms % 1000) * 1000; ++ } else { ++ http_request_pool_timeout(pool, &timeout); ++ } ++ ++ event_add(pool->timeout, &timeout); ++ ++#if HTTP_DEBUG_REQPOOLS ++ fprintf(stderr, "Updating timeout %lu (%lu, %lu) of pool %p\n", (ulong) timeout_ms, (ulong) timeout.tv_sec, (ulong) timeout.tv_usec, pool); ++#endif ++ } ++} ++/* }}} */ ++#endif /* HTTP_HAVE_EVENT */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_requestdatashare_object.c +@@ -0,0 +1,315 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_requestdatashare_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_datashare_api.h" ++#include "php_http_requestdatashare_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestDataShare, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequestDataShare, method, 0) ++#define HTTP_RSHARE_ME(method, visibility) PHP_ME(HttpRequestDataShare, method, HTTP_ARGS(HttpRequestDataShare, method), visibility) ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++HTTP_EMPTY_ARGS(__destruct); ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_BEGIN_ARGS(attach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++HTTP_BEGIN_ARGS(detach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(reset); ++ ++HTTP_BEGIN_ARGS(factory, 0) ++ HTTP_ARG_VAL(global, 0) ++ HTTP_ARG_VAL(class_name, 0) ++HTTP_END_ARGS; ++ ++#ifndef WONKY ++HTTP_BEGIN_ARGS(singleton, 0) ++ HTTP_ARG_VAL(global, 0) ++HTTP_END_ARGS; ++#endif ++ ++ ++#define http_requestdatashare_object_read_prop _http_requestdatashare_object_read_prop ++static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_requestdatashare_object_write_prop _http_requestdatashare_object_write_prop ++static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC); ++#define http_requestdatashare_instantiate(t, g) _http_requestdatashare_instantiate((t), (g) TSRMLS_CC) ++static inline zval *_http_requestdatashare_instantiate(zval *this_ptr, zend_bool global TSRMLS_DC); ++ ++#define THIS_CE http_requestdatashare_object_ce ++zend_class_entry *http_requestdatashare_object_ce; ++zend_function_entry http_requestdatashare_object_fe[] = { ++ HTTP_RSHARE_ME(__destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) ++ HTTP_RSHARE_ME(count, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(attach, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(reset, ZEND_ACC_PUBLIC) ++ HTTP_RSHARE_ME(factory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#ifndef WONKY ++ HTTP_RSHARE_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ++#endif ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_requestdatashare_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_requestdatashare_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequestDataShare, http_requestdatashare_object, NULL, 0); ++ http_requestdatashare_object_handlers.clone_obj = NULL; ++ http_requestdatashare_object_handlers.read_property = http_requestdatashare_object_read_prop; ++ http_requestdatashare_object_handlers.write_property = http_requestdatashare_object_write_prop; ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++ zend_class_implements(http_requestdatashare_object_ce TSRMLS_CC, 1, spl_ce_Countable); ++#endif ++ ++ zend_declare_property_null(THIS_CE, ZEND_STRS("instance")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("cookie")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("dns")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("ssl")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("connect")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_requestdatashare_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ return http_requestdatashare_object_new_ex(ce, NULL, NULL); ++} ++ ++zend_object_value _http_requestdatashare_object_new_ex(zend_class_entry *ce, http_request_datashare *share, http_requestdatashare_object **ptr TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_requestdatashare_object *o; ++ ++ o = ecalloc(1, sizeof(http_requestdatashare_object)); ++ o->zo.ce = ce; ++ ++ if (share) { ++ o->share = share; ++ } else { ++ o->share = http_request_datashare_new(); ++ } ++ ++ if (ptr) { ++ *ptr = o; ++ } ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_requestdatashare_object, o); ++ ov.handlers = &http_requestdatashare_object_handlers; ++ ++ return ov; ++} ++ ++void _http_requestdatashare_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_requestdatashare_object *o = (http_requestdatashare_object *) object; ++ ++ if (!o->share->persistent) { ++ http_request_datashare_free(&o->share); ++ } ++ freeObject(o); ++} ++ ++static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ if (type == BP_VAR_W && zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)) { ++ zend_error(E_ERROR, "Cannot access HttpRequestDataShare default properties by reference or array key/index"); ++ return NULL; ++ } ++ ++ return zend_get_std_object_handlers()->read_property(object, member, type ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC) ++{ ++ if (zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)) { ++ int status; ++ getObjectEx(http_requestdatashare_object, obj, object); ++ ++ status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), (zend_bool) i_zend_is_true(value)); ++ if (SUCCESS != status) { ++ return; ++ } ++ } ++ ++ zend_get_std_object_handlers()->write_property(object, member, value ZEND_LITERAL_KEY_CC TSRMLS_CC); ++} ++ ++/* {{{ proto void HttpRequestDataShare::__destruct() ++ Clean up HttpRequestDataShare object. */ ++PHP_METHOD(HttpRequestDataShare, __destruct) ++{ ++ NO_ARGS { ++ getObject(http_requestdatashare_object, obj); ++ http_request_datashare_detach_all(obj->share); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestDataShare::count() ++ Implements Countable::count(). */ ++PHP_METHOD(HttpRequestDataShare, count) ++{ ++ getObject(http_requestdatashare_object, obj); ++ ++ NO_ARGS; ++ ++ RETURN_LONG(zend_llist_count(HTTP_RSHARE_HANDLES(obj->share))); ++} ++/* }}} */ ++ ++PHP_METHOD(HttpRequestDataShare, attach) ++{ ++ zval *request; ++ getObject(http_requestdatashare_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_request_datashare_attach(obj->share, request)); ++} ++ ++PHP_METHOD(HttpRequestDataShare, detach) ++{ ++ zval *request; ++ getObject(http_requestdatashare_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(http_request_datashare_detach(obj->share, request)); ++} ++ ++PHP_METHOD(HttpRequestDataShare, reset) ++{ ++ NO_ARGS { ++ getObject(http_requestdatashare_object, obj); ++ http_request_datashare_detach_all(obj->share); ++ } ++} ++ ++PHP_METHOD(HttpRequestDataShare, factory) ++{ ++ zend_bool global = 0; ++ char *cn = NULL; ++ int cl = 0; ++ zend_object_value ov; ++ ++ SET_EH_THROW_HTTP(); ++ if ( SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bs", &global, &cn, &cl) && ++ SUCCESS == http_object_new(&ov, cn, cl, _http_requestdatashare_object_new_ex, http_requestdatashare_object_ce, NULL, NULL)) { ++ RETVAL_OBJVAL(ov, 0); ++ http_requestdatashare_instantiate(return_value, global); ++ } ++ SET_EH_NORMAL(); ++} ++ ++#ifndef WONKY ++/* {{{ proto static HttpRequestDataShare HttpRequestDataShare::singleton([bool global = false]) ++ Get a single instance (differentiates between the global setting). */ ++PHP_METHOD(HttpRequestDataShare, singleton) ++{ ++ zend_bool global = 0; ++ zval *instance = *zend_std_get_static_property(THIS_CE, ZEND_STRS("instance")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &global)) { ++ zval **zobj_ptr = NULL, *zobj = NULL; ++ ++ if (Z_TYPE_P(instance) == IS_ARRAY) { ++ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) { ++ RETVAL_ZVAL(*zobj_ptr, 1, 0); ++ } else { ++ zobj = http_requestdatashare_instantiate(NULL, global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ } ++ } else { ++ MAKE_STD_ZVAL(instance); ++ array_init(instance); ++ ++ zobj = http_requestdatashare_instantiate(NULL, global); ++ add_index_zval(instance, global, zobj); ++ RETVAL_OBJECT(zobj, 1); ++ ++ zend_update_static_property(THIS_CE, ZEND_STRS("instance")-1, instance TSRMLS_CC); ++ zval_ptr_dtor(&instance); ++ } ++ } ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++#endif /* !WONKY */ ++ ++static inline zval *_http_requestdatashare_instantiate(zval *this_ptr, zend_bool global TSRMLS_DC) ++{ ++ if (!this_ptr) { ++ MAKE_STD_ZVAL(this_ptr); ++ Z_TYPE_P(this_ptr) = IS_OBJECT; ++ this_ptr->value.obj = http_requestdatashare_object_new_ex(http_requestdatashare_object_ce, global ? http_request_datashare_global_get() : NULL, NULL); ++ } ++ if (global) { ++ if (HTTP_G->request.datashare.cookie) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("cookie")-1, HTTP_G->request.datashare.cookie TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.dns) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("dns")-1, HTTP_G->request.datashare.dns TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.ssl) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("ssl")-1, HTTP_G->request.datashare.ssl TSRMLS_CC); ++ } ++ if (HTTP_G->request.datashare.connect) { ++ zend_update_property_bool(THIS_CE, getThis(), ZEND_STRS("connect")-1, HTTP_G->request.datashare.connect TSRMLS_CC); ++ } ++ } ++ return this_ptr; ++} ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_requestpool_object.c +@@ -0,0 +1,466 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_requestpool_object.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_CURL ++#include "php_http.h" ++ ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ ++#include "zend_interfaces.h" ++ ++#include "php_http_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_request_api.h" ++#include "php_http_request_object.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_requestpool_object.h" ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++/* SPL doesn't install its headers */ ++extern PHPAPI zend_class_entry *spl_ce_Countable; ++#endif ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestPool, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpRequestPool, method, 0) ++#define HTTP_REQPOOL_ME(method, visibility) PHP_ME(HttpRequestPool, method, HTTP_ARGS(HttpRequestPool, method), visibility) ++ ++HTTP_EMPTY_ARGS(__construct); ++ ++HTTP_EMPTY_ARGS(__destruct); ++HTTP_EMPTY_ARGS(reset); ++ ++HTTP_BEGIN_ARGS(attach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(detach, 1) ++ HTTP_ARG_OBJ(HttpRequest, request, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(send); ++HTTP_EMPTY_ARGS(socketPerform); ++HTTP_BEGIN_ARGS(socketSelect, 0) ++ HTTP_ARG_VAL(timeout, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(valid); ++HTTP_EMPTY_ARGS(current); ++HTTP_EMPTY_ARGS(key); ++HTTP_EMPTY_ARGS(next); ++HTTP_EMPTY_ARGS(rewind); ++ ++HTTP_EMPTY_ARGS(count); ++ ++HTTP_EMPTY_ARGS(getAttachedRequests); ++HTTP_EMPTY_ARGS(getFinishedRequests); ++ ++HTTP_BEGIN_ARGS(enablePipelining, 0) ++ HTTP_ARG_VAL(enable, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(enableEvents, 0) ++ HTTP_ARG_VAL(enable, 0) ++HTTP_END_ARGS; ++ ++zend_class_entry *http_requestpool_object_ce; ++zend_function_entry http_requestpool_object_fe[] = { ++ HTTP_REQPOOL_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) ++ HTTP_REQPOOL_ME(__destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) ++ HTTP_REQPOOL_ME(attach, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(detach, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(reset, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(socketPerform, ZEND_ACC_PROTECTED) ++ HTTP_REQPOOL_ME(socketSelect, ZEND_ACC_PROTECTED) ++ ++ /* implements Iterator */ ++ HTTP_REQPOOL_ME(valid, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(current, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(key, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(next, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(rewind, ZEND_ACC_PUBLIC) ++ ++ /* implmenents Countable */ ++ HTTP_REQPOOL_ME(count, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(getAttachedRequests, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(getFinishedRequests, ZEND_ACC_PUBLIC) ++ ++ HTTP_REQPOOL_ME(enablePipelining, ZEND_ACC_PUBLIC) ++ HTTP_REQPOOL_ME(enableEvents, ZEND_ACC_PUBLIC) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++static zend_object_handlers http_requestpool_object_handlers; ++ ++PHP_MINIT_FUNCTION(http_requestpool_object) ++{ ++ HTTP_REGISTER_CLASS_EX(HttpRequestPool, http_requestpool_object, NULL, 0); ++ http_requestpool_object_handlers.clone_obj = NULL; ++ ++#if defined(HAVE_SPL) && !defined(WONKY) ++ zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); ++#else ++ zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 1, zend_ce_iterator); ++#endif ++ ++ return SUCCESS; ++} ++ ++zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC) ++{ ++ zend_object_value ov; ++ http_requestpool_object *o; ++ ++ o = ecalloc(1, sizeof(http_requestpool_object)); ++ o->zo.ce = ce; ++ ++ http_request_pool_init(&o->pool); ++ ++ ALLOC_HASHTABLE(OBJ_PROP(o)); ++ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0); ++ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); ++ ++ ov.handle = putObject(http_requestpool_object, o); ++ ov.handlers = &http_requestpool_object_handlers; ++ ++ return ov; ++} ++ ++void _http_requestpool_object_free(zend_object *object TSRMLS_DC) ++{ ++ http_requestpool_object *o = (http_requestpool_object *) object; ++ ++ http_request_pool_dtor(&o->pool); ++ freeObject(o); ++} ++ ++#define http_requestpool_object_llist2array _http_requestpool_object_llist2array ++static void _http_requestpool_object_llist2array(zval **req, zval *array TSRMLS_DC) ++{ ++ ZVAL_ADDREF(*req); ++ add_next_index_zval(array, *req); ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto void HttpRequestPool::__construct([HttpRequest request[, ...]]) ++ Creates a new HttpRequestPool object instance. */ ++PHP_METHOD(HttpRequestPool, __construct) ++{ ++ int argc = ZEND_NUM_ARGS(); ++ zval ***argv = safe_emalloc(argc, sizeof(zval *), 0); ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_get_parameters_array_ex(argc, argv)) { ++ int i; ++ ++ for (i = 0; i < argc; ++i) { ++ if (Z_TYPE_PP(argv[i]) == IS_OBJECT && instanceof_function(Z_OBJCE_PP(argv[i]), http_request_object_ce TSRMLS_CC)) { ++ http_request_pool_attach(&obj->pool, *(argv[i])); ++ } ++ } ++ } ++ efree(argv); ++ http_final(HTTP_EX_CE(request_pool)); ++ SET_EH_NORMAL(); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::__destruct() ++ Clean up HttpRequestPool object. */ ++PHP_METHOD(HttpRequestPool, __destruct) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ http_request_pool_detach_all(&obj->pool); ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::reset() ++ Detach all attached HttpRequest objects. */ ++PHP_METHOD(HttpRequestPool, reset) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ obj->iterator.pos = 0; ++ http_request_pool_detach_all(&obj->pool); ++} ++ ++/* {{{ proto bool HttpRequestPool::attach(HttpRequest request) ++ Attach an HttpRequest object to this HttpRequestPool. WARNING: set all options prior attaching! */ ++PHP_METHOD(HttpRequestPool, attach) ++{ ++ zval *request; ++ STATUS status = FAILURE; ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ if (obj->iterator.pos > 0 && obj->iterator.pos < zend_llist_count(&obj->pool.handles)) { ++ http_error(HE_THROW, HTTP_E_REQUEST_POOL, "Cannot attach to the HttpRequestPool while the iterator is active"); ++ } else { ++ status = http_request_pool_attach(&obj->pool, request); ++ } ++ } ++ SET_EH_NORMAL(); ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::detach(HttpRequest request) ++ Detach an HttpRequest object from this HttpRequestPool. */ ++PHP_METHOD(HttpRequestPool, detach) ++{ ++ zval *request; ++ STATUS status = FAILURE; ++ getObject(http_requestpool_object, obj); ++ ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, http_request_object_ce)) { ++ obj->iterator.pos = -1; ++ status = http_request_pool_detach(&obj->pool, request); ++ } ++ SET_EH_NORMAL(); ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::send() ++ Send all attached HttpRequest objects in parallel. */ ++PHP_METHOD(HttpRequestPool, send) ++{ ++ STATUS status; ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ SET_EH_THROW_HTTP(); ++ status = http_request_pool_send(&obj->pool); ++ SET_EH_NORMAL(); ++ ++ /* rethrow as HttpRequestPoolException */ ++ http_final(HTTP_EX_CE(request_pool)); ++ ++ RETURN_SUCCESS(status); ++} ++/* }}} */ ++ ++/* {{{ proto protected bool HttpRequestPool::socketPerform() ++ Returns TRUE until each request has finished its transaction. */ ++PHP_METHOD(HttpRequestPool, socketPerform) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ if (0 < http_request_pool_perform(&obj->pool)) { ++ RETURN_TRUE; ++ } else { ++ RETURN_FALSE; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto protected bool HttpRequestPool::socketSelect([double timeout]) */ ++PHP_METHOD(HttpRequestPool, socketSelect) ++{ ++ double timeout = 0; ++ struct timeval custom_timeout, *custom_timeout_ptr = NULL; ++ getObject(http_requestpool_object, obj); ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|d", &timeout)) { ++ RETURN_FALSE; ++ } ++ if (ZEND_NUM_ARGS() && timeout > 0) { ++ custom_timeout.tv_sec = (time_t) timeout; ++ custom_timeout.tv_usec = HTTP_USEC(timeout) % HTTP_MCROSEC; ++ custom_timeout_ptr = &custom_timeout; ++ } ++ ++ RETURN_SUCCESS(http_request_pool_select_ex(&obj->pool, custom_timeout_ptr)); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::valid() ++ Implements Iterator::valid(). */ ++PHP_METHOD(HttpRequestPool, valid) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_requestpool_object, obj); ++ RETURN_BOOL(obj->iterator.pos >= 0 && obj->iterator.pos < zend_llist_count(&obj->pool.handles)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto HttpRequest HttpRequestPool::current() ++ Implements Iterator::current(). */ ++PHP_METHOD(HttpRequestPool, current) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ long pos = 0; ++ zval **current = NULL; ++ zend_llist_position lpos; ++ getObject(http_requestpool_object, obj); ++ ++ if (obj->iterator.pos < zend_llist_count(&obj->pool.handles)) { ++ for ( current = zend_llist_get_first_ex(&obj->pool.handles, &lpos); ++ current && obj->iterator.pos != pos++; ++ current = zend_llist_get_next_ex(&obj->pool.handles, &lpos)); ++ if (current) { ++ RETURN_OBJECT(*current, 1); ++ } ++ } ++ RETURN_NULL(); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestPool::key() ++ Implements Iterator::key(). */ ++PHP_METHOD(HttpRequestPool, key) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ getObject(http_requestpool_object, obj); ++ RETURN_LONG(obj->iterator.pos); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::next() ++ Implements Iterator::next(). */ ++PHP_METHOD(HttpRequestPool, next) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ ++(obj->iterator.pos); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto void HttpRequestPool::rewind() ++ Implements Iterator::rewind(). */ ++PHP_METHOD(HttpRequestPool, rewind) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ obj->iterator.pos = 0; ++ } ++} ++/* }}} */ ++ ++/* {{{ proto int HttpRequestPool::count() ++ Implements Countable::count(). */ ++PHP_METHOD(HttpRequestPool, count) ++{ ++ NO_ARGS { ++ getObject(http_requestpool_object, obj); ++ RETURN_LONG((long) zend_llist_count(&obj->pool.handles)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequestPool::getAttachedRequests() ++ Get attached HttpRequest objects. */ ++PHP_METHOD(HttpRequestPool, getAttachedRequests) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ array_init(return_value); ++ zend_llist_apply_with_argument(&obj->pool.handles, ++ (llist_apply_with_arg_func_t) http_requestpool_object_llist2array, ++ return_value TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ proto array HttpRequestPool::getFinishedRequests() ++ Get attached HttpRequest objects that already have finished their work. */ ++PHP_METHOD(HttpRequestPool, getFinishedRequests) ++{ ++ getObject(http_requestpool_object, obj); ++ ++ NO_ARGS; ++ ++ array_init(return_value); ++ zend_llist_apply_with_argument(&obj->pool.finished, ++ (llist_apply_with_arg_func_t) http_requestpool_object_llist2array, ++ return_value TSRMLS_CC); ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::enablePipelining([bool enable = true]) ++ Enables pipelining support for all attached requests if support in libcurl is given. */ ++PHP_METHOD(HttpRequestPool, enablePipelining) ++{ ++ zend_bool enable = 1; ++#if defined(HAVE_CURL_MULTI_SETOPT) && HTTP_CURL_VERSION(7,16,0) ++ getObject(http_requestpool_object, obj); ++#endif ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enable)) { ++ RETURN_FALSE; ++ } ++#if defined(HAVE_CURL_MULTI_SETOPT) && HTTP_CURL_VERSION(7,16,0) ++ if (CURLM_OK == curl_multi_setopt(obj->pool.ch, CURLMOPT_PIPELINING, (long) enable)) { ++ RETURN_TRUE; ++ } ++#endif ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++/* {{{ proto bool HttpRequestPool::enableEvents([bool enable = true]) ++ Enables event-driven I/O if support in libcurl is given. */ ++PHP_METHOD(HttpRequestPool, enableEvents) ++{ ++ zend_bool enable = 1; ++#if defined(HTTP_HAVE_EVENT) ++ getObject(http_requestpool_object, obj); ++#endif ++ ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enable)) { ++#if defined(HTTP_HAVE_EVENT) ++ obj->pool.useevents = enable; ++ RETURN_TRUE; ++#endif ++ } ++ RETURN_FALSE; ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_response_object.c +@@ -0,0 +1,915 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_response_object.c 298891 2010-05-03 08:26:38Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++/* broken static properties in PHP 5.0 */ ++#if defined(ZEND_ENGINE_2) && !defined(WONKY) ++ ++#include "php_ini.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_exception_object.h" ++#include "php_http_headers_api.h" ++#include "php_http_response_object.h" ++#include "php_http_send_api.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpResponse, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpResponse, method, 0) ++#define HTTP_RESPONSE_ME(method, visibility) PHP_ME(HttpResponse, method, HTTP_ARGS(HttpResponse, method), visibility|ZEND_ACC_STATIC) ++#define HTTP_RESPONSE_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpResponse, method)) ++ ++HTTP_BEGIN_ARGS(setHeader, 1) ++ HTTP_ARG_VAL(name, 0) ++ HTTP_ARG_VAL(value, 0) ++ HTTP_ARG_VAL(replace, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(getHeader, 0) ++ HTTP_ARG_VAL(name, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getETag); ++HTTP_BEGIN_ARGS(setETag, 1) ++ HTTP_ARG_VAL(etag, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getLastModified); ++HTTP_BEGIN_ARGS(setLastModified, 1) ++ HTTP_ARG_VAL(timestamp, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCache); ++HTTP_BEGIN_ARGS(setCache, 1) ++ HTTP_ARG_VAL(cache, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getGzip); ++HTTP_BEGIN_ARGS(setGzip, 1) ++ HTTP_ARG_VAL(gzip, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getCacheControl); ++HTTP_BEGIN_ARGS(setCacheControl, 1) ++ HTTP_ARG_VAL(cache_control, 0) ++ HTTP_ARG_VAL(max_age, 0) ++ HTTP_ARG_VAL(must_revalidate, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentType); ++HTTP_BEGIN_ARGS(setContentType, 1) ++ HTTP_ARG_VAL(content_type, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(guessContentType, 1) ++ HTTP_ARG_VAL(magic_file, 0) ++ HTTP_ARG_VAL(magic_mode, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getContentDisposition); ++HTTP_BEGIN_ARGS(setContentDisposition, 1) ++ HTTP_ARG_VAL(filename, 0) ++ HTTP_ARG_VAL(send_inline, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getThrottleDelay); ++HTTP_BEGIN_ARGS(setThrottleDelay, 1) ++ HTTP_ARG_VAL(seconds, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getBufferSize); ++HTTP_BEGIN_ARGS(setBufferSize, 1) ++ HTTP_ARG_VAL(bytes, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getData); ++HTTP_BEGIN_ARGS(setData, 1) ++ HTTP_ARG_VAL(data, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getStream); ++HTTP_BEGIN_ARGS(setStream, 1) ++ HTTP_ARG_VAL(stream, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getFile); ++HTTP_BEGIN_ARGS(setFile, 1) ++ HTTP_ARG_VAL(filepath, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(send, 0) ++ HTTP_ARG_VAL(clean_ob, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(capture); ++ ++HTTP_BEGIN_ARGS(redirect, 0) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(params, 0) ++ HTTP_ARG_VAL(session, 0) ++ HTTP_ARG_VAL(permanent, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(status, 1) ++ HTTP_ARG_VAL(code, 0) ++HTTP_END_ARGS; ++ ++HTTP_EMPTY_ARGS(getRequestHeaders); ++HTTP_EMPTY_ARGS(getRequestBody); ++HTTP_EMPTY_ARGS(getRequestBodyStream); ++ ++#define THIS_CE http_response_object_ce ++zend_class_entry *http_response_object_ce; ++zend_function_entry http_response_object_fe[] = { ++ ++ HTTP_RESPONSE_ME(setHeader, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getHeader, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setETag, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getETag, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setLastModified, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getLastModified, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setContentDisposition, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getContentDisposition, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setContentType, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(guessContentType, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setCache, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getCache, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setCacheControl, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getCacheControl, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setGzip, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getGzip, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setThrottleDelay, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getThrottleDelay, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setBufferSize, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getBufferSize, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setData, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getData, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setFile, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getFile, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(setStream, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(getStream, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ME(send, ZEND_ACC_PUBLIC) ++ HTTP_RESPONSE_ME(capture, ZEND_ACC_PUBLIC) ++ ++ HTTP_RESPONSE_ALIAS(redirect, http_redirect) ++ HTTP_RESPONSE_ALIAS(status, http_send_status) ++ HTTP_RESPONSE_ALIAS(getRequestHeaders, http_get_request_headers) ++ HTTP_RESPONSE_ALIAS(getRequestBody, http_get_request_body) ++ HTTP_RESPONSE_ALIAS(getRequestBodyStream, http_get_request_body_stream) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++PHP_MINIT_FUNCTION(http_response_object) ++{ ++ HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0); ++ ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("sent")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("catch")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("mode")-1, -1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("stream")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("file")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("data")-1, (ZEND_ACC_STATIC|ZEND_ACC_PRIVATE) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("cache")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_bool(THIS_CE, ZEND_STRS("gzip")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("eTag")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("lastModified")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("cacheControl")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("contentType")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_null(THIS_CE, ZEND_STRS("contentDisposition")-1, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_long(THIS_CE, ZEND_STRS("bufferSize")-1, 0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ zend_declare_property_double(THIS_CE, ZEND_STRS("throttleDelay")-1, 0.0, (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC); ++ ++#ifndef WONKY ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT")-1, HTTP_REDIRECT TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_PERM")-1, HTTP_REDIRECT_PERM TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_FOUND")-1, HTTP_REDIRECT_FOUND TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_POST")-1, HTTP_REDIRECT_POST TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_PROXY")-1, HTTP_REDIRECT_PROXY TSRMLS_CC); ++ zend_declare_class_constant_long(THIS_CE, ZEND_STRS("REDIRECT_TEMP")-1, HTTP_REDIRECT_TEMP TSRMLS_CC); ++#endif /* WONKY */ ++ ++ return SUCCESS; ++} ++ ++/* ### USERLAND ### */ ++ ++/* {{{ proto static bool HttpResponse::setHeader(string name[, mixed value[, bool replace = true]]) ++ Send an HTTP header. */ ++PHP_METHOD(HttpResponse, setHeader) ++{ ++ zend_bool replace = 1; ++ char *name; ++ int name_len = 0; ++ zval *value = NULL; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/!b", &name, &name_len, &value, &replace)) { ++ RETURN_FALSE; ++ } ++ if (SG(headers_sent)) { ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot add another header when headers have already been sent"); ++ RETURN_FALSE; ++ } ++ if (!name_len) { ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot send anonymous headers"); ++ RETURN_FALSE; ++ } ++ http_send_header_zval_ex(name, name_len, &value, replace); ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static mixed HttpResponse::getHeader([string name]) ++ Get header(s) about to be sent. */ ++PHP_METHOD(HttpResponse, getHeader) ++{ ++ char *name = NULL; ++ int name_len = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (name && name_len) { ++ zval **header; ++ HashTable headers_ht; ++ ++ zend_hash_init(&headers_ht, sizeof(zval *), NULL, ZVAL_PTR_DTOR, 0); ++ if ( (SUCCESS == http_get_response_headers(&headers_ht)) && ++ (SUCCESS == zend_hash_find(&headers_ht, name, name_len + 1, (void *) &header))) { ++ RETVAL_ZVAL(*header, 1, 0); ++ } else { ++ RETVAL_NULL(); ++ } ++ zend_hash_destroy(&headers_ht); ++ } else { ++ array_init(return_value); ++ http_get_response_headers(Z_ARRVAL_P(return_value)); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setCache(bool cache) ++ Whether it should be attempted to cache the entity. */ ++PHP_METHOD(HttpResponse, setCache) ++{ ++ zend_bool do_cache = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_cache)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_bool(THIS_CE, ZEND_STRS("cache")-1, do_cache TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::getCache() ++ Get current caching setting. */ ++PHP_METHOD(HttpResponse, getCache) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cache = http_zsep(IS_BOOL, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cache")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cache, 1, 1); ++ } ++} ++/* }}}*/ ++ ++/* {{{ proto static bool HttpResponse::setGzip(bool gzip) ++ Enable on-thy-fly gzipping of the sent entity. */ ++PHP_METHOD(HttpResponse, setGzip) ++{ ++ zend_bool do_gzip = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_gzip)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_bool(THIS_CE, ZEND_STRS("gzip")-1, do_gzip TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::getGzip() ++ Get current gzipping setting. */ ++PHP_METHOD(HttpResponse, getGzip) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *gzip = http_zsep(IS_BOOL, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("gzip")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(gzip, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setCacheControl(string control[, int max_age = 0[, bool must_revalidate = true]]) ++ Set a custom cache-control header, usually being "private" or "public"; The max_age parameter controls how long the cache entry is valid on the client side. */ ++PHP_METHOD(HttpResponse, setCacheControl) ++{ ++ char *ccontrol, *cctl; ++ int cc_len; ++ long max_age = 0; ++ zend_bool must_revalidate = 1; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lb", &ccontrol, &cc_len, &max_age, &must_revalidate)) { ++ RETURN_FALSE; ++ } ++ ++ if (strcmp(ccontrol, "public") && strcmp(ccontrol, "private") && strcmp(ccontrol, "no-cache")) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Cache-Control '%s' doesn't match public, private or no-cache", ccontrol); ++ RETURN_FALSE; ++ } else { ++ size_t cctl_len = spprintf(&cctl, 0, "%s,%s max-age=%ld", ccontrol, must_revalidate?" must-revalidate,":"", max_age); ++ RETVAL_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("cacheControl")-1, cctl, cctl_len TSRMLS_CC)); ++ efree(cctl); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getCacheControl() ++ Get current Cache-Control header setting. */ ++PHP_METHOD(HttpResponse, getCacheControl) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cctl = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cacheControl")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cctl, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setContentType(string content_type) ++ Set the content-type of the sent entity. */ ++PHP_METHOD(HttpResponse, setContentType) ++{ ++ char *ctype; ++ int ctype_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ctype_len)) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE); ++ RETURN_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("contentType")-1, ctype, ctype_len TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getContentType() ++ Get current Content-Type header setting. */ ++PHP_METHOD(HttpResponse, getContentType) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *ctype = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentType")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(ctype, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME]) ++ Attempts to guess the content type of supplied payload through libmagic. */ ++PHP_METHOD(HttpResponse, guessContentType) ++{ ++#ifdef HTTP_HAVE_MAGIC ++ char *magic_file, *ct = NULL; ++ int magic_file_len; ++ long magic_mode = MAGIC_MIME; ++ ++ RETVAL_FALSE; ++ SET_EH_THROW_HTTP(); ++ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &magic_file, &magic_file_len, &magic_mode)) { ++ switch (Z_LVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ case SEND_DATA: ++ { ++ zval *data = *zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ct = http_guess_content_type(magic_file, magic_mode, Z_STRVAL_P(data), Z_STRLEN_P(data), SEND_DATA); ++ break; ++ } ++ ++ case SEND_RSRC: ++ { ++ php_stream *s; ++ zval *z = *zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ z->type = IS_RESOURCE; ++ php_stream_from_zval(s, &z); ++ ct = http_guess_content_type(magic_file, magic_mode, s, 0, SEND_RSRC); ++ break; ++ } ++ ++ default: ++ ct = http_guess_content_type(magic_file, magic_mode, Z_STRVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC)), 0, -1); ++ break; ++ } ++ if (ct) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("contentType")-1, ct TSRMLS_CC); ++ RETVAL_STRING(ct, 0); ++ } ++ } ++ SET_EH_NORMAL(); ++#else ++ http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++ RETURN_FALSE; ++#endif ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setContentDisposition(string filename[, bool inline = false]) ++ Set the Content-Disposition. */ ++PHP_METHOD(HttpResponse, setContentDisposition) ++{ ++ char *file, *cd; ++ int file_len; ++ size_t cd_len; ++ zend_bool send_inline = 0; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &file, &file_len, &send_inline)) { ++ RETURN_FALSE; ++ } ++ ++ cd_len = spprintf(&cd, 0, "%s; filename=\"%s\"", send_inline ? "inline" : "attachment", file); ++ RETVAL_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("contentDisposition")-1, cd, cd_len TSRMLS_CC)); ++ efree(cd); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getContentDisposition() ++ Get current Content-Disposition setting. */ ++PHP_METHOD(HttpResponse, getContentDisposition) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *cdisp = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentDisposition")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(cdisp, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setETag(string etag) ++ Set a custom ETag. Use this only if you know what you're doing. */ ++PHP_METHOD(HttpResponse, setETag) ++{ ++ char *etag; ++ int etag_len; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &etag, &etag_len)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_stringl(THIS_CE, ZEND_STRS("eTag")-1, etag, etag_len TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getETag() ++ Get calculated or previously set custom ETag. */ ++PHP_METHOD(HttpResponse, getETag) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *etag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(etag, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setLastModified(int timestamp) ++ Set a custom Last-Modified date. */ ++PHP_METHOD(HttpResponse, setLastModified) ++{ ++ long lm; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &lm)) { ++ RETURN_FALSE; ++ } ++ ++ RETURN_SUCCESS(zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, lm TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static int HttpResponse::getLastModified() ++ Get calculated or previously set custom Last-Modified date. */ ++PHP_METHOD(HttpResponse, getLastModified) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *lmod = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("lastModified")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(lmod, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setThrottleDelay(double seconds) ++ Sets the throttle delay for use with HttpResponse::setBufferSize(). */ ++PHP_METHOD(HttpResponse, setThrottleDelay) ++{ ++ double seconds; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &seconds)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(zend_update_static_property_double(THIS_CE, ZEND_STRS("throttleDelay")-1, seconds TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static double HttpResponse::getThrottleDelay() ++ Get the current throttle delay. */ ++PHP_METHOD(HttpResponse, getThrottleDelay) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *tdel = http_zsep(IS_DOUBLE, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("throttleDelay")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(tdel, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setBufferSize(int bytes) ++ Sets the send buffer size for use with HttpResponse::setThrottleDelay(). */ ++PHP_METHOD(HttpResponse, setBufferSize) ++{ ++ long bytes; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bytes)) { ++ RETURN_FALSE; ++ } ++ RETURN_SUCCESS(zend_update_static_property_long(THIS_CE, ZEND_STRS("bufferSize")-1, bytes TSRMLS_CC)); ++} ++/* }}} */ ++ ++/* {{{ proto static int HttpResponse::getBufferSize() ++ Get current buffer size. */ ++PHP_METHOD(HttpResponse, getBufferSize) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *bsize = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("bufferSize")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(bsize, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setData(mixed data) ++ Set the data to be sent. */ ++PHP_METHOD(HttpResponse, setData) ++{ ++ char *etag; ++ zval *the_data; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &the_data)) { ++ RETURN_FALSE; ++ } ++ if (Z_TYPE_P(the_data) != IS_STRING) { ++ convert_to_string(the_data); ++ } ++ ++ if ( (SUCCESS != zend_update_static_property(THIS_CE, ZEND_STRS("data")-1, the_data TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, SEND_DATA TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_data, SEND_DATA) TSRMLS_CC); ++ if ((etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getData() ++ Get the previously set data to be sent. */ ++PHP_METHOD(HttpResponse, getData) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *the_data = *zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ ++ RETURN_ZVAL(the_data, 1, 0); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setStream(resource stream) ++ Set the resource to be sent. */ ++PHP_METHOD(HttpResponse, setStream) ++{ ++ char *etag; ++ zval *the_stream; ++ php_stream *the_real_stream; ++ php_stream_statbuf ssb; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &the_stream)) { ++ RETURN_FALSE; ++ } ++ ++ php_stream_from_zval(the_real_stream, &the_stream); ++ if (php_stream_stat(the_real_stream, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if ( (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("stream")-1, Z_LVAL_P(the_stream) TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, SEND_RSRC TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ zend_list_addref(Z_LVAL_P(the_stream)); ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_real_stream, SEND_RSRC) TSRMLS_CC); ++ if ((etag = http_etag(the_real_stream, 0, SEND_RSRC))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static resource HttpResponse::getStream() ++ Get the previously set resource to be sent. */ ++PHP_METHOD(HttpResponse, getStream) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *stream = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_RESOURCE(Z_LVAL_P(stream)); ++ zval_ptr_dtor(&stream); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::setFile(string file) ++ Set the file to be sent. */ ++PHP_METHOD(HttpResponse, setFile) ++{ ++ char *the_file, *etag; ++ int file_len; ++ php_stream_statbuf ssb; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &the_file, &file_len)) { ++ RETURN_FALSE; ++ } ++ ++ if (php_stream_stat_path(the_file, &ssb)) { ++ RETURN_FALSE; ++ } ++ ++ if ( (SUCCESS != zend_update_static_property_stringl(THIS_CE, ZEND_STRS("file")-1, the_file, file_len TSRMLS_CC)) || ++ (SUCCESS != zend_update_static_property_long(THIS_CE, ZEND_STRS("mode")-1, -1 TSRMLS_CC))) { ++ RETURN_FALSE; ++ } ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("lastModified")-1, http_last_modified(the_file, -1) TSRMLS_CC); ++ if ((etag = http_etag(the_file, 0, -1))) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ ++ RETURN_TRUE; ++} ++/* }}} */ ++ ++/* {{{ proto static string HttpResponse::getFile() ++ Get the previously set file to be sent. */ ++PHP_METHOD(HttpResponse, getFile) ++{ ++ NO_ARGS; ++ ++ if (return_value_used) { ++ zval *file = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_ZVAL(file, 1, 1); ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static bool HttpResponse::send([bool clean_ob = true]) ++ Finally send the entity. */ ++PHP_METHOD(HttpResponse, send) ++{ ++ zval *sent; ++ zend_bool clean_ob = 1; ++ ++ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &clean_ob)) { ++ RETURN_FALSE; ++ } ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ sent = *zend_std_get_static_property(THIS_CE, ZEND_STRS("sent")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC); ++ if (Z_LVAL_P(sent)) { ++ http_error(HE_WARNING, HTTP_E_RESPONSE, "Cannot send HttpResponse, response has already been sent"); ++ RETURN_FALSE; ++ } else { ++ Z_LVAL_P(sent) = 1; ++ } ++ ++ /* capture mode */ ++ if (i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("catch")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ zval *zetag, *the_data; ++ ++ MAKE_STD_ZVAL(the_data); ++ php_ob_get_buffer(the_data TSRMLS_CC); ++ zend_update_static_property(THIS_CE, ZEND_STRS("data")-1, the_data TSRMLS_CC); ++ ZVAL_LONG(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC), SEND_DATA); ++ ++ zetag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (!Z_STRLEN_P(zetag)) { ++ char *etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA); ++ if (etag) { ++ zend_update_static_property_string(THIS_CE, ZEND_STRS("eTag")-1, etag TSRMLS_CC); ++ efree(etag); ++ } ++ } ++ zval_ptr_dtor(&the_data); ++ zval_ptr_dtor(&zetag); ++ ++ clean_ob = 1; ++ } ++ ++ if (clean_ob) { ++ /* interrupt on-the-fly etag generation */ ++ HTTP_G->etag.started = 0; ++ /* discard previous output buffers */ ++ php_end_ob_buffers(0 TSRMLS_CC); ++ } ++ ++ /* caching */ ++ if (i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("cache")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ zval *cctl, *etag, *lmod; ++ ++ lmod = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("lastModified")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ etag = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("eTag")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ cctl = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("cacheControl")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ ++ if (Z_LVAL_P(lmod) || Z_STRLEN_P(etag)) { ++ if (Z_STRLEN_P(cctl)) { ++ http_send_cache_control(Z_STRVAL_P(cctl), Z_STRLEN_P(cctl)); ++ } else { ++ http_send_cache_control(HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL)); ++ } ++ if (Z_STRLEN_P(etag)) { ++ http_send_etag(Z_STRVAL_P(etag), Z_STRLEN_P(etag)); ++ } ++ if (Z_LVAL_P(lmod)) { ++ http_send_last_modified(Z_LVAL_P(lmod)); ++ } ++ } ++ ++ zval_ptr_dtor(&etag); ++ zval_ptr_dtor(&lmod); ++ zval_ptr_dtor(&cctl); ++ } ++ ++ /* content type */ ++ { ++ zval *ctype = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentType")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (Z_STRLEN_P(ctype)) { ++ http_send_content_type(Z_STRVAL_P(ctype), Z_STRLEN_P(ctype)); ++ } else { ++ char *ctypes = INI_STR("default_mimetype"); ++ size_t ctlen = ctypes ? strlen(ctypes) : 0; ++ ++ if (ctlen) { ++ http_send_content_type(ctypes, ctlen); ++ } else { ++ http_send_content_type("application/x-octetstream", lenof("application/x-octetstream")); ++ } ++ } ++ zval_ptr_dtor(&ctype); ++ } ++ ++ /* content disposition */ ++ { ++ zval *cd = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("contentDisposition")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ if (Z_STRLEN_P(cd)) { ++ http_send_header_ex("Content-Disposition", lenof("Content-Disposition"), Z_STRVAL_P(cd), Z_STRLEN_P(cd), 1, NULL); ++ } ++ zval_ptr_dtor(&cd); ++ } ++ ++ /* throttling */ ++ { ++ zval *bsize = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("bufferSize")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ zval *delay = http_zsep(IS_DOUBLE, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("throttleDelay")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ HTTP_G->send.buffer_size = Z_LVAL_P(bsize); ++ HTTP_G->send.throttle_delay = Z_DVAL_P(delay); ++ zval_ptr_dtor(&bsize); ++ zval_ptr_dtor(&delay); ++ } ++ ++ /* gzip */ ++ HTTP_G->send.deflate.response = i_zend_is_true(*zend_std_get_static_property(THIS_CE, ZEND_STRS("gzip")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC)); ++ ++ /* send */ ++ switch (Z_LVAL_P(*zend_std_get_static_property(THIS_CE, ZEND_STRS("mode")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))) { ++ case SEND_DATA: ++ { ++ zval *zdata = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("data")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_SUCCESS(http_send_data(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata))); ++ zval_ptr_dtor(&zdata); ++ return; ++ } ++ ++ case SEND_RSRC: ++ { ++ php_stream *the_real_stream; ++ zval *the_stream = http_zsep(IS_LONG, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("stream")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ the_stream->type = IS_RESOURCE; ++ php_stream_from_zval(the_real_stream, &the_stream); ++ RETVAL_SUCCESS(http_send_stream(the_real_stream)); ++ zval_ptr_dtor(&the_stream); ++ return; ++ } ++ ++ default: ++ { ++ zval *file = http_zsep(IS_STRING, *(zend_std_get_static_property(THIS_CE, ZEND_STRS("file")-1, 0 ZEND_LITERAL_NIL_CC TSRMLS_CC))); ++ RETVAL_SUCCESS(http_send_file(Z_STRVAL_P(file))); ++ zval_ptr_dtor(&file); ++ return; ++ } ++ } ++} ++/* }}} */ ++ ++/* {{{ proto static void HttpResponse::capture() ++ Capture script output. ++ */ ++PHP_METHOD(HttpResponse, capture) ++{ ++ NO_ARGS; ++ ++ HTTP_CHECK_HEADERS_SENT(RETURN_FALSE); ++ ++ zend_update_static_property_long(THIS_CE, ZEND_STRS("catch")-1, 1 TSRMLS_CC); ++ ++ php_end_ob_buffers(0 TSRMLS_CC); ++ php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC); ++ ++ /* register shutdown function */ ++ { ++ zval func, retval, arg, *argp[1]; ++ ++ INIT_PZVAL(&arg); ++ INIT_PZVAL(&func); ++ INIT_PZVAL(&retval); ++ ZVAL_STRINGL(&func, "register_shutdown_function", lenof("register_shutdown_function"), 0); ++ ++ array_init(&arg); ++ add_next_index_stringl(&arg, "HttpResponse", lenof("HttpResponse"), 1); ++ add_next_index_stringl(&arg, "send", lenof("send"), 1); ++ argp[0] = &arg; ++ call_user_function(EG(function_table), NULL, &func, &retval, 1, argp TSRMLS_CC); ++ zval_dtor(&arg); ++ } ++} ++/* }}} */ ++ ++#endif /* ZEND_ENGINE_2 && !WONKY */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_send_api.c +@@ -0,0 +1,607 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_send_api.c 300299 2010-06-09 06:23:16Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_ZLIB ++#define HTTP_WANT_MAGIC ++#include "php_http.h" ++ ++#include "php_streams.h" ++ ++#include "php_http_api.h" ++#include "php_http_cache_api.h" ++#include "php_http_date_api.h" ++#include "php_http_encoding_api.h" ++#include "php_http_headers_api.h" ++#include "php_http_send_api.h" ++ ++/* {{{ http_flush() */ ++#define http_flush(d, l) _http_flush(NULL, (d), (l) TSRMLS_CC) ++static inline void _http_flush(void *nothing, const char *data, size_t data_len TSRMLS_DC) ++{ ++ PHPWRITE(data, data_len); ++ /* we really only need to flush when throttling is enabled, ++ because we push the data as fast as possible anyway if not */ ++ if (HTTP_G->send.throttle_delay >= HTTP_DIFFSEC) { ++ if (OG(ob_nesting_level)) { ++ php_end_ob_buffer(1, 1 TSRMLS_CC); ++ } ++ if (!OG(implicit_flush)) { ++ sapi_flush(TSRMLS_C); ++ } ++ http_sleep(HTTP_G->send.throttle_delay); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_start */ ++#define http_send_response_start(b, cl) _http_send_response_start((b), (cl) TSRMLS_CC) ++static inline void _http_send_response_start(void **buffer, size_t content_length TSRMLS_DC) ++{ ++ int encoding; ++ ++ if ((encoding = http_encoding_response_start(content_length, 0))) { ++#ifdef HTTP_HAVE_ZLIB ++ *((http_encoding_stream **) buffer) = http_encoding_deflate_stream_init(NULL, ++ (encoding == HTTP_ENCODING_GZIP) ? ++ HTTP_DEFLATE_TYPE_GZIP : HTTP_DEFLATE_TYPE_ZLIB); ++#endif ++ } ++ /* flush headers */ ++ sapi_flush(TSRMLS_C); ++} ++/* }}} */ ++ ++/* {{{ http_send_response_data_plain */ ++#define http_send_response_data_plain(b, d, dl) _http_send_response_data_plain((b), (d), (dl) TSRMLS_CC) ++static inline void _http_send_response_data_plain(void **buffer, const char *data, size_t data_len TSRMLS_DC) ++{ ++ if (HTTP_G->send.deflate.response && HTTP_G->send.deflate.encoding) { ++#ifdef HTTP_HAVE_ZLIB ++ char *encoded; ++ size_t encoded_len; ++ http_encoding_stream *s = *((http_encoding_stream **) buffer); ++ ++ http_encoding_deflate_stream_update(s, data, data_len, &encoded, &encoded_len); ++ if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) &s->storage, encoded, encoded_len, HTTP_G->send.buffer_size, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(encoded, encoded_len); ++ } ++ efree(encoded); ++#else ++ http_error(HE_ERROR, HTTP_E_RESPONSE, "Attempt to send GZIP response despite being able to do so; please report this bug"); ++#endif ++ } else if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) buffer, data, data_len, HTTP_G->send.buffer_size, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(data, data_len); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_data_fetch */ ++#define http_send_response_data_fetch(b, d, l, m, s, e) _http_send_response_data_fetch((b), (d), (l), (m), (s), (e) TSRMLS_CC) ++static inline void _http_send_response_data_fetch(void **buffer, const void *data, size_t data_len, http_send_mode mode, size_t begin, size_t end TSRMLS_DC) ++{ ++ long bsz, got, len = end - begin; ++ ++ if (!(bsz = HTTP_G->send.buffer_size)) { ++ bsz = HTTP_SENDBUF_SIZE; ++ } ++ ++ switch (mode) { ++ case SEND_RSRC: { ++ php_stream *s = (php_stream *) data; ++ if (SUCCESS == php_stream_seek(s, begin, SEEK_SET)) { ++ char *buf = emalloc(bsz); ++ ++ while (len > 0) { ++ got = php_stream_read(s, buf, MIN(len, bsz)); ++ http_send_response_data_plain(buffer, buf, got); ++ len -= got; ++ } ++ ++ efree(buf); ++ } ++ break; ++ } ++ case SEND_DATA: { ++ const char *buf = ((const char *) data) + begin; ++ while (len > 0) { ++ got = MIN(len, bsz); ++ http_send_response_data_plain(buffer, buf, got); ++ len -= got; ++ buf += got; ++ } ++ break; ++ } ++ EMPTY_SWITCH_DEFAULT_CASE(); ++ } ++} ++/* }}} */ ++ ++/* {{{ http_send_response_finish */ ++#define http_send_response_finish(b) _http_send_response_finish((b) TSRMLS_CC) ++static inline void _http_send_response_finish(void **buffer TSRMLS_DC) ++{ ++ if (HTTP_G->send.deflate.response && HTTP_G->send.deflate.encoding) { ++#ifdef HTTP_HAVE_ZLIB ++ char *encoded = NULL; ++ size_t encoded_len = 0; ++ http_encoding_stream *s = *((http_encoding_stream **) buffer); ++ ++ http_encoding_deflate_stream_finish(s, &encoded, &encoded_len); ++ if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) &s->storage, encoded, encoded_len, 0, _http_flush, NULL TSRMLS_CC); ++ } else { ++ http_flush(encoded, encoded_len); ++ } ++ http_encoding_deflate_stream_free(&s); ++ STR_FREE(encoded); ++#else ++ http_error(HE_ERROR, HTTP_E_RESPONSE, "Attempt to send GZIP response despite being able to do so; please report this bug"); ++#endif ++ } else if (HTTP_G->send.buffer_size) { ++ phpstr_chunked_output((phpstr **) buffer, NULL, 0, 0, _http_flush, NULL TSRMLS_CC); ++ } ++} ++/* }}} */ ++ ++/* {{{ */ ++PHP_MINIT_FUNCTION(http_send) ++{ ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT", HTTP_REDIRECT); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_PERM", HTTP_REDIRECT_PERM); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_FOUND", HTTP_REDIRECT_FOUND); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_POST", HTTP_REDIRECT_POST); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_PROXY", HTTP_REDIRECT_PROXY); ++ HTTP_LONG_CONSTANT("HTTP_REDIRECT_TEMP", HTTP_REDIRECT_TEMP); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_find_header */ ++typedef struct { ++ const char *h; ++ size_t l; ++} http_response_header_t; ++ ++static int http_find_header(void *data, void *arg) ++{ ++ http_response_header_t *h = arg; ++ sapi_header_struct *s = data; ++ ++ return (!strncasecmp(s->header, h->h, h->l)) && s->header[h->l] == ':'; ++} ++/* }}} */ ++ ++/* {{{ void http_hide_header(char *) */ ++PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len TSRMLS_DC) ++{ ++ http_response_header_t h = {name, name_len}; ++ zend_llist_del_element(&SG(sapi_headers).headers, (void *) &h, http_find_header); ++} ++/* }}} */ ++ ++/* {{{ void http_send_header_zval(char*, zval **, zend_bool) */ ++PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC) ++{ ++ if (!val || !*val || Z_TYPE_PP(val) == IS_NULL || (Z_TYPE_PP(val) == IS_STRING && !Z_STRLEN_PP(val))) { ++ http_hide_header_ex(name, name_len); ++ } else if (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT) { ++ zend_bool first = replace; ++ zval **data_ptr; ++ HashPosition pos; ++ ++ FOREACH_HASH_VAL(pos, HASH_OF(*val), data_ptr) { ++ zval *data = http_zsep(IS_STRING, *data_ptr); ++ ++ http_send_header_ex(name, name_len, Z_STRVAL_P(data), Z_STRLEN_P(data), first, NULL); ++ zval_ptr_dtor(&data); ++ first = 0; ++ } ++ } else { ++ zval *data = http_zsep(IS_STRING, *val); ++ ++ http_send_header_ex(name, name_len, Z_STRVAL_P(data), Z_STRLEN_P(data), replace, NULL); ++ zval_ptr_dtor(&data); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_header(char *, char *, zend_bool) */ ++PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace, char **sent_header TSRMLS_DC) ++{ ++ STATUS ret; ++ ++ if (value && value_len) { ++ size_t header_len = sizeof(": ") + name_len + value_len + 1; ++ char *header = emalloc(header_len + 1); ++ ++ header[header_len] = '\0'; ++ header_len = snprintf(header, header_len, "%s: %s", name, value); ++ ret = http_send_header_string_ex(header, header_len, replace); ++ if (sent_header) { ++ *sent_header = header; ++ } else { ++ efree(header); ++ } ++ } else { ++ http_hide_header_ex(name, name_len); ++ ret = SUCCESS; ++ } ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_status_header(int, char *) */ ++PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, size_t header_len, zend_bool replace TSRMLS_DC) ++{ ++ STATUS ret; ++ sapi_header_line h = {(char *) header, header_len, status}; ++ if (SUCCESS != (ret = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD, &h TSRMLS_CC))) { ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Could not send header: %s (%d)", header, status); ++ } ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_last_modified(int) */ ++PHP_HTTP_API STATUS _http_send_last_modified_ex(time_t t, char **sent_header TSRMLS_DC) ++{ ++ STATUS ret; ++ char *date = http_date(t); ++ ++ if (!date) { ++ return FAILURE; ++ } ++ ++ ret = http_send_header_ex("Last-Modified", lenof("Last-Modified"), date, strlen(date), 1, sent_header); ++ efree(date); ++ ++ /* remember */ ++ HTTP_G->send.last_modified = t; ++ ++ return ret; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_etag(char *, size_t) */ ++PHP_HTTP_API STATUS _http_send_etag_ex(const char *etag, size_t etag_len, char **sent_header TSRMLS_DC) ++{ ++ STATUS status; ++ char *etag_header; ++ size_t etag_header_len; ++ ++ if (!etag_len){ ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Attempt to send empty ETag (previous: %s)\n", HTTP_G->send.unquoted_etag); ++ return FAILURE; ++ } ++ ++ etag_header_len = spprintf(&etag_header, 0, "ETag: \"%s\"", etag); ++ status = http_send_header_string_ex(etag_header, etag_header_len, 1); ++ ++ /* remember */ ++ STR_SET(HTTP_G->send.unquoted_etag, estrndup(etag, etag_len)); ++ ++ if (sent_header) { ++ *sent_header = etag_header; ++ } else { ++ efree(etag_header); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_content_type(char *, size_t) */ ++PHP_HTTP_API STATUS _http_send_content_type(const char *content_type, size_t ct_len TSRMLS_DC) ++{ ++ HTTP_CHECK_CONTENT_TYPE(content_type, return FAILURE); ++ ++ /* remember for multiple ranges */ ++ STR_FREE(HTTP_G->send.content_type); ++ HTTP_G->send.content_type = estrndup(content_type, ct_len); ++ ++ return http_send_header_ex("Content-Type", lenof("Content-Type"), content_type, ct_len, 1, NULL); ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_content_disposition(char *, size_t, zend_bool) */ ++PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t f_len, zend_bool send_inline TSRMLS_DC) ++{ ++ STATUS status; ++ char *cd_header; ++ ++ if (send_inline) { ++ cd_header = ecalloc(1, sizeof("Content-Disposition: inline; filename=\"\"") + f_len); ++ sprintf(cd_header, "Content-Disposition: inline; filename=\"%s\"", filename); ++ } else { ++ cd_header = ecalloc(1, sizeof("Content-Disposition: attachment; filename=\"\"") + f_len); ++ sprintf(cd_header, "Content-Disposition: attachment; filename=\"%s\"", filename); ++ } ++ ++ status = http_send_header_string(cd_header); ++ efree(cd_header); ++ return status; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send(void *, size_t, http_send_mode) */ ++PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_send_mode data_mode, zend_bool no_cache TSRMLS_DC) ++{ ++ void *s = NULL; ++ HashTable ranges; ++ http_range_status range_status; ++ ++ if (!data_ptr) { ++ return FAILURE; ++ } ++ if (!data_size) { ++ return SUCCESS; ++ } ++ ++ /* enable partial dl and resume */ ++ http_send_header_string("Accept-Ranges: bytes"); ++ ++ zend_hash_init(&ranges, 0, NULL, ZVAL_PTR_DTOR, 0); ++ range_status = http_get_request_ranges(&ranges, data_size); ++ ++ switch (range_status) { ++ case RANGE_ERR: ++ { ++ zend_hash_destroy(&ranges); ++ http_send_status(416); ++ return FAILURE; ++ } ++ case RANGE_OK: ++ { ++ /* Range Request - only send ranges if entity hasn't changed */ ++ if ( http_got_server_var("HTTP_IF_RANGE") && ++ !http_match_etag("HTTP_IF_RANGE", HTTP_G->send.unquoted_etag) && ++ !http_match_last_modified("HTTP_IF_RANGE", HTTP_G->send.last_modified)) { ++ /* fallthrough to send full entity with 200 Ok */ ++ no_cache = 1; ++ } else if ( !http_match_etag_ex("HTTP_IF_MATCH", HTTP_G->send.unquoted_etag, 0) || ++ !http_match_last_modified_ex("HTTP_IF_UNMODIFIED_SINCE", HTTP_G->send.last_modified, 0) || ++ !http_match_last_modified_ex("HTTP_UNLESS_MODIFIED_SINCE", HTTP_G->send.last_modified, 0)) { ++ /* 412 Precondition failed */ ++ zend_hash_destroy(&ranges); ++ http_send_status(412); ++ return FAILURE; ++ } else if (zend_hash_num_elements(&ranges) == 1) { ++ /* single range */ ++ zval **range, **begin, **end; ++ ++ if ( SUCCESS != zend_hash_index_find(&ranges, 0, (void *) &range) || ++ SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) || ++ SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { ++ /* this should never happen */ ++ zend_hash_destroy(&ranges); ++ http_send_status(500); ++ return FAILURE; ++ } else { ++ phpstr header; ++ ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Range: bytes %ld-%ld/%zu", Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size); ++ phpstr_fix(&header); ++ http_send_status_header_ex(206, PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ http_send_response_start(&s, Z_LVAL_PP(end)-Z_LVAL_PP(begin)+1); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, Z_LVAL_PP(begin), Z_LVAL_PP(end) + 1); ++ http_send_response_finish(&s); ++ zend_hash_destroy(&ranges); ++ return SUCCESS; ++ } ++ } else { ++ /* multi range */ ++ HashPosition pos; ++ zval **range, **begin, **end; ++ const char *content_type = HTTP_G->send.content_type; ++ char boundary_str[32]; ++ size_t boundary_len; ++ phpstr header, preface; ++ ++ boundary_len = http_boundary(boundary_str, sizeof(boundary_str)); ++ phpstr_init(&header); ++ phpstr_appendf(&header, "Content-Type: multipart/byteranges; boundary=%s", boundary_str); ++ phpstr_fix(&header); ++ http_send_status_header_ex(206, PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1); ++ phpstr_dtor(&header); ++ http_send_response_start(&s, 0); ++ ++ if (!content_type) { ++ content_type = "application/x-octetstream"; ++ } ++ ++ phpstr_init(&preface); ++ FOREACH_HASH_VAL(pos, &ranges, range) { ++ if ( SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) && ++ SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { ++ ++#define HTTP_RANGE_PREFACE \ ++ HTTP_CRLF "--%s" \ ++ HTTP_CRLF "Content-Type: %s" \ ++ HTTP_CRLF "Content-Range: bytes %ld-%ld/%zu" \ ++ HTTP_CRLF HTTP_CRLF ++ ++ phpstr_appendf(&preface, HTTP_RANGE_PREFACE, boundary_str, content_type, Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size); ++ phpstr_fix(&preface); ++ http_send_response_data_plain(&s, PHPSTR_VAL(&preface), PHPSTR_LEN(&preface)); ++ phpstr_reset(&preface); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, Z_LVAL_PP(begin), Z_LVAL_PP(end) + 1); ++ } ++ } ++ phpstr_dtor(&preface); ++ ++ http_send_response_data_plain(&s, HTTP_CRLF "--", lenof(HTTP_CRLF "--")); ++ http_send_response_data_plain(&s, boundary_str, boundary_len); ++ http_send_response_data_plain(&s, "--", lenof("--")); ++ ++ http_send_response_finish(&s); ++ zend_hash_destroy(&ranges); ++ return SUCCESS; ++ } ++ } ++ case RANGE_NO: ++ { ++ zend_hash_destroy(&ranges); ++ ++ /* send 304 Not Modified if etag matches - DON'T return on ETag generation failure */ ++ if (!no_cache && (http_interrupt_ob_etaghandler() || (HTTP_G->send.unquoted_etag != NULL))) { ++ char *etag = NULL; ++ ++ if (HTTP_G->send.unquoted_etag) { ++ etag = estrdup(HTTP_G->send.unquoted_etag); ++ } ++ ++ if (etag || (etag = http_etag(data_ptr, data_size, data_mode))) { ++ char *sent_header = NULL; ++ ++ http_send_etag_ex(etag, strlen(etag), &sent_header); ++ if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { ++ return http_exit_ex(304, sent_header, NULL, 0); ++ } else { ++ STR_FREE(sent_header); ++ /* no caching for Last-Modified if ETags really don't match */ ++ no_cache = http_got_server_var("HTTP_IF_NONE_MATCH"); ++ } ++ efree(etag); ++ } ++ } ++ ++ /* send 304 Not Modified if last modified matches */ ++ if (!no_cache && HTTP_G->send.last_modified && http_match_last_modified("HTTP_IF_MODIFIED_SINCE", HTTP_G->send.last_modified)) { ++ char *sent_header = NULL; ++ http_send_last_modified_ex(HTTP_G->send.last_modified, &sent_header); ++ return http_exit_ex(304, sent_header, NULL, 0); ++ } ++ ++ /* send full response */ ++ http_send_response_start(&s, data_size); ++ http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, 0, data_size); ++ http_send_response_finish(&s); ++ return SUCCESS; ++ } ++ } ++ return FAILURE; ++} ++/* }}} */ ++ ++/* {{{ STATUS http_send_stream(php_stream *) */ ++PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *file, zend_bool close_stream, zend_bool no_cache TSRMLS_DC) ++{ ++ STATUS status; ++ php_stream_statbuf ssb; ++ int orig_flags; ++ ++ if ((!file) || php_stream_stat(file, &ssb)) { ++ char *defct = sapi_get_default_content_type(TSRMLS_C); ++ ++ http_hide_header("Content-Disposition"); ++ http_send_content_type(defct, strlen(defct)); ++ http_error(HE_WARNING, HTTP_E_RESPONSE, "File not found; stat failed"); ++ STR_FREE(defct); ++ ++ if (HTTP_G->send.not_found_404) { ++ http_exit_ex(404, NULL, estrdup("File not found\n"), 0); ++ } ++ return FAILURE; ++ } ++ ++ orig_flags = file->flags; ++ file->flags |= PHP_STREAM_FLAG_NO_BUFFER; ++ status = http_send_ex(file, ssb.sb.st_size, SEND_RSRC, no_cache); ++ file->flags = orig_flags; ++ ++ if (close_stream) { ++ php_stream_close(file); ++ } ++ ++ return status; ++} ++/* }}} */ ++ ++/* {{{ char *http_guess_content_type(char *magic_file, long magic_mode, void *data, size_t size, http_send_mode mode) */ ++PHP_HTTP_API char *_http_guess_content_type(const char *magicfile, long magicmode, void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC) ++{ ++ char *ct = NULL; ++ ++#ifdef HTTP_HAVE_MAGIC ++ struct magic_set *magic = NULL; ++ ++ HTTP_CHECK_OPEN_BASEDIR(magicfile, return NULL); ++ ++ if (!data_ptr) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Supplied payload is empty"); ++ } else if (!(magic = magic_open(magicmode &~ MAGIC_MIME))) { ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid magic mode: %ld", magicmode); ++ } else if (-1 == magic_load(magic, magicfile)) { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to load magic database '%s' (%s)", magicfile, magic_error(magic)); ++ } else { ++ const char *ctype = NULL; ++ ++ magic_setflags(magic, magicmode); ++ ++ switch (data_mode) { ++ case SEND_RSRC: ++ { ++ char *buffer; ++ size_t b_len; ++ ++ b_len = php_stream_copy_to_mem(data_ptr, &buffer, 65536, 0); ++ ctype = magic_buffer(magic, buffer, b_len); ++ efree(buffer); ++ break; ++ } ++ ++ case SEND_DATA: ++ ctype = magic_buffer(magic, data_ptr, data_len); ++ break; ++ ++ default: ++ HTTP_CHECK_OPEN_BASEDIR(data_ptr, magic_close(magic); return NULL); ++ ctype = magic_file(magic, data_ptr); ++ break; ++ } ++ ++ if (ctype) { ++ ct = estrdup(ctype); ++ } else { ++ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to guess Content-Type: %s", magic_error(magic)); ++ } ++ } ++ if (magic) { ++ magic_close(magic); ++ } ++#else ++ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); ++#endif ++ ++ return ct; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_url_api.c +@@ -0,0 +1,482 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_url_api.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#define HTTP_WANT_SAPI ++#define HTTP_WANT_NETDB ++#include "php_http.h" ++ ++#include "zend_ini.h" ++#include "php_output.h" ++#include "ext/standard/php_string.h" ++ ++#include "php_http_api.h" ++#include "php_http_querystring_api.h" ++#include "php_http_url_api.h" ++ ++static inline char *localhostname(void) ++{ ++ char hostname[1024] = {0}; ++ ++#ifdef PHP_WIN32 ++ if (SUCCESS == gethostname(hostname, lenof(hostname))) { ++ return estrdup(hostname); ++ } ++#elif defined(HAVE_GETHOSTNAME) ++ if (SUCCESS == gethostname(hostname, lenof(hostname))) { ++# if defined(HAVE_GETDOMAINNAME) ++ size_t hlen = strlen(hostname); ++ if (hlen <= lenof(hostname) - lenof("(none)")) { ++ hostname[hlen++] = '.'; ++ if (SUCCESS == getdomainname(&hostname[hlen], lenof(hostname) - hlen)) { ++ if (!strcmp(&hostname[hlen], "(none)")) { ++ hostname[hlen - 1] = '\0'; ++ } ++ return estrdup(hostname); ++ } ++ } ++# endif ++ if (strcmp(hostname, "(none)")) { ++ return estrdup(hostname); ++ } ++ } ++#endif ++ return estrndup("localhost", lenof("localhost")); ++} ++ ++PHP_MINIT_FUNCTION(http_url) ++{ ++ HTTP_LONG_CONSTANT("HTTP_URL_REPLACE", HTTP_URL_REPLACE); ++ HTTP_LONG_CONSTANT("HTTP_URL_JOIN_PATH", HTTP_URL_JOIN_PATH); ++ HTTP_LONG_CONSTANT("HTTP_URL_JOIN_QUERY", HTTP_URL_JOIN_QUERY); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_USER", HTTP_URL_STRIP_USER); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PASS", HTTP_URL_STRIP_PASS); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_AUTH", HTTP_URL_STRIP_AUTH); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PORT", HTTP_URL_STRIP_PORT); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_PATH", HTTP_URL_STRIP_PATH); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_QUERY", HTTP_URL_STRIP_QUERY); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_FRAGMENT", HTTP_URL_STRIP_FRAGMENT); ++ HTTP_LONG_CONSTANT("HTTP_URL_STRIP_ALL", HTTP_URL_STRIP_ALL); ++ HTTP_LONG_CONSTANT("HTTP_URL_FROM_ENV", HTTP_URL_FROM_ENV); ++ return SUCCESS; ++} ++ ++PHP_HTTP_API char *_http_absolute_url_ex(const char *url, int flags TSRMLS_DC) ++{ ++ char *abs = NULL; ++ php_url *purl = NULL; ++ ++ if (url) { ++ purl = php_url_parse(abs = estrdup(url)); ++ STR_SET(abs, NULL); ++ if (!purl) { ++ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", url); ++ return NULL; ++ } ++ } ++ ++ http_build_url(flags, purl, NULL, NULL, &abs, NULL); ++ ++ if (purl) { ++ php_url_free(purl); ++ } ++ ++ return abs; ++} ++ ++/* {{{ void http_build_url(int flags, const php_url *, const php_url *, php_url **, char **, size_t *) */ ++PHP_HTTP_API void _http_build_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC) ++{ ++#if defined(HAVE_GETSERVBYPORT) || defined(HAVE_GETSERVBYNAME) ++ struct servent *se; ++#endif ++ php_url *url = ecalloc(1, sizeof(php_url)); ++ ++#define __URLSET(u,n) \ ++ ((u)&&(u)->n) ++#define __URLCPY(n) \ ++ url->n = __URLSET(new_url,n) ? estrdup(new_url->n) : (__URLSET(old_url,n) ? estrdup(old_url->n) : NULL) ++ ++ if (!(flags & HTTP_URL_STRIP_PORT)) { ++ url->port = __URLSET(new_url, port) ? new_url->port : ((old_url) ? old_url->port : 0); ++ } ++ if (!(flags & HTTP_URL_STRIP_USER)) { ++ __URLCPY(user); ++ } ++ if (!(flags & HTTP_URL_STRIP_PASS)) { ++ __URLCPY(pass); ++ } ++ ++ __URLCPY(scheme); ++ __URLCPY(host); ++ ++ if (!(flags & HTTP_URL_STRIP_PATH)) { ++ if ((flags & HTTP_URL_JOIN_PATH) && __URLSET(old_url, path) && __URLSET(new_url, path) && *new_url->path != '/') { ++ size_t old_path_len = strlen(old_url->path), new_path_len = strlen(new_url->path); ++ ++ url->path = ecalloc(1, old_path_len + new_path_len + 1 + 1); ++ ++ strcat(url->path, old_url->path); ++ if (url->path[old_path_len - 1] != '/') { ++ php_dirname(url->path, old_path_len); ++ strcat(url->path, "/"); ++ } ++ strcat(url->path, new_url->path); ++ } else { ++ __URLCPY(path); ++ } ++ } ++ if (!(flags & HTTP_URL_STRIP_QUERY)) { ++ if ((flags & HTTP_URL_JOIN_QUERY) && __URLSET(new_url, query) && __URLSET(old_url, query)) { ++ zval qarr, qstr; ++ ++ INIT_PZVAL(&qstr); ++ INIT_PZVAL(&qarr); ++ array_init(&qarr); ++ ++ ZVAL_STRING(&qstr, old_url->query, 0); ++ http_querystring_modify(&qarr, &qstr); ++ ZVAL_STRING(&qstr, new_url->query, 0); ++ http_querystring_modify(&qarr, &qstr); ++ ++ ZVAL_NULL(&qstr); ++ http_querystring_update(&qarr, &qstr); ++ url->query = Z_STRVAL(qstr); ++ zval_dtor(&qarr); ++ } else { ++ __URLCPY(query); ++ } ++ } ++ if (!(flags & HTTP_URL_STRIP_FRAGMENT)) { ++ __URLCPY(fragment); ++ } ++ ++ if (!url->scheme) { ++ if (flags & HTTP_URL_FROM_ENV) { ++ zval *https = http_get_server_var("HTTPS", 1); ++ if (https && !strcasecmp(Z_STRVAL_P(https), "ON")) { ++ url->scheme = estrndup("https", lenof("https")); ++ } else switch (url->port) { ++ case 443: ++ url->scheme = estrndup("https", lenof("https")); ++ break; ++ ++#ifndef HAVE_GETSERVBYPORT ++ default: ++#endif ++ case 80: ++ case 0: ++ url->scheme = estrndup("http", lenof("http")); ++ break; ++ ++#ifdef HAVE_GETSERVBYPORT ++ default: ++ if ((se = getservbyport(htons(url->port), "tcp")) && se->s_name) { ++ url->scheme = estrdup(se->s_name); ++ } else { ++ url->scheme = estrndup("http", lenof("http")); ++ } ++ break; ++#endif ++ } ++ } else { ++ url->scheme = estrndup("http", lenof("http")); ++ } ++ } ++ ++ if (!url->host) { ++ if (flags & HTTP_URL_FROM_ENV) { ++ zval *zhost; ++ ++ if ((((zhost = http_get_server_var("HTTP_HOST", 1)) || ++ (zhost = http_get_server_var("SERVER_NAME", 1)))) && Z_STRLEN_P(zhost)) { ++ url->host = estrndup(Z_STRVAL_P(zhost), Z_STRLEN_P(zhost)); ++ } else { ++ url->host = localhostname(); ++ } ++ } else { ++ url->host = estrndup("localhost", lenof("localhost")); ++ } ++ } ++ ++ if (!url->path) { ++ if ((flags & HTTP_URL_FROM_ENV) && SG(request_info).request_uri && SG(request_info).request_uri[0]) { ++ const char *q = strchr(SG(request_info).request_uri, '?'); ++ ++ if (q) { ++ url->path = estrndup(SG(request_info).request_uri, q - SG(request_info).request_uri); ++ } else { ++ url->path = estrdup(SG(request_info).request_uri); ++ } ++ } else { ++ url->path = estrndup("/", 1); ++ } ++ } else if (url->path[0] != '/') { ++ if ((flags & HTTP_URL_FROM_ENV) && SG(request_info).request_uri && SG(request_info).request_uri[0]) { ++ size_t ulen = strlen(SG(request_info).request_uri); ++ size_t plen = strlen(url->path); ++ char *path; ++ ++ if (SG(request_info).request_uri[ulen-1] != '/') { ++ for (--ulen; ulen && SG(request_info).request_uri[ulen - 1] != '/'; --ulen); ++ } ++ ++ path = emalloc(ulen + plen + 1); ++ memcpy(path, SG(request_info).request_uri, ulen); ++ memcpy(path + ulen, url->path, plen); ++ path[ulen + plen] = '\0'; ++ STR_SET(url->path, path); ++ } else { ++ size_t plen = strlen(url->path); ++ char *path = emalloc(plen + 1 + 1); ++ ++ path[0] = '/'; ++ memcpy(&path[1], url->path, plen + 1); ++ STR_SET(url->path, path); ++ } ++ } ++ /* replace directory references if path is not a single slash */ ++ if (url->path[0] && (url->path[0] != '/' || url->path[1])) { ++ char *ptr, *end = url->path + strlen(url->path) + 1; ++ ++ for (ptr = strstr(url->path, "/."); ptr; ptr = strstr(ptr, "/.")) { ++ switch (ptr[2]) { ++ case '\0': ++ ptr[1] = '\0'; ++ break; ++ ++ case '/': ++ memmove(&ptr[1], &ptr[3], end - &ptr[3]); ++ break; ++ ++ case '.': ++ if (ptr[3] == '/') { ++ char *pos = &ptr[4]; ++ while (ptr != url->path) { ++ if (*--ptr == '/') { ++ break; ++ } ++ } ++ memmove(&ptr[1], pos, end - pos); ++ break; ++ } else if (!ptr[3]) { ++ /* .. at the end */ ++ ptr[1] = '\0'; ++ } ++ /* fallthrough */ ++ ++ default: ++ /* something else */ ++ ++ptr; ++ break; ++ } ++ } ++ } ++ ++ if (url->port) { ++ if ( ((url->port == 80) && !strcmp(url->scheme, "http")) ++ || ((url->port ==443) && !strcmp(url->scheme, "https")) ++#ifdef HAVE_GETSERVBYNAME ++ || ((se = getservbyname(url->scheme, "tcp")) && se->s_port && ++ (url->port == ntohs(se->s_port))) ++#endif ++ ) { ++ url->port = 0; ++ } ++ } ++ ++ if (url_str) { ++ size_t len; ++ ++ *url_str = emalloc(HTTP_URL_MAXLEN + 1); ++ ++ **url_str = '\0'; ++ strlcat(*url_str, url->scheme, HTTP_URL_MAXLEN); ++ strlcat(*url_str, "://", HTTP_URL_MAXLEN); ++ ++ if (url->user && *url->user) { ++ strlcat(*url_str, url->user, HTTP_URL_MAXLEN); ++ if (url->pass && *url->pass) { ++ strlcat(*url_str, ":", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->pass, HTTP_URL_MAXLEN); ++ } ++ strlcat(*url_str, "@", HTTP_URL_MAXLEN); ++ } ++ ++ strlcat(*url_str, url->host, HTTP_URL_MAXLEN); ++ ++ if (url->port) { ++ char port_str[8]; ++ ++ snprintf(port_str, sizeof(port_str), "%d", (int) url->port); ++ strlcat(*url_str, ":", HTTP_URL_MAXLEN); ++ strlcat(*url_str, port_str, HTTP_URL_MAXLEN); ++ } ++ ++ strlcat(*url_str, url->path, HTTP_URL_MAXLEN); ++ ++ if (url->query && *url->query) { ++ strlcat(*url_str, "?", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->query, HTTP_URL_MAXLEN); ++ } ++ ++ if (url->fragment && *url->fragment) { ++ strlcat(*url_str, "#", HTTP_URL_MAXLEN); ++ strlcat(*url_str, url->fragment, HTTP_URL_MAXLEN); ++ } ++ ++ if (HTTP_URL_MAXLEN == (len = strlen(*url_str))) { ++ http_error(HE_NOTICE, HTTP_E_URL, "Length of URL exceeds HTTP_URL_MAXLEN"); ++ } ++ if (url_len) { ++ *url_len = len; ++ } ++ } ++ ++ if (url_ptr) { ++ *url_ptr = url; ++ } else { ++ php_url_free(url); ++ } ++} ++/* }}} */ ++ ++/* {{{ STATUS http_urlencode_hash_ex(HashTable *, zend_bool, char *, size_t, char **, size_t *) */ ++PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, zend_bool override_argsep, ++ char *pre_encoded_data, size_t pre_encoded_len, ++ char **encoded_data, size_t *encoded_len TSRMLS_DC) ++{ ++ char *arg_sep; ++ size_t arg_sep_len; ++ phpstr *qstr = phpstr_new(); ++ ++ if (override_argsep || !(arg_sep_len = strlen(arg_sep = INI_STR("arg_separator.output")))) { ++ arg_sep = HTTP_URL_ARGSEP; ++ arg_sep_len = lenof(HTTP_URL_ARGSEP); ++ } ++ ++ if (pre_encoded_len && pre_encoded_data) { ++ phpstr_append(qstr, pre_encoded_data, pre_encoded_len); ++ } ++ ++ if (SUCCESS != http_urlencode_hash_recursive(hash, qstr, arg_sep, arg_sep_len, NULL, 0)) { ++ phpstr_free(&qstr); ++ return FAILURE; ++ } ++ ++ phpstr_data(qstr, encoded_data, encoded_len); ++ phpstr_free(&qstr); ++ ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* {{{ http_urlencode_hash_recursive */ ++PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, const char *arg_sep, size_t arg_sep_len, const char *prefix, size_t prefix_len TSRMLS_DC) ++{ ++ HashKey key = initHashKey(0); ++ zval **data = NULL; ++ HashPosition pos; ++ ++ if (!ht || !str) { ++ http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid parameters"); ++ return FAILURE; ++ } ++ if (ht->nApplyCount > 0) { ++ return SUCCESS; ++ } ++ ++ FOREACH_HASH_KEYVAL(pos, ht, key, data) { ++ char *encoded_key; ++ int encoded_len; ++ phpstr new_prefix; ++ ++ if (!data || !*data) { ++ phpstr_dtor(str); ++ return FAILURE; ++ } ++ ++ if (key.type == HASH_KEY_IS_STRING) { ++ if (!*key.str) { ++ /* only public properties */ ++ continue; ++ } ++ if (key.len && key.str[key.len - 1] == '\0') { ++ --key.len; ++ } ++ encoded_key = php_url_encode(key.str, key.len, &encoded_len); ++ } else { ++ encoded_len = spprintf(&encoded_key, 0, "%ld", key.num); ++ } ++ ++ { ++ phpstr_init(&new_prefix); ++ if (prefix && prefix_len) { ++ phpstr_append(&new_prefix, prefix, prefix_len); ++ phpstr_appends(&new_prefix, "%5B"); ++ } ++ ++ phpstr_append(&new_prefix, encoded_key, encoded_len); ++ efree(encoded_key); ++ ++ if (prefix && prefix_len) { ++ phpstr_appends(&new_prefix, "%5D"); ++ } ++ phpstr_fix(&new_prefix); ++ } ++ ++ if (Z_TYPE_PP(data) == IS_ARRAY || Z_TYPE_PP(data) == IS_OBJECT) { ++ STATUS status; ++ ++ht->nApplyCount; ++ status = http_urlencode_hash_recursive(HASH_OF(*data), str, arg_sep, arg_sep_len, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); ++ --ht->nApplyCount; ++ if (SUCCESS != status) { ++ phpstr_dtor(&new_prefix); ++ phpstr_dtor(str); ++ return FAILURE; ++ } ++ } else { ++ zval *val = http_zsep(IS_STRING, *data); ++ ++ if (PHPSTR_LEN(str)) { ++ phpstr_append(str, arg_sep, arg_sep_len); ++ } ++ phpstr_append(str, PHPSTR_VAL(&new_prefix), PHPSTR_LEN(&new_prefix)); ++ phpstr_appends(str, "="); ++ ++ if (Z_STRLEN_P(val) && Z_STRVAL_P(val)) { ++ char *encoded_val; ++ int encoded_len; ++ ++ encoded_val = php_url_encode(Z_STRVAL_P(val), Z_STRLEN_P(val), &encoded_len); ++ phpstr_append(str, encoded_val, encoded_len); ++ efree(encoded_val); ++ } ++ ++ zval_ptr_dtor(&val); ++ } ++ phpstr_dtor(&new_prefix); ++ } ++ return SUCCESS; ++} ++/* }}} */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/http_util_object.c +@@ -0,0 +1,158 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: http_util_object.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#include "php_http.h" ++ ++#ifdef ZEND_ENGINE_2 ++ ++#include "ext/standard/php_http.h" ++ ++#include "php_http_util_object.h" ++ ++#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpUtil, method, 0, req_args) ++#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpUtil, method, 0) ++ ++#define HTTP_UTIL_ALIAS(method, func) HTTP_STATIC_ME_ALIAS(method, func, HTTP_ARGS(HttpUtil, method)) ++ ++HTTP_BEGIN_ARGS(date, 0) ++ HTTP_ARG_VAL(timestamp, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildStr, 1) ++ HTTP_ARG_VAL(query, 0) ++ HTTP_ARG_VAL(prefix, 0) ++ HTTP_ARG_VAL(arg_sep, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildUrl, 1) ++ HTTP_ARG_VAL(url, 0) ++ HTTP_ARG_VAL(parts, 0) ++ HTTP_ARG_VAL(flags, 0) ++ HTTP_ARG_VAL(composed, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateLanguage, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateCharset, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(negotiateContentType, 1) ++ HTTP_ARG_VAL(supported, 0) ++ HTTP_ARG_VAL(result, 1) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchModified, 1) ++ HTTP_ARG_VAL(last_modified, 0) ++ HTTP_ARG_VAL(for_range, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchEtag, 1) ++ HTTP_ARG_VAL(plain_etag, 0) ++ HTTP_ARG_VAL(for_range, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(matchRequestHeader, 2) ++ HTTP_ARG_VAL(header_name, 0) ++ HTTP_ARG_VAL(header_value, 0) ++ HTTP_ARG_VAL(case_sensitive, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseMessage, 1) ++ HTTP_ARG_VAL(message_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseHeaders, 1) ++ HTTP_ARG_VAL(headers_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseCookie, 1) ++ HTTP_ARG_VAL(cookie_string, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(buildCookie, 1) ++ HTTP_ARG_VAL(cookie_array, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(parseParams, 1) ++ HTTP_ARG_VAL(param_string, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(chunkedDecode, 1) ++ HTTP_ARG_VAL(encoded_string, 0) ++HTTP_END_ARGS; ++ ++#ifdef HTTP_HAVE_ZLIB ++HTTP_BEGIN_ARGS(deflate, 1) ++ HTTP_ARG_VAL(plain, 0) ++ HTTP_ARG_VAL(flags, 0) ++HTTP_END_ARGS; ++ ++HTTP_BEGIN_ARGS(inflate, 1) ++ HTTP_ARG_VAL(encoded, 0) ++HTTP_END_ARGS; ++#endif ++ ++HTTP_BEGIN_ARGS(support, 0) ++ HTTP_ARG_VAL(feature, 0) ++HTTP_END_ARGS; ++ ++zend_class_entry *http_util_object_ce; ++zend_function_entry http_util_object_fe[] = { ++ HTTP_UTIL_ALIAS(date, http_date) ++ HTTP_UTIL_ALIAS(buildUrl, http_build_url) ++ HTTP_UTIL_ALIAS(buildStr, http_build_str) ++ HTTP_UTIL_ALIAS(negotiateLanguage, http_negotiate_language) ++ HTTP_UTIL_ALIAS(negotiateCharset, http_negotiate_charset) ++ HTTP_UTIL_ALIAS(negotiateContentType, http_negotiate_content_type) ++ HTTP_UTIL_ALIAS(matchModified, http_match_modified) ++ HTTP_UTIL_ALIAS(matchEtag, http_match_etag) ++ HTTP_UTIL_ALIAS(matchRequestHeader, http_match_request_header) ++ HTTP_UTIL_ALIAS(parseMessage, http_parse_message) ++ HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers) ++ HTTP_UTIL_ALIAS(parseCookie, http_parse_cookie) ++ HTTP_UTIL_ALIAS(buildCookie, http_build_cookie) ++ HTTP_UTIL_ALIAS(parseParams, http_parse_params) ++ HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode) ++#ifdef HTTP_HAVE_ZLIB ++ HTTP_UTIL_ALIAS(deflate, http_deflate) ++ HTTP_UTIL_ALIAS(inflate, http_inflate) ++#endif /* HTTP_HAVE_ZLIB */ ++ HTTP_UTIL_ALIAS(support, http_support) ++ ++ EMPTY_FUNCTION_ENTRY ++}; ++ ++PHP_MINIT_FUNCTION(http_util_object) ++{ ++ HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, 0); ++ return SUCCESS; ++} ++ ++#endif /* ZEND_ENGINE_2 */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/lib/BigGet.php +@@ -0,0 +1,213 @@ ++ ++ * @license BSD, revised ++ * @version $Revision: 220502 $ ++ */ ++class BigGet extends HttpRequestPool ++{ ++ /** ++ * File split size ++ */ ++ const SIZE = 1048576; ++ ++ /** ++ * Parallel Request count ++ */ ++ const RMAX = 5; ++ ++ /** ++ * Whether to output debug messages ++ * ++ * @var bool ++ */ ++ public $dbg = false; ++ ++ /** ++ * URL ++ * ++ * @var string ++ */ ++ private $url; ++ ++ /** ++ * Temp file prefix ++ * ++ * @var string ++ */ ++ private $tmp; ++ ++ /** ++ * Size of requested resource ++ * ++ * @var int ++ */ ++ private $size; ++ ++ /** ++ * Whether the requests have been sent ++ * ++ * @var bool ++ */ ++ private $sent = false; ++ ++ /** ++ * Request counter ++ * ++ * @var int ++ */ ++ private $count = 0; ++ ++ /** ++ * Static constructor ++ * ++ * @param string $url ++ * @param string $tmp ++ * @return BigGet ++ * @throws Exception ++ */ ++ public static function url($url, $tmp = '/tmp') ++ { ++ $head = new HttpRequest($url, HttpRequest::METH_HEAD); ++ $headers = $head->send()->getHeaders(); ++ ++ if (200 != $head->getResponseCode()) { ++ throw new HttpException("Did not receive '200 Ok' from HEAD $url"); ++ } ++ if (!isset($headers['Accept-Ranges'])) { ++ throw new HttpException("Did not receive an Accept-Ranges header from HEAD $url"); ++ } ++ if (!isset($headers['Content-Length'])) { ++ throw new HttpException("Did not receive a Content-Length header from HEAD $url"); ++ } ++ ++ $bigget = new BigGet; ++ $bigget->url = $url; ++ $bigget->tmp = tempnam($tmp, 'BigGet.'); ++ $bigget->size = $headers['Content-Length']; ++ return $bigget; ++ } ++ ++ /** ++ * Save the resource to a file ++ * ++ * @param string $file ++ * @return bool ++ * @throws Exception ++ */ ++ public function saveTo($file) ++ { ++ $this->sent or $this->send(); ++ ++ if ($w = fopen($this->tmp, 'wb')) { ++ ++ $this->dbg && print "\nCopying temp files to $file ...\n"; ++ ++ foreach (glob($this->tmp .".????") as $tmp) { ++ ++ $this->dbg && print "\t$tmp\n"; ++ ++ if ($r = fopen($tmp, 'rb')) { ++ stream_copy_to_stream($r, $w); ++ fclose($r); ++ } ++ unlink($tmp); ++ } ++ fclose($w); ++ rename($this->tmp, $file); ++ ++ $this->dbg && print "\nDone.\n"; ++ ++ return true; ++ } ++ return false; ++ } ++ ++ /** ++ * Overrides HttpRequestPool::send() ++ * ++ * @return void ++ * @throws Exception ++ */ ++ public function send() ++ { ++ $this->sent = true; ++ ++ // use max RMAX simultanous requests with a req size of SIZE ++ while ($this->count < self::RMAX && -1 != $offset = $this->getRangeOffset()) { ++ $this->attachNew($offset); ++ } ++ ++ while ($this->socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ /** ++ * Overrides HttpRequestPool::socketPerform() ++ * ++ * @return bool ++ */ ++ protected function socketPerform() ++ { ++ $rs = parent::socketPerform(); ++ ++ foreach ($this->getFinishedRequests() as $r) { ++ $this->detach($r); ++ ++ if (206 != $rc = $r->getResponseCode()) { ++ throw new HttpException("Unexpected response code: $rc"); ++ } ++ ++ file_put_contents(sprintf("%s.%04d", $this->tmp, $r->id), $r->getResponseBody()); ++ ++ if (-1 != $offset = $this->getRangeOffset()) { ++ $this->attachNew($offset); ++ } ++ } ++ ++ return $rs; ++ } ++ ++ private function attachNew($offset) ++ { ++ $stop = min($this->count * self::SIZE + self::SIZE, $this->size) - 1; ++ ++ $this->dbg && print "Attaching new request to get range: $offset-$stop\n"; ++ ++ $req = new BigGetRequest( ++ $this->url, ++ HttpRequest::METH_GET, ++ array( ++ 'headers' => array( ++ 'Range' => "bytes=$offset-$stop" ++ ) ++ ) ++ ); ++ $this->attach($req); ++ $req->id = $this->count++; ++ } ++ ++ private function getRangeOffset() ++ { ++ return ($this->size >= $start = $this->count * self::SIZE) ? $start : -1; ++ } ++} ++ ++ ++/** ++ * BigGet request ++ * @ignore ++ */ ++class BigGetRequest extends HttpRequest ++{ ++ public $id; ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/FeedAggregator.php +@@ -0,0 +1,187 @@ ++ ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 208774 $ ++ */ ++class FeedAggregator ++{ ++ /** ++ * Cache directory ++ * ++ * @var string ++ */ ++ public $directory; ++ ++ /** ++ * Feeds ++ * ++ * @var array ++ */ ++ protected $feeds = array(); ++ ++ /** ++ * Constructor ++ * ++ * @param string $directory ++ */ ++ public function __construct($directory = 'feeds') ++ { ++ $this->setDirectory($directory); ++ } ++ ++ /** ++ * Set cache directory ++ * ++ * @param string $directory ++ */ ++ public function setDirectory($directory) ++ { ++ $this->directory = $directory; ++ foreach (glob($this->directory .'/*.xml') as $feed) { ++ $this->feeds[basename($feed, '.xml')] = filemtime($feed); ++ } ++ } ++ ++ /** ++ * Strips all special chars ++ * ++ * @param string $url ++ * @return string ++ */ ++ public function url2name($url) ++ { ++ return preg_replace('/[^\w\.-]+/', '_', $url); ++ } ++ ++ /** ++ * Checks if $url is a known feed ++ * ++ * @param string $url ++ * @return bool ++ */ ++ public function hasFeed($url) ++ { ++ return isset($this->feeds[$this->url2name($url)]); ++ } ++ ++ /** ++ * Add an URL as feed ++ * ++ * @param string $url ++ * @return void ++ * @throws Exception ++ */ ++ public function addFeed($url) ++ { ++ $r = $this->setupRequest($url); ++ $r->send(); ++ $this->handleResponse($r); ++ } ++ ++ /** ++ * Add several URLs as feeds ++ * ++ * @param array $urls ++ * @return void ++ * @throws Exception ++ */ ++ public function addFeeds(array $urls) ++ { ++ $pool = new HttpRequestPool; ++ foreach ($urls as $url) { ++ $pool->attach($r = $this->setupRequest($url)); ++ } ++ $pool->send(); ++ ++ foreach ($pool as $request) { ++ $this->handleResponse($request); ++ } ++ } ++ ++ /** ++ * Load a feed (from cache) ++ * ++ * @param string $url ++ * @return string ++ * @throws Exception ++ */ ++ public function getFeed($url) ++ { ++ $this->addFeed($url); ++ return $this->loadFeed($this->url2name($url)); ++ } ++ ++ /** ++ * Load several feeds (from cache) ++ * ++ * @param array $urls ++ * @return array ++ * @throws Exception ++ */ ++ public function getFeeds(array $urls) ++ { ++ $feeds = array(); ++ $this->addFeeds($urls); ++ foreach ($urls as $url) { ++ $feeds[] = $this->loadFeed($this->url2name($url)); ++ } ++ return $feeds; ++ } ++ ++ protected function saveFeed($file, $contents) ++ { ++ if (file_put_contents($this->directory .'/'. $file .'.xml', $contents)) { ++ $this->feeds[$file] = time(); ++ } else { ++ throw new Exception("Could not save feed contents to $file.xml"); ++ } ++ } ++ ++ protected function loadFeed($file) ++ { ++ if (isset($this->feeds[$file])) { ++ if ($data = file_get_contents($this->directory .'/'. $file .'.xml')) { ++ return $data; ++ } else { ++ throw new Exception("Could not load feed contents from $file.xml"); ++ } ++ } else { ++ throw new Exception("Unknown feed/file $file.xml"); ++ } ++ } ++ ++ protected function setupRequest($url, $escape = true) ++ { ++ $r = new HttpRequest($url); ++ $r->setOptions(array('redirect' => true)); ++ ++ $file = $escape ? $this->url2name($url) : $url; ++ ++ if (isset($this->feeds[$file])) { ++ $r->setOptions(array('lastmodified' => $this->feeds[$file])); ++ } ++ ++ return $r; ++ } ++ ++ protected function handleResponse(HttpRequest $r) ++ { ++ if ($r->getResponseCode() != 304) { ++ if ($r->getResponseCode() != 200) { ++ throw new Exception("Unexpected response code ". $r->getResponseCode()); ++ } ++ if (!strlen($body = $r->getResponseBody())) { ++ throw new Exception("Received empty feed from ". $r->getUrl()); ++ } ++ $this->saveFeed($this->url2name($r->getUrl()), $body); ++ } ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/PgLobStream.php +@@ -0,0 +1,100 @@ ++ ++ * // GET /image.php?image=1234 ++ * if (PgLobStream::$loId = (int) $_GET['image']) { ++ * if ($lob = fopen('pglob://dbname=database user=mike', 'r')) { ++ * HttpResponse::setContentType('image/jpeg'); ++ * HttpResponse::setStream($lob); ++ * HttpResponse::send(); ++ * } ++ * } ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 210232 $ ++ */ ++class PgLobStream ++{ ++ private $dbh; ++ private $loh; ++ private $lon; ++ private $size = 0; ++ ++ public static $loId; ++ ++ function stream_open($path, $mode) ++ { ++ $path = trim(parse_url($path, PHP_URL_HOST)); ++ ++ if ($path) { ++ if ($this->dbh = pg_connect($path)) { ++ if (pg_query($this->dbh, 'BEGIN')) { ++ if (is_resource($this->loh = pg_lo_open($this->dbh, $this->lon = self::$loId, $mode))) { ++ pg_lo_seek($this->loh, 0, PGSQL_SEEK_END); ++ $this->size = (int) pg_lo_tell($this->loh); ++ pg_lo_seek($this->loh, 0, PGSQL_SEEK_SET); ++ return true; ++ } ++ } ++ } ++ } ++ return false; ++ } ++ ++ function stream_read($length) ++ { ++ return pg_lo_read($this->loh, $length); ++ } ++ ++ function stream_seek($offset, $whence = PGSQL_SEEK_SET) ++ { ++ return pg_lo_seek($this->loh, $offset, $whence); ++ } ++ ++ function stream_tell() ++ { ++ return pg_lo_tell($this->loh); ++ } ++ ++ function stream_eof() ++ { ++ return pg_lo_tell($this->loh) >= $this->size; ++ } ++ ++ function stream_flush() ++ { ++ return true; ++ } ++ ++ function stream_stat() ++ { ++ return array('size' => $this->size, 'ino' => $this->lon); ++ } ++ ++ function stream_write($data) ++ { ++ return pg_lo_write($this->loh, $data); ++ } ++ ++ function stream_close() ++ { ++ if (pg_lo_close($this->loh)) { ++ return pg_query($this->dbh, 'COMMIT'); ++ } else { ++ pg_query($this->dbh, 'ROLLBACK'); ++ return false; ++ } ++ } ++} ++ ++stream_register_wrapper('pglob', 'PgLobStream'); ++ ++?> +--- /dev/null ++++ b/ext/http/lib/XmlRpcClient.php +@@ -0,0 +1,119 @@ ++ ++ * __request->setOptions(array('compress' => true)); ++ * try { ++ * print_r($rpc->vpop->listdomain(array('domain' => 'example.com'))); ++ * } catch (Exception $ex) { ++ * echo $ex; ++ * } ++ * ?> ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 227268 $ ++ */ ++class XmlRpcClient ++{ ++ /** ++ * RPC namespace ++ * ++ * @var string ++ */ ++ public $__namespace; ++ ++ /** ++ * HttpRequest instance ++ * ++ * @var HttpRequest ++ */ ++ public $__request; ++ ++ /** ++ * Client charset ++ * ++ * @var string ++ */ ++ public $__encoding = "iso-8859-1"; ++ ++ /** ++ * RPC options ++ * ++ * @var array ++ */ ++ public $__options; ++ ++ /** ++ * Constructor ++ * ++ * @param string $url RPC endpoint ++ * @param string $namespace RPC namespace ++ * @param array $options HttpRequest options ++ */ ++ public function __construct($url, $namespace = '', array $options = null) ++ { ++ $this->__request = new HttpRequest($url, HttpRequest::METH_POST, (array) $options); ++ $this->__namespace = $namespace; ++ } ++ ++ /** ++ * RPC method proxy ++ * ++ * @param string $method RPC method name ++ * @param array $params RPC method arguments ++ * @return mixed decoded RPC response ++ * @throws Exception ++ */ ++ public function __call($method, array $params) ++ { ++ if (strlen($this->__namespace)) { ++ $method = $this->__namespace .'.'. $method; ++ } ++ $this->__request->setContentType("text/xml"); ++ $this->__request->setRawPostData( ++ xmlrpc_encode_request($method, $params, ++ array("encoding" => $this->__encoding) + (array) $this->__options)); ++ $response = $this->__request->send(); ++ if ($response->getResponseCode() != 200) { ++ throw new Exception( ++ $response->getResponseStatus(), ++ $response->getResponseCode() ++ ); ++ } ++ ++ $data = xmlrpc_decode($response->getBody(), $this->__encoding); ++ if (xmlrpc_is_fault($data)) { ++ throw new Exception( ++ (string) $data['faultString'], ++ (int) $data['faultCode'] ++ ); ++ } ++ ++ return $data; ++ } ++ ++ /** ++ * Returns self, where namespace is set to variable name ++ * ++ * @param string $ns ++ * @return XmlRpcRequest ++ */ ++ public function __get($ns) ++ { ++ $this->__namespace = $ns; ++ return $this; ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/lib/XmlRpcServer.php +@@ -0,0 +1,254 @@ ++ ++ * registerHandler(new Handler); ++ * XmlRpcServer::run(); ++ * } catch (Exception $ex) { ++ * XmlRpcServer::error($ex->getCode(), $ex->getMessage()); ++ * } ++ * ++ * ++ * @copyright Michael Wallner, ++ * @license BSD, revised ++ * @package pecl/http ++ * @version $Revision: 227268 $ ++ */ ++ ++class XmlRpcServer extends HttpResponse ++{ ++ /** ++ * Server charset ++ * ++ * @var string ++ */ ++ public static $encoding = "iso-8859-1"; ++ ++ /** ++ * RPC namespace ++ * ++ * @var string ++ */ ++ public $namespace; ++ ++ /** ++ * RPC handler attached to this server instance ++ * ++ * @var XmlRpcRequestHandler ++ */ ++ protected $handler; ++ ++ private static $xmlreq; ++ private static $xmlrpc; ++ private static $refcnt = 0; ++ private static $handle = array(); ++ ++ /** ++ * Create a new XmlRpcServer instance ++ * ++ * @param string $namespace ++ * @param string $encoding ++ */ ++ public function __construct($namespace) ++ { ++ $this->namespace = $namespace; ++ self::initialize(); ++ } ++ ++ /** ++ * Destructor ++ */ ++ public function __destruct() ++ { ++ if (self::$refcnt && !--self::$refcnt) { ++ xmlrpc_server_destroy(self::$xmlrpc); ++ } ++ } ++ ++ /** ++ * Static factory ++ * ++ * @param string $namespace ++ * @return XmlRpcServer ++ */ ++ public static function factory($namespace) ++ { ++ return new XmlRpcServer($namespace); ++ } ++ ++ /** ++ * Run all servers and send response ++ * ++ * @param array $options ++ */ ++ public static function run(array $options = null) ++ { ++ self::initialize(false, true); ++ self::setContentType("text/xml; charset=". self::$encoding); ++ echo xmlrpc_server_call_method(self::$xmlrpc, self::$xmlreq, null, ++ array("encoding" => self::$encoding) + (array) $options); ++ } ++ ++ /** ++ * Test hook; call instead of XmlRpcServer::run() ++ * ++ * @param string $method ++ * @param array $params ++ * @param array $request_options ++ * @param array $response_options ++ */ ++ public static function test($method, array $params, array $request_options = null, array $response_options = null) ++ { ++ self::$xmlreq = xmlrpc_encode_request($method, $params, $request_options); ++ self::run($response_options); ++ } ++ ++ /** ++ * Optional XMLRPC error handler ++ * ++ * @param int $code ++ * @param string $msg ++ */ ++ public static function error($code, $msg, array $options = null) ++ { ++ echo xmlrpc_encode(array("faultCode" => $code, "faultString" => $msg), ++ array("encoding" => self::$encoding) + (array) $options); ++ } ++ ++ /** ++ * Register a single method ++ * ++ * @param string $name ++ * @param mixed $callback ++ * @param mixed $dispatch ++ * @param array $spec ++ */ ++ public function registerMethod($name, $callback, $dispatch = null, array $spec = null) ++ { ++ if (!is_callable($callback, false, $cb_name)) { ++ throw new Exception("$cb_name is not a valid callback"); ++ } ++ if (isset($dispatch)) { ++ if (!is_callable($dispatch, false, $cb_name)) { ++ throw new Exception("$cb_name is not a valid callback"); ++ } ++ xmlrpc_server_register_method(self::$xmlrpc, $name, $dispatch); ++ self::$handle[$name] = $callback; ++ } else { ++ xmlrpc_server_register_method(self::$xmlrpc, $name, $callback); ++ } ++ ++ if (isset($spec)) { ++ xmlrpc_server_add_introspection_data(self::$xmlrpc, $spec); ++ } ++ } ++ ++ /** ++ * Register an XmlRpcRequestHandler for this server instance ++ * ++ * @param XmlRpcRequestHandler $handler ++ */ ++ public function registerHandler(XmlRpcRequestHandler $handler) ++ { ++ $this->handler = $handler; ++ ++ foreach (get_class_methods($handler) as $method) { ++ if (!strncmp($method, "xmlrpc", 6)) { ++ $this->registerMethod( ++ $this->method($method, $handler->getNamespace()), ++ array($handler, $method), array($this, "dispatch")); ++ } ++ } ++ ++ $handler->getIntrospectionData($spec); ++ if (is_array($spec)) { ++ xmlrpc_server_add_introspection_data(self::$xmlrpc, $spec); ++ } ++ } ++ ++ private function method($method, $namespace = null) ++ { ++ if (!strlen($namespace)) { ++ $namespace = strlen($this->namespace) ? $this->namespace : "xmlrpc"; ++ } ++ return $namespace .".". strtolower($method[6]) . substr($method, 7); ++ } ++ ++ private function dispatch($method, array $params = null) ++ { ++ if (array_key_exists($method, self::$handle)) { ++ return call_user_func(self::$handle[$method], $params); ++ } ++ throw new Exception("Unknown XMLRPC method: $method"); ++ } ++ ++ private static function initialize($server = true, $data = false) ++ { ++ if ($data) { ++ if (!self::$xmlreq && !(self::$xmlreq = http_get_request_body())) { ++ throw new Exception("Failed to fetch XMLRPC request body"); ++ } ++ } ++ if ($server) { ++ if (!self::$xmlrpc && !(self::$xmlrpc = xmlrpc_server_create())) { ++ throw new Exception("Failed to initialize XMLRPC server"); ++ } ++ ++self::$refcnt; ++ } ++ } ++} ++ ++/** ++ * XmlRpcRequestHandler ++ * ++ * Define XMLRPC methods with an "xmlrpc" prefix, eg: ++ * ++ * class IntOp implements XmlRpcRequestHandler { ++ * public function getNamespace() { ++ * return "int"; ++ * } ++ * public function getInstrospectionData(array &$spec = null) { ++ * } ++ * // XMLRPC method name: int.sumValues ++ * public function xmlrpcSumValues(array $values) { ++ * return array_sum($values); ++ * } ++ * } ++ * ++ */ ++interface XmlRpcRequestHandler ++{ ++ public function getNamespace(); ++ public function getIntrospectionData(array &$spec = null); ++} ++ ++/** ++ * XmlRpcRequestHandlerStub ++ */ ++abstract class XmlRpcRequestHandlerStub implements XmlRpcRequestHandler ++{ ++ public function getNamespace() ++ { ++ } ++ public function getIntrospectionData(array &$spec = null) ++ { ++ } ++} ++ ++?> +--- /dev/null ++++ b/ext/http/missing.c +@@ -0,0 +1,74 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: missing.c 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#endif ++ ++#include "php.h" ++#include "missing.h" ++ ++#ifdef WONKY ++int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC) ++{ ++ zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS); ++ INIT_PZVAL(property); ++ ZVAL_DOUBLE(property, value); ++ return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); ++} ++ ++void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC) ++{ ++ zval *tmp = ecalloc(1, sizeof(zval)); ++ ZVAL_DOUBLE(tmp, value); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC) ++{ ++ zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS); ++ INIT_PZVAL(property); ++ ZVAL_BOOL(property, value); ++ return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); ++} ++ ++void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) ++{ ++ zval *tmp = ecalloc(1, sizeof(zval)); ++ ZVAL_BOOL(tmp, value); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) ++{ ++ zval *tmp; ++ ++ ALLOC_ZVAL(tmp); ++ tmp->is_ref = 0; ++ tmp->refcount = 0; ++ ZVAL_STRINGL(tmp, value, value_len, 1); ++ zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/missing.h +@@ -0,0 +1,180 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: missing.h 298892 2010-05-03 08:29:31Z mike $ */ ++ ++#ifndef PHP_HTTP_MISSING ++#define PHP_HTTP_MISSING ++ ++#include "php_version.h" ++ ++#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399) ++# define ZEND_LITERAL_KEY_DC , const zend_literal *_zend_literal_key ++# define ZEND_LITERAL_KEY_CC , _zend_literal_key ++# define ZEND_LITERAL_NIL_CC , NULL ++# define HTTP_CHECK_OPEN_BASEDIR(file, act) \ ++ if ((PG(open_basedir) && *PG(open_basedir))) \ ++ { \ ++ const char *tmp = file; \ ++ \ ++ if (!strncasecmp(tmp, "file:", lenof("file:"))) { \ ++ tmp += lenof("file:"); \ ++ while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \ ++ } \ ++ \ ++ if ( (tmp != file || !strstr(file, "://")) && \ ++ (!*tmp || php_check_open_basedir(tmp TSRMLS_CC))) { \ ++ act; \ ++ } \ ++ } ++ ++#else ++# define ZEND_LITERAL_KEY_DC ++# define ZEND_LITERAL_KEY_CC ++# define ZEND_LITERAL_NIL_CC ++# define HTTP_CHECK_OPEN_BASEDIR(file, act) \ ++ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) \ ++ { \ ++ const char *tmp = file; \ ++ \ ++ if (!strncasecmp(tmp, "file:", lenof("file:"))) { \ ++ tmp += lenof("file:"); \ ++ while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \ ++ } \ ++ \ ++ if ( (tmp != file || !strstr(file, "://")) && \ ++ (!*tmp || php_check_open_basedir(tmp TSRMLS_CC) || \ ++ (PG(safe_mode) && !php_checkuid(tmp, "rb+", CHECKUID_CHECK_MODE_PARAM)))) { \ ++ act; \ ++ } \ ++ } ++ ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3) ++# define HTTP_ZAPI_HASH_TSRMLS_CC TSRMLS_CC ++# define HTTP_ZAPI_HASH_TSRMLS_DC TSRMLS_DC ++# define HTTP_ZAPI_CONST_CAST(t) (const t) ++# define GLOBAL_ERROR_HANDLING EG(error_handling) ++# define GLOBAL_EXCEPTION_CLASS EG(exception_class) ++# define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC) ++# define HTTP_STATIC_ARG_INFO ++#else ++# define HTTP_ZAPI_HASH_TSRMLS_CC ++# define HTTP_ZAPI_HASH_TSRMLS_DC ++# define HTTP_ZAPI_CONST_CAST(t) (t) ++# define GLOBAL_ERROR_HANDLING PG(error_handling) ++# define GLOBAL_EXCEPTION_CLASS PG(exception_class) ++# define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp)) ++# define HTTP_STATIC_ARG_INFO static ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0) ++# define WONKY ++#endif ++ ++#ifndef pemalloc_rel ++# define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size)) ++#endif ++ ++#ifndef ZEND_ACC_DEPRECATED ++# define ZEND_ACC_DEPRECATED 0 ++#endif ++ ++#if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10 ++# define php_url_parse_ex(u, l) php_url_parse(u) ++#endif ++ ++#ifndef TSRMLS_FETCH_FROM_CTX ++# ifdef ZTS ++# define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx ++# else ++# define TSRMLS_FETCH_FROM_CTX(ctx) ++# endif ++#endif ++ ++#ifndef TSRMLS_SET_CTX ++# ifdef ZTS ++# define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls ++# else ++# define TSRMLS_SET_CTX(ctx) ++# endif ++#endif ++ ++#ifndef ZVAL_ADDREF ++# define ZVAL_ADDREF Z_ADDREF_P ++#endif ++ ++#ifndef SEPARATE_ARG_IF_REF ++#define SEPARATE_ARG_IF_REF(zv) \ ++ if (PZVAL_IS_REF(zv)) { \ ++ zval *ov = zv; \ ++ ALLOC_INIT_ZVAL(zv); \ ++ Z_TYPE_P(zv) = Z_TYPE_P(ov); \ ++ zv->value = ov->value; \ ++ zval_copy_ctor(zv); \ ++ } else { \ ++ ZVAL_ADDREF(zv); \ ++ } ++#endif ++ ++#ifndef ZVAL_ZVAL ++#define ZVAL_ZVAL(z, zv, copy, dtor) { \ ++ int is_ref, refcount; \ ++ is_ref = (z)->is_ref; \ ++ refcount = (z)->refcount; \ ++ *(z) = *(zv); \ ++ if (copy) { \ ++ zval_copy_ctor(z); \ ++ } \ ++ if (dtor) { \ ++ if (!copy) { \ ++ ZVAL_NULL(zv); \ ++ } \ ++ zval_ptr_dtor(&zv); \ ++ } \ ++ (z)->is_ref = is_ref; \ ++ (z)->refcount = refcount; \ ++ } ++#endif ++#ifndef RETVAL_ZVAL ++# define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor) ++#endif ++#ifndef RETURN_ZVAL ++# define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; } ++#endif ++ ++#ifndef ZEND_MN ++# define ZEND_MN(name) ZEND_FN(name) ++#endif ++ ++#ifdef WONKY ++extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC); ++extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC); ++ ++extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC); ++extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC); ++ ++extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC); ++#endif ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http.h +@@ -0,0 +1,262 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http.h 310776 2011-05-05 06:35:46Z mike $ */ ++ ++#ifndef PHP_EXT_HTTP_H ++#define PHP_EXT_HTTP_H ++ ++#define PHP_HTTP_VERSION "1.7.1" ++ ++#ifdef HAVE_CONFIG_H ++# include "config.h" ++#else ++# ifndef PHP_WIN32 ++# include "php_config.h" ++# endif ++#endif ++ ++#include "php.h" ++#include "missing.h" ++#include "php_http_std_defs.h" ++#include "phpstr/phpstr.h" ++ ++#ifdef HTTP_WANT_SAPI ++# if PHP_API_VERSION > 20041225 ++# define HTTP_HAVE_SAPI_RTIME ++# endif ++# include "SAPI.h" ++#endif ++ ++#ifdef HTTP_WANT_NETDB ++# ifdef PHP_WIN32 ++# define HTTP_HAVE_NETDB ++# include ++# elif defined(HAVE_NETDB_H) ++# define HTTP_HAVE_NETDB ++# include ++# ifdef HAVE_UNISTD_H ++# include ++# endif ++# endif ++#endif ++ ++#if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL) ++# ifdef PHP_WIN32 ++# include ++# define CURL_STATICLIB ++# endif ++# include ++# define HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z))) ++# ++# if defined(HTTP_WANT_EVENT) && defined(HTTP_HAVE_EVENT) ++# include ++# endif ++#endif ++ ++#if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC) ++# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC) ++# define USE_MAGIC_STATIC ++# endif ++# include ++#endif ++ ++#if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB) ++# include ++#endif ++ ++#include ++#define HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c)) ++#define HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c)) ++ ++extern zend_module_entry http_module_entry; ++#define phpext_http_ptr &http_module_entry ++ ++extern int http_module_number; ++ ++ZEND_BEGIN_MODULE_GLOBALS(http) ++ ++ struct _http_globals_etag { ++ char *mode; ++ void *ctx; ++ zend_bool started; ++ } etag; ++ ++ struct _http_globals_log { ++ char *cache; ++ char *redirect; ++ char *not_found; ++ char *allowed_methods; ++ char *composite; ++ } log; ++ ++ struct _http_globals_send { ++ double throttle_delay; ++ size_t buffer_size; ++ char *content_type; ++ char *unquoted_etag; ++ time_t last_modified; ++ struct _http_globals_send_deflate { ++ zend_bool response; ++ zend_bool start_auto; ++ long start_flags; ++ int encoding; ++ void *stream; ++ } deflate; ++ struct _http_globals_send_inflate { ++ zend_bool start_auto; ++ long start_flags; ++ void *stream; ++ } inflate; ++ zend_bool not_found_404; ++ } send; ++ ++ struct _http_globals_request { ++ time_t time; ++ HashTable *headers; ++ struct _http_globals_request_methods { ++ HashTable registered; ++ char *allowed; ++ char *custom; ++ } methods; ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) ++ struct _http_globals_request_datashare { ++ zend_llist handles; ++ zend_bool cookie; ++ zend_bool dns; ++ zend_bool ssl; ++ zend_bool connect; ++ } datashare; ++#endif ++#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_EVENT) ++ struct _http_globals_request_pool { ++ struct _http_globals_request_pool_event { ++ void *base; ++ } event; ++ } pool; ++#endif ++ } request; ++ ++ struct _http_globals_persistent { ++ struct _http_globals_persistent_handles { ++ ulong limit; ++ struct _http_globals_persistent_handles_ident { ++ ulong h; ++ char *s; ++ size_t l; ++ } ident; ++ } handles; ++ } persistent; ++ ++#ifdef ZEND_ENGINE_2 ++ zend_bool only_exceptions; ++#endif ++ ++ zend_bool force_exit; ++ zend_bool read_post_data; ++ zval *server_var; ++ ++ZEND_END_MODULE_GLOBALS(http) ++ ++ZEND_EXTERN_MODULE_GLOBALS(http); ++ ++#ifdef ZTS ++# include "TSRM.h" ++# define HTTP_G ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)]) ++#else ++# define HTTP_G (&http_globals) ++#endif ++ ++#if defined(HAVE_ICONV) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV)) ++# define HTTP_HAVE_ICONV ++#endif ++ ++#if defined(HAVE_PHP_SESSION) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_SESSION)) ++# define HTTP_HAVE_SESSION ++#endif ++ ++#if defined(HAVE_HASH_EXT) && (HTTP_SHARED_DEPS || !defined(COMPILE_DL_HASH)) && defined(HTTP_HAVE_PHP_HASH_H) ++# define HTTP_HAVE_HASH ++#endif ++ ++#if defined(HAVE_SPL) ++# define HTTP_HAVE_SPL ++#endif ++ ++PHP_FUNCTION(http_date); ++PHP_FUNCTION(http_build_url); ++PHP_FUNCTION(http_build_str); ++PHP_FUNCTION(http_negotiate_language); ++PHP_FUNCTION(http_negotiate_charset); ++PHP_FUNCTION(http_negotiate_content_type); ++PHP_FUNCTION(http_negotiate); ++PHP_FUNCTION(http_redirect); ++PHP_FUNCTION(http_throttle); ++PHP_FUNCTION(http_send_status); ++PHP_FUNCTION(http_send_last_modified); ++PHP_FUNCTION(http_send_content_type); ++PHP_FUNCTION(http_send_content_disposition); ++PHP_FUNCTION(http_match_modified); ++PHP_FUNCTION(http_match_etag); ++PHP_FUNCTION(http_cache_last_modified); ++PHP_FUNCTION(http_cache_etag); ++PHP_FUNCTION(http_send_data); ++PHP_FUNCTION(http_send_file); ++PHP_FUNCTION(http_send_stream); ++PHP_FUNCTION(http_chunked_decode); ++PHP_FUNCTION(http_parse_message); ++PHP_FUNCTION(http_parse_headers); ++PHP_FUNCTION(http_parse_cookie); ++PHP_FUNCTION(http_build_cookie); ++PHP_FUNCTION(http_parse_params); ++PHP_FUNCTION(http_get_request_headers); ++PHP_FUNCTION(http_get_request_body); ++PHP_FUNCTION(http_get_request_body_stream); ++PHP_FUNCTION(http_match_request_header); ++PHP_FUNCTION(http_persistent_handles_count); ++PHP_FUNCTION(http_persistent_handles_clean); ++PHP_FUNCTION(http_persistent_handles_ident); ++#ifdef HTTP_HAVE_CURL ++PHP_FUNCTION(http_get); ++PHP_FUNCTION(http_head); ++PHP_FUNCTION(http_post_data); ++PHP_FUNCTION(http_post_fields); ++PHP_FUNCTION(http_put_data); ++PHP_FUNCTION(http_put_file); ++PHP_FUNCTION(http_put_stream); ++PHP_FUNCTION(http_request); ++PHP_FUNCTION(http_request_body_encode); ++#endif /* HTTP_HAVE_CURL */ ++PHP_FUNCTION(http_request_method_register); ++PHP_FUNCTION(http_request_method_unregister); ++PHP_FUNCTION(http_request_method_exists); ++PHP_FUNCTION(http_request_method_name); ++PHP_FUNCTION(ob_etaghandler); ++#ifdef HTTP_HAVE_ZLIB ++PHP_FUNCTION(http_deflate); ++PHP_FUNCTION(http_inflate); ++PHP_FUNCTION(ob_deflatehandler); ++PHP_FUNCTION(ob_inflatehandler); ++#endif ++PHP_FUNCTION(http_support); ++ ++#endif /* PHP_HTTP_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_api.h +@@ -0,0 +1,318 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_api.h 298891 2010-05-03 08:26:38Z mike $ */ ++ ++#ifndef PHP_HTTP_API_H ++#define PHP_HTTP_API_H ++ ++#define HTTP_SUPPORT 0x01L ++#define HTTP_SUPPORT_REQUESTS 0x02L ++#define HTTP_SUPPORT_MAGICMIME 0x04L ++#define HTTP_SUPPORT_ENCODINGS 0x08L ++#define HTTP_SUPPORT_SSLREQUESTS 0x20L ++#define HTTP_SUPPORT_PERSISTENCE 0x40L ++#define HTTP_SUPPORT_EVENTS 0x80L ++ ++#define HTTP_PARAMS_ALLOW_COMMA 0x01 ++#define HTTP_PARAMS_ALLOW_FAILURE 0x02 ++#define HTTP_PARAMS_RAISE_ERROR 0x04 ++#define HTTP_PARAMS_DEFAULT (HTTP_PARAMS_ALLOW_COMMA|HTTP_PARAMS_ALLOW_FAILURE|HTTP_PARAMS_RAISE_ERROR) ++#define HTTP_PARAMS_COLON_SEPARATOR 0x10 ++ ++extern PHP_MINIT_FUNCTION(http_support); ++ ++#define http_support(f) _http_support(f) ++PHP_HTTP_API long _http_support(long feature); ++ ++#define pretty_key(key, key_len, uctitle, xhyphen) _http_pretty_key(key, key_len, uctitle, xhyphen) ++extern char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen); ++ ++#define http_boundary(b, l) _http_boundary((b), (l) TSRMLS_CC) ++extern size_t _http_boundary(char *buf, size_t len TSRMLS_DC); ++ ++#define http_error(type, code, string) _http_error_ex(type, code, "%s", string) ++#define http_error_ex _http_error_ex ++extern void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...); ++ ++ ++#ifdef ZEND_ENGINE_2 ++#define http_exception_wrap(o, n, ce) _http_exception_wrap((o), (n), (ce) TSRMLS_CC) ++extern zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC); ++ ++#define http_try \ ++{ \ ++ zval *old_exception = EG(exception); \ ++ EG(exception) = NULL; ++#define http_catch(ex_ce) \ ++ if (EG(exception) && old_exception) { \ ++ EG(exception) = http_exception_wrap(old_exception, EG(exception), ex_ce); \ ++ } \ ++} ++#define http_final(ex_ce) \ ++ if (EG(exception)) { \ ++ EG(exception) = http_exception_wrap(EG(exception), NULL, ex_ce); \ ++ } ++ ++typedef zend_object_value (*http_object_new_t)(zend_class_entry *ce, void *, void ** TSRMLS_DC); ++ ++#define http_object_new(ov, cn, cl, co, ce, i, pp) _http_object_new((ov), (cn), (cl), (http_object_new_t) (co), (ce), (i), (void *) (pp) TSRMLS_CC) ++extern STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname_len, http_object_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC); ++#endif /* ZEND_ENGINE_2 */ ++ ++ ++#define HTTP_CHECK_CURL_INIT(ch, init, action) \ ++ if ((!(ch)) && (!((ch) = init))) { \ ++ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not initialize curl"); \ ++ action; \ ++ } ++#define HTTP_CHECK_CONTENT_TYPE(ct, action) \ ++ if (!strchr((ct), '/')) { \ ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, \ ++ "Content type \"%s\" does not seem to contain a primary and a secondary part", (ct)); \ ++ action; \ ++ } ++#define HTTP_CHECK_MESSAGE_TYPE_RESPONSE(msg, action) \ ++ if (!HTTP_MSG_TYPE(RESPONSE, (msg))) { \ ++ http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_RESPONSE"); \ ++ action; \ ++ } ++#define HTTP_CHECK_MESSAGE_TYPE_REQUEST(msg, action) \ ++ if (!HTTP_MSG_TYPE(REQUEST, (msg))) { \ ++ http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST"); \ ++ action; \ ++ } ++#define HTTP_CHECK_GZIP_LEVEL(level, action) \ ++ if (level < -1 || level > 9) { \ ++ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid compression level (-1 to 9): %d", level); \ ++ action; \ ++ } ++ ++#define HTTP_CHECK_HEADERS_SENT(action) \ ++ if (SG(headers_sent) && !SG(request_info).no_headers) { \ ++ char *output_start_filename = php_get_output_start_filename(TSRMLS_C); \ ++ int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); \ ++ \ ++ if (output_start_filename) { \ ++ http_error_ex(HE_WARNING, HTTP_E_HEADER, "Cannot modify header information - headers already sent by (output started at %s:%d)", \ ++ output_start_filename, output_start_lineno); \ ++ } else { \ ++ http_error(HE_WARNING, HTTP_E_HEADER, "Cannot modify header information - headers already sent"); \ ++ } \ ++ action; \ ++ } ++ ++#define http_log(f, i, m) _http_log_ex((f), (i), (m) TSRMLS_CC) ++extern void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC); ++ ++#define http_exit(s, h) http_exit_ex((s), (h), NULL, 1) ++#define http_exit_ex(s, h, b, e) _http_exit_ex((s), (h), (b), (e) TSRMLS_CC) ++extern STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC); ++ ++#define http_check_method(m) http_check_method_ex((m), HTTP_KNOWN_METHODS) ++#define http_check_method_ex(m, a) _http_check_method_ex((m), (a)) ++extern STATUS _http_check_method_ex(const char *method, const char *methods); ++ ++#define http_got_server_var(v) (NULL != http_get_server_var_ex((v), strlen(v), 1)) ++#define http_get_server_var(v, c) http_get_server_var_ex((v), strlen(v), (c)) ++#define http_get_server_var_ex(v, l, c) _http_get_server_var_ex((v), (l), (c) TSRMLS_CC) ++PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend_bool check TSRMLS_DC); ++ ++#define http_get_request_body(b, l) _http_get_request_body_ex((b), (l), 1 TSRMLS_CC) ++#define http_get_request_body_ex(b, l, d) _http_get_request_body_ex((b), (l), (d) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC); ++ ++#define http_get_request_body_stream() _http_get_request_body_stream(TSRMLS_C) ++PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D); ++ ++ ++typedef void (*http_parse_params_callback)(void *cb_arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC); ++ ++#define http_parse_params_default_callback _http_parse_params_default_callback ++PHP_HTTP_API void _http_parse_params_default_callback(void *ht, const char *key, int keylen, const char *val, int vallen TSRMLS_DC); ++ ++#define http_parse_params(s, f, ht) _http_parse_params_ex((s), (f), _http_parse_params_default_callback, (ht) TSRMLS_CC) ++#define http_parse_params_ex(s, f, cb, a) _http_parse_params_ex((s), (f), (cb), (a) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_parse_params_ex(const char *params, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC); ++ ++ ++#define http_sleep(s) _http_sleep(s) ++static inline void _http_sleep(double s) ++{ ++#define HTTP_DIFFSEC (0.001) ++#define HTTP_MLLISEC (1000) ++#define HTTP_MCROSEC (1000 * 1000) ++#define HTTP_NANOSEC (1000 * 1000 * 1000) ++#define HTTP_MSEC(s) ((long)(s * HTTP_MLLISEC)) ++#define HTTP_USEC(s) ((long)(s * HTTP_MCROSEC)) ++#define HTTP_NSEC(s) ((long)(s * HTTP_NANOSEC)) ++ ++#if defined(PHP_WIN32) ++ Sleep((DWORD) HTTP_MSEC(s)); ++#elif defined(HAVE_USLEEP) ++ usleep(HTTP_USEC(s)); ++#elif defined(HAVE_NANOSLEEP) ++ struct timespec req, rem; ++ ++ req.tv_sec = (time_t) s; ++ req.tv_nsec = HTTP_NSEC(s) % HTTP_NANOSEC; ++ ++ while (nanosleep(&req, &rem) && (errno == EINTR) && (HTTP_NSEC(rem.tv_sec) + rem.tv_nsec) > HTTP_NSEC(HTTP_DIFFSEC))) { ++ req.tv_sec = rem.tv_sec; ++ req.tv_nsec = rem.tv_nsec; ++ } ++#else ++ struct timeval timeout; ++ ++ timeout.tv.sec = (time_t) s; ++ timeout.tv_usec = HTTP_USEC(s) % HTTP_MCROSEC; ++ ++ select(0, NULL, NULL, NULL, &timeout); ++#endif ++} ++ ++#define http_locate_str _http_locate_str ++static inline const char *_http_locate_str(const char *h, size_t h_len, const char *n, size_t n_len) ++{ ++ const char *p, *e; ++ ++ if (n_len && h_len) { ++ e = h + h_len; ++ do { ++ if (*h == *n) { ++ for (p = n; *p == h[p-n]; ++p) { ++ if (p == n+n_len-1) { ++ return h; ++ } ++ } ++ } ++ } while (h++ != e); ++ } ++ ++ return NULL; ++} ++ ++#define http_locate_body _http_locate_body ++static inline const char *_http_locate_body(const char *message) ++{ ++ const char *body = NULL, *msg = message; ++ ++ while (*msg) { ++ if (*msg == '\n') { ++ if (*(msg+1) == '\n') { ++ body = msg + 2; ++ break; ++ } else if (*(msg+1) == '\r' && *(msg+2) == '\n') { ++ body = msg + 3; ++ break; ++ } ++ } ++ ++msg; ++ } ++ return body; ++} ++ ++#define http_locate_eol _http_locate_eol ++static inline const char *_http_locate_eol(const char *line, int *eol_len) ++{ ++ const char *eol = strpbrk(line, "\r\n"); ++ ++ if (eol_len) { ++ *eol_len = eol ? ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1) : 0; ++ } ++ return eol; ++} ++ ++#define http_zset(t, z) _http_zset((t), (z)) ++static inline zval *_http_zset(int type, zval *z) ++{ ++ if (Z_TYPE_P(z) != type) { ++ switch (type) { ++ case IS_NULL: convert_to_null(z); break; ++ case IS_BOOL: convert_to_boolean(z); break; ++ case IS_LONG: convert_to_long(z); break; ++ case IS_DOUBLE: convert_to_double(z); break; ++ case IS_STRING: convert_to_string(z); break; ++ case IS_ARRAY: convert_to_array(z); break; ++ case IS_OBJECT: convert_to_object(z); break; ++ } ++ } ++ return z; ++} ++#define http_zsep(t, z) _http_zsep_ex((t), (z), NULL) ++#define http_zsep_ex(t, z, p) _http_zsep_ex((t), (z), (p)) ++static inline zval *_http_zsep_ex(int type, zval *z, zval **p) { ++ SEPARATE_ARG_IF_REF(z); ++ if (Z_TYPE_P(z) != type) { ++ switch (type) { ++ case IS_NULL: convert_to_null_ex(&z); break; ++ case IS_BOOL: convert_to_boolean_ex(&z); break; ++ case IS_LONG: convert_to_long_ex(&z); break; ++ case IS_DOUBLE: convert_to_double_ex(&z); break; ++ case IS_STRING: convert_to_string_ex(&z); break; ++ case IS_ARRAY: convert_to_array_ex(&z); break; ++ case IS_OBJECT: convert_to_object_ex(&z); break; ++ } ++ } ++ if (p) { ++ *p = z; ++ } ++ return z; ++} ++ ++typedef struct _HashKey { ++ char *str; ++ uint len; ++ ulong num; ++ uint dup:1; ++ uint type:31; ++} HashKey; ++#define initHashKey(dup) {NULL, 0, 0, (dup), 0} ++ ++#define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, Z_ARRVAL_P(array), val) ++#define FOREACH_HASH_VAL(pos, hash, val) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ ++ zend_hash_move_forward_ex(hash, &pos)) ++ ++#define FOREACH_KEY(pos, array, key) FOREACH_HASH_KEY(pos, Z_ARRVAL_P(array), key) ++#define FOREACH_HASH_KEY(pos, hash, _key) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT; \ ++ zend_hash_move_forward_ex(hash, &pos)) \ ++ ++#define FOREACH_KEYVAL(pos, array, key, val) FOREACH_HASH_KEYVAL(pos, Z_ARRVAL_P(array), key, val) ++#define FOREACH_HASH_KEYVAL(pos, hash, _key, val) \ ++ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ ++ ((_key).type = zend_hash_get_current_key_ex(hash, &(_key).str, &(_key).len, &(_key).num, (zend_bool) (_key).dup, &pos)) != HASH_KEY_NON_EXISTANT && \ ++ zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ ++ zend_hash_move_forward_ex(hash, &pos)) ++ ++#define array_copy(src, dst) zend_hash_copy(dst, src, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)) ++#define ARRAY_JOIN_STRONLY 1 ++#define ARRAY_JOIN_PRETTIFY 2 ++#define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src HTTP_ZAPI_HASH_TSRMLS_CC, (append)?apply_array_append_func:apply_array_merge_func, 2, dst, (int)flags) ++ ++extern int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key); ++extern int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_cache_api.h +@@ -0,0 +1,162 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_cache_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_CACHE_API_H ++#define PHP_HTTP_CACHE_API_H ++ ++#include "php_http_send_api.h" ++ ++#include "ext/standard/crc32.h" ++#include "ext/standard/sha1.h" ++#include "ext/standard/md5.h" ++ ++#ifdef HTTP_HAVE_HASH ++# include "php_hash.h" ++#endif ++ ++#define http_etag_digest(d, l) _http_etag_digest((d), (l)) ++static inline char *_http_etag_digest(const unsigned char *digest, int len) ++{ ++ static const char hexdigits[17] = "0123456789abcdef"; ++ int i; ++ char *hex = emalloc(len * 2 + 1); ++ char *ptr = hex; ++ ++ for (i = 0; i < len; ++i) { ++ *ptr++ = hexdigits[digest[i] >> 4]; ++ *ptr++ = hexdigits[digest[i] & 0xF]; ++ } ++ *ptr = '\0'; ++ ++ return hex; ++} ++ ++#define http_etag_init() _http_etag_init(TSRMLS_C) ++static inline void *_http_etag_init(TSRMLS_D) ++{ ++ void *ctx = NULL; ++ char *mode = HTTP_G->etag.mode; ++ ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ ctx = emalloc(eho->context_size); ++ eho->hash_init(ctx); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ ctx = emalloc(sizeof(uint)); ++ *((uint *) ctx) = ~0; ++ } else if (mode && !strcasecmp(mode, "sha1")) { ++ PHP_SHA1Init(ctx = emalloc(sizeof(PHP_SHA1_CTX))); ++ } else { ++ PHP_MD5Init(ctx = emalloc(sizeof(PHP_MD5_CTX))); ++ } ++ ++ return ctx; ++} ++ ++#define http_etag_finish(c) _http_etag_finish((c) TSRMLS_CC) ++static inline char *_http_etag_finish(void *ctx TSRMLS_DC) ++{ ++ unsigned char digest[128] = {0}; ++ char *etag = NULL, *mode = HTTP_G->etag.mode; ++ ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ eho->hash_final(digest, ctx); ++ etag = http_etag_digest(digest, eho->digest_size); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ *((uint *) ctx) = ~*((uint *) ctx); ++ etag = http_etag_digest((const unsigned char *) ctx, sizeof(uint)); ++ } else if (mode && (!strcasecmp(mode, "sha1"))) { ++ PHP_SHA1Final(digest, ctx); ++ etag = http_etag_digest(digest, 20); ++ } else { ++ PHP_MD5Final(digest, ctx); ++ etag = http_etag_digest(digest, 16); ++ } ++ efree(ctx); ++ ++ return etag; ++} ++ ++#define http_etag_update(c, d, l) _http_etag_update((c), (d), (l) TSRMLS_CC) ++static inline void _http_etag_update(void *ctx, const char *data_ptr, size_t data_len TSRMLS_DC) ++{ ++ char *mode = HTTP_G->etag.mode; ++#ifdef HTTP_HAVE_HASH ++ const php_hash_ops *eho = NULL; ++ ++ if (mode && (eho = php_hash_fetch_ops(mode, strlen(mode)))) { ++ eho->hash_update(ctx, (const unsigned char *) data_ptr, data_len); ++ } else ++#endif ++ if (mode && ((!strcasecmp(mode, "crc32")) || (!strcasecmp(mode, "crc32b")))) { ++ uint i, c = *((uint *) ctx); ++ for (i = 0; i < data_len; ++i) { ++ CRC32(c, data_ptr[i]); ++ } ++ *((uint *)ctx) = c; ++ } else if (mode && (!strcasecmp(mode, "sha1"))) { ++ PHP_SHA1Update(ctx, (const unsigned char *) data_ptr, data_len); ++ } else { ++ PHP_MD5Update(ctx, (const unsigned char *) data_ptr, data_len); ++ } ++} ++ ++#define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC) ++extern void _http_ob_etaghandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); ++ ++#define http_etag(p, l, m) _http_etag((p), (l), (m) TSRMLS_CC) ++PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC); ++ ++#define http_last_modified(p, m) _http_last_modified((p), (m) TSRMLS_CC) ++PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC); ++ ++#define http_match_last_modified(entry, modified) _http_match_last_modified_ex((entry), (modified), 1 TSRMLS_CC) ++#define http_match_last_modified_ex(entry, modified, ep) _http_match_last_modified_ex((entry), (modified), (ep) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC); ++ ++#define http_match_etag(entry, etag) _http_match_etag_ex((entry), (etag), 1 TSRMLS_CC) ++#define http_match_etag_ex(entry, etag, ep) _http_match_etag_ex((entry), (etag), (ep) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC); ++ ++#define http_cache_last_modified(l, s, cc, ccl) _http_cache_last_modified((l), (s), (cc), (ccl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC); ++ ++#define http_cache_etag(e, el, cc, ccl) _http_cache_etag((e), (el), (cc), (ccl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, const char *cache_control, size_t cc_len TSRMLS_DC); ++ ++#define http_start_ob_etaghandler() _http_start_ob_etaghandler(TSRMLS_C) ++PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D); ++#define http_interrupt_ob_etaghandler() _http_interrupt_ob_etaghandler(TSRMLS_C) ++PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_cookie_api.h +@@ -0,0 +1,86 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_cookie_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_COOKIE_API_H ++#define PHP_HTTP_COOKIE_API_H ++ ++#define HTTP_COOKIE_SECURE 0x10L ++#define HTTP_COOKIE_HTTPONLY 0x20L ++ ++#define HTTP_COOKIE_PARSE_RAW 0x01L ++ ++extern PHP_MINIT_FUNCTION(http_cookie); ++ ++/* ++ generally a netscape cookie compliant struct, recognizing httpOnly attribute, too; ++ cookie params like those from rfc2109 and rfc2965 are just put into extras, if ++ one specifies them in allowed extras, else they're treated like cookies themself ++*/ ++typedef struct _http_cookie_list_t { ++ HashTable cookies; ++ HashTable extras; ++ long flags; ++ char *path; ++ char *domain; ++ time_t expires; ++} http_cookie_list; ++ ++#define http_cookie_list_new() _http_cookie_list_init(NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_cookie_list_init(l) _http_cookie_list_init((l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_cookie_list_init(http_cookie_list *list ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_cookie_list_dtor(l) _http_cookie_list_dtor((l) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_dtor(http_cookie_list *list TSRMLS_DC); ++ ++#define http_cookie_list_free(l) _http_cookie_list_free((l) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC); ++ ++#define http_cookie_list_has_cookie(list, name, name_len) zend_hash_exists(&(list)->cookies, (name), (name_len)+1) ++#define http_cookie_list_has_extra(list, name, name_len) zend_hash_exists(&(list)->extras, (name), (name_len)+1) ++ ++#define http_cookie_list_add_cookie(l, n, nl, v, vl) _http_cookie_list_add_cookie((l), (n), (nl), (v), (vl) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_add_cookie(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC); ++ ++#define http_cookie_list_add_extra(l, n , nl, v, vl) _http_cookie_list_add_extra((l), (n), (nl), (v), (vl) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_add_extra(http_cookie_list *list, const char *name, size_t name_len, const char *value, size_t value_len TSRMLS_DC); ++ ++#define http_cookie_list_get_cookie(l, n, nl) _http_cookie_list_get_cookie((l), (n), (nl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_cookie_list_get_extra(l, n, nl) _http_cookie_list_get_extra((l), (n), (nl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_parse_cookie(s) _http_parse_cookie_ex(NULL, (s), 0, NULL TSRMLS_CC) ++#define http_parse_cookie_ex(l, s, f, a) _http_parse_cookie_ex((l), (s), (f), (a) TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_parse_cookie_ex(http_cookie_list * list, const char *string, long flags, char **allowed_extras TSRMLS_DC); ++ ++#define http_cookie_list_tostruct(l, s) _http_cookie_list_tostruct((l), (s) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_tostruct(http_cookie_list *list, zval *strct TSRMLS_DC); ++ ++#define http_cookie_list_fromstruct(l, s) _http_cookie_list_fromstruct((l), (s) TSRMLS_CC) ++PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *list, zval *strct TSRMLS_DC); ++ ++#define http_cookie_list_tostring(l, str, len) _http_cookie_list_tostring((l), (str), (len) TSRMLS_CC) ++PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str, size_t *len TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_date_api.h +@@ -0,0 +1,35 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_date_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_DATE_API_H ++#define PHP_HTTP_DATE_API_H ++ ++#define http_date(t) _http_date((t) TSRMLS_CC) ++PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC); ++ ++#define http_parse_date(d) _http_parse_date_ex((d), 0 TSRMLS_CC) ++#define http_parse_date_ex(d, s) _http_parse_date_ex((d), (s) TSRMLS_CC) ++PHP_HTTP_API time_t _http_parse_date_ex(const char *date, zend_bool silent TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_deflatestream_object.h +@@ -0,0 +1,57 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_deflatestream_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_DEFLATESTREAM_OBJECT_H ++#define PHP_HTTP_DEFLATESTREAM_OBJECT_H ++#ifdef HTTP_HAVE_ZLIB ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_deflatestream_object_t { ++ zend_object zo; ++ http_encoding_stream *stream; ++} http_deflatestream_object; ++ ++extern zend_class_entry *http_deflatestream_object_ce; ++extern zend_function_entry http_deflatestream_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_deflatestream_object); ++ ++#define http_deflatestream_object_new(ce) _http_deflatestream_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_deflatestream_object_new_ex(ce, s, ptr) _http_deflatestream_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_deflatestream_object **ptr TSRMLS_DC); ++#define http_deflatestream_object_clone(zobj) _http_deflatestream_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_deflatestream_object_clone_obj(zval *object TSRMLS_DC); ++#define http_deflatestream_object_free(o) _http_deflatestream_object_free((o) TSRMLS_CC) ++extern void _http_deflatestream_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpDeflateStream, __construct); ++PHP_METHOD(HttpDeflateStream, factory); ++PHP_METHOD(HttpDeflateStream, update); ++PHP_METHOD(HttpDeflateStream, flush); ++PHP_METHOD(HttpDeflateStream, finish); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_encoding_api.h +@@ -0,0 +1,192 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_encoding_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_ENCODING_API_H ++#define PHP_HTTP_ENCODING_API_H ++ ++#define http_encoding_dechunk(e, el, d, dl) _http_encoding_dechunk((e), (el), (d), (dl) TSRMLS_CC) ++PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); ++ ++#define http_encoding_response_start(cl, i) _http_encoding_response_start((cl), (i) TSRMLS_CC) ++PHP_HTTP_API int _http_encoding_response_start(size_t content_length, zend_bool ignore_http_ohandler TSRMLS_DC); ++ ++#ifdef HTTP_HAVE_ZLIB ++ ++extern PHP_MINIT_FUNCTION(http_encoding); ++extern PHP_RINIT_FUNCTION(http_encoding); ++extern PHP_RSHUTDOWN_FUNCTION(http_encoding); ++ ++typedef enum _http_encoding_type_t { ++ HTTP_ENCODING_NONE, ++ HTTP_ENCODING_GZIP, ++ HTTP_ENCODING_DEFLATE, ++} http_encoding_type; ++ ++#define HTTP_INFLATE_ROUNDS 100 ++ ++#define HTTP_DEFLATE_BUFFER_SIZE_GUESS(S) \ ++ (((size_t) ((double) S * (double) 1.015)) + 10 + 8 + 4 + 1) ++#define HTTP_INFLATE_BUFFER_SIZE_GUESS(S) \ ++ (((S) + 1) << 3) ++#define HTTP_INFLATE_BUFFER_SIZE_ALIGN(S) \ ++ ((S) += (S) >> (3)) ++ ++#define HTTP_DEFLATE_BUFFER_SIZE 0x8000 ++#define HTTP_INFLATE_BUFFER_SIZE 0x1000 ++ ++#define HTTP_DEFLATE_LEVEL_DEF 0x00000000 ++#define HTTP_DEFLATE_LEVEL_MIN 0x00000001 ++#define HTTP_DEFLATE_LEVEL_MAX 0x00000009 ++#define HTTP_DEFLATE_TYPE_ZLIB 0x00000000 ++#define HTTP_DEFLATE_TYPE_GZIP 0x00000010 ++#define HTTP_DEFLATE_TYPE_RAW 0x00000020 ++#define HTTP_DEFLATE_STRATEGY_DEF 0x00000000 ++#define HTTP_DEFLATE_STRATEGY_FILT 0x00000100 ++#define HTTP_DEFLATE_STRATEGY_HUFF 0x00000200 ++#define HTTP_DEFLATE_STRATEGY_RLE 0x00000300 ++#define HTTP_DEFLATE_STRATEGY_FIXED 0x00000400 ++ ++#define HTTP_DEFLATE_LEVEL_SET(flags, level) \ ++ switch (flags & 0xf) \ ++ { \ ++ default: \ ++ if ((flags & 0xf) < 10) { \ ++ level = flags & 0xf; \ ++ break; \ ++ } \ ++ case HTTP_DEFLATE_LEVEL_DEF: \ ++ level = Z_DEFAULT_COMPRESSION; \ ++ break; \ ++ } ++ ++#define HTTP_DEFLATE_WBITS_SET(flags, wbits) \ ++ switch (flags & 0xf0) \ ++ { \ ++ case HTTP_DEFLATE_TYPE_GZIP: \ ++ wbits = HTTP_WINDOW_BITS_GZIP; \ ++ break; \ ++ case HTTP_DEFLATE_TYPE_RAW: \ ++ wbits = HTTP_WINDOW_BITS_RAW; \ ++ break; \ ++ default: \ ++ wbits = HTTP_WINDOW_BITS_ZLIB; \ ++ break; \ ++ } ++ ++#define HTTP_INFLATE_WBITS_SET(flags, wbits) \ ++ if (flags & HTTP_INFLATE_TYPE_RAW) { \ ++ wbits = HTTP_WINDOW_BITS_RAW; \ ++} else { \ ++ wbits = HTTP_WINDOW_BITS_ANY; \ ++} ++ ++#define HTTP_DEFLATE_STRATEGY_SET(flags, strategy) \ ++ switch (flags & 0xf00) \ ++ { \ ++ case HTTP_DEFLATE_STRATEGY_FILT: \ ++ strategy = Z_FILTERED; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_HUFF: \ ++ strategy = Z_HUFFMAN_ONLY; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_RLE: \ ++ strategy = Z_RLE; \ ++ break; \ ++ case HTTP_DEFLATE_STRATEGY_FIXED: \ ++ strategy = Z_FIXED; \ ++ break; \ ++ default: \ ++ strategy = Z_DEFAULT_STRATEGY; \ ++ break; \ ++ } ++ ++#define HTTP_WINDOW_BITS_ZLIB 0x0000000f ++#define HTTP_WINDOW_BITS_GZIP 0x0000001f ++#define HTTP_WINDOW_BITS_ANY 0x0000002f ++#define HTTP_WINDOW_BITS_RAW -0x000000f ++ ++#ifndef Z_FIXED ++/* Z_FIXED does not exist prior 1.2.2.2 */ ++# define Z_FIXED 0 ++#endif ++ ++#define HTTP_INFLATE_TYPE_ZLIB 0x00000000 ++#define HTTP_INFLATE_TYPE_GZIP 0x00000000 ++#define HTTP_INFLATE_TYPE_RAW 0x00000001 ++ ++#define HTTP_ENCODING_STREAM_FLUSH_NONE 0x00000000 ++#define HTTP_ENCODING_STREAM_FLUSH_SYNC 0x00100000 ++#define HTTP_ENCODING_STREAM_FLUSH_FULL 0x00200000 ++ ++#define HTTP_ENCODING_STREAM_FLUSH_FLAG(f) \ ++ (((f) & HTTP_ENCODING_STREAM_FLUSH_FULL) ? Z_FULL_FLUSH : \ ++ (((f) & HTTP_ENCODING_STREAM_FLUSH_SYNC) ? Z_SYNC_FLUSH : Z_NO_FLUSH)) ++ ++#define HTTP_ENCODING_STREAM_PERSISTENT 0x01000000 ++ ++typedef struct _http_encoding_stream_t { ++ z_stream stream; ++ int flags; ++ void *storage; ++} http_encoding_stream; ++ ++#define http_encoding_deflate(f, d, dl, r, rl) _http_encoding_deflate((f), (d), (dl), (r), (rl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate(int flags, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate(d, dl, r, rl) _http_encoding_inflate((d), (dl), (r), (rl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_encoding_deflate_stream_init(s, f) _http_encoding_deflate_stream_init((s), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_encoding_stream *_http_encoding_deflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_update(s, d, dl, e, el) _http_encoding_deflate_stream_update((s), (d), (dl), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_flush(s, e, el) _http_encoding_deflate_stream_flush((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_finish(s, e, el) _http_encoding_deflate_stream_finish((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s, char **encoded, size_t *encoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_deflate_stream_dtor(s) _http_encoding_deflate_stream_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_deflate_stream_dtor(http_encoding_stream *s TSRMLS_DC); ++#define http_encoding_deflate_stream_free(s) _http_encoding_deflate_stream_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_deflate_stream_free(http_encoding_stream **s TSRMLS_DC); ++ ++#define http_encoding_inflate_stream_init(s, f) _http_encoding_inflate_stream_init((s), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_encoding_stream *_http_encoding_inflate_stream_init(http_encoding_stream *s, int flags ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_update(s, d, dl, e, el) _http_encoding_inflate_stream_update((s), (d), (dl), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_flush(s, d, dl) _http_encoding_inflate_stream_flush((s), (d), (dl) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_flush(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_finish(s, e, el) _http_encoding_inflate_stream_finish((s), (e), (el) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s, char **decoded, size_t *decoded_len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++#define http_encoding_inflate_stream_dtor(s) _http_encoding_inflate_stream_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_inflate_stream_dtor(http_encoding_stream *s TSRMLS_DC); ++#define http_encoding_inflate_stream_free(s) _http_encoding_inflate_stream_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_encoding_inflate_stream_free(http_encoding_stream **s TSRMLS_DC); ++ ++#define http_ob_deflatehandler(o, ol, h, hl, m) _http_ob_deflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) ++extern void _http_ob_deflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); ++ ++#define http_ob_inflatehandler(o, ol, h, hl, m) _http_ob_inflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) ++extern void _http_ob_inflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); ++ ++#endif /* HTTP_HAVE_ZLIB */ ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_exception_object.h +@@ -0,0 +1,60 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_exception_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_EXCEPTION_OBJECT_H ++#define PHP_HTTP_EXCEPTION_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++#include "zend_exceptions.h" ++ ++PHP_MINIT_FUNCTION(http_exception_object); ++ ++#define HTTP_EX_DEF_CE http_exception_object_ce ++#define HTTP_EX_CE(name) http_ ##name## _exception_object_ce ++ ++extern zend_class_entry *http_exception_object_ce; ++extern zend_class_entry *HTTP_EX_CE(runtime); ++extern zend_class_entry *HTTP_EX_CE(header); ++extern zend_class_entry *HTTP_EX_CE(malformed_headers); ++extern zend_class_entry *HTTP_EX_CE(request_method); ++extern zend_class_entry *HTTP_EX_CE(message_type); ++extern zend_class_entry *HTTP_EX_CE(invalid_param); ++extern zend_class_entry *HTTP_EX_CE(encoding); ++extern zend_class_entry *HTTP_EX_CE(request); ++extern zend_class_entry *HTTP_EX_CE(request_pool); ++extern zend_class_entry *HTTP_EX_CE(socket); ++extern zend_class_entry *HTTP_EX_CE(response); ++extern zend_class_entry *HTTP_EX_CE(url); ++extern zend_function_entry http_exception_object_fe[]; ++ ++#define http_exception_get_default _http_exception_get_default ++extern zend_class_entry *_http_exception_get_default(); ++ ++#define http_exception_get_for_code(c) _http_exception_get_for_code(c) ++extern zend_class_entry *_http_exception_get_for_code(long code); ++ ++PHP_METHOD(HttpException, __toString); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_filter_api.h +@@ -0,0 +1,33 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_filter_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_FILTER_API_H ++#define PHP_HTTP_FILTER_API_H ++#ifdef ZEND_ENGINE_2 ++ ++extern php_stream_filter_factory http_filter_factory; ++PHP_MINIT_FUNCTION(http_filter); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_headers_api.h +@@ -0,0 +1,77 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_headers_api.h 300300 2010-06-09 07:29:35Z mike $ */ ++ ++#ifndef PHP_HTTP_HEADERS_API_H ++#define PHP_HTTP_HEADERS_API_H ++ ++#include "php_http_info_api.h" ++ ++typedef enum http_range_status_t { ++ RANGE_OK, ++ RANGE_NO, ++ RANGE_ERR ++} http_range_status; ++ ++#define http_parse_headers(h, a) _http_parse_headers_ex((h), Z_ARRVAL_P(a), 1, http_info_default_callback, NULL TSRMLS_CC) ++#define http_parse_headers_ex(h, ht, p) _http_parse_headers_ex((h), (ht), (p), http_info_default_callback, NULL TSRMLS_CC) ++#define http_parse_headers_cb(h, ht, p, f, d) _http_parse_headers_ex((h), (ht), (p), (f), (d) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *headers, zend_bool prettify, http_info_callback callback_func, void **callback_data TSRMLS_DC); ++ ++typedef char *(*negotiate_func_t)(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++ ++#define http_negotiate_language_func _http_negotiate_language_func ++extern char *_http_negotiate_language_func(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++#define http_negotiate_content_type_func _http_negotiate_default_func ++#define http_negotiate_encoding_func _http_negotiate_default_func ++#define http_negotiate_charset_func _http_negotiate_default_func ++#define http_negotiate_default_func _http_negotiate_default_func ++extern char *_http_negotiate_default_func(const char *test, double *quality, HashTable *supported TSRMLS_DC); ++ ++#define http_negotiate_language(zsupported) http_negotiate_language_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_language_ex(supported) http_negotiate_q("HTTP_ACCEPT_LANGUAGE", (supported), http_negotiate_language_func) ++#define http_negotiate_charset(zsupported) http_negotiate_charset_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_charset_ex(supported) http_negotiate_q("HTTP_ACCEPT_CHARSET", (supported), http_negotiate_charset_func) ++#define http_negotiate_encoding(zsupported) http_negotiate_encoding_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_encoding_ex(supported) http_negotiate_q("HTTP_ACCEPT_ENCODING", (supported), http_negotiate_encoding_func) ++#define http_negotiate_content_type(zsupported) http_negotiate_content_type_ex(Z_ARRVAL_P(zsupported)) ++#define http_negotiate_content_type_ex(supported) http_negotiate_q("HTTP_ACCEPT", (supported), http_negotiate_content_type_func) ++#define http_negotiate_q(e, s, n) _http_negotiate_q((e), (s), (n) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *supported, negotiate_func_t neg TSRMLS_DC); ++#define http_negotiate_z(z, s, n) _http_negotiate_z((z), (s), (n) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_negotiate_z(zval *value, HashTable *supported, negotiate_func_t neg TSRMLS_DC); ++ ++#define http_get_request_ranges(r, l) _http_get_request_ranges((r), (l) TSRMLS_CC) ++PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_t length TSRMLS_DC); ++ ++#define http_get_request_headers(h) _http_get_request_headers((h) TSRMLS_CC) ++PHP_HTTP_API void _http_get_request_headers(HashTable *headers TSRMLS_DC); ++ ++#define http_get_response_headers(h) _http_get_response_headers((h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_get_response_headers(HashTable *headers_ht TSRMLS_DC); ++ ++#define http_match_request_header(h, v) http_match_request_header_ex((h), (v), 0) ++#define http_match_request_header_ex(h, v, c) _http_match_request_header_ex((h), (v), (c) TSRMLS_CC) ++PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const char *value, zend_bool match_case TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_inflatestream_object.h +@@ -0,0 +1,57 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_inflatestream_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_INFLATESTREAM_OBJECT_H ++#define PHP_HTTP_INFLATESTREAM_OBJECT_H ++#ifdef HTTP_HAVE_ZLIB ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_inflatestream_object_t { ++ zend_object zo; ++ http_encoding_stream *stream; ++} http_inflatestream_object; ++ ++extern zend_class_entry *http_inflatestream_object_ce; ++extern zend_function_entry http_inflatestream_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_inflatestream_object); ++ ++#define http_inflatestream_object_new(ce) _http_inflatestream_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_inflatestream_object_new_ex(ce, s, ptr) _http_inflatestream_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_new_ex(zend_class_entry *ce, http_encoding_stream *s, http_inflatestream_object **ptr TSRMLS_DC); ++#define http_inflatestream_object_clone(zobj) _http_inflatestream_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_inflatestream_object_clone_obj(zval *object TSRMLS_DC); ++#define http_inflatestream_object_free(o) _http_inflatestream_object_free((o) TSRMLS_CC) ++extern void _http_inflatestream_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpInflateStream, __construct); ++PHP_METHOD(HttpInflateStream, factory); ++PHP_METHOD(HttpInflateStream, update); ++PHP_METHOD(HttpInflateStream, flush); ++PHP_METHOD(HttpInflateStream, finish); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_info_api.h +@@ -0,0 +1,79 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_info_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_INFO_API_H ++#define PHP_HTTP_INFO_API_H ++ ++#define IS_HTTP_REQUEST 1 ++#define IS_HTTP_RESPONSE 2 ++ ++#define HTTP_INFO(ptr) (ptr)->http.info ++ ++#define HTTP_INFO_REQUEST_FMT_ARGS(_http_ptr, _EOL) "%s %s HTTP/%1.1f" _EOL, \ ++ (_http_ptr)->info.request.method?(_http_ptr)->info.request.method:"UNKNOWN", \ ++ (_http_ptr)->info.request.url?(_http_ptr)->info.request.url:"/", \ ++ (_http_ptr)->version>0.0?(_http_ptr)->version:1.1 ++ ++#define HTTP_INFO_RESPONSE_FMT_ARGS(_http_ptr, _EOL) "HTTP/%1.1f %d%s%s" _EOL, \ ++ (_http_ptr)->version>0.0?(_http_ptr)->version:1.1, \ ++ (_http_ptr)->info.response.code?(_http_ptr)->info.response.code:200, \ ++ (_http_ptr)->info.response.status&&*(_http_ptr)->info.response.status ? " ":"", \ ++ STR_PTR((_http_ptr)->info.response.status) ++ ++typedef struct _http_request_info_t { ++ char *method; ++ char *url; ++} http_request_info; ++ ++typedef struct _http_response_info_t { ++ int code; ++ char *status; ++} http_response_info; ++ ++typedef union _http_info_union_t { ++ http_request_info request; ++ http_response_info response; ++} http_info_union; ++ ++struct http_info { ++ http_info_union info; ++ double version; ++}; ++ ++typedef struct _http_info_t { ++ struct http_info http; ++ int type; ++} http_info; ++ ++typedef void (*http_info_callback)(void **callback_data, HashTable **headers, http_info *info TSRMLS_DC); ++ ++#define http_info_default_callback _http_info_default_callback ++PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC); ++#define http_info_dtor _http_info_dtor ++PHP_HTTP_API void _http_info_dtor(http_info *info); ++#define http_info_parse(p, i) _http_info_parse_ex((p), (i), 1 TSRMLS_CC) ++#define http_info_parse_ex(p, i, s) _http_info_parse_ex((p), (i), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info , zend_bool silent TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_message_api.h +@@ -0,0 +1,131 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_message_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_MESSAGE_API_H ++#define PHP_HTTP_MESSAGE_API_H ++ ++#include "php_http_info_api.h" ++ ++typedef enum _http_message_type_t { ++ HTTP_MSG_NONE = 0, ++ HTTP_MSG_REQUEST = IS_HTTP_REQUEST, ++ HTTP_MSG_RESPONSE = IS_HTTP_RESPONSE, ++} http_message_type; ++ ++typedef struct _http_message_t http_message; ++ ++struct _http_message_t { ++ phpstr body; ++ HashTable hdrs; ++ http_message_type type; ++ struct http_info http; ++ http_message *parent; ++}; ++ ++/* required minimum length of an HTTP message "HTTP/1.1" */ ++#define HTTP_MSG_MIN_SIZE 8 ++ ++/* shorthand for type checks */ ++#define HTTP_MSG_TYPE(TYPE, msg) ((msg) && ((msg)->type == HTTP_MSG_ ##TYPE)) ++ ++#define http_message_new() http_message_init_ex(NULL, 0) ++#define http_message_init(m) http_message_init_ex((m), 0) ++#define http_message_init_ex(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) ++#define http_message_init_rel(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ++PHP_HTTP_API http_message *_http_message_init_ex(http_message *m, http_message_type t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ++#define http_message_init_env(m, t) _http_message_init_env((m), (t) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) ++PHP_HTTP_API http_message *_http_message_init_env(http_message *m, http_message_type t TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ++ ++#define http_message_set_type(m, t) _http_message_set_type((m), (t)) ++PHP_HTTP_API void _http_message_set_type(http_message *m, http_message_type t); ++ ++#define http_message_set_info(m, i) _http_message_set_info((m), (i)) ++PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info); ++ ++#define http_message_header(m, h) _http_message_header_ex((m), (h), sizeof(h), 1) ++#define http_message_header_ex _http_message_header_ex ++static inline zval *_http_message_header_ex(http_message *msg, char *key_str, size_t key_len, int join) ++{ ++ zval **header; ++ if (SUCCESS == zend_hash_find(&msg->hdrs, key_str, key_len, (void *) &header)) { ++ if (join && Z_TYPE_PP(header) == IS_ARRAY) { ++ zval *header_str, **val; ++ HashPosition pos; ++ phpstr str; ++ ++ phpstr_init(&str); ++ MAKE_STD_ZVAL(header_str); ++ FOREACH_VAL(pos, *header, val) { ++ phpstr_appendf(&str, PHPSTR_LEN(&str) ? ", %s":"%s", Z_STRVAL_PP(val)); ++ } ++ phpstr_fix(&str); ++ ZVAL_STRINGL(header_str, PHPSTR_VAL(&str), PHPSTR_LEN(&str), 0); ++ return header_str; ++ } else { ++ ZVAL_ADDREF(*header); ++ return *header; ++ } ++ } ++ return NULL; ++} ++ ++#define http_message_count(c, m) \ ++{ \ ++ http_message *__tmp_msg = (m); \ ++ for (c = 0; __tmp_msg; __tmp_msg = __tmp_msg->parent, ++(c)); \ ++} ++ ++#define http_message_parse(m, l) http_message_parse_ex(NULL, (m), (l)) ++#define http_message_parse_ex(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_message_parse_rel(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) ++PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char *message, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_message_tostring(m, s, l) _http_message_tostring((m), (s), (l)) ++PHP_HTTP_API void _http_message_tostring(http_message *msg, char **string, size_t *length); ++ ++#define http_message_serialize(m, s, l) _http_message_serialize((m), (s), (l)) ++PHP_HTTP_API void _http_message_serialize(http_message *message, char **string, size_t *length); ++ ++#define http_message_reverse(m) _http_message_reverse(m) ++PHP_HTTP_API http_message *_http_message_reverse(http_message *msg); ++ ++#define http_message_interconnect(m1, m2) _http_message_interconnect((m1), (m2)) ++PHP_HTTP_API http_message *_http_message_interconnect(http_message *m1, http_message *m2); ++ ++#define http_message_tostruct_recursive(m, s) _http_message_tostruct_recursive((m), (s) TSRMLS_CC) ++PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *strct TSRMLS_DC); ++ ++#define http_message_send(m) _http_message_send((m) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC); ++ ++#define http_message_dup(m) _http_message_dup((m) TSRMLS_CC) ++PHP_HTTP_API http_message *_http_message_dup(http_message *msg TSRMLS_DC); ++ ++#define http_message_dtor(m) _http_message_dtor((m)) ++PHP_HTTP_API void _http_message_dtor(http_message *message); ++ ++#define http_message_free(m) _http_message_free((m)) ++PHP_HTTP_API void _http_message_free(http_message **message); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_message_object.h +@@ -0,0 +1,115 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_message_object.h 298590 2010-04-26 11:46:35Z mike $ */ ++ ++#ifndef PHP_HTTP_MESSAGE_OBJECT_H ++#define PHP_HTTP_MESSAGE_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_message_object_t { ++ zend_object zo; ++ http_message *message; ++ zend_object_value parent; ++ zval *iterator; ++} http_message_object; ++ ++extern zend_class_entry *http_message_object_ce; ++extern zend_function_entry http_message_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_message_object); ++extern PHP_MSHUTDOWN_FUNCTION(http_message_object); ++ ++#define http_message_object_prepend(o, p) http_message_object_prepend_ex((o), (p), 1) ++#define http_message_object_prepend_ex(o, p, t) _http_message_object_prepend_ex((o), (p), (t) TSRMLS_CC) ++extern void _http_message_object_prepend_ex(zval *this_ptr, zval *prepend, zend_bool top TSRMLS_DC); ++ ++#define http_message_object_reverse(t, r) _http_message_object_reverse((t), (r) TSRMLS_CC) ++extern void _http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC); ++ ++#define http_message_object_new(ce) _http_message_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_message_object_new_ex(ce, msg, ptr) _http_message_object_new_ex((ce), (msg), (ptr) TSRMLS_CC) ++extern zend_object_value _http_message_object_new_ex(zend_class_entry *ce, http_message *msg, http_message_object **ptr TSRMLS_DC); ++#define http_message_object_clone(zobj) _http_message_object_clone_obj(zobj TSRMLS_CC) ++extern zend_object_value _http_message_object_clone_obj(zval *object TSRMLS_DC); ++#define http_message_object_free(o) _http_message_object_free((o) TSRMLS_CC) ++extern void _http_message_object_free(zend_object *object TSRMLS_DC); ++ ++#define HTTP_MSG_CHECK_OBJ(obj, dofail) \ ++ if (!(obj)->message) { \ ++ http_error(E_WARNING, HTTP_E_MSG, "HttpMessage is empty"); \ ++ dofail; \ ++ } ++#define HTTP_MSG_CHECK_STD() HTTP_MSG_CHECK_OBJ(obj, RETURN_FALSE) ++ ++#define HTTP_MSG_INIT_OBJ(obj) \ ++ if (!(obj)->message) { \ ++ (obj)->message = http_message_new(); \ ++ } ++#define HTTP_MSG_INIT_STD() HTTP_MSG_INIT_OBJ(obj) ++ ++PHP_METHOD(HttpMessage, __construct); ++PHP_METHOD(HttpMessage, getBody); ++PHP_METHOD(HttpMessage, setBody); ++PHP_METHOD(HttpMessage, getHeader); ++PHP_METHOD(HttpMessage, getHeaders); ++PHP_METHOD(HttpMessage, setHeaders); ++PHP_METHOD(HttpMessage, addHeaders); ++PHP_METHOD(HttpMessage, getType); ++PHP_METHOD(HttpMessage, setType); ++PHP_METHOD(HttpMessage, getInfo); ++PHP_METHOD(HttpMessage, setInfo); ++PHP_METHOD(HttpMessage, getResponseCode); ++PHP_METHOD(HttpMessage, setResponseCode); ++PHP_METHOD(HttpMessage, getResponseStatus); ++PHP_METHOD(HttpMessage, setResponseStatus); ++PHP_METHOD(HttpMessage, getRequestMethod); ++PHP_METHOD(HttpMessage, setRequestMethod); ++PHP_METHOD(HttpMessage, getRequestUrl); ++PHP_METHOD(HttpMessage, setRequestUrl); ++PHP_METHOD(HttpMessage, getHttpVersion); ++PHP_METHOD(HttpMessage, setHttpVersion); ++PHP_METHOD(HttpMessage, guessContentType); ++PHP_METHOD(HttpMessage, getParentMessage); ++PHP_METHOD(HttpMessage, send); ++PHP_METHOD(HttpMessage, toString); ++PHP_METHOD(HttpMessage, toMessageTypeObject); ++ ++PHP_METHOD(HttpMessage, count); ++PHP_METHOD(HttpMessage, serialize); ++PHP_METHOD(HttpMessage, unserialize); ++PHP_METHOD(HttpMessage, rewind); ++PHP_METHOD(HttpMessage, valid); ++PHP_METHOD(HttpMessage, current); ++PHP_METHOD(HttpMessage, key); ++PHP_METHOD(HttpMessage, next); ++ ++PHP_METHOD(HttpMessage, factory); ++PHP_METHOD(HttpMessage, fromEnv); ++ ++PHP_METHOD(HttpMessage, detach); ++PHP_METHOD(HttpMessage, prepend); ++PHP_METHOD(HttpMessage, reverse); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_persistent_handle_api.h +@@ -0,0 +1,58 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_persistent_handle_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef HTTP_PERSISTENT_HANDLE_H ++#define HTTP_PERSISTENT_HANDLE_H ++ ++typedef void *(*http_persistent_handle_ctor)(void); ++typedef void (*http_persistent_handle_dtor)(void *handle); ++typedef void *(*http_persistent_handle_copy)(void *handle); ++ ++PHP_MINIT_FUNCTION(http_persistent_handle); ++PHP_MSHUTDOWN_FUNCTION(http_persistent_handle); ++ ++#define http_persistent_handle_provide(n, c, d, cc) _http_persistent_handle_provide_ex((n), strlen(n), (c), (d), (cc)) ++#define http_persistent_handle_provide_ex(n, l, c, d, cc) _http_persistent_handle_provide_ex((n), (l), (c), (d), (cc)) ++PHP_HTTP_API STATUS _http_persistent_handle_provide_ex(const char *name_str, size_t name_len, http_persistent_handle_ctor ctor, http_persistent_handle_dtor dtor, http_persistent_handle_copy copy); ++ ++#define http_persistent_handle_cleanup(n, c) _http_persistent_handle_cleanup_ex((n), strlen(n), (c) TSRMLS_CC) ++#define http_persistent_handle_cleanup_ex(n, l,c ) _http_persistent_handle_cleanup_ex((n), (l), (c) TSRMLS_CC) ++PHP_HTTP_API void _http_persistent_handle_cleanup_ex(const char *name_str, size_t name_len, int current_ident_only TSRMLS_DC); ++ ++#define http_persistent_handle_statall() _http_persistent_handle_statall_ex(NULL TSRMLS_CC) ++#define http_persistent_handle_statall_ex(ht) _http_persistent_handle_statall_ex((ht) TSRMLS_CC) ++PHP_HTTP_API HashTable *_http_persistent_handle_statall_ex(HashTable *ht TSRMLS_DC); ++ ++#define http_persistent_handle_acquire(n, h) _http_persistent_handle_acquire_ex((n), strlen(n), (h) TSRMLS_CC) ++#define http_persistent_handle_acquire_ex(n, l, h) _http_persistent_handle_acquire_ex((n), (l), (h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_acquire_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC); ++ ++#define http_persistent_handle_release(n, h) _http_persistent_handle_release_ex((n), strlen(n), (h) TSRMLS_CC) ++#define http_persistent_handle_release_ex(n, l, h) _http_persistent_handle_release_ex((n), (l), (h) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, size_t name_len, void **handle TSRMLS_DC); ++ ++#define http_persistent_handle_accrete(n, oh, nh) _http_persistent_handle_accrete_ex((n), strlen(n), (oh), (nh) TSRMLS_CC) ++#define http_persistent_handle_accrete_ex(n, l, oh, nh) _http_persistent_handle_accrete_ex((n), (l), (oh), (nh) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_persistent_handle_accrete_ex(const char *name_str, size_t name_len, void *old_handle, void **new_handle TSRMLS_DC); ++ ++#endif /* HTTP_PERSISTENT_HANDLE_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_querystring_api.h +@@ -0,0 +1,38 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_querystring_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_QUERYSTRING_API_H ++#define PHP_HTTP_QUERYSTRING_API_H ++ ++#ifdef HTTP_HAVE_ICONV ++#define http_querystring_xlate(a, p, ie, oe) _http_querystring_xlate((a), (p), (ie), (oe) TSRMLS_CC) ++PHP_HTTP_API int _http_querystring_xlate(zval *array, zval *param, const char *ie, const char *oe TSRMLS_DC); ++#endif ++ ++#define http_querystring_update(qa, qs) _http_querystring_update((qa), (qs) TSRMLS_CC) ++PHP_HTTP_API void _http_querystring_update(zval *qarray, zval *qstring TSRMLS_DC); ++ ++#define http_querystring_modify(q, p) _http_querystring_modify((q), (p) TSRMLS_CC) ++PHP_HTTP_API int _http_querystring_modify(zval *qarray, zval *params TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_querystring_object.h +@@ -0,0 +1,78 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_querystring_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_QUERYSTRING_OBJECT_H ++#define PHP_HTTP_QUERYSTRING_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_querystring_object_t { ++ zend_object zo; ++} http_querystring_object; ++ ++#define HTTP_QUERYSTRING_TYPE_BOOL IS_BOOL ++#define HTTP_QUERYSTRING_TYPE_INT IS_LONG ++#define HTTP_QUERYSTRING_TYPE_FLOAT IS_DOUBLE ++#define HTTP_QUERYSTRING_TYPE_STRING IS_STRING ++#define HTTP_QUERYSTRING_TYPE_ARRAY IS_ARRAY ++#define HTTP_QUERYSTRING_TYPE_OBJECT IS_OBJECT ++ ++extern zend_class_entry *http_querystring_object_ce; ++extern zend_function_entry http_querystring_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_querystring_object); ++ ++#define http_querystring_object_new(ce) _http_querystring_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_querystring_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_querystring_object_new_ex(ce, n, ptr) _http_querystring_object_new_ex((ce), (n), (ptr) TSRMLS_CC) ++extern zend_object_value _http_querystring_object_new_ex(zend_class_entry *ce, void *nothing, http_querystring_object **ptr TSRMLS_DC); ++#define http_querystring_object_free(o) _http_querystring_object_free((o) TSRMLS_CC) ++extern void _http_querystring_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpQueryString, __construct); ++PHP_METHOD(HttpQueryString, toString); ++PHP_METHOD(HttpQueryString, toArray); ++PHP_METHOD(HttpQueryString, get); ++PHP_METHOD(HttpQueryString, set); ++PHP_METHOD(HttpQueryString, mod); ++PHP_METHOD(HttpQueryString, getBool); ++PHP_METHOD(HttpQueryString, getInt); ++PHP_METHOD(HttpQueryString, getFloat); ++PHP_METHOD(HttpQueryString, getString); ++PHP_METHOD(HttpQueryString, getArray); ++PHP_METHOD(HttpQueryString, getObject); ++#ifdef HTTP_HAVE_ICONV ++PHP_METHOD(HttpQueryString, xlate); ++#endif ++PHP_METHOD(HttpQueryString, factory); ++#ifndef WONKY ++PHP_METHOD(HttpQueryString, singleton); ++#endif ++PHP_METHOD(HttpQueryString, serialize); ++PHP_METHOD(HttpQueryString, unserialize); ++PHP_METHOD(HttpQueryString, offsetGet); ++PHP_METHOD(HttpQueryString, offsetSet); ++PHP_METHOD(HttpQueryString, offsetExists); ++PHP_METHOD(HttpQueryString, offsetUnset); ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_api.h +@@ -0,0 +1,144 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_API_H ++#define PHP_HTTP_REQUEST_API_H ++ ++#ifdef HTTP_HAVE_CURL ++ ++#include "php_http_request_body_api.h" ++#include "php_http_request_method_api.h" ++ ++extern PHP_MINIT_FUNCTION(http_request); ++extern PHP_MSHUTDOWN_FUNCTION(http_request); ++ ++typedef struct _http_request_t { ++ CURL *ch; ++ char *url; ++ http_request_method meth; ++ http_request_body *body; ++ ++ struct { ++ curl_infotype last_type; ++ phpstr request; ++ phpstr response; ++ } conv; ++ ++ struct { ++ phpstr cookies; ++ HashTable options; ++ struct curl_slist *headers; ++ } _cache; ++ ++ struct { ++ uint count; ++ double delay; ++ } _retry; ++ ++ char _error[CURL_ERROR_SIZE+1]; ++ zval *_progress_callback; ++ ++#ifdef ZTS ++ void ***tsrm_ls; ++#endif ++ ++ uint _in_progress_cb:1; ++ ++} http_request; ++ ++#ifndef pestrndup ++# define pestrndup(s,l,p) _pestrndup((s),(l),(p)) ++static inline void *_pestrndup(const void *s, size_t l, int p) ++{ ++ void *d = pemalloc(l+1, p); ++ memcpy(d, s, l); ++ ((char *) d)[l] = '\0'; ++ return d; ++} ++#endif ++ ++/* CURLOPT_PRIVATE storage living as long as a CURL handle */ ++typedef struct _http_request_storage_t { ++ char *url; ++ char *cookiestore; ++ char errorbuffer[CURL_ERROR_SIZE]; ++} http_request_storage; ++ ++static inline http_request_storage *http_request_storage_get(CURL *ch) ++{ ++ http_request_storage *st = NULL; ++ curl_easy_getinfo(ch, CURLINFO_PRIVATE, &st); ++ return st; ++} ++ ++#define http_curl_init(r) http_curl_init_ex(NULL, (r)) ++#define http_curl_init_ex(c, r) _http_curl_init_ex((c), (r) TSRMLS_CC) ++PHP_HTTP_API CURL *_http_curl_init_ex(CURL *ch, http_request *request TSRMLS_DC); ++ ++#define http_curl_free(c) _http_curl_free((c) TSRMLS_CC) ++PHP_HTTP_API void _http_curl_free(CURL **ch TSRMLS_DC); ++ ++#define http_curl_copy(c) _http_curl_copy((c) TSRMLS_CC) ++PHP_HTTP_API CURL *_http_curl_copy(CURL *ch TSRMLS_DC); ++ ++#define http_request_new() _http_request_init_ex(NULL, NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_dtor(r) _http_request_dtor((r)) ++PHP_HTTP_API void _http_request_dtor(http_request *request); ++ ++#define http_request_free(r) _http_request_free((r)) ++PHP_HTTP_API void _http_request_free(http_request **request); ++ ++#define http_request_reset(r) _http_request_reset(r) ++PHP_HTTP_API void _http_request_reset(http_request *r); ++ ++#define http_request_enable_cookies(r) _http_request_enable_cookies(r) ++PHP_HTTP_API STATUS _http_request_enable_cookies(http_request *request); ++ ++#define http_request_reset_cookies(r, s) _http_request_reset_cookies((r), (s)) ++PHP_HTTP_API STATUS _http_request_reset_cookies(http_request *request, int session_only); ++ ++#define http_request_flush_cookies(r) _http_request_flush_cookies(r) ++PHP_HTTP_API STATUS _http_request_flush_cookies(http_request *request); ++ ++#define http_request_defaults(r) _http_request_defaults(r) ++PHP_HTTP_API void _http_request_defaults(http_request *request); ++ ++#define http_request_prepare(r, o) _http_request_prepare((r), (o)) ++PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options); ++ ++#define http_request_exec(r) _http_request_exec((r)) ++PHP_HTTP_API void _http_request_exec(http_request *request); ++ ++#define http_request_info(r, i) _http_request_info((r), (i)) ++PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info); ++ ++#define http_request_set_progress_callback(r, cb) _http_request_set_progress_callback((r), (cb)) ++PHP_HTTP_API void _http_request_set_progress_callback(http_request *request, zval *cb); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_body_api.h +@@ -0,0 +1,62 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_body_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_BODY_API_H ++#define PHP_HTTP_REQUEST_BODY_API_H ++ ++#ifdef HTTP_HAVE_CURL ++ ++#define HTTP_REQUEST_BODY_EMPTY 0 ++#define HTTP_REQUEST_BODY_CSTRING 1 ++#define HTTP_REQUEST_BODY_CURLPOST 2 ++#define HTTP_REQUEST_BODY_UPLOADFILE 3 ++typedef struct _http_request_body_t { ++ void *data; ++ size_t size; ++ uint type:3; ++ uint free:1; ++ uint priv:28; ++} http_request_body; ++ ++ ++#define http_request_body_new() http_request_body_init(NULL) ++#define http_request_body_init(b) http_request_body_init_ex((b), 0, NULL, 0, 0) ++#define http_request_body_init_ex(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++#define http_request_body_init_rel(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) ++PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void *data, size_t len, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_body_fill(b, fields, files) _http_request_body_fill((b), (fields), (files) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) ++PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, HashTable *fields, HashTable *files ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); ++ ++#define http_request_body_encode(b, s, l) _http_request_body_encode((b), (s), (l) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_body_encode(http_request_body *body, char **buf, size_t *len TSRMLS_DC); ++ ++#define http_request_body_dtor(b) _http_request_body_dtor((b) TSRMLS_CC) ++PHP_HTTP_API void _http_request_body_dtor(http_request_body *body TSRMLS_DC); ++ ++#define http_request_body_free(b) _http_request_body_free((b) TSRMLS_CC) ++PHP_HTTP_API void _http_request_body_free(http_request_body **body TSRMLS_DC); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_datashare_api.h +@@ -0,0 +1,88 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_datashare_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_DATASHARE_API_H ++#define PHP_HTTP_REQUEST_DATASHARE_API_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++#ifdef ZTS ++typedef struct _http_request_datashare_lock_t { ++ CURL *ch; ++ MUTEX_T mx; ++} http_request_datashare_lock; ++ ++typedef union _http_request_datashare_handle_t { ++ zend_llist *list; ++ http_request_datashare_lock *locks; ++} http_request_datashare_handle; ++#else ++typedef struct _http_request_datashare_handle_t { ++ zend_llist *list; ++} http_request_datashare_handle; ++#endif ++ ++typedef struct _http_request_datashare_t { ++ CURLSH *ch; ++ zend_bool persistent; ++ http_request_datashare_handle handle; ++} http_request_datashare; ++ ++#define HTTP_RSHARE_HANDLES(s) ((s)->persistent ? &HTTP_G->request.datashare.handles : (s)->handle.list) ++ ++#define http_request_datashare_global_get _http_request_datashare_global_get ++extern http_request_datashare *_http_request_datashare_global_get(void); ++ ++extern PHP_MINIT_FUNCTION(http_request_datashare); ++extern PHP_MSHUTDOWN_FUNCTION(http_request_datashare); ++extern PHP_RINIT_FUNCTION(http_request_datashare); ++extern PHP_RSHUTDOWN_FUNCTION(http_request_datashare); ++ ++#define http_request_datashare_new() _http_request_datashare_init_ex(NULL, 0 TSRMLS_CC) ++#define http_request_datashare_init(s) _http_request_datashare_init_ex((s), 0 TSRMLS_CC) ++#define http_request_datashare_init_ex(s, p) _http_request_datashare_init_ex((s), (p) TSRMLS_CC) ++PHP_HTTP_API http_request_datashare *_http_request_datashare_init_ex(http_request_datashare *share, zend_bool persistent TSRMLS_DC); ++ ++#define http_request_datashare_attach(s, r) _http_request_datashare_attach((s), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_attach(http_request_datashare *share, zval *request TSRMLS_DC); ++ ++#define http_request_datashare_detach(s, r) _http_request_datashare_detach((s), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_detach(http_request_datashare *share, zval *request TSRMLS_DC); ++ ++#define http_request_datashare_detach_all(s) _http_request_datashare_detach_all((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_detach_all(http_request_datashare *share TSRMLS_DC); ++ ++#define http_request_datashare_dtor(s) _http_request_datashare_dtor((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_dtor(http_request_datashare *share TSRMLS_DC); ++ ++#define http_request_datashare_free(s) _http_request_datashare_free((s) TSRMLS_CC) ++PHP_HTTP_API void _http_request_datashare_free(http_request_datashare **share TSRMLS_DC); ++ ++#define http_request_datashare_set(s, o, l, e) _http_request_datashare_set((s), (o), (l), (e) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_datashare_set(http_request_datashare *share, const char *option, size_t option_len, zend_bool enable TSRMLS_DC); ++ ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_int.h +@@ -0,0 +1,72 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_int.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#if defined(ZTS) && defined(HTTP_HAVE_SSL) ++# ifdef PHP_WIN32 ++# define HTTP_NEED_OPENSSL_TSL ++# include ++# else /* !PHP_WIN32 */ ++# if defined(HTTP_HAVE_OPENSSL) ++# define HTTP_NEED_OPENSSL_TSL ++# include ++# elif defined(HTTP_HAVE_GNUTLS) ++# define HTTP_NEED_GNUTLS_TSL ++# include ++# else ++# warning \ ++ "libcurl was compiled with SSL support, but configure could not determine which" \ ++ "library was used; thus no SSL crypto locking callbacks will be set, which may " \ ++ "cause random crashes on SSL requests" ++# endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */ ++# endif /* PHP_WIN32 */ ++#endif /* ZTS && HTTP_HAVE_SSL */ ++ ++#define HTTP_CURL_OPT(OPTION, p) curl_easy_setopt((request->ch), OPTION, (p)) ++ ++#define HTTP_CURL_OPT_STRING(OPTION, ldiff, obdc) \ ++ { \ ++ char *K = #OPTION; \ ++ HTTP_CURL_OPT_STRING_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION, obdc); \ ++ } ++#define HTTP_CURL_OPT_STRING_EX(keyname, optname, obdc) \ ++ if (!strcasecmp(key.str, keyname)) { \ ++ zval *copy = http_request_option_cache_ex(request, keyname, strlen(keyname)+1, 0, http_zsep(IS_STRING, *param)); \ ++ if (obdc) { \ ++ HTTP_CHECK_OPEN_BASEDIR(Z_STRVAL_P(copy), return FAILURE); \ ++ } \ ++ HTTP_CURL_OPT(optname, Z_STRVAL_P(copy)); \ ++ zval_ptr_dtor(©); \ ++ continue; \ ++ } ++#define HTTP_CURL_OPT_LONG(OPTION, ldiff) \ ++ { \ ++ char *K = #OPTION; \ ++ HTTP_CURL_OPT_LONG_EX(K+lenof("CURLOPT_KEY")+ldiff, OPTION); \ ++ } ++#define HTTP_CURL_OPT_LONG_EX(keyname, optname) \ ++ if (!strcasecmp(key.str, keyname)) { \ ++ zval *copy = http_zsep(IS_LONG, *param); \ ++ HTTP_CURL_OPT(optname, Z_LVAL_P(copy)); \ ++ zval_ptr_dtor(©); \ ++ continue; \ ++ } ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/php_http_request_method_api.h +@@ -0,0 +1,85 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_method_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_METHOD_API_H ++#define PHP_HTTP_REQUEST_METHOD_API_H ++ ++typedef enum _http_request_method_t { ++ /* force the enum to be signed */ ++ HTTP_NEG_REQUEST_METHOD =-1, ++ HTTP_NO_REQUEST_METHOD = 0, ++ /* HTTP/1.1 */ ++ HTTP_GET = 1, ++ HTTP_HEAD = 2, ++ HTTP_POST = 3, ++ HTTP_PUT = 4, ++ HTTP_DELETE = 5, ++ HTTP_OPTIONS = 6, ++ HTTP_TRACE = 7, ++ HTTP_CONNECT = 8, ++ /* WebDAV - RFC 2518 */ ++ HTTP_PROPFIND = 9, ++ HTTP_PROPPATCH = 10, ++ HTTP_MKCOL = 11, ++ HTTP_COPY = 12, ++ HTTP_MOVE = 13, ++ HTTP_LOCK = 14, ++ HTTP_UNLOCK = 15, ++ /* WebDAV Versioning - RFC 3253 */ ++ HTTP_VERSION_CONTROL = 16, ++ HTTP_REPORT = 17, ++ HTTP_CHECKOUT = 18, ++ HTTP_CHECKIN = 19, ++ HTTP_UNCHECKOUT = 20, ++ HTTP_MKWORKSPACE = 21, ++ HTTP_UPDATE = 22, ++ HTTP_LABEL = 23, ++ HTTP_MERGE = 24, ++ HTTP_BASELINE_CONTROL = 25, ++ HTTP_MKACTIVITY = 26, ++ /* WebDAV Access Control - RFC 3744 */ ++ HTTP_ACL = 27, ++ HTTP_MAX_REQUEST_METHOD = 28 ++} http_request_method; ++ ++#define HTTP_MIN_REQUEST_METHOD (HTTP_NO_REQUEST_METHOD + 1) ++#define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD)) ++ ++extern PHP_MINIT_FUNCTION(http_request_method); ++extern PHP_RINIT_FUNCTION(http_request_method); ++extern PHP_RSHUTDOWN_FUNCTION(http_request_method); ++ ++#define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC) ++PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC); ++ ++#define http_request_method_exists(u, l, c) _http_request_method_exists((u), (l), (c) TSRMLS_CC) ++PHP_HTTP_API int _http_request_method_exists(int by_name, http_request_method id, const char *name TSRMLS_DC); ++ ++#define http_request_method_register(m, l) _http_request_method_register((m), (l) TSRMLS_CC) ++PHP_HTTP_API int _http_request_method_register(const char *method, int method_name_len TSRMLS_DC); ++ ++#define http_request_method_unregister(mn) _http_request_method_unregister((mn) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_object.h +@@ -0,0 +1,118 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_OBJECT_H ++#define PHP_HTTP_REQUEST_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++#include "php_http_request_api.h" ++#include "php_http_request_pool_api.h" ++#include "php_http_request_datashare_api.h" ++ ++typedef struct _http_request_object_t { ++ zend_object zo; ++ http_request *request; ++ http_request_pool *pool; ++ http_request_datashare *share; ++} http_request_object; ++ ++extern zend_class_entry *http_request_object_ce; ++extern zend_function_entry http_request_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_request_object); ++ ++#define http_request_object_new(ce) _http_request_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_request_object_new_ex(ce, ch, ptr) _http_request_object_new_ex((ce), (ch), (ptr) TSRMLS_CC) ++extern zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC); ++#define http_request_object_clone(zv) _http_request_object_clone_obj((zv) TSRMLS_CC) ++extern zend_object_value _http_request_object_clone_obj(zval *zobject TSRMLS_DC); ++#define http_request_object_free(o) _http_request_object_free((o) TSRMLS_CC) ++extern void _http_request_object_free(zend_object *object TSRMLS_DC); ++ ++#define http_request_object_requesthandler(req, this) _http_request_object_requesthandler((req), (this) TSRMLS_CC) ++extern STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC); ++#define http_request_object_responsehandler(req, this) _http_request_object_responsehandler((req), (this) TSRMLS_CC) ++extern STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr TSRMLS_DC); ++ ++PHP_METHOD(HttpRequest, __construct); ++PHP_METHOD(HttpRequest, setOptions); ++PHP_METHOD(HttpRequest, getOptions); ++PHP_METHOD(HttpRequest, addSslOptions); ++PHP_METHOD(HttpRequest, setSslOptions); ++PHP_METHOD(HttpRequest, getSslOptions); ++PHP_METHOD(HttpRequest, addHeaders); ++PHP_METHOD(HttpRequest, getHeaders); ++PHP_METHOD(HttpRequest, setHeaders); ++PHP_METHOD(HttpRequest, addCookies); ++PHP_METHOD(HttpRequest, getCookies); ++PHP_METHOD(HttpRequest, setCookies); ++PHP_METHOD(HttpRequest, enableCookies); ++PHP_METHOD(HttpRequest, resetCookies); ++PHP_METHOD(HttpRequest, flushCookies); ++PHP_METHOD(HttpRequest, setMethod); ++PHP_METHOD(HttpRequest, getMethod); ++PHP_METHOD(HttpRequest, setUrl); ++PHP_METHOD(HttpRequest, getUrl); ++PHP_METHOD(HttpRequest, setContentType); ++PHP_METHOD(HttpRequest, getContentType); ++PHP_METHOD(HttpRequest, setQueryData); ++PHP_METHOD(HttpRequest, getQueryData); ++PHP_METHOD(HttpRequest, addQueryData); ++PHP_METHOD(HttpRequest, setPostFields); ++PHP_METHOD(HttpRequest, getPostFields); ++PHP_METHOD(HttpRequest, addPostFields); ++PHP_METHOD(HttpRequest, getBody); ++PHP_METHOD(HttpRequest, setBody); ++PHP_METHOD(HttpRequest, addBody); ++PHP_METHOD(HttpRequest, addPostFile); ++PHP_METHOD(HttpRequest, setPostFiles); ++PHP_METHOD(HttpRequest, getPostFiles); ++PHP_METHOD(HttpRequest, setPutFile); ++PHP_METHOD(HttpRequest, getPutFile); ++PHP_METHOD(HttpRequest, getPutData); ++PHP_METHOD(HttpRequest, setPutData); ++PHP_METHOD(HttpRequest, addPutData); ++PHP_METHOD(HttpRequest, send); ++PHP_METHOD(HttpRequest, getResponseData); ++PHP_METHOD(HttpRequest, getResponseHeader); ++PHP_METHOD(HttpRequest, getResponseCookies); ++PHP_METHOD(HttpRequest, getResponseCode); ++PHP_METHOD(HttpRequest, getResponseStatus); ++PHP_METHOD(HttpRequest, getResponseBody); ++PHP_METHOD(HttpRequest, getResponseInfo); ++PHP_METHOD(HttpRequest, getResponseMessage); ++PHP_METHOD(HttpRequest, getRawResponseMessage); ++PHP_METHOD(HttpRequest, getRequestMessage); ++PHP_METHOD(HttpRequest, getRawRequestMessage); ++PHP_METHOD(HttpRequest, getHistory); ++PHP_METHOD(HttpRequest, clearHistory); ++PHP_METHOD(HttpRequest, getMessageClass); ++PHP_METHOD(HttpRequest, setMessageClass); ++PHP_METHOD(HttpRequest, factory); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_request_pool_api.h +@@ -0,0 +1,97 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_request_pool_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_POOL_API_H ++#define PHP_HTTP_REQUEST_POOL_API_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_request_pool_t { ++ CURLM *ch; ++ zend_llist finished; ++ zend_llist handles; ++ int unfinished; ++#ifdef ZTS ++ void ***tsrm_ls; ++#endif ++#ifdef HTTP_HAVE_EVENT ++ struct event *timeout; ++ unsigned useevents:1; ++ unsigned runsocket:1; ++#endif ++} http_request_pool; ++ ++typedef int (*http_request_pool_apply_func)(http_request_pool *pool, zval *request); ++typedef int (*http_request_pool_apply_with_arg_func)(http_request_pool *pool, zval *request, void *arg); ++ ++PHP_MINIT_FUNCTION(http_request_pool); ++#ifdef HTTP_HAVE_EVENT ++PHP_RINIT_FUNCTION(http_request_pool); ++#endif ++ ++#define http_request_pool_timeout _http_request_pool_timeout ++extern struct timeval *_http_request_pool_timeout(http_request_pool *pool, struct timeval *timeout); ++ ++#define http_request_pool_responsehandler _http_request_pool_responsehandler ++extern void _http_request_pool_responsehandler(http_request_pool *pool); ++ ++#define http_request_pool_apply_responsehandler _http_request_pool_responsehandler ++extern int _http_request_pool_apply_responsehandler(http_request_pool *pool, zval *req, void *ch); ++ ++#define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC) ++PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC); ++ ++#define http_request_pool_attach(p, r) _http_request_pool_attach((p), (r)) ++PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request); ++ ++#define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r)) ++PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request); ++ ++#define http_request_pool_apply(p, f) _http_request_pool_apply((p), (f)) ++PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb); ++ ++#define http_request_pool_apply_with_arg(p, f, a) _http_request_pool_apply_with_arg((p), (f), (a)) ++PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg); ++ ++#define http_request_pool_detach_all(p) _http_request_pool_detach_all((p)) ++PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool); ++ ++#define http_request_pool_send(p) _http_request_pool_send((p)) ++PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool); ++ ++#define http_request_pool_select _http_request_pool_select ++PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool); ++ ++#define http_request_pool_select_ex _http_request_pool_select_ex ++PHP_HTTP_API STATUS _http_request_pool_select_ex(http_request_pool *pool, struct timeval *custom_timeout); ++ ++#define http_request_pool_perform(p) _http_request_pool_perform((p)) ++PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool); ++ ++#define http_request_pool_dtor(p) _http_request_pool_dtor((p)) ++PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_requestdatashare_object.h +@@ -0,0 +1,59 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_requestdatashare_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUEST_DATASHARE_OBJECT_H ++#define PHP_HTTP_REQUEST_DATASHARE_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_requestdatashare_object_t { ++ zend_object zo; ++ http_request_datashare *share; ++} http_requestdatashare_object; ++ ++extern zend_class_entry *http_requestdatashare_object_ce; ++extern zend_function_entry http_requestdatashare_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_requestdatashare_object); ++ ++#define http_requestdatashare_object_new(ce) _http_requestdatashare_object_new((ce) TSRMLS_CC) ++extern zend_object_value _http_requestdatashare_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_requestdatashare_object_new_ex(ce, s, ptr) _http_requestdatashare_object_new_ex((ce), (s), (ptr) TSRMLS_CC) ++extern zend_object_value _http_requestdatashare_object_new_ex(zend_class_entry *ce, http_request_datashare *share, http_requestdatashare_object **ptr TSRMLS_DC); ++#define http_requestdatashare_object_free(o) _http_requestdatashare_object_free((o) TSRMLS_CC) ++extern void _http_requestdatashare_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpRequestDataShare, __destruct); ++PHP_METHOD(HttpRequestDataShare, count); ++PHP_METHOD(HttpRequestDataShare, attach); ++PHP_METHOD(HttpRequestDataShare, detach); ++PHP_METHOD(HttpRequestDataShare, reset); ++PHP_METHOD(HttpRequestDataShare, factory); ++#ifndef WONKY ++PHP_METHOD(HttpRequestDataShare, singleton); ++#endif ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_requestpool_object.h +@@ -0,0 +1,69 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_requestpool_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_REQUESTPOOL_OBJECT_H ++#define PHP_HTTP_REQUESTPOOL_OBJECT_H ++#ifdef HTTP_HAVE_CURL ++#ifdef ZEND_ENGINE_2 ++ ++typedef struct _http_requestpool_object_t { ++ zend_object zo; ++ http_request_pool pool; ++ struct { ++ long pos; ++ } iterator; ++} http_requestpool_object; ++ ++extern zend_class_entry *http_requestpool_object_ce; ++extern zend_function_entry http_requestpool_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_requestpool_object); ++ ++#define http_requestpool_object_new(ce) _http_requestpool_object_new(ce TSRMLS_CC) ++extern zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC); ++#define http_requestpool_object_free(o) _http_requestpool_object_free(o TSRMLS_CC) ++extern void _http_requestpool_object_free(zend_object *object TSRMLS_DC); ++ ++PHP_METHOD(HttpRequestPool, __construct); ++PHP_METHOD(HttpRequestPool, __destruct); ++PHP_METHOD(HttpRequestPool, attach); ++PHP_METHOD(HttpRequestPool, detach); ++PHP_METHOD(HttpRequestPool, send); ++PHP_METHOD(HttpRequestPool, reset); ++PHP_METHOD(HttpRequestPool, socketPerform); ++PHP_METHOD(HttpRequestPool, socketSelect); ++PHP_METHOD(HttpRequestPool, valid); ++PHP_METHOD(HttpRequestPool, current); ++PHP_METHOD(HttpRequestPool, key); ++PHP_METHOD(HttpRequestPool, next); ++PHP_METHOD(HttpRequestPool, rewind); ++PHP_METHOD(HttpRequestPool, count); ++PHP_METHOD(HttpRequestPool, getAttachedRequests); ++PHP_METHOD(HttpRequestPool, getFinishedRequests); ++PHP_METHOD(HttpRequestPool, enablePipelining); ++PHP_METHOD(HttpRequestPool, enableEvents); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_response_object.h +@@ -0,0 +1,67 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_response_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_RESPONSE_OBJECT_H ++#define PHP_HTTP_RESPONSE_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++#ifndef WONKY ++ ++extern zend_class_entry *http_response_object_ce; ++extern zend_function_entry http_response_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_response_object); ++ ++PHP_METHOD(HttpResponse, setHeader); ++PHP_METHOD(HttpResponse, getHeader); ++PHP_METHOD(HttpResponse, setETag); ++PHP_METHOD(HttpResponse, getETag); ++PHP_METHOD(HttpResponse, setLastModified); ++PHP_METHOD(HttpResponse, getLastModified); ++PHP_METHOD(HttpResponse, setContentDisposition); ++PHP_METHOD(HttpResponse, getContentDisposition); ++PHP_METHOD(HttpResponse, setContentType); ++PHP_METHOD(HttpResponse, getContentType); ++PHP_METHOD(HttpResponse, guessContentType); ++PHP_METHOD(HttpResponse, setCache); ++PHP_METHOD(HttpResponse, getCache); ++PHP_METHOD(HttpResponse, setCacheControl); ++PHP_METHOD(HttpResponse, getCacheControl); ++PHP_METHOD(HttpResponse, setGzip); ++PHP_METHOD(HttpResponse, getGzip); ++PHP_METHOD(HttpResponse, setThrottleDelay); ++PHP_METHOD(HttpResponse, getThrottleDelay); ++PHP_METHOD(HttpResponse, setBufferSize); ++PHP_METHOD(HttpResponse, getBufferSize); ++PHP_METHOD(HttpResponse, setData); ++PHP_METHOD(HttpResponse, getData); ++PHP_METHOD(HttpResponse, setFile); ++PHP_METHOD(HttpResponse, getFile); ++PHP_METHOD(HttpResponse, setStream); ++PHP_METHOD(HttpResponse, getStream); ++PHP_METHOD(HttpResponse, send); ++PHP_METHOD(HttpResponse, capture); ++ ++#endif ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_send_api.h +@@ -0,0 +1,91 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_send_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_SEND_API_H ++#define PHP_HTTP_SEND_API_H ++ ++typedef enum _http_send_mode_t { ++ SEND_DATA, ++ SEND_RSRC ++} http_send_mode; ++ ++#define HTTP_REDIRECT 0L ++#define HTTP_REDIRECT_PERM 301L ++#define HTTP_REDIRECT_FOUND 302L ++#define HTTP_REDIRECT_POST 303L ++#define HTTP_REDIRECT_PROXY 305L ++#define HTTP_REDIRECT_TEMP 307L ++ ++extern PHP_MINIT_FUNCTION(http_send); ++ ++#define http_send_status(s) sapi_header_op(SAPI_HEADER_SET_STATUS, (void *) (long) (s) TSRMLS_CC) ++#define http_send_header(n, v, r) _http_send_header_ex((n), strlen(n), (v), strlen(v), (r), NULL TSRMLS_CC) ++#define http_send_header_ex(n, nl, v, vl, r, s) _http_send_header_ex((n), (nl), (v), (vl), (r), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_header_ex(const char *name, size_t name_len, const char *value, size_t value_len, zend_bool replace, char **sent_header TSRMLS_DC); ++#define http_send_header_string(h) _http_send_status_header_ex(0, (h), strlen(h), 1 TSRMLS_CC) ++#define http_send_header_string_ex(h, l, r) _http_send_status_header_ex(0, (h), (l), (r) TSRMLS_CC) ++#define http_send_status_header(s, h) _http_send_status_header_ex((s), (h), (h)?strlen(h):0, 1 TSRMLS_CC) ++#define http_send_status_header_ex(s, h, l, r) _http_send_status_header_ex((s), (h), (l), (r) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_status_header_ex(int status, const char *header, size_t header_len, zend_bool replace TSRMLS_DC); ++ ++#define http_send_header_zval(n, z, r) http_send_header_zval_ex((n), strlen(n), (z), (r)) ++#define http_send_header_zval_ex(n, l, z, r) _http_send_header_zval_ex((n), (l), (z), (r) TSRMLS_CC) ++PHP_HTTP_API void _http_send_header_zval_ex(const char *name, size_t name_len, zval **val, zend_bool replace TSRMLS_DC); ++ ++#define http_hide_header(h) http_hide_header_ex((h), strlen(h)) ++#define http_hide_header_ex(h, l) _http_hide_header_ex((h), (l) TSRMLS_CC) ++PHP_HTTP_API void _http_hide_header_ex(const char *name, size_t name_len TSRMLS_DC); ++ ++#define http_send_last_modified(t) _http_send_last_modified_ex((t), NULL TSRMLS_CC) ++#define http_send_last_modified_ex(t, s) _http_send_last_modified_ex((t), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_last_modified_ex(time_t t, char **sent_header TSRMLS_DC); ++ ++#define http_send_etag(e, l) _http_send_etag_ex((e), (l), NULL TSRMLS_CC) ++#define http_send_etag_ex(e, l, s) _http_send_etag_ex((e), (l), (s) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_etag_ex(const char *etag, size_t etag_len, char **sent_header TSRMLS_DC); ++ ++#define http_send_cache_control(cc, cl) http_send_header_ex("Cache-Control", lenof("Cache-Control"), (cc), (cl), 1, NULL) ++ ++#define http_send_content_type(c, l) _http_send_content_type((c), (l) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_content_type(const char *content_type, size_t ct_len TSRMLS_DC); ++ ++#define http_send_content_disposition(f, l, i) _http_send_content_disposition((f), (l), (i) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t f_len, zend_bool send_inline TSRMLS_DC); ++ ++#define http_send_data(d, l) http_send((d), (l), SEND_DATA) ++#define http_send_data_ex(d, l, nc) http_send_ex((d), (l), SEND_DATA, (nc)) ++#define http_send(d, s, m) _http_send_ex((d), (s), (m), 0 TSRMLS_CC) ++#define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC); ++ ++#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) ++#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) ++#define http_send_stream(s) http_send_stream_ex((s), 0, 0) ++#define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC); ++ ++#define http_guess_content_type(mf, mm, d, l, m) _http_guess_content_type((mf), (mm), (d), (l), (m) TSRMLS_CC) ++PHP_HTTP_API char *_http_guess_content_type(const char *magic_file, long magic_mode, void *data_ptr, size_t data_len, http_send_mode mode TSRMLS_DC); ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_std_defs.h +@@ -0,0 +1,406 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_std_defs.h 310777 2011-05-05 06:43:10Z mike $ */ ++ ++#ifndef PHP_HTTP_STD_DEFS_H ++#define PHP_HTTP_STD_DEFS_H ++ ++#if defined(PHP_WIN32) ++# if defined(HTTP_EXPORTS) ++# define PHP_HTTP_API __declspec(dllexport) ++# elif defined(COMPILE_DL_HTTP) ++# define PHP_HTTP_API __declspec(dllimport) ++# else ++# define PHP_HTTP_API ++# endif ++#else ++# define PHP_HTTP_API ++#endif ++ ++/* make functions that return SUCCESS|FAILURE more obvious */ ++typedef int STATUS; ++ ++/* lenof() */ ++#define lenof(S) (sizeof(S) - 1) ++ ++#ifndef MIN ++# define MIN(a,b) (ab?a:b) ++#endif ++ ++/* STR_SET() */ ++#ifndef STR_SET ++# define STR_SET(STR, SET) \ ++ { \ ++ STR_FREE(STR); \ ++ STR = SET; \ ++ } ++#endif ++ ++#define STR_PTR(s) (s?s:"") ++ ++#define INIT_ZARR(zv, ht) \ ++ { \ ++ INIT_PZVAL(&(zv)); \ ++ Z_TYPE(zv) = IS_ARRAY; \ ++ Z_ARRVAL(zv) = (ht); \ ++ } ++ ++/* return bool (v == SUCCESS) */ ++#define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v)) ++#define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v)) ++/* return object(values) */ ++#define RETVAL_OBJECT(o, addref) \ ++ RETVAL_OBJVAL((o)->value.obj, addref) ++#define RETURN_OBJECT(o, addref) \ ++ RETVAL_OBJECT(o, addref); \ ++ return ++#define RETVAL_OBJVAL(ov, addref) \ ++ ZVAL_OBJVAL(return_value, ov, addref) ++#define RETURN_OBJVAL(ov, addref) \ ++ RETVAL_OBJVAL(ov, addref); \ ++ return ++#define ZVAL_OBJVAL(zv, ov, addref) \ ++ (zv)->type = IS_OBJECT; \ ++ (zv)->value.obj = (ov);\ ++ if (addref && Z_OBJ_HT_P(zv)->add_ref) { \ ++ Z_OBJ_HT_P(zv)->add_ref((zv) TSRMLS_CC); \ ++ } ++/* return property */ ++#define RETVAL_PROP(n) RETVAL_PROP_EX(getThis(), n) ++#define RETURN_PROP(n) RETURN_PROP_EX(getThis(), n) ++#define RETVAL_PROP_EX(this, n) \ ++ { \ ++ zval *__prop = zend_read_property(THIS_CE, this, ZEND_STRS(#n)-1, 0 TSRMLS_CC); \ ++ RETVAL_ZVAL(__prop, 1, 0); \ ++ } ++#define RETURN_PROP_EX(this, n) \ ++ { \ ++ zval *__prop = zend_read_property(THIS_CE, this, ZEND_STRS(#n)-1, 0 TSRMLS_CC); \ ++ RETURN_ZVAL(__prop, 1, 0); \ ++ } ++ ++/* function accepts no args */ ++#define NO_ARGS zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ""); ++ ++/* CR LF */ ++#define HTTP_CRLF "\r\n" ++ ++/* default cache control */ ++#define HTTP_DEFAULT_CACHECONTROL "private, must-revalidate, max-age=0" ++ ++/* max URL length */ ++#define HTTP_URL_MAXLEN 4096 ++ ++/* max request method length */ ++#define HTTP_REQUEST_METHOD_MAXLEN 31 ++ ++/* def URL arg separator */ ++#define HTTP_URL_ARGSEP "&" ++ ++/* send buffer size */ ++#define HTTP_SENDBUF_SIZE 40960 ++ ++/* CURL buffer size */ ++#define HTTP_CURLBUF_SIZE 16384 ++ ++/* known methods */ ++#define HTTP_KNOWN_METHODS \ ++ /* HTTP 1.1 */ \ ++ "GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, CONNECT, " \ ++ /* WebDAV - RFC 2518 */ \ ++ "PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, " \ ++ /* WebDAV Versioning - RFC 3253 */ \ ++ "VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, " \ ++ "MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, " \ ++ /* WebDAV Access Control - RFC 3744 */ \ ++ "ACL, " \ ++ /* END */ ++ ++#ifdef ZEND_ENGINE_2 ++# include "ext/standard/file.h" ++# define HTTP_DEFAULT_STREAM_CONTEXT FG(default_context) ++#else ++# define HTTP_DEFAULT_STREAM_CONTEXT NULL ++#endif ++ ++#define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \ ++ STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals) ++#define HTTP_PHP_INI_ENTRY_EX(entry, default, scope, updater, displayer, global) \ ++ STD_PHP_INI_ENTRY_EX(entry, default, scope, updater, global, zend_http_globals, http_globals, displayer) ++ ++ ++#define HTTP_LONG_CONSTANT(name, const) REGISTER_LONG_CONSTANT(name, const, CONST_CS | CONST_PERSISTENT) ++ ++/* {{{ objects & properties */ ++#ifdef ZEND_ENGINE_2 ++ ++# define HTTP_STATIC_ME_ALIAS(me, al, ai) ZEND_FENTRY(me, ZEND_FN(al), ai, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ++ ++# define HTTP_REGISTER_CLASS_EX(classname, name, parent, flags) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, name## _fe); \ ++ ce.create_object = _ ##name## _new; \ ++ name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ name## _ce->ce_flags |= flags; \ ++ memcpy(& name## _handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \ ++ } ++ ++# define HTTP_REGISTER_CLASS(classname, name, parent, flags) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, name## _fe); \ ++ ce.create_object = NULL; \ ++ name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ name## _ce->ce_flags |= flags; \ ++ } ++ ++# define HTTP_REGISTER_EXCEPTION(classname, cename, parent) \ ++ { \ ++ zend_class_entry ce; \ ++ memset(&ce, 0, sizeof(zend_class_entry)); \ ++ INIT_CLASS_ENTRY(ce, #classname, NULL); \ ++ ce.create_object = NULL; \ ++ cename = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ ++ } ++ ++# define getObject(t, o) getObjectEx(t, o, getThis()) ++# define getObjectEx(t, o, v) t * o = ((t *) zend_object_store_get_object(v TSRMLS_CC)) ++# define putObject(t, o) zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) _ ##t## _free, NULL TSRMLS_CC); ++# ifndef WONKY ++# define freeObject(o) \ ++ if (OBJ_GUARDS(o)) { \ ++ zend_hash_destroy(OBJ_GUARDS(o)); \ ++ FREE_HASHTABLE(OBJ_GUARDS(o)); \ ++ } \ ++ if (OBJ_PROP(o)) { \ ++ zend_hash_destroy(OBJ_PROP(o)); \ ++ FREE_HASHTABLE(OBJ_PROP(o)); \ ++ } \ ++ efree(o); ++# else ++# define freeObject(o) \ ++ if (OBJ_PROP(o)) { \ ++ zend_hash_destroy(OBJ_PROP(o)); \ ++ FREE_HASHTABLE(OBJ_PROP(o)); \ ++ } \ ++ efree(o); ++# endif ++# define OBJ_PROP(o) (o)->zo.properties ++# define OBJ_GUARDS(o) (o)->zo.guards ++ ++# define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope)) ++# define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope)))) ++# define ACC_PROP_PUBLIC(flags) (flags & ZEND_ACC_PUBLIC) ++# define ACC_PROP(ce, flags) (ACC_PROP_PUBLIC(flags) || ACC_PROP_PRIVATE(ce, flags) || ACC_PROP_PROTECTED(ce, flags)) ++ ++# define SET_EH_THROW_HTTP() SET_EH_THROW_EX(http_exception_get_default()) ++# define SET_EH_THROW_EX(ex) php_set_error_handling(EH_THROW, ex TSRMLS_CC) ++# define SET_EH_NORMAL() php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) ++ ++#endif /* ZEND_ENGINE_2 */ ++/* }}} */ ++ ++#ifdef ZEND_ENGINE_2 ++# define with_error_handling(eh, ec) \ ++ { \ ++ error_handling_t __eh = GLOBAL_ERROR_HANDLING; \ ++ zend_class_entry *__ec= GLOBAL_EXCEPTION_CLASS; \ ++ php_set_error_handling(eh, ec TSRMLS_CC); ++# define end_error_handling() \ ++ php_set_error_handling(__eh, __ec TSRMLS_CC); \ ++ } ++#else ++# define with_error_handling(eh, ec) ++# define end_error_handling() ++#endif ++ ++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION > 5 ++# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default(TSRMLS_C) ++#else ++# define ZEND_EXCEPTION_GET_DEFAULT() zend_exception_get_default() ++#endif ++ ++#ifndef E_THROW ++# define E_THROW 0 ++#endif ++#ifdef ZEND_ENGINE_2 ++# define HE_THROW E_THROW TSRMLS_CC ++# define HE_NOTICE (HTTP_G->only_exceptions ? E_THROW : E_NOTICE) TSRMLS_CC ++# define HE_WARNING (HTTP_G->only_exceptions ? E_THROW : E_WARNING) TSRMLS_CC ++# define HE_ERROR (HTTP_G->only_exceptions ? E_THROW : E_ERROR) TSRMLS_CC ++#else ++# define HE_THROW E_WARNING TSRMLS_CC ++# define HE_NOTICE E_NOTICE TSRMLS_CC ++# define HE_WARNING E_WARNING TSRMLS_CC ++# define HE_ERROR E_ERROR TSRMLS_CC ++#endif ++ ++#define HTTP_E_RUNTIME 1L ++#define HTTP_E_INVALID_PARAM 2L ++#define HTTP_E_HEADER 3L ++#define HTTP_E_MALFORMED_HEADERS 4L ++#define HTTP_E_REQUEST_METHOD 5L ++#define HTTP_E_MESSAGE_TYPE 6L ++#define HTTP_E_ENCODING 7L ++#define HTTP_E_REQUEST 8L ++#define HTTP_E_REQUEST_POOL 9L ++#define HTTP_E_SOCKET 10L ++#define HTTP_E_RESPONSE 11L ++#define HTTP_E_URL 12L ++#define HTTP_E_QUERYSTRING 13L ++ ++#ifdef ZEND_ENGINE_2 ++# define HTTP_BEGIN_ARGS_EX(class, method, ret_ref, req_args) HTTP_STATIC_ARG_INFO ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 0, ret_ref, req_args) ++# define HTTP_BEGIN_ARGS_AR(class, method, ret_ref, req_args) HTTP_STATIC_ARG_INFO ZEND_BEGIN_ARG_INFO_EX(args_for_ ##class## _ ##method , 1, ret_ref, req_args) ++# define HTTP_END_ARGS } ++# define HTTP_EMPTY_ARGS_EX(class, method, ret_ref) HTTP_BEGIN_ARGS_EX(class, method, ret_ref, 0) HTTP_END_ARGS ++# define HTTP_ARGS(class, method) args_for_ ##class## _ ##method ++# define HTTP_ARG_VAL(name, pass_ref) ZEND_ARG_INFO(pass_ref, name) ++# define HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(0, name, class, allow_null) ++#endif ++ ++#ifdef ZEND_ENGINE_2 ++# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0, 0} ++#else ++# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL} ++#endif ++ ++#ifdef HTTP_HAVE_CURL ++# ifdef ZEND_ENGINE_2 ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_3, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_4, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++ \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_5, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); ++ ++# else ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_5[] = {5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; ++# endif /* ZEND_ENGINE_2 */ ++#else ++# ifdef ZEND_ENGINE_2 ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_2, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++\ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_3, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); \ ++\ ++ HTTP_STATIC_ARG_INFO \ ++ ZEND_BEGIN_ARG_INFO(http_arg_pass_ref_4, 0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(0) \ ++ ZEND_ARG_PASS_INFO(1) \ ++ ZEND_END_ARG_INFO(); ++# else ++# define HTTP_DECLARE_ARG_PASS_INFO() \ ++ static unsigned char http_arg_pass_ref_2[] = {2, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; \ ++ static unsigned char http_arg_pass_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE}; ++# endif /* ZEND_ENGINE_2 */ ++#endif /* HTTP_HAVE_CURL */ ++ ++ ++#ifndef HAVE_CURL_SHARE_STRERROR ++# define curl_share_strerror(dummy) "unknown error" ++#endif ++#ifndef HAVE_CURL_EASY_STRERROR ++# define curl_easy_strerror(dummy) "unknown error" ++#endif ++#ifndef HAVE_CURL_MULTI_STRERROR ++# define curl_multi_strerror(dummy) "unknown error" ++#endif ++ ++#define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU) ++#define PHP_RINIT_CALL(func) PHP_RINIT(func)(INIT_FUNC_ARGS_PASSTHRU) ++#define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) ++#define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) ++ ++#define Z_OBJ_DELREF(z) \ ++ if (Z_OBJ_HT(z)->del_ref) { \ ++ Z_OBJ_HT(z)->del_ref(&(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF(z) \ ++ if (Z_OBJ_HT(z)->add_ref) { \ ++ Z_OBJ_HT(z)->add_ref(&(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_DELREF_P(z) \ ++ if (Z_OBJ_HT_P(z)->del_ref) { \ ++ Z_OBJ_HT_P(z)->del_ref((z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF_P(z) \ ++ if (Z_OBJ_HT_P(z)->add_ref) { \ ++ Z_OBJ_HT_P(z)->add_ref((z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_DELREF_PP(z) \ ++ if (Z_OBJ_HT_PP(z)->del_ref) { \ ++ Z_OBJ_HT_PP(z)->del_ref(*(z) TSRMLS_CC); \ ++ } ++#define Z_OBJ_ADDREF_PP(z) \ ++ if (Z_OBJ_HT_PP(z)->add_ref) { \ ++ Z_OBJ_HT_PP(z)->add_ref(*(z) TSRMLS_CC); \ ++ } ++ ++#endif /* PHP_HTTP_STD_DEFS_H */ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_url_api.h +@@ -0,0 +1,165 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_url_api.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_URL_API_H ++#define PHP_HTTP_URL_API_H ++ ++#include "ext/standard/url.h" ++ ++extern PHP_MINIT_FUNCTION(http_url); ++ ++#define http_absolute_url(u) _http_absolute_url_ex((u), HTTP_URL_REPLACE TSRMLS_CC) ++#define http_absolute_url_ex(u, f) _http_absolute_url_ex((u), (f) TSRMLS_CC) ++PHP_HTTP_API char *_http_absolute_url_ex(const char *url, int flags TSRMLS_DC); ++ ++#define HTTP_URL_REPLACE 0x000 ++#define HTTP_URL_JOIN_PATH 0x001 ++#define HTTP_URL_JOIN_QUERY 0x002 ++#define HTTP_URL_STRIP_USER 0x004 ++#define HTTP_URL_STRIP_PASS 0x008 ++#define HTTP_URL_STRIP_AUTH (HTTP_URL_STRIP_USER|HTTP_URL_STRIP_PASS) ++#define HTTP_URL_STRIP_PORT 0x020 ++#define HTTP_URL_STRIP_PATH 0x040 ++#define HTTP_URL_STRIP_QUERY 0x080 ++#define HTTP_URL_STRIP_FRAGMENT 0x100 ++#define HTTP_URL_STRIP_ALL ( \ ++ HTTP_URL_STRIP_AUTH | \ ++ HTTP_URL_STRIP_PORT | \ ++ HTTP_URL_STRIP_PATH | \ ++ HTTP_URL_STRIP_QUERY | \ ++ HTTP_URL_STRIP_FRAGMENT \ ++) ++#define HTTP_URL_FROM_ENV 0x1000 ++ ++#define http_build_url(f, o, n, p, s, l) _http_build_url((f), (o), (n), (p), (s), (l) TSRMLS_CC) ++PHP_HTTP_API void _http_build_url(int flags, const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC); ++ ++#define http_urlencode_hash(h, q) _http_urlencode_hash_ex((h), 1, NULL, 0, (q), NULL TSRMLS_CC) ++#define http_urlencode_hash_ex(h, o, p, pl, q, ql) _http_urlencode_hash_ex((h), (o), (p), (pl), (q), (ql) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, zend_bool override_argsep, char *pre_encoded_data, size_t pre_encoded_len, char **encoded_data, size_t *encoded_len TSRMLS_DC); ++ ++#define http_urlencode_hash_recursive(ht, s, as, al, pr, pl) _http_urlencode_hash_recursive((ht), (s), (as), (al), (pr), (pl) TSRMLS_CC) ++PHP_HTTP_API STATUS _http_urlencode_hash_recursive(HashTable *ht, phpstr *str, const char *arg_sep, size_t arg_sep_len, const char *prefix, size_t prefix_len TSRMLS_DC); ++ ++#define http_url_from_struct(u, ht) _http_url_from_struct((u), (ht) TSRMLS_CC) ++static inline php_url *_http_url_from_struct(php_url *url, HashTable *ht TSRMLS_DC) ++{ ++ zval **e; ++ ++ if (!url) { ++ url = ecalloc(1, sizeof(php_url)); ++ } ++ ++ if ((SUCCESS == zend_hash_find(ht, "scheme", sizeof("scheme"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->scheme = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "user", sizeof("user"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->user = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "pass", sizeof("pass"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->pass = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "host", sizeof("host"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->host = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->path = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "query", sizeof("query"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->query = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if ((SUCCESS == zend_hash_find(ht, "fragment", sizeof("fragment"), (void *) &e)) ++ && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { ++ url->fragment = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); ++ } ++ if (SUCCESS == zend_hash_find(ht, "port", sizeof("port"), (void *) &e)) { ++ if (Z_TYPE_PP(e) == IS_LONG) { ++ url->port = (unsigned short) Z_LVAL_PP(e); ++ } else { ++ zval *o = http_zsep(IS_LONG, *e); ++ ++ url->port = (unsigned short) Z_LVAL_P(o); ++ zval_ptr_dtor(&o); ++ } ++ } ++ ++ return url; ++} ++ ++#define http_url_tostruct(u, strct) _http_url_tostruct((u), (strct) TSRMLS_CC) ++static inline HashTable *_http_url_tostruct(php_url *url, zval *strct TSRMLS_DC) ++{ ++ zval arr; ++ ++ if (strct) { ++ switch (Z_TYPE_P(strct)) { ++ default: ++ zval_dtor(strct); ++ array_init(strct); ++ case IS_ARRAY: ++ case IS_OBJECT: ++ INIT_ZARR(arr, HASH_OF(strct)); ++ } ++ } else { ++ INIT_PZVAL(&arr); ++ array_init(&arr); ++ } ++ ++ if (url) { ++ if (url->scheme) { ++ add_assoc_string(&arr, "scheme", url->scheme, 1); ++ } ++ if (url->user) { ++ add_assoc_string(&arr, "user", url->user, 1); ++ } ++ if (url->pass) { ++ add_assoc_string(&arr, "pass", url->pass, 1); ++ } ++ if (url->host) { ++ add_assoc_string(&arr, "host", url->host, 1); ++ } ++ if (url->port) { ++ add_assoc_long(&arr, "port", (long) url->port); ++ } ++ if (url->path) { ++ add_assoc_string(&arr, "path", url->path, 1); ++ } ++ if (url->query) { ++ add_assoc_string(&arr, "query", url->query, 1); ++ } ++ if (url->fragment) { ++ add_assoc_string(&arr, "fragment", url->fragment, 1); ++ } ++ } ++ ++ return Z_ARRVAL(arr); ++} ++ ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/php_http_util_object.h +@@ -0,0 +1,35 @@ ++/* ++ +--------------------------------------------------------------------+ ++ | PECL :: http | ++ +--------------------------------------------------------------------+ ++ | Redistribution and use in source and binary forms, with or without | ++ | modification, are permitted provided that the conditions mentioned | ++ | in the accompanying LICENSE file are met. | ++ +--------------------------------------------------------------------+ ++ | Copyright (c) 2004-2010, Michael Wallner | ++ +--------------------------------------------------------------------+ ++*/ ++ ++/* $Id: php_http_util_object.h 292841 2009-12-31 08:48:57Z mike $ */ ++ ++#ifndef PHP_HTTP_UTIL_OBJECT_H ++#define PHP_HTTP_UTIL_OBJECT_H ++#ifdef ZEND_ENGINE_2 ++ ++extern zend_class_entry *http_util_object_ce; ++extern zend_function_entry http_util_object_fe[]; ++ ++extern PHP_MINIT_FUNCTION(http_util_object); ++ ++#endif ++#endif ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: noet sw=4 ts=4 fdm=marker ++ * vim<600: noet sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/phpstr/phpstr.c +@@ -0,0 +1,379 @@ ++ ++/* $Id: phpstr.c 211942 2006-04-24 17:17:09Z mike $ */ ++ ++#include "php.h" ++#include "phpstr.h" ++ ++PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags) ++{ ++ if (!buf) { ++ buf = pemalloc(sizeof(phpstr), flags & PHPSTR_INIT_PERSISTENT); ++ } ++ ++ if (buf) { ++ buf->size = (chunk_size) ? chunk_size : PHPSTR_DEFAULT_SIZE; ++ buf->pmem = (flags & PHPSTR_INIT_PERSISTENT) ? 1 : 0; ++ buf->data = (flags & PHPSTR_INIT_PREALLOC) ? pemalloc(buf->size, buf->pmem) : NULL; ++ buf->free = (flags & PHPSTR_INIT_PREALLOC) ? buf->size : 0; ++ buf->used = 0; ++ } ++ ++ return buf; ++} ++ ++PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length) ++{ ++ if ((buf = phpstr_init(buf))) { ++ if (PHPSTR_NOMEM == phpstr_append(buf, string, length)) { ++ pefree(buf, buf->pmem); ++ buf = NULL; ++ } ++ } ++ return buf; ++} ++ ++PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size, int allow_error) ++{ ++ char *ptr = NULL; ++#if 0 ++ fprintf(stderr, "RESIZE: size=%lu, used=%lu, free=%lu\n", buf->size, buf->used, buf->free); ++#endif ++ if (buf->free < len) { ++ size_t size = override_size ? override_size : buf->size; ++ ++ while ((size + buf->free) < len) { ++ size <<= 1; ++ } ++ ++ if (allow_error) { ++ ptr = perealloc_recoverable(buf->data, buf->used + buf->free + size, buf->pmem); ++ } else { ++ ptr = perealloc(buf->data, buf->used + buf->free + size, buf->pmem); ++ } ++ ++ if (ptr) { ++ buf->data = ptr; ++ } else { ++ return PHPSTR_NOMEM; ++ } ++ ++ buf->free += size; ++ return size; ++ } ++ return 0; ++} ++ ++PHPSTR_API size_t phpstr_shrink(phpstr *buf) ++{ ++ /* avoid another realloc on fixation */ ++ if (buf->free > 1) { ++ char *ptr = perealloc(buf->data, buf->used + 1, buf->pmem); ++ ++ if (ptr) { ++ buf->data = ptr; ++ } else { ++ return PHPSTR_NOMEM; ++ } ++ buf->free = 1; ++ } ++ return buf->used; ++} ++ ++PHPSTR_API size_t phpstr_append(phpstr *buf, const char *append, size_t append_len) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, append_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memcpy(buf->data + buf->used, append, append_len); ++ buf->used += append_len; ++ buf->free -= append_len; ++ return append_len; ++} ++ ++PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...) ++{ ++ va_list argv; ++ char *append; ++ size_t append_len, alloc; ++ ++ va_start(argv, format); ++ append_len = vspprintf(&append, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_append(buf, append, append_len); ++ efree(append); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return append_len; ++} ++ ++PHPSTR_API size_t phpstr_insert(phpstr *buf, const char *insert, size_t insert_len, size_t offset) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, insert_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memmove(buf->data + offset + insert_len, buf->data + offset, insert_len); ++ memcpy(buf->data + offset, insert, insert_len); ++ buf->used += insert_len; ++ buf->free -= insert_len; ++ return insert_len; ++} ++ ++PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...) ++{ ++ va_list argv; ++ char *insert; ++ size_t insert_len, alloc; ++ ++ va_start(argv, format); ++ insert_len = vspprintf(&insert, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_insert(buf, insert, insert_len, offset); ++ efree(insert); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return insert_len; ++} ++ ++PHPSTR_API size_t phpstr_prepend(phpstr *buf, const char *prepend, size_t prepend_len) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize(buf, prepend_len)) { ++ return PHPSTR_NOMEM; ++ } ++ memmove(buf->data + prepend_len, buf->data, buf->used); ++ memcpy(buf->data, prepend, prepend_len); ++ buf->used += prepend_len; ++ buf->free -= prepend_len; ++ return prepend_len; ++} ++ ++PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...) ++{ ++ va_list argv; ++ char *prepend; ++ size_t prepend_len, alloc; ++ ++ va_start(argv, format); ++ prepend_len = vspprintf(&prepend, 0, format, argv); ++ va_end(argv); ++ ++ alloc = phpstr_prepend(buf, prepend, prepend_len); ++ efree(prepend); ++ ++ if (PHPSTR_NOMEM == alloc) { ++ return PHPSTR_NOMEM; ++ } ++ return prepend_len; ++} ++ ++PHPSTR_API char *phpstr_data(const phpstr *buf, char **into, size_t *len) ++{ ++ char *copy = ecalloc(1, buf->used + 1); ++ memcpy(copy, buf->data, buf->used); ++ if (into) { ++ *into = copy; ++ } ++ if (len) { ++ *len = buf->used; ++ } ++ return copy; ++} ++ ++PHPSTR_API phpstr *phpstr_dup(const phpstr *buf) ++{ ++ phpstr *dup = phpstr_clone(buf); ++ if (PHPSTR_NOMEM == phpstr_append(dup, buf->data, buf->used)) { ++ phpstr_free(&dup); ++ } ++ return dup; ++} ++ ++PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length) ++{ ++ if (offset >= buf->used) { ++ return 0; ++ } ++ if (offset + length > buf->used) { ++ length = buf->used - offset; ++ } ++ memmove(buf->data + offset, buf->data + offset + length, buf->used - length); ++ buf->used -= length; ++ buf->free += length; ++ return length; ++} ++ ++PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t length) ++{ ++ if (offset >= buf->used) { ++ return NULL; ++ } else { ++ size_t need = 1 + ((length + offset) > buf->used ? (buf->used - offset) : (length - offset)); ++ phpstr *sub = phpstr_init_ex(NULL, need, PHPSTR_INIT_PREALLOC | (buf->pmem ? PHPSTR_INIT_PERSISTENT:0)); ++ if (sub) { ++ if (PHPSTR_NOMEM == phpstr_append(sub, buf->data + offset, need)) { ++ phpstr_free(&sub); ++ } else { ++ sub->size = buf->size; ++ } ++ } ++ return sub; ++ } ++} ++ ++PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length) ++{ ++ if (length < buf->used) { ++ return phpstr_sub(buf, buf->used - length, length); ++ } else { ++ return phpstr_sub(buf, 0, buf->used); ++ } ++} ++ ++ ++PHPSTR_API phpstr *phpstr_merge_va(phpstr *buf, unsigned argc, va_list argv) ++{ ++ unsigned i = 0; ++ buf = phpstr_init(buf); ++ ++ if (buf) { ++ while (argc > i++) { ++ phpstr_free_t f = va_arg(argv, phpstr_free_t); ++ phpstr *current = va_arg(argv, phpstr *); ++ phpstr_append(buf, current->data, current->used); ++ FREE_PHPSTR(f, current); ++ } ++ } ++ ++ return buf; ++} ++ ++PHPSTR_API phpstr *phpstr_merge_ex(phpstr *buf, unsigned argc, ...) ++{ ++ va_list argv; ++ phpstr *ret; ++ ++ va_start(argv, argc); ++ ret = phpstr_merge_va(buf, argc, argv); ++ va_end(argv); ++ return ret; ++} ++ ++PHPSTR_API phpstr *phpstr_merge(unsigned argc, ...) ++{ ++ va_list argv; ++ phpstr *ret; ++ ++ va_start(argv, argc); ++ ret = phpstr_merge_va(NULL, argc, argv); ++ va_end(argv); ++ return ret; ++} ++ ++PHPSTR_API phpstr *phpstr_fix(phpstr *buf) ++{ ++ if (PHPSTR_NOMEM == phpstr_resize_ex(buf, 1, 1, 0)) { ++ return NULL; ++ } ++ buf->data[buf->used] = '\0'; ++ return buf; ++} ++ ++PHPSTR_API int phpstr_cmp(phpstr *left, phpstr *right) ++{ ++ if (left->used > right->used) { ++ return -1; ++ } else if (right->used > left->used) { ++ return 1; ++ } else { ++ return memcmp(left->data, right->data, left->used); ++ } ++} ++ ++PHPSTR_API void phpstr_reset(phpstr *buf) ++{ ++ buf->free += buf->used; ++ buf->used = 0; ++} ++ ++PHPSTR_API void phpstr_dtor(phpstr *buf) ++{ ++ if (buf->data) { ++ pefree(buf->data, buf->pmem); ++ buf->data = NULL; ++ } ++ buf->used = 0; ++ buf->free = 0; ++} ++ ++PHPSTR_API void phpstr_free(phpstr **buf) ++{ ++ if (*buf) { ++ phpstr_dtor(*buf); ++ pefree(*buf, (*buf)->pmem); ++ *buf = NULL; ++ } ++} ++ ++PHPSTR_API size_t phpstr_chunk_buffer(phpstr **s, const char *data, size_t data_len, char **chunk, size_t chunk_size) ++{ ++ phpstr *storage; ++ ++ *chunk = NULL; ++ ++ if (!*s) { ++ *s = phpstr_init_ex(NULL, chunk_size << 1, chunk_size ? PHPSTR_INIT_PREALLOC : 0); ++ } ++ storage = *s; ++ ++ if (data_len) { ++ phpstr_append(storage, data, data_len); ++ } ++ ++ if (!chunk_size) { ++ phpstr_data(storage, chunk, &chunk_size); ++ phpstr_free(s); ++ return chunk_size; ++ } ++ ++ if (storage->used >= (chunk_size = storage->size >> 1)) { ++ *chunk = estrndup(storage->data, chunk_size); ++ phpstr_cut(storage, 0, chunk_size); ++ return chunk_size; ++ } ++ ++ return 0; ++} ++ ++PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_len, phpstr_passthru_func passthru, void *opaque TSRMLS_DC) ++{ ++ char *chunk = NULL; ++ size_t got = 0; ++ ++ while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) { ++ passthru(opaque, chunk, got TSRMLS_CC); ++ if (!chunk_len) { ++ /* we already got the last chunk, ++ and freed all resources */ ++ break; ++ } ++ data = NULL; ++ data_len = 0; ++ STR_SET(chunk, NULL); ++ } ++ STR_FREE(chunk); ++} ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ ++ +--- /dev/null ++++ b/ext/http/phpstr/phpstr.h +@@ -0,0 +1,224 @@ ++ ++/* $Id: phpstr.h 229282 2007-02-07 15:31:50Z mike $ */ ++ ++#ifndef _PHPSTR_H_ ++#define _PHPSTR_H_ ++ ++#ifndef PHPSTR_DEFAULT_SIZE ++# define PHPSTR_DEFAULT_SIZE 256 ++#endif ++ ++#define PHPSTR_NOMEM ((size_t) -1) ++ ++#ifndef STR_FREE ++# define STR_FREE(STR) \ ++ { \ ++ if (STR) { \ ++ efree(STR); \ ++ } \ ++ } ++#endif ++#ifndef STR_SET ++# define STR_SET(STR, SET) \ ++ { \ ++ STR_FREE(STR); \ ++ STR = SET; \ ++ } ++#endif ++#ifndef TSRMLS_D ++# define TSRMLS_D ++# define TSRMLS_DC ++# define TSRMLS_CC ++# define TSRMLS_C ++#endif ++#ifdef PHP_ATTRIBUTE_FORMAT ++# define PHPSTR_ATTRIBUTE_FORMAT(f, a, b) PHP_ATTRIBUTE_FORMAT(f, a, b) ++#else ++# define PHPSTR_ATTRIBUTE_FORMAT(f, a, b) ++#endif ++#ifndef pemalloc ++# define pemalloc(s,p) malloc(s) ++# define pefree(x,p) free(x) ++# define perealloc(x,s,p) realloc(x,s) ++# define perealloc_recoverable perealloc ++# define ecalloc calloc ++static inline void *estrndup(void *p, size_t s) ++{ ++ char *r = (char *) malloc(s+1); ++ if (r) memcpy((void *) r, p, s), r[s] = '\0'; ++ return (void *) r; ++} ++#endif ++ ++#if defined(PHP_WIN32) ++# if defined(PHPSTR_EXPORTS) ++# define PHPSTR_API __declspec(dllexport) ++# elif defined(COMPILE_DL_PHPSTR) ++# define PHPSTR_API __declspec(dllimport) ++# else ++# define PHPSTR_API ++# endif ++#else ++# define PHPSTR_API ++#endif ++ ++#define PHPSTR(p) ((phpstr *) (p)) ++#define PHPSTR_VAL(p) (PHPSTR(p))->data ++#define PHPSTR_LEN(p) (PHPSTR(p))->used ++ ++#define FREE_PHPSTR_PTR(STR) pefree(STR, STR->pmem) ++#define FREE_PHPSTR_VAL(STR) phpstr_dtor(STR) ++#define FREE_PHPSTR_ALL(STR) phpstr_free(&(STR)) ++#define FREE_PHPSTR(free, STR) \ ++ switch (free) \ ++ { \ ++ case PHPSTR_FREE_NOT: break; \ ++ case PHPSTR_FREE_PTR: pefree(STR, STR->pmem); break; \ ++ case PHPSTR_FREE_VAL: phpstr_dtor(STR); break; \ ++ case PHPSTR_FREE_ALL: \ ++ { \ ++ phpstr *PTR = (STR); \ ++ phpstr_free(&PTR); \ ++ } \ ++ break; \ ++ default: break; \ ++ } ++ ++#define RETURN_PHPSTR_PTR(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_PTR, 0) ++#define RETURN_PHPSTR_VAL(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 0) ++#define RETURN_PHPSTR_DUP(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 1) ++#define RETVAL_PHPSTR_PTR(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_PTR, 0) ++#define RETVAL_PHPSTR_VAL(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_NOT, 0) ++#define RETVAL_PHPSTR_DUP(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_NOT, 1) ++/* RETURN_PHPSTR(buf, PHPSTR_FREE_PTR, 0) */ ++#define RETURN_PHPSTR(STR, free, dup) \ ++ RETVAL_PHPSTR((STR), (free), (dup)); \ ++ return; ++ ++#define RETVAL_PHPSTR(STR, free, dup) \ ++ phpstr_fix(STR); \ ++ RETVAL_STRINGL((STR)->data, (STR)->used, (dup)); \ ++ FREE_PHPSTR((free), (STR)); ++ ++typedef struct _phpstr_t { ++ char *data; ++ size_t used; ++ size_t free; ++ size_t size; ++ unsigned pmem:1; ++ unsigned reserved:31; ++} phpstr; ++ ++typedef enum _phpstr_free_t { ++ PHPSTR_FREE_NOT = 0, ++ PHPSTR_FREE_PTR, /* pefree() */ ++ PHPSTR_FREE_VAL, /* phpstr_dtor() */ ++ PHPSTR_FREE_ALL /* phpstr_free() */ ++} phpstr_free_t; ++ ++#define PHPSTR_ALL_FREE(STR) PHPSTR_FREE_ALL,(STR) ++#define PHPSTR_PTR_FREE(STR) PHPSTR_FREE_PTR,(STR) ++#define PHPSTR_VAL_FREE(STR) PHPSTR_FREE_VAL,(STR) ++#define PHPSTR_NOT_FREE(STR) PHPSTR_FREE_NOT,(STR) ++ ++#define PHPSTR_INIT_PREALLOC 0x01 ++#define PHPSTR_INIT_PERSISTENT 0x02 ++ ++/* create a new phpstr */ ++#define phpstr_new() phpstr_init(NULL) ++#define phpstr_init(b) phpstr_init_ex(b, PHPSTR_DEFAULT_SIZE, 0) ++#define phpstr_clone(phpstr_pointer) phpstr_init_ex(NULL, (phpstr_pointer)->size, (phpstr_pointer)->pmem ? PHPSTR_INIT_PERSISTENT:0) ++PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags); ++ ++/* create a phpstr from a zval or c-string */ ++#define phpstr_from_zval(z) phpstr_from_string(Z_STRVAL(z), Z_STRLEN(z)) ++#define phpstr_from_zval_ex(b, z) phpstr_from_string_ex(b, Z_STRVAL(z), Z_STRLEN(z)) ++#define phpstr_from_string(s, l) phpstr_from_string_ex(NULL, (s), (l)) ++PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length); ++ ++/* usually only called from within the internal functions */ ++#define phpstr_resize(b, s) phpstr_resize_ex((b), (s), 0, 0) ++PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size, int allow_error); ++ ++/* shrink memory chunk to actually used size (+1) */ ++PHPSTR_API size_t phpstr_shrink(phpstr *buf); ++ ++/* append data to the phpstr */ ++#define phpstr_appends(b, a) phpstr_append((b), (a), sizeof(a)-1) ++#define phpstr_appendl(b, a) phpstr_append((b), (a), strlen(a)) ++PHPSTR_API size_t phpstr_append(phpstr *buf, const char *append, size_t append_len); ++PHPSTR_API size_t phpstr_appendf(phpstr *buf, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 2, 3); ++ ++/* insert data at a specific position of the phpstr */ ++#define phpstr_inserts(b, i, o) phpstr_insert((b), (i), sizeof(i)-1, (o)) ++#define phpstr_insertl(b, i, o) phpstr_insert((b), (i), strlen(i), (o)) ++PHPSTR_API size_t phpstr_insert(phpstr *buf, const char *insert, size_t insert_len, size_t offset); ++PHPSTR_API size_t phpstr_insertf(phpstr *buf, size_t offset, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 3, 4); ++ ++/* prepend data */ ++#define phpstr_prepends(b, p) phpstr_prepend((b), (p), sizeof(p)-1) ++#define phpstr_prependl(b, p) phpstr_prepend((b), (p), strlen(p)) ++PHPSTR_API size_t phpstr_prepend(phpstr *buf, const char *prepend, size_t prepend_len); ++PHPSTR_API size_t phpstr_prependf(phpstr *buf, const char *format, ...) PHPSTR_ATTRIBUTE_FORMAT(printf, 2, 3); ++ ++/* get a zero-terminated string */ ++PHPSTR_API char *phpstr_data(const phpstr *buf, char **into, size_t *len); ++ ++/* get a part of the phpstr */ ++#define phpstr_mid(b, o, l) phpstr_sub((b), (o), (l)) ++#define phpstr_left(b, l) phpstr_sub((b), 0, (l)) ++PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length); ++PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t len); ++ ++/* remove a substring */ ++PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length); ++ ++/* get a complete phpstr duplicate */ ++PHPSTR_API phpstr *phpstr_dup(const phpstr *buf); ++ ++/* merge several phpstr objects ++ use like: ++ ++ phpstr *final = phpstr_merge(3, ++ PHPSTR_NOT_FREE(&keep), ++ PHPSTR_ALL_FREE(middle_ptr), ++ PHPSTR_VAL_FREE(&local); ++*/ ++PHPSTR_API phpstr *phpstr_merge(unsigned argc, ...); ++PHPSTR_API phpstr *phpstr_merge_ex(phpstr *buf, unsigned argc, ...); ++PHPSTR_API phpstr *phpstr_merge_va(phpstr *buf, unsigned argc, va_list argv); ++ ++/* sets a trailing NUL byte */ ++PHPSTR_API phpstr *phpstr_fix(phpstr *buf); ++ ++/* memcmp for phpstr objects */ ++PHPSTR_API int phpstr_cmp(phpstr *left, phpstr *right); ++ ++/* reset phpstr object */ ++PHPSTR_API void phpstr_reset(phpstr *buf); ++ ++/* free a phpstr objects contents */ ++PHPSTR_API void phpstr_dtor(phpstr *buf); ++ ++/* free a phpstr object completely */ ++PHPSTR_API void phpstr_free(phpstr **buf); ++ ++/* stores data in a phpstr until it reaches chunk_size */ ++PHPSTR_API size_t phpstr_chunk_buffer(phpstr **s, const char *data, size_t data_len, char **chunk, size_t chunk_size); ++ ++typedef void (*phpstr_passthru_func)(void *opaque, const char *, size_t TSRMLS_DC); ++ ++/* wrapper around phpstr_chunk_buffer, which passes available chunks to passthru() */ ++PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_size, phpstr_passthru_func passthru, void *opaque TSRMLS_DC); ++ ++#endif ++ ++ ++/* ++ * Local variables: ++ * tab-width: 4 ++ * c-basic-offset: 4 ++ * End: ++ * vim600: sw=4 ts=4 fdm=marker ++ * vim<600: sw=4 ts=4 ++ */ +--- /dev/null ++++ b/ext/http/tests/HttpMessage_001.phpt +@@ -0,0 +1,70 @@ ++--TEST-- ++HttpMessage ++--SKIPIF-- ++ ++--FILE-- ++getResponseStatus()); ++ ++$x = $m->getParentMessage(); ++$x = $m->getParentMessage(); ++$x = $m->getParentMessage(); ++ ++var_dump($m->getBody()); ++var_dump(HttpMessage::fromString($m->toString(true))->toString(true)); ++try { ++ do { ++ var_dump($m->toString()); ++ } while ($m = $m->getParentMessage()); ++} catch (HttpException $ex) { ++} ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(15) "Partial content" ++string(1) "X" ++string(190) "HTTP/1.1 301 ++Location: /anywhere ++HTTP/1.1 302 ++Location: /somewhere ++HTTP/1.1 206 Partial content ++Content-Range: bytes=2-3 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++string(119) "HTTP/1.1 206 Partial content ++Content-Range: bytes=2-3 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++string(36) "HTTP/1.1 302 ++Location: /somewhere ++" ++string(35) "HTTP/1.1 301 ++Location: /anywhere ++" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_002.phpt +@@ -0,0 +1,65 @@ ++--TEST-- ++HttpMessage properties ++--SKIPIF-- ++ ++--FILE-- ++var_property); ++ var_dump($this->public_property); ++ var_dump($this->protected_property); ++ var_dump($this->private_property); ++ var_dump($this->non_ex_property); ++ $this->var_property.='_property'; ++ $this->public_property.='_property'; ++ $this->protected_property.='_property'; ++ $this->private_property.='_property'; ++ $this->non_ex_property = 'non_ex'; ++ var_dump($this->var_property); ++ var_dump($this->public_property); ++ var_dump($this->protected_property); ++ var_dump($this->private_property); ++ var_dump($this->non_ex_property); ++ ++ print_r($this->headers); ++ $this->headers['Foo'] = 'Bar'; ++ } ++} ++ ++error_reporting(E_ALL|E_STRICT); ++ ++echo "-TEST\n"; ++$m = new Message; ++$m->test(); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(3) "var" ++string(6) "public" ++string(9) "protected" ++string(7) "private" ++ ++Notice: Undefined property: Message::$non_ex_property in %s ++NULL ++string(12) "var_property" ++string(15) "public_property" ++string(18) "protected_property" ++string(16) "private_property" ++string(6) "non_ex" ++Array ++( ++) ++%aFatal error%sCannot access HttpMessage properties by reference or array key/index in%s +--- /dev/null ++++ b/ext/http/tests/HttpMessage_003.phpt +@@ -0,0 +1,70 @@ ++--TEST-- ++HttpMessage implements Serializable, Countable ++--SKIPIF-- ++ ++--FILE-- ++count()); ++var_dump($m->serialize()); ++$m->unserialize("HTTP/1.1 200 Ok\r\nServer: Funky/1.0"); ++var_dump($m); ++var_dump($m->count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++int(3) ++string(148) "HTTP/1.1 301 ++Location: /anywhere ++HTTP/1.1 302 ++Location: /somewhere ++HTTP/1.1 200 ++X-Original-Transfer-Encoding: chunked ++Content-Length: 1 ++ ++X ++" ++object(HttpMessage)#%d (%d) { ++ ["type%s]=> ++ int(2) ++ ["body%s]=> ++ string(0) "" ++ ["requestMethod%s]=> ++ string(0) "" ++ ["requestUrl%s]=> ++ string(0) "" ++ ["responseStatus%s]=> ++ string(2) "Ok" ++ ["responseCode%s]=> ++ int(200) ++ ["httpVersion%s]=> ++ float(1.1) ++ ["headers%s]=> ++ array(1) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ } ++ ["parentMessage%s]=> ++ NULL ++} ++int(1) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_004.phpt +@@ -0,0 +1,36 @@ ++--TEST-- ++HttpMessage::detach() ++--SKIPIF-- ++ ++--FILE-- ++detach(); ++$d->addHeaders(array('Server'=>'Funky/2.0')); ++var_dump($d->getHeaders() == $m->getHeaders()); ++var_dump($d->getBody()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(false) ++string(3) "Hi!" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_005.phpt +@@ -0,0 +1,86 @@ ++--TEST-- ++HttpMessage::prepend() ++--SKIPIF-- ++ ++--FILE-- ++prepend($m2); ++$m2 = NULL; ++echo $m1->toString(true); ++ ++$m1->prepend($m1->detach(), false); ++echo $m1->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET http://example.com/ HTTP/1.0 ++HTTP/1.1 200 ok ++Server: Funky/2.0 ++Content-Type: text/html ++Content-Length: 9 ++ ++Hi there! ++GET / HTTP/1.1 ++Host: example.com ++Accept: */* ++Connection: close ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++GET http://example.com/ HTTP/1.0 ++HTTP/1.1 200 ok ++Server: Funky/2.0 ++Content-Type: text/html ++Content-Length: 9 ++ ++Hi there! ++GET / HTTP/1.1 ++Host: example.com ++Accept: */* ++Connection: close ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++HTTP/1.1 200 ok ++Server: Funky/1.0 ++Content-Type: text/plain ++Content-Length: 3 ++ ++Hi! ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_006.phpt +@@ -0,0 +1,35 @@ ++--TEST-- ++HttpMessage iterator ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++== ++HTTP/1.1 304 Not Modified ++== ++GET /foo HTTP/1.1 ++== ++HTTP/1.1 200 OK ++== ++GET / HTTP/1.1 ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpMessage_007.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++HttpMessage::reverse() ++--SKIPIF-- ++ ++--FILE-- ++toString(true); ++echo "===\n"; ++echo HttpMessage::fromString($s)->reverse()->toString(true); ++ ++$m = new HttpMessage($s); ++$r = $m->reverse(); ++unset($m); ++var_dump($r->count()); ++echo $r->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET /first HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-third ++=== ++HTTP/1.1 200 Ok-third ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /first HTTP/1.1 ++int(6) ++HTTP/1.1 200 Ok-third ++GET /third HTTP/1.1 ++HTTP/1.1 200 Ok-second ++GET /second HTTP/1.1 ++HTTP/1.1 200 Ok-first ++GET /first HTTP/1.1 ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_008.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++HttpMessage::toMessageTypeObject() ++--SKIPIF-- ++ ++--FILE-- ++"b",1=>2),null); ++ ++$m = new HttpMessage; ++$m->setType(HttpMessage::TYPE_REQUEST); ++$m->setRequestMethod('POST'); ++$m->setRequestUrl("http://www.example.com"); ++$m->setHttpVersion('1.1'); ++$m->addHeaders( ++ array( ++ "Content-Type" => "application/x-www-form-urlencoded", ++ "Host" => "www.example.com", ++ "Content-Length"=> strlen($b), ++ ) ++); ++$m->setBody($b); ++$r = $m->toMessageTypeObject(); ++echo $m,"\n"; ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++POST http://www.example.com HTTP/1.1 ++Content-Type: application/x-www-form-urlencoded ++Host: www.example.com ++Content-Length: 7 ++ ++a=b&1=2 ++ ++Done +--- /dev/null ++++ b/ext/http/tests/HttpMessage_009_bug16700.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++Bug #16700 - child classes of HttpMessage cannot not have array properties ++--SKIPIF-- ++ ++--FILE-- ++properties['foo'] = 'bar'; ++echo $child->properties['foo'], "\n"; ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bar ++Done +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_001.phpt +@@ -0,0 +1,116 @@ ++--TEST-- ++HttpQueryString global ++--SKIPIF-- ++ ++--FILE-- ++'b','c'=>'3.4','r'=>array(1,2,3)); ++$_SERVER['QUERY_STRING'] = 'a=b&c=3.4&r[0]=1&r[1]=2&r[2]=3'; ++ ++var_dump(HttpQueryString::singleton()->get()); ++var_dump(HttpQueryString::singleton()->get('n')); ++var_dump(HttpQueryString::singleton()->get('a')); ++var_dump(HttpQueryString::singleton()->get('a', "i", 0, true)); ++var_dump(HttpQueryString::singleton()->get('a', "string", 'hi!')); ++var_dump(HttpQueryString::singleton()->get('c')); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_INT)); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_FLOAT)); ++var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_BOOL)); ++var_dump(HttpQueryString::singleton()->get('r')); ++var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_ARRAY)); ++var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_OBJECT)); ++ ++HttpQueryString::singleton()->set(new HttpQueryString(false, 'z[0]=2')); ++ ++HttpQueryString::singleton()->set(array('a'=>'b', 'c'=> "3.4")); ++HttpQueryString::singleton()->set(array('a' => NULL)); ++ ++var_dump(HttpQueryString::singleton()); ++var_dump($_GET); ++var_dump($_SERVER['QUERY_STRING']); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(42) "a=b&c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3" ++NULL ++string(1) "b" ++int(0) ++string(3) "hi!" ++string(3) "3.4" ++int(3) ++float(3.4) ++bool(true) ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(stdClass)#%d (%d) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(HttpQueryString)#1 (2) { ++ ["queryArray%s]=> ++ &array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++ } ++ ["queryString%s]=> ++ &string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++} ++array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++} ++string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_002.phpt +@@ -0,0 +1,108 @@ ++--TEST-- ++HttpQueryString local ++--SKIPIF-- ++ ++--FILE-- ++'b','c'=>'3.4','r'=>array(1,2,3))); ++var_dump($q->get()); ++var_dump($q->get('n')); ++var_dump($q->get('a')); ++var_dump($q->get('a', "i", 0, true)); ++var_dump($q->get('a', "string", 'hi!')); ++var_dump($q->get('c')); ++var_dump($q->get('c', HttpQueryString::TYPE_INT)); ++var_dump($q->get('c', HttpQueryString::TYPE_FLOAT)); ++var_dump($q->get('c', HttpQueryString::TYPE_BOOL)); ++var_dump($q->get('r')); ++var_dump($q->get('r', HttpQueryString::TYPE_ARRAY)); ++var_dump($q->get('r', HttpQueryString::TYPE_OBJECT)); ++ ++$q->set('z[0]=2'); ++$q->set(array('a'=>'b', 'c'=> "3.4")); ++$q->set(array('a' => NULL)); ++ ++var_dump($q); ++var_dump($array); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(42) "a=b&c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3" ++NULL ++string(1) "b" ++int(0) ++string(3) "hi!" ++string(3) "3.4" ++int(3) ++float(3.4) ++bool(true) ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(stdClass)#%d (%d) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++} ++object(HttpQueryString)#1 (2) { ++ ["queryArray%s]=> ++ array(3) { ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++ ["z"]=> ++ array(1) { ++ [0]=> ++ string(1) "2" ++ } ++ } ++ ["queryString%s]=> ++ string(49) "c=3.4&r%5B0%5D=1&r%5B1%5D=2&r%5B2%5D=3&z%5B0%5D=2" ++} ++array(3) { ++ ["a"]=> ++ string(1) "b" ++ ["c"]=> ++ string(3) "3.4" ++ ["r"]=> ++ array(3) { ++ [0]=> ++ int(1) ++ [1]=> ++ int(2) ++ [2]=> ++ int(3) ++ } ++} ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_003.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpQueryString xlate ++--SKIPIF-- ++ ++--FILE-- ++get()); ++$qs->xlate("latin1", "utf8"); ++var_dump($qs->get()); ++$qs->xlate("utf8", "latin1"); ++var_dump($qs->get()); ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++string(29) "%E4%5B0%5D=%FC&%F6%5Ba%5D=%DF" ++string(41) "%C3%A4%5B0%5D=%C3%BC&%C3%B6%5Ba%5D=%C3%9F" ++string(29) "%E4%5B0%5D=%FC&%F6%5Ba%5D=%DF" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpQueryString_004.phpt +@@ -0,0 +1,54 @@ ++--TEST-- ++HttpQueryString w/ objects ++--SKIPIF-- ++ ++--FILE-- ++bar = (object) array("baz"=>1); ++ $this->dont_show = 'xxx'; ++ $this->dont_show2 = 'zzz'; ++ } ++} ++$foo = new test_props; ++var_dump($q = new HttpQueryString(false, $foo)); ++$foo->bar->baz = 0; ++var_dump($q->mod($foo)); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpQueryString)#3 (2) { ++ ["queryArray%s]=> ++ array(1) { ++ ["bar"]=> ++ array(1) { ++ ["baz"]=> ++ int(1) ++ } ++ } ++ ["queryString%s]=> ++ string(14) "bar%5Bbaz%5D=1" ++} ++object(HttpQueryString)#4 (2) { ++ ["queryArray%s]=> ++ array(1) { ++ ["bar"]=> ++ array(1) { ++ ["baz"]=> ++ int(0) ++ } ++ } ++ ["queryString%s]=> ++ string(14) "bar%5Bbaz%5D=0" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestDataShare_001.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++HttpRequestDataShare ++--SKIPIF-- ++ ++--FILE-- ++dns = true; ++$s->cookie = true; ++ ++$r1 = new HttpRequest("http://www.google.com/"); ++$r2 = new HttpRequest("http://www.google.com/"); ++ ++$r1->enableCookies(); ++$r2->enableCookies(); ++ ++$s->attach($r1); ++$s->attach($r2); ++ ++$r1->send(); ++$r2->send(); ++ ++$s->reset(); ++ ++var_dump(current($r1->getResponseCookies())->cookies["PREF"] === HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestDataShare_002.phpt +@@ -0,0 +1,52 @@ ++--TEST-- ++HttpRequestDataShare global ++--SKIPIF-- ++ ++--FILE-- ++cookie = true; ++var_dump($s); ++ ++$r1 = new HttpRequest("http://www.google.com/"); ++$r2 = new HttpRequest("http://www.google.com/"); ++ ++$r1->enableCookies(); ++$r2->enableCookies(); ++ ++$s->attach($r1); ++$s->attach($r2); ++ ++$r1->send(); ++$r2->send(); ++ ++$s->reset(); ++ ++if (current($r1->getResponseCookies())->cookies["PREF"] !== HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]) { ++ var_dump( ++ current($r1->getResponseCookies())->cookies["PREF"], ++ HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"] ++ ); ++} ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpRequestDataShare)#1 (4) { ++ ["cookie"]=> ++ bool(true) ++ ["dns"]=> ++ bool(true) ++ ["ssl"]=> ++ bool(false) ++ ["connect"]=> ++ bool(false) ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_001.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++HttpRequestPool ++--SKIPIF-- ++ ++--FILE-- ++addPostFields(array('a'=>1,'b'=>2)) ; ++ ++$pool = new HttpRequestPool( ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ $post ++); ++ ++$pool->send(); ++ ++foreach ($pool as $req) { ++ echo $req->getUrl(), '=', ++ $req->getResponseCode(), ':', ++ $req->getResponseMessage()->getResponseCode(), "\n"; ++} ++ ++foreach ($pool as $req) { ++ try { ++ $pool->attach(new HttpRequest('http://foo.bar')); ++ } catch (HttpRequestPoolException $x) { ++ echo ".\n"; ++ } ++} ++ ++foreach ($pool as $req) { ++ $pool->detach($req); ++} ++ ++echo "Done\n"; ++?> ++ ++--EXPECTF-- ++%aTEST ++http://www.php.net/=200:200 ++http://dev.iworks.at/ext-http/.print_request.php=200:200 ++. ++. ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_002.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++extending HttpRequestPool ++--SKIPIF-- ++ ++--FILE-- ++socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ protected final function socketPerform() ++ { ++ $result = parent::socketPerform(); ++ ++ echo "."; ++ foreach ($this->getFinishedRequests() as $r) { ++ echo "=", $r->getResponseCode(), "="; ++ $this->detach($r); ++ } ++ ++ return $result; ++ } ++} ++ ++$pool = new MyPool( ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), ++ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD) ++); ++ ++$pool->send(); ++ ++echo "\nDone\n"; ++?> ++--EXPECTREGEX-- ++.+TEST ++\.*=200=\.*=200=\.*=200= ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_003.phpt +@@ -0,0 +1,175 @@ ++--TEST-- ++HttpRequestPool chain ++--SKIPIF-- ++ ++--FILE-- ++dir = (is_dir($cache_dir) or @mkdir($cache_dir)) ? $cache_dir : null; ++ ++ foreach (array_map('trim', file($urls_file)) as $url) { ++ $this->all[$url] = $this->dir ? $this->dir .'/'. md5($url) : null; ++ } ++ ++ $this->send(); ++ } ++ ++ public final function send() ++ { ++ if (RMAX) { ++ $now = array_slice($this->all, 0, RMAX); ++ $this->rem = array_slice($this->all, RMAX); ++ } else { ++ $now = $urls; ++ $this->rem = array(); ++ } ++ ++ foreach ($now as $url => $file) { ++ $this->attach( ++ new HttpRequest( ++ $url, ++ HttpRequest::METH_GET, ++ array( ++ 'redirect' => 5, ++ 'compress' => GZIP, ++ 'timeout' => TOUT, ++ 'connecttimeout' => TOUT, ++ 'lastmodified' => is_file($file)?filemtime($file):0 ++ ) ++ ) ++ ); ++ } ++ ++ while ($this->socketPerform()) { ++ if (!$this->socketSelect()) { ++ throw new HttpSocketException; ++ } ++ } ++ } ++ ++ protected final function socketPerform() ++ { ++ try { ++ $rc = parent::socketPerform(); ++ } catch (HttpRequestException $x) { ++ // a request may have thrown an exception, ++ // but it is still save to continue ++ echo $x->getMessage(), "\n"; ++ } ++ ++ foreach ($this->getFinishedRequests() as $r) { ++ $this->detach($r); ++ ++ $u = $r->getUrl(); ++ $c = $r->getResponseCode(); ++ $b = $r->getResponseBody(); ++ ++ printf("%d %s %d\n", $c, $u, strlen($b)); ++ ++ if ($c == 200 && $this->dir) { ++ file_put_contents($this->all[$u], $b); ++ } ++ ++ if ($a = each($this->rem)) { ++ list($url, $file) = $a; ++ $this->attach( ++ new HttpRequest( ++ $url, ++ HttpRequest::METH_GET, ++ array( ++ 'redirect' => 5, ++ 'compress' => GZIP, ++ 'timeout' => TOUT, ++ 'connecttimeout' => TOUT, ++ 'lastmodified' => is_file($file)?filemtime($file):0 ++ ) ++ ) ++ ); ++ } ++ } ++ return $rc; ++ } ++} ++ ++define('GZIP', true); ++define('TOUT', 50); ++define('RMAX', 10); ++chdir(dirname(__FILE__)); ++ ++$time = microtime(true); ++$pool = new Pool(); ++printf("Elapsed: %0.3fs\n", microtime(true)-$time); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++%d %s %d ++Elapsed: %fs ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_004.phpt +@@ -0,0 +1,19 @@ ++--TEST-- ++HttpRequestPool::__destruct() invalid curl handle ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_005.phpt +@@ -0,0 +1,46 @@ ++--TEST-- ++HttpRequestPool exception ++--SKIPIF-- ++ ++--FILE-- ++send(); ++} catch (HttpRequestPoolException $x) { ++ for ($i=0; $x; ++$i, $x = @$x->innerException) { ++ printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage()); ++ } ++ var_dump($i); ++} ++$p = new HttpRequestPool(new HttpRequest('http://_____'), new HttpRequest('http://_____')); ++try { ++ $p->send(); ++} catch (HttpRequestPoolException $x) { ++ for ($i=0; $x; ++$i, $x = @$x->innerException) { ++ printf("%s%s: %s\n", str_repeat("\t", $i), get_class($x), $x->getMessage()); ++ } ++ var_dump($i); ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++HttpRequestPoolException: Exception caused by 2 inner exception(s) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++int(3) ++HttpRequestPoolException: Exception caused by 4 inner exception(s) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++ HttpInvalidParamException: Empty or too short HTTP message: '' ++ HttpRequestException: %souldn't resolve host name; %s (http://_____/) ++int(5) ++Done ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequestPool_006.phpt +@@ -0,0 +1,50 @@ ++--TEST-- ++HttpRequestPool detaching in callbacks ++--SKIPIF-- ++ ++--FILE-- ++getUrl()])) { ++ $i[$this->getUrl()] = true; ++ try { ++ $GLOBALS['p']->detach($this); ++ } catch (Exception $ex) { ++ echo $ex, "\n"; ++ } ++ } ++ } ++ function onFinish() { ++ $GLOBALS['p']->detach($this); ++ } ++} ++$p = new HttpRequestPool(new r("http://at.php.net"), new r("http://de.php.net")); ++$p->send(); ++var_dump($p->getAttachedRequests()); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d ++Stack trace: ++#0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r)) ++#1 [internal function]: r->onProgress(Array) ++#2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send() ++#3 {main} ++exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d ++Stack trace: ++#0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r)) ++#1 [internal function]: r->onProgress(Array) ++#2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send() ++#3 {main} ++array(0) { ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_001.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++HttpRequest options ++--SKIPIF-- ++ ++--FILE-- ++11, 'headers'=>array('X-Foo'=>'Bar'))); ++$r2 = new HttpRequest; ++$r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo'))); ++$o1 = $r1->getOptions(); ++$o2 = $r2->getOptions(); ++$r1->setOptions($o2); ++$r2->setOptions($o1); ++print_r(array($o1, $o2)); ++var_dump(serialize($r1->getOptions()) === serialize($r2->getOptions())); ++$r1 = null; ++$r2 = null; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [0] => Array ++ ( ++ [headers] => Array ++ ( ++ [X-Foo] => Bar ++ [X-Bar] => Foo ++ ) ++ ++ [redirect] => 11 ++ ) ++ ++ [1] => Array ++ ( ++ [headers] => Array ++ ( ++ [X-Bar] => Foo ++ [X-Foo] => Bar ++ ) ++ ++ [redirect] => 99 ++ ) ++ ++) ++bool(false) +--- /dev/null ++++ b/ext/http/tests/HttpRequest_002.phpt +@@ -0,0 +1,86 @@ ++--TEST-- ++HttpRequest GET/POST ++--SKIPIF-- ++ ++--FILE-- ++send(); ++print_r($r->getResponseInfo()); ++ ++$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); ++$r->addCookies(array('MyCookie' => 'foobar')); ++$r->addQueryData(array('gq'=>'foobar','gi'=>10)); ++$r->addPostFields(array('pq'=>'foobar','pi'=>10)); ++$r->addPostFile('upload', dirname(__FILE__).'/data.txt', 'text/plain'); ++$r->send(); ++echo $r->getResponseBody(); ++var_dump($r->getResponseMessage()->getResponseCode()); ++ ++echo "Done"; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [effective_url] => http://www.google.com/ ++ [response_code] => 302 ++ [total_time] => %f ++ [namelookup_time] => %f ++ [connect_time] => %f ++ [pretransfer_time] => %f ++ [size_upload] => %d ++ [size_download] => %d ++ [speed_download] => %d ++ [speed_upload] => %d ++ [header_size] => %d ++ [request_size] => %d ++ [ssl_verifyresult] => %d ++ [filetime] => -1 ++ [content_length_download] => %d ++ [content_length_upload] => %d ++ [starttransfer_time] => %f ++ [content_type] => %s ++ [redirect_time] => %d ++ [redirect_count] => %d ++ [connect_code] => %d ++ [httpauth_avail] => %d ++ [proxyauth_avail] => %d ++ [os_errno] => %d ++ [num_connects] => %d ++ [ssl_engines] => Array ++ %a ++ [cookies] => Array ++ %a ++ [error] => ++) ++Array ++( ++ [gq] => foobar ++ [gi] => 10 ++ [pq] => foobar ++ [pi] => 10 ++ [MyCookie] => foobar ++) ++Array ++( ++ [upload] => Array ++ ( ++ [name] => data.txt ++ [type] => text/plain ++ [tmp_name] => %a ++ [error] => 0 ++ [size] => 1010 ++ ) ++ ++) ++int(200) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_003.phpt +@@ -0,0 +1,54 @@ ++--TEST-- ++HttpRequest SSL ++--SKIPIF-- ++ ++--FILE-- ++ '3', 'ssl' => array('version' => '3', 'verifyhost' => '1')); ++$r = new HttpRequest('https://ssl.irmler.at/iworks/data.txt'); ++$r->setOptions($o); ++$r->send(); ++var_dump($r->getResponseBody()); ++var_dump(is_object($r->getResponseMessage())); ++var_dump(is_object($r->getResponseMessage())); ++var_dump(is_object($r->getResponseMessage())); ++var_dump($o); ++$r->setOptions($o); ++$r->send(); ++var_dump($o); ++?> ++--EXPECTF-- ++%aTEST ++string(10) "1234567890" ++bool(true) ++bool(true) ++bool(true) ++array(2) { ++ ["redirect"]=> ++ string(1) "3" ++ ["ssl"]=> ++ array(2) { ++ ["version"]=> ++ string(1) "3" ++ ["verifyhost"]=> ++ string(1) "1" ++ } ++} ++array(2) { ++ ["redirect"]=> ++ string(1) "3" ++ ["ssl"]=> ++ array(2) { ++ ["version"]=> ++ string(1) "3" ++ ["verifyhost"]=> ++ string(1) "1" ++ } ++} ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequest_004.phpt +@@ -0,0 +1,162 @@ ++--TEST-- ++HttpRequest multiple posts ++--SKIPIF-- ++ ++--FILE-- ++ 1, 'dbl' => M_PI), ++ array('str' => 'something', 'nil' => null) ++); ++ ++echo "\nFirst Request\n"; ++$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_POST); ++$r->setPostFields($fields[0]); ++$r->addPostFields($fields[1]); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nSecond Request\n"; ++$r->setPostFields($fields); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nThird Request\n"; ++$r->addPostFields(array('x' => 'X')); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "\nFourth Request\n"; ++$r->setPostFields(array()); ++var_dump($r->send()->getBody()); ++var_dump($fields); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++ ++First Request ++string(%d) "Array ++( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ [str] => something ++ [nil] => ++) ++string(44) "int=1&dbl=3.1415926535898&str=something&nil=" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Second Request ++string(%d) "Array ++( ++ [0] => Array ++ ( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ ) ++ ++ [1] => Array ++ ( ++ [str] => something ++ [nil] => ++ ) ++ ++) ++string(72) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Third Request ++string(%d) "Array ++( ++ [0] => Array ++ ( ++ [int] => 1 ++ [dbl] => 3.1415926535898 ++ ) ++ ++ [1] => Array ++ ( ++ [str] => something ++ [nil] => ++ ) ++ ++ [x] => X ++) ++string(76) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=&x=X" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++ ++Fourth Request ++string(13) "string(0) "" ++" ++array(2) { ++ [0]=> ++ array(2) { ++ ["int"]=> ++ int(1) ++ ["dbl"]=> ++ float(3.1415926535898) ++ } ++ [1]=> ++ array(2) { ++ ["str"]=> ++ string(9) "something" ++ ["nil"]=> ++ NULL ++ } ++} ++Done ++ +--- /dev/null ++++ b/ext/http/tests/HttpRequest_005.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpRequest accessors ++--SKIPIF-- ++ ++--FILE-- ++ 3 && substr($method, 0, 3) == 'get') ++ $x = $r->$method(); ++ } catch (HttpException $e) { ++ } ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_006.phpt +@@ -0,0 +1,147 @@ ++--TEST-- ++HttpRequest XMLRPC ++--SKIPIF-- ++ ++--FILE-- ++setContentType('text/xml'); ++$r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar'))); ++var_dump($r->send()); ++var_dump($r->send()); ++var_dump($r->send()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++object(HttpMessage)#%d (%d) { ++ ["type:protected"]=> ++ int(2) ++ ["body:protected"]=> ++ string(309) "string(294) " ++ ++testMethod ++ ++ ++ ++ ++ ++ foo ++ ++ bar ++ ++ ++ ++ ++ ++ ++ ++" ++" ++ ["requestMethod:protected"]=> ++ string(0) "" ++ ["requestUrl:protected"]=> ++ string(0) "" ++ ["responseStatus:protected"]=> ++ string(2) "OK" ++ ["responseCode:protected"]=> ++ int(200) ++ ["httpVersion:protected"]=> ++ float(1.1) ++ ["headers:protected"]=> ++ array(6) { ++ %a ++ } ++ ["parentMessage:protected"]=> ++ NULL ++} ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_007.phpt +@@ -0,0 +1,64 @@ ++--TEST-- ++HttpRequest PUT ++--SKIPIF-- ++ ++--FILE-- ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1 ++User-Agent: PECL::HTTP/%a ++Host: dev.iworks.at ++Accept: */* ++Content-Type: text/plain ++Content-Length: %d ++Expect: 100-continue ++ ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++ ++HTTP/1.1 100 Continue ++HTTP/1.1 200 OK ++Date: %a ++Server: %a ++X-Powered-By: %a ++Vary: Accept-Encoding ++Content-Length: %d ++Content-Type: text/html ++ ++recordHistory = true; ++$r->addHeaders(array('content-type' => 'text/plain')); ++$r->setPutFile(__FILE__); ++$r->send(); ++var_dump($r->getHistory()->toString(true)); ++echo "Done\n"; ++?> ++ ++" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_008.phpt +@@ -0,0 +1,32 @@ ++--TEST-- ++HttpRequest custom request method ++--SKIPIF-- ++ ++--FILE-- ++setContentType('text/plain'); ++$r->setBody('Yep, this is FOOBAR!'); ++var_dump($r->send()->getResponseCode()); ++var_dump($r->getRawRequestMessage()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++int(200) ++string(%d) "FOOBAR /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Content-Type: text/plain ++Content-Length: 20 ++ ++Yep, this is FOOBAR!" ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_009.phpt +@@ -0,0 +1,48 @@ ++--TEST-- ++HttpRequest callbacks ++--SKIPIF-- ++ ++--FILE-- ++getResponseCode()); ++ } ++} ++ ++$r = new _R('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); ++$r->addPostFile('upload', __FILE__, 'text/plain'); ++$r->send(); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Array ++( ++ [dltotal] => %f ++ [dlnow] => %f ++ [ultotal] => %f ++ [ulnow] => %f ++) ++%array ++( ++ [dltotal] => %f ++ [dlnow] => %f ++ [ultotal] => %f ++ [ulnow] => %f ++) ++int(200) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpRequest_010.phpt +@@ -0,0 +1,48 @@ ++--TEST-- ++HttpRequest cookie API ++--SKIPIF-- ++ ++--FILE-- ++send(); ++$c[0] = $r->getResponseInfo("cookies"); ++if (!empty($c[0])) { ++ var_dump('$c[0]', $c[0]); ++} ++ ++var_dump($r->enableCookies()); ++$r->send(); ++ ++$c[1] = $r->getResponseInfo("cookies"); ++if (empty($c[1])) { ++ var_dump('$c[1]', $c[1]); ++} ++ ++var_dump($r->resetCookies()); ++$r->send(); ++ ++$c[2] = $r->getResponseInfo("cookies"); ++if ($c[1] === $c[2]) { ++ var_dump('$c[1]', $c[1], '$c[2]', $c[2]); ++} ++ ++$r->send(); ++$c[3] = $r->getResponseInfo("cookies"); ++if ($c[2] !== $c[3]) { ++ var_dump('$c[2]', $c[2], '$c[3]', $c[3]); ++} ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/HttpResponse_001.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++HttpResponse - send data with caching headers ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %a, %d %a 20%d %d:%d:%d GMT ++Content-Type: %a ++Accept-Ranges: bytes ++ETag: "3858f62230ac3c915f300c664312c63f" ++Content-Length: 6 ++ ++foobar +--- /dev/null ++++ b/ext/http/tests/HttpResponse_002.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++HttpResponse - send gzipped file ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Content-Type: %a ++Accept-Ranges: bytes ++Content-Encoding: gzip ++Vary: Accept-Encoding ++ ++%a +--- /dev/null ++++ b/ext/http/tests/HttpResponse_003.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++HttpResponse - send gzipped file with caching headers ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %a, %d %a 20%d %d:%d:%d GMT ++Content-Type: %a ++Accept-Ranges: bytes ++ETag: "%a" ++Content-Encoding: gzip ++Vary: Accept-Encoding ++ ++%a +--- /dev/null ++++ b/ext/http/tests/HttpResponse_004.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++HttpResponse - send cached gzipped data ++--SKIPIF-- ++ ++--ENV-- ++HTTP_IF_NONE_MATCH="900150983cd24fb0d6963f7d28e17f72" ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++Status: 304%s ++X-Powered-By: PHP/%s ++Cache-Control: public, must-revalidate, max-age=3600 ++Last-Modified: %s ++Accept-Ranges: bytes ++ETag: "900150983cd24fb0d6963f7d28e17f72" +--- /dev/null ++++ b/ext/http/tests/HttpResponse_005.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++HttpResponse file not found ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++Status: 404%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++ ++File not found +--- /dev/null ++++ b/ext/http/tests/allowed_methods_002.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++allowed methods ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++Status: 405%s ++X-Powered-By: PHP/%a ++Allow: POST ++Content-type: %a ++ +--- /dev/null ++++ b/ext/http/tests/allowed_methods_002_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging allowed methods ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [405-ALLOWED] Allow: POST <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/bug_15800.phpt +@@ -0,0 +1,49 @@ ++--TEST-- ++Bug #15800 Double free when zval is separated in convert_to_* ++--SKIPIF-- ++ ++--FILE-- ++ array('verifypeer'=>'1')); ++debug_zval_dump($o); ++ ++$r = new HttpRequest('http://www.google.com'); ++$r->setOptions($o); ++$r->send(); ++debug_zval_dump($o); ++ ++unset($r); ++debug_zval_dump($o); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(1) ++ } ++} ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(2) ++ } ++} ++array(1) refcount(2){ ++ ["ssl"]=> ++ array(1) refcount(1){ ++ ["verifypeer"]=> ++ string(1) "1" refcount(1) ++ } ++} ++Done +--- /dev/null ++++ b/ext/http/tests/build_str_001.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_build_str ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++a=b ++a=b&c%5B0%5D=1 ++a=b&c%5B0%5D=1&d%5Be%5D=f ++foo%5B0%5D=1&foo%5B1%5D=2&foo%5B2%5D%5B0%5D=3 ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_001.phpt +@@ -0,0 +1,18 @@ ++--TEST-- ++http_build_url() with relative paths ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++http://%a/page ++http://%a/with/some/path/ ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_002.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_build_url() with parse_url() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++https://www.example.com:9999/replaced?q=1#n ++https://www.example.com:9999/replaced?q=1#n ++Array ++( ++ [scheme] => https ++ [host] => www.example.com ++ [port] => 9999 ++ [path] => /replaced ++ [query] => q=1 ++ [fragment] => n ++) ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_003.phpt +@@ -0,0 +1,26 @@ ++--TEST-- ++http_build_url() ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=www.example.com ++--FILE-- ++ 'https'))); ++printf("-%s-\n", http_build_url($url, array('scheme' => 'https', 'host' => 'ssl.example.com'))); ++printf("-%s-\n", http_build_url($url, array('scheme' => 'ftp', 'host' => 'ftp.example.com', 'port' => 21))); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++-http://www.example.com/path/?query#anchor- ++-https://www.example.com/path/?query#anchor- ++-https://ssl.example.com/path/?query#anchor- ++-ftp://ftp.example.com/path/?query#anchor- ++Done +--- /dev/null ++++ b/ext/http/tests/build_url_004.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_build_url flags ++--SKPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++http://www.example.com/foo/baz ++http://www.example.com/foo/baz ++http://mike@www.example.com/foo/baz ++http://www.example.com/?a%5B0%5D=1&a%5B1%5D=b&b=c ++Done +--- /dev/null ++++ b/ext/http/tests/chunked_decode_001.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++http_chunked_decode() "\r\n" ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(12) "abra ++cadabra" ++ +--- /dev/null ++++ b/ext/http/tests/chunked_decode_002.phpt +@@ -0,0 +1,25 @@ ++--TEST-- ++http_chunked_decode() "\n" ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(12) "abra ++cadabra" ++ +--- /dev/null ++++ b/ext/http/tests/chunked_decode_003.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_chunked_decode() truncated message ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%aWarning%ahttp_chunked_decode()%aTruncated message: chunk size 255 exceeds remaining data size 12 at pos 34 of 46 in%a ++string(24) "abra ++cadabra ++all we got ++" +--- /dev/null ++++ b/ext/http/tests/chunked_decode_004.phpt +@@ -0,0 +1,26 @@ ++--TEST-- ++http_chunked_decode() truncated message ending with NUL after a chunk ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(24) "abra ++cadabra ++all we got ++" +--- /dev/null ++++ b/ext/http/tests/cloning_001.phpt +@@ -0,0 +1,29 @@ ++--TEST-- ++cloning ++--SKIPIF-- ++ ++--FILE-- ++setOptions(array('redirect' => 3)); ++var_dump($r1->getOptions() == $r2->getOptions()); ++$r1->setUrl('http://www.google.com/'); ++var_dump($r1->getUrl() == $r2->getUrl()); ++$r1->send(); ++var_dump($r1->getResponseInfo() == $r2->getResponseInfo()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(false) ++bool(false) ++bool(false) ++Done +--- /dev/null ++++ b/ext/http/tests/data.txt +@@ -0,0 +1,10 @@ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/date_001.phpt +@@ -0,0 +1,17 @@ ++--TEST-- ++http_date() with timestamp ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Thu, 01 Jan 1970 00:00:01 GMT ++Fri, 13 Feb 2009 23:31:30 GMT ++ +--- /dev/null ++++ b/ext/http/tests/date_002.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++http_date() without timestamp ++--SKIPIF-- ++ ++--FILE-- ++ 1); ++echo "$t\n$d\nDone\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++%d ++%a, %d %a %d %d:%d:%d GMT ++Done +--- /dev/null ++++ b/ext/http/tests/encoding_objects_001.phpt +@@ -0,0 +1,35 @@ ++--TEST-- ++encoding stream objects ++--SKIPIF-- ++ ++--FILE-- ++flush($d->flush("Hi ")); ++echo $i->finish($d->finish("there!\n")); ++echo $i->finish($d->finish("Yo...\n")); ++ ++$id = $i->update($d->update($pd = file_get_contents(__FILE__))); ++foreach (glob('*.phpt') as $f) { ++ $id .= $i->update($d->update($tmp = file_get_contents($f))); ++ $pd .= $tmp; ++} ++$id .= $i->finish($d->finish()); ++ ++var_dump($id == $pd); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++Hi there! ++Yo... ++bool(true) ++Done ++ +--- /dev/null ++++ b/ext/http/tests/encodings.phpt +@@ -0,0 +1,44 @@ ++--TEST-- ++encodings ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/etag_mode_031.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++crc32 etag (may fail because PHPs crc32 is actually crc32b) ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "4e818847" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_032.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++sha1 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "03cfd743661f07975fa2f1220c5194cbaff48451" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_033.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++md5 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "0bee89b07a248e27c83fc3d5951213c1" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_034.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++ext/hash etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++Accept-Ranges: bytes ++ETag: "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb" ++Content-Length: 4 ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_041.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob crc32 etag (may fail because PHPs crc32 is actually crc32b) ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "4e818847" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_042.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob sha1 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "03cfd743661f07975fa2f1220c5194cbaff48451" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_043.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++ob md5 etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "0bee89b07a248e27c83fc3d5951213c1" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/etag_mode_044.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++ob ext/hash etag ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%a ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb" ++Content-type: %a ++ ++abc +--- /dev/null ++++ b/ext/http/tests/exceptions.phpt +@@ -0,0 +1,53 @@ ++--TEST-- ++exceptions ++--SKIPIF-- ++ ++--FILE-- ++ 'Runtime', ++ HTTP_E_INVALID_PARAM => 'InvalidParam', ++ HTTP_E_HEADER => 'Header', ++ HTTP_E_MALFORMED_HEADERS => 'MalformedHeaders', ++ HTTP_E_REQUEST_METHOD => 'RequestMethod', ++ HTTP_E_MESSAGE_TYPE => 'MessageType', ++ HTTP_E_ENCODING => 'Encoding', ++ HTTP_E_REQUEST => 'Request', ++ HTTP_E_REQUEST_POOL => 'RequestPool', ++ HTTP_E_SOCKET => 'Socket', ++ HTTP_E_RESPONSE => 'Response', ++ HTTP_E_URL => 'Url', ++); ++ ++foreach ($e as $i => $c) { ++ try { ++ $n = "Http{$c}Exception"; ++ throw new $n; ++ } catch (HttpException $x) { ++ printf("%2d: %s\n", $i, get_class($x)); ++ } ++} ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++ 1: HttpRuntimeException ++ 2: HttpInvalidParamException ++ 3: HttpHeaderException ++ 4: HttpMalformedHeadersException ++ 5: HttpRequestMethodException ++ 6: HttpMessageTypeException ++ 7: HttpEncodingException ++ 8: HttpRequestException ++ 9: HttpRequestPoolException ++10: HttpSocketException ++11: HttpResponseException ++12: HttpUrlException ++Done +--- /dev/null ++++ b/ext/http/tests/get_request_data_001.phpt +@@ -0,0 +1,40 @@ ++--TEST-- ++get request data ++--SKIPIF-- ++ ++--POST-- ++a=b&c=d ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Array ++( ++ [Accept-Charset] => iso-8859-1, * ++ [Accept-Encoding] => none ++ [Host] => localhost ++ [User-Agent] => Mozilla/5.0 ++) ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++string(7) "a=b&c=d" ++Done +--- /dev/null ++++ b/ext/http/tests/log.inc +@@ -0,0 +1,23 @@ ++ +--- /dev/null ++++ b/ext/http/tests/match_request_header_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_match_request_header() ++--SKIPIF-- ++ ++--ENV-- ++HTTP_FOO=bar ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(false) ++Done +--- /dev/null ++++ b/ext/http/tests/negotiation_001.phpt +@@ -0,0 +1,64 @@ ++--TEST-- ++negotiation ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8 ++HTTP_ACCEPT_LANGUAGE=de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2 ++HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(2) "de" ++string(2) "de" ++string(10) "iso-8859-1" ++string(10) "iso-8859-1" ++string(21) "application/xhtml+xml" ++string(21) "application/xhtml+xml" ++string(7) "unknown" ++string(7) "unknown" ++string(7) "unknown" ++Array ++( ++ [de] => 900 ++ [en] => 0.27 ++) ++Array ++( ++ [iso-8859-1] => 1000 ++ [utf-8] => 0.7 ++) ++Array ++( ++ [application/xhtml+xml] => 999 ++ [text/html] => 0.8 ++) ++Done +--- /dev/null ++++ b/ext/http/tests/ob_deflatehandler_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++ob_deflatehandler ++--SKIPIF-- ++ ++--ENV-- ++HTTP_ACCEPT_ENCODING=gzip ++--FILE-- ++ ++--EXPECTF-- ++%a ++Content-Encoding: gzip ++Vary: Accept-Encoding ++%a ++ +--- /dev/null ++++ b/ext/http/tests/ob_inflatehandler_001.phpt +@@ -0,0 +1,16 @@ ++--TEST-- ++ob_inflatehandler ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++ +--- /dev/null ++++ b/ext/http/tests/parse_cookie_001.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++parse cookie ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["cookies"]=> ++ array(3) { ++ ["name"]=> ++ string(5) "value" ++ ["foo"]=> ++ string(7) "bar"baz" ++ ["hey"]=> ++ string(6) "got"it" ++ } ++ ["extras"]=> ++ array(1) { ++ ["comment"]=> ++ string(0) "" ++ } ++ ["flags"]=> ++ int(32) ++ ["expires"]=> ++ int(1) ++ ["path"]=> ++ string(1) "/" ++ ["domain"]=> ++ string(0) "" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/parse_cookie_002.phpt +@@ -0,0 +1,80 @@ ++--TEST-- ++parse cookie ++--SKIPIF-- ++ ++--FILE-- ++cookies['foo']); ++var_dump(http_parse_cookie('foo;')->cookies['foo']); ++var_dump(http_parse_cookie('foo ')->cookies['foo']); ++var_dump(http_parse_cookie('foo ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo ; ')->cookies['foo']); ++var_dump(http_parse_cookie('foo=')->cookies['foo']); ++var_dump(http_parse_cookie('foo=;')->cookies['foo']); ++var_dump(http_parse_cookie('foo =')->cookies['foo']); ++var_dump(http_parse_cookie('foo =;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= ')->cookies['foo']); ++var_dump(http_parse_cookie('foo= ;')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo=1')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1 ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= 1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo = 1;')->cookies['foo']); ++var_dump(http_parse_cookie('foo = 1 ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo=1')->cookies['foo']); ++var_dump(http_parse_cookie('foo= 1')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo="1"')->cookies['foo']); ++var_dump(http_parse_cookie('foo="1" ')->cookies['foo']); ++var_dump(http_parse_cookie('foo="1";')->cookies['foo']); ++var_dump(http_parse_cookie('foo = "1" ;')->cookies['foo']); ++var_dump(http_parse_cookie('foo= "1" ')->cookies['foo']); ++ ++var_dump(http_parse_cookie('foo=""')->cookies['foo']); ++var_dump(http_parse_cookie('foo="\""')->cookies['foo']); ++var_dump(http_parse_cookie('foo=" "')->cookies['foo']); ++var_dump(http_parse_cookie('foo= "')->cookies['foo']); ++var_dump(http_parse_cookie('foo=" ')->cookies['foo']); ++var_dump(http_parse_cookie('foo= " ')->cookies['foo']); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(0) "" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(1) "1" ++string(0) "" ++string(1) """ ++string(1) " " ++string(1) """ ++string(1) """ ++string(1) """ ++Done +--- /dev/null ++++ b/ext/http/tests/parse_headers_001.phpt +@@ -0,0 +1,41 @@ ++--TEST-- ++http_parse_headers() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++Array ++( ++ [Host] => Array ++ ( ++ [0] => localhost ++ [1] => ambigious ++ ) ++ ++ [Nospace] => here ++ [Muchspace] => there ++ [Empty] => ++ [Empty2] => ++ [Folded] => one ++ two ++ three ++) ++ +--- /dev/null ++++ b/ext/http/tests/parse_message_001.phpt +@@ -0,0 +1,18 @@ ++--TEST-- ++http_parse_message() ++--SKIPIF-- ++ ++--FILE-- ++body; ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++%aThe document has moved%a ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_002.phpt +@@ -0,0 +1,39 @@ ++--TEST-- ++identity encoding trap ++--SKIPIF-- ++ ++--FILE-- ++ 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 200 ++ [responseStatus] => Ok ++ [headers] => Array ++ ( ++ [Transfer-Encoding] => identity ++ [Content-Length] => 3 ++ [Content-Type] => text/plain ++ ) ++ ++ [body] => Hi! ++ [parentMessage] => ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_003.phpt +@@ -0,0 +1,31 @@ ++--TEST-- ++content range message ++--SKIPIF-- ++ ++--FILE-- ++body); ++ ++$message = ++"HTTP/1.1 200 Ok\n". ++"Content-Range: bytes 0-1/1\n\n". ++"X\n"; ++ ++$msg = http_parse_message($message); ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++string(2) "OK" ++%a Invalid Content-Range header: bytes 0-1/1 in%a ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_004.phpt +@@ -0,0 +1,115 @@ ++--TEST-- ++http_parse_message() recursive ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "Ok" ++ ["headers"]=> ++ array(2) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ ["Content-Length"]=> ++ string(2) "10" ++ } ++ ["body"]=> ++ string(10) "1234567890" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(1) ++ ["httpVersion"]=> ++ float(1.1) ++ ["requestMethod"]=> ++ string(3) "GET" ++ ["requestUrl"]=> ++ string(1) "/" ++ ["headers"]=> ++ array(2) { ++ ["Host"]=> ++ string(15) "www.example.com" ++ ["Accept"]=> ++ string(3) "*/*" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "Ok" ++ ["headers"]=> ++ array(2) { ++ ["Server"]=> ++ string(9) "Funky/1.0" ++ ["Content-Length"]=> ++ string(2) "10" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ object(stdClass)%a { ++ ["type"]=> ++ int(1) ++ ["httpVersion"]=> ++ float(1.1) ++ ["requestMethod"]=> ++ string(4) "HEAD" ++ ["requestUrl"]=> ++ string(1) "/" ++ ["headers"]=> ++ array(2) { ++ ["Host"]=> ++ string(15) "www.example.com" ++ ["Accept"]=> ++ string(3) "*/*" ++ } ++ ["body"]=> ++ string(0) "" ++ ["parentMessage"]=> ++ NULL ++ } ++ } ++ } ++} ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_005.phpt +@@ -0,0 +1,60 @@ ++--TEST-- ++http_parse_message() content range header w/(o) = ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++stdClass Object ++( ++ [type] => 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 206 ++ [responseStatus] => ++ [headers] => Array ++ ( ++ [Server] => Funky/1.0 ++ [Content-Range] => bytes 0-0/100 ++ ) ++ ++ [body] => 1 ++ [parentMessage] => stdClass Object ++ ( ++ [type] => 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 206 ++ [responseStatus] => ++ [headers] => Array ++ ( ++ [Server] => Funky/1.0 ++ [Content-Range] => bytes: 0-0/100 ++ ) ++ ++ [body] => 1 ++ [parentMessage] => ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_message_006.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++mixed EOL trap ++--SKIPIF-- ++ ++--FILE-- ++ 2 ++ [httpVersion] => 1.1 ++ [responseCode] => 200 ++ [responseStatus] => Ok ++ [headers] => Array ++ ( ++ [Header] => Value ++ [Connection] => close ++ ) ++ ++ [body] => Bug! ++ [parentMessage] => ++) ++Done +--- /dev/null ++++ b/ext/http/tests/parse_params_001.phpt +@@ -0,0 +1,75 @@ ++--TEST-- ++http_parse_params ++--SKIPIF-- ++ ++--FILE-- ++params[0]); ++$p = http_parse_params('a=b'); var_dump($p->params[0]); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(9) "text/html" ++ [1]=> ++ array(1) { ++ ["charset"]=> ++ string(10) "iso-8859-1" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(9) "text/html" ++ [1]=> ++ array(1) { ++ ["charset"]=> ++ string(10) "iso-8859-1" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(2) { ++ [0]=> ++ string(10) "attachment" ++ [1]=> ++ array(1) { ++ ["filename"]=> ++ string(13) "gol;got,a.ext" ++ } ++ } ++} ++object(stdClass)%a { ++ ["params"]=> ++ array(3) { ++ [0]=> ++ string(6) "public" ++ [1]=> ++ string(15) "must-revalidate" ++ [2]=> ++ array(1) { ++ ["max-age"]=> ++ string(1) "0" ++ } ++ } ++} ++string(1) "a" ++array(1) { ++ ["a"]=> ++ string(1) "b" ++} ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_001.phpt +@@ -0,0 +1,91 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++var_dump(http_persistent_handles_count()->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare_lock] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_pool] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_002.phpt +@@ -0,0 +1,83 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++$h = http_persistent_handles_count(); ++var_dump($h->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_datashare] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++ [http_request_pool] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/persistent_handles_003.phpt +@@ -0,0 +1,62 @@ ++--TEST-- ++persistent handles ++--SKIPIF-- ++ ++--INI-- ++http.persistent.handles.limit=-1 ++http.persistent.handles.ident=GLOBAL ++--FILE-- ++ $idents) { ++ foreach ((array)$idents as $ident => $counts) { ++ if (!empty($counts["free"])) { ++ printf("%a, %a, %a\n", $provider, $ident, $counts["free"]); ++ } ++ } ++} ++ ++http_get("http://www.google.com/", null, $info[]); ++ ++echo "One free request handle within GLOBAL: "; ++$h = http_persistent_handles_count(); ++var_dump($h->http_request["GLOBAL"]["free"]); ++ ++echo "Reusing request handle: "; ++http_get("http://www.google.com/", null, $info[]); ++var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); ++ ++echo "Handles' been cleaned up:\n"; ++http_persistent_handles_clean(); ++print_r(http_persistent_handles_count()); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++No free handles! ++One free request handle within GLOBAL: int(1) ++Reusing request handle: bool(true) ++float(%f) ++float(%f) ++Handles' been cleaned up: ++stdClass Object ++( ++ [http_request] => Array ++ ( ++ [GLOBAL] => Array ++ ( ++ [used] => 0 ++ [free] => 0 ++ ) ++ ++ ) ++ ++) ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_011.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_redirect() with params ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ 1, 'b' => 2)); ++?> ++--EXPECTF-- ++Status: 302%s ++X-Powered-By: PHP/%a ++Location: http://localhost/redirect?a=1&b=2 ++Content-type: %a ++ ++Redirecting to http://localhost/redirect?a=1&b=2. ++ +--- /dev/null ++++ b/ext/http/tests/redirect_011_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_012.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_redirect() with session ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ 1), true); ++?> ++--EXPECTF-- ++Status: 302%s ++X-Powered-By: PHP/%a ++Set-Cookie: PHPSESSID=%a; path=/ ++Expires: %a ++Cache-Control: %a ++Pragma: %a ++Location: http://localhost/redirect?a=1&PHPSESSID=%a ++Content-type: %a +--- /dev/null ++++ b/ext/http/tests/redirect_012_logging.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/redirect_013.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_redirect() permanent ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=localhost ++--FILE-- ++ ++--EXPECTF-- ++Status: 301%s ++X-Powered-By: PHP/%a ++Location: http://localhost/redirect ++Content-type: %a ++ ++Redirecting to http://localhost/redirect. ++ +--- /dev/null ++++ b/ext/http/tests/redirect_013_logging.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++logging redirects ++--SKIPIF-- ++ ++--ENV-- ++HTTP_HOST=example.com ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [301-REDIRECT] Location: http%a <%a> ++Done +--- /dev/null ++++ b/ext/http/tests/request_cookies.phpt +@@ -0,0 +1,52 @@ ++--TEST-- ++urlencoded cookies ++--SKIPIF-- ++ ++--FILE-- ++ "val=ue"); ++ ++$r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies)); ++$r->recordHistory = true; ++$r->send(); ++$r->setOptions(array('encodecookies' => false)); ++$r->send(); ++echo $r->getHistory()->toString(true); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++GET /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Cookie: name=val%3Due ++HTTP/1.1 200 OK ++%a ++ ++Array ++( ++ [name] => val=ue ++) ++ ++GET /ext-http/.print_request.php HTTP/1.1 ++User-Agent: %a ++Host: dev.iworks.at ++Accept: */* ++Cookie: name=val=ue; ++HTTP/1.1 200 OK ++%a ++ ++Array ++( ++ [name] => val=ue ++) ++ ++Done +--- /dev/null ++++ b/ext/http/tests/request_etag.phpt +@@ -0,0 +1,21 @@ ++--TEST-- ++request etag ++--SKIPIF-- ++ ++--FILE-- ++ '"26ad3a-5-95eb19c0"'))); ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++string(%d) "HTTP/1.1 304 Not Modified ++Date: %a ++Server: %a ++ETag: "26ad3a-5-95eb19c0" ++" ++Done +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/request_gzip.phpt +@@ -0,0 +1,51 @@ ++--TEST-- ++GZIP request ++--SKIPIF-- ++ ++--FILE-- ++ true)))); ++ ++echo "Done\n"; ++--EXPECTF-- ++%aTEST ++object(stdClass)%a { ++ ["type"]=> ++ int(2) ++ ["httpVersion"]=> ++ float(1.1) ++ ["responseCode"]=> ++ int(200) ++ ["responseStatus"]=> ++ string(2) "OK" ++ ["headers"]=> ++ array(8) { ++ %a ++ ["Vary"]=> ++ string(15) "Accept-Encoding" ++ ["Content-Length"]=> ++ string(2) "26" ++ ["Content-Type"]=> ++ string(9) "text/html" ++ ["X-Original-Content-Encoding"]=> ++ string(4) "gzip" ++ ["X-Original-Content-Length"]=> ++ string(2) "51" ++ } ++ ["body"]=> ++ string(26) "Array ++( ++ [gzip] => 1 ++) ++" ++ ["parentMessage"]=> ++ NULL ++} ++Done ++ +--- /dev/null ++++ b/ext/http/tests/request_methods.phpt +@@ -0,0 +1,144 @@ ++--TEST-- ++request methods ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++int(0) ++UNKNOWN ++int(0) ++int(1) ++GET ++int(1) ++int(2) ++HEAD ++int(2) ++int(3) ++POST ++int(3) ++int(4) ++PUT ++int(4) ++int(5) ++DELETE ++int(5) ++int(6) ++OPTIONS ++int(6) ++int(7) ++TRACE ++int(7) ++int(8) ++CONNECT ++int(8) ++int(9) ++PROPFIND ++int(9) ++int(10) ++PROPPATCH ++int(10) ++int(11) ++MKCOL ++int(11) ++int(12) ++COPY ++int(12) ++int(13) ++MOVE ++int(13) ++int(14) ++LOCK ++int(14) ++int(15) ++UNLOCK ++int(15) ++int(16) ++VERSION-CONTROL ++int(16) ++int(17) ++REPORT ++int(17) ++int(18) ++CHECKOUT ++int(18) ++int(19) ++CHECKIN ++int(19) ++int(20) ++UNCHECKOUT ++int(20) ++int(21) ++MKWORKSPACE ++int(21) ++int(22) ++UPDATE ++int(22) ++int(23) ++LABEL ++int(23) ++int(24) ++MERGE ++int(24) ++int(25) ++BASELINE-CONTROL ++int(25) ++int(26) ++MKACTIVITY ++int(26) ++int(27) ++ACL ++int(27) ++int(0) ++UNKNOWN ++int(0) ++int(28) ++int(28) ++int(29) ++int(29) ++int(30) ++int(30) ++int(31) ++int(31) ++int(32) ++int(32) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++bool(true) ++int(0) ++int(0) ++Done +--- /dev/null ++++ b/ext/http/tests/request_put_data.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_put_data() ++--SKIPIF-- ++ ++--FILE-- ++ CURLBUF_SIZE */); ++$resp = http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", $data); ++$mess = http_parse_message($resp); ++var_dump($data === $mess->body); ++ ++echo "Done\n"; ++?> ++--EXPECTF-- ++%aTEST ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/send_data_001.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NIL-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-5 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5995-5999/6000 ++Content-Length: 5 ++ ++23abc +--- /dev/null ++++ b/ext/http/tests/send_data_002.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NUM-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5-6 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5-6/6000 ++Content-Length: 2 ++ ++c1 +--- /dev/null ++++ b/ext/http/tests/send_data_003.phpt +@@ -0,0 +1,24 @@ ++--TEST-- ++http_send_data() NUM-NIL range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5981- ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Range: bytes 5981-5999/6000 ++Content-Length: 19 ++ ++c123abc123abc123abc +--- /dev/null ++++ b/ext/http/tests/send_data_004.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_send_data() syntactically invalid range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=123,-wtf ? ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Content-Type: text/plain ++Accept-Ranges: bytes ++Content-Length: 6000 ++ ++123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/send_data_005.phpt +@@ -0,0 +1,17 @@ ++--TEST-- ++http_send_data() oversized range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5990-6000 ++--FILE-- ++ ++--EXPECTF-- ++Status: 416%a +\ No newline at end of file +--- /dev/null ++++ b/ext/http/tests/send_data_006.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++http_send_data() multiple ranges ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-3, 4-5,9-11 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Type: multipart/byteranges; boundary=%d.%d ++ ++ ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 0-3/6000 ++ ++123a ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 4-5/6000 ++ ++bc ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 9-11/6000 ++ ++abc ++--%d.%d-- +--- /dev/null ++++ b/ext/http/tests/send_data_010.phpt +@@ -0,0 +1,20 @@ ++--TEST-- ++http_send_data() HTTP_SENDBUF_SIZE long string ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 20 ++Content-type: %s ++ ++00000000000000000000 +--- /dev/null ++++ b/ext/http/tests/send_data_011.phpt +@@ -0,0 +1,22 @@ ++--TEST-- ++http_send_data() last modified caching ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Cache-Control: private, must-revalidate, max-age=0 ++Last-Modified: %s, %d %s %d %d:%d:%d GMT ++Accept-Ranges: bytes ++Content-Length: 4 ++Content-type: %s ++ ++abc +--- /dev/null ++++ b/ext/http/tests/send_failed_precond_001.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send() failed precondition ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_UNMODIFIED_SINCE=Thu, 01 Jan 1970 00:16:40 GMT ++--FILE-- ++ ++--EXPECTF-- ++Status: 412%s ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++Last-Modified: %s ++Accept-Ranges: bytes ++Content-type: text/html +--- /dev/null ++++ b/ext/http/tests/send_file_005.phpt +@@ -0,0 +1,38 @@ ++--TEST-- ++http_send_file() multiple ranges ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-3, 4-5,9-11 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Type: multipart/byteranges; boundary=%d.%d ++ ++ ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 0-3/1010 ++ ++0123 ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 4-5/1010 ++ ++45 ++--%d.%d ++Content-Type: text/plain ++Content-Range: bytes 9-11/1010 ++ ++901 ++--%d.%d-- +--- /dev/null ++++ b/ext/http/tests/send_file_008.phpt +@@ -0,0 +1,28 @@ ++--TEST-- ++http_send_file() ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 1010 ++Content-type: %s ++ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_009.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NUM-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=5-9 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 5-9/1010 ++Content-Length: 5 ++Content-type: %s ++ ++56789 +--- /dev/null ++++ b/ext/http/tests/send_file_010.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NIL-NUM range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-9 ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 1001-1009/1010 ++Content-Length: 9 ++Content-type: %s ++ ++23456789 +--- /dev/null ++++ b/ext/http/tests/send_file_011.phpt +@@ -0,0 +1,23 @@ ++--TEST-- ++http_send_file() NUM-NIL range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=1000- ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Range: bytes 1000-1009/1010 ++Content-Length: 10 ++Content-type: %s ++ ++123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_012.phpt +@@ -0,0 +1,30 @@ ++--TEST-- ++http_send_file() syntactically invalid range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=xxx ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-Length: 1010 ++Content-type: %s ++ ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ++0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +--- /dev/null ++++ b/ext/http/tests/send_file_013.phpt +@@ -0,0 +1,19 @@ ++--TEST-- ++http_send_file() oversized range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=-1111 ++--FILE-- ++ ++--EXPECTF-- ++Status: 416 ++X-Powered-By: PHP/%s ++Accept-Ranges: bytes ++Content-type: %s +--- /dev/null ++++ b/ext/http/tests/send_ifrange_001.phpt +@@ -0,0 +1,27 @@ ++--TEST-- ++http_send() If-Range ++--SKIPIF-- ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_RANGE="abc" ++--FILE-- ++ ++--EXPECTF-- ++Status: 206%s ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "abc" ++Accept-Ranges: bytes ++Content-Range: bytes 0-1/%d ++Content-Length: 2 ++Content-type: text/html ++ ++ ++--ENV-- ++HTTP_RANGE=bytes=0-1 ++HTTP_IF_RANGE="abcd" ++--FILE-- ++ ++--EXPECTF-- ++X-Powered-By: %s ++Cache-Control: private, must-revalidate, max-age=0 ++ETag: "abc" ++Accept-Ranges: bytes ++Content-Length: %d ++Content-type: text/html ++ ++%a +--- /dev/null ++++ b/ext/http/tests/skip.inc +@@ -0,0 +1,15 @@ ++= v%s",$ver)); } ++function checkmax($ver) { skipif(version_compare(PHP_VERSION, $ver) > 0, sprintf("need PHP <= v%s",$ver)); } ++function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); } ++function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); } ++function checkver($ver) { checkmin($ver); } ++checkext('http'); ++?> +--- /dev/null ++++ b/ext/http/tests/stream_filters_001.phpt +@@ -0,0 +1,45 @@ ++--TEST-- ++stream filters ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++string(30) "5 ++Here ++2 ++we ++5 ++ go! ++ ++0 ++" ++string(12) "Here we go! ++" ++Done +--- /dev/null ++++ b/ext/http/tests/stream_filters_002.phpt +@@ -0,0 +1,50 @@ ++--TEST-- ++gzip stream filters ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++bool(true) ++bool(true) ++bool(true) ++Done +--- /dev/null ++++ b/ext/http/tests/stream_filters_003.phpt +@@ -0,0 +1,42 @@ ++--TEST-- ++stream filter fun ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECTF-- ++%aTEST ++This is some stream filter fun; we'll see if it bails out or not. ++The text should come out at the other end of the stream exactly like written to it. ++Go figure! +--- /dev/null ++++ b/ext/http/tests/urls.txt +@@ -0,0 +1,49 @@ ++http://www.microsoft.com ++http://www.opensource.org ++http://www.google.com ++http://www.yahoo.com ++http://www.ibm.com ++http://www.mysql.com ++http://www.oracle.com ++http://www.ripe.net ++http://www.iana.org ++http://www.amazon.com ++http://www.netcraft.com ++http://www.heise.de ++http://www.chip.de ++http://www.ca.com ++http://www.cnet.com ++http://www.news.com ++http://www.cnn.com ++http://www.wikipedia.org ++http://www.dell.com ++http://www.hp.com ++http://www.cert.org ++http://www.mit.edu ++http://www.nist.gov ++http://www.ebay.com ++http://www.playstation.com ++http://www.uefa.com ++http://www.ieee.org ++http://www.apple.com ++http://www.sony.com ++http://www.symantec.com ++http://www.zdnet.com ++http://www.fujitsu.com ++http://www.supermicro.com ++http://www.hotmail.com ++http://www.ecma.com ++http://www.bbc.co.uk ++http://news.google.com ++http://www.foxnews.com ++http://www.msn.com ++http://www.wired.com ++http://www.sky.com ++http://www.usatoday.com ++http://www.cbs.com ++http://www.nbc.com ++http://slashdot.org ++http://www.bloglines.com ++http://www.techweb.com ++http://www.newslink.org ++http://www.un.org +\ No newline at end of file diff --git a/lang/php5/patches/900-prevent_buildconf_force.patch b/lang/php5/patches/900-prevent_buildconf_force.patch index 17291d531..7e56417e4 100644 --- a/lang/php5/patches/900-prevent_buildconf_force.patch +++ b/lang/php5/patches/900-prevent_buildconf_force.patch @@ -49,42 +49,67 @@ --enable-mbstring Enable multibyte string support" ac_help="$ac_help --disable-mbregex MBSTRING: Disable multibyte regex support" -@@ -1888,12 +1916,12 @@ fi +@@ -1165,6 +1193,24 @@ ac_help="$ac_help + ac_help="$ac_help + --with-pcre-dir ZIP: pcre install prefix" + ac_help="$ac_help ++ --enable-http Enable extended HTTP support" ++ac_help="$ac_help ++ --with-http-shared-deps ++ HTTP: disable to not depend on extensions like hash, ++ iconv and session (when built shared)" ++ac_help="$ac_help ++ --with-http-curl-requests[=LIBCURLDIR] ++ HTTP: with cURL request support" ++ac_help="$ac_help ++ --with-http-curl-libevent[=LIBEVENTDIR] ++ HTTP: libevent install directory" ++ac_help="$ac_help ++ --with-http-zlib-compression[=LIBZDIR] ++ HTTP: with zlib encodings support" ++ac_help="$ac_help ++ --with-http-magic-mime[=LIBMAGICDIR] ++ HTTP: with magic mime response content type guessing" ++ac_help="$ac_help + --disable-mysqlnd-compression-support + Enable support for the MySQL compressed protocol in mysqlnd" + ac_help="$ac_help +@@ -1888,12 +1934,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1892: checking for Cygwin environment" >&5 -+echo "configure:1920: checking for Cygwin environment" >&5 ++echo "configure:1938: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:1936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else -@@ -1921,19 +1949,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 +@@ -1921,19 +1967,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1925: checking for mingw32 environment" >&5 -+echo "configure:1953: checking for mingw32 environment" >&5 ++echo "configure:1971: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:1965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else -@@ -1952,7 +1980,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y +@@ -1952,7 +1998,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for egrep""... $ac_c" 1>&6 -echo "configure:1956: checking for egrep" >&5 -+echo "configure:1984: checking for egrep" >&5 ++echo "configure:2002: checking for egrep" >&5 if eval "test \"`echo '$''{'ac_cv_prog_egrep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -1967,7 +1995,7 @@ echo "$ac_t""$ac_cv_prog_egrep" 1>&6 +@@ -1967,7 +2013,7 @@ echo "$ac_t""$ac_cv_prog_egrep" 1>&6 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6 -echo "configure:1971: checking for a sed that does not truncate output" >&5 -+echo "configure:1999: checking for a sed that does not truncate output" >&5 ++echo "configure:2017: checking for a sed that does not truncate output" >&5 if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2117,7 +2145,7 @@ else { echo "configure: error: can not r +@@ -2117,7 +2163,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:2121: checking host system type" >&5 -+echo "configure:2149: checking host system type" >&5 ++echo "configure:2167: checking host system type" >&5 host_alias=$host case "$host_alias" in -@@ -2138,7 +2166,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- +@@ -2138,7 +2184,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:2142: checking target system type" >&5 -+echo "configure:2170: checking target system type" >&5 ++echo "configure:2188: checking target system type" >&5 target_alias=$target case "$target_alias" in -@@ -2250,7 +2278,7 @@ rm -f libs/* +@@ -2250,7 +2296,7 @@ rm -f libs/* # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2254: checking for $ac_word" >&5 -+echo "configure:2282: checking for $ac_word" >&5 ++echo "configure:2300: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2280,7 +2308,7 @@ if test -z "$CC"; then +@@ -2280,7 +2326,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2284: checking for $ac_word" >&5 -+echo "configure:2312: checking for $ac_word" >&5 ++echo "configure:2330: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2331,7 +2359,7 @@ fi +@@ -2331,7 +2377,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2335: checking for $ac_word" >&5 -+echo "configure:2363: checking for $ac_word" >&5 ++echo "configure:2381: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2363,7 +2391,7 @@ fi +@@ -2363,7 +2409,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2367: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -+echo "configure:2395: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:2413: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -@@ -2374,12 +2402,12 @@ cross_compiling=$ac_cv_prog_cc_cross +@@ -2374,12 +2420,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2378 "configure" -+#line 2406 "configure" ++#line 2424 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then -@@ -2405,12 +2433,12 @@ if test $ac_cv_prog_cc_works = no; then +@@ -2405,12 +2451,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2409: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -+echo "configure:2437: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2455: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2414: checking whether we are using GNU C" >&5 -+echo "configure:2442: checking whether we are using GNU C" >&5 ++echo "configure:2460: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2419,7 +2447,7 @@ else +@@ -2419,7 +2465,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no -@@ -2438,7 +2466,7 @@ ac_test_CFLAGS="${CFLAGS+set}" +@@ -2438,7 +2484,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2442: checking whether ${CC-cc} accepts -g" >&5 -+echo "configure:2470: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:2488: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2470,7 +2498,7 @@ else +@@ -2470,7 +2516,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2474: checking how to run the C preprocessor" >&5 -+echo "configure:2502: checking how to run the C preprocessor" >&5 ++echo "configure:2520: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= -@@ -2485,13 +2513,13 @@ else +@@ -2485,13 +2531,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2502,13 +2530,13 @@ else +@@ -2502,13 +2548,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2519,13 +2547,13 @@ else +@@ -2519,13 +2565,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2552,9 +2580,9 @@ echo "$ac_t""$CPP" 1>&6 +@@ -2552,9 +2598,9 @@ echo "$ac_t""$CPP" 1>&6 ICC="no" echo $ac_n "checking for icc""... $ac_c" 1>&6 -echo "configure:2556: checking for icc" >&5 -+echo "configure:2584: checking for icc" >&5 ++echo "configure:2602: checking for icc" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2580: checking for suncc" >&5 -+echo "configure:2608: checking for suncc" >&5 ++echo "configure:2626: checking for suncc" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2605: checking whether $CC and cc understand -c and -o together" >&5 -+echo "configure:2633: checking whether $CC and cc understand -c and -o together" >&5 ++echo "configure:2651: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:2608: checking whether cc understands -c and -o together" >&5 -+echo "configure:2636: checking whether cc understands -c and -o together" >&5 ++echo "configure:2654: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" -@@ -2616,16 +2644,16 @@ else +@@ -2616,16 +2662,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:2620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:2621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; -+if { (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && -+ test -f conftest.o && { (eval echo configure:2649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; ++if { (eval echo configure:2666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && ++ test -f conftest.o && { (eval echo configure:2667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:2626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then -+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:2654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ++ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:2672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:2628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:2629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; -+ if { (eval echo configure:2656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && -+ test -f conftest.o && { (eval echo configure:2657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; ++ if { (eval echo configure:2674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && ++ test -f conftest.o && { (eval echo configure:2675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : -@@ -2652,7 +2680,7 @@ EOF +@@ -2652,7 +2698,7 @@ EOF fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2656: checking how to run the C preprocessor" >&5 -+echo "configure:2684: checking how to run the C preprocessor" >&5 ++echo "configure:2702: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= -@@ -2667,13 +2695,13 @@ else +@@ -2667,13 +2713,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2684,13 +2712,13 @@ else +@@ -2684,13 +2730,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2701,13 +2729,13 @@ else +@@ -2701,13 +2747,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -2732,9 +2760,9 @@ fi +@@ -2732,9 +2778,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2736: checking for AIX" >&5 -+echo "configure:2764: checking for AIX" >&5 ++echo "configure:2782: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2760: checking whether ln -s works" >&5 -+echo "configure:2788: checking whether ln -s works" >&5 ++echo "configure:2806: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2781,7 +2809,7 @@ fi +@@ -2781,7 +2827,7 @@ fi php_with_libdir=lib echo $ac_n "checking for system library directory""... $ac_c" 1>&6 -echo "configure:2785: checking for system library directory" >&5 -+echo "configure:2813: checking for system library directory" >&5 ++echo "configure:2831: checking for system library directory" >&5 # Check whether --with-libdir or --without-libdir was given. if test "${with_libdir+set}" = set; then withval="$with_libdir" -@@ -2804,7 +2832,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -2804,7 +2850,7 @@ echo "$ac_t""$ext_output" 1>&6 php_enable_rpath=yes echo $ac_n "checking whether to enable runpaths""... $ac_c" 1>&6 -echo "configure:2808: checking whether to enable runpaths" >&5 -+echo "configure:2836: checking whether to enable runpaths" >&5 ++echo "configure:2854: checking whether to enable runpaths" >&5 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" -@@ -2825,7 +2853,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -2825,7 +2871,7 @@ echo "$ac_t""$ext_output" 1>&6 echo $ac_n "checking if compiler supports -R""... $ac_c" 1>&6 -echo "configure:2829: checking if compiler supports -R" >&5 -+echo "configure:2857: checking if compiler supports -R" >&5 ++echo "configure:2875: checking if compiler supports -R" >&5 if eval "test \"`echo '$''{'php_cv_cc_dashr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2833,14 +2861,14 @@ else +@@ -2833,14 +2879,14 @@ else SAVE_LIBS=$LIBS LIBS="-R /usr/$PHP_LIBDIR $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* php_cv_cc_dashr=yes else -@@ -2858,7 +2886,7 @@ if test $php_cv_cc_dashr = "yes"; then +@@ -2858,7 +2904,7 @@ if test $php_cv_cc_dashr = "yes"; then ld_runpath_switch=-R else echo $ac_n "checking if compiler supports -Wl,-rpath,""... $ac_c" 1>&6 -echo "configure:2862: checking if compiler supports -Wl,-rpath," >&5 -+echo "configure:2890: checking if compiler supports -Wl,-rpath," >&5 ++echo "configure:2908: checking if compiler supports -Wl,-rpath," >&5 if eval "test \"`echo '$''{'php_cv_cc_rpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2866,14 +2894,14 @@ else +@@ -2866,14 +2912,14 @@ else SAVE_LIBS=$LIBS LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* php_cv_cc_rpath=yes else -@@ -2904,7 +2932,7 @@ do +@@ -2904,7 +2950,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2908: checking for $ac_word" >&5 -+echo "configure:2936: checking for $ac_word" >&5 ++echo "configure:2954: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -2945,7 +2973,7 @@ test -n "$AWK" || AWK="bork" +@@ -2945,7 +2991,7 @@ test -n "$AWK" || AWK="bork" ;; *) echo $ac_n "checking if $AWK is broken""... $ac_c" 1>&6 -echo "configure:2949: checking if $AWK is broken" >&5 -+echo "configure:2977: checking if $AWK is broken" >&5 ++echo "configure:2995: checking if $AWK is broken" >&5 if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 { echo "configure: error: You should install GNU awk" 1>&2; exit 1; } -@@ -2964,7 +2992,7 @@ do +@@ -2964,7 +3010,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2968: checking for $ac_word" >&5 -+echo "configure:2996: checking for $ac_word" >&5 ++echo "configure:3014: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3004,7 +3032,7 @@ test -n "$YACC" || YACC="yacc" +@@ -3004,7 +3050,7 @@ test -n "$YACC" || YACC="yacc" bison_version=none if test "$YACC"; then echo $ac_n "checking for bison version""... $ac_c" 1>&6 -echo "configure:3008: checking for bison version" >&5 -+echo "configure:3036: checking for bison version" >&5 ++echo "configure:3054: checking for bison version" >&5 if eval "test \"`echo '$''{'php_cv_bison_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3042,7 +3070,7 @@ echo "$ac_t""$php_cv_bison_version" 1>&6 +@@ -3042,7 +3088,7 @@ echo "$ac_t""$php_cv_bison_version" 1>&6 # Extract the first word of "re2c", so it can be a program name with args. set dummy re2c; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3046: checking for $ac_word" >&5 -+echo "configure:3074: checking for $ac_word" >&5 ++echo "configure:3092: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RE2C'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3070,7 +3098,7 @@ fi +@@ -3070,7 +3116,7 @@ fi if test -n "$RE2C"; then echo $ac_n "checking for re2c version""... $ac_c" 1>&6 -echo "configure:3074: checking for re2c version" >&5 -+echo "configure:3102: checking for re2c version" >&5 ++echo "configure:3120: checking for re2c version" >&5 if eval "test \"`echo '$''{'php_cv_re2c_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3109,7 +3137,7 @@ esac +@@ -3109,7 +3155,7 @@ esac php_enable_re2c_cgoto=no echo $ac_n "checking whether to enable computed goto gcc extension with re2c""... $ac_c" 1>&6 -echo "configure:3113: checking whether to enable computed goto gcc extension with re2c" >&5 -+echo "configure:3141: checking whether to enable computed goto gcc extension with re2c" >&5 ++echo "configure:3159: checking whether to enable computed goto gcc extension with re2c" >&5 # Check whether --enable-re2c-cgoto or --disable-re2c-cgoto was given. if test "${enable_re2c_cgoto+set}" = set; then enableval="$enable_re2c_cgoto" -@@ -3132,9 +3160,9 @@ if test "$PHP_RE2C_CGOTO" = "no"; then +@@ -3132,9 +3178,9 @@ if test "$PHP_RE2C_CGOTO" = "no"; then RE2C_FLAGS="" else echo $ac_n "checking whether re2c -g works""... $ac_c" 1>&6 -echo "configure:3136: checking whether re2c -g works" >&5 -+echo "configure:3164: checking whether re2c -g works" >&5 ++echo "configure:3182: checking whether re2c -g works" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* RE2C_FLAGS="" -@@ -3218,7 +3246,7 @@ case $host_alias in +@@ -3218,7 +3264,7 @@ case $host_alias in gcc_arg_name=ac_cv_gcc_arg_no_cpp_precomp echo $ac_n "checking whether $CC supports -no-cpp-precomp""... $ac_c" 1>&6 -echo "configure:3222: checking whether $CC supports -no-cpp-precomp" >&5 -+echo "configure:3250: checking whether $CC supports -no-cpp-precomp" >&5 ++echo "configure:3268: checking whether $CC supports -no-cpp-precomp" >&5 if eval "test \"`echo '$''{'ac_cv_gcc_arg_no_cpp_precomp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3419,7 +3447,7 @@ esac +@@ -3419,7 +3465,7 @@ esac # Disable PIC mode by default where it is known to be safe to do so, # to avoid the performance hit from the lost register echo $ac_n "checking whether to force non-PIC code in shared modules""... $ac_c" 1>&6 -echo "configure:3423: checking whether to force non-PIC code in shared modules" >&5 -+echo "configure:3451: checking whether to force non-PIC code in shared modules" >&5 ++echo "configure:3469: checking whether to force non-PIC code in shared modules" >&5 case $host_alias in i?86-*-linux*|i?86-*-freebsd*) if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then -@@ -3449,7 +3477,7 @@ esac +@@ -3449,7 +3495,7 @@ esac echo $ac_n "checking whether /dev/urandom exists""... $ac_c" 1>&6 -echo "configure:3453: checking whether /dev/urandom exists" >&5 -+echo "configure:3481: checking whether /dev/urandom exists" >&5 ++echo "configure:3499: checking whether /dev/urandom exists" >&5 if test -r "/dev/urandom" && test -c "/dev/urandom"; then cat >> confdefs.h <<\EOF #define HAVE_DEV_URANDOM 1 -@@ -3510,7 +3538,7 @@ if test "$cross_compiling" = yes; then +@@ -3510,7 +3556,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -3528,7 +3556,7 @@ int main() { +@@ -3528,7 +3574,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:3532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -3548,7 +3576,7 @@ fi +@@ -3548,7 +3594,7 @@ fi CFLAGS=$save_CFLAGS echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6 -echo "configure:3552: checking for pthreads_cflags" >&5 -+echo "configure:3580: checking for pthreads_cflags" >&5 ++echo "configure:3598: checking for pthreads_cflags" >&5 if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3570,7 +3598,7 @@ if test "$cross_compiling" = yes; then +@@ -3570,7 +3616,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -3588,7 +3616,7 @@ int main() { +@@ -3588,7 +3634,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -3618,7 +3646,7 @@ fi +@@ -3618,7 +3664,7 @@ fi echo "$ac_t""$ac_cv_pthreads_cflags" 1>&6 echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6 -echo "configure:3622: checking for pthreads_lib" >&5 -+echo "configure:3650: checking for pthreads_lib" >&5 ++echo "configure:3668: checking for pthreads_lib" >&5 if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -3640,7 +3668,7 @@ if test "$cross_compiling" = yes; then +@@ -3640,7 +3686,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -3658,7 +3686,7 @@ int main() { +@@ -3658,7 +3704,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -3789,7 +3817,7 @@ ext_output=$PHP_AOLSERVER +@@ -3789,7 +3835,7 @@ ext_output=$PHP_AOLSERVER echo $ac_n "checking for AOLserver support""... $ac_c" 1>&6 -echo "configure:3793: checking for AOLserver support" >&5 -+echo "configure:3821: checking for AOLserver support" >&5 ++echo "configure:3839: checking for AOLserver support" >&5 if test "$PHP_AOLSERVER" != "no"; then if test -d "$PHP_AOLSERVER/include"; then -@@ -4054,7 +4082,7 @@ ext_output=$PHP_APXS +@@ -4054,7 +4100,7 @@ ext_output=$PHP_APXS echo $ac_n "checking for Apache 1.x module support via DSO through APXS""... $ac_c" 1>&6 -echo "configure:4058: checking for Apache 1.x module support via DSO through APXS" >&5 -+echo "configure:4086: checking for Apache 1.x module support via DSO through APXS" >&5 ++echo "configure:4104: checking for Apache 1.x module support via DSO through APXS" >&5 if test "$PHP_APXS" != "no"; then if test "$PHP_APXS" = "yes"; then -@@ -4385,7 +4413,7 @@ ext_output=$PHP_APACHE +@@ -4385,7 +4431,7 @@ ext_output=$PHP_APACHE echo $ac_n "checking for Apache 1.x module support""... $ac_c" 1>&6 -echo "configure:4389: checking for Apache 1.x module support" >&5 -+echo "configure:4417: checking for Apache 1.x module support" >&5 ++echo "configure:4435: checking for Apache 1.x module support" >&5 if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then -@@ -5262,7 +5290,7 @@ fi +@@ -5262,7 +5308,7 @@ fi php_enable_mod_charset=no echo $ac_n "checking whether to enable Apache charset compatibility option""... $ac_c" 1>&6 -echo "configure:5266: checking whether to enable Apache charset compatibility option" >&5 -+echo "configure:5294: checking whether to enable Apache charset compatibility option" >&5 ++echo "configure:5312: checking whether to enable Apache charset compatibility option" >&5 # Check whether --enable-mod-charset or --disable-mod-charset was given. if test "${enable_mod_charset+set}" = set; then enableval="$enable_mod_charset" -@@ -5294,7 +5322,7 @@ if test "$APACHE_MODULE" = "yes"; then +@@ -5294,7 +5340,7 @@ if test "$APACHE_MODULE" = "yes"; then gcc_arg_name=ac_cv_gcc_arg_rdynamic echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6 -echo "configure:5298: checking whether $CC supports -rdynamic" >&5 -+echo "configure:5326: checking whether $CC supports -rdynamic" >&5 ++echo "configure:5344: checking whether $CC supports -rdynamic" >&5 if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -5337,7 +5365,7 @@ if test -n "$APACHE_INSTALL"; then +@@ -5337,7 +5383,7 @@ if test -n "$APACHE_INSTALL"; then echo $ac_n "checking for member fd in BUFF *""... $ac_c" 1>&6 -echo "configure:5341: checking for member fd in BUFF *" >&5 -+echo "configure:5369: checking for member fd in BUFF *" >&5 ++echo "configure:5387: checking for member fd in BUFF *" >&5 if eval "test \"`echo '$''{'ac_cv_php_fd_in_buff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -5349,14 +5377,14 @@ else +@@ -5349,14 +5395,14 @@ else CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" fi cat > conftest.$ac_ext < int main() { @@ -730,79 +755,79 @@ ; return 0; } EOF -if { (eval echo configure:5360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:5388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:5406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_php_fd_in_buff=yes -@@ -5429,7 +5457,7 @@ ext_output=$PHP_APXS2FILTER +@@ -5429,7 +5475,7 @@ ext_output=$PHP_APXS2FILTER echo $ac_n "checking for Apache 2.0 filter-module support via DSO through APXS""... $ac_c" 1>&6 -echo "configure:5433: checking for Apache 2.0 filter-module support via DSO through APXS" >&5 -+echo "configure:5461: checking for Apache 2.0 filter-module support via DSO through APXS" >&5 ++echo "configure:5479: checking for Apache 2.0 filter-module support via DSO through APXS" >&5 if test "$PHP_APXS2FILTER" != "no"; then if test "$PHP_APXS2FILTER" = "yes"; then -@@ -6318,7 +6346,7 @@ ext_output=$PHP_APXS2 +@@ -6318,7 +6364,7 @@ ext_output=$PHP_APXS2 echo $ac_n "checking for Apache 2.0 handler-module support via DSO through APXS""... $ac_c" 1>&6 -echo "configure:6322: checking for Apache 2.0 handler-module support via DSO through APXS" >&5 -+echo "configure:6350: checking for Apache 2.0 handler-module support via DSO through APXS" >&5 ++echo "configure:6368: checking for Apache 2.0 handler-module support via DSO through APXS" >&5 if test "$PHP_APXS2" != "no"; then if test "$PHP_APXS2" = "yes"; then -@@ -7208,7 +7236,7 @@ ext_output=$PHP_APACHE_HOOKS +@@ -7208,7 +7254,7 @@ ext_output=$PHP_APACHE_HOOKS echo $ac_n "checking for Apache 1.x (hooks) module support via DSO through APXS""... $ac_c" 1>&6 -echo "configure:7212: checking for Apache 1.x (hooks) module support via DSO through APXS" >&5 -+echo "configure:7240: checking for Apache 1.x (hooks) module support via DSO through APXS" >&5 ++echo "configure:7258: checking for Apache 1.x (hooks) module support via DSO through APXS" >&5 if test "$PHP_APACHE_HOOKS" != "no"; then if test "$PHP_APACHE_HOOKS" = "yes"; then -@@ -7539,7 +7567,7 @@ ext_output=$PHP_APACHE_HOOKS_STATIC +@@ -7539,7 +7585,7 @@ ext_output=$PHP_APACHE_HOOKS_STATIC echo $ac_n "checking for Apache 1.x (hooks) module support""... $ac_c" 1>&6 -echo "configure:7543: checking for Apache 1.x (hooks) module support" >&5 -+echo "configure:7571: checking for Apache 1.x (hooks) module support" >&5 ++echo "configure:7589: checking for Apache 1.x (hooks) module support" >&5 if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$PHP_APACHE_HOOKS_STATIC" != "no"; then -@@ -8416,7 +8444,7 @@ fi +@@ -8416,7 +8462,7 @@ fi php_enable_mod_charset=no echo $ac_n "checking whether to enable Apache charset compatibility option""... $ac_c" 1>&6 -echo "configure:8420: checking whether to enable Apache charset compatibility option" >&5 -+echo "configure:8448: checking whether to enable Apache charset compatibility option" >&5 ++echo "configure:8466: checking whether to enable Apache charset compatibility option" >&5 # Check whether --enable-mod-charset or --disable-mod-charset was given. if test "${enable_mod_charset+set}" = set; then enableval="$enable_mod_charset" -@@ -8448,7 +8476,7 @@ if test "$APACHE_HOOKS_MODULE" = "yes"; +@@ -8448,7 +8494,7 @@ if test "$APACHE_HOOKS_MODULE" = "yes"; gcc_arg_name=ac_cv_gcc_arg_rdynamic echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6 -echo "configure:8452: checking whether $CC supports -rdynamic" >&5 -+echo "configure:8480: checking whether $CC supports -rdynamic" >&5 ++echo "configure:8498: checking whether $CC supports -rdynamic" >&5 if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -8491,7 +8519,7 @@ if test -n "$APACHE_HOOKS_INSTALL"; then +@@ -8491,7 +8537,7 @@ if test -n "$APACHE_HOOKS_INSTALL"; then echo $ac_n "checking for member fd in BUFF *""... $ac_c" 1>&6 -echo "configure:8495: checking for member fd in BUFF *" >&5 -+echo "configure:8523: checking for member fd in BUFF *" >&5 ++echo "configure:8541: checking for member fd in BUFF *" >&5 if eval "test \"`echo '$''{'ac_cv_php_fd_in_buff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -8503,14 +8531,14 @@ else +@@ -8503,14 +8549,14 @@ else CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" fi cat > conftest.$ac_ext < int main() { @@ -810,103 +835,103 @@ ; return 0; } EOF -if { (eval echo configure:8514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:8542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_php_fd_in_buff=yes -@@ -8584,7 +8612,7 @@ ext_output=$PHP_CAUDIUM +@@ -8584,7 +8630,7 @@ ext_output=$PHP_CAUDIUM echo $ac_n "checking for Caudium support""... $ac_c" 1>&6 -echo "configure:8588: checking for Caudium support" >&5 -+echo "configure:8616: checking for Caudium support" >&5 ++echo "configure:8634: checking for Caudium support" >&5 if test "$PHP_CAUDIUM" != "no"; then if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi -@@ -8654,7 +8682,7 @@ if test "$PHP_CAUDIUM" != "no"; then +@@ -8654,7 +8700,7 @@ if test "$PHP_CAUDIUM" != "no"; then PIKE_C_INCLUDE=/usr/local/include/`basename $PIKE` fi echo $ac_n "checking for C includes in $PIKE_C_INCLUDE""... $ac_c" 1>&6 -echo "configure:8658: checking for C includes in $PIKE_C_INCLUDE" >&5 -+echo "configure:8686: checking for C includes in $PIKE_C_INCLUDE" >&5 ++echo "configure:8704: checking for C includes in $PIKE_C_INCLUDE" >&5 if test -f $PIKE_C_INCLUDE/version.h; then PIKE_TEST_VER=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` ###### VERSION MATCH CHECK ####### -@@ -8943,7 +8971,7 @@ ext_output=$PHP_CLI +@@ -8943,7 +8989,7 @@ ext_output=$PHP_CLI echo $ac_n "checking for CLI build""... $ac_c" 1>&6 -echo "configure:8947: checking for CLI build" >&5 -+echo "configure:8975: checking for CLI build" >&5 ++echo "configure:8993: checking for CLI build" >&5 if test "$PHP_CLI" != "no"; then src=$abs_srcdir/sapi/cli/Makefile.frag -@@ -8993,7 +9021,7 @@ echo "$ac_t""$PHP_CLI" 1>&6 +@@ -8993,7 +9039,7 @@ echo "$ac_t""$PHP_CLI" 1>&6 php_with_continuity=no echo $ac_n "checking for Continuity support""... $ac_c" 1>&6 -echo "configure:8997: checking for Continuity support" >&5 -+echo "configure:9025: checking for Continuity support" >&5 ++echo "configure:9043: checking for Continuity support" >&5 # Check whether --with-continuity or --without-continuity was given. if test "${with_continuity+set}" = set; then withval="$with_continuity" -@@ -9017,7 +9045,7 @@ if test "$PHP_CONTINUITY" != "no"; then +@@ -9017,7 +9063,7 @@ if test "$PHP_CONTINUITY" != "no"; then { echo "configure: error: Please specify the path to the root of your Continuity server using --with-continuity=DIR" 1>&2; exit 1; } fi echo $ac_n "checking for Continuity include files""... $ac_c" 1>&6 -echo "configure:9021: checking for Continuity include files" >&5 -+echo "configure:9049: checking for Continuity include files" >&5 ++echo "configure:9067: checking for Continuity include files" >&5 if test -d $PHP_CONTINUITY/include ; then CAPI_INCLUDE=$PHP_CONTINUITY/include echo "$ac_t""Continuity Binary Distribution" 1>&6 -@@ -9275,7 +9303,7 @@ ext_output=$PHP_EMBED +@@ -9275,7 +9321,7 @@ ext_output=$PHP_EMBED echo $ac_n "checking for embedded SAPI library support""... $ac_c" 1>&6 -echo "configure:9279: checking for embedded SAPI library support" >&5 -+echo "configure:9307: checking for embedded SAPI library support" >&5 ++echo "configure:9325: checking for embedded SAPI library support" >&5 if test "$PHP_EMBED" != "no"; then case "$PHP_EMBED" in -@@ -9534,7 +9562,7 @@ ext_output=$PHP_FPM +@@ -9534,7 +9580,7 @@ ext_output=$PHP_FPM echo $ac_n "checking for FPM build""... $ac_c" 1>&6 -echo "configure:9538: checking for FPM build" >&5 -+echo "configure:9566: checking for FPM build" >&5 ++echo "configure:9584: checking for FPM build" >&5 if test "$PHP_FPM" != "no"; then echo "$ac_t""$PHP_FPM" 1>&6 -@@ -9542,12 +9570,12 @@ if test "$PHP_FPM" != "no"; then +@@ -9542,12 +9588,12 @@ if test "$PHP_FPM" != "no"; then for ac_func in setenv clearenv setproctitle do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9546: checking for $ac_func" >&5 -+echo "configure:9574: checking for $ac_func" >&5 ++echo "configure:9592: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -9597,14 +9625,14 @@ done +@@ -9597,14 +9643,14 @@ done echo $ac_n "checking for library containing socket""... $ac_c" 1>&6 -echo "configure:9601: checking for library containing socket" >&5 -+echo "configure:9629: checking for library containing socket" >&5 ++echo "configure:9647: checking for library containing socket" >&5 if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -914,43 +939,43 @@ ac_cv_search_socket="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socket="none required" else -@@ -9626,7 +9654,7 @@ rm -f conftest* +@@ -9626,7 +9672,7 @@ rm -f conftest* test "$ac_cv_search_socket" = "no" && for i in socket; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socket="-l$i" break -@@ -9659,14 +9687,14 @@ else : +@@ -9659,14 +9705,14 @@ else : fi echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6 -echo "configure:9663: checking for library containing inet_addr" >&5 -+echo "configure:9691: checking for library containing inet_addr" >&5 ++echo "configure:9709: checking for library containing inet_addr" >&5 if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -958,110 +983,110 @@ ac_cv_search_inet_addr="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_inet_addr="none required" else -@@ -9688,7 +9716,7 @@ rm -f conftest* +@@ -9688,7 +9734,7 @@ rm -f conftest* test "$ac_cv_search_inet_addr" = "no" && for i in nsl; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_inet_addr="-l$i" break -@@ -9724,17 +9752,17 @@ fi +@@ -9724,17 +9770,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9728: checking for $ac_hdr" >&5 -+echo "configure:9756: checking for $ac_hdr" >&5 ++echo "configure:9774: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:9766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:9784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -9764,17 +9792,17 @@ done +@@ -9764,17 +9810,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9768: checking for $ac_hdr" >&5 -+echo "configure:9796: checking for $ac_hdr" >&5 ++echo "configure:9814: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:9806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:9824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -9804,17 +9832,17 @@ done +@@ -9804,17 +9850,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9808: checking for $ac_hdr" >&5 -+echo "configure:9836: checking for $ac_hdr" >&5 ++echo "configure:9854: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:9846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:9864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -9843,17 +9871,17 @@ done +@@ -9843,17 +9889,17 @@ done echo $ac_n "checking for prctl""... $ac_c" 1>&6 -echo "configure:9847: checking for prctl" >&5 -+echo "configure:9875: checking for prctl" >&5 ++echo "configure:9893: checking for prctl" >&5 cat > conftest.$ac_ext < int main() { @@ -1069,20 +1094,20 @@ ; return 0; } EOF -if { (eval echo configure:9857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:9885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF -@@ -9876,17 +9904,17 @@ rm -f conftest* +@@ -9876,17 +9922,17 @@ rm -f conftest* have_clock_gettime=no echo $ac_n "checking for clock_gettime""... $ac_c" 1>&6 -echo "configure:9880: checking for clock_gettime" >&5 -+echo "configure:9908: checking for clock_gettime" >&5 ++echo "configure:9926: checking for clock_gettime" >&5 cat > conftest.$ac_ext < int main() { @@ -1090,23 +1115,23 @@ ; return 0; } EOF -if { (eval echo configure:9890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_clock_gettime=yes -@@ -9904,20 +9932,20 @@ rm -f conftest* +@@ -9904,20 +9950,20 @@ rm -f conftest* if test "$have_clock_gettime" = "no"; then echo $ac_n "checking for clock_gettime in -lrt""... $ac_c" 1>&6 -echo "configure:9908: checking for clock_gettime in -lrt" >&5 -+echo "configure:9936: checking for clock_gettime in -lrt" >&5 ++echo "configure:9954: checking for clock_gettime in -lrt" >&5 SAVED_LIBS="$LIBS" LIBS="$LIBS -lrt" cat > conftest.$ac_ext < int main() { @@ -1114,160 +1139,160 @@ ; return 0; } EOF -if { (eval echo configure:9921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:9949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_clock_gettime=yes -@@ -9946,13 +9974,13 @@ EOF +@@ -9946,13 +9992,13 @@ EOF if test "$have_clock_gettime" = "no"; then echo $ac_n "checking for clock_get_time""... $ac_c" 1>&6 -echo "configure:9950: checking for clock_get_time" >&5 -+echo "configure:9978: checking for clock_get_time" >&5 ++echo "configure:9996: checking for clock_get_time" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #include -@@ -9976,7 +10004,7 @@ else +@@ -9976,7 +10022,7 @@ else } EOF -if { (eval echo configure:9980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:10008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:10026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then have_clock_get_time=yes -@@ -10007,10 +10035,10 @@ EOF +@@ -10007,10 +10053,10 @@ EOF have_broken_ptrace=no echo $ac_n "checking for ptrace""... $ac_c" 1>&6 -echo "configure:10011: checking for ptrace" >&5 -+echo "configure:10039: checking for ptrace" >&5 ++echo "configure:10057: checking for ptrace" >&5 cat > conftest.$ac_ext < -@@ -10019,7 +10047,7 @@ int main() { +@@ -10019,7 +10065,7 @@ int main() { ptrace(0, 0, (void *) 0, 0); ; return 0; } EOF -if { (eval echo configure:10023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:10051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_ptrace=yes -@@ -10037,13 +10065,13 @@ rm -f conftest* +@@ -10037,13 +10083,13 @@ rm -f conftest* if test "$have_ptrace" = "yes"; then echo $ac_n "checking whether ptrace works""... $ac_c" 1>&6 -echo "configure:10041: checking whether ptrace works" >&5 -+echo "configure:10069: checking whether ptrace works" >&5 ++echo "configure:10087: checking whether ptrace works" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < -@@ -10114,7 +10142,7 @@ else +@@ -10114,7 +10160,7 @@ else } EOF -if { (eval echo configure:10118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:10146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:10164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 -@@ -10145,10 +10173,10 @@ EOF +@@ -10145,10 +10191,10 @@ EOF if test "$have_broken_ptrace" = "yes"; then echo $ac_n "checking for mach_vm_read""... $ac_c" 1>&6 -echo "configure:10149: checking for mach_vm_read" >&5 -+echo "configure:10177: checking for mach_vm_read" >&5 ++echo "configure:10195: checking for mach_vm_read" >&5 cat > conftest.$ac_ext < #include -@@ -10159,7 +10187,7 @@ int main() { +@@ -10159,7 +10205,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:10163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:10191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_mach_vm_read=yes -@@ -10195,13 +10223,13 @@ EOF +@@ -10195,13 +10241,13 @@ EOF if test -n "$proc_mem_file" ; then echo $ac_n "checking for proc mem file""... $ac_c" 1>&6 -echo "configure:10199: checking for proc mem file" >&5 -+echo "configure:10227: checking for proc mem file" >&5 ++echo "configure:10245: checking for proc mem file" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:10263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:10281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""$proc_mem_file" 1>&6 -@@ -10275,9 +10303,9 @@ EOF +@@ -10275,9 +10321,9 @@ EOF echo $ac_n "checking if gcc supports __sync_bool_compare_and_swap""... $ac_c" 1>&6 -echo "configure:10279: checking if gcc supports __sync_bool_compare_and_swap" >&5 -+echo "configure:10307: checking if gcc supports __sync_bool_compare_and_swap" >&5 ++echo "configure:10325: checking if gcc supports __sync_bool_compare_and_swap" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:10320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -@@ -10311,17 +10339,17 @@ rm -f conftest* +@@ -10311,17 +10357,17 @@ rm -f conftest* have_lq=no echo $ac_n "checking for TCP_INFO""... $ac_c" 1>&6 -echo "configure:10315: checking for TCP_INFO" >&5 -+echo "configure:10343: checking for TCP_INFO" >&5 ++echo "configure:10361: checking for TCP_INFO" >&5 cat > conftest.$ac_ext < int main() { @@ -1275,20 +1300,20 @@ ; return 0; } EOF -if { (eval echo configure:10325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:10353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_lq=tcp_info -@@ -10346,17 +10374,17 @@ EOF +@@ -10346,17 +10392,17 @@ EOF if test "$have_lq" = "no" ; then echo $ac_n "checking for SO_LISTENQLEN""... $ac_c" 1>&6 -echo "configure:10350: checking for SO_LISTENQLEN" >&5 -+echo "configure:10378: checking for SO_LISTENQLEN" >&5 ++echo "configure:10396: checking for SO_LISTENQLEN" >&5 cat > conftest.$ac_ext < int main() { @@ -1296,157 +1321,157 @@ ; return 0; } EOF -if { (eval echo configure:10360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:10388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_lq=so_listenq -@@ -10732,7 +10760,7 @@ fi +@@ -10732,7 +10778,7 @@ fi php_with_isapi=no echo $ac_n "checking for Zeus ISAPI support""... $ac_c" 1>&6 -echo "configure:10736: checking for Zeus ISAPI support" >&5 -+echo "configure:10764: checking for Zeus ISAPI support" >&5 ++echo "configure:10782: checking for Zeus ISAPI support" >&5 # Check whether --with-isapi or --without-isapi was given. if test "${with_isapi+set}" = set; then withval="$with_isapi" -@@ -10986,7 +11014,7 @@ fi +@@ -10986,7 +11032,7 @@ fi echo $ac_n "checking for LiteSpeed support""... $ac_c" 1>&6 -echo "configure:10990: checking for LiteSpeed support" >&5 -+echo "configure:11018: checking for LiteSpeed support" >&5 ++echo "configure:11036: checking for LiteSpeed support" >&5 php_with_litespeed=no -@@ -11249,7 +11277,7 @@ echo "$ac_t""$PHP_LITESPEED" 1>&6 +@@ -11249,7 +11295,7 @@ echo "$ac_t""$PHP_LITESPEED" 1>&6 php_with_milter=no echo $ac_n "checking for Milter support""... $ac_c" 1>&6 -echo "configure:11253: checking for Milter support" >&5 -+echo "configure:11281: checking for Milter support" >&5 ++echo "configure:11299: checking for Milter support" >&5 # Check whether --with-milter or --without-milter was given. if test "${with_milter+set}" = set; then withval="$with_milter" -@@ -11541,7 +11569,7 @@ fi +@@ -11541,7 +11587,7 @@ fi php_with_nsapi=no echo $ac_n "checking for NSAPI support""... $ac_c" 1>&6 -echo "configure:11545: checking for NSAPI support" >&5 -+echo "configure:11573: checking for NSAPI support" >&5 ++echo "configure:11591: checking for NSAPI support" >&5 # Check whether --with-nsapi or --without-nsapi was given. if test "${with_nsapi+set}" = set; then withval="$with_nsapi" -@@ -11565,7 +11593,7 @@ if test "$PHP_NSAPI" != "no"; then +@@ -11565,7 +11611,7 @@ if test "$PHP_NSAPI" != "no"; then { echo "configure: error: Please specify the path to the root of your Netscape/iPlanet/Sun Webserver using --with-nsapi=DIR" 1>&2; exit 1; } fi echo $ac_n "checking for NSAPI include files""... $ac_c" 1>&6 -echo "configure:11569: checking for NSAPI include files" >&5 -+echo "configure:11597: checking for NSAPI include files" >&5 ++echo "configure:11615: checking for NSAPI include files" >&5 if test -d $PHP_NSAPI/include ; then NSAPI_INC_DIR="$PHP_NSAPI/include" echo "$ac_t""Netscape 3.x / Sun 7.x style" 1>&6 -@@ -11573,17 +11601,17 @@ echo "configure:11569: checking for NSAP +@@ -11573,17 +11619,17 @@ echo "configure:11569: checking for NSAP do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11577: checking for $ac_hdr" >&5 -+echo "configure:11605: checking for $ac_hdr" >&5 ++echo "configure:11623: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:11615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:11633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -11618,17 +11646,17 @@ done +@@ -11618,17 +11664,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11622: checking for $ac_hdr" >&5 -+echo "configure:11650: checking for $ac_hdr" >&5 ++echo "configure:11668: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:11660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:11678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -11901,7 +11929,7 @@ fi +@@ -11901,7 +11947,7 @@ fi php_with_phttpd=no echo $ac_n "checking for PHTTPD support""... $ac_c" 1>&6 -echo "configure:11905: checking for PHTTPD support" >&5 -+echo "configure:11933: checking for PHTTPD support" >&5 ++echo "configure:11951: checking for PHTTPD support" >&5 # Check whether --with-phttpd or --without-phttpd was given. if test "${with_phttpd+set}" = set; then withval="$with_phttpd" -@@ -12155,7 +12183,7 @@ fi +@@ -12155,7 +12201,7 @@ fi php_with_pi3web=no echo $ac_n "checking for Pi3Web support""... $ac_c" 1>&6 -echo "configure:12159: checking for Pi3Web support" >&5 -+echo "configure:12187: checking for Pi3Web support" >&5 ++echo "configure:12205: checking for Pi3Web support" >&5 # Check whether --with-pi3web or --without-pi3web was given. if test "${with_pi3web+set}" = set; then withval="$with_pi3web" -@@ -12527,7 +12555,7 @@ ext_output=$PHP_ROXEN +@@ -12527,7 +12573,7 @@ ext_output=$PHP_ROXEN php_enable_roxen_zts=no echo $ac_n "checking whether Roxen module is build using ZTS""... $ac_c" 1>&6 -echo "configure:12531: checking whether Roxen module is build using ZTS" >&5 -+echo "configure:12559: checking whether Roxen module is build using ZTS" >&5 ++echo "configure:12577: checking whether Roxen module is build using ZTS" >&5 # Check whether --enable-roxen-zts or --disable-roxen-zts was given. if test "${enable_roxen_zts+set}" = set; then enableval="$enable_roxen_zts" -@@ -12548,7 +12576,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -12548,7 +12594,7 @@ echo "$ac_t""$ext_output" 1>&6 RESULT= echo $ac_n "checking for Roxen/Pike support""... $ac_c" 1>&6 -echo "configure:12552: checking for Roxen/Pike support" >&5 -+echo "configure:12580: checking for Roxen/Pike support" >&5 ++echo "configure:12598: checking for Roxen/Pike support" >&5 if test "$PHP_ROXEN" != "no"; then if test ! -d $PHP_ROXEN ; then { echo "configure: error: You did not specify a directory" 1>&2; exit 1; } -@@ -12834,7 +12862,7 @@ ext_output=$PHP_THTTPD +@@ -12834,7 +12880,7 @@ ext_output=$PHP_THTTPD echo $ac_n "checking for thttpd""... $ac_c" 1>&6 -echo "configure:12838: checking for thttpd" >&5 -+echo "configure:12866: checking for thttpd" >&5 ++echo "configure:12884: checking for thttpd" >&5 if test "$PHP_THTTPD" != "no"; then if test ! -d $PHP_THTTPD; then -@@ -12867,7 +12895,7 @@ if test "$PHP_THTTPD" != "no"; then +@@ -12867,7 +12913,7 @@ if test "$PHP_THTTPD" != "no"; then gcc_arg_name=ac_cv_gcc_arg_rdynamic echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6 -echo "configure:12871: checking whether $CC supports -rdynamic" >&5 -+echo "configure:12899: checking whether $CC supports -rdynamic" >&5 ++echo "configure:12917: checking whether $CC supports -rdynamic" >&5 if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -13103,24 +13131,24 @@ ext_output=$PHP_TUX +@@ -13103,24 +13149,24 @@ ext_output=$PHP_TUX echo $ac_n "checking for TUX""... $ac_c" 1>&6 -echo "configure:13107: checking for TUX" >&5 -+echo "configure:13135: checking for TUX" >&5 ++echo "configure:13153: checking for TUX" >&5 if test "$PHP_TUX" != "no"; then INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_TUX/php5.tux.so" for ac_hdr in tuxmodule.h @@ -1454,1444 +1479,1444 @@ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13114: checking for $ac_hdr" >&5 -+echo "configure:13142: checking for $ac_hdr" >&5 ++echo "configure:13160: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:13152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:13170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -13357,7 +13385,7 @@ ext_output=$PHP_WEBJAMES +@@ -13357,7 +13403,7 @@ ext_output=$PHP_WEBJAMES echo $ac_n "checking for webjames""... $ac_c" 1>&6 -echo "configure:13361: checking for webjames" >&5 -+echo "configure:13389: checking for webjames" >&5 ++echo "configure:13407: checking for webjames" >&5 if test "$PHP_WEBJAMES" != "no"; then -@@ -13617,14 +13645,14 @@ ext_output=$PHP_CGI +@@ -13617,14 +13663,14 @@ ext_output=$PHP_CGI if test "$PHP_SAPI" = "default"; then echo $ac_n "checking whether to build CGI binary""... $ac_c" 1>&6 -echo "configure:13621: checking whether to build CGI binary" >&5 -+echo "configure:13649: checking whether to build CGI binary" >&5 ++echo "configure:13667: checking whether to build CGI binary" >&5 if test "$PHP_CGI" != "no"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 -echo "configure:13626: checking for socklen_t in sys/socket.h" >&5 -+echo "configure:13654: checking for socklen_t in sys/socket.h" >&5 ++echo "configure:13672: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext < EOF -@@ -13644,9 +13672,9 @@ rm -f conftest* +@@ -13644,9 +13690,9 @@ rm -f conftest* echo $ac_n "checking for sun_len in sys/un.h""... $ac_c" 1>&6 -echo "configure:13648: checking for sun_len in sys/un.h" >&5 -+echo "configure:13676: checking for sun_len in sys/un.h" >&5 ++echo "configure:13694: checking for sun_len in sys/un.h" >&5 cat > conftest.$ac_ext < EOF -@@ -13666,7 +13694,7 @@ rm -f conftest* +@@ -13666,7 +13712,7 @@ rm -f conftest* echo $ac_n "checking whether cross-process locking is required by accept()""... $ac_c" 1>&6 -echo "configure:13670: checking whether cross-process locking is required by accept()" >&5 -+echo "configure:13698: checking whether cross-process locking is required by accept()" >&5 ++echo "configure:13716: checking whether cross-process locking is required by accept()" >&5 case "`uname -sr`" in IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0) echo "$ac_t""yes" 1>&6 -@@ -13910,7 +13938,7 @@ fi +@@ -13910,7 +13956,7 @@ fi echo $ac_n "checking for chosen SAPI module""... $ac_c" 1>&6 -echo "configure:13914: checking for chosen SAPI module" >&5 -+echo "configure:13942: checking for chosen SAPI module" >&5 ++echo "configure:13960: checking for chosen SAPI module" >&5 echo "$ac_t""$PHP_SAPI" 1>&6 if test "$enable_maintainer_zts" = "yes"; then -@@ -13967,7 +13995,7 @@ fi +@@ -13967,7 +14013,7 @@ fi # Extract the first word of "sendmail", so it can be a program name with args. set dummy sendmail; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:13971: checking for $ac_word" >&5 -+echo "configure:13999: checking for $ac_word" >&5 ++echo "configure:14017: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PROG_SENDMAIL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -14006,7 +14034,7 @@ fi +@@ -14006,7 +14052,7 @@ fi echo $ac_n "checking whether system uses EBCDIC""... $ac_c" 1>&6 -echo "configure:14010: checking whether system uses EBCDIC" >&5 -+echo "configure:14038: checking whether system uses EBCDIC" >&5 ++echo "configure:14056: checking whether system uses EBCDIC" >&5 if eval "test \"`echo '$''{'ac_cv_ebcdic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -14017,7 +14045,7 @@ else +@@ -14017,7 +14063,7 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_ebcdic=yes -@@ -14053,7 +14081,7 @@ EOF +@@ -14053,7 +14099,7 @@ EOF echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:14057: checking whether byte ordering is bigendian" >&5 -+echo "configure:14085: checking whether byte ordering is bigendian" >&5 ++echo "configure:14103: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian_php'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -14063,7 +14091,7 @@ else +@@ -14063,7 +14109,7 @@ else ac_cv_c_bigendian_php=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian_php=yes else -@@ -14105,7 +14133,7 @@ EOF +@@ -14105,7 +14151,7 @@ EOF echo $ac_n "checking whether writing to stdout works""... $ac_c" 1>&6 -echo "configure:14109: checking whether writing to stdout works" >&5 -+echo "configure:14137: checking whether writing to stdout works" >&5 ++echo "configure:14155: checking whether writing to stdout works" >&5 if eval "test \"`echo '$''{'ac_cv_write_stdout'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -14116,7 +14144,7 @@ else +@@ -14116,7 +14162,7 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_write_stdout=yes -@@ -14209,12 +14237,12 @@ test -d /usr/ucblib && +@@ -14209,12 +14255,12 @@ test -d /usr/ucblib && unset found echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:14213: checking for socket" >&5 -+echo "configure:14241: checking for socket" >&5 ++echo "configure:14259: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else -@@ -14255,12 +14283,12 @@ if eval "test \"`echo '$ac_cv_func_'sock +@@ -14255,12 +14301,12 @@ if eval "test \"`echo '$ac_cv_func_'sock else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __socket""... $ac_c" 1>&6 -echo "configure:14259: checking for __socket" >&5 -+echo "configure:14287: checking for __socket" >&5 ++echo "configure:14305: checking for __socket" >&5 if eval "test \"`echo '$''{'ac_cv_func___socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___socket=yes" else -@@ -14321,7 +14349,7 @@ EOF +@@ -14321,7 +14367,7 @@ EOF unset ac_cv_lib_socket___socket unset found echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:14325: checking for socket in -lsocket" >&5 -+echo "configure:14353: checking for socket in -lsocket" >&5 ++echo "configure:14371: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14329,7 +14357,7 @@ else +@@ -14329,7 +14375,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14360,7 +14388,7 @@ else +@@ -14360,7 +14406,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __socket in -lsocket""... $ac_c" 1>&6 -echo "configure:14364: checking for __socket in -lsocket" >&5 -+echo "configure:14392: checking for __socket in -lsocket" >&5 ++echo "configure:14410: checking for __socket in -lsocket" >&5 ac_lib_var=`echo socket'_'__socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14368,7 +14396,7 @@ else +@@ -14368,7 +14414,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14411,11 +14439,11 @@ fi +@@ -14411,11 +14457,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -14466,12 +14494,12 @@ EOF +@@ -14466,12 +14512,12 @@ EOF unset found echo $ac_n "checking for socketpair""... $ac_c" 1>&6 -echo "configure:14470: checking for socketpair" >&5 -+echo "configure:14498: checking for socketpair" >&5 ++echo "configure:14516: checking for socketpair" >&5 if eval "test \"`echo '$''{'ac_cv_func_socketpair'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socketpair=yes" else -@@ -14512,12 +14540,12 @@ if eval "test \"`echo '$ac_cv_func_'sock +@@ -14512,12 +14558,12 @@ if eval "test \"`echo '$ac_cv_func_'sock else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __socketpair""... $ac_c" 1>&6 -echo "configure:14516: checking for __socketpair" >&5 -+echo "configure:14544: checking for __socketpair" >&5 ++echo "configure:14562: checking for __socketpair" >&5 if eval "test \"`echo '$''{'ac_cv_func___socketpair'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___socketpair=yes" else -@@ -14578,7 +14606,7 @@ EOF +@@ -14578,7 +14624,7 @@ EOF unset ac_cv_lib_socket___socketpair unset found echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:14582: checking for socketpair in -lsocket" >&5 -+echo "configure:14610: checking for socketpair in -lsocket" >&5 ++echo "configure:14628: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14586,7 +14614,7 @@ else +@@ -14586,7 +14632,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14617,7 +14645,7 @@ else +@@ -14617,7 +14663,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:14621: checking for __socketpair in -lsocket" >&5 -+echo "configure:14649: checking for __socketpair in -lsocket" >&5 ++echo "configure:14667: checking for __socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'__socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14625,7 +14653,7 @@ else +@@ -14625,7 +14671,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14668,11 +14696,11 @@ fi +@@ -14668,11 +14714,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -14723,12 +14751,12 @@ EOF +@@ -14723,12 +14769,12 @@ EOF unset found echo $ac_n "checking for htonl""... $ac_c" 1>&6 -echo "configure:14727: checking for htonl" >&5 -+echo "configure:14755: checking for htonl" >&5 ++echo "configure:14773: checking for htonl" >&5 if eval "test \"`echo '$''{'ac_cv_func_htonl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_htonl=yes" else -@@ -14769,12 +14797,12 @@ if eval "test \"`echo '$ac_cv_func_'hton +@@ -14769,12 +14815,12 @@ if eval "test \"`echo '$ac_cv_func_'hton else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __htonl""... $ac_c" 1>&6 -echo "configure:14773: checking for __htonl" >&5 -+echo "configure:14801: checking for __htonl" >&5 ++echo "configure:14819: checking for __htonl" >&5 if eval "test \"`echo '$''{'ac_cv_func___htonl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___htonl=yes" else -@@ -14835,7 +14863,7 @@ EOF +@@ -14835,7 +14881,7 @@ EOF unset ac_cv_lib_socket___htonl unset found echo $ac_n "checking for htonl in -lsocket""... $ac_c" 1>&6 -echo "configure:14839: checking for htonl in -lsocket" >&5 -+echo "configure:14867: checking for htonl in -lsocket" >&5 ++echo "configure:14885: checking for htonl in -lsocket" >&5 ac_lib_var=`echo socket'_'htonl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14843,7 +14871,7 @@ else +@@ -14843,7 +14889,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14874,7 +14902,7 @@ else +@@ -14874,7 +14920,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __htonl in -lsocket""... $ac_c" 1>&6 -echo "configure:14878: checking for __htonl in -lsocket" >&5 -+echo "configure:14906: checking for __htonl in -lsocket" >&5 ++echo "configure:14924: checking for __htonl in -lsocket" >&5 ac_lib_var=`echo socket'_'__htonl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -14882,7 +14910,7 @@ else +@@ -14882,7 +14928,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:14925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -14925,11 +14953,11 @@ fi +@@ -14925,11 +14971,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:14961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:14979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -14980,12 +15008,12 @@ EOF +@@ -14980,12 +15026,12 @@ EOF unset found echo $ac_n "checking for gethostname""... $ac_c" 1>&6 -echo "configure:14984: checking for gethostname" >&5 -+echo "configure:15012: checking for gethostname" >&5 ++echo "configure:15030: checking for gethostname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostname=yes" else -@@ -15026,12 +15054,12 @@ if eval "test \"`echo '$ac_cv_func_'geth +@@ -15026,12 +15072,12 @@ if eval "test \"`echo '$ac_cv_func_'geth else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __gethostname""... $ac_c" 1>&6 -echo "configure:15030: checking for __gethostname" >&5 -+echo "configure:15058: checking for __gethostname" >&5 ++echo "configure:15076: checking for __gethostname" >&5 if eval "test \"`echo '$''{'ac_cv_func___gethostname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___gethostname=yes" else -@@ -15092,7 +15120,7 @@ EOF +@@ -15092,7 +15138,7 @@ EOF unset ac_cv_lib_nsl___gethostname unset found echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6 -echo "configure:15096: checking for gethostname in -lnsl" >&5 -+echo "configure:15124: checking for gethostname in -lnsl" >&5 ++echo "configure:15142: checking for gethostname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15100,7 +15128,7 @@ else +@@ -15100,7 +15146,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15131,7 +15159,7 @@ else +@@ -15131,7 +15177,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __gethostname in -lnsl""... $ac_c" 1>&6 -echo "configure:15135: checking for __gethostname in -lnsl" >&5 -+echo "configure:15163: checking for __gethostname in -lnsl" >&5 ++echo "configure:15181: checking for __gethostname in -lnsl" >&5 ac_lib_var=`echo nsl'_'__gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15139,7 +15167,7 @@ else +@@ -15139,7 +15185,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15182,11 +15210,11 @@ fi +@@ -15182,11 +15228,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:15218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:15236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -15237,12 +15265,12 @@ EOF +@@ -15237,12 +15283,12 @@ EOF unset found echo $ac_n "checking for gethostbyaddr""... $ac_c" 1>&6 -echo "configure:15241: checking for gethostbyaddr" >&5 -+echo "configure:15269: checking for gethostbyaddr" >&5 ++echo "configure:15287: checking for gethostbyaddr" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyaddr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyaddr=yes" else -@@ -15283,12 +15311,12 @@ if eval "test \"`echo '$ac_cv_func_'geth +@@ -15283,12 +15329,12 @@ if eval "test \"`echo '$ac_cv_func_'geth else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __gethostbyaddr""... $ac_c" 1>&6 -echo "configure:15287: checking for __gethostbyaddr" >&5 -+echo "configure:15315: checking for __gethostbyaddr" >&5 ++echo "configure:15333: checking for __gethostbyaddr" >&5 if eval "test \"`echo '$''{'ac_cv_func___gethostbyaddr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___gethostbyaddr=yes" else -@@ -15349,7 +15377,7 @@ EOF +@@ -15349,7 +15395,7 @@ EOF unset ac_cv_lib_nsl___gethostbyaddr unset found echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6 -echo "configure:15353: checking for gethostbyaddr in -lnsl" >&5 -+echo "configure:15381: checking for gethostbyaddr in -lnsl" >&5 ++echo "configure:15399: checking for gethostbyaddr in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15357,7 +15385,7 @@ else +@@ -15357,7 +15403,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15388,7 +15416,7 @@ else +@@ -15388,7 +15434,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __gethostbyaddr in -lnsl""... $ac_c" 1>&6 -echo "configure:15392: checking for __gethostbyaddr in -lnsl" >&5 -+echo "configure:15420: checking for __gethostbyaddr in -lnsl" >&5 ++echo "configure:15438: checking for __gethostbyaddr in -lnsl" >&5 ac_lib_var=`echo nsl'_'__gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15396,7 +15424,7 @@ else +@@ -15396,7 +15442,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15439,11 +15467,11 @@ fi +@@ -15439,11 +15485,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:15475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:15493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -15494,12 +15522,12 @@ EOF +@@ -15494,12 +15540,12 @@ EOF unset found echo $ac_n "checking for yp_get_default_domain""... $ac_c" 1>&6 -echo "configure:15498: checking for yp_get_default_domain" >&5 -+echo "configure:15526: checking for yp_get_default_domain" >&5 ++echo "configure:15544: checking for yp_get_default_domain" >&5 if eval "test \"`echo '$''{'ac_cv_func_yp_get_default_domain'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_yp_get_default_domain=yes" else -@@ -15540,12 +15568,12 @@ if eval "test \"`echo '$ac_cv_func_'yp_g +@@ -15540,12 +15586,12 @@ if eval "test \"`echo '$ac_cv_func_'yp_g else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __yp_get_default_domain""... $ac_c" 1>&6 -echo "configure:15544: checking for __yp_get_default_domain" >&5 -+echo "configure:15572: checking for __yp_get_default_domain" >&5 ++echo "configure:15590: checking for __yp_get_default_domain" >&5 if eval "test \"`echo '$''{'ac_cv_func___yp_get_default_domain'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___yp_get_default_domain=yes" else -@@ -15606,7 +15634,7 @@ EOF +@@ -15606,7 +15652,7 @@ EOF unset ac_cv_lib_nsl___yp_get_default_domain unset found echo $ac_n "checking for yp_get_default_domain in -lnsl""... $ac_c" 1>&6 -echo "configure:15610: checking for yp_get_default_domain in -lnsl" >&5 -+echo "configure:15638: checking for yp_get_default_domain in -lnsl" >&5 ++echo "configure:15656: checking for yp_get_default_domain in -lnsl" >&5 ac_lib_var=`echo nsl'_'yp_get_default_domain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15614,7 +15642,7 @@ else +@@ -15614,7 +15660,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15645,7 +15673,7 @@ else +@@ -15645,7 +15691,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __yp_get_default_domain in -lnsl""... $ac_c" 1>&6 -echo "configure:15649: checking for __yp_get_default_domain in -lnsl" >&5 -+echo "configure:15677: checking for __yp_get_default_domain in -lnsl" >&5 ++echo "configure:15695: checking for __yp_get_default_domain in -lnsl" >&5 ac_lib_var=`echo nsl'_'__yp_get_default_domain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15653,7 +15681,7 @@ else +@@ -15653,7 +15699,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15696,11 +15724,11 @@ fi +@@ -15696,11 +15742,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:15732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:15750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -15752,12 +15780,12 @@ EOF +@@ -15752,12 +15798,12 @@ EOF unset found echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:15756: checking for dlopen" >&5 -+echo "configure:15784: checking for dlopen" >&5 ++echo "configure:15802: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else -@@ -15798,12 +15826,12 @@ if eval "test \"`echo '$ac_cv_func_'dlop +@@ -15798,12 +15844,12 @@ if eval "test \"`echo '$ac_cv_func_'dlop else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __dlopen""... $ac_c" 1>&6 -echo "configure:15802: checking for __dlopen" >&5 -+echo "configure:15830: checking for __dlopen" >&5 ++echo "configure:15848: checking for __dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func___dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___dlopen=yes" else -@@ -15864,7 +15892,7 @@ EOF +@@ -15864,7 +15910,7 @@ EOF unset ac_cv_lib_dl___dlopen unset found echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:15868: checking for dlopen in -ldl" >&5 -+echo "configure:15896: checking for dlopen in -ldl" >&5 ++echo "configure:15914: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15872,7 +15900,7 @@ else +@@ -15872,7 +15918,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15903,7 +15931,7 @@ else +@@ -15903,7 +15949,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:15907: checking for __dlopen in -ldl" >&5 -+echo "configure:15935: checking for __dlopen in -ldl" >&5 ++echo "configure:15953: checking for __dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'__dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -15911,7 +15939,7 @@ else +@@ -15911,7 +15957,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:15954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -15954,11 +15982,11 @@ fi +@@ -15954,11 +16000,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:15990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:16008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -16010,7 +16038,7 @@ EOF +@@ -16010,7 +16056,7 @@ EOF fi echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:16014: checking for sin in -lm" >&5 -+echo "configure:16042: checking for sin in -lm" >&5 ++echo "configure:16060: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16018,7 +16046,7 @@ else +@@ -16018,7 +16064,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16063,12 +16091,12 @@ fi +@@ -16063,12 +16109,12 @@ fi unset found echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:16067: checking for inet_aton" >&5 -+echo "configure:16095: checking for inet_aton" >&5 ++echo "configure:16113: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else -@@ -16109,12 +16137,12 @@ if eval "test \"`echo '$ac_cv_func_'inet +@@ -16109,12 +16155,12 @@ if eval "test \"`echo '$ac_cv_func_'inet else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __inet_aton""... $ac_c" 1>&6 -echo "configure:16113: checking for __inet_aton" >&5 -+echo "configure:16141: checking for __inet_aton" >&5 ++echo "configure:16159: checking for __inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func___inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___inet_aton=yes" else -@@ -16175,7 +16203,7 @@ EOF +@@ -16175,7 +16221,7 @@ EOF unset ac_cv_lib_resolv___inet_aton unset found echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:16179: checking for inet_aton in -lresolv" >&5 -+echo "configure:16207: checking for inet_aton in -lresolv" >&5 ++echo "configure:16225: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16183,7 +16211,7 @@ else +@@ -16183,7 +16229,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16214,7 +16242,7 @@ else +@@ -16214,7 +16260,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:16218: checking for __inet_aton in -lresolv" >&5 -+echo "configure:16246: checking for __inet_aton in -lresolv" >&5 ++echo "configure:16264: checking for __inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'__inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16222,7 +16250,7 @@ else +@@ -16222,7 +16268,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16265,11 +16293,11 @@ fi +@@ -16265,11 +16311,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:16301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:16319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -16311,7 +16339,7 @@ EOF +@@ -16311,7 +16357,7 @@ EOF unset ac_cv_lib_bind___inet_aton unset found echo $ac_n "checking for inet_aton in -lbind""... $ac_c" 1>&6 -echo "configure:16315: checking for inet_aton in -lbind" >&5 -+echo "configure:16343: checking for inet_aton in -lbind" >&5 ++echo "configure:16361: checking for inet_aton in -lbind" >&5 ac_lib_var=`echo bind'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16319,7 +16347,7 @@ else +@@ -16319,7 +16365,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16350,7 +16378,7 @@ else +@@ -16350,7 +16396,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __inet_aton in -lbind""... $ac_c" 1>&6 -echo "configure:16354: checking for __inet_aton in -lbind" >&5 -+echo "configure:16382: checking for __inet_aton in -lbind" >&5 ++echo "configure:16400: checking for __inet_aton in -lbind" >&5 ac_lib_var=`echo bind'_'__inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16358,7 +16386,7 @@ else +@@ -16358,7 +16404,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16401,11 +16429,11 @@ fi +@@ -16401,11 +16447,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:16437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:16455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -16456,12 +16484,12 @@ EOF +@@ -16456,12 +16502,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:16460: checking for ANSI C header files" >&5 -+echo "configure:16488: checking for ANSI C header files" >&5 ++echo "configure:16506: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -16469,7 +16497,7 @@ else +@@ -16469,7 +16515,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:16501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:16519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -16486,7 +16514,7 @@ rm -f conftest* +@@ -16486,7 +16532,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF -@@ -16504,7 +16532,7 @@ fi +@@ -16504,7 +16550,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF -@@ -16525,7 +16553,7 @@ if test "$cross_compiling" = yes; then +@@ -16525,7 +16571,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -@@ -16536,7 +16564,7 @@ if (XOR (islower (i), ISLOWER (i)) || to +@@ -16536,7 +16582,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:16540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:16568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:16586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else -@@ -16564,12 +16592,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di +@@ -16564,12 +16610,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:16568: checking for $ac_hdr that defines DIR" >&5 -+echo "configure:16596: checking for $ac_hdr that defines DIR" >&5 ++echo "configure:16614: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> -@@ -16577,7 +16605,7 @@ int main() { +@@ -16577,7 +16623,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:16581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:16609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:16627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else -@@ -16602,7 +16630,7 @@ done +@@ -16602,7 +16648,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:16606: checking for opendir in -ldir" >&5 -+echo "configure:16634: checking for opendir in -ldir" >&5 ++echo "configure:16652: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16610,7 +16638,7 @@ else +@@ -16610,7 +16656,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16643,7 +16671,7 @@ fi +@@ -16643,7 +16689,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:16647: checking for opendir in -lx" >&5 -+echo "configure:16675: checking for opendir in -lx" >&5 ++echo "configure:16693: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -16651,7 +16679,7 @@ else +@@ -16651,7 +16697,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -16744,17 +16772,17 @@ assert.h +@@ -16744,17 +16790,17 @@ assert.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16748: checking for $ac_hdr" >&5 -+echo "configure:16776: checking for $ac_hdr" >&5 ++echo "configure:16794: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:16786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:16804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -16783,12 +16811,12 @@ done +@@ -16783,12 +16829,12 @@ done echo $ac_n "checking for fopencookie""... $ac_c" 1>&6 -echo "configure:16787: checking for fopencookie" >&5 -+echo "configure:16815: checking for fopencookie" >&5 ++echo "configure:16833: checking for fopencookie" >&5 if eval "test \"`echo '$''{'ac_cv_func_fopencookie'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:16843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:16861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_fopencookie=yes" else -@@ -16833,7 +16861,7 @@ fi +@@ -16833,7 +16879,7 @@ fi if test "$have_glibc_fopencookie" = "yes"; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:16875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:16893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_cookie_io_functions_t=yes else -@@ -16862,7 +16890,7 @@ if test "$cross_compiling" = yes; then +@@ -16862,7 +16908,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:16926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:16944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cookie_io_functions_use_off64_t=yes -@@ -16914,7 +16942,7 @@ fi +@@ -16914,7 +16960,7 @@ fi else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:16956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:16974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_IO_cookie_io_functions_t=yes else -@@ -16958,7 +16986,7 @@ EOF +@@ -16958,7 +17004,7 @@ EOF echo $ac_n "checking for broken getcwd""... $ac_c" 1>&6 -echo "configure:16962: checking for broken getcwd" >&5 -+echo "configure:16990: checking for broken getcwd" >&5 ++echo "configure:17008: checking for broken getcwd" >&5 os=`uname -sr 2>/dev/null` case $os in SunOS*) -@@ -16973,14 +17001,14 @@ EOF +@@ -16973,14 +17019,14 @@ EOF echo $ac_n "checking for broken libc stdio""... $ac_c" 1>&6 -echo "configure:16977: checking for broken libc stdio" >&5 -+echo "configure:17005: checking for broken libc stdio" >&5 ++echo "configure:17023: checking for broken libc stdio" >&5 if eval "test \"`echo '$''{'_cv_have_broken_glibc_fopen_append'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2899,118 +2924,118 @@ if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -@@ -16993,7 +17021,7 @@ choke me +@@ -16993,7 +17039,7 @@ choke me ; return 0; } EOF -if { (eval echo configure:16997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* _cv_have_broken_glibc_fopen_append=yes else -@@ -17006,7 +17034,7 @@ rm -f conftest* +@@ -17006,7 +17052,7 @@ rm -f conftest* else cat > conftest.$ac_ext < -@@ -17034,7 +17062,7 @@ int main(int argc, char *argv[]) +@@ -17034,7 +17080,7 @@ int main(int argc, char *argv[]) } EOF -if { (eval echo configure:17038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then _cv_have_broken_glibc_fopen_append=no else -@@ -17062,12 +17090,12 @@ EOF +@@ -17062,12 +17108,12 @@ EOF echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:17066: checking whether struct tm is in sys/time.h or time.h" >&5 -+echo "configure:17094: checking whether struct tm is in sys/time.h or time.h" >&5 ++echo "configure:17112: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -17075,7 +17103,7 @@ int main() { +@@ -17075,7 +17121,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:17079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else -@@ -17096,12 +17124,12 @@ EOF +@@ -17096,12 +17142,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:17100: checking for tm_zone in struct tm" >&5 -+echo "configure:17128: checking for tm_zone in struct tm" >&5 ++echo "configure:17146: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> -@@ -17109,7 +17137,7 @@ int main() { +@@ -17109,7 +17155,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:17113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else -@@ -17129,12 +17157,12 @@ EOF +@@ -17129,12 +17175,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:17133: checking for tzname" >&5 -+echo "configure:17161: checking for tzname" >&5 ++echo "configure:17179: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ -@@ -17144,7 +17172,7 @@ int main() { +@@ -17144,7 +17190,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:17148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:17176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:17194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else -@@ -17168,16 +17196,16 @@ fi +@@ -17168,16 +17214,16 @@ fi echo $ac_n "checking for missing declarations of reentrant functions""... $ac_c" 1>&6 -echo "configure:17172: checking for missing declarations of reentrant functions" >&5 -+echo "configure:17200: checking for missing declarations of reentrant functions" >&5 ++echo "configure:17218: checking for missing declarations of reentrant functions" >&5 cat > conftest.$ac_ext < int main() { @@ -3018,16 +3043,16 @@ ; return 0; } EOF -if { (eval echo configure:17181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : -@@ -17195,14 +17223,14 @@ EOF +@@ -17195,14 +17241,14 @@ EOF fi rm -f conftest* cat > conftest.$ac_ext < int main() { @@ -3035,16 +3060,16 @@ ; return 0; } EOF -if { (eval echo configure:17206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : -@@ -17220,14 +17248,14 @@ EOF +@@ -17220,14 +17266,14 @@ EOF fi rm -f conftest* cat > conftest.$ac_ext < int main() { @@ -3052,16 +3077,16 @@ ; return 0; } EOF -if { (eval echo configure:17231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : -@@ -17245,14 +17273,14 @@ EOF +@@ -17245,14 +17291,14 @@ EOF fi rm -f conftest* cat > conftest.$ac_ext < int main() { @@ -3069,16 +3094,16 @@ ; return 0; } EOF -if { (eval echo configure:17256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : -@@ -17270,14 +17298,14 @@ EOF +@@ -17270,14 +17316,14 @@ EOF fi rm -f conftest* cat > conftest.$ac_ext < int main() { @@ -3086,19 +3111,19 @@ ; return 0; } EOF -if { (eval echo configure:17281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* : -@@ -17298,16 +17326,16 @@ rm -f conftest* +@@ -17298,16 +17344,16 @@ rm -f conftest* echo $ac_n "checking for fclose declaration""... $ac_c" 1>&6 -echo "configure:17302: checking for fclose declaration" >&5 -+echo "configure:17330: checking for fclose declaration" >&5 ++echo "configure:17348: checking for fclose declaration" >&5 cat > conftest.$ac_ext < int main() { @@ -3106,97 +3131,97 @@ ; return 0; } EOF -if { (eval echo configure:17311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF -@@ -17333,12 +17361,12 @@ rm -f conftest* +@@ -17333,12 +17379,12 @@ rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:17337: checking for tm_gmtoff in struct tm" >&5 -+echo "configure:17365: checking for tm_gmtoff in struct tm" >&5 ++echo "configure:17383: checking for tm_gmtoff in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_gmtoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> -@@ -17346,7 +17374,7 @@ int main() { +@@ -17346,7 +17392,7 @@ int main() { struct tm tm; tm.tm_gmtoff; ; return 0; } EOF -if { (eval echo configure:17350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_gmtoff=yes else -@@ -17369,12 +17397,12 @@ fi +@@ -17369,12 +17415,12 @@ fi echo $ac_n "checking for struct flock""... $ac_c" 1>&6 -echo "configure:17373: checking for struct flock" >&5 -+echo "configure:17401: checking for struct flock" >&5 ++echo "configure:17419: checking for struct flock" >&5 if eval "test \"`echo '$''{'ac_cv_struct_flock'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -17384,7 +17412,7 @@ int main() { +@@ -17384,7 +17430,7 @@ int main() { struct flock x; ; return 0; } EOF -if { (eval echo configure:17388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_flock=yes -@@ -17411,12 +17439,12 @@ fi +@@ -17411,12 +17457,12 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:17415: checking for socklen_t" >&5 -+echo "configure:17443: checking for socklen_t" >&5 ++echo "configure:17461: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -17428,7 +17456,7 @@ socklen_t x; +@@ -17428,7 +17474,7 @@ socklen_t x; ; return 0; } EOF -if { (eval echo configure:17432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_socklen_t=yes -@@ -17454,7 +17482,7 @@ fi +@@ -17454,7 +17500,7 @@ fi echo $ac_n "checking size of size_t""... $ac_c" 1>&6 -echo "configure:17458: checking size of size_t" >&5 -+echo "configure:17486: checking size of size_t" >&5 ++echo "configure:17504: checking size of size_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -17462,18 +17490,19 @@ else +@@ -17462,18 +17508,19 @@ else ac_cv_sizeof_size_t=8 else cat > conftest.$ac_ext < -int main() @@ -3212,25 +3237,25 @@ } EOF -if { (eval echo configure:17477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_size_t=`cat conftestval` else -@@ -17493,7 +17522,7 @@ EOF +@@ -17493,7 +17540,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:17497: checking size of long long" >&5 -+echo "configure:17526: checking size of long long" >&5 ++echo "configure:17544: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -17501,18 +17530,19 @@ else +@@ -17501,18 +17548,19 @@ else ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext < -int main() @@ -3246,25 +3271,25 @@ } EOF -if { (eval echo configure:17516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else -@@ -17532,7 +17562,7 @@ EOF +@@ -17532,7 +17580,7 @@ EOF echo $ac_n "checking size of long long int""... $ac_c" 1>&6 -echo "configure:17536: checking size of long long int" >&5 -+echo "configure:17566: checking size of long long int" >&5 ++echo "configure:17584: checking size of long long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -17540,18 +17570,19 @@ else +@@ -17540,18 +17588,19 @@ else ac_cv_sizeof_long_long_int=8 else cat > conftest.$ac_ext < -int main() @@ -3280,25 +3305,25 @@ } EOF -if { (eval echo configure:17555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long_int=`cat conftestval` else -@@ -17571,7 +17602,7 @@ EOF +@@ -17571,7 +17620,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:17575: checking size of long" >&5 -+echo "configure:17606: checking size of long" >&5 ++echo "configure:17624: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -17579,18 +17610,19 @@ else +@@ -17579,18 +17628,19 @@ else ac_cv_sizeof_long=8 else cat > conftest.$ac_ext < -int main() @@ -3314,25 +3339,25 @@ } EOF -if { (eval echo configure:17594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else -@@ -17610,7 +17642,7 @@ EOF +@@ -17610,7 +17660,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:17614: checking size of int" >&5 -+echo "configure:17646: checking size of int" >&5 ++echo "configure:17664: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -17618,18 +17650,19 @@ else +@@ -17618,18 +17668,19 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < -int main() @@ -3348,418 +3373,418 @@ } EOF -if { (eval echo configure:17633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else -@@ -17651,7 +17684,7 @@ EOF +@@ -17651,7 +17702,7 @@ EOF echo $ac_n "checking size of intmax_t""... $ac_c" 1>&6 -echo "configure:17655: checking size of intmax_t" >&5 -+echo "configure:17688: checking size of intmax_t" >&5 ++echo "configure:17706: checking size of intmax_t" >&5 php_cache_value=php_cv_sizeof_intmax_t if eval "test \"`echo '$''{'php_cv_sizeof_intmax_t'+set}'`\" = set"; then -@@ -17668,7 +17701,7 @@ else +@@ -17668,7 +17719,7 @@ else else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -17692,7 +17725,7 @@ int main() +@@ -17692,7 +17743,7 @@ int main() } EOF -if { (eval echo configure:17696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then eval $php_cache_value=`cat conftestval` -@@ -17731,7 +17764,7 @@ EOF +@@ -17731,7 +17782,7 @@ EOF echo $ac_n "checking size of ssize_t""... $ac_c" 1>&6 -echo "configure:17735: checking size of ssize_t" >&5 -+echo "configure:17768: checking size of ssize_t" >&5 ++echo "configure:17786: checking size of ssize_t" >&5 php_cache_value=php_cv_sizeof_ssize_t if eval "test \"`echo '$''{'php_cv_sizeof_ssize_t'+set}'`\" = set"; then -@@ -17748,7 +17781,7 @@ else +@@ -17748,7 +17799,7 @@ else else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -17772,7 +17805,7 @@ int main() +@@ -17772,7 +17823,7 @@ int main() } EOF -if { (eval echo configure:17776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then eval $php_cache_value=`cat conftestval` -@@ -17811,7 +17844,7 @@ EOF +@@ -17811,7 +17862,7 @@ EOF echo $ac_n "checking size of ptrdiff_t""... $ac_c" 1>&6 -echo "configure:17815: checking size of ptrdiff_t" >&5 -+echo "configure:17848: checking size of ptrdiff_t" >&5 ++echo "configure:17866: checking size of ptrdiff_t" >&5 php_cache_value=php_cv_sizeof_ptrdiff_t if eval "test \"`echo '$''{'php_cv_sizeof_ptrdiff_t'+set}'`\" = set"; then -@@ -17828,7 +17861,7 @@ else +@@ -17828,7 +17879,7 @@ else else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -17852,7 +17885,7 @@ int main() +@@ -17852,7 +17903,7 @@ int main() } EOF -if { (eval echo configure:17856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:17889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:17907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then eval $php_cache_value=`cat conftestval` -@@ -17891,12 +17924,12 @@ EOF +@@ -17891,12 +17942,12 @@ EOF echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:17895: checking for st_blksize in struct stat" >&5 -+echo "configure:17928: checking for st_blksize in struct stat" >&5 ++echo "configure:17946: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -17904,7 +17937,7 @@ int main() { +@@ -17904,7 +17955,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:17908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else -@@ -17926,12 +17959,12 @@ fi +@@ -17926,12 +17977,12 @@ fi if test "`uname -s 2>/dev/null`" != "QNX"; then echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:17930: checking for st_blocks in struct stat" >&5 -+echo "configure:17963: checking for st_blocks in struct stat" >&5 ++echo "configure:17981: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -17939,7 +17972,7 @@ int main() { +@@ -17939,7 +17990,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:17943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:17976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else -@@ -17966,12 +17999,12 @@ else +@@ -17966,12 +18017,12 @@ else WARNING_LEVEL=0 fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:17970: checking for st_rdev in struct stat" >&5 -+echo "configure:18003: checking for st_rdev in struct stat" >&5 ++echo "configure:18021: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -17979,7 +18012,7 @@ int main() { +@@ -17979,7 +18030,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:17983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:18016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:18034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else -@@ -18001,12 +18034,12 @@ fi +@@ -18001,12 +18052,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:18005: checking for size_t" >&5 -+echo "configure:18038: checking for size_t" >&5 ++echo "configure:18056: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -18034,12 +18067,12 @@ EOF +@@ -18034,12 +18085,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:18038: checking for uid_t in sys/types.h" >&5 -+echo "configure:18071: checking for uid_t in sys/types.h" >&5 ++echo "configure:18089: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF -@@ -18070,12 +18103,12 @@ fi +@@ -18070,12 +18121,12 @@ fi echo $ac_n "checking for struct sockaddr_storage""... $ac_c" 1>&6 -echo "configure:18074: checking for struct sockaddr_storage" >&5 -+echo "configure:18107: checking for struct sockaddr_storage" >&5 ++echo "configure:18125: checking for struct sockaddr_storage" >&5 if eval "test \"`echo '$''{'ac_cv_sockaddr_storage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -18083,7 +18116,7 @@ int main() { +@@ -18083,7 +18134,7 @@ int main() { struct sockaddr_storage s; s ; return 0; } EOF -if { (eval echo configure:18087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:18120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:18138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sockaddr_storage=yes else -@@ -18104,13 +18137,13 @@ EOF +@@ -18104,13 +18155,13 @@ EOF fi echo $ac_n "checking for field sa_len in struct sockaddr""... $ac_c" 1>&6 -echo "configure:18108: checking for field sa_len in struct sockaddr" >&5 -+echo "configure:18141: checking for field sa_len in struct sockaddr" >&5 ++echo "configure:18159: checking for field sa_len in struct sockaddr" >&5 if eval "test \"`echo '$''{'ac_cv_sockaddr_sa_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -18118,7 +18151,7 @@ int main() { +@@ -18118,7 +18169,7 @@ int main() { static struct sockaddr sa; int n = (int) sa.sa_len; return n; ; return 0; } EOF -if { (eval echo configure:18122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:18155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:18173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sockaddr_sa_len=yes else -@@ -18141,12 +18174,12 @@ EOF +@@ -18141,12 +18192,12 @@ EOF echo $ac_n "checking for IPv6 support""... $ac_c" 1>&6 -echo "configure:18145: checking for IPv6 support" >&5 -+echo "configure:18178: checking for IPv6 support" >&5 ++echo "configure:18196: checking for IPv6 support" >&5 if eval "test \"`echo '$''{'ac_cv_ipv6_support'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -18155,7 +18188,7 @@ int main() { +@@ -18155,7 +18206,7 @@ int main() { struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ; return 0; } EOF -if { (eval echo configure:18159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_ipv6_support=yes else -@@ -18171,12 +18204,12 @@ echo "$ac_t""$ac_cv_ipv6_support" 1>&6 +@@ -18171,12 +18222,12 @@ echo "$ac_t""$ac_cv_ipv6_support" 1>&6 echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:18175: checking for vprintf" >&5 -+echo "configure:18208: checking for vprintf" >&5 ++echo "configure:18226: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else -@@ -18223,12 +18256,12 @@ fi +@@ -18223,12 +18274,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:18227: checking for _doprnt" >&5 -+echo "configure:18260: checking for _doprnt" >&5 ++echo "configure:18278: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else -@@ -18359,12 +18392,12 @@ asprintf \ +@@ -18359,12 +18410,12 @@ asprintf \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:18363: checking for $ac_func" >&5 -+echo "configure:18396: checking for $ac_func" >&5 ++echo "configure:18414: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -18418,7 +18451,7 @@ done +@@ -18418,7 +18469,7 @@ done unset ac_cv_lib_rt___nanosleep unset found echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6 -echo "configure:18422: checking for nanosleep in -lrt" >&5 -+echo "configure:18455: checking for nanosleep in -lrt" >&5 ++echo "configure:18473: checking for nanosleep in -lrt" >&5 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -18426,7 +18459,7 @@ else +@@ -18426,7 +18477,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -18457,7 +18490,7 @@ else +@@ -18457,7 +18508,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __nanosleep in -lrt""... $ac_c" 1>&6 -echo "configure:18461: checking for __nanosleep in -lrt" >&5 -+echo "configure:18494: checking for __nanosleep in -lrt" >&5 ++echo "configure:18512: checking for __nanosleep in -lrt" >&5 ac_lib_var=`echo rt'_'__nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -18465,7 +18498,7 @@ else +@@ -18465,7 +18516,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -18508,11 +18541,11 @@ fi +@@ -18508,11 +18559,11 @@ fi found=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:18549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:18567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then found=yes else -@@ -18556,25 +18589,25 @@ EOF +@@ -18556,25 +18607,25 @@ EOF echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 -echo "configure:18560: checking for getaddrinfo" >&5 -+echo "configure:18593: checking for getaddrinfo" >&5 ++echo "configure:18611: checking for getaddrinfo" >&5 if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -3767,89 +3792,89 @@ ; return 0; } EOF -if { (eval echo configure:18572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* if test "$cross_compiling" = yes; then ac_cv_func_getaddrinfo=no else cat > conftest.$ac_ext < -@@ -18614,7 +18647,7 @@ int main(void) { +@@ -18614,7 +18665,7 @@ int main(void) { } EOF -if { (eval echo configure:18618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:18651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:18669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_getaddrinfo=yes else -@@ -18646,12 +18679,12 @@ fi +@@ -18646,12 +18697,12 @@ fi for ac_func in strlcat strlcpy getopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:18650: checking for $ac_func" >&5 -+echo "configure:18683: checking for $ac_func" >&5 ++echo "configure:18701: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -18701,7 +18734,7 @@ done +@@ -18701,7 +18752,7 @@ done echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:18705: checking whether utime accepts a null argument" >&5 -+echo "configure:18738: checking whether utime accepts a null argument" >&5 ++echo "configure:18756: checking whether utime accepts a null argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -18711,7 +18744,7 @@ if test "$cross_compiling" = yes; then +@@ -18711,7 +18762,7 @@ if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include -@@ -18722,7 +18755,7 @@ exit(!(stat ("conftestdata", &s) == 0 && +@@ -18722,7 +18773,7 @@ exit(!(stat ("conftestdata", &s) == 0 && && t.st_mtime - s.st_mtime < 120)); } EOF -if { (eval echo configure:18726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:18759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:18777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_utime_null=yes else -@@ -18748,19 +18781,19 @@ fi +@@ -18748,19 +18799,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:18752: checking for working alloca.h" >&5 -+echo "configure:18785: checking for working alloca.h" >&5 ++echo "configure:18803: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -3857,284 +3882,284 @@ ; return 0; } EOF -if { (eval echo configure:18764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else -@@ -18781,12 +18814,12 @@ EOF +@@ -18781,12 +18832,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:18785: checking for alloca" >&5 -+echo "configure:18818: checking for alloca" >&5 ++echo "configure:18836: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else -@@ -18846,12 +18879,12 @@ EOF +@@ -18846,12 +18897,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:18850: checking whether alloca needs Cray hooks" >&5 -+echo "configure:18883: checking whether alloca needs Cray hooks" >&5 ++echo "configure:18901: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 +@@ -18876,12 +18927,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:18880: checking for $ac_func" >&5 -+echo "configure:18913: checking for $ac_func" >&5 ++echo "configure:18931: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:18941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:18959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -18931,7 +18964,7 @@ done +@@ -18931,7 +18982,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:18935: checking stack direction for C alloca" >&5 -+echo "configure:18968: checking stack direction for C alloca" >&5 ++echo "configure:18986: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -18939,7 +18972,7 @@ else +@@ -18939,7 +18990,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:18995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else -@@ -18981,13 +19014,13 @@ fi +@@ -18981,13 +19032,13 @@ fi echo $ac_n "checking for declared timezone""... $ac_c" 1>&6 -echo "configure:18985: checking for declared timezone" >&5 -+echo "configure:19018: checking for declared timezone" >&5 ++echo "configure:19036: checking for declared timezone" >&5 if eval "test \"`echo '$''{'ac_cv_declared_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -19002,7 +19035,7 @@ int main() { +@@ -19002,7 +19053,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:19006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:19039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:19057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_declared_timezone=yes -@@ -19028,7 +19061,7 @@ EOF +@@ -19028,7 +19079,7 @@ EOF echo $ac_n "checking for type of reentrant time-related functions""... $ac_c" 1>&6 -echo "configure:19032: checking for type of reentrant time-related functions" >&5 -+echo "configure:19065: checking for type of reentrant time-related functions" >&5 ++echo "configure:19083: checking for type of reentrant time-related functions" >&5 if eval "test \"`echo '$''{'ac_cv_time_r_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -19039,7 +19072,7 @@ if test "$cross_compiling" = yes; then +@@ -19039,7 +19090,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -19057,7 +19090,7 @@ return (1); +@@ -19057,7 +19108,7 @@ return (1); } EOF -if { (eval echo configure:19061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:19094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_time_r_type=hpux -@@ -19073,7 +19106,7 @@ else +@@ -19073,7 +19124,7 @@ else else cat > conftest.$ac_ext < -@@ -19089,7 +19122,7 @@ main() { +@@ -19089,7 +19140,7 @@ main() { } EOF -if { (eval echo configure:19093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:19126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_time_r_type=irix -@@ -19127,12 +19160,12 @@ EOF +@@ -19127,12 +19178,12 @@ EOF echo $ac_n "checking for readdir_r""... $ac_c" 1>&6 -echo "configure:19131: checking for readdir_r" >&5 -+echo "configure:19164: checking for readdir_r" >&5 ++echo "configure:19182: checking for readdir_r" >&5 if eval "test \"`echo '$''{'ac_cv_func_readdir_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:19192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:19210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_readdir_r=yes" else -@@ -19177,7 +19210,7 @@ fi +@@ -19177,7 +19228,7 @@ fi if test "$ac_cv_func_readdir_r" = "yes"; then echo $ac_n "checking for type of readdir_r""... $ac_c" 1>&6 -echo "configure:19181: checking for type of readdir_r" >&5 -+echo "configure:19214: checking for type of readdir_r" >&5 ++echo "configure:19232: checking for type of readdir_r" >&5 if eval "test \"`echo '$''{'ac_cv_what_readdir_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -19188,7 +19221,7 @@ else +@@ -19188,7 +19239,7 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:19250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_what_readdir_r=POSIX -@@ -19224,7 +19257,7 @@ else +@@ -19224,7 +19275,7 @@ else rm -fr conftest* cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:19271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:19289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -19276,12 +19309,12 @@ EOF +@@ -19276,12 +19327,12 @@ EOF echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 -echo "configure:19280: checking for in_addr_t" >&5 -+echo "configure:19313: checking for in_addr_t" >&5 ++echo "configure:19331: checking for in_addr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_in_addr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -19315,12 +19348,12 @@ fi +@@ -19315,12 +19366,12 @@ fi for ac_func in crypt_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:19319: checking for $ac_func" >&5 -+echo "configure:19352: checking for $ac_func" >&5 ++echo "configure:19370: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:19380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:19398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -19371,14 +19404,14 @@ done +@@ -19371,14 +19422,14 @@ done if test "x$php_crypt_r" = "x1"; then echo $ac_n "checking which data struct is used by crypt_r""... $ac_c" 1>&6 -echo "configure:19375: checking which data struct is used by crypt_r" >&5 -+echo "configure:19408: checking which data struct is used by crypt_r" >&5 ++echo "configure:19426: checking which data struct is used by crypt_r" >&5 if eval "test \"`echo '$''{'php_cv_crypt_r_style'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4142,250 +4167,250 @@ php_cv_crypt_r_style=none cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:19428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:19446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* php_cv_crypt_r_style=cryptd else -@@ -19402,7 +19435,7 @@ rm -f conftest* +@@ -19402,7 +19453,7 @@ rm -f conftest* if test "$php_cv_crypt_r_style" = "none"; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:19452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:19470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* php_cv_crypt_r_style=struct_crypt_data else -@@ -19427,7 +19460,7 @@ rm -f conftest* +@@ -19427,7 +19478,7 @@ rm -f conftest* if test "$php_cv_crypt_r_style" = "none"; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:19478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:19496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* php_cv_crypt_r_style=struct_crypt_data_gnu_source else -@@ -19500,7 +19533,7 @@ fi +@@ -19500,7 +19551,7 @@ fi php_enable_gcov=no echo $ac_n "checking whether to include gcov symbols""... $ac_c" 1>&6 -echo "configure:19504: checking whether to include gcov symbols" >&5 -+echo "configure:19537: checking whether to include gcov symbols" >&5 ++echo "configure:19555: checking whether to include gcov symbols" >&5 # Check whether --enable-gcov or --disable-gcov was given. if test "${enable_gcov+set}" = set; then enableval="$enable_gcov" -@@ -19539,7 +19572,7 @@ if test "$PHP_GCOV" = "yes"; then +@@ -19539,7 +19590,7 @@ if test "$PHP_GCOV" = "yes"; then # Extract the first word of "lcov", so it can be a program name with args. set dummy lcov; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:19543: checking for $ac_word" >&5 -+echo "configure:19576: checking for $ac_word" >&5 ++echo "configure:19594: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LTP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -19568,7 +19601,7 @@ fi +@@ -19568,7 +19619,7 @@ fi # Extract the first word of "genhtml", so it can be a program name with args. set dummy genhtml; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:19572: checking for $ac_word" >&5 -+echo "configure:19605: checking for $ac_word" >&5 ++echo "configure:19623: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LTP_GENHTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -19603,7 +19636,7 @@ fi +@@ -19603,7 +19654,7 @@ fi if test "$LTP"; then echo $ac_n "checking for ltp version""... $ac_c" 1>&6 -echo "configure:19607: checking for ltp version" >&5 -+echo "configure:19640: checking for ltp version" >&5 ++echo "configure:19658: checking for ltp version" >&5 if eval "test \"`echo '$''{'php_cv_ltp_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -19660,7 +19693,7 @@ fi +@@ -19660,7 +19711,7 @@ fi php_enable_debug=no echo $ac_n "checking whether to include debugging symbols""... $ac_c" 1>&6 -echo "configure:19664: checking whether to include debugging symbols" >&5 -+echo "configure:19697: checking whether to include debugging symbols" >&5 ++echo "configure:19715: checking whether to include debugging symbols" >&5 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" -@@ -19708,7 +19741,7 @@ fi +@@ -19708,7 +19759,7 @@ fi php_with_layout=PHP echo $ac_n "checking layout of installed files""... $ac_c" 1>&6 -echo "configure:19712: checking layout of installed files" >&5 -+echo "configure:19745: checking layout of installed files" >&5 ++echo "configure:19763: checking layout of installed files" >&5 # Check whether --with-layout or --without-layout was given. if test "${with_layout+set}" = set; then withval="$with_layout" -@@ -19740,7 +19773,7 @@ esac +@@ -19740,7 +19791,7 @@ esac php_with_config_file_path=DEFAULT echo $ac_n "checking path to configuration file""... $ac_c" 1>&6 -echo "configure:19744: checking path to configuration file" >&5 -+echo "configure:19777: checking path to configuration file" >&5 ++echo "configure:19795: checking path to configuration file" >&5 # Check whether --with-config-file-path or --without-config-file-path was given. if test "${with_config_file_path+set}" = set; then withval="$with_config_file_path" -@@ -19771,7 +19804,7 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAU +@@ -19771,7 +19822,7 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAU fi echo $ac_n "checking where to scan for configuration files""... $ac_c" 1>&6 -echo "configure:19775: checking where to scan for configuration files" >&5 -+echo "configure:19808: checking where to scan for configuration files" >&5 ++echo "configure:19826: checking where to scan for configuration files" >&5 php_with_config_file_scan_dir=DEFAULT -@@ -19804,7 +19837,7 @@ test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLA +@@ -19804,7 +19855,7 @@ test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLA php_enable_safe_mode=no echo $ac_n "checking whether to enable safe mode by default""... $ac_c" 1>&6 -echo "configure:19808: checking whether to enable safe mode by default" >&5 -+echo "configure:19841: checking whether to enable safe mode by default" >&5 ++echo "configure:19859: checking whether to enable safe mode by default" >&5 # Check whether --enable-safe-mode or --disable-safe-mode was given. if test "${enable_safe_mode+set}" = set; then enableval="$enable_safe_mode" -@@ -19836,7 +19869,7 @@ EOF +@@ -19836,7 +19887,7 @@ EOF fi echo $ac_n "checking for safe mode exec dir""... $ac_c" 1>&6 -echo "configure:19840: checking for safe mode exec dir" >&5 -+echo "configure:19873: checking for safe mode exec dir" >&5 ++echo "configure:19891: checking for safe mode exec dir" >&5 php_with_exec_dir=no -@@ -19877,7 +19910,7 @@ fi +@@ -19877,7 +19928,7 @@ fi php_enable_sigchild=no echo $ac_n "checking whether to enable PHP's own SIGCHLD handler""... $ac_c" 1>&6 -echo "configure:19881: checking whether to enable PHP's own SIGCHLD handler" >&5 -+echo "configure:19914: checking whether to enable PHP's own SIGCHLD handler" >&5 ++echo "configure:19932: checking whether to enable PHP's own SIGCHLD handler" >&5 # Check whether --enable-sigchild or --disable-sigchild was given. if test "${enable_sigchild+set}" = set; then enableval="$enable_sigchild" -@@ -19912,7 +19945,7 @@ fi +@@ -19912,7 +19963,7 @@ fi php_enable_magic_quotes=no echo $ac_n "checking whether to enable magic quotes by default""... $ac_c" 1>&6 -echo "configure:19916: checking whether to enable magic quotes by default" >&5 -+echo "configure:19949: checking whether to enable magic quotes by default" >&5 ++echo "configure:19967: checking whether to enable magic quotes by default" >&5 # Check whether --enable-magic-quotes or --disable-magic-quotes was given. if test "${enable_magic_quotes+set}" = set; then enableval="$enable_magic_quotes" -@@ -19947,7 +19980,7 @@ fi +@@ -19947,7 +19998,7 @@ fi php_enable_libgcc=no echo $ac_n "checking whether to explicitly link against libgcc""... $ac_c" 1>&6 -echo "configure:19951: checking whether to explicitly link against libgcc" >&5 -+echo "configure:19984: checking whether to explicitly link against libgcc" >&5 ++echo "configure:20002: checking whether to explicitly link against libgcc" >&5 # Check whether --enable-libgcc or --disable-libgcc was given. if test "${enable_libgcc+set}" = set; then enableval="$enable_libgcc" -@@ -20024,7 +20057,7 @@ fi +@@ -20024,7 +20075,7 @@ fi php_enable_short_tags=yes echo $ac_n "checking whether to enable short tags by default""... $ac_c" 1>&6 -echo "configure:20028: checking whether to enable short tags by default" >&5 -+echo "configure:20061: checking whether to enable short tags by default" >&5 ++echo "configure:20079: checking whether to enable short tags by default" >&5 # Check whether --enable-short-tags or --disable-short-tags was given. if test "${enable_short_tags+set}" = set; then enableval="$enable_short_tags" -@@ -20059,7 +20092,7 @@ fi +@@ -20059,7 +20110,7 @@ fi php_enable_dmalloc=no echo $ac_n "checking whether to enable dmalloc""... $ac_c" 1>&6 -echo "configure:20063: checking whether to enable dmalloc" >&5 -+echo "configure:20096: checking whether to enable dmalloc" >&5 ++echo "configure:20114: checking whether to enable dmalloc" >&5 # Check whether --enable-dmalloc or --disable-dmalloc was given. if test "${enable_dmalloc+set}" = set; then enableval="$enable_dmalloc" -@@ -20080,7 +20113,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -20080,7 +20131,7 @@ echo "$ac_t""$ext_output" 1>&6 if test "$PHP_DMALLOC" = "yes"; then echo $ac_n "checking for dmalloc_error in -ldmalloc""... $ac_c" 1>&6 -echo "configure:20084: checking for dmalloc_error in -ldmalloc" >&5 -+echo "configure:20117: checking for dmalloc_error in -ldmalloc" >&5 ++echo "configure:20135: checking for dmalloc_error in -ldmalloc" >&5 ac_lib_var=`echo dmalloc'_'dmalloc_error | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -20088,7 +20121,7 @@ else +@@ -20088,7 +20139,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:20136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:20154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -20144,7 +20177,7 @@ fi +@@ -20144,7 +20195,7 @@ fi php_enable_ipv6=yes echo $ac_n "checking whether to enable IPv6 support""... $ac_c" 1>&6 -echo "configure:20148: checking whether to enable IPv6 support" >&5 -+echo "configure:20181: checking whether to enable IPv6 support" >&5 ++echo "configure:20199: checking whether to enable IPv6 support" >&5 # Check whether --enable-ipv6 or --disable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval="$enable_ipv6" -@@ -20171,7 +20204,7 @@ EOF +@@ -20171,7 +20222,7 @@ EOF fi echo $ac_n "checking how big to make fd sets""... $ac_c" 1>&6 -echo "configure:20175: checking how big to make fd sets" >&5 -+echo "configure:20208: checking how big to make fd sets" >&5 ++echo "configure:20226: checking how big to make fd sets" >&5 php_enable_fd_setsize=no -@@ -20239,7 +20272,7 @@ fi +@@ -20239,7 +20290,7 @@ fi echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:20243: checking size of long" >&5 -+echo "configure:20276: checking size of long" >&5 ++echo "configure:20294: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -20247,18 +20280,19 @@ else +@@ -20247,18 +20298,19 @@ else ac_cv_sizeof_long=8 else cat > conftest.$ac_ext < -int main() @@ -4401,25 +4426,25 @@ } EOF -if { (eval echo configure:20262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:20296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:20314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else -@@ -20278,7 +20312,7 @@ EOF +@@ -20278,7 +20330,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:20282: checking size of int" >&5 -+echo "configure:20316: checking size of int" >&5 ++echo "configure:20334: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -20286,18 +20320,19 @@ else +@@ -20286,18 +20338,19 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < -int main() @@ -4435,512 +4460,512 @@ } EOF -if { (eval echo configure:20301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:20336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:20354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else -@@ -20318,13 +20353,13 @@ EOF +@@ -20318,13 +20371,13 @@ EOF echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:20322: checking for int32_t" >&5 -+echo "configure:20357: checking for int32_t" >&5 ++echo "configure:20375: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_int_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:20382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:20400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_int_type_int32_t=yes else -@@ -20366,13 +20401,13 @@ fi +@@ -20366,13 +20419,13 @@ fi echo $ac_n "checking for uint32_t""... $ac_c" 1>&6 -echo "configure:20370: checking for uint32_t" >&5 -+echo "configure:20405: checking for uint32_t" >&5 ++echo "configure:20423: checking for uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_int_type_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:20430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:20448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_int_type_uint32_t=yes else -@@ -20423,17 +20458,17 @@ stdlib.h +@@ -20423,17 +20476,17 @@ stdlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:20427: checking for $ac_hdr" >&5 -+echo "configure:20462: checking for $ac_hdr" >&5 ++echo "configure:20480: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:20437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:20472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:20490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -20463,12 +20498,12 @@ done +@@ -20463,12 +20516,12 @@ done for ac_func in strtoll atoll strftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:20467: checking for $ac_func" >&5 -+echo "configure:20502: checking for $ac_func" >&5 ++echo "configure:20520: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:20530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:20548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -20953,7 +20988,7 @@ case $PHP_REGEX in +@@ -20953,7 +21006,7 @@ case $PHP_REGEX in esac echo $ac_n "checking which regex library to use""... $ac_c" 1>&6 -echo "configure:20957: checking which regex library to use" >&5 -+echo "configure:20992: checking which regex library to use" >&5 ++echo "configure:21010: checking which regex library to use" >&5 echo "$ac_t""$REGEX_TYPE" 1>&6 if test "$REGEX_TYPE" = "php"; then -@@ -21330,13 +21365,13 @@ elif test "$REGEX_TYPE" = "system"; then +@@ -21330,13 +21383,13 @@ elif test "$REGEX_TYPE" = "system"; then EOF echo $ac_n "checking whether field re_magic exists in struct regex_t""... $ac_c" 1>&6 -echo "configure:21334: checking whether field re_magic exists in struct regex_t" >&5 -+echo "configure:21369: checking whether field re_magic exists in struct regex_t" >&5 ++echo "configure:21387: checking whether field re_magic exists in struct regex_t" >&5 if eval "test \"`echo '$''{'ac_cv_regex_t_re_magic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -21344,7 +21379,7 @@ int main() { +@@ -21344,7 +21397,7 @@ int main() { regex_t rt; rt.re_magic; ; return 0; } EOF -if { (eval echo configure:21348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:21383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:21401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_regex_t_re_magic=yes else -@@ -21370,7 +21405,7 @@ fi +@@ -21370,7 +21423,7 @@ fi php_enable_libxml=yes echo $ac_n "checking whether to enable LIBXML support""... $ac_c" 1>&6 -echo "configure:21374: checking whether to enable LIBXML support" >&5 -+echo "configure:21409: checking whether to enable LIBXML support" >&5 ++echo "configure:21427: checking whether to enable LIBXML support" >&5 # Check whether --enable-libxml or --disable-libxml was given. if test "${enable_libxml+set}" = set; then enableval="$enable_libxml" -@@ -21415,7 +21450,7 @@ if test -z "$PHP_LIBXML_DIR"; then +@@ -21415,7 +21468,7 @@ if test -z "$PHP_LIBXML_DIR"; then php_with_libxml_dir=no echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 -echo "configure:21419: checking libxml2 install dir" >&5 -+echo "configure:21454: checking libxml2 install dir" >&5 ++echo "configure:21472: checking libxml2 install dir" >&5 # Check whether --with-libxml-dir or --without-libxml-dir was given. if test "${with_libxml_dir+set}" = set; then withval="$with_libxml_dir" -@@ -21441,7 +21476,7 @@ if test "$PHP_LIBXML" != "no"; then +@@ -21441,7 +21494,7 @@ if test "$PHP_LIBXML" != "no"; then echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 -echo "configure:21445: checking for xml2-config path" >&5 -+echo "configure:21480: checking for xml2-config path" >&5 ++echo "configure:21498: checking for xml2-config path" >&5 if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -21599,7 +21634,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path +@@ -21599,7 +21652,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 -echo "configure:21603: checking whether libxml build works" >&5 -+echo "configure:21638: checking whether libxml build works" >&5 ++echo "configure:21656: checking whether libxml build works" >&5 if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -21615,7 +21650,7 @@ else +@@ -21615,7 +21668,7 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:21665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:21683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBS=$old_LIBS -@@ -21991,7 +22026,7 @@ fi +@@ -21991,7 +22044,7 @@ fi php_with_openssl=no echo $ac_n "checking for OpenSSL support""... $ac_c" 1>&6 -echo "configure:21995: checking for OpenSSL support" >&5 -+echo "configure:22030: checking for OpenSSL support" >&5 ++echo "configure:22048: checking for OpenSSL support" >&5 # Check whether --with-openssl or --without-openssl was given. if test "${with_openssl+set}" = set; then withval="$with_openssl" -@@ -22035,7 +22070,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -22035,7 +22088,7 @@ echo "$ac_t""$ext_output" 1>&6 php_with_kerberos=no echo $ac_n "checking for Kerberos support""... $ac_c" 1>&6 -echo "configure:22039: checking for Kerberos support" >&5 -+echo "configure:22074: checking for Kerberos support" >&5 ++echo "configure:22092: checking for Kerberos support" >&5 # Check whether --with-kerberos or --without-kerberos was given. if test "${with_kerberos+set}" = set; then withval="$with_kerberos" -@@ -22361,7 +22396,7 @@ EOF +@@ -22361,7 +22414,7 @@ EOF # Extract the first word of "krb5-config", so it can be a program name with args. set dummy krb5-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:22365: checking for $ac_word" >&5 -+echo "configure:22400: checking for $ac_word" >&5 ++echo "configure:22418: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_KRB5_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -22721,7 +22756,7 @@ fi +@@ -22721,7 +22774,7 @@ fi fi echo $ac_n "checking for DSA_get_default_method in -lssl""... $ac_c" 1>&6 -echo "configure:22725: checking for DSA_get_default_method in -lssl" >&5 -+echo "configure:22760: checking for DSA_get_default_method in -lssl" >&5 ++echo "configure:22778: checking for DSA_get_default_method in -lssl" >&5 ac_lib_var=`echo ssl'_'DSA_get_default_method | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -22729,7 +22764,7 @@ else +@@ -22729,7 +22782,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:22779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:22797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -22782,7 +22817,7 @@ fi +@@ -22782,7 +22835,7 @@ fi # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:22786: checking for $ac_word" >&5 -+echo "configure:22821: checking for $ac_word" >&5 ++echo "configure:22839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -22987,9 +23022,9 @@ fi +@@ -22987,9 +23040,9 @@ fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$OPENSSL_INCDIR echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 -echo "configure:22991: checking for OpenSSL version" >&5 -+echo "configure:23026: checking for OpenSSL version" >&5 ++echo "configure:23044: checking for OpenSSL version" >&5 cat > conftest.$ac_ext < -@@ -23144,7 +23179,7 @@ rm -f conftest* +@@ -23144,7 +23197,7 @@ rm -f conftest* done echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 -echo "configure:23148: checking for CRYPTO_free in -lcrypto" >&5 -+echo "configure:23183: checking for CRYPTO_free in -lcrypto" >&5 ++echo "configure:23201: checking for CRYPTO_free in -lcrypto" >&5 ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -23152,7 +23187,7 @@ else +@@ -23152,7 +23205,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:23202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:23220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -23320,7 +23355,7 @@ fi +@@ -23320,7 +23373,7 @@ fi done echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 -echo "configure:23324: checking for SSL_CTX_set_ssl_version in -lssl" >&5 -+echo "configure:23359: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ++echo "configure:23377: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -23328,7 +23363,7 @@ else +@@ -23328,7 +23381,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:23378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:23396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -23481,7 +23516,7 @@ ext_output=$PHP_PCRE_REGEX +@@ -23481,7 +23534,7 @@ ext_output=$PHP_PCRE_REGEX if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then echo $ac_n "checking for PCRE headers location""... $ac_c" 1>&6 -echo "configure:23485: checking for PCRE headers location" >&5 -+echo "configure:23520: checking for PCRE headers location" >&5 ++echo "configure:23538: checking for PCRE headers location" >&5 for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do test -f $i/pcre.h && PCRE_INCDIR=$i done -@@ -23492,7 +23527,7 @@ echo "configure:23485: checking for PCRE +@@ -23492,7 +23545,7 @@ echo "configure:23485: checking for PCRE echo "$ac_t""$PCRE_INCDIR" 1>&6 echo $ac_n "checking for PCRE library location""... $ac_c" 1>&6 -echo "configure:23496: checking for PCRE library location" >&5 -+echo "configure:23531: checking for PCRE library location" >&5 ++echo "configure:23549: checking for PCRE library location" >&5 for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j done -@@ -23914,7 +23949,7 @@ EOF +@@ -23914,7 +23967,7 @@ EOF else echo $ac_n "checking for PCRE library to use""... $ac_c" 1>&6 -echo "configure:23918: checking for PCRE library to use" >&5 -+echo "configure:23953: checking for PCRE library to use" >&5 ++echo "configure:23971: checking for PCRE library to use" >&5 echo "$ac_t""bundled" 1>&6 pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucd.c \ pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c \ -@@ -24251,7 +24286,7 @@ EOF +@@ -24251,7 +24304,7 @@ EOF php_with_sqlite3=yes echo $ac_n "checking whether to enable the SQLite3 extension""... $ac_c" 1>&6 -echo "configure:24255: checking whether to enable the SQLite3 extension" >&5 -+echo "configure:24290: checking whether to enable the SQLite3 extension" >&5 ++echo "configure:24308: checking whether to enable the SQLite3 extension" >&5 # Check whether --with-sqlite3 or --without-sqlite3 was given. if test "${with_sqlite3+set}" = set; then withval="$with_sqlite3" -@@ -24306,7 +24341,7 @@ if test $PHP_SQLITE3 != "no"; then +@@ -24306,7 +24359,7 @@ if test $PHP_SQLITE3 != "no"; then if test $PHP_SQLITE3 != "yes"; then echo $ac_n "checking for sqlite3 files in default path""... $ac_c" 1>&6 -echo "configure:24310: checking for sqlite3 files in default path" >&5 -+echo "configure:24345: checking for sqlite3 files in default path" >&5 ++echo "configure:24363: checking for sqlite3 files in default path" >&5 for i in $PHP_SQLITE3 /usr/local /usr; do if test -r $i/include/sqlite3.h; then SQLITE3_DIR=$i -@@ -24321,7 +24356,7 @@ echo "configure:24310: checking for sqli +@@ -24321,7 +24374,7 @@ echo "configure:24310: checking for sqli fi echo $ac_n "checking for SQLite 3.3.9+""... $ac_c" 1>&6 -echo "configure:24325: checking for SQLite 3.3.9+" >&5 -+echo "configure:24360: checking for SQLite 3.3.9+" >&5 ++echo "configure:24378: checking for SQLite 3.3.9+" >&5 save_old_LDFLAGS=$LDFLAGS ac_stuff=" -@@ -24420,7 +24455,7 @@ echo "configure:24325: checking for SQLi +@@ -24420,7 +24473,7 @@ echo "configure:24325: checking for SQLi done echo $ac_n "checking for sqlite3_prepare_v2 in -lsqlite3""... $ac_c" 1>&6 -echo "configure:24424: checking for sqlite3_prepare_v2 in -lsqlite3" >&5 -+echo "configure:24459: checking for sqlite3_prepare_v2 in -lsqlite3" >&5 ++echo "configure:24477: checking for sqlite3_prepare_v2 in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_prepare_v2 | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -24428,7 +24463,7 @@ else +@@ -24428,7 +24481,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:24478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:24496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -24699,7 +24734,7 @@ fi +@@ -24699,7 +24752,7 @@ fi done echo $ac_n "checking for sqlite3_key in -lsqlite3""... $ac_c" 1>&6 -echo "configure:24703: checking for sqlite3_key in -lsqlite3" >&5 -+echo "configure:24738: checking for sqlite3_key in -lsqlite3" >&5 ++echo "configure:24756: checking for sqlite3_key in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_key | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -24707,7 +24742,7 @@ else +@@ -24707,7 +24760,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:24757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:24775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -24850,7 +24885,7 @@ fi +@@ -24850,7 +24903,7 @@ fi done echo $ac_n "checking for sqlite3_load_extension in -lsqlite3""... $ac_c" 1>&6 -echo "configure:24854: checking for sqlite3_load_extension in -lsqlite3" >&5 -+echo "configure:24889: checking for sqlite3_load_extension in -lsqlite3" >&5 ++echo "configure:24907: checking for sqlite3_load_extension in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_load_extension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -24858,7 +24893,7 @@ else +@@ -24858,7 +24911,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:24908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:24926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -24906,7 +24941,7 @@ fi +@@ -24906,7 +24959,7 @@ fi else echo $ac_n "checking bundled sqlite3 library""... $ac_c" 1>&6 -echo "configure:24910: checking bundled sqlite3 library" >&5 -+echo "configure:24945: checking bundled sqlite3 library" >&5 ++echo "configure:24963: checking bundled sqlite3 library" >&5 echo "$ac_t""yes" 1>&6 sqlite3_extra_sources="libsqlite/sqlite3.c" -@@ -25262,7 +25297,7 @@ fi +@@ -25262,7 +25315,7 @@ fi php_with_zlib=no echo $ac_n "checking for ZLIB support""... $ac_c" 1>&6 -echo "configure:25266: checking for ZLIB support" >&5 -+echo "configure:25301: checking for ZLIB support" >&5 ++echo "configure:25319: checking for ZLIB support" >&5 # Check whether --with-zlib or --without-zlib was given. if test "${with_zlib+set}" = set; then withval="$with_zlib" -@@ -25306,7 +25341,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -25306,7 +25359,7 @@ echo "$ac_t""$ext_output" 1>&6 php_with_zlib_dir=no echo $ac_n "checking if the location of ZLIB install directory is defined""... $ac_c" 1>&6 -echo "configure:25310: checking if the location of ZLIB install directory is defined" >&5 -+echo "configure:25345: checking if the location of ZLIB install directory is defined" >&5 ++echo "configure:25363: checking if the location of ZLIB install directory is defined" >&5 # Check whether --with-zlib-dir or --without-zlib-dir was given. if test "${with_zlib_dir+set}" = set; then withval="$with_zlib_dir" -@@ -25749,7 +25784,7 @@ EOF +@@ -25749,7 +25802,7 @@ EOF done echo $ac_n "checking for gzgets in -lz""... $ac_c" 1>&6 -echo "configure:25753: checking for gzgets in -lz" >&5 -+echo "configure:25788: checking for gzgets in -lz" >&5 ++echo "configure:25806: checking for gzgets in -lz" >&5 ac_lib_var=`echo z'_'gzgets | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -25757,7 +25792,7 @@ else +@@ -25757,7 +25810,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:25807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:25825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -25905,18 +25940,18 @@ fi +@@ -25905,18 +25958,18 @@ fi @@ -4954,7 +4979,7 @@ - enableval="$enable_bcmath" - PHP_BCMATH=$enableval +echo $ac_n "checking whether to enable APC support""... $ac_c" 1>&6 -+echo "configure:25947: checking whether to enable APC support" >&5 ++echo "configure:25965: checking whether to enable APC support" >&5 +# Check whether --enable-apc or --disable-apc was given. +if test "${enable_apc+set}" = set; then + enableval="$enable_apc" @@ -4968,7 +4993,7 @@ fi -@@ -25924,12 +25959,12 @@ fi +@@ -25924,12 +25977,12 @@ fi ext_output="yes, shared" ext_shared=yes @@ -4984,7 +5009,7 @@ ;; no) ext_output=no -@@ -25948,346 +25983,1335 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -25948,396 +26001,481 @@ echo "$ac_t""$ext_output" 1>&6 @@ -5002,31 +5027,16 @@ - if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then - PHP_BCMATH_SHARED=no - -+else - +- - case ext/bcmath in - "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; - /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; - *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; - esac -+ PHP_APC_DEBUG=no -+ -+fi -+ -+ -+echo $ac_n "checking whether we should enable cache request file info""... $ac_c" 1>&6 -+echo "configure:26001: checking whether we should enable cache request file info" >&5 -+# Check whether --enable-apc-filehits or --disable-apc-filehits was given. -+if test "${enable_apc_filehits+set}" = set; then -+ enableval="$enable_apc_filehits" - -+ PHP_APC_FILEHITS=$enableval -+ echo "$ac_t""$enableval" 1>&6 -+ +- +else -+ PHP_APC_FILEHITS=no -+ echo "$ac_t""no" 1>&6 ++ PHP_APC_DEBUG=no - b_c_pre=$php_c_pre - b_cxx_pre=$php_cxx_pre @@ -5044,11 +5054,11 @@ -libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -libbcmath/src/rmzero.c libbcmath/src/str2num.c; do -+echo $ac_n "checking whether we should use mmap""... $ac_c" 1>&6 -+echo "configure:26018: checking whether we should use mmap" >&5 -+# Check whether --enable-apc-mmap or --disable-apc-mmap was given. -+if test "${enable_apc_mmap+set}" = set; then -+ enableval="$enable_apc_mmap" ++echo $ac_n "checking whether we should enable cache request file info""... $ac_c" 1>&6 ++echo "configure:26019: checking whether we should enable cache request file info" >&5 ++# Check whether --enable-apc-filehits or --disable-apc-filehits was given. ++if test "${enable_apc_filehits+set}" = set; then ++ enableval="$enable_apc_filehits" - IFS=. - set $ac_src @@ -5056,8 +5066,8 @@ - IFS=$old_IFS - - PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ PHP_APC_MMAP=$enableval -+ echo "$ac_t""$enableval" 1>&6 ++ PHP_APC_FILEHITS=$enableval ++ echo "$ac_t""$enableval" 1>&6 - case $ac_src in - *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; @@ -5067,8 +5077,8 @@ - esac +else + -+ PHP_APC_MMAP=yes -+ echo "$ac_t""yes" 1>&6 ++ PHP_APC_FILEHITS=no ++ echo "$ac_t""no" 1>&6 - cat >>Makefile.objects<&6 -+echo "configure:26035: checking whether we should use semaphore locking instead of fcntl" >&5 -+# Check whether --enable-apc-sem or --disable-apc-sem was given. -+if test "${enable_apc_sem+set}" = set; then -+ enableval="$enable_apc_sem" ++echo $ac_n "checking whether we should use mmap""... $ac_c" 1>&6 ++echo "configure:26036: checking whether we should use mmap" >&5 ++# Check whether --enable-apc-mmap or --disable-apc-mmap was given. ++if test "${enable_apc_mmap+set}" = set; then ++ enableval="$enable_apc_mmap" -+ PHP_APC_SEM=$enableval ++ PHP_APC_MMAP=$enableval + echo "$ac_t""$enableval" 1>&6 + +else -+ PHP_APC_SEM=no -+ echo "$ac_t""no" 1>&6 ++ PHP_APC_MMAP=yes ++ echo "$ac_t""yes" 1>&6 - b_c_pre=$shared_c_pre - b_cxx_pre=$shared_cxx_pre @@ -5121,11 +5131,11 @@ -libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -libbcmath/src/rmzero.c libbcmath/src/str2num.c; do -+echo $ac_n "checking whether we should use pthread mutex locking""... $ac_c" 1>&6 -+echo "configure:26052: checking whether we should use pthread mutex locking" >&5 -+# Check whether --enable-apc-pthreadmutex or --disable-apc-pthreadmutex was given. -+if test "${enable_apc_pthreadmutex+set}" = set; then -+ enableval="$enable_apc_pthreadmutex" ++echo $ac_n "checking whether we should use semaphore locking instead of fcntl""... $ac_c" 1>&6 ++echo "configure:26053: checking whether we should use semaphore locking instead of fcntl" >&5 ++# Check whether --enable-apc-sem or --disable-apc-sem was given. ++if test "${enable_apc_sem+set}" = set; then ++ enableval="$enable_apc_sem" - IFS=. - set $ac_src @@ -5133,31 +5143,31 @@ - IFS=$old_IFS - - shared_objects_bcmath="$shared_objects_bcmath $ac_bdir$ac_obj.lo" -+ PHP_APC_PTHREADMUTEX=$enableval -+ echo "$ac_t""$enableval" 1>&6 - +- - case $ac_src in - *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; - *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; - *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; - *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; - esac -+else -+ -+ PHP_APC_PTHREADMUTEX=yes -+ echo "$ac_t""yes" 1>&6 ++ PHP_APC_SEM=$enableval ++ echo "$ac_t""$enableval" 1>&6 - cat >>Makefile.objects<&6 - case $host_alias in - *netware*) - - install_modules="install-modules" ++fi - case $host_alias in - *aix*) @@ -5172,11 +5182,68 @@ - suffix=la - link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(PHPBCMATH_SHARED_LIBADD)' - ;; +- esac + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpbcmath.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpbcmath.$suffix" +- fi ++echo $ac_n "checking whether we should use pthread mutex locking""... $ac_c" 1>&6 ++echo "configure:26070: checking whether we should use pthread mutex locking" >&5 ++# Check whether --enable-apc-pthreadmutex or --disable-apc-pthreadmutex was given. ++if test "${enable_apc_pthreadmutex+set}" = set; then ++ enableval="$enable_apc_pthreadmutex" + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath" +- +- cat >>Makefile.objects<&6 + +-$ext_builddir/phpbcmath.$suffix: \$(shared_objects_bcmath) \$(PHPBCMATH_SHARED_DEPENDENCIES) +- $link_cmd +- +-EOF ++else ++ ++ PHP_APC_PTHREADMUTEX=yes ++ echo "$ac_t""yes" 1>&6 + +- ;; +- *) +- +- install_modules="install-modules" ++fi + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/bcmath.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/bcmath.so '$ext_builddir'/bcmath.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(BCMATH, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD)' +- ;; +- esac + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/bcmath.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/bcmath.$suffix" +- fi +if test "$PHP_APC_PTHREADMUTEX" != "no"; then + orig_LIBS="$LIBS" + LIBS="$LIBS -lpthread" + if test "$cross_compiling" = yes; then -+ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath" + + + case pthread in @@ -5184,21 +5251,21 @@ + *) + LIBS="-lpthread $LIBS" + ;; - esac ++ esac -- if test "x" = "xyes"; then -- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpbcmath.$suffix" -- else -- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpbcmath.$suffix" -- fi -+ +- cat >>Makefile.objects< conftest.$ac_ext < + #include + main() { @@ -5230,12 +5297,11 @@ + return 0; + } + -+EOF -+if { (eval echo configure:26122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + EOF ++if { (eval echo configure:26140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + - -- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath" ++ + case pthread in + c|c_r|pthread*) ;; + *) @@ -5243,12 +5309,14 @@ + ;; + esac -- cat >>Makefile.objects<> confdefs.h <&5 @@ -5261,93 +5329,87 @@ +rm -fr conftest* +fi --EOF +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_BCMATH_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/bcmath in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + LIBS="$orig_LIBS" +fi - -- ;; -- *) -- -- install_modules="install-modules" ++ +echo $ac_n "checking whether we should use spin locks""... $ac_c" 1>&6 -+echo "configure:26150: checking whether we should use spin locks" >&5 ++echo "configure:26168: checking whether we should use spin locks" >&5 +# Check whether --enable-apc-spinlocks or --disable-apc-spinlocks was given. +if test "${enable_apc_spinlocks+set}" = set; then + enableval="$enable_apc_spinlocks" -+ + + PHP_APC_SPINLOCKS=$enableval + echo "$ac_t""$enableval" 1>&6 - -- case $host_alias in -- *aix*) -- suffix=so -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/bcmath.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/bcmath.so '$ext_builddir'/bcmath.so' -- ;; -- *netware*) -- suffix=nlm -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(BCMATH, 3)_SHARED_LIBADD)' -- ;; -- *) -- suffix=la -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD)' -- ;; -- esac ++ +else -+ + + PHP_APC_SPINLOCKS=no + echo "$ac_t""no" 1>&6 -- if test "x" = "xyes"; then -- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/bcmath.$suffix" -- else -- PHP_MODULES="$PHP_MODULES \$(phplibdir)/bcmath.$suffix" -- fi +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +fi -+ -+ + + +- old_IFS=$IFS +- for ac_src in bcmath.c \ +-libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ +-libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ +-libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ +-libbcmath/src/rmzero.c libbcmath/src/str2num.c; do +echo $ac_n "checking whether we should enable memory protection""... $ac_c" 1>&6 -+echo "configure:26167: checking whether we should enable memory protection" >&5 ++echo "configure:26185: checking whether we should enable memory protection" >&5 +# Check whether --enable-apc-memprotect or --disable-apc-memprotect was given. +if test "${enable_apc_memprotect+set}" = set; then + enableval="$enable_apc_memprotect" -- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath" +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + PHP_APC_MEMPROTECT=$enableval + echo "$ac_t""$enableval" 1>&6 -- cat >>Makefile.objects<&6 --$ext_builddir/bcmath.$suffix: \$(shared_objects_bcmath) \$(BCMATH_SHARED_DEPENDENCIES) -- $link_cmd +- cat >>Makefile.objects<> confdefs.h <<\EOF -+#define APC_MMAP 1 - EOF - -- ;; -- esac -- cat >> confdefs.h <> confdefs.h <<\EOF -+#define APC_FILEHITS 1 - EOF - -- fi -- fi -- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then -- PHP_BCMATH_SHARED=no -- case "$PHP_SAPI" in -- cgi|embed) +- EXT_STATIC="$EXT_STATIC bcmath" +- ;; +- *) - - - case ext/bcmath in @@ -5357,9 +5419,9 @@ - esac - - -+ if test "$PHP_APC_DEBUG" != "no"; then -+ cat >> confdefs.h <<\EOF -+#define __DEBUG_APC__ 1 ++if test "$PHP_APC" != "no"; then ++ test "$PHP_APC_MMAP" != "no" && cat >> confdefs.h <<\EOF ++#define APC_MMAP 1 +EOF - b_c_pre=$php_c_pre @@ -5369,13 +5431,11 @@ - b_c_post=$php_c_post - b_cxx_post=$php_cxx_post - b_lo=$php_lo -+ fi - -+ if test "$PHP_APC_SEM" != "no"; then -+ cat >> confdefs.h <<\EOF -+#define APC_SEM_LOCKS 1 ++ test "$PHP_APC_FILEHITS" != "no" && cat >> confdefs.h <<\EOF ++#define APC_FILEHITS 1 +EOF + - old_IFS=$IFS - for ac_src in bcmath.c \ -libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ @@ -5388,7 +5448,29 @@ - ac_obj=$1 - IFS=$old_IFS - -- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ if test "$PHP_APC_DEBUG" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define __DEBUG_APC__ 1 ++EOF + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ fi + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define APC_SEM_LOCKS 1 + EOF +- done + + elif test "$PHP_APC_SPINLOCKS" != "no"; then + cat >> confdefs.h <<\EOF +#define APC_SPIN_LOCKS 1 @@ -5399,51 +5481,45 @@ +#define APC_PTHREADMUTEX_LOCKS 1 +EOF -- case $ac_src in -- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -- esac +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC bcmath" +- fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- + else + cat >> confdefs.h <<\EOF +#define APC_FCNTL_LOCKS 1 +EOF -- cat >>Makefile.objects<> confdefs.h <<\EOF +#define APC_MEMPROTECT 1 - EOF -- done ++EOF +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=bcmath +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + fi -- EXT_STATIC="$EXT_STATIC bcmath" -- ;; -- *) -- +- fi + echo $ac_n "checking for zend_set_lookup_function_hook""... $ac_c" 1>&6 -+echo "configure:26230: checking for zend_set_lookup_function_hook" >&5 ++echo "configure:26248: checking for zend_set_lookup_function_hook" >&5 +if eval "test \"`echo '$''{'php_cv_zend_set_lookup_function_hook'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else - -- case ext/bcmath in -- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -- /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -- *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -- esac ++ + orig_cflags=$CFLAGS + CFLAGS="$INCLUDES $EXTRA_INCLUDES" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:26268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* -+ + + php_cv_zend_set_lookup_function_hook=yes + +else @@ -5463,6 +5539,7 @@ + cat conftest.$ac_ext >&5 + rm -rf conftest* +- BUILD_DIR="$BUILD_DIR $ext_builddir/libbcmath/src" + php_cv_zend_set_lookup_function_hook=no + +fi @@ -5471,54 +5548,31 @@ +fi -- b_c_pre=$php_c_pre -- b_cxx_pre=$php_cxx_pre -- b_c_meta=$php_c_meta -- b_cxx_meta=$php_cxx_meta -- b_c_post=$php_c_post -- b_cxx_post=$php_cxx_post -- b_lo=$php_lo +- cat >> confdefs.h <<\EOF +-#define HAVE_BCMATH 1 +echo "$ac_t""$php_cv_zend_set_lookup_function_hook" 1>&6 + if test "$php_cv_zend_set_lookup_function_hook" = "yes"; then + cat >> confdefs.h <<\EOF +#define APC_HAVE_LOOKUP_HOOKS 1 -+EOF + EOF +-fi + else + cat >> confdefs.h <<\EOF +#define APC_HAVE_LOOKUP_HOOKS 0 +EOF -- old_IFS=$IFS -- for ac_src in bcmath.c \ --libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ --libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ --libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ --libbcmath/src/rmzero.c libbcmath/src/str2num.c; do -- -- IFS=. -- set $ac_src -- ac_obj=$1 -- IFS=$old_IFS -- -- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" + fi - -- case $ac_src in -- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -- esac ++ + for ac_func in sigaction +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -+echo "configure:26284: checking for $ac_func" >&5 ++echo "configure:26302: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <>Makefile.objects<&6 +-echo "configure:26277: checking for BZip2 support" >&5 +-# Check whether --with-bz2 or --without-bz2 was given. +-if test "${with_bz2+set}" = set; then +- withval="$with_bz2" +- PHP_BZ2=$withval +; return 0; } - EOF -- done -+if { (eval echo configure:26312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++EOF ++if { (eval echo configure:26330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" -+else + else +- +- PHP_BZ2=no +- test "$PHP_ENABLE_ALL" && PHP_BZ2=$PHP_ENABLE_ALL +- + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* -+fi + fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 @@ -5569,20 +5630,34 @@ +fi +done -- ;; -- esac -- EXT_CLI_STATIC="$EXT_CLI_STATIC bcmath" -- fi + echo $ac_n "checking for union semun""... $ac_c" 1>&6 -+echo "configure:26337: checking for union semun" >&5 ++echo "configure:26355: checking for union semun" >&5 +if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else - ++ + cat > conftest.$ac_ext < +#include +#include @@ -5591,10 +5666,9 @@ +union semun x; x.val=1 +; return 0; } +EOF -+if { (eval echo configure:26354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:26372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* - -- BUILD_DIR="$BUILD_DIR $ext_builddir" ++ + php_cv_semun=yes + +else @@ -5606,7 +5680,7 @@ + +fi +rm -f conftest* - ++ +fi +echo "$ac_t""$php_cv_semun" 1>&6 @@ -5615,45 +5689,40 @@ +#define HAVE_SEMUN 1 +EOF -- if test "$ext_builddir" = "."; then -- PHP_PECL_EXTENSION=bcmath -- -- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + else + cat >> confdefs.h <<\EOF +#define HAVE_SEMUN 0 +EOF - fi +-echo "$ac_t""$ext_output" 1>&6 ++ fi + echo $ac_n "checking whether we should enable valgrind support""... $ac_c" 1>&6 -+echo "configure:26385: checking whether we should enable valgrind support" >&5 ++echo "configure:26403: checking whether we should enable valgrind support" >&5 + # Check whether --enable-valgrind-checks or --disable-valgrind-checks was given. +if test "${enable_valgrind_checks+set}" = set; then + enableval="$enable_valgrind_checks" - ++ + PHP_APC_VALGRIND=$enableval + echo "$ac_t""$enableval" 1>&6 - -- BUILD_DIR="$BUILD_DIR $ext_builddir/libbcmath/src" ++ +else - -- ++ + PHP_APC_VALGRIND=yes + echo "$ac_t""yes" 1>&6 + ac_safe=`echo "valgrind/memcheck.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for valgrind/memcheck.h""... $ac_c" 1>&6 -+echo "configure:26399: checking for valgrind/memcheck.h" >&5 ++echo "configure:26417: checking for valgrind/memcheck.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -+{ (eval echo configure:26409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:26427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* @@ -5669,33 +5738,36 @@ +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF --#define HAVE_BCMATH 1 ++ cat >> confdefs.h <<\EOF +#define HAVE_VALGRIND_MEMCHECK_H 1 - EOF ++EOF +else + echo "$ac_t""no" 1>&6 - fi ++fi -- -- --php_with_bz2=no -- --echo $ac_n "checking for BZip2 support""... $ac_c" 1>&6 --echo "configure:26277: checking for BZip2 support" >&5 --# Check whether --with-bz2 or --without-bz2 was given. --if test "${with_bz2+set}" = set; then -- withval="$with_bz2" -- PHP_BZ2=$withval --else - -- PHP_BZ2=no -- test "$PHP_ENABLE_ALL" && PHP_BZ2=$PHP_ENABLE_ALL -- - fi ++ ++fi +-if test "$PHP_BZ2" != "no"; then +- if test -r $PHP_BZ2/include/bzlib.h; then +- BZIP_DIR=$PHP_BZ2 +- else +- echo $ac_n "checking for BZip2 in default path""... $ac_c" 1>&6 +-echo "configure:26322: checking for BZip2 in default path" >&5 +- for i in /usr/local /usr; do +- if test -r $i/include/bzlib.h; then +- BZIP_DIR=$i +- echo "$ac_t""found in $i" 1>&6 +- break +- fi +- done +- fi +- if test -z "$BZIP_DIR"; then +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Please reinstall the BZip2 distribution" 1>&2; exit 1; } +- fi + apc_sources="apc.c php_apc.c \ + apc_cache.c \ + apc_compile.c \ @@ -5718,467 +5790,459 @@ + apc_bin.c \ + apc_string.c " --ext_output="yes, shared" -+ -+ save_old_LDFLAGS=$LDFLAGS + + save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$BZIP_DIR/$PHP_LIBDIR +- " + ac_stuff="" -+ -+ save_ext_shared=$ext_shared -+ ext_shared=yes -+ -+ for ac_i in $ac_stuff; do -+ case $ac_i in -+ -pthread) -+ if test "$ext_shared" = "yes"; then -+ LDFLAGS="$LDFLAGS -pthread" -+ else -+ -+ -+ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` -+ -+ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" -+ if test -n "$unique" && test "`eval $cmd`" = "" ; then -+ eval "EXTRA_LDFLAGS$unique=set" -+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" -+ fi -+ -+ fi -+ ;; -+ -l*) -+ ac_ii=`echo $ac_i|cut -c 3-` -+ -+ -+ case $ac_ii in -+ c|c_r|pthread*) ;; -+ *) -+ if test "$ext_shared" = "yes"; then -+ LDFLAGS="$LDFLAGS -l$ac_ii" -+ else -+ -+ -+ case $ac_ii in -+ c|c_r|pthread*) ;; -+ *) -+ LIBS="$LIBS -l$ac_ii" -+ ;; -+ esac -+ -+ -+ fi -+ ;; -+ esac -+ -+ -+ ;; -+ -L*) -+ ac_ii=`echo $ac_i|cut -c 3-` -+ -+ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then -+ -+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then -+ ai_p=$ac_ii -+ else -+ -+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" -+ -+ ep_realdir="`(cd \"$ep_dir\" && pwd)`" -+ ai_p="$ep_realdir/`basename \"$ac_ii\"`" -+ fi -+ -+ -+ if test "$ext_shared" = "yes"; then -+ LDFLAGS="-L$ai_p $LDFLAGS" -+ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" -+ else -+ -+ -+ -+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` -+ -+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" -+ if test -n "$unique" && test "`eval $cmd`" = "" ; then -+ eval "LIBPATH$unique=set" -+ -+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" -+ LDFLAGS="$LDFLAGS -L$ai_p" -+ PHP_RPATHS="$PHP_RPATHS $ai_p" -+ -+ fi -+ -+ -+ fi -+ -+ fi -+ -+ ;; -+ esac -+ done -+ + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -26430,27 +26568,27 @@ echo "configure:26322: checking for BZip + esac + done + +- echo $ac_n "checking for BZ2_bzerror in -lbz2""... $ac_c" 1>&6 +-echo "configure:26435: checking for BZ2_bzerror in -lbz2" >&5 +-ac_lib_var=`echo bz2'_'BZ2_bzerror | sed 'y%./+-%__p_%'` + echo $ac_n "checking for shm_open in -lrt""... $ac_c" 1>&6 -+echo "configure:26555: checking for shm_open in -lrt" >&5 ++echo "configure:26573: checking for shm_open in -lrt" >&5 +ac_lib_var=`echo rt'_'shm_open | sed 'y%./+-%__p_%'` -+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ ac_save_LIBS="$LIBS" + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lbz2 $LIBS" +LIBS="-lrt $LIBS" -+cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=yes" -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_lib_$ac_lib_var=no" -+fi -+rm -f conftest* -+LIBS="$ac_save_LIBS" -+ -+fi -+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ -+ LDFLAGS=$save_old_LDFLAGS -+ ext_shared=$save_ext_shared -+ -+ + ; return 0; } + EOF +-if { (eval echo configure:26454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:26592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -26469,167 +26607,53 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- +- if test "$BZIP_DIR/include" != "/usr/include"; then +- +- if test -z "$BZIP_DIR/include" || echo "$BZIP_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$BZIP_DIR/include +- else +- +- ep_dir="`echo $BZIP_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$BZIP_DIR/include\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- +- if test "$ext_shared" = "yes"; then +- BZ2_SHARED_LIBADD="-lbz2 $BZ2_SHARED_LIBADD" +- if test -n "$BZIP_DIR/$PHP_LIBDIR"; then +- +- if test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$BZIP_DIR/$PHP_LIBDIR" || echo "$BZIP_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$BZIP_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $BZIP_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$BZIP_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- BZ2_SHARED_LIBADD="-L$ai_p $BZ2_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && BZ2_SHARED_LIBADD="$ld_runpath_switch$ai_p $BZ2_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$BZIP_DIR/$PHP_LIBDIR"; then +- +- if test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$BZIP_DIR/$PHP_LIBDIR" || echo "$BZIP_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$BZIP_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $BZIP_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$BZIP_DIR/$PHP_LIBDIR\"`" +- fi +- +- + case rt in + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then + APC_SHARED_LIBADD="-lrt $APC_SHARED_LIBADD" + else -+ -+ + + +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case bz2 in + case rt in -+ c|c_r|pthread*) ;; -+ *) + c|c_r|pthread*) ;; + *) +- LIBS="-lbz2 $LIBS" + LIBS="-lrt $LIBS" -+ ;; -+ esac -+ -+ + ;; + esac + + + fi + ;; + esac -+ -+ -+ -+else -+ echo "$ac_t""no" 1>&6 -+ -+ LDFLAGS=$save_old_LDFLAGS -+ ext_shared=$save_ext_shared + + +- fi +- +- +- cat >> confdefs.h <<\EOF +-#define HAVE_BZ2 1 +-EOF +- +- + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_bz2_BZ2_bzerror + unset ac_cv_lib_rt_shm_open -+ -+ -+fi -+ -+ + +- { echo "configure: error: bz2 module requires libbz2 >= 1.0.0" 1>&2; exit 1; } +- + + fi + +- + +- ext_builddir=ext/bz2 +- ext_srcdir=$abs_srcdir/ext/bz2 + ext_builddir=ext/apc + ext_srcdir=$abs_srcdir/ext/apc -+ + +- ac_extra= + ac_extra=`echo "\\$(APC_CFLAGS)"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` -+ -+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_BZ2_SHARED=no + PHP_APC_SHARED=no -+ -+ + + +- case ext/bz2 in + case ext/apc in -+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + /*) ac_srcdir=`echo "ext/apc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; + *) ac_srcdir="$abs_srcdir/ext/apc/"; ac_bdir="ext/apc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ esac -+ -+ -+ -+ b_c_pre=$php_c_pre -+ b_cxx_pre=$php_cxx_pre -+ b_c_meta=$php_c_meta -+ b_cxx_meta=$php_cxx_meta -+ b_c_post=$php_c_post -+ b_cxx_post=$php_cxx_post -+ b_lo=$php_lo -+ -+ -+ old_IFS=$IFS + esac + + +@@ -26644,7 +26668,7 @@ fi + + + old_IFS=$IFS +- for ac_src in bz2.c bz2_filter.c; do + for ac_src in $apc_sources; do -+ -+ IFS=. -+ set $ac_src -+ ac_obj=$1 -+ IFS=$old_IFS -+ -+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ -+ case $ac_src in -+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -+ esac -+ -+ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h <>Makefile.objects<>Makefile.objects<> confdefs.h <<\EOF +#define HAVE_APC 1 +EOF -+ -+fi -+ -+ -+ -+ + + fi + + + +-php_enable_calendar=no + +-echo $ac_n "checking whether to enable calendar conversion support""... $ac_c" 1>&6 +-echo "configure:26922: checking whether to enable calendar conversion support" >&5 +-# Check whether --enable-calendar or --disable-calendar was given. +-if test "${enable_calendar+set}" = set; then +- enableval="$enable_calendar" +- PHP_CALENDAR=$enableval +php_enable_bcmath=no + +echo $ac_n "checking whether to enable bc style precision math functions""... $ac_c" 1>&6 -+echo "configure:26936: checking whether to enable bc style precision math functions" >&5 ++echo "configure:26954: checking whether to enable bc style precision math functions" >&5 +# Check whether --enable-bcmath or --disable-bcmath was given. +if test "${enable_bcmath+set}" = set; then + enableval="$enable_bcmath" + PHP_BCMATH=$enableval -+else -+ + else + +- PHP_CALENDAR=no +- test "$PHP_ENABLE_ALL" && PHP_CALENDAR=$PHP_ENABLE_ALL + PHP_BCMATH=no + test "$PHP_ENABLE_ALL" && PHP_BCMATH=$PHP_ENABLE_ALL -+ -+fi -+ -+ -+ -+ext_output="yes, shared" -+ext_shared=yes + + fi + +@@ -26934,12 +26966,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_CALENDAR in +case $PHP_BCMATH in -+shared,*) + shared,*) +- PHP_CALENDAR=`echo "$PHP_CALENDAR"|$SED 's/^shared,//'` + PHP_BCMATH=`echo "$PHP_BCMATH"|$SED 's/^shared,//'` -+ ;; -+shared) + ;; + shared) +- PHP_CALENDAR=yes + PHP_BCMATH=yes -+ ;; -+no) -+ ext_output=no -+ ext_shared=no -+ ;; -+*) -+ ext_output=yes -+ ext_shared=no -+ ;; -+esac -+ -+ -+ -+echo "$ac_t""$ext_output" 1>&6 -+ -+ -+ -+ + ;; + no) + ext_output=no +@@ -26958,25 +26990,21 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_CALENDAR" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_CALENDAR 1 +-EOF +- +if test "$PHP_BCMATH" != "no"; then -+ + +- ext_builddir=ext/calendar +- ext_srcdir=$abs_srcdir/ext/calendar + ext_builddir=ext/bcmath + ext_srcdir=$abs_srcdir/ext/bcmath -+ + +- ac_extra= + ac_extra=`echo "-I@ext_srcdir@/libbcmath/src"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` -+ -+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_CALENDAR_SHARED=no + PHP_BCMATH_SHARED=no -+ -+ + + +- case ext/calendar in + case ext/bcmath in -+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; + *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ esac -+ -+ -+ -+ b_c_pre=$php_c_pre -+ b_cxx_pre=$php_cxx_pre -+ b_c_meta=$php_c_meta -+ b_cxx_meta=$php_cxx_meta -+ b_c_post=$php_c_post -+ b_cxx_post=$php_cxx_post -+ b_lo=$php_lo -+ -+ -+ old_IFS=$IFS + esac + + +@@ -26991,7 +27019,11 @@ EOF + + + old_IFS=$IFS +- for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do + for ac_src in bcmath.c \ +libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ +libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ +libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ +libbcmath/src/rmzero.c libbcmath/src/str2num.c; do -+ -+ IFS=. -+ set $ac_src -+ ac_obj=$1 -+ IFS=$old_IFS -+ -+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ -+ case $ac_src in -+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -+ esac -+ -+ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_BCMATH 1 ++EOF ++ + fi + + + +-php_enable_ctype=yes ++php_with_bz2=no + +-echo $ac_n "checking whether to enable ctype functions""... $ac_c" 1>&6 +-echo "configure:27266: checking whether to enable ctype functions" >&5 +-# Check whether --enable-ctype or --disable-ctype was given. +-if test "${enable_ctype+set}" = set; then +- enableval="$enable_ctype" +- PHP_CTYPE=$enableval ++echo $ac_n "checking for BZip2 support""... $ac_c" 1>&6 ++echo "configure:27319: checking for BZip2 support" >&5 ++# Check whether --with-bz2 or --without-bz2 was given. ++if test "${with_bz2+set}" = set; then ++ withval="$with_bz2" ++ PHP_BZ2=$withval + else + +- PHP_CTYPE=yes +- test "$PHP_ENABLE_ALL" && PHP_CTYPE=$PHP_ENABLE_ALL ++ PHP_BZ2=no ++ test "$PHP_ENABLE_ALL" && PHP_BZ2=$PHP_ENABLE_ALL + + fi + +@@ -27278,12 +27331,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_CTYPE in ++case $PHP_BZ2 in + shared,*) +- PHP_CTYPE=`echo "$PHP_CTYPE"|$SED 's/^shared,//'` ++ PHP_BZ2=`echo "$PHP_BZ2"|$SED 's/^shared,//'` + ;; + shared) +- PHP_CTYPE=yes ++ PHP_BZ2=yes + ;; + no) + ext_output=no +@@ -27302,31 +27355,329 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_CTYPE" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_CTYPE 1 +-EOF +- +- +- ext_builddir=ext/ctype +- ext_srcdir=$abs_srcdir/ext/ctype ++if test "$PHP_BZ2" != "no"; then ++ if test -r $PHP_BZ2/include/bzlib.h; then ++ BZIP_DIR=$PHP_BZ2 ++ else ++ echo $ac_n "checking for BZip2 in default path""... $ac_c" 1>&6 ++echo "configure:27364: checking for BZip2 in default path" >&5 ++ for i in /usr/local /usr; do ++ if test -r $i/include/bzlib.h; then ++ BZIP_DIR=$i ++ echo "$ac_t""found in $i" 1>&6 ++ break ++ fi ++ done ++ fi + +- ac_extra= ++ if test -z "$BZIP_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Please reinstall the BZip2 distribution" 1>&2; exit 1; } ++ fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_CTYPE_SHARED=no +- + +- case ext/ctype in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$BZIP_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes + ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` + -+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + -+ case $ac_src in -+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -+ esac + -+ cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else + + -+ case ext/bcmath in -+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + -+ b_c_pre=$php_c_pre -+ b_cxx_pre=$php_cxx_pre -+ b_c_meta=$php_c_meta -+ b_cxx_meta=$php_cxx_meta -+ b_c_post=$php_c_post -+ b_cxx_post=$php_cxx_post -+ b_lo=$php_lo + ++ fi ++ ++ fi + -+ old_IFS=$IFS -+ for ac_src in bcmath.c \ -+libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ -+libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -+libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -+libbcmath/src/rmzero.c libbcmath/src/str2num.c; do -+ -+ IFS=. -+ set $ac_src -+ ac_obj=$1 -+ IFS=$old_IFS -+ -+ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ ;; ++ esac ++ done + -+ case $ac_src in -+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; -+ esac ++ echo $ac_n "checking for BZ2_bzerror in -lbz2""... $ac_c" 1>&6 ++echo "configure:27477: checking for BZ2_bzerror in -lbz2" >&5 ++ac_lib_var=`echo bz2'_'BZ2_bzerror | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbz2 $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ if test "$BZIP_DIR/include" != "/usr/include"; then ++ ++ if test -z "$BZIP_DIR/include" || echo "$BZIP_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$BZIP_DIR/include ++ else ++ ++ ep_dir="`echo $BZIP_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$BZIP_DIR/include\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + ++ fi + -+ ;; -+ esac -+ EXT_CLI_STATIC="$EXT_CLI_STATIC bcmath" ++ ++ ++ if test "$ext_shared" = "yes"; then ++ BZ2_SHARED_LIBADD="-lbz2 $BZ2_SHARED_LIBADD" ++ if test -n "$BZIP_DIR/$PHP_LIBDIR"; then ++ ++ if test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$BZIP_DIR/$PHP_LIBDIR" || echo "$BZIP_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$BZIP_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $BZIP_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$BZIP_DIR/$PHP_LIBDIR\"`" + fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ BZ2_SHARED_LIBADD="-L$ai_p $BZ2_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && BZ2_SHARED_LIBADD="$ld_runpath_switch$ai_p $BZ2_SHARED_LIBADD" ++ else ++ + + -+ BUILD_DIR="$BUILD_DIR $ext_builddir" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + + -+ if test "$ext_builddir" = "."; then -+ PHP_PECL_EXTENSION=bcmath ++ fi ++ ++ fi ++ ++ fi ++ else + -+ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + ++ if test -n "$BZIP_DIR/$PHP_LIBDIR"; then ++ ++ if test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$BZIP_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$BZIP_DIR/$PHP_LIBDIR" || echo "$BZIP_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$BZIP_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $BZIP_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$BZIP_DIR/$PHP_LIBDIR\"`" + fi + ++ ++ + + -+ BUILD_DIR="$BUILD_DIR $ext_builddir/libbcmath/src" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + -+ cat >> confdefs.h <<\EOF -+#define HAVE_BCMATH 1 -+EOF + -+fi ++ ++ fi ++ ++ fi ++ ++ ++ case bz2 in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lbz2 $LIBS" ++ ;; ++ esac + + + -+php_with_bz2=no + -+echo $ac_n "checking for BZip2 support""... $ac_c" 1>&6 -+echo "configure:27301: checking for BZip2 support" >&5 -+# Check whether --with-bz2 or --without-bz2 was given. -+if test "${with_bz2+set}" = set; then -+ withval="$with_bz2" -+ PHP_BZ2=$withval -+else ++ fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_BZ2 1 ++EOF ++ + -+ PHP_BZ2=no -+ test "$PHP_ENABLE_ALL" && PHP_BZ2=$PHP_ENABLE_ALL ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_bz2_BZ2_bzerror ++ ++ { echo "configure: error: bz2 module requires libbz2 >= 1.0.0" 1>&2; exit 1; } ++ ++ +fi + + ++ ++ ext_builddir=ext/bz2 ++ ext_srcdir=$abs_srcdir/ext/bz2 + -+ext_output="yes, shared" - ext_shared=yes - case $PHP_BZ2 in - shared,*) -@@ -26318,7 +27342,7 @@ if test "$PHP_BZ2" != "no"; then - BZIP_DIR=$PHP_BZ2 - else - echo $ac_n "checking for BZip2 in default path""... $ac_c" 1>&6 --echo "configure:26322: checking for BZip2 in default path" >&5 -+echo "configure:27346: checking for BZip2 in default path" >&5 - for i in /usr/local /usr; do - if test -r $i/include/bzlib.h; then - BZIP_DIR=$i -@@ -26431,7 +27455,7 @@ echo "configure:26322: checking for BZip ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_BZ2_SHARED=no ++ ++ ++ case ext/bz2 in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre + b_c_meta=$php_c_meta + b_cxx_meta=$php_cxx_meta + b_c_post=$php_c_post +@@ -27335,7 +27686,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in ctype.c; do ++ for ac_src in bz2.c bz2_filter.c; do + + IFS=. + set $ac_src +@@ -27358,18 +27709,18 @@ EOF done - echo $ac_n "checking for BZ2_bzerror in -lbz2""... $ac_c" 1>&6 --echo "configure:26435: checking for BZ2_bzerror in -lbz2" >&5 -+echo "configure:27459: checking for BZ2_bzerror in -lbz2" >&5 - ac_lib_var=`echo bz2'_'BZ2_bzerror | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -26439,7 +27463,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbz2 $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:27478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -26918,7 +27942,7 @@ fi - php_enable_calendar=no - echo $ac_n "checking whether to enable calendar conversion support""... $ac_c" 1>&6 --echo "configure:26922: checking whether to enable calendar conversion support" >&5 -+echo "configure:27946: checking whether to enable calendar conversion support" >&5 - # Check whether --enable-calendar or --disable-calendar was given. - if test "${enable_calendar+set}" = set; then - enableval="$enable_calendar" -@@ -27262,7 +28286,7 @@ fi - php_enable_ctype=yes - - echo $ac_n "checking whether to enable ctype functions""... $ac_c" 1>&6 --echo "configure:27266: checking whether to enable ctype functions" >&5 -+echo "configure:28290: checking whether to enable ctype functions" >&5 - # Check whether --enable-ctype or --disable-ctype was given. - if test "${enable_ctype+set}" = set; then - enableval="$enable_ctype" -@@ -27606,7 +28630,7 @@ fi - php_with_curl=no - - echo $ac_n "checking for cURL support""... $ac_c" 1>&6 --echo "configure:27610: checking for cURL support" >&5 -+echo "configure:28634: checking for cURL support" >&5 - # Check whether --with-curl or --without-curl was given. - if test "${with_curl+set}" = set; then - withval="$with_curl" -@@ -27650,7 +28674,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_curlwrappers=no - - echo $ac_n "checking if we should use cURL for url streams""... $ac_c" 1>&6 --echo "configure:27654: checking if we should use cURL for url streams" >&5 -+echo "configure:28678: checking if we should use cURL for url streams" >&5 - # Check whether --with-curlwrappers or --without-curlwrappers was given. - if test "${with_curlwrappers+set}" = set; then - withval="$with_curlwrappers" -@@ -27674,7 +28698,7 @@ if test "$PHP_CURL" != "no"; then - CURL_DIR=$PHP_CURL +- EXT_STATIC="$EXT_STATIC ctype" ++ EXT_STATIC="$EXT_STATIC bz2" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC ctype" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC bz2" + fi else - echo $ac_n "checking for cURL in default path""... $ac_c" 1>&6 --echo "configure:27678: checking for cURL in default path" >&5 -+echo "configure:28702: checking for cURL in default path" >&5 - for i in /usr/local /usr; do - if test -r $i/include/curl/easy.h; then - CURL_DIR=$i -@@ -27692,7 +28716,7 @@ echo "configure:27678: checking for cURL - - CURL_CONFIG="curl-config" - echo $ac_n "checking for cURL 7.10.5 or greater""... $ac_c" 1>&6 --echo "configure:27696: checking for cURL 7.10.5 or greater" >&5 -+echo "configure:28720: checking for cURL 7.10.5 or greater" >&5 + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_CTYPE_SHARED=yes ++ PHP_BZ2_SHARED=yes + +- case ext/ctype in ++ case ext/bz2 in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -27384,14 +27735,14 @@ EOF - if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/bin/curl-config -@@ -27930,7 +28954,7 @@ echo "configure:27696: checking for cURL + old_IFS=$IFS +- for ac_src in ctype.c; do ++ for ac_src in bz2.c bz2_filter.c; do - echo $ac_n "checking for SSL support in libcurl""... $ac_c" 1>&6 --echo "configure:27934: checking for SSL support in libcurl" >&5 -+echo "configure:28958: checking for SSL support in libcurl" >&5 - CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` - if test "$CURL_SSL" = "SSL"; then - echo "$ac_t""yes" 1>&6 -@@ -27943,7 +28967,7 @@ EOF - CFLAGS="`$CURL_CONFIG --cflags`" - - echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 --echo "configure:27947: checking how to run the C preprocessor" >&5 -+echo "configure:28971: checking how to run the C preprocessor" >&5 - # On Suns, sometimes $CPP names a directory. - if test -n "$CPP" && test -d "$CPP"; then - CPP= -@@ -27958,13 +28982,13 @@ else - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:27968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:28992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -27975,13 +28999,13 @@ else - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:27985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:29009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -27992,13 +29016,13 @@ else - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:28002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:29026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -28023,14 +29047,14 @@ fi - echo "$ac_t""$CPP" 1>&6 + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_ctype="$shared_objects_ctype $ac_bdir$ac_obj.lo" ++ shared_objects_bz2="$shared_objects_bz2 $ac_bdir$ac_obj.lo" - echo $ac_n "checking for openssl support in libcurl""... $ac_c" 1>&6 --echo "configure:28027: checking for openssl support in libcurl" >&5 -+echo "configure:29051: checking for openssl support in libcurl" >&5 - if test "$cross_compiling" = yes; then - - echo "$ac_t""no" 1>&6 - - else - cat > conftest.$ac_ext < -@@ -28049,7 +29073,7 @@ int main(int argc, char *argv[]) - } - - EOF --if { (eval echo configure:28053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:29077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpctype.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpbz2.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpctype.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpbz2.$suffix" + fi - echo "$ac_t""yes" 1>&6 -@@ -28057,17 +29081,17 @@ then - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:28061: checking for $ac_hdr" >&5 -+echo "configure:29085: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:28071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:29095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -28112,14 +29136,14 @@ fi +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bz2" - - echo $ac_n "checking for gnutls support in libcurl""... $ac_c" 1>&6 --echo "configure:28116: checking for gnutls support in libcurl" >&5 -+echo "configure:29140: checking for gnutls support in libcurl" >&5 - if test "$cross_compiling" = yes; then - - echo "$ac_t""no" 1>&6 - - else - cat > conftest.$ac_ext <>Makefile.objects< -@@ -28138,23 +29162,23 @@ int main(int argc, char *argv[]) - } +-$ext_builddir/phpctype.$suffix: \$(shared_objects_ctype) \$(PHPCTYPE_SHARED_DEPENDENCIES) ++$ext_builddir/phpbz2.$suffix: \$(shared_objects_bz2) \$(PHPBZ2_SHARED_DEPENDENCIES) + $link_cmd EOF --if { (eval echo configure:28142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:29166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +@@ -27451,31 +27802,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/ctype.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/ctype.so '$ext_builddir'/ctype.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/bz2.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(BZ2_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/bz2.so '$ext_builddir'/bz2.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(CTYPE, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(BZ2, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(BZ2_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/ctype.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/bz2.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/ctype.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/bz2.$suffix" + fi - echo "$ac_t""yes" 1>&6 - ac_safe=`echo "gcrypt.h" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for gcrypt.h""... $ac_c" 1>&6 --echo "configure:28148: checking for gcrypt.h" >&5 -+echo "configure:29172: checking for gcrypt.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:28158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:29182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -28296,7 +29320,7 @@ fi - done +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bz2" - echo $ac_n "checking for curl_easy_perform in -lcurl""... $ac_c" 1>&6 --echo "configure:28300: checking for curl_easy_perform in -lcurl" >&5 -+echo "configure:29324: checking for curl_easy_perform in -lcurl" >&5 - ac_lib_var=`echo curl'_'curl_easy_perform | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -28304,7 +29328,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcurl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:29343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -28451,7 +29475,7 @@ fi - done + cat >>Makefile.objects<&6 --echo "configure:28455: checking for curl_version_info in -lcurl" >&5 -+echo "configure:29479: checking for curl_version_info in -lcurl" >&5 - ac_lib_var=`echo curl'_'curl_version_info | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -28459,7 +29483,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcurl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:29498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -28604,7 +29628,7 @@ fi - done +-$ext_builddir/ctype.$suffix: \$(shared_objects_ctype) \$(CTYPE_SHARED_DEPENDENCIES) ++$ext_builddir/bz2.$suffix: \$(shared_objects_bz2) \$(BZ2_SHARED_DEPENDENCIES) + $link_cmd - echo $ac_n "checking for curl_easy_strerror in -lcurl""... $ac_c" 1>&6 --echo "configure:28608: checking for curl_easy_strerror in -lcurl" >&5 -+echo "configure:29632: checking for curl_easy_strerror in -lcurl" >&5 - ac_lib_var=`echo curl'_'curl_easy_strerror | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -28612,7 +29636,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcurl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:29651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -28757,7 +29781,7 @@ fi - done - - echo $ac_n "checking for curl_multi_strerror in -lcurl""... $ac_c" 1>&6 --echo "configure:28761: checking for curl_multi_strerror in -lcurl" >&5 -+echo "configure:29785: checking for curl_multi_strerror in -lcurl" >&5 - ac_lib_var=`echo curl'_'curl_multi_strerror | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -28765,7 +29789,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcurl $LIBS" - cat > conftest.$ac_ext <> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:29804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -29462,7 +30486,7 @@ if test "$PHP_QDBM" != "no"; then - done - echo $ac_n "checking for dpopen in -l$LIB""... $ac_c" 1>&6 --echo "configure:29466: checking for dpopen in -l$LIB" >&5 -+echo "configure:30490: checking for dpopen in -l$LIB" >&5 - ac_lib_var=`echo $LIB'_'dpopen | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -29470,7 +30494,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$LIB $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:30509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -29650,7 +30674,7 @@ fi - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:29654: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:30678: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -29678,7 +30702,7 @@ if test "$PHP_GDBM" != "no"; then - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:29682: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:30706: checking for $THIS_FULL_NAME support" >&5 - if test -n "You cannot combine --with-gdbm with --with-qdbm"; then - { echo "configure: error: You cannot combine --with-gdbm with --with-qdbm" 1>&2; exit 1; } + fi fi -@@ -29797,7 +30821,7 @@ echo "configure:29682: checking for $THI - done - echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 --echo "configure:29801: checking for gdbm_open in -lgdbm" >&5 -+echo "configure:30825: checking for gdbm_open in -lgdbm" >&5 - ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -29805,7 +30829,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lgdbm $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:30844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -29981,7 +31005,7 @@ fi - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:29985: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:31009: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -30110,7 +31134,7 @@ if test "$PHP_NDBM" != "no"; then - done + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_CTYPE_SHARED=no ++ PHP_BZ2_SHARED=no + case "$PHP_SAPI" in + cgi|embed) + + +- case ext/ctype in ++ case ext/bz2 in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -27513,7 +27864,7 @@ EOF - echo $ac_n "checking for dbm_open in -l$LIB""... $ac_c" 1>&6 --echo "configure:30114: checking for dbm_open in -l$LIB" >&5 -+echo "configure:31138: checking for dbm_open in -l$LIB" >&5 - ac_lib_var=`echo $LIB'_'dbm_open | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -30118,7 +31142,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$LIB $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:31157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -30298,7 +31322,7 @@ fi - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:30302: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:31326: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -30382,7 +31406,7 @@ if test "$PHP_DB4" != "no"; then - LIBS="-l$LIB $LIBS" + + old_IFS=$IFS +- for ac_src in ctype.c; do ++ for ac_src in bz2.c bz2_filter.c; do - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:31421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - cat > conftest.$ac_ext <&6 --echo "configure:30438: checking for DB4 major version" >&5 -+echo "configure:31462: checking for DB4 major version" >&5 - { echo "configure: error: Header contains different version" 1>&2; exit 1; } - fi - if test "4" = "4"; then - echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 --echo "configure:30443: checking for DB4 minor version and patch level" >&5 -+echo "configure:31467: checking for DB4 minor version and patch level" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:30471: checking if dba can be used as shared extension" >&5 -+echo "configure:31495: checking if dba can be used as shared extension" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:30630: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:31654: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -30654,7 +31678,7 @@ if test "$PHP_DB3" != "no"; then - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:30658: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:31682: checking for $THIS_FULL_NAME support" >&5 - if test -n "You cannot combine --with-db3 with --with-db4"; then - { echo "configure: error: You cannot combine --with-db3 with --with-db4" 1>&2; exit 1; } + ;; + esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC ctype" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC bz2" fi -@@ -30705,7 +31729,7 @@ echo "configure:30658: checking for $THI - LIBS="-l$LIB $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:31744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - cat > conftest.$ac_ext <&6 --echo "configure:30761: checking for DB3 major version" >&5 -+echo "configure:31785: checking for DB3 major version" >&5 - { echo "configure: error: Header contains different version" 1>&2; exit 1; } - fi - if test "3" = "4"; then - echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 --echo "configure:30766: checking for DB4 minor version and patch level" >&5 -+echo "configure:31790: checking for DB4 minor version and patch level" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:30794: checking if dba can be used as shared extension" >&5 -+echo "configure:31818: checking if dba can be used as shared extension" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:30953: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:31977: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -30977,7 +32001,7 @@ if test "$PHP_DB2" != "no"; then - THIS_FULL_NAME="$THIS_NAME" fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:30981: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:32005: checking for $THIS_FULL_NAME support" >&5 - if test -n "You cannot combine --with-db2 with --with-db3 or --with-db4"; then - { echo "configure: error: You cannot combine --with-db2 with --with-db3 or --with-db4" 1>&2; exit 1; } - fi -@@ -31028,7 +32052,7 @@ echo "configure:30981: checking for $THI - LIBS="-l$LIB $LIBS" - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:32067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - - cat > conftest.$ac_ext <&6 --echo "configure:31084: checking for DB2 major version" >&5 -+echo "configure:32108: checking for DB2 major version" >&5 - { echo "configure: error: Header contains different version" 1>&2; exit 1; } - fi - if test "2" = "4"; then - echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 --echo "configure:31089: checking for DB4 minor version and patch level" >&5 -+echo "configure:32113: checking for DB4 minor version and patch level" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:31117: checking if dba can be used as shared extension" >&5 -+echo "configure:32141: checking if dba can be used as shared extension" >&5 - cat > conftest.$ac_ext <&6 --echo "configure:31276: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:32300: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -31292,7 +32316,7 @@ if test "$PHP_DB1" != "no"; then - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT +-php_with_curl=no ++php_enable_calendar=no - echo $ac_n "checking for DB1 in library""... $ac_c" 1>&6 --echo "configure:31296: checking for DB1 in library" >&5 -+echo "configure:32320: checking for DB1 in library" >&5 - if test "$HAVE_DB4" = "1"; then - THIS_VERSION=4 - THIS_LIBS=$DB4_LIBS -@@ -31340,7 +32364,7 @@ EOF - fi - echo "$ac_t""$THIS_LIBS" 1>&6 - echo $ac_n "checking for DB1 in header""... $ac_c" 1>&6 --echo "configure:31344: checking for DB1 in header" >&5 -+echo "configure:32368: checking for DB1 in header" >&5 - echo "$ac_t""$THIS_INCLUDE" 1>&6 - if test -n "$THIS_INCLUDE"; then - -@@ -31350,7 +32374,7 @@ echo "configure:31344: checking for DB1 - LIBS="-l$THIS_LIBS $LIBS" +-echo $ac_n "checking for cURL support""... $ac_c" 1>&6 +-echo "configure:27610: checking for cURL support" >&5 +-# Check whether --with-curl or --without-curl was given. +-if test "${with_curl+set}" = set; then +- withval="$with_curl" +- PHP_CURL=$withval ++echo $ac_n "checking whether to enable calendar conversion support""... $ac_c" 1>&6 ++echo "configure:27964: checking whether to enable calendar conversion support" >&5 ++# Check whether --enable-calendar or --disable-calendar was given. ++if test "${enable_calendar+set}" = set; then ++ enableval="$enable_calendar" ++ PHP_CALENDAR=$enableval + else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:32389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - - cat >> confdefs.h <&6 --echo "configure:31515: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:32539: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -31539,7 +32563,7 @@ if test "$PHP_DBM" != "no"; then - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:31543: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:32567: checking for $THIS_FULL_NAME support" >&5 - if test -n "You cannot combine --with-dbm with --with-qdbm"; then - { echo "configure: error: You cannot combine --with-dbm with --with-qdbm" 1>&2; exit 1; } - fi -@@ -31663,7 +32687,7 @@ echo "configure:31543: checking for $THI - done + fi - echo $ac_n "checking for dbminit in -l$LIB""... $ac_c" 1>&6 --echo "configure:31667: checking for dbminit in -l$LIB" >&5 -+echo "configure:32691: checking for dbminit in -l$LIB" >&5 - ac_lib_var=`echo $LIB'_'dbminit | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -31671,7 +32695,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$LIB $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:32710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -31702,7 +32726,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - ext_shared=$save_ext_shared - - echo $ac_n "checking for DBM using GDBM""... $ac_c" 1>&6 --echo "configure:31706: checking for DBM using GDBM" >&5 -+echo "configure:32730: checking for DBM using GDBM" >&5 - cat >> confdefs.h <&6 --echo "configure:31870: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:32894: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -32078,7 +33102,7 @@ elif test "$PHP_CDB" != "no"; then - done +@@ -27622,12 +27976,12 @@ fi - echo $ac_n "checking for cdb_read in -l$LIB""... $ac_c" 1>&6 --echo "configure:32082: checking for cdb_read in -l$LIB" >&5 -+echo "configure:33106: checking for cdb_read in -l$LIB" >&5 - ac_lib_var=`echo $LIB'_'cdb_read | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -32086,7 +33110,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$LIB $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:33125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -32266,7 +33290,7 @@ fi - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:32270: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:33294: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -32297,7 +33321,7 @@ fi - THIS_FULL_NAME="$THIS_NAME" - fi - echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:32301: checking for $THIS_FULL_NAME support" >&5 -+echo "configure:33325: checking for $THIS_FULL_NAME support" >&5 - if test -n ""; then - { echo "configure: error: " 1>&2; exit 1; } - fi -@@ -32321,53 +33345,413 @@ EOF - THIS_RESULT="builtin" - fi + ext_output="yes, shared" + ext_shared=yes +-case $PHP_CURL in ++case $PHP_CALENDAR in + shared,*) +- PHP_CURL=`echo "$PHP_CURL"|$SED 's/^shared,//'` ++ PHP_CALENDAR=`echo "$PHP_CALENDAR"|$SED 's/^shared,//'` + ;; + shared) +- PHP_CURL=yes ++ PHP_CALENDAR=yes + ;; + no) + ext_output=no +@@ -27646,572 +28000,796 @@ echo "$ac_t""$ext_output" 1>&6 -- THIS_NAME=FLATFILE -- if test -n "FlatFile"; then -- THIS_FULL_NAME="FlatFile" -- else -- THIS_FULL_NAME="$THIS_NAME" -- fi -- echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 --echo "configure:32332: checking for $THIS_FULL_NAME support" >&5 -- if test -n ""; then -- { echo "configure: error: " 1>&2; exit 1; } -- fi -- if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then -- HAVE_DBA=1 -- eval HAVE_$THIS_NAME=1 -- echo "$ac_t""$THIS_RESULT" 1>&6 -- else -- echo "$ac_t""no" 1>&6 -- fi -- unset THIS_RESULT THIS_NAME THIS_FULL_NAME -+ THIS_NAME=FLATFILE -+ if test -n "FlatFile"; then -+ THIS_FULL_NAME="FlatFile" -+ else -+ THIS_FULL_NAME="$THIS_NAME" -+ fi -+ echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 -+echo "configure:33356: checking for $THIS_FULL_NAME support" >&5 -+ if test -n ""; then -+ { echo "configure: error: " 1>&2; exit 1; } -+ fi -+ if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then -+ HAVE_DBA=1 -+ eval HAVE_$THIS_NAME=1 -+ echo "$ac_t""$THIS_RESULT" 1>&6 -+ else -+ echo "$ac_t""no" 1>&6 -+ fi -+ unset THIS_RESULT THIS_NAME THIS_FULL_NAME -+ -+ -+echo $ac_n "checking whether to enable DBA interface""... $ac_c" 1>&6 -+echo "configure:33371: checking whether to enable DBA interface" >&5 -+if test "$HAVE_DBA" = "1"; then -+ if test "$ext_shared" = "yes"; then -+ echo "$ac_t""yes, shared" 1>&6 -+ else -+ echo "$ac_t""yes" 1>&6 -+ fi + + ++if test "$PHP_CALENDAR" = "yes"; then + cat >> confdefs.h <<\EOF -+#define HAVE_DBA 1 ++#define HAVE_CALENDAR 1 +EOF + + -+ ext_builddir=ext/dba -+ ext_srcdir=$abs_srcdir/ext/dba -+ ++ ext_builddir=ext/calendar ++ ext_srcdir=$abs_srcdir/ext/calendar + +-php_with_curlwrappers=no + ac_extra= -+ + +-echo $ac_n "checking if we should use cURL for url streams""... $ac_c" 1>&6 +-echo "configure:27654: checking if we should use cURL for url streams" >&5 +-# Check whether --with-curlwrappers or --without-curlwrappers was given. +-if test "${with_curlwrappers+set}" = set; then +- withval="$with_curlwrappers" +- PHP_CURLWRAPPERS=$withval +-else + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then -+ PHP_DBA_SHARED=no ++ PHP_CALENDAR_SHARED=no + + -+ case ext/dba in ++ case ext/calendar in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac -+ -+ -+ + +- PHP_CURLWRAPPERS=no + + +-fi + b_c_pre=$php_c_pre + b_cxx_pre=$php_cxx_pre + b_c_meta=$php_c_meta @@ -7481,10 +7278,12 @@ + b_c_post=$php_c_post + b_cxx_post=$php_cxx_post + b_lo=$php_lo -+ -+ + + +-ext_output=$PHP_CURLWRAPPERS +-echo "$ac_t""$ext_output" 1>&6 + old_IFS=$IFS -+ for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do ++ for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do + + IFS=. + set $ac_src @@ -7492,37 +7291,67 @@ + IFS=$old_IFS + + PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac -+ + + cat >>Makefile.objects<&6 +-echo "configure:27678: checking for cURL in default path" >&5 +- for i in /usr/local /usr; do +- if test -r $i/include/curl/easy.h; then +- CURL_DIR=$i +- echo "$ac_t""found in $i" 1>&6 +- break +- fi +- done +- fi +- +- if test -z "$CURL_DIR"; then +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Please reinstall the libcurl distribution - +- easy.h should be in /include/curl/" 1>&2; exit 1; } +- fi +- +- CURL_CONFIG="curl-config" +- echo $ac_n "checking for cURL 7.10.5 or greater""... $ac_c" 1>&6 +-echo "configure:27696: checking for cURL 7.10.5 or greater" >&5 + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then -+ PHP_DBA_SHARED=yes ++ PHP_CALENDAR_SHARED=yes + -+ case ext/dba in ++ case ext/calendar in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + -+ + +- if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then +- CURL_CONFIG=${CURL_DIR}/bin/curl-config +- else +- if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then +- CURL_CONFIG=${CURL_DIR}/curl-config +- fi +- fi + b_c_pre=$shared_c_pre + b_cxx_pre=$shared_cxx_pre + b_c_meta=$shared_c_meta @@ -7530,66 +7359,147 @@ + b_c_post=$shared_c_post + b_cxx_post=$shared_cxx_post + b_lo=$shared_lo -+ -+ + +- curl_version_full=`$CURL_CONFIG --version` +- curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` +- if test "$curl_version" -ge 7010005; then +- echo "$ac_t""$curl_version_full" 1>&6 +- CURL_LIBS=`$CURL_CONFIG --libs` +- else +- { echo "configure: error: cURL version 7.10.5 or later is required to compile php with cURL support" 1>&2; exit 1; } +- fi + + old_IFS=$IFS -+ for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do -+ ++ for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do + +- if test "$CURL_DIR/include" != "/usr/include"; then +- +- if test -z "$CURL_DIR/include" || echo "$CURL_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$CURL_DIR/include +- else +- +- ep_dir="`echo $CURL_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$CURL_DIR/include\"`" +- fi + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + -+ shared_objects_dba="$shared_objects_dba $ac_bdir$ac_obj.lo" -+ ++ shared_objects_calendar="$shared_objects_calendar $ac_bdir$ac_obj.lo" + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac -+ + +- fi + cat >>Makefile.objects<>Makefile.objects</dev/null ; then +- ai_p=$ac_ii +EOF + + ;; @@ -7600,31 +7510,41 @@ + case $host_alias in + *aix*) + suffix=so -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/dba.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(DBA_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/dba.so '$ext_builddir'/dba.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/calendar.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(CALENDAR_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/calendar.so '$ext_builddir'/calendar.so' + ;; + *netware*) + suffix=nlm -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(DBA, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(CALENDAR, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(DBA_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(CALENDAR_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then -+ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/dba.$suffix" -+ else -+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/dba.$suffix" -+ fi ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/calendar.$suffix" + else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/calendar.$suffix" + fi + -+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dba" -+ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_calendar" + +- +- if test "$ext_shared" = "yes"; then +- CURL_SHARED_LIBADD="-L$ai_p $CURL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p $CURL_SHARED_LIBADD" +- else + cat >>Makefile.objects<> confdefs.h </dev/null ; then +- ai_p=$CURL_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" +- fi + PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ + +- +- if test "$ext_shared" = "yes"; then +- CURL_SHARED_LIBADD="-L$ai_p $CURL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p $CURL_SHARED_LIBADD" +- else + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; @@ -7685,18 +7642,26 @@ + done + + -+ EXT_STATIC="$EXT_STATIC dba" ++ EXT_STATIC="$EXT_STATIC calendar" + ;; + *) -+ -+ -+ case ext/dba in + + ++ case ext/calendar in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac -+ -+ + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + + b_c_pre=$php_c_pre + b_cxx_pre=$php_cxx_pre @@ -7708,95 +7673,222 @@ + + + old_IFS=$IFS -+ for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do -+ ++ for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do + +- fi + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + + PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" -+ + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac -+ + +- fi +- +- fi + cat >>Makefile.objects</dev/null ; then +- ai_p=$CURL_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" + ;; + esac -+ EXT_CLI_STATIC="$EXT_CLI_STATIC dba" -+ fi -+ -+ ++ EXT_CLI_STATIC="$EXT_CLI_STATIC calendar" + fi +- +- +- +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + BUILD_DIR="$BUILD_DIR $ext_builddir" -+ -+ -+ + +- fi + + + if test "$ext_builddir" = "."; then -+ PHP_PECL_EXTENSION=dba -+ ++ PHP_PECL_EXTENSION=calendar + +- fi + PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" -+ -+ fi -+ -+ -+ -+ BUILD_DIR="$BUILD_DIR $ext_builddir/libinifile" -+ -+ -+ -+ -+ BUILD_DIR="$BUILD_DIR $ext_builddir/libcdb" -+ -+ -+ -+ -+ BUILD_DIR="$BUILD_DIR $ext_builddir/libflatfile" -+ -+ -+ -+ PHP_VAR_SUBST="$PHP_VAR_SUBST DBA_SHARED_LIBADD" -+ -+else -+ echo "$ac_t""no" 1>&6 + + fi +- +- +- case curl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lcurl $LIBS" +- ;; +- esac +- + +fi -+ -+ -+ -+php_enable_dio=no -+ -+echo $ac_n "checking whether to enable direct I/O support""... $ac_c" 1>&6 -+echo "configure:33701: checking whether to enable direct I/O support" >&5 -+# Check whether --enable-dio or --disable-dio was given. -+if test "${enable_dio+set}" = set; then -+ enableval="$enable_dio" -+ PHP_DIO=$enableval + + +- fi + ++php_enable_ctype=yes + ++echo $ac_n "checking whether to enable ctype functions""... $ac_c" 1>&6 ++echo "configure:28308: checking whether to enable ctype functions" >&5 ++# Check whether --enable-ctype or --disable-ctype was given. ++if test "${enable_ctype+set}" = set; then ++ enableval="$enable_ctype" ++ PHP_CTYPE=$enableval +else -+ -+ PHP_DIO=no -+ test "$PHP_ENABLE_ALL" && PHP_DIO=$PHP_ENABLE_ALL -+ -+fi -+ -+ -+ + +- echo $ac_n "checking for SSL support in libcurl""... $ac_c" 1>&6 +-echo "configure:27934: checking for SSL support in libcurl" >&5 +- CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` +- if test "$CURL_SSL" = "SSL"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_CURL_SSL 1 +-EOF ++ PHP_CTYPE=yes ++ test "$PHP_ENABLE_ALL" && PHP_CTYPE=$PHP_ENABLE_ALL + +- +- save_CFLAGS="$CFLAGS" +- CFLAGS="`$CURL_CONFIG --cflags`" +- +- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:27947: checking how to run the C preprocessor" >&5 +-# On Suns, sometimes $CPP names a directory. +-if test -n "$CPP" && test -d "$CPP"; then +- CPP= +-fi +-if test -z "$CPP"; then +-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- # This must be in double quotes, not single quotes, because CPP may get +- # substituted into the Makefile and "${CC-cc}" will confuse make. +- CPP="${CC-cc} -E" +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. +- cat > conftest.$ac_ext < +-Syntax Error +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:27968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- : +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- CPP="${CC-cc} -E -traditional-cpp" +- cat > conftest.$ac_ext < +-Syntax Error +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:27985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- : +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- CPP="${CC-cc} -nologo -E" +- cat > conftest.$ac_ext < +-Syntax Error +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:28002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- : +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- CPP=/lib/cpp +-fi +-rm -f conftest* +-fi +-rm -f conftest* +-fi +-rm -f conftest* +- ac_cv_prog_CPP="$CPP" +-fi +- CPP="$ac_cv_prog_CPP" +-else +- ac_cv_prog_CPP="$CPP" + fi +-echo "$ac_t""$CPP" 1>&6 + +- echo $ac_n "checking for openssl support in libcurl""... $ac_c" 1>&6 +-echo "configure:28027: checking for openssl support in libcurl" >&5 +- if test "$cross_compiling" = yes; then +- +- echo "$ac_t""no" 1>&6 +- +-else +- cat > conftest.$ac_ext < + +-int main(int argc, char *argv[]) +-{ +- curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); +ext_output="yes, shared" +ext_shared=yes -+case $PHP_DIO in ++case $PHP_CTYPE in +shared,*) -+ PHP_DIO=`echo "$PHP_DIO"|$SED 's/^shared,//'` ++ PHP_CTYPE=`echo "$PHP_CTYPE"|$SED 's/^shared,//'` + ;; +shared) -+ PHP_DIO=yes ++ PHP_CTYPE=yes + ;; +no) + ext_output=no @@ -7807,1932 +7899,3771 @@ + ext_shared=no + ;; +esac + +- if (data && data->ssl_version && *data->ssl_version) { +- const char *ptr = data->ssl_version; + +- while(*ptr == ' ') ++ptr; +- return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); +- } +- return 1; +-} +- + ++echo "$ac_t""$ext_output" 1>&6 + + -+echo "$ac_t""$ext_output" 1>&6 + - - --echo $ac_n "checking whether to enable DBA interface""... $ac_c" 1>&6 --echo "configure:32347: checking whether to enable DBA interface" >&5 --if test "$HAVE_DBA" = "1"; then -- if test "$ext_shared" = "yes"; then -- echo "$ac_t""yes, shared" 1>&6 -- else -- echo "$ac_t""yes" 1>&6 -- fi -- cat >> confdefs.h <<\EOF --#define HAVE_DBA 1 --EOF - -+if test "$PHP_DIO" != "no"; then ++ ++if test "$PHP_CTYPE" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_CTYPE 1 + EOF +-if { (eval echo configure:28053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++ -- ext_builddir=ext/dba -- ext_srcdir=$abs_srcdir/ext/dba -+ ext_builddir=ext/dio -+ ext_srcdir=$abs_srcdir/ext/dio +- echo "$ac_t""yes" 1>&6 +- for ac_hdr in openssl/crypto.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:28061: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:28071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_CURL_OPENSSL 1 +-EOF ++ ext_builddir=ext/ctype ++ ext_srcdir=$abs_srcdir/ext/ctype - ac_extra= +- +-else +- echo "$ac_t""no" 1>&6 +-fi +-done ++ ac_extra= - if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then -- PHP_DBA_SHARED=no -+ PHP_DIO_SHARED=no ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_CTYPE_SHARED=no - -- case ext/dba in -+ case ext/dio in - "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -- /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -- *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; - esac - - -@@ -32382,7 +33766,7 @@ EOF - - - old_IFS=$IFS -- for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do -+ for ac_src in dio.c dio_common.c dio_posix.c dio_stream_wrappers.c; do - - IFS=. - set $ac_src -@@ -32405,18 +33789,18 @@ EOF - done - +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- echo "$ac_t""no" 1>&6 +- +-fi +-rm -fr conftest* +-fi ++ ++ case ext/ctype in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ -- EXT_STATIC="$EXT_STATIC dba" -+ EXT_STATIC="$EXT_STATIC dio" - if test "$ext_shared" != "nocli"; then -- EXT_CLI_STATIC="$EXT_CLI_STATIC dba" -+ EXT_CLI_STATIC="$EXT_CLI_STATIC dio" - fi - else - if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then -- PHP_DBA_SHARED=yes -+ PHP_DIO_SHARED=yes - -- case ext/dba in -+ case ext/dio in - "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -- /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -- *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; - esac - +- +- echo $ac_n "checking for gnutls support in libcurl""... $ac_c" 1>&6 +-echo "configure:28116: checking for gnutls support in libcurl" >&5 +- if test "$cross_compiling" = yes; then ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in ctype.c; do -@@ -32431,14 +33815,14 @@ EOF +- echo "$ac_t""no" 1>&6 +- +-else +- cat > conftest.$ac_ext < ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac - old_IFS=$IFS -- for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do -+ for ac_src in dio.c dio_common.c dio_posix.c dio_stream_wrappers.c; do - - IFS=. - set $ac_src - ac_obj=$1 - IFS=$old_IFS - -- shared_objects_dba="$shared_objects_dba $ac_bdir$ac_obj.lo" -+ shared_objects_dio="$shared_objects_dio $ac_bdir$ac_obj.lo" - - case $ac_src in - *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; -@@ -32461,31 +33845,31 @@ EOF - case $host_alias in - *aix*) - suffix=so -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpdba.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(PHPDBA_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpdba.so '$ext_builddir'/phpdba.so' -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpdio.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) $(PHPDIO_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpdio.so '$ext_builddir'/phpdio.so' - ;; - *netware*) - suffix=nlm -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPDBA, 3)_SHARED_LIBADD)' -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPDIO, 3)_SHARED_LIBADD)' - ;; - *) - suffix=la -- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(PHPDBA_SHARED_LIBADD)' -+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) $(PHPDIO_SHARED_LIBADD)' - ;; - esac - - if test "x" = "xyes"; then -- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpdba.$suffix" -+ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpdio.$suffix" - else -- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdba.$suffix" -+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdio.$suffix" - fi +-int main(int argc, char *argv[]) +-{ +- curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ cat >>Makefile.objects<>Makefile.objects<ssl_version && *data->ssl_version) { +- const char *ptr = data->ssl_version; + +- while(*ptr == ' ') ++ptr; +- return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); +- } +- return 1; +-} ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in ctype.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_ctype="$shared_objects_ctype $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++ done ++ ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpctype.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(PHPCTYPE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpctype.so '$ext_builddir'/phpctype.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPCTYPE, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(PHPCTYPE_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpctype.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpctype.$suffix" ++ fi -- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dba" -+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dio" - - cat >>Makefile.objects<> confdefs.h <&6 +- ac_safe=`echo "gcrypt.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for gcrypt.h""... $ac_c" 1>&6 +-echo "configure:28148: checking for gcrypt.h" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype" ++ ++ cat >>Makefile.objects<&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ ++ ;; ++ *) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/ctype.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/ctype.so '$ext_builddir'/ctype.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(CTYPE, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/ctype.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/ctype.$suffix" ++ fi -@@ -32560,7 +33944,7 @@ EOF +- cat >> confdefs.h <<\EOF +-#define HAVE_CURL_GNUTLS 1 ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype" ++ ++ cat >>Makefile.objects<> confdefs.h <&6 +-fi ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<&6 ++echo "configure:28652: checking for cURL support" >&5 ++# Check whether --with-curl or --without-curl was given. ++if test "${with_curl+set}" = set; then ++ withval="$with_curl" ++ PHP_CURL=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* - IFS=. - set $ac_src -@@ -32583,15 +33967,15 @@ EOF - done +- echo "$ac_t""no" 1>&6 +- ++ PHP_CURL=no ++ test "$PHP_ENABLE_ALL" && PHP_CURL=$PHP_ENABLE_ALL ++ + fi +-rm -fr conftest* ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_CURL in ++shared,*) ++ PHP_CURL=`echo "$PHP_CURL"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_CURL=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++ ++php_with_curlwrappers=no ++ ++echo $ac_n "checking if we should use cURL for url streams""... $ac_c" 1>&6 ++echo "configure:28696: checking if we should use cURL for url streams" >&5 ++# Check whether --with-curlwrappers or --without-curlwrappers was given. ++if test "${with_curlwrappers+set}" = set; then ++ withval="$with_curlwrappers" ++ PHP_CURLWRAPPERS=$withval ++else ++ ++ PHP_CURLWRAPPERS=no ++ ++ + fi +- +- CFLAGS="$save_CFLAGS" ++ ++ext_output=$PHP_CURLWRAPPERS ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_CURL" != "no"; then ++ if test -r $PHP_CURL/include/curl/easy.h; then ++ CURL_DIR=$PHP_CURL + else +- echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for cURL in default path""... $ac_c" 1>&6 ++echo "configure:28720: checking for cURL in default path" >&5 ++ for i in /usr/local /usr; do ++ if test -r $i/include/curl/easy.h; then ++ CURL_DIR=$i ++ echo "$ac_t""found in $i" 1>&6 ++ break ++ fi ++ done ++ fi ++ ++ if test -z "$CURL_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Please reinstall the libcurl distribution - ++ easy.h should be in /include/curl/" 1>&2; exit 1; } ++ fi ++ ++ CURL_CONFIG="curl-config" ++ echo $ac_n "checking for cURL 7.10.5 or greater""... $ac_c" 1>&6 ++echo "configure:28738: checking for cURL 7.10.5 or greater" >&5 ++ ++ if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then ++ CURL_CONFIG=${CURL_DIR}/bin/curl-config ++ else ++ if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then ++ CURL_CONFIG=${CURL_DIR}/curl-config ++ fi ++ fi ++ ++ curl_version_full=`$CURL_CONFIG --version` ++ curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` ++ if test "$curl_version" -ge 7010005; then ++ echo "$ac_t""$curl_version_full" 1>&6 ++ CURL_LIBS=`$CURL_CONFIG --libs` ++ else ++ { echo "configure: error: cURL version 7.10.5 or later is required to compile php with cURL support" 1>&2; exit 1; } + fi -- EXT_STATIC="$EXT_STATIC dba" -+ EXT_STATIC="$EXT_STATIC dio" - ;; - *) - - -- case ext/dba in -+ case ext/dio in - "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; -- /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -- *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; -+ /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; -+ *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; - esac +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR +- " ++ if test "$CURL_DIR/include" != "/usr/include"; then ++ ++ if test -z "$CURL_DIR/include" || echo "$CURL_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/include ++ else ++ ++ ep_dir="`echo $CURL_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/include\"`" ++ fi ++ ++ -@@ -32606,7 +33990,7 @@ EOF - - - old_IFS=$IFS -- for ac_src in dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources; do -+ for ac_src in dio.c dio_common.c dio_posix.c dio_stream_wrappers.c; do +- save_ext_shared=$ext_shared +- ext_shared=yes ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` - IFS=. - set $ac_src -@@ -32631,7 +34015,7 @@ EOF - - ;; - esac -- EXT_CLI_STATIC="$EXT_CLI_STATIC dba" -+ EXT_CLI_STATIC="$EXT_CLI_STATIC dio" - fi +- for ac_i in $ac_stuff; do ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ for ac_i in $CURL_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ CURL_SHARED_LIBADD="$CURL_SHARED_LIBADD -pthread" + else + +@@ -28233,7 +28811,7 @@ fi + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ CURL_SHARED_LIBADD="$CURL_SHARED_LIBADD -l$ac_ii" + else + -@@ -32640,32 +34024,12 @@ EOF - +@@ -28268,8 +28846,8 @@ fi - if test "$ext_builddir" = "."; then -- PHP_PECL_EXTENSION=dba -+ PHP_PECL_EXTENSION=dio - PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" - - fi + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ CURL_SHARED_LIBADD="-L$ai_p $CURL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p $CURL_SHARED_LIBADD" + else + + +@@ -28295,39 +28873,503 @@ fi + esac + done -- -- -- BUILD_DIR="$BUILD_DIR $ext_builddir/libinifile" -- -- -- -- -- BUILD_DIR="$BUILD_DIR $ext_builddir/libcdb" -- -- -- -- -- BUILD_DIR="$BUILD_DIR $ext_builddir/libflatfile" -- -- -- -- PHP_VAR_SUBST="$PHP_VAR_SUBST DBA_SHARED_LIBADD" +- echo $ac_n "checking for curl_easy_perform in -lcurl""... $ac_c" 1>&6 +-echo "configure:28300: checking for curl_easy_perform in -lcurl" >&5 +-ac_lib_var=`echo curl'_'curl_easy_perform | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lcurl $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" -else -- echo "$ac_t""no" 1>&6 - fi - - -@@ -32673,7 +34037,7 @@ fi - php_enable_dom=yes - - echo $ac_n "checking whether to enable DOM support""... $ac_c" 1>&6 --echo "configure:32677: checking whether to enable DOM support" >&5 -+echo "configure:34041: checking whether to enable DOM support" >&5 - # Check whether --enable-dom or --disable-dom was given. - if test "${enable_dom+set}" = set; then - enableval="$enable_dom" -@@ -32718,7 +34082,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no - - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:32722: checking libxml2 install dir" >&5 -+echo "configure:34086: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -32746,7 +34110,7 @@ if test "$PHP_DOM" != "no"; then - - - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:32750: checking for xml2-config path" >&5 -+echo "configure:34114: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -32904,7 +34268,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path - - - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:32908: checking whether libxml build works" >&5 -+echo "configure:34272: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -32920,7 +34284,7 @@ else - - else - cat > conftest.$ac_ext <&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ - -@@ -32931,7 +34295,7 @@ else - } - - EOF --if { (eval echo configure:32935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:34299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +-fi ++ if test "$ext_shared" = "yes"; then ++ CURL_SHARED_LIBADD="-lcurl $CURL_SHARED_LIBADD" ++ if test -n "$CURL_DIR/$PHP_LIBDIR"; then ++ ++ if test "$CURL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$CURL_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$CURL_DIR/$PHP_LIBDIR" || echo "$CURL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ CURL_SHARED_LIBADD="-L$ai_p $CURL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p $CURL_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$CURL_DIR/$PHP_LIBDIR"; then ++ ++ if test "$CURL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$CURL_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$CURL_DIR/$PHP_LIBDIR" || echo "$CURL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case curl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lcurl $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ echo $ac_n "checking for SSL support in libcurl""... $ac_c" 1>&6 ++echo "configure:28976: checking for SSL support in libcurl" >&5 ++ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` ++ if test "$CURL_SSL" = "SSL"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_SSL 1 ++EOF ++ ++ ++ save_CFLAGS="$CFLAGS" ++ CFLAGS="`$CURL_CONFIG --cflags`" ++ ++ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ++echo "configure:28989: checking how to run the C preprocessor" >&5 ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ # This must be in double quotes, not single quotes, because CPP may get ++ # substituted into the Makefile and "${CC-cc}" will confuse make. ++ CPP="${CC-cc} -E" ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:29010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -E -traditional-cpp" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:29027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -nologo -E" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:29044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP=/lib/cpp ++fi ++rm -f conftest* ++fi ++rm -f conftest* ++fi ++rm -f conftest* ++ ac_cv_prog_CPP="$CPP" ++fi ++ CPP="$ac_cv_prog_CPP" ++else ++ ac_cv_prog_CPP="$CPP" ++fi ++echo "$ac_t""$CPP" 1>&6 ++ ++ echo $ac_n "checking for openssl support in libcurl""... $ac_c" 1>&6 ++echo "configure:29069: checking for openssl support in libcurl" >&5 ++ if test "$cross_compiling" = yes; then ++ ++ echo "$ac_t""no" 1>&6 ++ ++else ++ cat > conftest.$ac_ext < ++ ++int main(int argc, char *argv[]) ++{ ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); ++ } ++ return 1; ++} ++ ++EOF ++if { (eval echo configure:29095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ echo "$ac_t""yes" 1>&6 ++ for ac_hdr in openssl/crypto.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:29103: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:29113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_CURL_OPENSSL 1 ++EOF ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++done ++ ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ echo "$ac_t""no" 1>&6 ++ ++fi ++rm -fr conftest* ++fi ++ ++ ++ echo $ac_n "checking for gnutls support in libcurl""... $ac_c" 1>&6 ++echo "configure:29158: checking for gnutls support in libcurl" >&5 ++ if test "$cross_compiling" = yes; then ++ ++ echo "$ac_t""no" 1>&6 ++ ++else ++ cat > conftest.$ac_ext < ++ ++int main(int argc, char *argv[]) ++{ ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); ++ } ++ return 1; ++} ++ ++EOF ++if { (eval echo configure:29184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ echo "$ac_t""yes" 1>&6 ++ ac_safe=`echo "gcrypt.h" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for gcrypt.h""... $ac_c" 1>&6 ++echo "configure:29190: checking for gcrypt.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:29200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_GNUTLS 1 ++EOF ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ echo "$ac_t""no" 1>&6 ++ ++fi ++rm -fr conftest* ++fi ++ ++ ++ CFLAGS="$save_CFLAGS" ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for curl_easy_perform in -lcurl""... $ac_c" 1>&6 ++echo "configure:29342: checking for curl_easy_perform in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_easy_perform | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 - LIBS=$old_LIBS -@@ -33354,7 +34718,7 @@ fi - php_with_enchant=no - - echo $ac_n "checking for ENCHANT support""... $ac_c" 1>&6 --echo "configure:33358: checking for ENCHANT support" >&5 -+echo "configure:34722: checking for ENCHANT support" >&5 - # Check whether --with-enchant or --without-enchant was given. - if test "${with_enchant+set}" = set; then - withval="$with_enchant" -@@ -33939,7 +35303,7 @@ EOF +@@ -28451,7 +29493,7 @@ fi done - echo $ac_n "checking for enchant_broker_set_param in -lenchant""... $ac_c" 1>&6 --echo "configure:33943: checking for enchant_broker_set_param in -lenchant" >&5 -+echo "configure:35307: checking for enchant_broker_set_param in -lenchant" >&5 - ac_lib_var=`echo enchant'_'enchant_broker_set_param | sed 'y%./+-%__p_%'` + echo $ac_n "checking for curl_version_info in -lcurl""... $ac_c" 1>&6 +-echo "configure:28455: checking for curl_version_info in -lcurl" >&5 ++echo "configure:29497: checking for curl_version_info in -lcurl" >&5 + ac_lib_var=`echo curl'_'curl_version_info | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -33947,7 +35311,7 @@ else +@@ -28459,7 +29501,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lenchant $LIBS" + LIBS="-lcurl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:35326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:28474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:29516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -34005,7 +35369,7 @@ fi - php_enable_exif=no - - echo $ac_n "checking whether to enable EXIF (metadata from images) support""... $ac_c" 1>&6 --echo "configure:34009: checking whether to enable EXIF (metadata from images) support" >&5 -+echo "configure:35373: checking whether to enable EXIF (metadata from images) support" >&5 - # Check whether --enable-exif or --disable-exif was given. - if test "${enable_exif+set}" = set; then - enableval="$enable_exif" -@@ -34349,7 +35713,7 @@ fi - php_enable_fileinfo=yes - - echo $ac_n "checking for fileinfo support""... $ac_c" 1>&6 --echo "configure:34353: checking for fileinfo support" >&5 -+echo "configure:35717: checking for fileinfo support" >&5 - # Check whether --enable-fileinfo or --disable-fileinfo was given. - if test "${enable_fileinfo+set}" = set; then - enableval="$enable_fileinfo" -@@ -34699,12 +36063,12 @@ EOF - for ac_func in utimes strndup - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:34703: checking for $ac_func" >&5 -+echo "configure:36067: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:36095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -34765,7 +36129,7 @@ fi - php_enable_filter=yes - - echo $ac_n "checking whether to enable input filter support""... $ac_c" 1>&6 --echo "configure:34769: checking whether to enable input filter support" >&5 -+echo "configure:36133: checking whether to enable input filter support" >&5 - # Check whether --enable-filter or --disable-filter was given. - if test "${enable_filter+set}" = set; then - enableval="$enable_filter" -@@ -34809,7 +36173,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_pcre_dir=no - - echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6 --echo "configure:34813: checking pcre install prefix" >&5 -+echo "configure:36177: checking pcre install prefix" >&5 - # Check whether --with-pcre-dir or --without-pcre-dir was given. - if test "${with_pcre_dir+set}" = set; then - withval="$with_pcre_dir" -@@ -34836,7 +36200,7 @@ if test "$PHP_FILTER" != "no"; then - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$INCLUDES - cat > conftest.$ac_ext < -@@ -34855,7 +36219,7 @@ else - rm -rf conftest* - - cat > conftest.$ac_ext < -@@ -35225,7 +36589,7 @@ fi - php_enable_ftp=no - - echo $ac_n "checking whether to enable FTP support""... $ac_c" 1>&6 --echo "configure:35229: checking whether to enable FTP support" >&5 -+echo "configure:36593: checking whether to enable FTP support" >&5 - # Check whether --enable-ftp or --disable-ftp was given. - if test "${enable_ftp+set}" = set; then - enableval="$enable_ftp" -@@ -35269,7 +36633,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_openssl_dir=no - - echo $ac_n "checking OpenSSL dir for FTP""... $ac_c" 1>&6 --echo "configure:35273: checking OpenSSL dir for FTP" >&5 -+echo "configure:36637: checking OpenSSL dir for FTP" >&5 - # Check whether --with-openssl-dir or --without-openssl-dir was given. - if test "${with_openssl_dir+set}" = set; then - withval="$with_openssl_dir" -@@ -35607,7 +36971,7 @@ EOF - # Extract the first word of "pkg-config", so it can be a program name with args. - set dummy pkg-config; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:35611: checking for $ac_word" >&5 -+echo "configure:36975: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -35812,9 +37176,9 @@ fi - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$OPENSSL_INCDIR - echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 --echo "configure:35816: checking for OpenSSL version" >&5 -+echo "configure:37180: checking for OpenSSL version" >&5 - cat > conftest.$ac_ext < -@@ -35969,7 +37333,7 @@ rm -f conftest* +@@ -28604,7 +29646,7 @@ fi done - echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 --echo "configure:35973: checking for CRYPTO_free in -lcrypto" >&5 -+echo "configure:37337: checking for CRYPTO_free in -lcrypto" >&5 - ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` + echo $ac_n "checking for curl_easy_strerror in -lcurl""... $ac_c" 1>&6 +-echo "configure:28608: checking for curl_easy_strerror in -lcurl" >&5 ++echo "configure:29650: checking for curl_easy_strerror in -lcurl" >&5 + ac_lib_var=`echo curl'_'curl_easy_strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -35977,7 +37341,7 @@ else +@@ -28612,7 +29654,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lcrypto $LIBS" + LIBS="-lcurl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:37356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:28627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:29669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -36145,7 +37509,7 @@ fi +@@ -28757,7 +29799,7 @@ fi done - echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 --echo "configure:36149: checking for SSL_CTX_set_ssl_version in -lssl" >&5 -+echo "configure:37513: checking for SSL_CTX_set_ssl_version in -lssl" >&5 - ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` + echo $ac_n "checking for curl_multi_strerror in -lcurl""... $ac_c" 1>&6 +-echo "configure:28761: checking for curl_multi_strerror in -lcurl" >&5 ++echo "configure:29803: checking for curl_multi_strerror in -lcurl" >&5 + ac_lib_var=`echo curl'_'curl_multi_strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -36153,7 +37517,7 @@ else +@@ -28765,7 +29807,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lssl $LIBS" + LIBS="-lcurl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:37532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:28780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:29822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -36283,7 +37647,7 @@ fi - php_with_gd=no - - echo $ac_n "checking for GD support""... $ac_c" 1>&6 --echo "configure:36287: checking for GD support" >&5 -+echo "configure:37651: checking for GD support" >&5 - # Check whether --with-gd or --without-gd was given. - if test "${with_gd+set}" = set; then - withval="$with_gd" -@@ -36328,7 +37692,7 @@ if test -z "$PHP_JPEG_DIR"; then - php_with_jpeg_dir=no - - echo $ac_n "checking for the location of libjpeg""... $ac_c" 1>&6 --echo "configure:36332: checking for the location of libjpeg" >&5 -+echo "configure:37696: checking for the location of libjpeg" >&5 - # Check whether --with-jpeg-dir or --without-jpeg-dir was given. - if test "${with_jpeg_dir+set}" = set; then - withval="$with_jpeg_dir" -@@ -36353,7 +37717,7 @@ if test -z "$PHP_PNG_DIR"; then - php_with_png_dir=no - - echo $ac_n "checking for the location of libpng""... $ac_c" 1>&6 --echo "configure:36357: checking for the location of libpng" >&5 -+echo "configure:37721: checking for the location of libpng" >&5 - # Check whether --with-png-dir or --without-png-dir was given. - if test "${with_png_dir+set}" = set; then - withval="$with_png_dir" -@@ -36378,7 +37742,7 @@ if test -z "$PHP_ZLIB_DIR"; then - php_with_zlib_dir=no - - echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 --echo "configure:36382: checking for the location of libz" >&5 -+echo "configure:37746: checking for the location of libz" >&5 - # Check whether --with-zlib-dir or --without-zlib-dir was given. - if test "${with_zlib_dir+set}" = set; then - withval="$with_zlib_dir" -@@ -36402,7 +37766,7 @@ fi - php_with_xpm_dir=no - - echo $ac_n "checking for the location of libXpm""... $ac_c" 1>&6 --echo "configure:36406: checking for the location of libXpm" >&5 -+echo "configure:37770: checking for the location of libXpm" >&5 - # Check whether --with-xpm-dir or --without-xpm-dir was given. - if test "${with_xpm_dir+set}" = set; then - withval="$with_xpm_dir" -@@ -36425,7 +37789,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_freetype_dir=no - - echo $ac_n "checking for FreeType 2""... $ac_c" 1>&6 --echo "configure:36429: checking for FreeType 2" >&5 -+echo "configure:37793: checking for FreeType 2" >&5 - # Check whether --with-freetype-dir or --without-freetype-dir was given. - if test "${with_freetype_dir+set}" = set; then - withval="$with_freetype_dir" -@@ -36448,7 +37812,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_t1lib=no - - echo $ac_n "checking for T1lib support""... $ac_c" 1>&6 --echo "configure:36452: checking for T1lib support" >&5 -+echo "configure:37816: checking for T1lib support" >&5 - # Check whether --with-t1lib or --without-t1lib was given. - if test "${with_t1lib+set}" = set; then - withval="$with_t1lib" -@@ -36471,7 +37835,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_gd_native_ttf=no - - echo $ac_n "checking whether to enable truetype string function in GD""... $ac_c" 1>&6 --echo "configure:36475: checking whether to enable truetype string function in GD" >&5 -+echo "configure:37839: checking whether to enable truetype string function in GD" >&5 - # Check whether --enable-gd-native-ttf or --disable-gd-native-ttf was given. - if test "${enable_gd_native_ttf+set}" = set; then - enableval="$enable_gd_native_ttf" -@@ -36494,7 +37858,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_gd_jis_conv=no - - echo $ac_n "checking whether to enable JIS-mapped Japanese font support in GD""... $ac_c" 1>&6 --echo "configure:36498: checking whether to enable JIS-mapped Japanese font support in GD" >&5 -+echo "configure:37862: checking whether to enable JIS-mapped Japanese font support in GD" >&5 - # Check whether --enable-gd-jis-conv or --disable-gd-jis-conv was given. - if test "${enable_gd_jis_conv+set}" = set; then - enableval="$enable_gd_jis_conv" -@@ -36546,12 +37910,12 @@ if test "$PHP_GD" = "yes"; then - for ac_func in fabsf floorf - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:36550: checking for $ac_func" >&5 -+echo "configure:37914: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:37942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -36746,7 +38110,7 @@ EOF +@@ -29462,7 +30504,7 @@ if test "$PHP_QDBM" != "no"; then done - echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6 --echo "configure:36750: checking for jpeg_read_header in -ljpeg" >&5 -+echo "configure:38114: checking for jpeg_read_header in -ljpeg" >&5 - ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'` + echo $ac_n "checking for dpopen in -l$LIB""... $ac_c" 1>&6 +-echo "configure:29466: checking for dpopen in -l$LIB" >&5 ++echo "configure:30508: checking for dpopen in -l$LIB" >&5 + ac_lib_var=`echo $LIB'_'dpopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -36754,7 +38118,7 @@ else +@@ -29470,7 +30512,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-ljpeg $LIBS" + LIBS="-l$LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:38133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:29485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:30527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -37047,7 +38411,7 @@ fi +@@ -29650,7 +30692,7 @@ fi + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:29654: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:30696: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -29678,7 +30720,7 @@ if test "$PHP_GDBM" != "no"; then + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:29682: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:30724: checking for $THIS_FULL_NAME support" >&5 + if test -n "You cannot combine --with-gdbm with --with-qdbm"; then + { echo "configure: error: You cannot combine --with-gdbm with --with-qdbm" 1>&2; exit 1; } + fi +@@ -29797,7 +30839,7 @@ echo "configure:29682: checking for $THI done - echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6 --echo "configure:37051: checking for png_write_image in -lpng" >&5 -+echo "configure:38415: checking for png_write_image in -lpng" >&5 - ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 +-echo "configure:29801: checking for gdbm_open in -lgdbm" >&5 ++echo "configure:30843: checking for gdbm_open in -lgdbm" >&5 + ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -37055,7 +38419,7 @@ else +@@ -29805,7 +30847,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lpng $LIBS" + LIBS="-lgdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:38434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:29820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:30862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -37446,7 +38810,7 @@ fi +@@ -29981,7 +31023,7 @@ fi + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:29985: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:31027: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -30110,7 +31152,7 @@ if test "$PHP_NDBM" != "no"; then done - echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6 --echo "configure:37450: checking for XpmFreeXpmImage in -lXpm" >&5 -+echo "configure:38814: checking for XpmFreeXpmImage in -lXpm" >&5 - ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'` + echo $ac_n "checking for dbm_open in -l$LIB""... $ac_c" 1>&6 +-echo "configure:30114: checking for dbm_open in -l$LIB" >&5 ++echo "configure:31156: checking for dbm_open in -l$LIB" >&5 + ac_lib_var=`echo $LIB'_'dbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -37454,7 +38818,7 @@ else +@@ -30118,7 +31160,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lXpm $LIBS" + LIBS="-l$LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:38833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:30133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:31175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -37840,7 +39204,7 @@ fi - done - - echo $ac_n "checking for FT_New_Face in -lfreetype""... $ac_c" 1>&6 --echo "configure:37844: checking for FT_New_Face in -lfreetype" >&5 -+echo "configure:39208: checking for FT_New_Face in -lfreetype" >&5 - ac_lib_var=`echo freetype'_'FT_New_Face | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -37848,7 +39212,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lfreetype $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:30302: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:31344: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -30382,7 +31424,7 @@ if test "$PHP_DB4" != "no"; then + LIBS="-l$LIB $LIBS" + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:39227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -38176,7 +39540,7 @@ fi - done - echo $ac_n "checking for T1_StrError in -lt1""... $ac_c" 1>&6 --echo "configure:38180: checking for T1_StrError in -lt1" >&5 -+echo "configure:39544: checking for T1_StrError in -lt1" >&5 - ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -38184,7 +39548,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lt1 $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:39563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:30397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:31439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -38638,7 +40002,7 @@ EOF + + cat > conftest.$ac_ext <&6 +-echo "configure:30438: checking for DB4 major version" >&5 ++echo "configure:31480: checking for DB4 major version" >&5 + { echo "configure: error: Header contains different version" 1>&2; exit 1; } + fi + if test "4" = "4"; then + echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 +-echo "configure:30443: checking for DB4 minor version and patch level" >&5 ++echo "configure:31485: checking for DB4 minor version and patch level" >&5 + cat > conftest.$ac_ext <&6 --echo "configure:38642: checking for jpeg_read_header in -ljpeg" >&5 -+echo "configure:40006: checking for jpeg_read_header in -ljpeg" >&5 - ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -38646,7 +40010,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ljpeg $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:30471: checking if dba can be used as shared extension" >&5 ++echo "configure:31513: checking if dba can be used as shared extension" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:40025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -38939,7 +40303,7 @@ fi - done - echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6 --echo "configure:38943: checking for png_write_image in -lpng" >&5 -+echo "configure:40307: checking for png_write_image in -lpng" >&5 - ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -38947,7 +40311,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpng $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:30630: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:31672: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -30654,7 +31696,7 @@ if test "$PHP_DB3" != "no"; then + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:30658: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:31700: checking for $THIS_FULL_NAME support" >&5 + if test -n "You cannot combine --with-db3 with --with-db4"; then + { echo "configure: error: You cannot combine --with-db3 with --with-db4" 1>&2; exit 1; } + fi +@@ -30705,7 +31747,7 @@ echo "configure:30658: checking for $THI + LIBS="-l$LIB $LIBS" + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:40326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:30720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:31762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -39338,7 +40702,7 @@ fi + + cat > conftest.$ac_ext <&6 +-echo "configure:30761: checking for DB3 major version" >&5 ++echo "configure:31803: checking for DB3 major version" >&5 + { echo "configure: error: Header contains different version" 1>&2; exit 1; } + fi + if test "3" = "4"; then + echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 +-echo "configure:30766: checking for DB4 minor version and patch level" >&5 ++echo "configure:31808: checking for DB4 minor version and patch level" >&5 + cat > conftest.$ac_ext <&6 --echo "configure:39342: checking for XpmFreeXpmImage in -lXpm" >&5 -+echo "configure:40706: checking for XpmFreeXpmImage in -lXpm" >&5 - ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -39346,7 +40710,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lXpm $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:30794: checking if dba can be used as shared extension" >&5 ++echo "configure:31836: checking if dba can be used as shared extension" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:40725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -39732,7 +41096,7 @@ fi - done - echo $ac_n "checking for FT_New_Face in -lfreetype""... $ac_c" 1>&6 --echo "configure:39736: checking for FT_New_Face in -lfreetype" >&5 -+echo "configure:41100: checking for FT_New_Face in -lfreetype" >&5 - ac_lib_var=`echo freetype'_'FT_New_Face | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -39740,7 +41104,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lfreetype $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:30953: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:31995: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -30977,7 +32019,7 @@ if test "$PHP_DB2" != "no"; then + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:30981: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:32023: checking for $THIS_FULL_NAME support" >&5 + if test -n "You cannot combine --with-db2 with --with-db3 or --with-db4"; then + { echo "configure: error: You cannot combine --with-db2 with --with-db3 or --with-db4" 1>&2; exit 1; } + fi +@@ -31028,7 +32070,7 @@ echo "configure:30981: checking for $THI + LIBS="-l$LIB $LIBS" + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:41119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:31043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:32085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -40068,7 +41432,7 @@ fi + + cat > conftest.$ac_ext <&6 +-echo "configure:31084: checking for DB2 major version" >&5 ++echo "configure:32126: checking for DB2 major version" >&5 + { echo "configure: error: Header contains different version" 1>&2; exit 1; } + fi + if test "2" = "4"; then + echo $ac_n "checking for DB4 minor version and patch level""... $ac_c" 1>&6 +-echo "configure:31089: checking for DB4 minor version and patch level" >&5 ++echo "configure:32131: checking for DB4 minor version and patch level" >&5 + cat > conftest.$ac_ext <&6 --echo "configure:40072: checking for T1_StrError in -lt1" >&5 -+echo "configure:41436: checking for T1_StrError in -lt1" >&5 - ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -40076,7 +41440,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lt1 $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:31117: checking if dba can be used as shared extension" >&5 ++echo "configure:32159: checking if dba can be used as shared extension" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:41455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -40462,7 +41826,7 @@ EOF - done - echo $ac_n "checking for gdImageString16 in -lgd""... $ac_c" 1>&6 --echo "configure:40466: checking for gdImageString16 in -lgd" >&5 -+echo "configure:41830: checking for gdImageString16 in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageString16 | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -40470,7 +41834,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:31276: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:32318: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -31292,7 +32334,7 @@ if test "$PHP_DB1" != "no"; then + unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT + + echo $ac_n "checking for DB1 in library""... $ac_c" 1>&6 +-echo "configure:31296: checking for DB1 in library" >&5 ++echo "configure:32338: checking for DB1 in library" >&5 + if test "$HAVE_DB4" = "1"; then + THIS_VERSION=4 + THIS_LIBS=$DB4_LIBS +@@ -31340,7 +32382,7 @@ EOF + fi + echo "$ac_t""$THIS_LIBS" 1>&6 + echo $ac_n "checking for DB1 in header""... $ac_c" 1>&6 +-echo "configure:31344: checking for DB1 in header" >&5 ++echo "configure:32386: checking for DB1 in header" >&5 + echo "$ac_t""$THIS_INCLUDE" 1>&6 + if test -n "$THIS_INCLUDE"; then + +@@ -31350,7 +32392,7 @@ echo "configure:31344: checking for DB1 + LIBS="-l$THIS_LIBS $LIBS" + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:41849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:31365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:32407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -40610,7 +41974,7 @@ fi + + cat >> confdefs.h <&6 +-echo "configure:31515: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:32557: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -31539,7 +32581,7 @@ if test "$PHP_DBM" != "no"; then + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:31543: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:32585: checking for $THIS_FULL_NAME support" >&5 + if test -n "You cannot combine --with-dbm with --with-qdbm"; then + { echo "configure: error: You cannot combine --with-dbm with --with-qdbm" 1>&2; exit 1; } + fi +@@ -31663,7 +32705,7 @@ echo "configure:31543: checking for $THI done - echo $ac_n "checking for gdImagePaletteCopy in -lgd""... $ac_c" 1>&6 --echo "configure:40614: checking for gdImagePaletteCopy in -lgd" >&5 -+echo "configure:41978: checking for gdImagePaletteCopy in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImagePaletteCopy | sed 'y%./+-%__p_%'` + echo $ac_n "checking for dbminit in -l$LIB""... $ac_c" 1>&6 +-echo "configure:31667: checking for dbminit in -l$LIB" >&5 ++echo "configure:32709: checking for dbminit in -l$LIB" >&5 + ac_lib_var=`echo $LIB'_'dbminit | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -40618,7 +41982,7 @@ else +@@ -31671,7 +32713,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-l$LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:41997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:31686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:32728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -40758,7 +42122,7 @@ fi +@@ -31702,7 +32744,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + ext_shared=$save_ext_shared + + echo $ac_n "checking for DBM using GDBM""... $ac_c" 1>&6 +-echo "configure:31706: checking for DBM using GDBM" >&5 ++echo "configure:32748: checking for DBM using GDBM" >&5 + cat >> confdefs.h <&6 +-echo "configure:31870: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:32912: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -32078,7 +33120,7 @@ elif test "$PHP_CDB" != "no"; then done - echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6 --echo "configure:40762: checking for gdImageCreateFromPng in -lgd" >&5 -+echo "configure:42126: checking for gdImageCreateFromPng in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'` + echo $ac_n "checking for cdb_read in -l$LIB""... $ac_c" 1>&6 +-echo "configure:32082: checking for cdb_read in -l$LIB" >&5 ++echo "configure:33124: checking for cdb_read in -l$LIB" >&5 + ac_lib_var=`echo $LIB'_'cdb_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -40766,7 +42130,7 @@ else +@@ -32086,7 +33128,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-l$LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:32101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:33143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -40906,7 +42270,7 @@ fi - done - - echo $ac_n "checking for gdImageCreateFromGif in -lgd""... $ac_c" 1>&6 --echo "configure:40910: checking for gdImageCreateFromGif in -lgd" >&5 -+echo "configure:42274: checking for gdImageCreateFromGif in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateFromGif | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +@@ -32266,7 +33308,7 @@ fi + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:32270: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:33312: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -32297,7 +33339,7 @@ fi + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:32301: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:33343: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -32328,7 +33370,7 @@ fi + THIS_FULL_NAME="$THIS_NAME" + fi + echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6 +-echo "configure:32332: checking for $THIS_FULL_NAME support" >&5 ++echo "configure:33374: checking for $THIS_FULL_NAME support" >&5 + if test -n ""; then + { echo "configure: error: " 1>&2; exit 1; } + fi +@@ -32343,7 +33385,7 @@ echo "configure:32332: checking for $THI + + + echo $ac_n "checking whether to enable DBA interface""... $ac_c" 1>&6 +-echo "configure:32347: checking whether to enable DBA interface" >&5 ++echo "configure:33389: checking whether to enable DBA interface" >&5 + if test "$HAVE_DBA" = "1"; then + if test "$ext_shared" = "yes"; then + echo "$ac_t""yes, shared" 1>&6 +@@ -32670,18 +33712,18 @@ fi + + + +-php_enable_dom=yes ++php_enable_dio=no + +-echo $ac_n "checking whether to enable DOM support""... $ac_c" 1>&6 +-echo "configure:32677: checking whether to enable DOM support" >&5 +-# Check whether --enable-dom or --disable-dom was given. +-if test "${enable_dom+set}" = set; then +- enableval="$enable_dom" +- PHP_DOM=$enableval ++echo $ac_n "checking whether to enable direct I/O support""... $ac_c" 1>&6 ++echo "configure:33719: checking whether to enable direct I/O support" >&5 ++# Check whether --enable-dio or --disable-dio was given. ++if test "${enable_dio+set}" = set; then ++ enableval="$enable_dio" ++ PHP_DIO=$enableval + else + +- PHP_DOM=yes +- test "$PHP_ENABLE_ALL" && PHP_DOM=$PHP_ENABLE_ALL ++ PHP_DIO=no ++ test "$PHP_ENABLE_ALL" && PHP_DIO=$PHP_ENABLE_ALL + + fi + +@@ -32689,12 +33731,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_DOM in ++case $PHP_DIO in + shared,*) +- PHP_DOM=`echo "$PHP_DOM"|$SED 's/^shared,//'` ++ PHP_DIO=`echo "$PHP_DIO"|$SED 's/^shared,//'` + ;; + shared) +- PHP_DOM=yes ++ PHP_DIO=yes + ;; + no) + ext_output=no +@@ -32713,27 +33755,367 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test -z "$PHP_LIBXML_DIR"; then ++if test "$PHP_DIO" != "no"; then + +-php_with_libxml_dir=no ++ ext_builddir=ext/dio ++ ext_srcdir=$abs_srcdir/ext/dio + +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:32722: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval +-else ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_DIO_SHARED=no ++ ++ ++ case ext/dio in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- PHP_LIBXML_DIR=no + + +-fi +- +- +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 +- ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in dio.c dio_common.c dio_posix.c dio_stream_wrappers.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:34059: checking whether to enable DOM support" >&5 ++# Check whether --enable-dom or --disable-dom was given. ++if test "${enable_dom+set}" = set; then ++ enableval="$enable_dom" ++ PHP_DOM=$enableval ++else ++ ++ PHP_DOM=yes ++ test "$PHP_ENABLE_ALL" && PHP_DOM=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_DOM in ++shared,*) ++ PHP_DOM=`echo "$PHP_DOM"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_DOM=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test -z "$PHP_LIBXML_DIR"; then ++ ++php_with_libxml_dir=no ++ ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:34104: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else ++ ++ PHP_LIBXML_DIR=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ + + + fi +@@ -32746,7 +34128,7 @@ if test "$PHP_DOM" != "no"; then + + + echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:32750: checking for xml2-config path" >&5 ++echo "configure:34132: checking for xml2-config path" >&5 + if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -40914,7 +42278,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:32908: checking whether libxml build works" >&5 ++echo "configure:34290: checking whether libxml build works" >&5 + if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -32920,7 +34302,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -41054,7 +42418,7 @@ fi +-if { (eval echo configure:32935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:34317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + + LIBS=$old_LIBS +@@ -33354,7 +34736,7 @@ fi + php_with_enchant=no + + echo $ac_n "checking for ENCHANT support""... $ac_c" 1>&6 +-echo "configure:33358: checking for ENCHANT support" >&5 ++echo "configure:34740: checking for ENCHANT support" >&5 + # Check whether --with-enchant or --without-enchant was given. + if test "${with_enchant+set}" = set; then + withval="$with_enchant" +@@ -33939,7 +35321,7 @@ EOF done - echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6 --echo "configure:41058: checking for gdImageGif in -lgd" >&5 -+echo "configure:42422: checking for gdImageGif in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'` + echo $ac_n "checking for enchant_broker_set_param in -lenchant""... $ac_c" 1>&6 +-echo "configure:33943: checking for enchant_broker_set_param in -lenchant" >&5 ++echo "configure:35325: checking for enchant_broker_set_param in -lenchant" >&5 + ac_lib_var=`echo enchant'_'enchant_broker_set_param | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41062,7 +42426,7 @@ else +@@ -33947,7 +35329,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lenchant $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:33962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:35344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -41202,7 +42566,7 @@ fi - done +@@ -34005,7 +35387,7 @@ fi + php_enable_exif=no - echo $ac_n "checking for gdImageWBMP in -lgd""... $ac_c" 1>&6 --echo "configure:41206: checking for gdImageWBMP in -lgd" >&5 -+echo "configure:42570: checking for gdImageWBMP in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageWBMP | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "checking whether to enable EXIF (metadata from images) support""... $ac_c" 1>&6 +-echo "configure:34009: checking whether to enable EXIF (metadata from images) support" >&5 ++echo "configure:35391: checking whether to enable EXIF (metadata from images) support" >&5 + # Check whether --enable-exif or --disable-exif was given. + if test "${enable_exif+set}" = set; then + enableval="$enable_exif" +@@ -34349,7 +35731,7 @@ fi + php_enable_fileinfo=yes + + echo $ac_n "checking for fileinfo support""... $ac_c" 1>&6 +-echo "configure:34353: checking for fileinfo support" >&5 ++echo "configure:35735: checking for fileinfo support" >&5 + # Check whether --enable-fileinfo or --disable-fileinfo was given. + if test "${enable_fileinfo+set}" = set; then + enableval="$enable_fileinfo" +@@ -34699,12 +36081,12 @@ EOF + for ac_func in utimes strndup + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:34703: checking for $ac_func" >&5 ++echo "configure:36085: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41210,7 +42574,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:34731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:36113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_$ac_func=yes" else -@@ -41350,7 +42714,7 @@ fi - done +@@ -34765,7 +36147,7 @@ fi + php_enable_filter=yes - echo $ac_n "checking for gdImageCreateFromJpeg in -lgd""... $ac_c" 1>&6 --echo "configure:41354: checking for gdImageCreateFromJpeg in -lgd" >&5 -+echo "configure:42718: checking for gdImageCreateFromJpeg in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateFromJpeg | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "checking whether to enable input filter support""... $ac_c" 1>&6 +-echo "configure:34769: checking whether to enable input filter support" >&5 ++echo "configure:36151: checking whether to enable input filter support" >&5 + # Check whether --enable-filter or --disable-filter was given. + if test "${enable_filter+set}" = set; then + enableval="$enable_filter" +@@ -34809,7 +36191,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_with_pcre_dir=no + + echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6 +-echo "configure:34813: checking pcre install prefix" >&5 ++echo "configure:36195: checking pcre install prefix" >&5 + # Check whether --with-pcre-dir or --without-pcre-dir was given. + if test "${with_pcre_dir+set}" = set; then + withval="$with_pcre_dir" +@@ -34836,7 +36218,7 @@ if test "$PHP_FILTER" != "no"; then + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$INCLUDES + cat > conftest.$ac_ext < +@@ -34855,7 +36237,7 @@ else + rm -rf conftest* + + cat > conftest.$ac_ext < +@@ -35225,7 +36607,7 @@ fi + php_enable_ftp=no + + echo $ac_n "checking whether to enable FTP support""... $ac_c" 1>&6 +-echo "configure:35229: checking whether to enable FTP support" >&5 ++echo "configure:36611: checking whether to enable FTP support" >&5 + # Check whether --enable-ftp or --disable-ftp was given. + if test "${enable_ftp+set}" = set; then + enableval="$enable_ftp" +@@ -35269,7 +36651,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_with_openssl_dir=no + + echo $ac_n "checking OpenSSL dir for FTP""... $ac_c" 1>&6 +-echo "configure:35273: checking OpenSSL dir for FTP" >&5 ++echo "configure:36655: checking OpenSSL dir for FTP" >&5 + # Check whether --with-openssl-dir or --without-openssl-dir was given. + if test "${with_openssl_dir+set}" = set; then + withval="$with_openssl_dir" +@@ -35607,7 +36989,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:35611: checking for $ac_word" >&5 ++echo "configure:36993: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -35812,9 +37194,9 @@ fi + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS=-I$OPENSSL_INCDIR + echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 +-echo "configure:35816: checking for OpenSSL version" >&5 ++echo "configure:37198: checking for OpenSSL version" >&5 + cat > conftest.$ac_ext < +@@ -35969,7 +37351,7 @@ rm -f conftest* + done + + echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 +-echo "configure:35973: checking for CRYPTO_free in -lcrypto" >&5 ++echo "configure:37355: checking for CRYPTO_free in -lcrypto" >&5 + ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41358,7 +42722,7 @@ else +@@ -35977,7 +37359,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:35992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:37374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -41498,7 +42862,7 @@ fi +@@ -36145,7 +37527,7 @@ fi done - echo $ac_n "checking for gdImageCreateFromXpm in -lgd""... $ac_c" 1>&6 --echo "configure:41502: checking for gdImageCreateFromXpm in -lgd" >&5 -+echo "configure:42866: checking for gdImageCreateFromXpm in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateFromXpm | sed 'y%./+-%__p_%'` + echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 +-echo "configure:36149: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ++echo "configure:37531: checking for SSL_CTX_set_ssl_version in -lssl" >&5 + ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41506,7 +42870,7 @@ else +@@ -36153,7 +37535,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:42885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:36168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:37550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -41646,7 +43010,7 @@ fi +@@ -36283,7 +37665,7 @@ fi + php_with_gd=no + + echo $ac_n "checking for GD support""... $ac_c" 1>&6 +-echo "configure:36287: checking for GD support" >&5 ++echo "configure:37669: checking for GD support" >&5 + # Check whether --with-gd or --without-gd was given. + if test "${with_gd+set}" = set; then + withval="$with_gd" +@@ -36328,7 +37710,7 @@ if test -z "$PHP_JPEG_DIR"; then + php_with_jpeg_dir=no + + echo $ac_n "checking for the location of libjpeg""... $ac_c" 1>&6 +-echo "configure:36332: checking for the location of libjpeg" >&5 ++echo "configure:37714: checking for the location of libjpeg" >&5 + # Check whether --with-jpeg-dir or --without-jpeg-dir was given. + if test "${with_jpeg_dir+set}" = set; then + withval="$with_jpeg_dir" +@@ -36353,7 +37735,7 @@ if test -z "$PHP_PNG_DIR"; then + php_with_png_dir=no + + echo $ac_n "checking for the location of libpng""... $ac_c" 1>&6 +-echo "configure:36357: checking for the location of libpng" >&5 ++echo "configure:37739: checking for the location of libpng" >&5 + # Check whether --with-png-dir or --without-png-dir was given. + if test "${with_png_dir+set}" = set; then + withval="$with_png_dir" +@@ -36378,7 +37760,7 @@ if test -z "$PHP_ZLIB_DIR"; then + php_with_zlib_dir=no + + echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 +-echo "configure:36382: checking for the location of libz" >&5 ++echo "configure:37764: checking for the location of libz" >&5 + # Check whether --with-zlib-dir or --without-zlib-dir was given. + if test "${with_zlib_dir+set}" = set; then + withval="$with_zlib_dir" +@@ -36402,7 +37784,7 @@ fi + php_with_xpm_dir=no + + echo $ac_n "checking for the location of libXpm""... $ac_c" 1>&6 +-echo "configure:36406: checking for the location of libXpm" >&5 ++echo "configure:37788: checking for the location of libXpm" >&5 + # Check whether --with-xpm-dir or --without-xpm-dir was given. + if test "${with_xpm_dir+set}" = set; then + withval="$with_xpm_dir" +@@ -36425,7 +37807,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_with_freetype_dir=no + + echo $ac_n "checking for FreeType 2""... $ac_c" 1>&6 +-echo "configure:36429: checking for FreeType 2" >&5 ++echo "configure:37811: checking for FreeType 2" >&5 + # Check whether --with-freetype-dir or --without-freetype-dir was given. + if test "${with_freetype_dir+set}" = set; then + withval="$with_freetype_dir" +@@ -36448,7 +37830,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_with_t1lib=no + + echo $ac_n "checking for T1lib support""... $ac_c" 1>&6 +-echo "configure:36452: checking for T1lib support" >&5 ++echo "configure:37834: checking for T1lib support" >&5 + # Check whether --with-t1lib or --without-t1lib was given. + if test "${with_t1lib+set}" = set; then + withval="$with_t1lib" +@@ -36471,7 +37853,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_enable_gd_native_ttf=no + + echo $ac_n "checking whether to enable truetype string function in GD""... $ac_c" 1>&6 +-echo "configure:36475: checking whether to enable truetype string function in GD" >&5 ++echo "configure:37857: checking whether to enable truetype string function in GD" >&5 + # Check whether --enable-gd-native-ttf or --disable-gd-native-ttf was given. + if test "${enable_gd_native_ttf+set}" = set; then + enableval="$enable_gd_native_ttf" +@@ -36494,7 +37876,7 @@ echo "$ac_t""$ext_output" 1>&6 + php_enable_gd_jis_conv=no + + echo $ac_n "checking whether to enable JIS-mapped Japanese font support in GD""... $ac_c" 1>&6 +-echo "configure:36498: checking whether to enable JIS-mapped Japanese font support in GD" >&5 ++echo "configure:37880: checking whether to enable JIS-mapped Japanese font support in GD" >&5 + # Check whether --enable-gd-jis-conv or --disable-gd-jis-conv was given. + if test "${enable_gd_jis_conv+set}" = set; then + enableval="$enable_gd_jis_conv" +@@ -36546,12 +37928,12 @@ if test "$PHP_GD" = "yes"; then + for ac_func in fabsf floorf + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:36550: checking for $ac_func" >&5 ++echo "configure:37932: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:37960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -36746,7 +38128,7 @@ EOF done - echo $ac_n "checking for gdImageCreateFromGd2 in -lgd""... $ac_c" 1>&6 --echo "configure:41650: checking for gdImageCreateFromGd2 in -lgd" >&5 -+echo "configure:43014: checking for gdImageCreateFromGd2 in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateFromGd2 | sed 'y%./+-%__p_%'` + echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6 +-echo "configure:36750: checking for jpeg_read_header in -ljpeg" >&5 ++echo "configure:38132: checking for jpeg_read_header in -ljpeg" >&5 + ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41654,7 +43018,7 @@ else +@@ -36754,7 +38136,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:36769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:38151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -41794,7 +43158,7 @@ fi +@@ -37047,7 +38429,7 @@ fi done - echo $ac_n "checking for gdImageCreateTrueColor in -lgd""... $ac_c" 1>&6 --echo "configure:41798: checking for gdImageCreateTrueColor in -lgd" >&5 -+echo "configure:43162: checking for gdImageCreateTrueColor in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreateTrueColor | sed 'y%./+-%__p_%'` + echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6 +-echo "configure:37051: checking for png_write_image in -lpng" >&5 ++echo "configure:38433: checking for png_write_image in -lpng" >&5 + ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41802,7 +43166,7 @@ else +@@ -37055,7 +38437,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lpng $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:37070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:38452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -41942,7 +43306,7 @@ fi +@@ -37446,7 +38828,7 @@ fi done - echo $ac_n "checking for gdImageSetTile in -lgd""... $ac_c" 1>&6 --echo "configure:41946: checking for gdImageSetTile in -lgd" >&5 -+echo "configure:43310: checking for gdImageSetTile in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageSetTile | sed 'y%./+-%__p_%'` + echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6 +-echo "configure:37450: checking for XpmFreeXpmImage in -lXpm" >&5 ++echo "configure:38832: checking for XpmFreeXpmImage in -lXpm" >&5 + ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -41950,7 +43314,7 @@ else +@@ -37454,7 +38836,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lXpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:37469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:38851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42090,7 +43454,7 @@ fi +@@ -37840,7 +39222,7 @@ fi done - echo $ac_n "checking for gdImageEllipse in -lgd""... $ac_c" 1>&6 --echo "configure:42094: checking for gdImageEllipse in -lgd" >&5 -+echo "configure:43458: checking for gdImageEllipse in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageEllipse | sed 'y%./+-%__p_%'` + echo $ac_n "checking for FT_New_Face in -lfreetype""... $ac_c" 1>&6 +-echo "configure:37844: checking for FT_New_Face in -lfreetype" >&5 ++echo "configure:39226: checking for FT_New_Face in -lfreetype" >&5 + ac_lib_var=`echo freetype'_'FT_New_Face | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42098,7 +43462,7 @@ else +@@ -37848,7 +39230,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lfreetype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:37863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:39245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42238,7 +43602,7 @@ fi +@@ -38176,7 +39558,7 @@ fi done - echo $ac_n "checking for gdImageSetBrush in -lgd""... $ac_c" 1>&6 --echo "configure:42242: checking for gdImageSetBrush in -lgd" >&5 -+echo "configure:43606: checking for gdImageSetBrush in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageSetBrush | sed 'y%./+-%__p_%'` + echo $ac_n "checking for T1_StrError in -lt1""... $ac_c" 1>&6 +-echo "configure:38180: checking for T1_StrError in -lt1" >&5 ++echo "configure:39562: checking for T1_StrError in -lt1" >&5 + ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42246,7 +43610,7 @@ else +@@ -38184,7 +39566,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lt1 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:38199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:39581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42386,7 +43750,7 @@ fi +@@ -38638,7 +40020,7 @@ EOF done - echo $ac_n "checking for gdImageStringTTF in -lgd""... $ac_c" 1>&6 --echo "configure:42390: checking for gdImageStringTTF in -lgd" >&5 -+echo "configure:43754: checking for gdImageStringTTF in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageStringTTF | sed 'y%./+-%__p_%'` + echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6 +-echo "configure:38642: checking for jpeg_read_header in -ljpeg" >&5 ++echo "configure:40024: checking for jpeg_read_header in -ljpeg" >&5 + ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42394,7 +43758,7 @@ else +@@ -38646,7 +40028,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:38661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:40043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42534,7 +43898,7 @@ fi +@@ -38939,7 +40321,7 @@ fi done - echo $ac_n "checking for gdImageStringFT in -lgd""... $ac_c" 1>&6 --echo "configure:42538: checking for gdImageStringFT in -lgd" >&5 -+echo "configure:43902: checking for gdImageStringFT in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageStringFT | sed 'y%./+-%__p_%'` + echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6 +-echo "configure:38943: checking for png_write_image in -lpng" >&5 ++echo "configure:40325: checking for png_write_image in -lpng" >&5 + ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42542,7 +43906,7 @@ else +@@ -38947,7 +40329,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lpng $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:43921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:38962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:40344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42682,7 +44046,7 @@ fi +@@ -39338,7 +40720,7 @@ fi done - echo $ac_n "checking for gdImageStringFTEx in -lgd""... $ac_c" 1>&6 --echo "configure:42686: checking for gdImageStringFTEx in -lgd" >&5 -+echo "configure:44050: checking for gdImageStringFTEx in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageStringFTEx | sed 'y%./+-%__p_%'` + echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6 +-echo "configure:39342: checking for XpmFreeXpmImage in -lXpm" >&5 ++echo "configure:40724: checking for XpmFreeXpmImage in -lXpm" >&5 + ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42690,7 +44054,7 @@ else +@@ -39346,7 +40728,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lXpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:39361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:40743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42830,7 +44194,7 @@ fi +@@ -39732,7 +41114,7 @@ fi done - echo $ac_n "checking for gdImageColorClosestHWB in -lgd""... $ac_c" 1>&6 --echo "configure:42834: checking for gdImageColorClosestHWB in -lgd" >&5 -+echo "configure:44198: checking for gdImageColorClosestHWB in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageColorClosestHWB | sed 'y%./+-%__p_%'` + echo $ac_n "checking for FT_New_Face in -lfreetype""... $ac_c" 1>&6 +-echo "configure:39736: checking for FT_New_Face in -lfreetype" >&5 ++echo "configure:41118: checking for FT_New_Face in -lfreetype" >&5 + ac_lib_var=`echo freetype'_'FT_New_Face | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42838,7 +44202,7 @@ else +@@ -39740,7 +41122,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lfreetype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:39755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:41137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -42978,7 +44342,7 @@ fi +@@ -40068,7 +41450,7 @@ fi done - echo $ac_n "checking for gdImageColorResolve in -lgd""... $ac_c" 1>&6 --echo "configure:42982: checking for gdImageColorResolve in -lgd" >&5 -+echo "configure:44346: checking for gdImageColorResolve in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageColorResolve | sed 'y%./+-%__p_%'` + echo $ac_n "checking for T1_StrError in -lt1""... $ac_c" 1>&6 +-echo "configure:40072: checking for T1_StrError in -lt1" >&5 ++echo "configure:41454: checking for T1_StrError in -lt1" >&5 + ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -42986,7 +44350,7 @@ else +@@ -40076,7 +41458,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lgd $LIBS" + LIBS="-lt1 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:40091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:41473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43126,7 +44490,7 @@ fi +@@ -40462,7 +41844,7 @@ EOF done - echo $ac_n "checking for gdImageGifCtx in -lgd""... $ac_c" 1>&6 --echo "configure:43130: checking for gdImageGifCtx in -lgd" >&5 -+echo "configure:44494: checking for gdImageGifCtx in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageGifCtx | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageString16 in -lgd""... $ac_c" 1>&6 +-echo "configure:40466: checking for gdImageString16 in -lgd" >&5 ++echo "configure:41848: checking for gdImageString16 in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageString16 | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43134,7 +44498,7 @@ else +@@ -40470,7 +41852,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:40485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:41867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43274,7 +44638,7 @@ fi +@@ -40610,7 +41992,7 @@ fi done - echo $ac_n "checking for gdCacheCreate in -lgd""... $ac_c" 1>&6 --echo "configure:43278: checking for gdCacheCreate in -lgd" >&5 -+echo "configure:44642: checking for gdCacheCreate in -lgd" >&5 - ac_lib_var=`echo gd'_'gdCacheCreate | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImagePaletteCopy in -lgd""... $ac_c" 1>&6 +-echo "configure:40614: checking for gdImagePaletteCopy in -lgd" >&5 ++echo "configure:41996: checking for gdImagePaletteCopy in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImagePaletteCopy | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43282,7 +44646,7 @@ else +@@ -40618,7 +42000,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:40633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43422,7 +44786,7 @@ fi +@@ -40758,7 +42140,7 @@ fi done - echo $ac_n "checking for gdFontCacheShutdown in -lgd""... $ac_c" 1>&6 --echo "configure:43426: checking for gdFontCacheShutdown in -lgd" >&5 -+echo "configure:44790: checking for gdFontCacheShutdown in -lgd" >&5 - ac_lib_var=`echo gd'_'gdFontCacheShutdown | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6 +-echo "configure:40762: checking for gdImageCreateFromPng in -lgd" >&5 ++echo "configure:42144: checking for gdImageCreateFromPng in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43430,7 +44794,7 @@ else +@@ -40766,7 +42148,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:40781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43570,7 +44934,7 @@ fi +@@ -40906,7 +42288,7 @@ fi done - echo $ac_n "checking for gdFreeFontCache in -lgd""... $ac_c" 1>&6 --echo "configure:43574: checking for gdFreeFontCache in -lgd" >&5 -+echo "configure:44938: checking for gdFreeFontCache in -lgd" >&5 - ac_lib_var=`echo gd'_'gdFreeFontCache | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageCreateFromGif in -lgd""... $ac_c" 1>&6 +-echo "configure:40910: checking for gdImageCreateFromGif in -lgd" >&5 ++echo "configure:42292: checking for gdImageCreateFromGif in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateFromGif | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43578,7 +44942,7 @@ else +@@ -40914,7 +42296,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:44957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:40929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43718,7 +45082,7 @@ fi +@@ -41054,7 +42436,7 @@ fi done - echo $ac_n "checking for gdFontCacheMutexSetup in -lgd""... $ac_c" 1>&6 --echo "configure:43722: checking for gdFontCacheMutexSetup in -lgd" >&5 -+echo "configure:45086: checking for gdFontCacheMutexSetup in -lgd" >&5 - ac_lib_var=`echo gd'_'gdFontCacheMutexSetup | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6 +-echo "configure:41058: checking for gdImageGif in -lgd" >&5 ++echo "configure:42440: checking for gdImageGif in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43726,7 +45090,7 @@ else +@@ -41062,7 +42444,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:45105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43866,7 +45230,7 @@ fi +@@ -41202,7 +42584,7 @@ fi done - echo $ac_n "checking for gdNewDynamicCtxEx in -lgd""... $ac_c" 1>&6 --echo "configure:43870: checking for gdNewDynamicCtxEx in -lgd" >&5 -+echo "configure:45234: checking for gdNewDynamicCtxEx in -lgd" >&5 - ac_lib_var=`echo gd'_'gdNewDynamicCtxEx | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageWBMP in -lgd""... $ac_c" 1>&6 +-echo "configure:41206: checking for gdImageWBMP in -lgd" >&5 ++echo "configure:42588: checking for gdImageWBMP in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageWBMP | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -43874,7 +45238,7 @@ else +@@ -41210,7 +42592,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:45253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -43940,7 +45304,7 @@ fi - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$GD_INCLUDE - cat > conftest.$ac_ext < -@@ -43954,7 +45318,7 @@ ctx->gd_free = 1; - - ; return 0; } - EOF --if { (eval echo configure:43958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:45322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - - cat >> confdefs.h <<\EOF -@@ -44285,7 +45649,7 @@ EOF - - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:45664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - LIBS=$old_LIBS -@@ -44447,7 +45811,7 @@ fi +@@ -41350,7 +42732,7 @@ fi done - echo $ac_n "checking for gdImageCreate in -lgd""... $ac_c" 1>&6 --echo "configure:44451: checking for gdImageCreate in -lgd" >&5 -+echo "configure:45815: checking for gdImageCreate in -lgd" >&5 - ac_lib_var=`echo gd'_'gdImageCreate | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageCreateFromJpeg in -lgd""... $ac_c" 1>&6 +-echo "configure:41354: checking for gdImageCreateFromJpeg in -lgd" >&5 ++echo "configure:42736: checking for gdImageCreateFromJpeg in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateFromJpeg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -44455,7 +45819,7 @@ else +@@ -41358,7 +42740,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:45834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -44531,7 +45895,7 @@ fi - php_with_gettext=no +@@ -41498,7 +42880,7 @@ fi + done - echo $ac_n "checking for GNU gettext support""... $ac_c" 1>&6 --echo "configure:44535: checking for GNU gettext support" >&5 -+echo "configure:45899: checking for GNU gettext support" >&5 - # Check whether --with-gettext or --without-gettext was given. - if test "${with_gettext+set}" = set; then - withval="$with_gettext" -@@ -44586,7 +45950,7 @@ if test "$PHP_GETTEXT" != "no"; then - O_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 --echo "configure:44590: checking for bindtextdomain in -lintl" >&5 -+echo "configure:45954: checking for bindtextdomain in -lintl" >&5 - ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageCreateFromXpm in -lgd""... $ac_c" 1>&6 +-echo "configure:41502: checking for gdImageCreateFromXpm in -lgd" >&5 ++echo "configure:42884: checking for gdImageCreateFromXpm in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateFromXpm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -44594,7 +45958,7 @@ else +@@ -41506,7 +42888,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lintl $LIBS" + LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:45973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:42903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -44627,7 +45991,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for bindtextdomain in -lc""... $ac_c" 1>&6 --echo "configure:44631: checking for bindtextdomain in -lc" >&5 -+echo "configure:45995: checking for bindtextdomain in -lc" >&5 - ac_lib_var=`echo c'_'bindtextdomain | sed 'y%./+-%__p_%'` +@@ -41646,7 +43028,7 @@ fi + done + + echo $ac_n "checking for gdImageCreateFromGd2 in -lgd""... $ac_c" 1>&6 +-echo "configure:41650: checking for gdImageCreateFromGd2 in -lgd" >&5 ++echo "configure:43032: checking for gdImageCreateFromGd2 in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateFromGd2 | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -44635,7 +45999,7 @@ else +@@ -41654,7 +43036,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-lc $LIBS" + LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45110,7 +46474,7 @@ EOF - +@@ -41794,7 +43176,7 @@ fi + done - echo $ac_n "checking for ngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 --echo "configure:45114: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 -+echo "configure:46478: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 - ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'ngettext | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageCreateTrueColor in -lgd""... $ac_c" 1>&6 +-echo "configure:41798: checking for gdImageCreateTrueColor in -lgd" >&5 ++echo "configure:43180: checking for gdImageCreateTrueColor in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreateTrueColor | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45118,7 +46482,7 @@ else +@@ -41802,7 +43184,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45153,7 +46517,7 @@ else - fi +@@ -41942,7 +43324,7 @@ fi + done - echo $ac_n "checking for dngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 --echo "configure:45157: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 -+echo "configure:46521: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 - ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dngettext | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageSetTile in -lgd""... $ac_c" 1>&6 +-echo "configure:41946: checking for gdImageSetTile in -lgd" >&5 ++echo "configure:43328: checking for gdImageSetTile in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageSetTile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45161,7 +46525,7 @@ else +@@ -41950,7 +43332,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:41965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45196,7 +46560,7 @@ else - fi +@@ -42090,7 +43472,7 @@ fi + done - echo $ac_n "checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 --echo "configure:45200: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 -+echo "configure:46564: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 - ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dcngettext | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageEllipse in -lgd""... $ac_c" 1>&6 +-echo "configure:42094: checking for gdImageEllipse in -lgd" >&5 ++echo "configure:43476: checking for gdImageEllipse in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageEllipse | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45204,7 +46568,7 @@ else +@@ -42098,7 +43480,7 @@ else ac_save_LIBS="$LIBS" - LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + LIBS="-lgd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:42113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45239,7 +46603,7 @@ else - fi +@@ -42238,7 +43620,7 @@ fi + done - echo $ac_n "checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 --echo "configure:45243: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5 -+echo "configure:46607: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5 - ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'bind_textdomain_codeset | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gdImageSetBrush in -lgd""... $ac_c" 1>&6 +-echo "configure:42242: checking for gdImageSetBrush in -lgd" >&5 ++echo "configure:43624: checking for gdImageSetBrush in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageSetBrush | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42246,7 +43628,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -42386,7 +43768,7 @@ fi + done + + echo $ac_n "checking for gdImageStringTTF in -lgd""... $ac_c" 1>&6 +-echo "configure:42390: checking for gdImageStringTTF in -lgd" >&5 ++echo "configure:43772: checking for gdImageStringTTF in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageStringTTF | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42394,7 +43776,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -42534,7 +43916,7 @@ fi + done + + echo $ac_n "checking for gdImageStringFT in -lgd""... $ac_c" 1>&6 +-echo "configure:42538: checking for gdImageStringFT in -lgd" >&5 ++echo "configure:43920: checking for gdImageStringFT in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageStringFT | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42542,7 +43924,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:43939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -42682,7 +44064,7 @@ fi + done + + echo $ac_n "checking for gdImageStringFTEx in -lgd""... $ac_c" 1>&6 +-echo "configure:42686: checking for gdImageStringFTEx in -lgd" >&5 ++echo "configure:44068: checking for gdImageStringFTEx in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageStringFTEx | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42690,7 +44072,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -42830,7 +44212,7 @@ fi + done + + echo $ac_n "checking for gdImageColorClosestHWB in -lgd""... $ac_c" 1>&6 +-echo "configure:42834: checking for gdImageColorClosestHWB in -lgd" >&5 ++echo "configure:44216: checking for gdImageColorClosestHWB in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageColorClosestHWB | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42838,7 +44220,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -42978,7 +44360,7 @@ fi + done + + echo $ac_n "checking for gdImageColorResolve in -lgd""... $ac_c" 1>&6 +-echo "configure:42982: checking for gdImageColorResolve in -lgd" >&5 ++echo "configure:44364: checking for gdImageColorResolve in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageColorResolve | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -42986,7 +44368,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43126,7 +44508,7 @@ fi + done + + echo $ac_n "checking for gdImageGifCtx in -lgd""... $ac_c" 1>&6 +-echo "configure:43130: checking for gdImageGifCtx in -lgd" >&5 ++echo "configure:44512: checking for gdImageGifCtx in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageGifCtx | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43134,7 +44516,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43274,7 +44656,7 @@ fi + done + + echo $ac_n "checking for gdCacheCreate in -lgd""... $ac_c" 1>&6 +-echo "configure:43278: checking for gdCacheCreate in -lgd" >&5 ++echo "configure:44660: checking for gdCacheCreate in -lgd" >&5 + ac_lib_var=`echo gd'_'gdCacheCreate | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43282,7 +44664,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43422,7 +44804,7 @@ fi + done + + echo $ac_n "checking for gdFontCacheShutdown in -lgd""... $ac_c" 1>&6 +-echo "configure:43426: checking for gdFontCacheShutdown in -lgd" >&5 ++echo "configure:44808: checking for gdFontCacheShutdown in -lgd" >&5 + ac_lib_var=`echo gd'_'gdFontCacheShutdown | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43430,7 +44812,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43570,7 +44952,7 @@ fi + done + + echo $ac_n "checking for gdFreeFontCache in -lgd""... $ac_c" 1>&6 +-echo "configure:43574: checking for gdFreeFontCache in -lgd" >&5 ++echo "configure:44956: checking for gdFreeFontCache in -lgd" >&5 + ac_lib_var=`echo gd'_'gdFreeFontCache | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43578,7 +44960,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:44975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43718,7 +45100,7 @@ fi + done + + echo $ac_n "checking for gdFontCacheMutexSetup in -lgd""... $ac_c" 1>&6 +-echo "configure:43722: checking for gdFontCacheMutexSetup in -lgd" >&5 ++echo "configure:45104: checking for gdFontCacheMutexSetup in -lgd" >&5 + ac_lib_var=`echo gd'_'gdFontCacheMutexSetup | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43726,7 +45108,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:45123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43866,7 +45248,7 @@ fi + done + + echo $ac_n "checking for gdNewDynamicCtxEx in -lgd""... $ac_c" 1>&6 +-echo "configure:43870: checking for gdNewDynamicCtxEx in -lgd" >&5 ++echo "configure:45252: checking for gdNewDynamicCtxEx in -lgd" >&5 + ac_lib_var=`echo gd'_'gdNewDynamicCtxEx | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -43874,7 +45256,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:45271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -43940,7 +45322,7 @@ fi + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS=-I$GD_INCLUDE + cat > conftest.$ac_ext < +@@ -43954,7 +45336,7 @@ ctx->gd_free = 1; + + ; return 0; } + EOF +-if { (eval echo configure:43958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:45340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + cat >> confdefs.h <<\EOF +@@ -44285,7 +45667,7 @@ EOF + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:45682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + + LIBS=$old_LIBS +@@ -44447,7 +45829,7 @@ fi + done + + echo $ac_n "checking for gdImageCreate in -lgd""... $ac_c" 1>&6 +-echo "configure:44451: checking for gdImageCreate in -lgd" >&5 ++echo "configure:45833: checking for gdImageCreate in -lgd" >&5 + ac_lib_var=`echo gd'_'gdImageCreate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45247,7 +46611,7 @@ else +@@ -44455,7 +45837,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lgd $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:45852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -44531,7 +45913,7 @@ fi + php_with_gettext=no + + echo $ac_n "checking for GNU gettext support""... $ac_c" 1>&6 +-echo "configure:44535: checking for GNU gettext support" >&5 ++echo "configure:45917: checking for GNU gettext support" >&5 + # Check whether --with-gettext or --without-gettext was given. + if test "${with_gettext+set}" = set; then + withval="$with_gettext" +@@ -44586,7 +45968,7 @@ if test "$PHP_GETTEXT" != "no"; then + O_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" + echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 +-echo "configure:44590: checking for bindtextdomain in -lintl" >&5 ++echo "configure:45972: checking for bindtextdomain in -lintl" >&5 + ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -44594,7 +45976,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lintl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:45991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -44627,7 +46009,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + else + echo "$ac_t""no" 1>&6 + echo $ac_n "checking for bindtextdomain in -lc""... $ac_c" 1>&6 +-echo "configure:44631: checking for bindtextdomain in -lc" >&5 ++echo "configure:46013: checking for bindtextdomain in -lc" >&5 + ac_lib_var=`echo c'_'bindtextdomain | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -44635,7 +46017,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lc $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -45110,7 +46492,7 @@ EOF + + + echo $ac_n "checking for ngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 +-echo "configure:45114: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 ++echo "configure:46496: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 + ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'ngettext | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -45118,7 +46500,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -45153,7 +46535,7 @@ else + fi + + echo $ac_n "checking for dngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 +-echo "configure:45157: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 ++echo "configure:46539: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 + ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dngettext | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -45161,7 +46543,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -45196,7 +46578,7 @@ else + fi + + echo $ac_n "checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 +-echo "configure:45200: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 ++echo "configure:46582: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5 + ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dcngettext | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -45204,7 +46586,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -45239,7 +46621,7 @@ else + fi + + echo $ac_n "checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6 +-echo "configure:45243: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5 ++echo "configure:46625: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5 + ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'bind_textdomain_codeset | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -45247,7 +46629,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45289,7 +46653,7 @@ fi +@@ -45289,7 +46671,7 @@ fi php_with_gmp=no echo $ac_n "checking for GNU MP support""... $ac_c" 1>&6 -echo "configure:45293: checking for GNU MP support" >&5 -+echo "configure:46657: checking for GNU MP support" >&5 ++echo "configure:46675: checking for GNU MP support" >&5 # Check whether --with-gmp or --without-gmp was given. if test "${with_gmp+set}" = set; then withval="$with_gmp" -@@ -45437,7 +46801,7 @@ if test "$PHP_GMP" != "no"; then +@@ -45437,7 +46819,7 @@ if test "$PHP_GMP" != "no"; then done echo $ac_n "checking for __gmp_randinit_lc_2exp_size in -lgmp""... $ac_c" 1>&6 -echo "configure:45441: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5 -+echo "configure:46805: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5 ++echo "configure:46823: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5 ac_lib_var=`echo gmp'_'__gmp_randinit_lc_2exp_size | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45445,7 +46809,7 @@ else +@@ -45445,7 +46827,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -45581,7 +46945,7 @@ else +@@ -45581,7 +46963,7 @@ else done echo $ac_n "checking for gmp_randinit_lc_2exp_size in -lgmp""... $ac_c" 1>&6 -echo "configure:45585: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5 -+echo "configure:46949: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5 ++echo "configure:46967: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5 ac_lib_var=`echo gmp'_'gmp_randinit_lc_2exp_size | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -45589,7 +46953,7 @@ else +@@ -45589,7 +46971,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:46968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:46986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -46072,7 +47436,7 @@ fi +@@ -46072,7 +47454,7 @@ fi php_with_mhash=no echo $ac_n "checking for mhash support""... $ac_c" 1>&6 -echo "configure:46076: checking for mhash support" >&5 -+echo "configure:47440: checking for mhash support" >&5 ++echo "configure:47458: checking for mhash support" >&5 # Check whether --with-mhash or --without-mhash was given. if test "${with_mhash+set}" = set; then withval="$with_mhash" -@@ -46116,7 +47480,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -46116,7 +47498,7 @@ echo "$ac_t""$ext_output" 1>&6 php_enable_hash=yes echo $ac_n "checking whether to enable hash support""... $ac_c" 1>&6 -echo "configure:46120: checking whether to enable hash support" >&5 -+echo "configure:47484: checking whether to enable hash support" >&5 ++echo "configure:47502: checking whether to enable hash support" >&5 # Check whether --enable-hash or --disable-hash was given. if test "${enable_hash+set}" = set; then enableval="$enable_hash" -@@ -46174,7 +47538,7 @@ EOF +@@ -46174,7 +47556,7 @@ EOF echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:46178: checking whether byte ordering is bigendian" >&5 -+echo "configure:47542: checking whether byte ordering is bigendian" >&5 ++echo "configure:47560: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian_php'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -46184,7 +47548,7 @@ else +@@ -46184,7 +47566,7 @@ else ac_cv_c_bigendian_php=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:47568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:47586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian_php=yes else -@@ -46225,7 +47589,7 @@ EOF +@@ -46225,7 +47607,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:46229: checking size of short" >&5 -+echo "configure:47593: checking size of short" >&5 ++echo "configure:47611: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -46233,18 +47597,19 @@ else +@@ -46233,18 +47615,19 @@ else ac_cv_sizeof_short=2 else cat > conftest.$ac_ext < -int main() @@ -9748,25 +11679,25 @@ } EOF -if { (eval echo configure:46248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:47613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:47631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else -@@ -46264,7 +47629,7 @@ EOF +@@ -46264,7 +47647,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:46268: checking size of int" >&5 -+echo "configure:47633: checking size of int" >&5 ++echo "configure:47651: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -46272,18 +47637,19 @@ else +@@ -46272,18 +47655,19 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < -int main() @@ -9782,25 +11713,25 @@ } EOF -if { (eval echo configure:46287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:47653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:47671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else -@@ -46303,7 +47669,7 @@ EOF +@@ -46303,7 +47687,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:46307: checking size of long" >&5 -+echo "configure:47673: checking size of long" >&5 ++echo "configure:47691: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -46311,18 +47677,19 @@ else +@@ -46311,18 +47695,19 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < -int main() @@ -9816,25 +11747,25 @@ } EOF -if { (eval echo configure:46326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:47693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:47711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else -@@ -46342,7 +47709,7 @@ EOF +@@ -46342,7 +47727,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:46346: checking size of long long" >&5 -+echo "configure:47713: checking size of long long" >&5 ++echo "configure:47731: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -46350,18 +47717,19 @@ else +@@ -46350,18 +47735,19 @@ else ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext < -int main() @@ -9850,130 +11781,136 @@ } EOF -if { (eval echo configure:46365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:47733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:47751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else -@@ -46710,7 +48078,7 @@ fi +@@ -46707,10 +48093,13 @@ fi + + + ++ ++ ++ php_with_iconv=yes echo $ac_n "checking for iconv support""... $ac_c" 1>&6 -echo "configure:46714: checking for iconv support" >&5 -+echo "configure:48082: checking for iconv support" >&5 ++echo "configure:48103: checking for iconv support" >&5 # Check whether --with-iconv or --without-iconv was given. if test "${with_iconv+set}" = set; then withval="$with_iconv" -@@ -46771,12 +48139,12 @@ if test "$PHP_ICONV" != "no"; then +@@ -46771,12 +48160,12 @@ if test "$PHP_ICONV" != "no"; then if test "$PHP_ICONV" = "yes"; then echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:46775: checking for iconv" >&5 -+echo "configure:48143: checking for iconv" >&5 ++echo "configure:48164: checking for iconv" >&5 if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_iconv=yes" else -@@ -46820,12 +48188,12 @@ else +@@ -46820,12 +48209,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for libiconv""... $ac_c" 1>&6 -echo "configure:46824: checking for libiconv" >&5 -+echo "configure:48192: checking for libiconv" >&5 ++echo "configure:48213: checking for libiconv" >&5 if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_libiconv=yes" else -@@ -47004,7 +48372,7 @@ EOF +@@ -47004,7 +48393,7 @@ EOF done echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6 -echo "configure:47008: checking for libiconv in -l$iconv_lib_name" >&5 -+echo "configure:48376: checking for libiconv in -l$iconv_lib_name" >&5 ++echo "configure:48397: checking for libiconv in -l$iconv_lib_name" >&5 ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -47012,7 +48380,7 @@ else +@@ -47012,7 +48401,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$iconv_lib_name $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -47164,7 +48532,7 @@ else +@@ -47164,7 +48553,7 @@ else done echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6 -echo "configure:47168: checking for iconv in -l$iconv_lib_name" >&5 -+echo "configure:48536: checking for iconv in -l$iconv_lib_name" >&5 ++echo "configure:48557: checking for iconv in -l$iconv_lib_name" >&5 ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -47172,7 +48540,7 @@ else +@@ -47172,7 +48561,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$iconv_lib_name $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -47394,16 +48762,16 @@ else +@@ -47394,16 +48783,16 @@ else fi echo $ac_n "checking if iconv is glibc's""... $ac_c" 1>&6 -echo "configure:47398: checking if iconv is glibc's" >&5 -+echo "configure:48766: checking if iconv is glibc's" >&5 ++echo "configure:48787: checking if iconv is glibc's" >&5 cat > conftest.$ac_ext < int main() { @@ -9981,46 +11918,46 @@ ; return 0; } EOF -if { (eval echo configure:47407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -@@ -47421,7 +48789,7 @@ rm -f conftest* +@@ -47421,7 +48810,7 @@ rm -f conftest* if test -z "$iconv_impl_name"; then echo $ac_n "checking if using GNU libiconv""... $ac_c" 1>&6 -echo "configure:47425: checking if using GNU libiconv" >&5 -+echo "configure:48793: checking if using GNU libiconv" >&5 ++echo "configure:48814: checking if using GNU libiconv" >&5 php_iconv_old_ld="$LDFLAGS" LDFLAGS="-liconv $LDFLAGS" if test "$cross_compiling" = yes; then -@@ -47431,7 +48799,7 @@ echo "configure:47425: checking if using +@@ -47431,7 +48820,7 @@ echo "configure:47425: checking if using else cat > conftest.$ac_ext < -@@ -47441,7 +48809,7 @@ int main() { +@@ -47441,7 +48830,7 @@ int main() { } EOF -if { (eval echo configure:47445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:48813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:48834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 -@@ -47463,16 +48831,16 @@ fi +@@ -47463,16 +48852,16 @@ fi if test -z "$iconv_impl_name"; then echo $ac_n "checking if iconv is Konstantin Chuguev's""... $ac_c" 1>&6 -echo "configure:47467: checking if iconv is Konstantin Chuguev's" >&5 -+echo "configure:48835: checking if iconv is Konstantin Chuguev's" >&5 ++echo "configure:48856: checking if iconv is Konstantin Chuguev's" >&5 cat > conftest.$ac_ext < int main() { @@ -10028,21 +11965,21 @@ ; return 0; } EOF -if { (eval echo configure:47476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -@@ -47491,18 +48859,18 @@ rm -f conftest* +@@ -47491,18 +48880,18 @@ rm -f conftest* if test -z "$iconv_impl_name"; then echo $ac_n "checking if using IBM iconv""... $ac_c" 1>&6 -echo "configure:47495: checking if using IBM iconv" >&5 -+echo "configure:48863: checking if using IBM iconv" >&5 ++echo "configure:48884: checking if using IBM iconv" >&5 php_iconv_old_ld="$LDFLAGS" LDFLAGS="-liconv $LDFLAGS" cat > conftest.$ac_ext < int main() { @@ -10050,590 +11987,590 @@ ; return 0; } EOF -if { (eval echo configure:47506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:48874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:48895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -@@ -47688,7 +49056,7 @@ EOF +@@ -47688,7 +49077,7 @@ EOF esac echo $ac_n "checking if iconv supports errno""... $ac_c" 1>&6 -echo "configure:47692: checking if iconv supports errno" >&5 -+echo "configure:49060: checking if iconv supports errno" >&5 ++echo "configure:49081: checking if iconv supports errno" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""no" 1>&6 -@@ -47702,7 +49070,7 @@ EOF +@@ -47702,7 +49091,7 @@ EOF else cat > conftest.$ac_ext < -@@ -47723,7 +49091,7 @@ int main() { +@@ -47723,7 +49112,7 @@ int main() { } EOF -if { (eval echo configure:47727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:49095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:49116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 -@@ -47755,9 +49123,9 @@ fi +@@ -47755,9 +49144,9 @@ fi echo $ac_n "checking if your cpp allows macro usage in include lines""... $ac_c" 1>&6 -echo "configure:47759: checking if your cpp allows macro usage in include lines" >&5 -+echo "configure:49127: checking if your cpp allows macro usage in include lines" >&5 ++echo "configure:49148: checking if your cpp allows macro usage in include lines" >&5 cat > conftest.$ac_ext < -@@ -47767,7 +49135,7 @@ int main() { +@@ -47767,7 +49156,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:47771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:49139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:49160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -@@ -48123,7 +49491,7 @@ fi +@@ -48123,7 +49512,7 @@ fi php_with_imap=no echo $ac_n "checking for IMAP support""... $ac_c" 1>&6 -echo "configure:48127: checking for IMAP support" >&5 -+echo "configure:49495: checking for IMAP support" >&5 ++echo "configure:49516: checking for IMAP support" >&5 # Check whether --with-imap or --without-imap was given. if test "${with_imap+set}" = set; then withval="$with_imap" -@@ -48167,7 +49535,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -48167,7 +49556,7 @@ echo "$ac_t""$ext_output" 1>&6 php_with_kerberos=no echo $ac_n "checking for IMAP Kerberos support""... $ac_c" 1>&6 -echo "configure:48171: checking for IMAP Kerberos support" >&5 -+echo "configure:49539: checking for IMAP Kerberos support" >&5 ++echo "configure:49560: checking for IMAP Kerberos support" >&5 # Check whether --with-kerberos or --without-kerberos was given. if test "${with_kerberos+set}" = set; then withval="$with_kerberos" -@@ -48190,7 +49558,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -48190,7 +49579,7 @@ echo "$ac_t""$ext_output" 1>&6 php_with_imap_ssl=no echo $ac_n "checking for IMAP SSL support""... $ac_c" 1>&6 -echo "configure:48194: checking for IMAP SSL support" >&5 -+echo "configure:49562: checking for IMAP SSL support" >&5 ++echo "configure:49583: checking for IMAP SSL support" >&5 # Check whether --with-imap-ssl or --without-imap-ssl was given. if test "${with_imap_ssl+set}" = set; then withval="$with_imap_ssl" -@@ -48594,7 +49962,7 @@ EOF +@@ -48594,7 +49983,7 @@ EOF done cat > conftest.$ac_ext < EOF -@@ -48614,12 +49982,12 @@ rm -f conftest* +@@ -48614,12 +50003,12 @@ rm -f conftest* old_CFLAGS=$CFLAGS CFLAGS="-I$IMAP_INC_DIR" echo $ac_n "checking for utf8_mime2text signature""... $ac_c" 1>&6 -echo "configure:48618: checking for utf8_mime2text signature" >&5 -+echo "configure:49986: checking for utf8_mime2text signature" >&5 ++echo "configure:50007: checking for utf8_mime2text signature" >&5 if eval "test \"`echo '$''{'ac_cv_utf8_mime2text'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -48632,7 +50000,7 @@ int main() { +@@ -48632,7 +50021,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:48636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:50004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:50025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_utf8_mime2text=old -@@ -48661,12 +50029,12 @@ EOF +@@ -48661,12 +50050,12 @@ EOF old_CFLAGS=$CFLAGS CFLAGS="-I$IMAP_INC_DIR" echo $ac_n "checking for U8T_DECOMPOSE""... $ac_c" 1>&6 -echo "configure:48665: checking for U8T_DECOMPOSE" >&5 -+echo "configure:50033: checking for U8T_DECOMPOSE" >&5 ++echo "configure:50054: checking for U8T_DECOMPOSE" >&5 if eval "test \"`echo '$''{'ac_cv_u8t_canonical'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -48677,7 +50045,7 @@ int main() { +@@ -48677,7 +50066,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:48681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:50049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:50070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_u8t_decompose=yes -@@ -48707,7 +50075,7 @@ echo "$ac_t""$ac_cv_u8t_canonical" 1>&6 +@@ -48707,7 +50096,7 @@ echo "$ac_t""$ac_cv_u8t_canonical" 1>&6 old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$IMAP_INC_DIR cat > conftest.$ac_ext <&6 -echo "configure:48830: checking for pam_start in -lpam" >&5 -+echo "configure:50198: checking for pam_start in -lpam" >&5 ++echo "configure:50219: checking for pam_start in -lpam" >&5 ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -48834,7 +50202,7 @@ else +@@ -48834,7 +50223,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpam $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:50217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:50238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -49000,7 +50368,7 @@ fi +@@ -49000,7 +50389,7 @@ fi done echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:49004: checking for crypt in -lcrypt" >&5 -+echo "configure:50372: checking for crypt in -lcrypt" >&5 ++echo "configure:50393: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -49008,7 +50376,7 @@ else +@@ -49008,7 +50397,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:50391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:50412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -49223,7 +50591,7 @@ fi +@@ -49223,7 +50612,7 @@ fi # Extract the first word of "krb5-config", so it can be a program name with args. set dummy krb5-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:49227: checking for $ac_word" >&5 -+echo "configure:50595: checking for $ac_word" >&5 ++echo "configure:50616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_KRB5_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -49592,7 +50960,7 @@ else +@@ -49592,7 +50981,7 @@ else else cat > conftest.$ac_ext < EOF -@@ -49633,7 +51001,7 @@ rm -f conftest* +@@ -49633,7 +51022,7 @@ rm -f conftest* # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:49637: checking for $ac_word" >&5 -+echo "configure:51005: checking for $ac_word" >&5 ++echo "configure:51026: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -49838,9 +51206,9 @@ fi +@@ -49838,9 +51227,9 @@ fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$OPENSSL_INCDIR echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 -echo "configure:49842: checking for OpenSSL version" >&5 -+echo "configure:51210: checking for OpenSSL version" >&5 ++echo "configure:51231: checking for OpenSSL version" >&5 cat > conftest.$ac_ext < -@@ -49995,7 +51363,7 @@ rm -f conftest* +@@ -49995,7 +51384,7 @@ rm -f conftest* done echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 -echo "configure:49999: checking for CRYPTO_free in -lcrypto" >&5 -+echo "configure:51367: checking for CRYPTO_free in -lcrypto" >&5 ++echo "configure:51388: checking for CRYPTO_free in -lcrypto" >&5 ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -50003,7 +51371,7 @@ else +@@ -50003,7 +51392,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:51386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:51407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -50171,7 +51539,7 @@ fi +@@ -50171,7 +51560,7 @@ fi done echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 -echo "configure:50175: checking for SSL_CTX_set_ssl_version in -lssl" >&5 -+echo "configure:51543: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ++echo "configure:51564: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -50179,7 +51547,7 @@ else +@@ -50179,7 +51568,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:51562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:51583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -50309,7 +51677,7 @@ else +@@ -50309,7 +51698,7 @@ else elif test -f "$IMAP_INC_DIR/linkage.c"; then cat > conftest.$ac_ext < EOF -@@ -50340,7 +51708,7 @@ rm -f conftest* +@@ -50340,7 +51729,7 @@ rm -f conftest* else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:51745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:51766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBS=$old_LIBS -@@ -50409,7 +51777,7 @@ fi +@@ -50409,7 +51798,7 @@ fi else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:51814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:51835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBS=$old_LIBS -@@ -50469,7 +51837,7 @@ fi +@@ -50469,7 +51858,7 @@ fi echo $ac_n "checking whether rfc822_output_address_list function present""... $ac_c" 1>&6 -echo "configure:50473: checking whether rfc822_output_address_list function present" >&5 -+echo "configure:51841: checking whether rfc822_output_address_list function present" >&5 ++echo "configure:51862: checking whether rfc822_output_address_list function present" >&5 old_LIBS=$LIBS LIBS=" -@@ -50481,7 +51849,7 @@ echo "configure:50473: checking whether +@@ -50481,7 +51870,7 @@ echo "configure:50473: checking whether else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:51889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:51910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBS=$old_LIBS -@@ -50546,7 +51914,7 @@ fi +@@ -50546,7 +51935,7 @@ fi echo $ac_n "checking whether build with IMAP works""... $ac_c" 1>&6 -echo "configure:50550: checking whether build with IMAP works" >&5 -+echo "configure:51918: checking whether build with IMAP works" >&5 ++echo "configure:51939: checking whether build with IMAP works" >&5 old_LIBS=$LIBS -@@ -50557,7 +51925,7 @@ echo "configure:50550: checking whether +@@ -50557,7 +51946,7 @@ echo "configure:50550: checking whether else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:51962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:51983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBS=$old_LIBS -@@ -50622,7 +51990,7 @@ fi +@@ -50622,7 +52011,7 @@ fi php_with_interbase=no echo $ac_n "checking for InterBase support""... $ac_c" 1>&6 -echo "configure:50626: checking for InterBase support" >&5 -+echo "configure:51994: checking for InterBase support" >&5 ++echo "configure:52015: checking for InterBase support" >&5 # Check whether --with-interbase or --without-interbase was given. if test "${with_interbase+set}" = set; then withval="$with_interbase" -@@ -50769,7 +52137,7 @@ if test "$PHP_INTERBASE" != "no"; then +@@ -50769,7 +52158,7 @@ if test "$PHP_INTERBASE" != "no"; then done echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6 -echo "configure:50773: checking for isc_detach_database in -lfbclient" >&5 -+echo "configure:52141: checking for isc_detach_database in -lfbclient" >&5 ++echo "configure:52162: checking for isc_detach_database in -lfbclient" >&5 ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -50777,7 +52145,7 @@ else +@@ -50777,7 +52166,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lfbclient $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:52160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:52181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -50915,7 +52283,7 @@ else +@@ -50915,7 +52304,7 @@ else done echo $ac_n "checking for isc_detach_database in -lgds""... $ac_c" 1>&6 -echo "configure:50919: checking for isc_detach_database in -lgds" >&5 -+echo "configure:52287: checking for isc_detach_database in -lgds" >&5 ++echo "configure:52308: checking for isc_detach_database in -lgds" >&5 ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -50923,7 +52291,7 @@ else +@@ -50923,7 +52312,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgds $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:52306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:52327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -51061,7 +52429,7 @@ else +@@ -51061,7 +52450,7 @@ else done echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6 -echo "configure:51065: checking for isc_detach_database in -lib_util" >&5 -+echo "configure:52433: checking for isc_detach_database in -lib_util" >&5 ++echo "configure:52454: checking for isc_detach_database in -lib_util" >&5 ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -51069,7 +52437,7 @@ else +@@ -51069,7 +52458,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lib_util $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:52452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:52473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -51557,7 +52925,7 @@ fi +@@ -51557,7 +52946,7 @@ fi php_enable_intl=no echo $ac_n "checking whether to enable internationalization support""... $ac_c" 1>&6 -echo "configure:51561: checking whether to enable internationalization support" >&5 -+echo "configure:52929: checking whether to enable internationalization support" >&5 ++echo "configure:52950: checking whether to enable internationalization support" >&5 # Check whether --enable-intl or --disable-intl was given. if test "${enable_intl+set}" = set; then enableval="$enable_intl" -@@ -51629,7 +52997,7 @@ ext_output=$PHP_ICU_DIR +@@ -51629,7 +53018,7 @@ ext_output=$PHP_ICU_DIR # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:51633: checking for $ac_word" >&5 -+echo "configure:53001: checking for $ac_word" >&5 ++echo "configure:53022: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ICU_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -51667,7 +53035,7 @@ fi +@@ -51667,7 +53056,7 @@ fi fi echo $ac_n "checking for location of ICU headers and libraries""... $ac_c" 1>&6 -echo "configure:51671: checking for location of ICU headers and libraries" >&5 -+echo "configure:53039: checking for location of ICU headers and libraries" >&5 ++echo "configure:53060: checking for location of ICU headers and libraries" >&5 icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null` if test "$?" != "0" || test -z "$icu_install_prefix"; then -@@ -51677,7 +53045,7 @@ echo "configure:51671: checking for loca +@@ -51677,7 +53066,7 @@ echo "configure:51671: checking for loca echo "$ac_t""$icu_install_prefix" 1>&6 echo $ac_n "checking for ICU 3.4 or greater""... $ac_c" 1>&6 -echo "configure:51681: checking for ICU 3.4 or greater" >&5 -+echo "configure:53049: checking for ICU 3.4 or greater" >&5 ++echo "configure:53070: checking for ICU 3.4 or greater" >&5 icu_version_full=`$ICU_CONFIG --version` ac_IFS=$IFS IFS="." -@@ -51834,7 +53202,7 @@ do +@@ -51834,7 +53223,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:51838: checking for $ac_word" >&5 -+echo "configure:53206: checking for $ac_word" >&5 ++echo "configure:53227: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -51866,7 +53234,7 @@ test -n "$CXX" || CXX="gcc" +@@ -51866,7 +53255,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:51870: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 -+echo "configure:53238: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ++echo "configure:53259: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -@@ -51877,12 +53245,12 @@ cross_compiling=$ac_cv_prog_cxx_cross +@@ -51877,12 +53266,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 51881 "configure" -+#line 53249 "configure" ++#line 53270 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:51886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:53254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:53275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then -@@ -51908,12 +53276,12 @@ if test $ac_cv_prog_cxx_works = no; then +@@ -51908,12 +53297,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:51912: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -+echo "configure:53280: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:53301: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:51917: checking whether we are using GNU C++" >&5 -+echo "configure:53285: checking whether we are using GNU C++" >&5 ++echo "configure:53306: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -51922,7 +53290,7 @@ else +@@ -51922,7 +53311,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:51926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:53294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:53315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no -@@ -51941,7 +53309,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" +@@ -51941,7 +53330,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:51945: checking whether ${CXX-g++} accepts -g" >&5 -+echo "configure:53313: checking whether ${CXX-g++} accepts -g" >&5 ++echo "configure:53334: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -51972,59 +53340,8 @@ else +@@ -51972,59 +53361,8 @@ else fi fi @@ -10690,124 +12627,124 @@ - echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:52028: checking how to run the C++ preprocessor" >&5 -+echo "configure:53345: checking how to run the C++ preprocessor" >&5 ++echo "configure:53366: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -52037,12 +53354,12 @@ ac_link='${CXX-g++} -o conftest${ac_exee +@@ -52037,12 +53375,12 @@ ac_link='${CXX-g++} -o conftest${ac_exee cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:52046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:53363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:53384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -52600,7 +53917,7 @@ fi +@@ -52600,7 +53938,7 @@ fi php_enable_json=yes echo $ac_n "checking whether to enable JavaScript Object Serialization support""... $ac_c" 1>&6 -echo "configure:52604: checking whether to enable JavaScript Object Serialization support" >&5 -+echo "configure:53921: checking whether to enable JavaScript Object Serialization support" >&5 ++echo "configure:53942: checking whether to enable JavaScript Object Serialization support" >&5 # Check whether --enable-json or --disable-json was given. if test "${enable_json+set}" = set; then enableval="$enable_json" -@@ -52646,12 +53963,12 @@ if test "$PHP_JSON" != "no"; then +@@ -52646,12 +53984,12 @@ if test "$PHP_JSON" != "no"; then EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:52650: checking for ANSI C header files" >&5 -+echo "configure:53967: checking for ANSI C header files" >&5 ++echo "configure:53988: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -52659,7 +53976,7 @@ else +@@ -52659,7 +53997,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:52663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:53980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:54001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -52676,7 +53993,7 @@ rm -f conftest* +@@ -52676,7 +54014,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF -@@ -52694,7 +54011,7 @@ fi +@@ -52694,7 +54032,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF -@@ -52715,7 +54032,7 @@ if test "$cross_compiling" = yes; then +@@ -52715,7 +54053,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -@@ -52726,7 +54043,7 @@ if (XOR (islower (i), ISLOWER (i)) || to +@@ -52726,7 +54064,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:52730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:54047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:54068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else -@@ -53076,7 +54393,7 @@ fi +@@ -53076,7 +54414,7 @@ fi php_with_ldap=no echo $ac_n "checking for LDAP support""... $ac_c" 1>&6 -echo "configure:53080: checking for LDAP support" >&5 -+echo "configure:54397: checking for LDAP support" >&5 ++echo "configure:54418: checking for LDAP support" >&5 # Check whether --with-ldap or --without-ldap was given. if test "${with_ldap+set}" = set; then withval="$with_ldap" -@@ -53120,7 +54437,7 @@ echo "$ac_t""$ext_output" 1>&6 +@@ -53120,7 +54458,7 @@ echo "$ac_t""$ext_output" 1>&6 php_with_ldap_sasl=no echo $ac_n "checking for LDAP Cyrus SASL support""... $ac_c" 1>&6 -echo "configure:53124: checking for LDAP Cyrus SASL support" >&5 -+echo "configure:54441: checking for LDAP Cyrus SASL support" >&5 ++echo "configure:54462: checking for LDAP Cyrus SASL support" >&5 # Check whether --with-ldap-sasl or --without-ldap-sasl was given. if test "${with_ldap_sasl+set}" = set; then withval="$with_ldap_sasl" -@@ -55462,19 +56779,19 @@ EOF +@@ -55462,19 +56800,19 @@ EOF LIBS="$LIBS $LDAP_SHARED_LIBADD" echo $ac_n "checking for 3 arg ldap_set_rebind_proc""... $ac_c" 1>&6 -echo "configure:55466: checking for 3 arg ldap_set_rebind_proc" >&5 -+echo "configure:56783: checking for 3 arg ldap_set_rebind_proc" >&5 ++echo "configure:56804: checking for 3 arg ldap_set_rebind_proc" >&5 if eval "test \"`echo '$''{'ac_cv_3arg_setrebindproc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -10815,97 +12752,272 @@ ; return 0; } EOF -if { (eval echo configure:55478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:56795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:56816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_3arg_setrebindproc=yes else -@@ -55497,12 +56814,12 @@ EOF +@@ -55497,12 +56835,12 @@ EOF for ac_func in ldap_parse_result ldap_parse_reference ldap_start_tls_s do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:55501: checking for $ac_func" >&5 -+echo "configure:56818: checking for $ac_func" >&5 ++echo "configure:56839: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:56846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:56867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -55537,62 +56854,514 @@ fi - rm -f conftest* +@@ -55687,7 +57025,7 @@ EOF + done + + echo $ac_n "checking for sasl_version in -lldap""... $ac_c" 1>&6 +-echo "configure:55691: checking for sasl_version in -lldap" >&5 ++echo "configure:57029: checking for sasl_version in -lldap" >&5 + ac_lib_var=`echo ldap'_'sasl_version | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -55695,7 +57033,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lldap $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:57048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -55875,12 +57213,12 @@ fi + fi + + echo $ac_n "checking for ldap_bind_s""... $ac_c" 1>&6 +-echo "configure:55879: checking for ldap_bind_s" >&5 ++echo "configure:57217: checking for ldap_bind_s" >&5 + if eval "test \"`echo '$''{'ac_cv_func_ldap_bind_s'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:57245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_ldap_bind_s=yes" + else +@@ -55932,39 +57270,18 @@ fi + + + ++php_with_libevent=no + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-php_enable_mbstring=no +- +-echo $ac_n "checking whether to enable multibyte string support""... $ac_c" 1>&6 +-echo "configure:55960: checking whether to enable multibyte string support" >&5 +-# Check whether --enable-mbstring or --disable-mbstring was given. +-if test "${enable_mbstring+set}" = set; then +- enableval="$enable_mbstring" +- PHP_MBSTRING=$enableval ++echo $ac_n "checking for libevent support""... $ac_c" 1>&6 ++echo "configure:57277: checking for libevent support" >&5 ++# Check whether --with-libevent or --without-libevent was given. ++if test "${with_libevent+set}" = set; then ++ withval="$with_libevent" ++ PHP_LIBEVENT=$withval + else + +- PHP_MBSTRING=no +- test "$PHP_ENABLE_ALL" && PHP_MBSTRING=$PHP_ENABLE_ALL ++ PHP_LIBEVENT=no ++ test "$PHP_ENABLE_ALL" && PHP_LIBEVENT=$PHP_ENABLE_ALL + fi --if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then -+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then -+ echo "$ac_t""yes" 1>&6 -+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -+ cat >> confdefs.h <&6 -+fi -+done +@@ -55972,12 +57289,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_MBSTRING in ++case $PHP_LIBEVENT in + shared,*) +- PHP_MBSTRING=`echo "$PHP_MBSTRING"|$SED 's/^shared,//'` ++ PHP_LIBEVENT=`echo "$PHP_LIBEVENT"|$SED 's/^shared,//'` + ;; + shared) +- PHP_MBSTRING=yes ++ PHP_LIBEVENT=yes + ;; + no) + ext_output=no +@@ -55996,2004 +57313,1529 @@ echo "$ac_t""$ext_output" 1>&6 + + + ++if test "$PHP_LIBEVENT" != "no"; then ++ SEARCH_PATH="/usr /usr/local" ++ SEARCH_FOR="/include/event.h" + -+ -+ if test "$PHP_LDAP_SASL" != "no"; then -+ -+ if test "$PHP_LDAP_SASL" = "yes"; then -+ SEARCH_DIRS="/usr/local /usr" ++ if test "$PHP_LIBEVENT" = "yes"; then ++ echo $ac_n "checking for libevent headers in default path""... $ac_c" 1>&6 ++echo "configure:57323: checking for libevent headers in default path" >&5 ++ for i in $SEARCH_PATH ; do ++ if test -r $i/$SEARCH_FOR; then ++ LIBEVENT_DIR=$i ++ echo "$ac_t""found in $i" 1>&6 ++ fi ++ done + else -+ SEARCH_DIRS=$PHP_LDAP_SASL -+ fi -+ -+ for i in $SEARCH_DIRS; do -+ if test -f $i/include/sasl/sasl.h; then -+ LDAP_SASL_DIR=$i -+ cat >> confdefs.h <<\EOF -+#define HAVE_LDAP_SASL_SASL_H 1 -+EOF -+ -+ break -+ elif test -f $i/include/sasl.h; then -+ LDAP_SASL_DIR=$i -+ cat >> confdefs.h <<\EOF -+#define HAVE_LDAP_SASL_H 1 -+EOF -+ -+ break ++ echo $ac_n "checking for libevent headers in $PHP_LIBEVENT""... $ac_c" 1>&6 ++echo "configure:57332: checking for libevent headers in $PHP_LIBEVENT" >&5 ++ if test -r $PHP_LIBEVENT/$SEARCH_FOR; then ++ LIBEVENT_DIR=$PHP_LIBEVENT ++ echo "$ac_t""found" 1>&6 + fi -+ done -+ -+ if test "$LDAP_SASL_DIR"; then -+ LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include -+ LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR -+ else -+ { echo "configure: error: sasl.h not found!" 1>&2; exit 1; } + fi -+ -+ if test "$PHP_LDAP_SASL" = "yes"; then -+ SASL_LIB="-lsasl2" + +-php_enable_mbregex=yes ++ if test -z "$LIBEVENT_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Cannot find libevent headers" 1>&2; exit 1; } ++ fi + +-echo $ac_n "checking whether to enable multibyte regex support""... $ac_c" 1>&6 +-echo "configure:56004: checking whether to enable multibyte regex support" >&5 +-# Check whether --enable-mbregex or --disable-mbregex was given. +-if test "${enable_mbregex+set}" = set; then +- enableval="$enable_mbregex" +- PHP_MBREGEX=$enableval +-else +- +- PHP_MBREGEX=yes + ++ if test "$LIBEVENT_DIR/include" != "/usr/include"; then ++ ++ if test -z "$LIBEVENT_DIR/include" || echo "$LIBEVENT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEVENT_DIR/include + else -+ SASL_LIB="-L$LDAP_SASL_LIBDIR -lsasl2" ++ ++ ep_dir="`echo $LIBEVENT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/include\"`" + fi -+ -+ + +-fi +- +- +-ext_output=$PHP_MBREGEX +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_enable_mbregex_backtrack=yes +- +-echo $ac_n "checking whether to check multibyte regex backtrack""... $ac_c" 1>&6 +-echo "configure:56027: checking whether to check multibyte regex backtrack" >&5 +-# Check whether --enable-mbregex_backtrack or --disable-mbregex_backtrack was given. +-if test "${enable_mbregex_backtrack+set}" = set; then +- enableval="$enable_mbregex_backtrack" +- PHP_MBREGEX_BACKTRACK=$enableval +-else ++ + +- PHP_MBREGEX_BACKTRACK=yes ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +-fi +- +- +-ext_output=$PHP_MBREGEX_BACKTRACK +-echo "$ac_t""$ext_output" 1>&6 +- +- ++ fi + + ++ LIBNAME=event ++ LIBSYMBOL=event_base_new + +-php_with_libmbfl=no ++ if test "x$PHP_LIBDIR" = "x"; then ++ PHP_LIBDIR=lib ++ fi + +-echo $ac_n "checking for external libmbfl""... $ac_c" 1>&6 +-echo "configure:56050: checking for external libmbfl" >&5 +-# Check whether --with-libmbfl or --without-libmbfl was given. +-if test "${with_libmbfl+set}" = set; then +- withval="$with_libmbfl" +- PHP_LIBMBFL=$withval +-else + +- PHP_LIBMBFL=no + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" -+ $LDAP_SHARED_LIBADD $SASL_LIB ++ -L$LIBEVENT_DIR/$PHP_LIBDIR + " -+ + + save_ext_shared=$ext_shared + ext_shared=yes + @@ -10924,13 +13036,33 @@ + eval "EXTRA_LDFLAGS$unique=set" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi -+ + +-fi +- +- +-ext_output=$PHP_LIBMBFL +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_with_onig=no +- +-echo $ac_n "checking for external oniguruma""... $ac_c" 1>&6 +-echo "configure:56073: checking for external oniguruma" >&5 +-# Check whether --with-onig or --without-onig was given. +-if test "${with_onig+set}" = set; then +- withval="$with_onig" +- PHP_ONIG=$withval +-else + fi + ;; + -l*) + ac_ii=`echo $ac_i|cut -c 3-` + -+ + +- PHP_ONIG=no + case $ac_ii in + c|c_r|pthread*) ;; + *) @@ -10938,26 +13070,51 @@ + LDFLAGS="$LDFLAGS -l$ac_ii" + else + -+ + + case $ac_ii in + c|c_r|pthread*) ;; + *) + LIBS="$LIBS -l$ac_ii" + ;; + esac -+ -+ + +-fi + + fi + ;; + esac -+ -+ + +-ext_output=$PHP_ONIG +-echo "$ac_t""$ext_output" 1>&6 + +- +- +- +-if test "$PHP_MBSTRING" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_MBSTRING 1 +-EOF +- +- +- +- PHP_MBSTRING_BASE_SOURCES="$PHP_MBSTRING_BASE_SOURCES mbstring.c php_unicode.c mb_gpc.c" +- +- +- if test "$PHP_MBREGEX" != "no"; then + ;; + -L*) + ac_ii=`echo $ac_i|cut -c 3-` + + if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then -+ + +- if test "$PHP_MBREGEX" = "yes"; then +- if test "$PHP_ONIG" = "yes" || test "$PHP_ONIG" = "no"; then +- if test "$PHP_MBREGEX_BACKTRACK" != "no"; then +- cat >> confdefs.h <<\EOF +-#define USE_COMBINATION_EXPLOSION_CHECK 1 +-EOF +- +- fi + if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then + ai_p=$ac_ii + else @@ -10967,15 +13124,34 @@ + ep_realdir="`(cd \"$ep_dir\" && pwd)`" + ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi -+ + +- echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 +-echo "configure:56114: checking for variable length prototypes and stdarg.h" >&5 +-if eval "test \"`echo '$''{'php_cv_mbstring_stdarg'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else + + if test "$ext_shared" = "yes"; then + LDFLAGS="-L$ai_p $LDFLAGS" + test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + -+ -+ + +- if test "$cross_compiling" = yes; then + +- case $host_alias in +- *netware*) +- php_cv_mbstring_stdarg=yes +- ;; +- *) +- php_cv_mbstring_stdarg=no +- ;; +- esac +- +-else +- cat > conftest.$ac_ext < +-int foo(int x, ...) { +- va_list va; +- va_start(va, x); +- va_arg(va, int); +- va_arg(va, char *); +- va_arg(va, double); +- return 0; +-} +-int main() { return foo(10, "", 3.14); } +- +-EOF +-if { (eval echo configure:56147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- php_cv_mbstring_stdarg=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- php_cv_mbstring_stdarg=no +-fi +-rm -fr conftest* +-fi + +- +-fi + fi + + fi -+ + +-echo "$ac_t""$php_cv_mbstring_stdarg" 1>&6 + ;; + esac + done -+ -+ echo $ac_n "checking for sasl_version in -lldap""... $ac_c" 1>&6 -+echo "configure:57008: checking for sasl_version in -lldap" >&5 -+ac_lib_var=`echo ldap'_'sasl_version | sed 'y%./+-%__p_%'` + +- for ac_hdr in stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h stdarg.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:56168: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6 ++echo "configure:57481: checking for $LIBSYMBOL in -l$LIBNAME" >&5 ++ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ -+char sasl_version(); ++char $LIBSYMBOL(); + +int main() { -+sasl_version() ++$LIBSYMBOL() +; return 0; } -+EOF -+if { (eval echo configure:57027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* + EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:56178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then ++if { (eval echo configure:57500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=yes" -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* + else +- echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_lib_$ac_lib_var=no" -+fi -+rm -f conftest* + fi + rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done +LIBS="$ac_save_LIBS" -+ -+fi + +- echo $ac_n "checking size of int""... $ac_c" 1>&6 +-echo "configure:56205: checking size of int" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_int=4 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(int)); +- return(0); +-} +-EOF +-if { (eval echo configure:56224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_int=`cat conftestval` +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_int=0 +-fi +-rm -fr conftest* + fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + @@ -11037,58 +13297,32 @@ + ext_shared=$save_ext_shared + + -+ if test "$LDAP_SASL_INCDIR" != "/usr/include"; then -+ -+ if test -z "$LDAP_SASL_INCDIR" || echo "$LDAP_SASL_INCDIR" | grep '^/' >/dev/null ; then -+ ai_p=$LDAP_SASL_INCDIR -+ else -+ -+ ep_dir="`echo $LDAP_SASL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" -+ -+ ep_realdir="`(cd \"$ep_dir\" && pwd)`" -+ ai_p="$ep_realdir/`basename \"$LDAP_SASL_INCDIR\"`" -+ fi -+ -+ -+ -+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` -+ -+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" -+ if test -n "$unique" && test "`eval $cmd`" = "" ; then -+ eval "INCLUDEPATH$unique=set" -+ -+ if test ""; then -+ INCLUDES="-I$ai_p $INCLUDES" -+ else -+ INCLUDES="$INCLUDES -I$ai_p" -+ fi -+ -+ fi -+ -+ fi -+ -+ -+ + +-fi +-echo "$ac_t""$ac_cv_sizeof_int" 1>&6 +-cat >> confdefs.h </dev/null ; then -+ ai_p=$LDAP_SASL_LIBDIR ++ if test -z "$LIBEVENT_DIR/$PHP_LIBDIR" || echo "$LIBEVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEVENT_DIR/$PHP_LIBDIR + else + -+ ep_dir="`echo $LDAP_SASL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $LIBEVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" -+ ai_p="$ep_realdir/`basename \"$LDAP_SASL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/$PHP_LIBDIR\"`" + fi -+ + + + if test "$ext_shared" = "yes"; then -+ LDAP_SHARED_LIBADD="-L$ai_p $LDAP_SHARED_LIBADD" -+ test -n "$ld_runpath_switch" && LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p $LDAP_SHARED_LIBADD" ++ LIBEVENT_SHARED_LIBADD="-L$ai_p $LIBEVENT_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && LIBEVENT_SHARED_LIBADD="$ld_runpath_switch$ai_p $LIBEVENT_SHARED_LIBADD" + else + + @@ -11104,30 +13338,102 @@ + PHP_RPATHS="$PHP_RPATHS $ai_p" + + fi -+ -+ + +- echo $ac_n "checking size of short""... $ac_c" 1>&6 +-echo "configure:56244: checking size of short" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_short=2 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(short)); +- return(0); +-} +-EOF +-if { (eval echo configure:56263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_short=`cat conftestval` +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_short=0 +-fi +-rm -fr conftest* +-fi + +-fi +-echo "$ac_t""$ac_cv_sizeof_short" 1>&6 +-cat >> confdefs.h <&6 +-echo "configure:56283: checking size of long" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_long=4 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(long)); +- return(0); +-} +-EOF +-if { (eval echo configure:56302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_long=`cat conftestval` +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_long=0 +-fi +-rm -fr conftest* +-fi ++ if test -n "$LIBEVENT_DIR/$PHP_LIBDIR"; then + -+ if test "$LDAP_SASL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LDAP_SASL_LIBDIR" != "/usr/lib"; then ++ if test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + -+ if test -z "$LDAP_SASL_LIBDIR" || echo "$LDAP_SASL_LIBDIR" | grep '^/' >/dev/null ; then -+ ai_p=$LDAP_SASL_LIBDIR ++ if test -z "$LIBEVENT_DIR/$PHP_LIBDIR" || echo "$LIBEVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEVENT_DIR/$PHP_LIBDIR + else + -+ ep_dir="`echo $LDAP_SASL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $LIBEVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" -+ ai_p="$ep_realdir/`basename \"$LDAP_SASL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/$PHP_LIBDIR\"`" + fi -+ + +-fi +-echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +-cat >> confdefs.h <&6 +-echo "configure:56322: checking for working const" >&5 +-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext <j = 5; +-} +-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ +- const int foo = 10; +-} + +-; return 0; } +-EOF +-if { (eval echo configure:56376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- ac_cv_c_const=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ac_cv_c_const=no +-fi +-rm -f conftest* +-fi + +-echo "$ac_t""$ac_cv_c_const" 1>&6 +-if test $ac_cv_c_const = no; then +- cat >> confdefs.h <<\EOF +-#define const +-EOF + fi -+ -+ -+ cat >> confdefs.h <<\EOF -+#define HAVE_LDAP_SASL 1 -+EOF -+ + +-fi + +- echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +-echo "configure:56397: checking whether time.h and sys/time.h may both be included" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-#include +-#include +-int main() { +-struct tm *tp; +-; return 0; } +-EOF +-if { (eval echo configure:56411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- ac_cv_header_time=yes + + -+else + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ac_cv_header_time=no +-fi +-rm -f conftest* +-fi +- +-echo "$ac_t""$ac_cv_header_time" 1>&6 +-if test $ac_cv_header_time = yes; then +- cat >> confdefs.h <<\EOF +-#define TIME_WITH_SYS_TIME 1 +-EOF + echo "$ac_t""no" 1>&6 -+ -+ LDFLAGS=$save_old_LDFLAGS -+ ext_shared=$save_ext_shared -+ unset ac_cv_lib_ldap_sasl_version -+ -+ { echo "configure: error: LDAP SASL check failed. Please check config.log for more information." 1>&2; exit 1; } -+ -+ -+fi -+ -+ -+ fi -+ -+ echo $ac_n "checking for ldap_bind_s""... $ac_c" 1>&6 -+echo "configure:57196: checking for ldap_bind_s" >&5 -+if eval "test \"`echo '$''{'ac_cv_func_ldap_bind_s'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+else -+ cat > conftest.$ac_ext < -+/* Override any gcc2 internal prototype to avoid an error. */ -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char ldap_bind_s(); -+ -+int main() { -+ -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_ldap_bind_s) || defined (__stub___ldap_bind_s) -+choke me -+#else -+ldap_bind_s(); -+#endif -+ -+; return 0; } -+EOF -+if { (eval echo configure:57224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ rm -rf conftest* -+ eval "ac_cv_func_ldap_bind_s=yes" -+else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ eval "ac_cv_func_ldap_bind_s=no" -+fi -+rm -f conftest* -+fi -+ -+if eval "test \"`echo '$ac_cv_func_'ldap_bind_s`\" = yes"; then - echo "$ac_t""yes" 1>&6 -- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -- cat >> confdefs.h <&6 -+ -+ { echo "configure: error: LDAP build check failed. Please check config.log for more information." 1>&2; exit 1; } -+ - fi --done - - -- if test "$PHP_LDAP_SASL" != "no"; then -- -- if test "$PHP_LDAP_SASL" = "yes"; then -- SEARCH_DIRS="/usr/local /usr" -- else -- SEARCH_DIRS=$PHP_LDAP_SASL -- fi -+ CPPFLAGS=$_SAVE_CPPFLAGS -+ LIBS=$_SAVE_LIBS -+fi - -- for i in $SEARCH_DIRS; do -- if test -f $i/include/sasl/sasl.h; then -- LDAP_SASL_DIR=$i -- cat >> confdefs.h <<\EOF --#define HAVE_LDAP_SASL_SASL_H 1 --EOF - -- break -- elif test -f $i/include/sasl.h; then -- LDAP_SASL_DIR=$i -- cat >> confdefs.h <<\EOF --#define HAVE_LDAP_SASL_H 1 --EOF - -- break -- fi -- done -+php_with_libevent=no -+ -+echo $ac_n "checking for libevent support""... $ac_c" 1>&6 -+echo "configure:57256: checking for libevent support" >&5 -+# Check whether --with-libevent or --without-libevent was given. -+if test "${with_libevent+set}" = set; then -+ withval="$with_libevent" -+ PHP_LIBEVENT=$withval -+else - -- if test "$LDAP_SASL_DIR"; then -- LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include -- LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR -+ PHP_LIBEVENT=no -+ test "$PHP_ENABLE_ALL" && PHP_LIBEVENT=$PHP_ENABLE_ALL -+ -+fi -+ -+ -+ -+ext_output="yes, shared" -+ext_shared=yes -+case $PHP_LIBEVENT in -+shared,*) -+ PHP_LIBEVENT=`echo "$PHP_LIBEVENT"|$SED 's/^shared,//'` -+ ;; -+shared) -+ PHP_LIBEVENT=yes -+ ;; -+no) -+ ext_output=no -+ ext_shared=no -+ ;; -+*) -+ ext_output=yes -+ ext_shared=no -+ ;; -+esac -+ -+ -+ -+echo "$ac_t""$ext_output" 1>&6 -+ -+ -+ -+ -+if test "$PHP_LIBEVENT" != "no"; then -+ SEARCH_PATH="/usr /usr/local" -+ SEARCH_FOR="/include/event.h" -+ -+ if test "$PHP_LIBEVENT" = "yes"; then -+ echo $ac_n "checking for libevent headers in default path""... $ac_c" 1>&6 -+echo "configure:57302: checking for libevent headers in default path" >&5 -+ for i in $SEARCH_PATH ; do -+ if test -r $i/$SEARCH_FOR; then -+ LIBEVENT_DIR=$i -+ echo "$ac_t""found in $i" 1>&6 -+ fi -+ done - else -- { echo "configure: error: sasl.h not found!" 1>&2; exit 1; } -+ echo $ac_n "checking for libevent headers in $PHP_LIBEVENT""... $ac_c" 1>&6 -+echo "configure:57311: checking for libevent headers in $PHP_LIBEVENT" >&5 -+ if test -r $PHP_LIBEVENT/$SEARCH_FOR; then -+ LIBEVENT_DIR=$PHP_LIBEVENT -+ echo "$ac_t""found" 1>&6 -+ fi - fi - -- if test "$PHP_LDAP_SASL" = "yes"; then -- SASL_LIB="-lsasl2" -+ if test -z "$LIBEVENT_DIR"; then -+ echo "$ac_t""not found" 1>&6 -+ { echo "configure: error: Cannot find libevent headers" 1>&2; exit 1; } -+ fi -+ -+ -+ if test "$LIBEVENT_DIR/include" != "/usr/include"; then -+ -+ if test -z "$LIBEVENT_DIR/include" || echo "$LIBEVENT_DIR/include" | grep '^/' >/dev/null ; then -+ ai_p=$LIBEVENT_DIR/include - else -- SASL_LIB="-L$LDAP_SASL_LIBDIR -lsasl2" -+ -+ ep_dir="`echo $LIBEVENT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" -+ -+ ep_realdir="`(cd \"$ep_dir\" && pwd)`" -+ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/include\"`" - fi -+ -+ -+ -+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` - -+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" -+ if test -n "$unique" && test "`eval $cmd`" = "" ; then -+ eval "INCLUDEPATH$unique=set" -+ -+ if test ""; then -+ INCLUDES="-I$ai_p $INCLUDES" -+ else -+ INCLUDES="$INCLUDES -I$ai_p" -+ fi -+ -+ fi -+ -+ fi -+ -+ -+ LIBNAME=event -+ LIBSYMBOL=event_base_new -+ -+ if test "x$PHP_LIBDIR" = "x"; then -+ PHP_LIBDIR=lib -+ fi -+ - - save_old_LDFLAGS=$LDFLAGS - ac_stuff=" -- $LDAP_SHARED_LIBADD $SASL_LIB -+ -L$LIBEVENT_DIR/$PHP_LIBDIR - " - - save_ext_shared=$ext_shared -@@ -55686,27 +57455,27 @@ EOF - esac - done - -- echo $ac_n "checking for sasl_version in -lldap""... $ac_c" 1>&6 --echo "configure:55691: checking for sasl_version in -lldap" >&5 --ac_lib_var=`echo ldap'_'sasl_version | sed 'y%./+-%__p_%'` -+ echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6 -+echo "configure:57460: checking for $LIBSYMBOL in -l$LIBNAME" >&5 -+ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-lldap $LIBS" -+LIBS="-l$LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:57479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -55726,58 +57495,27 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - ext_shared=$save_ext_shared - - -- if test "$LDAP_SASL_INCDIR" != "/usr/include"; then -- -- if test -z "$LDAP_SASL_INCDIR" || echo "$LDAP_SASL_INCDIR" | grep '^/' >/dev/null ; then -- ai_p=$LDAP_SASL_INCDIR -- else -- -- ep_dir="`echo $LDAP_SASL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" -- -- ep_realdir="`(cd \"$ep_dir\" && pwd)`" -- ai_p="$ep_realdir/`basename \"$LDAP_SASL_INCDIR\"`" -- fi -- -- -- -- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` -- -- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" -- if test -n "$unique" && test "`eval $cmd`" = "" ; then -- eval "INCLUDEPATH$unique=set" -- -- if test ""; then -- INCLUDES="-I$ai_p $INCLUDES" -- else -- INCLUDES="$INCLUDES -I$ai_p" -- fi -- -- fi -- -- fi -- -- - - if test "$ext_shared" = "yes"; then -- LDAP_SHARED_LIBADD="-lsasl2 $LDAP_SHARED_LIBADD" -- if test -n "$LDAP_SASL_LIBDIR"; then -+ LIBEVENT_SHARED_LIBADD="-l$LIBNAME $LIBEVENT_SHARED_LIBADD" -+ if test -n "$LIBEVENT_DIR/$PHP_LIBDIR"; then - -- if test "$LDAP_SASL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LDAP_SASL_LIBDIR" != "/usr/lib"; then -+ if test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then - -- if test -z "$LDAP_SASL_LIBDIR" || echo "$LDAP_SASL_LIBDIR" | grep '^/' >/dev/null ; then -- ai_p=$LDAP_SASL_LIBDIR -+ if test -z "$LIBEVENT_DIR/$PHP_LIBDIR" || echo "$LIBEVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then -+ ai_p=$LIBEVENT_DIR/$PHP_LIBDIR - else - -- ep_dir="`echo $LDAP_SASL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" -+ ep_dir="`echo $LIBEVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" - - ep_realdir="`(cd \"$ep_dir\" && pwd)`" -- ai_p="$ep_realdir/`basename \"$LDAP_SASL_LIBDIR\"`" -+ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/$PHP_LIBDIR\"`" - fi - - - if test "$ext_shared" = "yes"; then -- LDAP_SHARED_LIBADD="-L$ai_p $LDAP_SHARED_LIBADD" -- test -n "$ld_runpath_switch" && LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p $LDAP_SHARED_LIBADD" -+ LIBEVENT_SHARED_LIBADD="-L$ai_p $LIBEVENT_SHARED_LIBADD" -+ test -n "$ld_runpath_switch" && LIBEVENT_SHARED_LIBADD="$ld_runpath_switch$ai_p $LIBEVENT_SHARED_LIBADD" - else - - -@@ -55803,18 +57541,18 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - else - - -- if test -n "$LDAP_SASL_LIBDIR"; then -+ if test -n "$LIBEVENT_DIR/$PHP_LIBDIR"; then - -- if test "$LDAP_SASL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LDAP_SASL_LIBDIR" != "/usr/lib"; then -+ if test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then - -- if test -z "$LDAP_SASL_LIBDIR" || echo "$LDAP_SASL_LIBDIR" | grep '^/' >/dev/null ; then -- ai_p=$LDAP_SASL_LIBDIR -+ if test -z "$LIBEVENT_DIR/$PHP_LIBDIR" || echo "$LIBEVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then -+ ai_p=$LIBEVENT_DIR/$PHP_LIBDIR - else - -- ep_dir="`echo $LDAP_SASL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" -+ ep_dir="`echo $LIBEVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" - - ep_realdir="`(cd \"$ep_dir\" && pwd)`" -- ai_p="$ep_realdir/`basename \"$LDAP_SASL_LIBDIR\"`" -+ ai_p="$ep_realdir/`basename \"$LIBEVENT_DIR/$PHP_LIBDIR\"`" - fi - - -@@ -55840,10 +57578,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - fi - - -- case sasl2 in -+ case $LIBNAME in - c|c_r|pthread*) ;; - *) -- LIBS="-lsasl2 $LIBS" -+ LIBS="-l$LIBNAME $LIBS" - ;; - esac - -@@ -55853,10 +57591,6 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - fi - -- cat >> confdefs.h <<\EOF --#define HAVE_LDAP_SASL 1 +-fi +- +- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +-# for constant arguments. Useless! +-echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +-echo "configure:56434: checking for working alloca.h" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-int main() { +-char *p = alloca(2 * sizeof(int)); +-; return 0; } -EOF -- - - - else -@@ -55864,71 +57598,329 @@ else - - LDFLAGS=$save_old_LDFLAGS - ext_shared=$save_ext_shared -- unset ac_cv_lib_ldap_sasl_version +-if { (eval echo configure:56446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- ac_cv_header_alloca_h=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ac_cv_header_alloca_h=no +-fi +-rm -f conftest* ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared + unset ac_cv_lib_$LIBNAME_$LIBSYMBOL - -- { echo "configure: error: LDAP SASL check failed. Please check config.log for more information." 1>&2; exit 1; } ++ + { echo "configure: error: wrong libevent version {1.4.+ is required} or lib not found" 1>&2; exit 1; } - - ++ ++ fi +-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 +-if test $ac_cv_header_alloca_h = yes; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ALLOCA_H 1 +-EOF +-fi + + am_i_shared=$PHP_LIBEVENT_SHARED + is_it_shared=$PHP_SOCKETS_SHARED @@ -11579,41 +13634,60 @@ +You've configured extension libevent, which depends on extension sockets, +but you've either not enabled sockets, or have disabled it. +" 1>&2; exit 1; } - fi ++ fi + + + PHP_VAR_SUBST="$PHP_VAR_SUBST LIBEVENT_SHARED_LIBADD" -- echo $ac_n "checking for ldap_bind_s""... $ac_c" 1>&6 --echo "configure:55879: checking for ldap_bind_s" >&5 --if eval "test \"`echo '$''{'ac_cv_func_ldap_bind_s'+set}'`\" = set"; then +-echo $ac_n "checking for alloca""... $ac_c" 1>&6 +-echo "configure:56467: checking for alloca" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < --/* Override any gcc2 internal prototype to avoid an error. */ --/* We use char because int might match the return type of a gcc2 -- builtin and then its argument prototype would still apply. */ --char ldap_bind_s(); + + ext_builddir=ext/libevent + ext_srcdir=$abs_srcdir/ext/libevent --int main() { -+ ac_extra= - --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined (__stub_ldap_bind_s) || defined (__stub___ldap_bind_s) --choke me +-#ifdef __GNUC__ +-# define alloca __builtin_alloca -#else --ldap_bind_s(); +-# ifdef _MSC_VER +-# include +-# define alloca _alloca +-# else +-# if HAVE_ALLOCA_H +-# include +-# else +-# ifdef _AIX +- #pragma alloca +-# else +-# ifndef alloca /* predefined by HP cc +Olibcalls */ +-char *alloca (); +-# endif +-# endif +-# endif +-# endif -#endif ++ ac_extra= + +-int main() { +-char *p = (char *) alloca(1); +-; return 0; } +-EOF +-if { (eval echo configure:56500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- ac_cv_func_alloca_works=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ac_cv_func_alloca_works=no +-fi +-rm -f conftest* +-fi + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then + PHP_LIBEVENT_SHARED=no + @@ -11626,7 +13700,11 @@ + + --; return 0; } +-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +-if test $ac_cv_func_alloca_works = yes; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ALLOCA 1 +-EOF + b_c_pre=$php_c_pre + b_cxx_pre=$php_cxx_pre + b_c_meta=$php_c_meta @@ -11634,8 +13712,19 @@ + b_c_post=$php_c_post + b_cxx_post=$php_cxx_post + b_lo=$php_lo -+ -+ + +-fi +- +-if test $ac_cv_func_alloca_works = no; then +- # The SVR3 libPW and SVR4 libucb both contain incompatible functions +- # that cause trouble. Some versions do not even contain alloca or +- # contain a buggy version. If you still want to use their alloca, +- # use ar to extract alloca.o from them instead of compiling alloca.c. +- ALLOCA=alloca.${ac_objext} +- cat >> confdefs.h <<\EOF +-#define C_ALLOCA 1 +-EOF + + old_IFS=$IFS + for ac_src in libevent.c; do + @@ -11645,38 +13734,62 @@ + IFS=$old_IFS + + PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ + +-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +-echo "configure:56532: checking whether alloca needs Cray hooks" >&5 +-if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* -- eval "ac_cv_func_ldap_bind_s=yes" +- ac_cv_os_cray=yes -else -- echo "configure: failed program was:" >&5 -- cat conftest.$ac_ext >&5 - rm -rf conftest* -- eval "ac_cv_func_ldap_bind_s=no" +- ac_cv_os_cray=no -fi -rm -f conftest* --fi + done --if eval "test \"`echo '$ac_cv_func_'ldap_bind_s`\" = yes"; then -- echo "$ac_t""yes" 1>&6 -- : --else -- echo "$ac_t""no" 1>&6 +-fi -- { echo "configure: error: LDAP build check failed. Please check config.log for more information." 1>&2; exit 1; } +-echo "$ac_t""$ac_cv_os_cray" 1>&6 +-if test $ac_cv_os_cray = yes; then +-for ac_func in _getb67 GETB67 getb67; do +- echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:56562: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); + EXT_STATIC="$EXT_STATIC libevent" + if test "$ext_shared" != "nocli"; then + EXT_CLI_STATIC="$EXT_CLI_STATIC libevent" @@ -11690,10 +13803,10 @@ + /*) ac_srcdir=`echo "ext/libevent"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; + *) ac_srcdir="$abs_srcdir/ext/libevent/"; ac_bdir="ext/libevent/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac - --fi + -+ ++ + +-int main() { + b_c_pre=$shared_c_pre + b_cxx_pre=$shared_cxx_pre + b_c_meta=$shared_c_meta @@ -11701,21 +13814,43 @@ + b_c_post=$shared_c_post + b_cxx_post=$shared_cxx_post + b_lo=$shared_lo -+ +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif + +-; return 0; } +-EOF +-if { (eval echo configure:56590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi + old_IFS=$IFS + for ac_src in libevent.c; do - -- CPPFLAGS=$_SAVE_CPPFLAGS -- LIBS=$_SAVE_LIBS --fi ++ + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + + shared_objects_libevent="$shared_objects_libevent $ac_bdir$ac_obj.lo" -+ + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <>Makefile.objects<&6 +-fi + case $host_alias in + *netware*) + + install_modules="install-modules" -+ + +-done +-fi + case $host_alias in + *aix*) + suffix=so @@ -11748,29 +13889,83 @@ + link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_libevent) $(PHPLIBEVENT_SHARED_LIBADD)' + ;; + esac -+ + +-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +-echo "configure:56617: checking stack direction for C alloca" >&5 +-if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_c_stack_direction=0 +-else +- cat > conftest.$ac_ext < addr) ? 1 : -1; +-} +-main () +-{ +- exit (find_stack_direction() < 0); +-} +-EOF +-if { (eval echo configure:56644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_c_stack_direction=1 +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_c_stack_direction=-1 +-fi +-rm -fr conftest* +-fi + PHP_MODULES="$PHP_MODULES \$(phplibdir)/phplibevent.$suffix" + fi + + PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_libevent" -+ + +-fi + cat >>Makefile.objects<&6 +-cat >> confdefs.h <&6 +-echo "configure:56666: checking for 8-bit clean memcmp" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_func_memcmp_clean=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_func_memcmp_clean=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_func_memcmp_clean=no +-fi +-rm -fr conftest* +-fi + cat >>Makefile.objects<&6 +-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" +EOF -+ + +- ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6 +-echo "configure:56703: checking for stdarg.h" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < + ;; + esac + cat >> confdefs.h <&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 + + fi + fi @@ -11817,7 +14059,10 @@ + case "$PHP_SAPI" in + cgi|embed) + -+ + +- cat >> confdefs.h <<\EOF +-#define HAVE_STDARG_PROTOTYPES 1 +-EOF + case ext/libevent in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; + /*) ac_srcdir=`echo "ext/libevent"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; @@ -11833,7 +14078,7 @@ + b_c_post=$php_c_post + b_cxx_post=$php_cxx_post + b_lo=$php_lo -+ + + + old_IFS=$IFS + for ac_src in libevent.c; do @@ -11842,23 +14087,38 @@ + set $ac_src + ac_obj=$1 + IFS=$old_IFS -+ -+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" -+ + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- cat >> confdefs.h <<\EOF +-#define PHP_ONIG_BUNDLED 1 +-EOF + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac -+ + +- cat >> confdefs.h <<\EOF +-#define HAVE_ONIG 1 + cat >>Makefile.objects<&2; exit 1; } +- fi +- +- if test "$PHP_ONIG/include" != "/usr/include"; then +- +- if test -z "$PHP_ONIG/include" || echo "$PHP_ONIG/include" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ONIG/include +- else +- +- ep_dir="`echo $PHP_ONIG/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ONIG/include\"`" +- fi + cat >>Makefile.objects<&6 --echo "configure:55960: checking whether to enable multibyte string support" >&5 -+echo "configure:57952: checking whether to enable multibyte string support" >&5 - # Check whether --enable-mbstring or --disable-mbstring was given. - if test "${enable_mbstring+set}" = set; then - enableval="$enable_mbstring" -@@ -56000,7 +57992,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_mbregex=yes - - echo $ac_n "checking whether to enable multibyte regex support""... $ac_c" 1>&6 --echo "configure:56004: checking whether to enable multibyte regex support" >&5 -+echo "configure:57996: checking whether to enable multibyte regex support" >&5 - # Check whether --enable-mbregex or --disable-mbregex was given. - if test "${enable_mbregex+set}" = set; then - enableval="$enable_mbregex" -@@ -56023,7 +58015,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_mbregex_backtrack=yes - - echo $ac_n "checking whether to check multibyte regex backtrack""... $ac_c" 1>&6 --echo "configure:56027: checking whether to check multibyte regex backtrack" >&5 -+echo "configure:58019: checking whether to check multibyte regex backtrack" >&5 - # Check whether --enable-mbregex_backtrack or --disable-mbregex_backtrack was given. - if test "${enable_mbregex_backtrack+set}" = set; then - enableval="$enable_mbregex_backtrack" -@@ -56046,7 +58038,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_libmbfl=no - - echo $ac_n "checking for external libmbfl""... $ac_c" 1>&6 --echo "configure:56050: checking for external libmbfl" >&5 -+echo "configure:58042: checking for external libmbfl" >&5 - # Check whether --with-libmbfl or --without-libmbfl was given. - if test "${with_libmbfl+set}" = set; then - withval="$with_libmbfl" -@@ -56069,7 +58061,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_onig=no - - echo $ac_n "checking for external oniguruma""... $ac_c" 1>&6 --echo "configure:56073: checking for external oniguruma" >&5 -+echo "configure:58065: checking for external oniguruma" >&5 - # Check whether --with-onig or --without-onig was given. - if test "${with_onig+set}" = set; then - withval="$with_onig" -@@ -56110,7 +58102,7 @@ EOF - fi +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac - echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 --echo "configure:56114: checking for variable length prototypes and stdarg.h" >&5 -+echo "configure:58106: checking for variable length prototypes and stdarg.h" >&5 - if eval "test \"`echo '$''{'php_cv_mbstring_stdarg'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56128,7 +58120,7 @@ else - - else - cat > conftest.$ac_ext < -@@ -56143,7 +58135,7 @@ int foo(int x, ...) { - int main() { return foo(10, "", 3.14); } - - EOF --if { (eval echo configure:56147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - php_cv_mbstring_stdarg=yes - else -@@ -56164,17 +58156,17 @@ echo "$ac_t""$php_cv_mbstring_stdarg" 1> - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:56168: checking for $ac_hdr" >&5 -+echo "configure:58160: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:56178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:58170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -56201,7 +58193,7 @@ fi - done +- fi +- ;; +- esac - echo $ac_n "checking size of int""... $ac_c" 1>&6 --echo "configure:56205: checking size of int" >&5 -+echo "configure:58197: checking size of int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56209,18 +58201,19 @@ else - ac_cv_sizeof_int=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(int)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:56224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_int=`cat conftestval` - else -@@ -56240,7 +58233,7 @@ EOF +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi - echo $ac_n "checking size of short""... $ac_c" 1>&6 --echo "configure:56244: checking size of short" >&5 -+echo "configure:58237: checking size of short" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56248,18 +58241,19 @@ else - ac_cv_sizeof_short=2 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(short)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:56263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_short=`cat conftestval` - else -@@ -56279,7 +58273,7 @@ EOF +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi - echo $ac_n "checking size of long""... $ac_c" 1>&6 --echo "configure:56283: checking size of long" >&5 -+echo "configure:58277: checking size of long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56287,18 +58281,19 @@ else - ac_cv_sizeof_long=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:56302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_long=`cat conftestval` - else -@@ -56318,12 +58313,12 @@ EOF +- fi +- +- fi +- ;; +- esac +- done - echo $ac_n "checking for working const""... $ac_c" 1>&6 --echo "configure:56322: checking for working const" >&5 -+echo "configure:58317: checking for working const" >&5 - if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 +-echo "configure:56943: checking for onig_init in -lonig" >&5 +-ac_lib_var=`echo onig'_'onig_init | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lonig $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" - ; return 0; } - EOF --if { (eval echo configure:56376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:58371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes - else -@@ -56393,12 +58388,12 @@ EOF - fi +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- - echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 --echo "configure:56397: checking whether time.h and sys/time.h may both be included" >&5 -+echo "configure:58392: checking whether time.h and sys/time.h may both be included" >&5 - if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #include -@@ -56407,7 +58402,7 @@ int main() { - struct tm *tp; - ; return 0; } - EOF --if { (eval echo configure:56411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:58406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes - else -@@ -56430,19 +58425,19 @@ fi - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works - # for constant arguments. Useless! - echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 --echo "configure:56434: checking for working alloca.h" >&5 -+echo "configure:58429: checking for working alloca.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - int main() { - char *p = alloca(2 * sizeof(int)); - ; return 0; } - EOF --if { (eval echo configure:56446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:58441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes - else -@@ -56463,12 +58458,12 @@ EOF - fi +- if test "$ext_shared" = "yes"; then +- MBSTRING_SHARED_LIBADD="-lonig $MBSTRING_SHARED_LIBADD" +- if test -n "$PHP_ONIG/$PHP_LIBDIR"; then +- +- if test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_ONIG/$PHP_LIBDIR" || echo "$PHP_ONIG/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ONIG/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PHP_ONIG/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ONIG/$PHP_LIBDIR\"`" +- fi - echo $ac_n "checking for alloca""... $ac_c" 1>&6 --echo "configure:56467: checking for alloca" >&5 -+echo "configure:58462: checking for alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:58495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_alloca_works=yes - else -@@ -56528,12 +58523,12 @@ EOF +- fi +- +- fi - echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 --echo "configure:56532: checking whether alloca needs Cray hooks" >&5 -+echo "configure:58527: checking whether alloca needs Cray hooks" >&5 - if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 - if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:56562: checking for $ac_func" >&5 -+echo "configure:58557: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:58585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -56613,7 +58608,7 @@ done - fi +- if test -n "$PHP_ONIG/$PHP_LIBDIR"; then +- +- if test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_ONIG/$PHP_LIBDIR" || echo "$PHP_ONIG/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ONIG/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PHP_ONIG/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ONIG/$PHP_LIBDIR\"`" +- fi - echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 --echo "configure:56617: checking stack direction for C alloca" >&5 -+echo "configure:58612: checking stack direction for C alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56621,7 +58616,7 @@ else - ac_cv_c_stack_direction=0 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_c_stack_direction=1 - else -@@ -56662,7 +58657,7 @@ EOF - fi +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi - echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 --echo "configure:56666: checking for 8-bit clean memcmp" >&5 -+echo "configure:58661: checking for 8-bit clean memcmp" >&5 - if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -56670,7 +58665,7 @@ else - ac_cv_func_memcmp_clean=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:58679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_func_memcmp_clean=yes - else -@@ -56699,17 +58694,17 @@ test $ac_cv_func_memcmp_clean = no && LI +- fi +- ++ ++php_enable_mbstring=no ++ ++echo $ac_n "checking whether to enable multibyte string support""... $ac_c" 1>&6 ++echo "configure:57973: checking whether to enable multibyte string support" >&5 ++# Check whether --enable-mbstring or --disable-mbstring was given. ++if test "${enable_mbstring+set}" = set; then ++ enableval="$enable_mbstring" ++ PHP_MBSTRING=$enableval ++else + +- case onig in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lonig $LIBS" +- ;; +- esac ++ PHP_MBSTRING=no ++ test "$PHP_ENABLE_ALL" && PHP_MBSTRING=$PHP_ENABLE_ALL - ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6 --echo "configure:56703: checking for stdarg.h" >&5 -+echo "configure:58698: checking for stdarg.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:56713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:58708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -56939,7 +58934,7 @@ EOF - done ++fi - echo $ac_n "checking for onig_init in -lonig""... $ac_c" 1>&6 --echo "configure:56943: checking for onig_init in -lonig" >&5 -+echo "configure:58938: checking for onig_init in -lonig" >&5 - ac_lib_var=`echo onig'_'onig_init | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -56947,7 +58942,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lonig $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:58957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -57184,9 +59179,9 @@ fi - done - echo $ac_n "checking if oniguruma has an invalid entry for KOI8 encoding""... $ac_c" 1>&6 --echo "configure:57188: checking if oniguruma has an invalid entry for KOI8 encoding" >&5 -+echo "configure:59183: checking if oniguruma has an invalid entry for KOI8 encoding" >&5 - cat > conftest.$ac_ext < -@@ -57197,7 +59192,7 @@ return (int)(ONIG_ENCODING_KOI8 + 1); - - ; return 0; } - EOF --if { (eval echo configure:57201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:59196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - - echo "$ac_t""no" 1>&6 -@@ -57495,7 +59490,7 @@ EOF - done +- fi ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_MBSTRING in ++shared,*) ++ PHP_MBSTRING=`echo "$PHP_MBSTRING"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_MBSTRING=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac - echo $ac_n "checking for mbfl_buffer_converter_new in -lmbfl""... $ac_c" 1>&6 --echo "configure:57499: checking for mbfl_buffer_converter_new in -lmbfl" >&5 -+echo "configure:59494: checking for mbfl_buffer_converter_new in -lmbfl" >&5 - ac_lib_var=`echo mbfl'_'mbfl_buffer_converter_new | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -57503,7 +59498,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lmbfl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:59513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -58151,7 +60146,7 @@ fi - php_with_mcrypt=no - echo $ac_n "checking for mcrypt support""... $ac_c" 1>&6 --echo "configure:58155: checking for mcrypt support" >&5 -+echo "configure:60150: checking for mcrypt support" >&5 - # Check whether --with-mcrypt or --without-mcrypt was given. - if test "${with_mcrypt+set}" = set; then - withval="$with_mcrypt" -@@ -58204,9 +60199,9 @@ if test "$PHP_MCRYPT" != "no"; then - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$MCRYPT_DIR/include - echo $ac_n "checking for libmcrypt version""... $ac_c" 1>&6 --echo "configure:58208: checking for libmcrypt version" >&5 -+echo "configure:60203: checking for libmcrypt version" >&5 - cat > conftest.$ac_ext <> confdefs.h <<\EOF +-#define HAVE_ONIG 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 - #include -@@ -58330,7 +60325,7 @@ rm -f conftest* - done +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_onig_onig_init +- +- { echo "configure: error: Problem with oniguruma. Please check config.log for more information." 1>&2; exit 1; } +- +- +-fi ++echo "$ac_t""$ext_output" 1>&6 - echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6 --echo "configure:58334: checking for mcrypt_module_open in -lmcrypt" >&5 -+echo "configure:60329: checking for mcrypt_module_open in -lmcrypt" >&5 - ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -58338,7 +60333,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lmcrypt $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:60348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -58502,7 +60497,7 @@ else - done - echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6 --echo "configure:58506: checking for mcrypt_module_open in -lmcrypt" >&5 -+echo "configure:60501: checking for mcrypt_module_open in -lmcrypt" >&5 - ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -58510,7 +60505,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lmcrypt $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:60520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -58994,7 +60989,7 @@ fi - php_with_mssql=no +- save_old_LDFLAGS=$LDFLAGS +- +- for ac_i in $MBSTRING_SHARED_LIBADD; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi - echo $ac_n "checking for MSSQL support via FreeTDS""... $ac_c" 1>&6 --echo "configure:58998: checking for MSSQL support via FreeTDS" >&5 -+echo "configure:60993: checking for MSSQL support via FreeTDS" >&5 - # Check whether --with-mssql or --without-mssql was given. - if test "${with_mssql+set}" = set; then - withval="$with_mssql" -@@ -59492,7 +61487,7 @@ EOF - fi +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ ++ ++php_enable_mbregex=yes ++ ++echo $ac_n "checking whether to enable multibyte regex support""... $ac_c" 1>&6 ++echo "configure:58017: checking whether to enable multibyte regex support" >&5 ++# Check whether --enable-mbregex or --disable-mbregex was given. ++if test "${enable_mbregex+set}" = set; then ++ enableval="$enable_mbregex" ++ PHP_MBREGEX=$enableval ++else + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++ PHP_MBREGEX=yes + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac - echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6 --echo "configure:59496: checking for dnet_addr in -ldnet_stub" >&5 -+echo "configure:61491: checking for dnet_addr in -ldnet_stub" >&5 - ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -59500,7 +61495,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ldnet_stub $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:61510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -59655,7 +61650,7 @@ fi - php_with_mysql=no ++fi - echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 --echo "configure:59659: checking for MySQL support" >&5 -+echo "configure:61654: checking for MySQL support" >&5 - # Check whether --with-mysql or --without-mysql was given. - if test "${with_mysql+set}" = set; then - withval="$with_mysql" -@@ -59699,7 +61694,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_mysql_sock=no - - echo $ac_n "checking for specified location of the MySQL UNIX socket""... $ac_c" 1>&6 --echo "configure:59703: checking for specified location of the MySQL UNIX socket" >&5 -+echo "configure:61698: checking for specified location of the MySQL UNIX socket" >&5 - # Check whether --with-mysql-sock or --without-mysql-sock was given. - if test "${with_mysql_sock+set}" = set; then - withval="$with_mysql_sock" -@@ -59723,7 +61718,7 @@ if test -z "$PHP_ZLIB_DIR"; then - php_with_zlib_dir=no +- fi +- ;; +- esac - echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 --echo "configure:59727: checking for the location of libz" >&5 -+echo "configure:61722: checking for the location of libz" >&5 - # Check whether --with-zlib-dir or --without-zlib-dir was given. - if test "${with_zlib_dir+set}" = set; then - withval="$with_zlib_dir" -@@ -59897,7 +61892,7 @@ Note that the MySQL client library is no - done ++ext_output=$PHP_MBREGEX ++echo "$ac_t""$ext_output" 1>&6 - echo $ac_n "checking for mysql_close in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:59901: checking for mysql_close in -l$MYSQL_LIBNAME" >&5 -+echo "configure:61896: checking for mysql_close in -l$MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_close | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -59905,7 +61900,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:61915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -60139,7 +62134,7 @@ else - done +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi - echo $ac_n "checking for mysql_error in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:60143: checking for mysql_error in -l$MYSQL_LIBNAME" >&5 -+echo "configure:62138: checking for mysql_error in -l$MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_error | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -60147,7 +62142,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:62157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -60313,7 +62308,7 @@ fi - done +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ ++ ++php_enable_mbregex_backtrack=yes ++ ++echo $ac_n "checking whether to check multibyte regex backtrack""... $ac_c" 1>&6 ++echo "configure:58040: checking whether to check multibyte regex backtrack" >&5 ++# Check whether --enable-mbregex_backtrack or --disable-mbregex_backtrack was given. ++if test "${enable_mbregex_backtrack+set}" = set; then ++ enableval="$enable_mbregex_backtrack" ++ PHP_MBREGEX_BACKTRACK=$enableval ++else + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ PHP_MBREGEX_BACKTRACK=yes + +- fi - echo $ac_n "checking for mysql_errno in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:60317: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5 -+echo "configure:62312: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_errno | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -60321,7 +62316,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:62331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -60526,7 +62521,7 @@ fi ++fi - if test "$PHP_MYSQL" != "no"; then - echo $ac_n "checking for MySQL UNIX socket location""... $ac_c" 1>&6 --echo "configure:60530: checking for MySQL UNIX socket location" >&5 -+echo "configure:62525: checking for MySQL UNIX socket location" >&5 - if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then - MYSQL_SOCK=$PHP_MYSQL_SOCK - cat >> confdefs.h <&6 --echo "configure:60903: checking for MySQLi support" >&5 -+echo "configure:62898: checking for MySQLi support" >&5 - # Check whether --with-mysqli or --without-mysqli was given. - if test "${with_mysqli+set}" = set; then - withval="$with_mysqli" -@@ -60943,7 +62938,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_embedded_mysqli=no - - echo $ac_n "checking whether to enable embedded MySQLi support""... $ac_c" 1>&6 --echo "configure:60947: checking whether to enable embedded MySQLi support" >&5 -+echo "configure:62942: checking whether to enable embedded MySQLi support" >&5 - # Check whether --enable-embedded_mysqli or --disable-embedded_mysqli was given. - if test "${enable_embedded_mysqli+set}" = set; then - enableval="$enable_embedded_mysqli" -@@ -61094,7 +63089,7 @@ EOF - done +- fi +- +- fi - echo $ac_n "checking for mysql_set_server_option in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 --echo "configure:61098: checking for mysql_set_server_option in -l$MYSQL_LIB_NAME" >&5 -+echo "configure:63093: checking for mysql_set_server_option in -l$MYSQL_LIB_NAME" >&5 - ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_server_option | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -61102,7 +63097,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIB_NAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:63112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -61361,7 +63356,7 @@ EOF - done +- ;; +- esac +- done ++ext_output=$PHP_MBREGEX_BACKTRACK ++echo "$ac_t""$ext_output" 1>&6 - echo $ac_n "checking for mysql_set_character_set in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 --echo "configure:61365: checking for mysql_set_character_set in -l$MYSQL_LIB_NAME" >&5 -+echo "configure:63360: checking for mysql_set_character_set in -l$MYSQL_LIB_NAME" >&5 - ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_character_set | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -61369,7 +63364,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIB_NAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:63379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -61524,7 +63519,7 @@ fi - done +- echo $ac_n "checking if oniguruma has an invalid entry for KOI8 encoding""... $ac_c" 1>&6 +-echo "configure:57188: checking if oniguruma has an invalid entry for KOI8 encoding" >&5 +- cat > conftest.$ac_ext <&6 --echo "configure:61528: checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME" >&5 -+echo "configure:63523: checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME" >&5 - ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_stmt_next_result | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -61532,7 +63527,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$MYSQL_LIB_NAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:63542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +-#include +- +-int main() { + +-return (int)(ONIG_ENCODING_KOI8 + 1); +- +-; return 0; } +-EOF +-if { (eval echo configure:57201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- +- echo "$ac_t""no" 1>&6 +- ++ ++ ++php_with_libmbfl=no ++ ++echo $ac_n "checking for external libmbfl""... $ac_c" 1>&6 ++echo "configure:58063: checking for external libmbfl" >&5 ++# Check whether --with-libmbfl or --without-libmbfl was given. ++if test "${with_libmbfl+set}" = set; then ++ withval="$with_libmbfl" ++ PHP_LIBMBFL=$withval else -@@ -61947,7 +63942,7 @@ fi - php_with_oci8=no +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* + +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define PHP_ONIG_BAD_KOI8_ENTRY 1 +-EOF ++ PHP_LIBMBFL=no ++ - echo $ac_n "checking for Oracle (OCI8) support""... $ac_c" 1>&6 --echo "configure:61951: checking for Oracle (OCI8) support" >&5 -+echo "configure:63946: checking for Oracle (OCI8) support" >&5 - # Check whether --with-oci8 or --without-oci8 was given. - if test "${with_oci8+set}" = set; then - withval="$with_oci8" -@@ -61995,7 +63990,7 @@ if test "$PHP_OCI8" != "no"; then +- + fi +-rm -f conftest* +- LDFLAGS=$save_old_LDFLAGS +- fi +- +- +- PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DONIG_ESCAPE_UCHAR_COLLISION=1" - - echo $ac_n "checking PHP version""... $ac_c" 1>&6 --echo "configure:61999: checking PHP version" >&5 -+echo "configure:63994: checking PHP version" >&5 +- +- PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DUChar=OnigUChar" - tmp_version=$PHP_VERSION - if test -z "$tmp_version"; then -@@ -62027,7 +64022,7 @@ echo "configure:61999: checking PHP vers ++ext_output=$PHP_LIBMBFL ++echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking size of long int""... $ac_c" 1>&6 --echo "configure:62031: checking size of long int" >&5 -+echo "configure:64026: checking size of long int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -62035,18 +64030,19 @@ else - ac_cv_sizeof_long_int=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long int)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:62050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:64046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_long_int=`cat conftestval` - else -@@ -62066,7 +64062,7 @@ EOF +- cat >> confdefs.h <<\EOF +-#define HAVE_MBREGEX 1 +-EOF - echo $ac_n "checking checking if we're on a 64-bit platform""... $ac_c" 1>&6 --echo "configure:62070: checking checking if we're on a 64-bit platform" >&5 -+echo "configure:64066: checking checking if we're on a 64-bit platform" >&5 - if test "$ac_cv_sizeof_long_int" = "4"; then - echo "$ac_t""no" 1>&6 - PHP_OCI8_OH_LIBDIR=lib32 -@@ -62110,7 +64106,7 @@ echo "configure:62070: checking checking - if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then - - echo $ac_n "checking Oracle ORACLE_HOME install directory""... $ac_c" 1>&6 --echo "configure:62114: checking Oracle ORACLE_HOME install directory" >&5 -+echo "configure:64110: checking Oracle ORACLE_HOME install directory" >&5 +- +- PHP_MBSTRING_BASE_SOURCES="$PHP_MBSTRING_BASE_SOURCES php_mbregex.c" - if test "$PHP_OCI8" = "yes"; then - OCI8_DIR=$ORACLE_HOME -@@ -62121,7 +64117,7 @@ echo "configure:62114: checking Oracle O +- +- PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS php_mbregex.h php_onig_compat.h" - - echo $ac_n "checking ORACLE_HOME library validity""... $ac_c" 1>&6 --echo "configure:62125: checking ORACLE_HOME library validity" >&5 -+echo "configure:64121: checking ORACLE_HOME library validity" >&5 - if test ! -d "$OCI8_DIR"; then - { echo "configure: error: ${OCI8_DIR} is not a directory" 1>&2; exit 1; } - fi -@@ -62462,7 +64458,7 @@ echo "configure:62125: checking ORACLE_H +- fi ++php_with_onig=no - - echo $ac_n "checking Oracle version""... $ac_c" 1>&6 --echo "configure:62466: checking Oracle version" >&5 -+echo "configure:64462: checking Oracle version" >&5 - if test -s "$OCI8_DIR/orainst/unix.rgs"; then - OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/ */:/g' | cut -d: -f 6 | cut -c 2-4` - test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 -@@ -62592,7 +64588,7 @@ echo "configure:62466: checking Oracle v - done +- fi ++echo $ac_n "checking for external oniguruma""... $ac_c" 1>&6 ++echo "configure:58086: checking for external oniguruma" >&5 ++# Check whether --with-onig or --without-onig was given. ++if test "${with_onig+set}" = set; then ++ withval="$with_onig" ++ PHP_ONIG=$withval ++else ++ ++ PHP_ONIG=no + +- +- if test "$PHP_LIBMBFL" = "yes" || test "$PHP_LIBMBFL" = "no"; then +- +- PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl" - echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6 --echo "configure:62596: checking for OCIEnvNlsCreate in -lclntsh" >&5 -+echo "configure:64592: checking for OCIEnvNlsCreate in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -62600,7 +64596,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:64611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -63048,7 +65044,7 @@ EOF - else - - echo $ac_n "checking Oracle Instant Client directory""... $ac_c" 1>&6 --echo "configure:63052: checking Oracle Instant Client directory" >&5 -+echo "configure:65048: checking Oracle Instant Client directory" >&5 +- +- PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/mbfl" ++fi - if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` -@@ -63061,7 +65057,7 @@ echo "configure:63052: checking Oracle I - OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT +- +- PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/filters" - echo $ac_n "checking Oracle Instant Client SDK header directory""... $ac_c" 1>&6 --echo "configure:63065: checking Oracle Instant Client SDK header directory" >&5 -+echo "configure:65061: checking Oracle Instant Client SDK header directory" >&5 +- +- PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/nls" ++ext_output=$PHP_ONIG ++echo "$ac_t""$ext_output" 1>&6 - OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib/*$!/usr/include/oracle/\1/client\2!'` +- +- PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl" -@@ -63270,7 +65266,7 @@ echo "configure:63065: checking Oracle I +- +- PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl/mbfl" - - echo $ac_n "checking Oracle Instant Client version""... $ac_c" 1>&6 --echo "configure:63274: checking Oracle Instant Client version" >&5 -+echo "configure:65270: checking Oracle Instant Client version" >&5 - if test -f $PHP_OCI8_INSTANT_CLIENT/libnnz11.$SHLIB_SUFFIX_NAME; then - if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then - if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then -@@ -63749,7 +65745,7 @@ esac - - if test "$PHP_ADABAS" != "no"; then - echo $ac_n "checking for Adabas support""... $ac_c" 1>&6 --echo "configure:63753: checking for Adabas support" >&5 -+echo "configure:65749: checking for Adabas support" >&5 - if test "$PHP_ADABAS" = "yes"; then - PHP_ADABAS=/usr/local - fi -@@ -63952,7 +65948,7 @@ esac +- +- PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS libmbfl/config.h" - if test "$PHP_SAPDB" != "no"; then - echo $ac_n "checking for SAP DB support""... $ac_c" 1>&6 --echo "configure:63956: checking for SAP DB support" >&5 -+echo "configure:65952: checking for SAP DB support" >&5 - if test "$PHP_SAPDB" = "yes"; then - PHP_SAPDB=/usr/local - fi -@@ -64085,7 +66081,7 @@ esac ++if test "$PHP_MBSTRING" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_MBSTRING 1 ++EOF - if test "$PHP_SOLID" != "no"; then - echo $ac_n "checking for Solid support""... $ac_c" 1>&6 --echo "configure:64089: checking for Solid support" >&5 -+echo "configure:66085: checking for Solid support" >&5 - if test "$PHP_SOLID" = "yes"; then - PHP_SOLID=/usr/local/solid - fi -@@ -64112,7 +66108,7 @@ EOF - echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking Solid library file""... $ac_c" 1>&6 --echo "configure:64116: checking Solid library file" >&5 -+echo "configure:66112: checking Solid library file" >&5 - ac_solid_uname_r=`uname -r 2>/dev/null` - ac_solid_uname_s=`uname -s 2>/dev/null` - case $ac_solid_uname_s in -@@ -64233,7 +66229,7 @@ esac - - if test "$PHP_IBM_DB2" != "no"; then - echo $ac_n "checking for IBM DB2 support""... $ac_c" 1>&6 --echo "configure:64237: checking for IBM DB2 support" >&5 -+echo "configure:66233: checking for IBM DB2 support" >&5 - if test "$PHP_IBM_DB2" = "yes"; then - ODBC_INCDIR=/home/db2inst1/sqllib/include - ODBC_LIBDIR=/home/db2inst1/sqllib/lib -@@ -64264,7 +66260,7 @@ fi - - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:66275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - LIBS=$old_LIBS -@@ -64356,7 +66352,7 @@ esac +- PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h" ++ if test "$PHP_MBREGEX" = "yes"; then ++ if test "$PHP_ONIG" = "yes" || test "$PHP_ONIG" = "no"; then ++ if test "$PHP_MBREGEX_BACKTRACK" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define USE_COMBINATION_EXPLOSION_CHECK 1 ++EOF - if test "$PHP_ODBCROUTER" != "no"; then - echo $ac_n "checking for ODBCRouter.com support""... $ac_c" 1>&6 --echo "configure:64360: checking for ODBCRouter.com support" >&5 -+echo "configure:66356: checking for ODBCRouter.com support" >&5 - if test "$PHP_ODBCROUTER" = "yes"; then - PHP_ODBCROUTER=/usr - fi -@@ -64420,7 +66416,7 @@ esac +- else +- for inc in include include/mbfl-1.0 include/mbfl; do +- if test -f "$PHP_LIBMBFL/$inc/mbfilter.h"; then +- PHP_LIBMBFL_INCLUDE="$inc" +- break + fi +- done +- +- if test -z "$PHP_LIBMBFL_INCLUDE"; then +- { echo "configure: error: mbfilter.h not found. Please reinstall libmbfl library." 1>&2; exit 1; } +- else +- +- if test "$PHP_LIBMBFL_INCLUDE" != "/usr/include"; then +- +- if test -z "$PHP_LIBMBFL_INCLUDE" || echo "$PHP_LIBMBFL_INCLUDE" | grep '^/' >/dev/null ; then +- ai_p=$PHP_LIBMBFL_INCLUDE +- else +- +- ep_dir="`echo $PHP_LIBMBFL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL_INCLUDE\"`" +- fi - if test "$PHP_EMPRESS" != "no"; then - echo $ac_n "checking for Empress support""... $ac_c" 1>&6 --echo "configure:64424: checking for Empress support" >&5 -+echo "configure:66420: checking for Empress support" >&5 - if test "$PHP_EMPRESS" = "yes"; then - ODBC_INCDIR=$EMPRESSPATH/include/odbc - ODBC_LIBDIR=$EMPRESSPATH/shlib -@@ -64438,7 +66434,7 @@ EOF - echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking Empress library file""... $ac_c" 1>&6 --echo "configure:64442: checking Empress library file" >&5 -+echo "configure:66438: checking Empress library file" >&5 - ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` - if test ! -f $ODBC_LIBS; then - ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` -@@ -64494,7 +66490,7 @@ esac - - if test "$PHP_EMPRESS_BCS" != "no"; then - echo $ac_n "checking for Empress local access support""... $ac_c" 1>&6 --echo "configure:64498: checking for Empress local access support" >&5 -+echo "configure:66494: checking for Empress local access support" >&5 - if test "$PHP_EMPRESS_BCS" = "yes"; then - ODBC_INCDIR=$EMPRESSPATH/include/odbc - ODBC_LIBDIR=$EMPRESSPATH/shlib -@@ -64528,7 +66524,7 @@ EOF - echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking Empress local access library file""... $ac_c" 1>&6 --echo "configure:64532: checking Empress local access library file" >&5 -+echo "configure:66528: checking Empress local access library file" >&5 - ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` - if test ! -f $ODBCBCS_LIBS; then - ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` -@@ -64584,7 +66580,7 @@ esac - - if test "$PHP_BIRDSTEP" != "no"; then - echo $ac_n "checking for Birdstep support""... $ac_c" 1>&6 --echo "configure:64588: checking for Birdstep support" >&5 -+echo "configure:66584: checking for Birdstep support" >&5 - if test "$PHP_BIRDSTEP" = "yes"; then - ODBC_INCDIR=/usr/local/birdstep/include - ODBC_LIBDIR=/usr/local/birdstep/lib -@@ -64696,7 +66692,7 @@ esac - - if test "$PHP_CUSTOM_ODBC" != "no"; then - echo $ac_n "checking for a custom ODBC support""... $ac_c" 1>&6 --echo "configure:64700: checking for a custom ODBC support" >&5 -+echo "configure:66696: checking for a custom ODBC support" >&5 - if test "$PHP_CUSTOM_ODBC" = "yes"; then - PHP_CUSTOM_ODBC=/usr/local - fi -@@ -64760,7 +66756,7 @@ esac +- ++ echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 ++echo "configure:58127: checking for variable length prototypes and stdarg.h" >&5 ++if eval "test \"`echo '$''{'php_cv_mbstring_stdarg'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ if test "$cross_compiling" = yes; then + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PHP_LIBMBFL/$PHP_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else ++ case $host_alias in ++ *netware*) ++ php_cv_mbstring_stdarg=yes ++ ;; ++ *) ++ php_cv_mbstring_stdarg=no ++ ;; ++ esac + +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++else ++ cat > conftest.$ac_ext <&6 --echo "configure:64764: checking for iODBC support" >&5 -+echo "configure:66760: checking for iODBC support" >&5 - if test "$PHP_IODBC" = "yes"; then - PHP_IODBC=/usr/local - fi -@@ -64906,7 +66902,7 @@ esac +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else ++#include ++int foo(int x, ...) { ++ va_list va; ++ va_start(va, x); ++ va_arg(va, int); ++ va_arg(va, char *); ++ va_arg(va, double); ++ return 0; ++} ++int main() { return foo(10, "", 3.14); } + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- ++EOF ++if { (eval echo configure:58160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ php_cv_mbstring_stdarg=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ php_cv_mbstring_stdarg=no ++fi ++rm -fr conftest* ++fi - if test "$PHP_ESOOB" != "no"; then - echo $ac_n "checking for Easysoft ODBC-ODBC Bridge support""... $ac_c" 1>&6 --echo "configure:64910: checking for Easysoft ODBC-ODBC Bridge support" >&5 -+echo "configure:66906: checking for Easysoft ODBC-ODBC Bridge support" >&5 - if test "$PHP_ESOOB" = "yes"; then - PHP_ESOOB=/usr/local/easysoft/oob/client - fi -@@ -64970,7 +66966,7 @@ esac +- fi +- +- fi ++ ++fi - if test "$PHP_UNIXODBC" != "no"; then - echo $ac_n "checking for unixODBC support""... $ac_c" 1>&6 --echo "configure:64974: checking for unixODBC support" >&5 -+echo "configure:66970: checking for unixODBC support" >&5 - if test "$PHP_UNIXODBC" = "yes"; then - PHP_UNIXODBC=/usr/local - fi -@@ -65039,7 +67035,7 @@ esac +- ;; +- esac +- done ++echo "$ac_t""$php_cv_mbstring_stdarg" 1>&6 - if test "$PHP_DBMAKER" != "no"; then - echo $ac_n "checking for DBMaker support""... $ac_c" 1>&6 --echo "configure:65043: checking for DBMaker support" >&5 -+echo "configure:67039: checking for DBMaker support" >&5 - if test "$PHP_DBMAKER" = "yes"; then - # find dbmaker's home directory - DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'` -@@ -65601,7 +67597,7 @@ fi - php_enable_pcntl=no - - echo $ac_n "checking whether to enable pcntl support""... $ac_c" 1>&6 --echo "configure:65605: checking whether to enable pcntl support" >&5 -+echo "configure:67601: checking whether to enable pcntl support" >&5 - # Check whether --enable-pcntl or --disable-pcntl was given. - if test "${enable_pcntl+set}" = set; then - enableval="$enable_pcntl" -@@ -65645,12 +67641,12 @@ if test "$PHP_PCNTL" != "no"; then - for ac_func in fork - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:65649: checking for $ac_func" >&5 -+echo "configure:67645: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "checking for mbfl_buffer_converter_new in -lmbfl""... $ac_c" 1>&6 +-echo "configure:57499: checking for mbfl_buffer_converter_new in -lmbfl" >&5 +-ac_lib_var=`echo mbfl'_'mbfl_buffer_converter_new | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ for ac_hdr in stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h stdarg.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:58181: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < EOF --if { (eval echo configure:65677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:67673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:57518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:58191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -65704,12 +67700,12 @@ done - for ac_func in waitpid - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:65708: checking for $ac_func" >&5 -+echo "configure:67704: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +- eval "ac_cv_lib_$ac_lib_var=yes" ++ eval "ac_cv_header_$ac_safe=yes" else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:67732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -65763,12 +67759,12 @@ done - for ac_func in sigaction - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:65767: checking for $ac_func" >&5 -+echo "configure:67763: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:67791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -65822,12 +67818,12 @@ done - for ac_func in getpriority setpriority wait3 sigprocmask sigwaitinfo sigtimedwait - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:65826: checking for $ac_func" >&5 -+echo "configure:67822: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- if test "$ext_shared" = "yes"; then +- MBSTRING_SHARED_LIBADD="-lmbfl $MBSTRING_SHARED_LIBADD" +- if test -n "$PHP_LIBMBFL/$PHP_LIBDIR"; then +- +- if test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_LIBMBFL/$PHP_LIBDIR" || echo "$PHP_LIBMBFL/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_LIBMBFL/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PHP_LIBMBFL/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- MBSTRING_SHARED_LIBADD="-L$ai_p $MBSTRING_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MBSTRING_SHARED_LIBADD="$ld_runpath_switch$ai_p $MBSTRING_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done - ; return 0; } - EOF --if { (eval echo configure:65854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:67850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -66175,7 +68171,7 @@ fi - php_enable_pdo=yes ++ echo $ac_n "checking size of int""... $ac_c" 1>&6 ++echo "configure:58218: checking size of int" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_int=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(int)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:58238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_int=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_int=0 ++fi ++rm -fr conftest* ++fi - echo $ac_n "checking whether to enable PDO support""... $ac_c" 1>&6 --echo "configure:66179: checking whether to enable PDO support" >&5 -+echo "configure:68175: checking whether to enable PDO support" >&5 - # Check whether --enable-pdo or --disable-pdo was given. - if test "${enable_pdo+set}" = set; then - enableval="$enable_pdo" -@@ -66609,7 +68605,7 @@ fi - php_with_pdo_dblib=no - - echo $ac_n "checking for PDO_DBLIB support via FreeTDS""... $ac_c" 1>&6 --echo "configure:66613: checking for PDO_DBLIB support via FreeTDS" >&5 -+echo "configure:68609: checking for PDO_DBLIB support via FreeTDS" >&5 - # Check whether --with-pdo-dblib or --without-pdo-dblib was given. - if test "${with_pdo_dblib+set}" = set; then - withval="$with_pdo_dblib" -@@ -66826,13 +68822,13 @@ if test "$PHP_PDO_DBLIB" != "no"; then - - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:66830: checking for PDO includes" >&5 -+echo "configure:68826: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:66836: checking for PDO includes" >&5 -+echo "configure:68832: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -67146,7 +69142,7 @@ EOF - fi +- fi +- +- fi ++fi ++echo "$ac_t""$ac_cv_sizeof_int" 1>&6 ++cat >> confdefs.h <&6 --echo "configure:67150: checking for dnet_addr in -ldnet_stub" >&5 -+echo "configure:69146: checking for dnet_addr in -ldnet_stub" >&5 - ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -67154,7 +69150,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ldnet_stub $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:69165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -67326,7 +69322,7 @@ fi - php_with_pdo_firebird=no +- fi +- else +- - echo $ac_n "checking for Firebird support for PDO""... $ac_c" 1>&6 --echo "configure:67330: checking for Firebird support for PDO" >&5 -+echo "configure:69326: checking for Firebird support for PDO" >&5 - # Check whether --with-pdo-firebird or --without-pdo-firebird was given. - if test "${with_pdo_firebird+set}" = set; then - withval="$with_pdo_firebird" -@@ -67480,7 +69476,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; the - done +- if test -n "$PHP_LIBMBFL/$PHP_LIBDIR"; then +- +- if test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_LIBMBFL/$PHP_LIBDIR" || echo "$PHP_LIBMBFL/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_LIBMBFL/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PHP_LIBMBFL/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/$PHP_LIBDIR\"`" +- fi ++ echo $ac_n "checking size of short""... $ac_c" 1>&6 ++echo "configure:58258: checking size of short" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_short=2 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(short)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:58278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_short=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_short=0 ++fi ++rm -fr conftest* ++fi - echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6 --echo "configure:67484: checking for isc_detach_database in -lfbclient" >&5 -+echo "configure:69480: checking for isc_detach_database in -lfbclient" >&5 - ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -67488,7 +69484,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lfbclient $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:69499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -67626,7 +69622,7 @@ else - done +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++fi ++echo "$ac_t""$ac_cv_sizeof_short" 1>&6 ++cat >> confdefs.h <&6 --echo "configure:67630: checking for isc_detach_database in -lgds" >&5 -+echo "configure:69626: checking for isc_detach_database in -lgds" >&5 - ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -67634,7 +69630,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lgds $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:69645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -67772,7 +69768,7 @@ else - done - echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6 --echo "configure:67776: checking for isc_detach_database in -lib_util" >&5 -+echo "configure:69772: checking for isc_detach_database in -lib_util" >&5 - ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -67780,7 +69776,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lib_util $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:69791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -67836,13 +69832,13 @@ fi - - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:67840: checking for PDO includes" >&5 -+echo "configure:69836: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:67846: checking for PDO includes" >&5 -+echo "configure:69842: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -68314,7 +70310,7 @@ fi - php_with_pdo_mysql=no +- +- fi ++ echo $ac_n "checking size of long""... $ac_c" 1>&6 ++echo "configure:58298: checking size of long" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_long=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(long)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:58318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_long=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_long=0 ++fi ++rm -fr conftest* ++fi - echo $ac_n "checking for MySQL support for PDO""... $ac_c" 1>&6 --echo "configure:68318: checking for MySQL support for PDO" >&5 -+echo "configure:70314: checking for MySQL support for PDO" >&5 - # Check whether --with-pdo-mysql or --without-pdo-mysql was given. - if test "${with_pdo_mysql+set}" = set; then - withval="$with_pdo_mysql" -@@ -68359,7 +70355,7 @@ if test -z "$PHP_ZLIB_DIR"; then - php_with_zlib_dir=no +- fi +- +- +- case mbfl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lmbfl $LIBS" +- ;; +- esac ++fi ++echo "$ac_t""$ac_cv_sizeof_long" 1>&6 ++cat >> confdefs.h <&6 --echo "configure:68363: checking for the location of libz" >&5 -+echo "configure:70359: checking for the location of libz" >&5 - # Check whether --with-zlib-dir or --without-zlib-dir was given. - if test "${with_zlib_dir+set}" = set; then - withval="$with_zlib_dir" -@@ -68423,14 +70419,14 @@ EOF ++ echo $ac_n "checking for working const""... $ac_c" 1>&6 ++echo "configure:58338: checking for working const" >&5 ++if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext <&6 --echo "configure:68427: checking for mysql_config" >&5 -+echo "configure:70423: checking for mysql_config" >&5 - if test -n "$PDO_MYSQL_CONFIG"; then - echo "$ac_t""$PDO_MYSQL_CONFIG" 1>&6 - if test "x$SED" = "x"; then - # Extract the first word of "sed", so it can be a program name with args. - set dummy sed; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:68434: checking for $ac_word" >&5 -+echo "configure:70430: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -68474,7 +70470,7 @@ fi - elif test -n "$PDO_MYSQL_DIR"; then - echo "$ac_t""not found" 1>&6 - echo $ac_n "checking for mysql install under $PDO_MYSQL_DIR""... $ac_c" 1>&6 --echo "configure:68478: checking for mysql install under $PDO_MYSQL_DIR" >&5 -+echo "configure:70474: checking for mysql install under $PDO_MYSQL_DIR" >&5 - if test -r $PDO_MYSQL_DIR/include/mysql; then - PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql - else -@@ -68628,7 +70624,7 @@ echo "configure:68478: checking for mysq - done ++int main() { - echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:68632: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 -+echo "configure:70628: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -68636,7 +70632,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:70647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -69000,7 +70996,7 @@ else - done +- fi ++/* Ultrix mips cc rejects this. */ ++typedef int charset[2]; const charset x; ++/* SunOS 4.1.1 cc rejects this. */ ++char const *const *ccp; ++char **p; ++/* NEC SVR4.0.2 mips cc rejects this. */ ++struct point {int x, y;}; ++static struct point const zero = {0,0}; ++/* AIX XL C 1.02.0.0 rejects this. ++ It does not let you subtract one const X* pointer from another in an arm ++ of an if-expression whose if-part is not a constant expression */ ++const char *g = "string"; ++ccp = &g + (g ? g-g : 0); ++/* HPUX 7.0 cc rejects these. */ ++++ccp; ++p = (char**) ccp; ++ccp = (char const *const *) p; ++{ /* SCO 3.2v4 cc rejects this. */ ++ char *t; ++ char const *s = 0 ? (char *) 0 : (char const *) 0; + ++ *t++ = 0; ++} ++{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ ++ int x[] = {25, 17}; ++ const int *foo = &x[0]; ++ ++foo; ++} ++{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ ++ typedef const int *iptr; ++ iptr p = 0; ++ ++p; ++} ++{ /* AIX XL C 1.02.0.0 rejects this saying ++ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ ++ struct s { int j; const int *ap[3]; }; ++ struct s *b; b->j = 5; ++} ++{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ ++ const int foo = 10; ++} - echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:69004: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 -+echo "configure:71000: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -69008,7 +71004,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:71019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +- +- ++; return 0; } ++EOF ++if { (eval echo configure:58392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_c_const=yes else -@@ -69174,7 +71170,7 @@ fi - done +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_mbfl_mbfl_buffer_converter_new +- +- { echo "configure: error: Problem with libmbfl. Please check config.log for more information." 1>&2; exit 1; } +- +- ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_c_const=no ++fi ++rm -f conftest* + fi - echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 --echo "configure:69178: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 -+echo "configure:71174: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 - ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -69182,7 +71178,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:71193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -69367,12 +71363,12 @@ fi - for ac_func in mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:69371: checking for $ac_func" >&5 -+echo "configure:71367: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 ++if test $ac_cv_c_const = no; then ++ cat >> confdefs.h <<\EOF ++#define const ++EOF - ; return 0; } - EOF --if { (eval echo configure:69399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:71395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -69425,13 +71421,13 @@ done - - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:69429: checking for PDO includes" >&5 -+echo "configure:71425: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:69435: checking for PDO includes" >&5 -+echo "configure:71431: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -69816,7 +71812,7 @@ SUPPORTED_LIB_VERS="9.0 10.1 11.1" # Th - php_with_pdo_oci=no +- +- +- ext_builddir=ext/mbstring +- ext_srcdir=$abs_srcdir/ext/mbstring ++fi - echo $ac_n "checking Oracle OCI support for PDO""... $ac_c" 1>&6 --echo "configure:69820: checking Oracle OCI support for PDO" >&5 -+echo "configure:71816: checking Oracle OCI support for PDO" >&5 - # Check whether --with-pdo-oci or --without-pdo-oci was given. - if test "${with_pdo_oci+set}" = set; then - withval="$with_pdo_oci" -@@ -69863,7 +71859,7 @@ if test "$PHP_PDO_OCI" != "no"; then - fi +- ac_extra=`echo "$PHP_MBSTRING_CFLAGS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ++echo "configure:58413: checking whether time.h and sys/time.h may both be included" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++#include ++#include ++int main() { ++struct tm *tp; ++; return 0; } ++EOF ++if { (eval echo configure:58427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_header_time=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_header_time=no ++fi ++rm -f conftest* ++fi - echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6 --echo "configure:69867: checking Oracle Install-Dir" >&5 -+echo "configure:71863: checking Oracle Install-Dir" >&5 - if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then - PDO_OCI_DIR=$ORACLE_HOME - else -@@ -69872,7 +71868,7 @@ echo "configure:69867: checking Oracle I - echo "$ac_t""$PHP_PDO_OCI" 1>&6 +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_MBSTRING_SHARED=no +- +- +- case ext/mbstring in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++echo "$ac_t""$ac_cv_header_time" 1>&6 ++if test $ac_cv_header_time = yes; then ++ cat >> confdefs.h <<\EOF ++#define TIME_WITH_SYS_TIME 1 ++EOF - echo $ac_n "checking if that is sane""... $ac_c" 1>&6 --echo "configure:69876: checking if that is sane" >&5 -+echo "configure:71872: checking if that is sane" >&5 - if test -z "$PDO_OCI_DIR"; then - { echo "configure: error: - You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_HOME. -@@ -69885,7 +71881,7 @@ You need to tell me where to find your O - PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`" - PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`" - echo $ac_n "checking for oci.h""... $ac_c" 1>&6 --echo "configure:69889: checking for oci.h" >&5 -+echo "configure:71885: checking for oci.h" >&5 - if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then - - if test "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" != "/usr/include"; then -@@ -70034,7 +72030,7 @@ echo "configure:69889: checking for oci. - else - - echo $ac_n "checking size of long int""... $ac_c" 1>&6 --echo "configure:70038: checking size of long int" >&5 -+echo "configure:72034: checking size of long int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -70042,18 +72038,19 @@ else - ac_cv_sizeof_long_int=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long int)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:70057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:72054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_long_int=`cat conftestval` - else -@@ -70073,7 +72070,7 @@ EOF +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++fi ++ ++ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works ++# for constant arguments. Useless! ++echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ++echo "configure:58450: checking for working alloca.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++int main() { ++char *p = alloca(2 * sizeof(int)); ++; return 0; } ++EOF ++if { (eval echo configure:58462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ ac_cv_header_alloca_h=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_header_alloca_h=no ++fi ++rm -f conftest* ++fi ++echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 ++if test $ac_cv_header_alloca_h = yes; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ALLOCA_H 1 ++EOF - echo $ac_n "checking if we're on a 64-bit platform""... $ac_c" 1>&6 --echo "configure:70077: checking if we're on a 64-bit platform" >&5 -+echo "configure:72074: checking if we're on a 64-bit platform" >&5 - if test "$ac_cv_sizeof_long_int" = "4" ; then - echo "$ac_t""no" 1>&6 - TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" -@@ -70083,7 +72080,7 @@ echo "configure:70077: checking if we're - fi +- old_IFS=$IFS +- for ac_src in $PHP_MBSTRING_SOURCES; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++fi - echo $ac_n "checking OCI8 libraries dir""... $ac_c" 1>&6 --echo "configure:70087: checking OCI8 libraries dir" >&5 -+echo "configure:72084: checking OCI8 libraries dir" >&5 - if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then - PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" - elif test ! -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then -@@ -70450,7 +72447,7 @@ echo "configure:70087: checking OCI8 lib - fi - - echo $ac_n "checking Oracle version""... $ac_c" 1>&6 --echo "configure:70454: checking Oracle version" >&5 -+echo "configure:72451: checking Oracle version" >&5 - for OCI_VER in $SUPPORTED_LIB_VERS; do - if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then - PDO_OCI_VERSION="$OCI_VER" -@@ -70632,7 +72629,7 @@ echo "configure:70454: checking Oracle v - done +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++echo $ac_n "checking for alloca""... $ac_c" 1>&6 ++echo "configure:58483: checking for alloca" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext <&6 --echo "configure:70636: checking for OCIEnvCreate in -lclntsh" >&5 -+echo "configure:72633: checking for OCIEnvCreate in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -70640,7 +72637,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:72652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -70785,7 +72782,7 @@ fi - done +- cat >>Makefile.objects< ++# define alloca _alloca ++# else ++# if HAVE_ALLOCA_H ++# include ++# else ++# ifdef _AIX ++ #pragma alloca ++# else ++# ifndef alloca /* predefined by HP cc +Olibcalls */ ++char *alloca (); ++# endif ++# endif ++# endif ++# endif ++#endif - echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6 --echo "configure:70789: checking for OCIEnvNlsCreate in -lclntsh" >&5 -+echo "configure:72786: checking for OCIEnvNlsCreate in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -70793,7 +72790,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:72805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -70938,7 +72935,7 @@ fi - done - - echo $ac_n "checking for OCILobIsTemporary in -lclntsh""... $ac_c" 1>&6 --echo "configure:70942: checking for OCILobIsTemporary in -lclntsh" >&5 -+echo "configure:72939: checking for OCILobIsTemporary in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -70946,7 +72943,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:72958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -71087,7 +73084,7 @@ else - done ++int main() { ++char *p = (char *) alloca(1); ++; return 0; } ++EOF ++if { (eval echo configure:58516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ ac_cv_func_alloca_works=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_func_alloca_works=no ++fi ++rm -f conftest* ++fi - echo $ac_n "checking for OCILobIsTemporary in -locijdbc8""... $ac_c" 1>&6 --echo "configure:71091: checking for OCILobIsTemporary in -locijdbc8" >&5 -+echo "configure:73088: checking for OCILobIsTemporary in -locijdbc8" >&5 - ac_lib_var=`echo ocijdbc8'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -71095,7 +73092,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-locijdbc8 $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:73107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -71267,7 +73264,7 @@ fi - done +- EXT_STATIC="$EXT_STATIC mbstring" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_MBSTRING_SHARED=yes +- +- case ext/mbstring in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 ++if test $ac_cv_func_alloca_works = yes; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ALLOCA 1 ++EOF - echo $ac_n "checking for OCICollAssign in -lclntsh""... $ac_c" 1>&6 --echo "configure:71271: checking for OCICollAssign in -lclntsh" >&5 -+echo "configure:73268: checking for OCICollAssign in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCICollAssign | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -71275,7 +73272,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:73287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -71420,7 +73417,7 @@ fi - done +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo ++fi - echo $ac_n "checking for OCIStmtFetch2 in -lclntsh""... $ac_c" 1>&6 --echo "configure:71424: checking for OCIStmtFetch2 in -lclntsh" >&5 -+echo "configure:73421: checking for OCIStmtFetch2 in -lclntsh" >&5 - ac_lib_var=`echo clntsh'_'OCIStmtFetch2 | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -71428,7 +73425,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lclntsh $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:73440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -71478,13 +73475,13 @@ fi - - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:71482: checking for PDO includes" >&5 -+echo "configure:73479: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:71488: checking for PDO includes" >&5 -+echo "configure:73485: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -71852,7 +73849,7 @@ fi - php_with_pdo_odbc=no ++if test $ac_cv_func_alloca_works = no; then ++ # The SVR3 libPW and SVR4 libucb both contain incompatible functions ++ # that cause trouble. Some versions do not even contain alloca or ++ # contain a buggy version. If you still want to use their alloca, ++ # use ar to extract alloca.o from them instead of compiling alloca.c. ++ ALLOCA=alloca.${ac_objext} ++ cat >> confdefs.h <<\EOF ++#define C_ALLOCA 1 ++EOF - echo $ac_n "checking for ODBC v3 support for PDO""... $ac_c" 1>&6 --echo "configure:71856: checking for ODBC v3 support for PDO" >&5 -+echo "configure:73853: checking for ODBC v3 support for PDO" >&5 - # Check whether --with-pdo-odbc or --without-pdo-odbc was given. - if test "${with_pdo_odbc+set}" = set; then - withval="$with_pdo_odbc" -@@ -71904,13 +73901,13 @@ if test "$PHP_PDO_ODBC" != "no"; then - - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:71908: checking for PDO includes" >&5 -+echo "configure:73905: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:71914: checking for PDO includes" >&5 -+echo "configure:73911: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -71931,7 +73928,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6 - +- old_IFS=$IFS +- for ac_src in $PHP_MBSTRING_SOURCES; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_mbstring="$shared_objects_mbstring $ac_bdir$ac_obj.lo" - echo $ac_n "checking for selected PDO ODBC flavour""... $ac_c" 1>&6 --echo "configure:71935: checking for selected PDO ODBC flavour" >&5 -+echo "configure:73932: checking for selected PDO ODBC flavour" >&5 +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ++echo "configure:58548: checking whether alloca needs Cray hooks" >&5 ++if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext <>Makefile.objects<&5 | ++ egrep "webecray" >/dev/null 2>&1; then ++ rm -rf conftest* ++ ac_cv_os_cray=yes ++else ++ rm -rf conftest* ++ ac_cv_os_cray=no ++fi ++rm -f conftest* - - echo $ac_n "checking for odbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72014: checking for odbc.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74011: checking for odbc.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/odbc.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72024,7 +74021,7 @@ EOF +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" ++fi - - echo $ac_n "checking for odbcsdk.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72028: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74025: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/odbcsdk.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72038,7 +74035,7 @@ EOF +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmbstring.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmbstring.so '$ext_builddir'/phpmbstring.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMBSTRING, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD)' +- ;; +- esac ++echo "$ac_t""$ac_cv_os_cray" 1>&6 ++if test $ac_cv_os_cray = yes; then ++for ac_func in _getb67 GETB67 getb67; do ++ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:58578: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); - - echo $ac_n "checking for iodbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72042: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74039: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/iodbc.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72052,7 +74049,7 @@ EOF +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmbstring.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmbstring.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mbstring" ++int main() { - - echo $ac_n "checking for sqlunix.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72056: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74053: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sqlunix.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72066,7 +74063,7 @@ EOF +- cat >>Makefile.objects<&6 --echo "configure:72070: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74067: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sqltypes.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72080,7 +74077,7 @@ EOF +-$ext_builddir/phpmbstring.$suffix: \$(shared_objects_mbstring) \$(PHPMBSTRING_SHARED_DEPENDENCIES) +- $link_cmd ++; return 0; } ++EOF ++if { (eval echo configure:58606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi - - echo $ac_n "checking for sqlucode.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72084: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74081: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sqlucode.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72094,7 +74091,7 @@ EOF ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <&6 --echo "configure:72098: checking for sql.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74095: checking for sql.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sql.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72108,7 +74105,7 @@ EOF +- ;; +- *) +- +- install_modules="install-modules" ++ break ++else ++ echo "$ac_t""no" 1>&6 ++fi - - echo $ac_n "checking for isql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72112: checking for isql.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74109: checking for isql.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/isql.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72122,7 +74119,7 @@ EOF +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/mbstring.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(MBSTRING_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/mbstring.so '$ext_builddir'/mbstring.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(MBSTRING, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(MBSTRING_SHARED_LIBADD)' +- ;; +- esac ++done ++fi - - echo $ac_n "checking for sqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72126: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74123: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sqlext.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72136,7 +74133,7 @@ EOF +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/mbstring.$suffix" ++echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ++echo "configure:58633: checking stack direction for C alloca" >&5 ++if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_c_stack_direction=0 ++else ++ cat > conftest.$ac_ext <>Makefile.objects< addr) ? 1 : -1; ++} ++main () ++{ ++ exit (find_stack_direction() < 0); ++} + EOF ++if { (eval echo configure:58660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_c_stack_direction=1 ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_c_stack_direction=-1 ++fi ++rm -fr conftest* ++fi - - echo $ac_n "checking for isqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72140: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74137: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/isqlext.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72150,7 +74147,7 @@ EOF +- ;; +- esac +- cat >> confdefs.h <&6 ++cat >> confdefs.h <&6 --echo "configure:72154: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74151: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/udbcext.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72164,7 +74161,7 @@ EOF +- fi +- fi ++fi - - echo $ac_n "checking for sqlcli1.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72168: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74165: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/sqlcli1.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72178,7 +74175,7 @@ EOF +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_MBSTRING_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/mbstring in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++ echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 ++echo "configure:58682: checking for 8-bit clean memcmp" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_func_memcmp_clean=no ++else ++ cat > conftest.$ac_ext <&6 --echo "configure:72182: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74179: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/LibraryManager.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72192,7 +74189,7 @@ EOF +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++main() ++{ ++ char c0 = 0x40, c1 = 0x80, c2 = 0x81; ++ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1); ++} - - echo $ac_n "checking for cli0core.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72196: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74193: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/cli0core.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72206,7 +74203,7 @@ EOF ++EOF ++if { (eval echo configure:58700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_func_memcmp_clean=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_func_memcmp_clean=no ++fi ++rm -fr conftest* ++fi - - echo $ac_n "checking for cli0ext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72210: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74207: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/cli0ext.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72220,7 +74217,7 @@ EOF +- old_IFS=$IFS +- for ac_src in $PHP_MBSTRING_SOURCES; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++fi - - echo $ac_n "checking for cli0cli.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72224: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74221: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/cli0cli.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72234,7 +74231,7 @@ EOF +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 ++test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" +- cat >>Makefile.objects<&6 ++echo "configure:58719: checking for stdarg.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < + EOF +- done +- +- +- EXT_STATIC="$EXT_STATIC mbstring" +- ;; +- *) +- +- +- case ext/mbstring in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:58729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for cli0defs.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72238: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74235: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/cli0defs.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72248,7 +74245,7 @@ EOF ++ cat >> confdefs.h <<\EOF ++#define HAVE_STDARG_PROTOTYPES 1 ++EOF - - echo $ac_n "checking for cli0env.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 --echo "configure:72252: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5 -+echo "configure:74249: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5 - if test -f "$PDO_ODBC_INCDIR/cli0env.h"; then - php_pdo_have_header=yes - cat >> confdefs.h <<\EOF -@@ -72454,7 +74451,7 @@ EOF - done +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in $PHP_MBSTRING_SOURCES; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++else ++ echo "$ac_t""no" 1>&6 ++fi - echo $ac_n "checking for SQLBindCol in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 --echo "configure:72458: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5 -+echo "configure:74455: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5 - ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLBindCol | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -72462,7 +74459,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$pdo_odbc_def_lib $LIBS" - cat > conftest.$ac_ext <>Makefile.objects<> confdefs.h <<\EOF ++#define PHP_ONIG_BUNDLED 1 EOF --if { (eval echo configure:72477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:74474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -72588,7 +74585,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l - done +- done - echo $ac_n "checking for SQLAllocHandle in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 --echo "configure:72592: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5 -+echo "configure:74589: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5 - ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLAllocHandle | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -72596,7 +74593,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$pdo_odbc_def_lib $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:74608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -72981,7 +74978,7 @@ fi - php_with_pdo_pgsql=no ++ cat >> confdefs.h <<\EOF ++#define HAVE_ONIG 1 ++EOF ++ ++ ++ PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DNOT_RUBY" - echo $ac_n "checking for PostgreSQL support for PDO""... $ac_c" 1>&6 --echo "configure:72985: checking for PostgreSQL support for PDO" >&5 -+echo "configure:74982: checking for PostgreSQL support for PDO" >&5 - # Check whether --with-pdo-pgsql or --without-pdo-pgsql was given. - if test "${with_pdo_pgsql+set}" = set; then - withval="$with_pdo_pgsql" -@@ -73040,7 +75037,7 @@ if test "$PHP_PDO_PGSQL" != "no"; then +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring" +- fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- ++ ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS oniguruma" ++ ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS oniguruma/enc" - echo $ac_n "checking for pg_config""... $ac_c" 1>&6 --echo "configure:73044: checking for pg_config" >&5 -+echo "configure:75041: checking for pg_config" >&5 - for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do - if test -x $i/pg_config; then - PG_CONFIG="$i/pg_config" -@@ -73104,13 +75101,13 @@ EOF +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=mbstring +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ ++ PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES oniguruma" +- fi ++ ++ PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS oniguruma/config.h" - echo $ac_n "checking for openssl dependencies""... $ac_c" 1>&6 --echo "configure:73108: checking for openssl dependencies" >&5 -+echo "configure:75105: checking for openssl dependencies" >&5 - if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then - echo "$ac_t""yes" 1>&6 - # Extract the first word of "pkg-config", so it can be a program name with args. - set dummy pkg-config; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:73114: checking for $ac_word" >&5 -+echo "configure:75111: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -73154,7 +75151,7 @@ fi - old_LDFLAGS=$LDFLAGS - LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" - echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 --echo "configure:73158: checking for PQparameterStatus in -lpq" >&5 -+echo "configure:75155: checking for PQparameterStatus in -lpq" >&5 - ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -73162,7 +75159,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:75174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -73202,7 +75199,7 @@ fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MBSTRING_SHARED_LIBADD" ++ ++ PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES ++ oniguruma/regcomp.c ++ oniguruma/regerror.c ++ oniguruma/regexec.c ++ oniguruma/reggnu.c ++ oniguruma/regparse.c ++ oniguruma/regenc.c ++ oniguruma/regext.c ++ oniguruma/regsyntax.c ++ oniguruma/regtrav.c ++ oniguruma/regversion.c ++ oniguruma/st.c ++ oniguruma/enc/unicode.c ++ oniguruma/enc/ascii.c ++ oniguruma/enc/utf8.c ++ oniguruma/enc/euc_jp.c ++ oniguruma/enc/euc_tw.c ++ oniguruma/enc/euc_kr.c ++ oniguruma/enc/sjis.c ++ oniguruma/enc/iso8859_1.c ++ oniguruma/enc/iso8859_2.c ++ oniguruma/enc/iso8859_3.c ++ oniguruma/enc/iso8859_4.c ++ oniguruma/enc/iso8859_5.c ++ oniguruma/enc/iso8859_6.c ++ oniguruma/enc/iso8859_7.c ++ oniguruma/enc/iso8859_8.c ++ oniguruma/enc/iso8859_9.c ++ oniguruma/enc/iso8859_10.c ++ oniguruma/enc/iso8859_11.c ++ oniguruma/enc/iso8859_13.c ++ oniguruma/enc/iso8859_14.c ++ oniguruma/enc/iso8859_15.c ++ oniguruma/enc/iso8859_16.c ++ oniguruma/enc/koi8.c ++ oniguruma/enc/koi8_r.c ++ oniguruma/enc/big5.c ++ oniguruma/enc/utf16_be.c ++ oniguruma/enc/utf16_le.c ++ oniguruma/enc/utf32_be.c ++ oniguruma/enc/utf32_le.c ++ " ++ ++ PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS oniguruma/oniguruma.h" - echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 --echo "configure:73206: checking for PQprepare in -lpq" >&5 -+echo "configure:75203: checking for PQprepare in -lpq" >&5 - ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -73210,7 +75207,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:75222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -73245,7 +75242,7 @@ else - fi +- for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do ++ else ++ if test ! -f "$PHP_ONIG/include/oniguruma.h"; then ++ { echo "configure: error: oniguruma.h not found in $PHP_ONIG/include" 1>&2; exit 1; } ++ fi ++ ++ if test "$PHP_ONIG/include" != "/usr/include"; then + +- +- $php_shtool mkdir -p $ext_builddir/$dir +- +- +- done +- +- for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do +- +- if test "$ext_srcdir/$dir" != "/usr/include"; then +- +- if test -z "$ext_srcdir/$dir" || echo "$ext_srcdir/$dir" | grep '^/' >/dev/null ; then +- ai_p=$ext_srcdir/$dir +- else +- +- ep_dir="`echo $ext_srcdir/$dir|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ext_srcdir/$dir\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- if test "$ext_builddir/$dir" != "/usr/include"; then +- +- if test -z "$ext_builddir/$dir" || echo "$ext_builddir/$dir" | grep '^/' >/dev/null ; then +- ai_p=$ext_builddir/$dir ++ if test -z "$PHP_ONIG/include" || echo "$PHP_ONIG/include" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ONIG/include + else + +- ep_dir="`echo $ext_builddir/$dir|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_ONIG/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ext_builddir/$dir\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_ONIG/include\"`" + fi - echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 --echo "configure:73249: checking for PQescapeStringConn in -lpq" >&5 -+echo "configure:75246: checking for PQescapeStringConn in -lpq" >&5 - ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -73253,7 +75250,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:75265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -73288,7 +75285,7 @@ else - fi + +@@ -58014,229 +58856,12 @@ EOF - echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 --echo "configure:73292: checking for PQescapeByteaConn in -lpq" >&5 -+echo "configure:75289: checking for PQescapeByteaConn in -lpq" >&5 - ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -73296,7 +75293,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:75308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -73332,7 +75329,7 @@ fi + fi + +- done +- +- if test "$ext_shared" = "no"; then +- +- +- case ext/mbstring in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in $PHP_MBSTRING_BASE_SOURCES; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects< $ext_builddir/$cfg <&6 +-echo "configure:58155: checking for mcrypt support" >&5 +-# Check whether --with-mcrypt or --without-mcrypt was given. +-if test "${with_mcrypt+set}" = set; then +- withval="$with_mcrypt" +- PHP_MCRYPT=$withval +-else +- +- PHP_MCRYPT=no +- test "$PHP_ENABLE_ALL" && PHP_MCRYPT=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_MCRYPT in +-shared,*) +- PHP_MCRYPT=`echo "$PHP_MCRYPT"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_MCRYPT=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_MCRYPT" != "no"; then +- for i in $PHP_MCRYPT /usr/local /usr; do +- test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break +- done +- +- if test -z "$MCRYPT_DIR"; then +- { echo "configure: error: mcrypt.h not found. Please reinstall libmcrypt." 1>&2; exit 1; } +- fi +- +- +- old_CPPFLAGS=$CPPFLAGS +- CPPFLAGS=-I$MCRYPT_DIR/include +- echo $ac_n "checking for libmcrypt version""... $ac_c" 1>&6 +-echo "configure:58208: checking for libmcrypt version" >&5 +- cat > conftest.$ac_ext < +-#if MCRYPT_API_VERSION >= 20021217 +- yes +-#endif +- +-EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "yes" >/dev/null 2>&1; then +- rm -rf conftest* +- +- echo "$ac_t"">= 2.5.6" 1>&6 +- +-else +- rm -rf conftest* +- +- { echo "configure: error: libmcrypt version 2.5.6 or greater required." 1>&2; exit 1; } +- +-fi +-rm -f conftest* +- +- CPPFLAGS=$old_CPPFLAGS +- +- +- + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$MCRYPT_DIR/$PHP_LIBDIR -lltdl +- " ++ -L$PHP_ONIG/$PHP_LIBDIR ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -58329,27 +58954,27 @@ rm -f conftest* + esac + done - echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 --echo "configure:73336: checking for pg_encoding_to_char in -lpq" >&5 -+echo "configure:75333: checking for pg_encoding_to_char in -lpq" >&5 - ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` +- echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6 +-echo "configure:58334: checking for mcrypt_module_open in -lmcrypt" >&5 +-ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for onig_init in -lonig""... $ac_c" 1>&6 ++echo "configure:58959: checking for onig_init in -lonig" >&5 ++ac_lib_var=`echo onig'_'onig_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -73340,7 +75337,7 @@ else + else ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" +-LIBS="-lmcrypt $LIBS" ++LIBS="-lonig $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:75352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:58353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:58978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -73515,13 +75512,13 @@ fi - +@@ -58368,52 +58993,125 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:73519: checking for PDO includes" >&5 -+echo "configure:75516: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else ++ ++ ++ if test "$ext_shared" = "yes"; then ++ MBSTRING_SHARED_LIBADD="-lonig $MBSTRING_SHARED_LIBADD" ++ if test -n "$PHP_ONIG/$PHP_LIBDIR"; then ++ ++ if test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ONIG/$PHP_LIBDIR" || echo "$PHP_ONIG/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ONIG/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_ONIG/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ONIG/$PHP_LIBDIR\"`" ++ fi ++ + ++ if test "$ext_shared" = "yes"; then ++ MBSTRING_SHARED_LIBADD="-L$ai_p $MBSTRING_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MBSTRING_SHARED_LIBADD="$ld_runpath_switch$ai_p $MBSTRING_SHARED_LIBADD" ++ else ++ - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:73525: checking for PDO includes" >&5 -+echo "configure:75522: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -73861,7 +75858,7 @@ fi - php_with_pdo_sqlite=$PHP_PDO +- case ltdl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- MCRYPT_SHARED_LIBADD="-lltdl $MCRYPT_SHARED_LIBADD" +- else ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$PHP_ONIG/$PHP_LIBDIR"; then ++ ++ if test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ONIG/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ONIG/$PHP_LIBDIR" || echo "$PHP_ONIG/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ONIG/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_ONIG/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ONIG/$PHP_LIBDIR\"`" ++ fi ++ ++ + + +- case ltdl in ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case onig in + c|c_r|pthread*) ;; + *) +- LIBS="-lltdl $LIBS" ++ LIBS="-lonig $LIBS" + ;; + esac - echo $ac_n "checking for sqlite 3 support for PDO""... $ac_c" 1>&6 --echo "configure:73865: checking for sqlite 3 support for PDO" >&5 -+echo "configure:75862: checking for sqlite 3 support for PDO" >&5 - # Check whether --with-pdo-sqlite or --without-pdo-sqlite was given. - if test "${with_pdo_sqlite+set}" = set; then - withval="$with_pdo_sqlite" -@@ -73910,13 +75907,13 @@ if test "$PHP_PDO_SQLITE" != "no"; then + +- fi +- ;; +- esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBMCRYPT 1 +-EOF ++ fi + +- ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_ONIG 1 ++EOF ++ ++ - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:73914: checking for PDO includes" >&5 -+echo "configure:75911: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_mcrypt_mcrypt_module_open +- ++ unset ac_cv_lib_onig_onig_init + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$MCRYPT_DIR/$PHP_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes ++ { echo "configure: error: Problem with oniguruma. Please check config.log for more information." 1>&2; exit 1; } ++ - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:73920: checking for PDO includes" >&5 -+echo "configure:75917: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -73945,7 +75942,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6 - PDO_SQLITE_DIR=$PHP_PDO_SQLITE - else # search default path list - echo $ac_n "checking for sqlite3 files in default path""... $ac_c" 1>&6 --echo "configure:73949: checking for sqlite3 files in default path" >&5 -+echo "configure:75946: checking for sqlite3 files in default path" >&5 - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - PDO_SQLITE_DIR=$i -@@ -74091,7 +76088,7 @@ echo "configure:73949: checking for sqli +- for ac_i in $ac_stuff; do ++fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ++ for ac_i in $MBSTRING_SHARED_LIBADD; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +@@ -58501,131 +59199,294 @@ else + esac done - echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6 --echo "configure:74095: checking for $LIBSYMBOL in -l$LIBNAME" >&5 -+echo "configure:76092: checking for $LIBSYMBOL in -l$LIBNAME" >&5 - ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -74099,7 +76096,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$LIBNAME $LIBS" - cat > conftest.$ac_ext <&6 +-echo "configure:58506: checking for mcrypt_module_open in -lmcrypt" >&5 +-ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lmcrypt $LIBS" +-cat > conftest.$ac_ext <&6 ++echo "configure:59204: checking if oniguruma has an invalid entry for KOI8 encoding" >&5 ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:76111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -74340,7 +76337,7 @@ fi - done +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char mcrypt_module_open(); - echo $ac_n "checking for sqlite3_key in -lsqlite3""... $ac_c" 1>&6 --echo "configure:74344: checking for sqlite3_key in -lsqlite3" >&5 -+echo "configure:76341: checking for sqlite3_key in -lsqlite3" >&5 - ac_lib_var=`echo sqlite3'_'sqlite3_key | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -74348,7 +76345,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsqlite3 $LIBS" - cat > conftest.$ac_ext < ++ + int main() { +-mcrypt_module_open() ++ ++return (int)(ONIG_ENCODING_KOI8 + 1); ++ ; return 0; } EOF --if { (eval echo configure:74363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:76360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:58525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:59217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75100,12 +77097,12 @@ but you've either not enabled sqlite3, o - for ac_func in usleep nanosleep - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:75104: checking for $ac_func" >&5 -+echo "configure:77101: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++ echo "$ac_t""no" 1>&6 ++ else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -75156,17 +77153,17 @@ done - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:75160: checking for $ac_hdr" >&5 -+echo "configure:77157: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBMCRYPT 1 ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define PHP_ONIG_BAD_KOI8_ENTRY 1 EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:75170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:77167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -75290,7 +77287,7 @@ done - done - echo $ac_n "checking for fdatasync in -lrt""... $ac_c" 1>&6 --echo "configure:75294: checking for fdatasync in -lrt" >&5 -+echo "configure:77291: checking for fdatasync in -lrt" >&5 - ac_lib_var=`echo rt'_'fdatasync | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75298,7 +77295,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lrt $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75390,7 +77387,7 @@ fi - php_with_pgsql=no +- +- +-else +- echo "$ac_t""no" 1>&6 ++ ++fi ++rm -f conftest* ++ LDFLAGS=$save_old_LDFLAGS ++ fi - echo $ac_n "checking for PostgreSQL support""... $ac_c" 1>&6 --echo "configure:75394: checking for PostgreSQL support" >&5 -+echo "configure:77391: checking for PostgreSQL support" >&5 - # Check whether --with-pgsql or --without-pgsql was given. - if test "${with_pgsql+set}" = set; then - withval="$with_pgsql" -@@ -75444,7 +77441,7 @@ if test "$PHP_PGSQL" != "no"; then +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_mcrypt_mcrypt_module_open + +- { echo "configure: error: Sorry, I was not able to diagnose which libmcrypt version you have installed." 1>&2; exit 1; } ++ PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DONIG_ESCAPE_UCHAR_COLLISION=1" ++ + +- +-fi ++ PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DUChar=OnigUChar" +- +- +-fi - echo $ac_n "checking for pg_config""... $ac_c" 1>&6 --echo "configure:75448: checking for pg_config" >&5 -+echo "configure:77445: checking for pg_config" >&5 - for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do - if test -x $i/pg_config; then - PG_CONFIG="$i/pg_config" -@@ -75512,7 +77509,7 @@ EOF - old_LDFLAGS=$LDFLAGS - LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" - echo $ac_n "checking for PQescapeString in -lpq""... $ac_c" 1>&6 --echo "configure:75516: checking for PQescapeString in -lpq" >&5 -+echo "configure:77513: checking for PQescapeString in -lpq" >&5 - ac_lib_var=`echo pq'_'PQescapeString | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75520,7 +77517,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75555,7 +77552,7 @@ else - fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_MBREGEX 1 ++EOF - echo $ac_n "checking for PQunescapeBytea in -lpq""... $ac_c" 1>&6 --echo "configure:75559: checking for PQunescapeBytea in -lpq" >&5 -+echo "configure:77556: checking for PQunescapeBytea in -lpq" >&5 - ac_lib_var=`echo pq'_'PQunescapeBytea | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75563,7 +77560,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75598,7 +77595,7 @@ else - fi +- - echo $ac_n "checking for PQsetnonblocking in -lpq""... $ac_c" 1>&6 --echo "configure:75602: checking for PQsetnonblocking in -lpq" >&5 -+echo "configure:77599: checking for PQsetnonblocking in -lpq" >&5 - ac_lib_var=`echo pq'_'PQsetnonblocking | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75606,7 +77603,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75641,7 +77638,7 @@ else - fi +- if test "$ext_shared" = "yes"; then +- MCRYPT_SHARED_LIBADD="-lmcrypt $MCRYPT_SHARED_LIBADD" +- if test -n "$MCRYPT_DIR/$PHP_LIBDIR"; then +- +- if test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$MCRYPT_DIR/$PHP_LIBDIR" || echo "$MCRYPT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$MCRYPT_DIR/$PHP_LIBDIR +- else + +- ep_dir="`echo $MCRYPT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ PHP_MBSTRING_BASE_SOURCES="$PHP_MBSTRING_BASE_SOURCES php_mbregex.c" ++ + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/$PHP_LIBDIR\"`" ++ PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS php_mbregex.h php_onig_compat.h" ++ + fi - echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6 --echo "configure:75645: checking for PQcmdTuples in -lpq" >&5 -+echo "configure:77642: checking for PQcmdTuples in -lpq" >&5 - ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75649,7 +77646,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75684,7 +77681,7 @@ else - fi +- +- if test "$ext_shared" = "yes"; then +- MCRYPT_SHARED_LIBADD="-L$ai_p $MCRYPT_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MCRYPT_SHARED_LIBADD="$ld_runpath_switch$ai_p $MCRYPT_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ fi + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++ if test "$PHP_LIBMBFL" = "yes" || test "$PHP_LIBMBFL" = "no"; then ++ ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl" - echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6 --echo "configure:75688: checking for PQoidValue in -lpq" >&5 -+echo "configure:77685: checking for PQoidValue in -lpq" >&5 - ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75692,7 +77689,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75727,7 +77724,7 @@ else - fi ++ ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/mbfl" - echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6 --echo "configure:75731: checking for PQclientEncoding in -lpq" >&5 -+echo "configure:77728: checking for PQclientEncoding in -lpq" >&5 - ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75735,7 +77732,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75770,7 +77767,7 @@ else - fi +- fi + +- fi ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/filters" - echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 --echo "configure:75774: checking for PQparameterStatus in -lpq" >&5 -+echo "configure:77771: checking for PQparameterStatus in -lpq" >&5 - ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75778,7 +77775,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75813,7 +77810,7 @@ else - fi +- fi +- else + ++ PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/nls" - echo $ac_n "checking for PQprotocolVersion in -lpq""... $ac_c" 1>&6 --echo "configure:75817: checking for PQprotocolVersion in -lpq" >&5 -+echo "configure:77814: checking for PQprotocolVersion in -lpq" >&5 - ac_lib_var=`echo pq'_'PQprotocolVersion | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75821,7 +77818,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75856,7 +77853,7 @@ else - fi +- if test -n "$MCRYPT_DIR/$PHP_LIBDIR"; then + +- if test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl" ++ + +- if test -z "$MCRYPT_DIR/$PHP_LIBDIR" || echo "$MCRYPT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$MCRYPT_DIR/$PHP_LIBDIR ++ PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl/mbfl" ++ ++ ++ PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS libmbfl/config.h" ++ ++ ++ ++ PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES ++ libmbfl/filters/html_entities.c ++ libmbfl/filters/mbfilter_7bit.c ++ libmbfl/filters/mbfilter_ascii.c ++ libmbfl/filters/mbfilter_base64.c ++ libmbfl/filters/mbfilter_big5.c ++ libmbfl/filters/mbfilter_byte2.c ++ libmbfl/filters/mbfilter_byte4.c ++ libmbfl/filters/mbfilter_cp1251.c ++ libmbfl/filters/mbfilter_cp1252.c ++ libmbfl/filters/mbfilter_cp1254.c ++ libmbfl/filters/mbfilter_cp5022x.c ++ libmbfl/filters/mbfilter_cp51932.c ++ libmbfl/filters/mbfilter_cp850.c ++ libmbfl/filters/mbfilter_cp866.c ++ libmbfl/filters/mbfilter_cp932.c ++ libmbfl/filters/mbfilter_cp936.c ++ libmbfl/filters/mbfilter_euc_cn.c ++ libmbfl/filters/mbfilter_euc_jp.c ++ libmbfl/filters/mbfilter_euc_jp_win.c ++ libmbfl/filters/mbfilter_euc_kr.c ++ libmbfl/filters/mbfilter_euc_tw.c ++ libmbfl/filters/mbfilter_htmlent.c ++ libmbfl/filters/mbfilter_hz.c ++ libmbfl/filters/mbfilter_iso2022_jp_ms.c ++ libmbfl/filters/mbfilter_iso2022_kr.c ++ libmbfl/filters/mbfilter_iso8859_1.c ++ libmbfl/filters/mbfilter_iso8859_10.c ++ libmbfl/filters/mbfilter_iso8859_13.c ++ libmbfl/filters/mbfilter_iso8859_14.c ++ libmbfl/filters/mbfilter_iso8859_15.c ++ libmbfl/filters/mbfilter_iso8859_16.c ++ libmbfl/filters/mbfilter_iso8859_2.c ++ libmbfl/filters/mbfilter_iso8859_3.c ++ libmbfl/filters/mbfilter_iso8859_4.c ++ libmbfl/filters/mbfilter_iso8859_5.c ++ libmbfl/filters/mbfilter_iso8859_6.c ++ libmbfl/filters/mbfilter_iso8859_7.c ++ libmbfl/filters/mbfilter_iso8859_8.c ++ libmbfl/filters/mbfilter_iso8859_9.c ++ libmbfl/filters/mbfilter_jis.c ++ libmbfl/filters/mbfilter_koi8r.c ++ libmbfl/filters/mbfilter_armscii8.c ++ libmbfl/filters/mbfilter_qprint.c ++ libmbfl/filters/mbfilter_sjis.c ++ libmbfl/filters/mbfilter_sjis_open.c ++ libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c ++ libmbfl/filters/mbfilter_ucs2.c ++ libmbfl/filters/mbfilter_ucs4.c ++ libmbfl/filters/mbfilter_uhc.c ++ libmbfl/filters/mbfilter_utf16.c ++ libmbfl/filters/mbfilter_utf32.c ++ libmbfl/filters/mbfilter_utf7.c ++ libmbfl/filters/mbfilter_utf7imap.c ++ libmbfl/filters/mbfilter_utf8.c ++ libmbfl/filters/mbfilter_uuencode.c ++ libmbfl/filters/mbfilter_koi8u.c ++ libmbfl/mbfl/mbfilter.c ++ libmbfl/mbfl/mbfilter_8bit.c ++ libmbfl/mbfl/mbfilter_pass.c ++ libmbfl/mbfl/mbfilter_wchar.c ++ libmbfl/mbfl/mbfl_convert.c ++ libmbfl/mbfl/mbfl_encoding.c ++ libmbfl/mbfl/mbfl_filter_output.c ++ libmbfl/mbfl/mbfl_ident.c ++ libmbfl/mbfl/mbfl_language.c ++ libmbfl/mbfl/mbfl_memory_device.c ++ libmbfl/mbfl/mbfl_string.c ++ libmbfl/mbfl/mbfl_allocators.c ++ libmbfl/nls/nls_de.c ++ libmbfl/nls/nls_en.c ++ libmbfl/nls/nls_ja.c ++ libmbfl/nls/nls_kr.c ++ libmbfl/nls/nls_neutral.c ++ libmbfl/nls/nls_ru.c ++ libmbfl/nls/nls_uni.c ++ libmbfl/nls/nls_zh.c ++ libmbfl/nls/nls_hy.c ++ libmbfl/nls/nls_tr.c ++ libmbfl/nls/nls_ua.c ++ " ++ ++ ++ PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DHAVE_CONFIG_H" ++ ++ ++ PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h" ++ + else ++ for inc in include include/mbfl-1.0 include/mbfl; do ++ if test -f "$PHP_LIBMBFL/$inc/mbfilter.h"; then ++ PHP_LIBMBFL_INCLUDE="$inc" ++ break ++ fi ++ done ++ ++ if test -z "$PHP_LIBMBFL_INCLUDE"; then ++ { echo "configure: error: mbfilter.h not found. Please reinstall libmbfl library." 1>&2; exit 1; } ++ else ++ ++ if test "$PHP_LIBMBFL_INCLUDE" != "/usr/include"; then + +- ep_dir="`echo $MCRYPT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ if test -z "$PHP_LIBMBFL_INCLUDE" || echo "$PHP_LIBMBFL_INCLUDE" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_LIBMBFL_INCLUDE ++ else ++ ++ ep_dir="`echo $PHP_LIBMBFL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL_INCLUDE\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ + fi - echo $ac_n "checking for PQtransactionStatus in -lpq""... $ac_c" 1>&6 --echo "configure:75860: checking for PQtransactionStatus in -lpq" >&5 -+echo "configure:77857: checking for PQtransactionStatus in -lpq" >&5 - ac_lib_var=`echo pq'_'PQtransactionStatus | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75864,7 +77861,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75899,7 +77896,7 @@ else - fi ++ fi ++ + ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PHP_LIBMBFL/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` + ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -58641,74 +59502,181 @@ fi + fi - echo $ac_n "checking for PQexecParams in -lpq""... $ac_c" 1>&6 --echo "configure:75903: checking for PQexecParams in -lpq" >&5 -+echo "configure:77900: checking for PQexecParams in -lpq" >&5 - ac_lib_var=`echo pq'_'PQexecParams | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75907,7 +77904,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75942,7 +77939,7 @@ else - fi - echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 --echo "configure:75946: checking for PQprepare in -lpq" >&5 -+echo "configure:77943: checking for PQprepare in -lpq" >&5 - ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75950,7 +77947,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:77962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -75985,7 +77982,7 @@ else - fi ++ fi + + fi - echo $ac_n "checking for PQexecPrepared in -lpq""... $ac_c" 1>&6 --echo "configure:75989: checking for PQexecPrepared in -lpq" >&5 -+echo "configure:77986: checking for PQexecPrepared in -lpq" >&5 - ac_lib_var=`echo pq'_'PQexecPrepared | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -75993,7 +77990,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76028,7 +78025,7 @@ else - fi +- fi +- ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for mbfl_buffer_converter_new in -lmbfl""... $ac_c" 1>&6 ++echo "configure:59515: checking for mbfl_buffer_converter_new in -lmbfl" >&5 ++ac_lib_var=`echo mbfl'_'mbfl_buffer_converter_new | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lmbfl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- case mcrypt in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lmcrypt $LIBS" +- ;; +- esac ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ - echo $ac_n "checking for PQresultErrorField in -lpq""... $ac_c" 1>&6 --echo "configure:76032: checking for PQresultErrorField in -lpq" >&5 -+echo "configure:78029: checking for PQresultErrorField in -lpq" >&5 - ac_lib_var=`echo pq'_'PQresultErrorField | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76036,7 +78033,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76071,7 +78068,7 @@ else - fi ++ if test "$ext_shared" = "yes"; then ++ MBSTRING_SHARED_LIBADD="-lmbfl $MBSTRING_SHARED_LIBADD" ++ if test -n "$PHP_LIBMBFL/$PHP_LIBDIR"; then ++ ++ if test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_LIBMBFL/$PHP_LIBDIR" || echo "$PHP_LIBMBFL/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_LIBMBFL/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_LIBMBFL/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/$PHP_LIBDIR\"`" ++ fi - echo $ac_n "checking for PQsendQueryParams in -lpq""... $ac_c" 1>&6 --echo "configure:76075: checking for PQsendQueryParams in -lpq" >&5 -+echo "configure:78072: checking for PQsendQueryParams in -lpq" >&5 - ac_lib_var=`echo pq'_'PQsendQueryParams | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76079,7 +78076,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76114,7 +78111,7 @@ else - fi ++ ++ if test "$ext_shared" = "yes"; then ++ MBSTRING_SHARED_LIBADD="-L$ai_p $MBSTRING_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MBSTRING_SHARED_LIBADD="$ld_runpath_switch$ai_p $MBSTRING_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi - echo $ac_n "checking for PQsendPrepare in -lpq""... $ac_c" 1>&6 --echo "configure:76118: checking for PQsendPrepare in -lpq" >&5 -+echo "configure:78115: checking for PQsendPrepare in -lpq" >&5 - ac_lib_var=`echo pq'_'PQsendPrepare | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76122,7 +78119,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76157,7 +78154,7 @@ else - fi - echo $ac_n "checking for PQsendQueryPrepared in -lpq""... $ac_c" 1>&6 --echo "configure:76161: checking for PQsendQueryPrepared in -lpq" >&5 -+echo "configure:78158: checking for PQsendQueryPrepared in -lpq" >&5 - ac_lib_var=`echo pq'_'PQsendQueryPrepared | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76165,7 +78162,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76200,7 +78197,7 @@ else - fi ++ fi ++ + fi - echo $ac_n "checking for PQputCopyData in -lpq""... $ac_c" 1>&6 --echo "configure:76204: checking for PQputCopyData in -lpq" >&5 -+echo "configure:78201: checking for PQputCopyData in -lpq" >&5 - ac_lib_var=`echo pq'_'PQputCopyData | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76208,7 +78205,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76243,7 +78240,7 @@ else - fi ++ fi ++ else ++ - echo $ac_n "checking for PQputCopyEnd in -lpq""... $ac_c" 1>&6 --echo "configure:76247: checking for PQputCopyEnd in -lpq" >&5 -+echo "configure:78244: checking for PQputCopyEnd in -lpq" >&5 - ac_lib_var=`echo pq'_'PQputCopyEnd | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76251,7 +78248,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76286,7 +78283,7 @@ else - fi +- +- if test "$MCRYPT_DIR/include" != "/usr/include"; then ++ if test -n "$PHP_LIBMBFL/$PHP_LIBDIR"; then + +- if test -z "$MCRYPT_DIR/include" || echo "$MCRYPT_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$MCRYPT_DIR/include ++ if test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_LIBMBFL/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_LIBMBFL/$PHP_LIBDIR" || echo "$PHP_LIBMBFL/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_LIBMBFL/$PHP_LIBDIR + else + +- ep_dir="`echo $MCRYPT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_LIBMBFL/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/include\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/$PHP_LIBDIR\"`" + fi - echo $ac_n "checking for PQgetCopyData in -lpq""... $ac_c" 1>&6 --echo "configure:76290: checking for PQgetCopyData in -lpq" >&5 -+echo "configure:78287: checking for PQgetCopyData in -lpq" >&5 - ac_lib_var=`echo pq'_'PQgetCopyData | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76294,7 +78291,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76329,7 +78326,7 @@ else - fi + ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" ++ eval "LIBPATH$unique=set" + +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ + + fi - echo $ac_n "checking for PQfreemem in -lpq""... $ac_c" 1>&6 --echo "configure:76333: checking for PQfreemem in -lpq" >&5 -+echo "configure:78330: checking for PQfreemem in -lpq" >&5 - ac_lib_var=`echo pq'_'PQfreemem | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76337,7 +78334,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76372,7 +78369,7 @@ else - fi + fi ++ ++ ++ case mbfl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lmbfl $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi - echo $ac_n "checking for PQsetErrorVerbosity in -lpq""... $ac_c" 1>&6 --echo "configure:76376: checking for PQsetErrorVerbosity in -lpq" >&5 -+echo "configure:78373: checking for PQsetErrorVerbosity in -lpq" >&5 - ac_lib_var=`echo pq'_'PQsetErrorVerbosity | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76380,7 +78377,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76415,7 +78412,7 @@ else - fi - echo $ac_n "checking for PQftable in -lpq""... $ac_c" 1>&6 --echo "configure:76419: checking for PQftable in -lpq" >&5 -+echo "configure:78416: checking for PQftable in -lpq" >&5 - ac_lib_var=`echo pq'_'PQftable | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76423,7 +78420,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76458,7 +78455,7 @@ else - fi ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST MCRYPT_SHARED_LIBADD" ++else ++ echo "$ac_t""no" 1>&6 - echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 --echo "configure:76462: checking for PQescapeStringConn in -lpq" >&5 -+echo "configure:78459: checking for PQescapeStringConn in -lpq" >&5 - ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76466,7 +78463,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76501,7 +78498,7 @@ else - fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_mbfl_mbfl_buffer_converter_new ++ ++ { echo "configure: error: Problem with libmbfl. Please check config.log for more information." 1>&2; exit 1; } ++ + +- ext_builddir=ext/mcrypt +- ext_srcdir=$abs_srcdir/ext/mcrypt ++fi - echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 --echo "configure:76505: checking for PQescapeByteaConn in -lpq" >&5 -+echo "configure:78502: checking for PQescapeByteaConn in -lpq" >&5 - ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76509,7 +78506,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76544,7 +78541,7 @@ else - fi +- ac_extra= ++ fi ++ ++ ++ ++ ext_builddir=ext/mbstring ++ ext_srcdir=$abs_srcdir/ext/mbstring ++ ++ ac_extra=`echo "$PHP_MBSTRING_CFLAGS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` - echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 --echo "configure:76548: checking for pg_encoding_to_char in -lpq" >&5 -+echo "configure:78545: checking for pg_encoding_to_char in -lpq" >&5 - ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76552,7 +78549,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76587,7 +78584,7 @@ else - fi + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_MCRYPT_SHARED=no ++ PHP_MBSTRING_SHARED=no + + +- case ext/mcrypt in ++ case ext/mbstring in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -58723,7 +59691,7 @@ fi - echo $ac_n "checking for lo_create in -lpq""... $ac_c" 1>&6 --echo "configure:76591: checking for lo_create in -lpq" >&5 -+echo "configure:78588: checking for lo_create in -lpq" >&5 - ac_lib_var=`echo pq'_'lo_create | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76595,7 +78592,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -76630,7 +78627,7 @@ else - fi - echo $ac_n "checking for lo_import_with_oid in -lpq""... $ac_c" 1>&6 --echo "configure:76634: checking for lo_import_with_oid in -lpq" >&5 -+echo "configure:78631: checking for lo_import_with_oid in -lpq" >&5 - ac_lib_var=`echo pq'_'lo_import_with_oid | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -76638,7 +78635,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lpq $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:78650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -77109,7 +79106,7 @@ fi - php_enable_phar=yes + old_IFS=$IFS +- for ac_src in mcrypt.c mcrypt_filter.c; do ++ for ac_src in $PHP_MBSTRING_SOURCES; do + + IFS=. + set $ac_src +@@ -58746,18 +59714,18 @@ EOF + done - echo $ac_n "checking for phar archive support""... $ac_c" 1>&6 --echo "configure:77113: checking for phar archive support" >&5 -+echo "configure:79110: checking for phar archive support" >&5 - # Check whether --enable-phar or --disable-phar was given. - if test "${enable_phar+set}" = set; then - enableval="$enable_phar" -@@ -77443,7 +79440,7 @@ EOF + +- EXT_STATIC="$EXT_STATIC mcrypt" ++ EXT_STATIC="$EXT_STATIC mbstring" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC mcrypt" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_MCRYPT_SHARED=yes ++ PHP_MBSTRING_SHARED=yes + +- case ext/mcrypt in ++ case ext/mbstring in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -58772,14 +59740,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in mcrypt.c mcrypt_filter.c; do ++ for ac_src in $PHP_MBSTRING_SOURCES; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_mcrypt="$shared_objects_mcrypt $ac_bdir$ac_obj.lo" ++ shared_objects_mbstring="$shared_objects_mbstring $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -58802,31 +59770,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmcrypt.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(PHPMCRYPT_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmcrypt.so '$ext_builddir'/phpmcrypt.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmbstring.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmbstring.so '$ext_builddir'/phpmbstring.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMCRYPT, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMBSTRING, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(PHPMCRYPT_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmcrypt.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmbstring.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmcrypt.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmbstring.$suffix" fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcrypt" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mbstring" + + cat >>Makefile.objects<&6 --echo "configure:77447: checking for phar openssl support" >&5 -+echo "configure:79444: checking for phar openssl support" >&5 - if test "$PHP_HASH_SHARED" != "yes"; then - if test "$PHP_HASH" != "no"; then - cat >> confdefs.h <<\EOF -@@ -77518,7 +79515,7 @@ fi - php_enable_posix=yes - - echo $ac_n "checking whether to enable POSIX-like functions""... $ac_c" 1>&6 --echo "configure:77522: checking whether to enable POSIX-like functions" >&5 -+echo "configure:79519: checking whether to enable POSIX-like functions" >&5 - # Check whether --enable-posix or --disable-posix was given. - if test "${enable_posix+set}" = set; then - enableval="$enable_posix" -@@ -77860,17 +79857,17 @@ EOF - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:77864: checking for $ac_hdr" >&5 -+echo "configure:79861: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:77874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:79871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -77900,12 +79897,12 @@ done - for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:77904: checking for $ac_func" >&5 -+echo "configure:79901: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:79929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -77954,14 +79951,14 @@ done +@@ -58871,22 +59839,22 @@ EOF + ;; + esac + cat >> confdefs.h <&6 --echo "configure:77958: checking for working ttyname_r() implementation" >&5 -+echo "configure:79955: checking for working ttyname_r() implementation" >&5 - if test "$cross_compiling" = yes; then + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_MCRYPT_SHARED=no ++ PHP_MBSTRING_SHARED=no + case "$PHP_SAPI" in + cgi|embed) + - echo "$ac_t""no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe" 1>&6 +- case ext/mcrypt in ++ case ext/mbstring in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac - else - cat > conftest.$ac_ext < -@@ -77974,7 +79971,7 @@ int main(int argc, char *argv[]) - } + + old_IFS=$IFS +- for ac_src in mcrypt.c mcrypt_filter.c; do ++ for ac_src in $PHP_MBSTRING_SOURCES; do - EOF --if { (eval echo configure:77978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:79975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + IFS=. + set $ac_src +@@ -58924,15 +59892,15 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC mcrypt" ++ EXT_STATIC="$EXT_STATIC mbstring" + ;; + *) + - echo "$ac_t""yes" 1>&6 -@@ -77996,13 +79993,13 @@ fi +- case ext/mcrypt in ++ case ext/mbstring in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -58947,7 +59915,7 @@ EOF - echo $ac_n "checking for utsname.domainname""... $ac_c" 1>&6 --echo "configure:78000: checking for utsname.domainname" >&5 -+echo "configure:79997: checking for utsname.domainname" >&5 - if eval "test \"`echo '$''{'ac_cv_have_utsname_domainname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else + old_IFS=$IFS +- for ac_src in mcrypt.c mcrypt_filter.c; do ++ for ac_src in $PHP_MBSTRING_SOURCES; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:80015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ;; + esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC mcrypt" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring" + fi + - ac_cv_have_utsname_domainname=yes -@@ -78045,7 +80042,7 @@ fi - php_with_pspell=no +@@ -58981,107 +59949,68 @@ EOF - echo $ac_n "checking for PSPELL support""... $ac_c" 1>&6 --echo "configure:78049: checking for PSPELL support" >&5 -+echo "configure:80046: checking for PSPELL support" >&5 - # Check whether --with-pspell or --without-pspell was given. - if test "${with_pspell+set}" = set; then - withval="$with_pspell" -@@ -78595,7 +80592,7 @@ EOF - done - echo $ac_n "checking for new_aspell_config in -laspell""... $ac_c" 1>&6 --echo "configure:78599: checking for new_aspell_config in -laspell" >&5 -+echo "configure:80596: checking for new_aspell_config in -laspell" >&5 - ac_lib_var=`echo aspell'_'new_aspell_config | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -78603,7 +80600,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-laspell $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:80615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -78788,7 +80785,7 @@ fi - php_with_libedit=no + if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=mcrypt ++ PHP_PECL_EXTENSION=mbstring + + PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" - echo $ac_n "checking for libedit readline replacement""... $ac_c" 1>&6 --echo "configure:78792: checking for libedit readline replacement" >&5 -+echo "configure:80789: checking for libedit readline replacement" >&5 - # Check whether --with-libedit or --without-libedit was given. - if test "${with_libedit+set}" = set; then - withval="$with_libedit" -@@ -78833,7 +80830,7 @@ if test "$PHP_LIBEDIT" = "no"; then - php_with_readline=no - - echo $ac_n "checking for readline support""... $ac_c" 1>&6 --echo "configure:78837: checking for readline support" >&5 -+echo "configure:80834: checking for readline support" >&5 - # Check whether --with-readline or --without-readline was given. - if test "${with_readline+set}" = set; then - withval="$with_readline" -@@ -78919,7 +80916,7 @@ if test "$PHP_READLINE" && test "$PHP_RE - - PHP_READLINE_LIBS="" - echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 --echo "configure:78923: checking for tgetent in -lncurses" >&5 -+echo "configure:80920: checking for tgetent in -lncurses" >&5 - ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -78927,7 +80924,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lncurses $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:80939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -78983,7 +80980,7 @@ else - echo "$ac_t""no" 1>&6 + fi - echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 --echo "configure:78987: checking for tgetent in -ltermcap" >&5 -+echo "configure:80984: checking for tgetent in -ltermcap" >&5 - ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -78991,7 +80988,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ltermcap $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79149,7 +81146,7 @@ fi - done +-fi +- ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MBSTRING_SHARED_LIBADD" - echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 --echo "configure:79153: checking for readline in -lreadline" >&5 -+echo "configure:81150: checking for readline in -lreadline" >&5 - ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79157,7 +81154,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lreadline $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79397,7 +81394,7 @@ fi - done - echo $ac_n "checking for rl_pending_input in -lreadline""... $ac_c" 1>&6 --echo "configure:79401: checking for rl_pending_input in -lreadline" >&5 -+echo "configure:81398: checking for rl_pending_input in -lreadline" >&5 - ac_lib_var=`echo readline'_'rl_pending_input | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79405,7 +81402,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lreadline $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79547,7 +81544,7 @@ fi - done +-php_with_mssql=no ++ for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do ++ ++ ++ $php_shtool mkdir -p $ext_builddir/$dir ++ - echo $ac_n "checking for rl_callback_read_char in -lreadline""... $ac_c" 1>&6 --echo "configure:79551: checking for rl_callback_read_char in -lreadline" >&5 -+echo "configure:81548: checking for rl_callback_read_char in -lreadline" >&5 - ac_lib_var=`echo readline'_'rl_callback_read_char | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79555,7 +81552,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lreadline $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79650,7 +81647,7 @@ elif test "$PHP_LIBEDIT" != "no"; then +-echo $ac_n "checking for MSSQL support via FreeTDS""... $ac_c" 1>&6 +-echo "configure:58998: checking for MSSQL support via FreeTDS" >&5 +-# Check whether --with-mssql or --without-mssql was given. +-if test "${with_mssql+set}" = set; then +- withval="$with_mssql" +- PHP_MSSQL=$withval +-else ++ done + +- PHP_MSSQL=no +- test "$PHP_ENABLE_ALL" && PHP_MSSQL=$PHP_ENABLE_ALL ++ for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do ++ ++ if test "$ext_srcdir/$dir" != "/usr/include"; then ++ ++ if test -z "$ext_srcdir/$dir" || echo "$ext_srcdir/$dir" | grep '^/' >/dev/null ; then ++ ai_p=$ext_srcdir/$dir ++ else ++ ++ ep_dir="`echo $ext_srcdir/$dir|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ext_srcdir/$dir\"`" ++ fi +-fi ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi - echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 --echo "configure:79654: checking for tgetent in -lncurses" >&5 -+echo "configure:81651: checking for tgetent in -lncurses" >&5 - ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79658,7 +81655,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lncurses $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79713,7 +81710,7 @@ else - echo "$ac_t""no" 1>&6 ++ fi - echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 --echo "configure:79717: checking for tgetent in -ltermcap" >&5 -+echo "configure:81714: checking for tgetent in -ltermcap" >&5 - ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79721,7 +81718,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ltermcap $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -79878,7 +81875,7 @@ fi - done - - echo $ac_n "checking for readline in -ledit""... $ac_c" 1>&6 --echo "configure:79882: checking for readline in -ledit" >&5 -+echo "configure:81879: checking for readline in -ledit" >&5 - ac_lib_var=`echo edit'_'readline | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -79886,7 +81883,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ledit $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:81898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -80038,12 +82035,12 @@ if test "$PHP_READLINE" != "no" || test - for ac_func in rl_completion_matches - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:80042: checking for $ac_func" >&5 -+echo "configure:82039: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:82067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -80392,7 +82389,7 @@ fi - php_with_recode=no - - echo $ac_n "checking for recode support""... $ac_c" 1>&6 --echo "configure:80396: checking for recode support" >&5 -+echo "configure:82393: checking for recode support" >&5 - # Check whether --with-recode or --without-recode was given. - if test "${with_recode+set}" = set; then - withval="$with_recode" -@@ -80556,7 +82553,7 @@ if test "$PHP_RECODE" != "no"; then - done - - echo $ac_n "checking for recode_format_table in -lrecode""... $ac_c" 1>&6 --echo "configure:80560: checking for recode_format_table in -lrecode" >&5 -+echo "configure:82557: checking for recode_format_table in -lrecode" >&5 - ac_lib_var=`echo recode'_'recode_format_table | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -80564,7 +82561,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lrecode $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:82576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -80705,7 +82702,7 @@ else - LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" - LIBS="$LIBS -lrecode" - cat > conftest.$ac_ext <&6 +- +- +- +- +-if test "$PHP_MSSQL" != "no"; then +- +- if test "$PHP_MSSQL" = "yes"; then +- for i in /usr/local /usr; do +- if test -f $i/include/sybdb.h; then +- FREETDS_INSTALLATION_DIR=$i +- FREETDS_INCLUDE_DIR=$i/include +- break +- elif test -f $i/include/freetds/sybdb.h; then +- FREETDS_INSTALLATION_DIR=$i +- FREETDS_INCLUDE_DIR=$i/include/freetds +- break +- fi +- done +- +- if test -z "$FREETDS_INSTALLATION_DIR"; then +- { echo "configure: error: Cannot find FreeTDS in known installation directories" 1>&2; exit 1; } +- fi +- +- elif test "$PHP_MSSQL" != "no"; then +- +- if test -f $PHP_MSSQL/include/sybdb.h; then +- FREETDS_INSTALLATION_DIR=$PHP_MSSQL +- FREETDS_INCLUDE_DIR=$PHP_MSSQL/include +- elif test -f $PHP_MSSQL/include/freetds/sybdb.h; then +- FREETDS_INSTALLATION_DIR=$PHP_MSSQL +- FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds +- else +- { echo "configure: error: Directory $PHP_MSSQL is not a FreeTDS installation directory" 1>&2; exit 1; } +- fi +- fi +- +- if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then +- { echo "configure: error: Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a|so" 1>&2; exit 1; } +- fi +- +- +- if test "$FREETDS_INCLUDE_DIR" != "/usr/include"; then +- +- if test -z "$FREETDS_INCLUDE_DIR" || echo "$FREETDS_INCLUDE_DIR" | grep '^/' >/dev/null ; then +- ai_p=$FREETDS_INCLUDE_DIR +- else +- +- ep_dir="`echo $FREETDS_INCLUDE_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FREETDS_INCLUDE_DIR\"`" +- fi ++ ++ if test "$ext_builddir/$dir" != "/usr/include"; then ++ ++ if test -z "$ext_builddir/$dir" || echo "$ext_builddir/$dir" | grep '^/' >/dev/null ; then ++ ai_p=$ext_builddir/$dir ++ else ++ ++ ep_dir="`echo $ext_builddir/$dir|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ext_builddir/$dir\"`" ++ fi - char *program_name; -@@ -80716,7 +82713,7 @@ recode_format_table(); - ; return 0; } - EOF --if { (eval echo configure:80720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:82717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - -@@ -80879,17 +82876,17 @@ EOF - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:80883: checking for $ac_hdr" >&5 -+echo "configure:82880: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:80893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:82890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -81512,7 +83509,7 @@ EOF - php_enable_session=yes +@@ -59101,118 +60030,15 @@ if test "$PHP_MSSQL" != "no"; then - echo $ac_n "checking whether to enable PHP sessions""... $ac_c" 1>&6 --echo "configure:81516: checking whether to enable PHP sessions" >&5 -+echo "configure:83513: checking whether to enable PHP sessions" >&5 - # Check whether --enable-session or --disable-session was given. - if test "${enable_session+set}" = set; then - enableval="$enable_session" -@@ -81556,7 +83553,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_mm=no - - echo $ac_n "checking for mm support""... $ac_c" 1>&6 --echo "configure:81560: checking for mm support" >&5 -+echo "configure:83557: checking for mm support" >&5 - # Check whether --with-mm or --without-mm was given. - if test "${with_mm+set}" = set; then - withval="$with_mm" -@@ -81578,7 +83575,7 @@ echo "$ac_t""$ext_output" 1>&6 - if test "$PHP_SESSION" != "no"; then - - echo $ac_n "checking whether pwrite works""... $ac_c" 1>&6 --echo "configure:81582: checking whether pwrite works" >&5 -+echo "configure:83579: checking whether pwrite works" >&5 - if eval "test \"`echo '$''{'ac_cv_pwrite'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -81590,7 +83587,7 @@ else - - else - cat > conftest.$ac_ext < -@@ -81611,7 +83608,7 @@ else +- +- +- if test "$ext_shared" = "yes"; then +- MSSQL_SHARED_LIBADD="-lsybdb $MSSQL_SHARED_LIBADD" +- if test -n "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then +- +- if test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- MSSQL_SHARED_LIBADD="-L$ai_p $MSSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MSSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then +- +- if test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case sybdb in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybdb $LIBS" +- ;; +- esac +- +- +- +- +- fi +- +- +- +- +- ext_builddir=ext/mssql +- ext_srcdir=$abs_srcdir/ext/mssql +- +- ac_extra= ++ done +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_MSSQL_SHARED=no ++ if test "$ext_shared" = "no"; then + - EOF --if { (eval echo configure:81615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:83612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- case ext/mssql in ++ case ext/mbstring in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac - ac_cv_pwrite=yes -@@ -81636,7 +83633,7 @@ fi - else - cat > conftest.$ac_ext < -@@ -81657,7 +83654,7 @@ ssize_t pwrite(int, void *, size_t, off6 + old_IFS=$IFS +- for ac_src in php_mssql.c; do ++ for ac_src in $PHP_MBSTRING_BASE_SOURCES; do - EOF --if { (eval echo configure:81661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:83658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_pwrite=yes -@@ -81698,7 +83695,7 @@ EOF + IFS=. + set $ac_src +@@ -59237,10 +60063,10 @@ if test "$PHP_MSSQL" != "no"; then + PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + + case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac + + cat >>Makefile.objects<&6 --echo "configure:81702: checking whether pread works" >&5 -+echo "configure:83699: checking whether pread works" >&5 - if eval "test \"`echo '$''{'ac_cv_pread'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -81711,7 +83708,7 @@ else - else - cat > conftest.$ac_ext < -@@ -81731,7 +83728,7 @@ else - } + + old_IFS=$IFS +- for ac_src in php_mssql.c; do ++ for ac_src in $PHP_MBSTRING_BASE_SOURCES; do + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_mssql="$shared_objects_mssql $ac_bdir$ac_obj.lo" ++ shared_objects_mbstring="$shared_objects_mbstring $ac_bdir$ac_obj.lo" + + case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac + + cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:83732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_pread=yes -@@ -81758,7 +83755,7 @@ fi - - else - cat > conftest.$ac_ext < -@@ -81778,7 +83775,7 @@ ssize_t pread(int, void *, size_t, off64 - } +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmssql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmssql.so '$ext_builddir'/phpmssql.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMSSQL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmssql.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmssql.$suffix" ++ if test -f "$ext_builddir/config.h.in"; then ++ out="$abs_builddir/config.h" ++ else ++ out="php_config.h" ++ fi + fi +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mssql" +- +- cat >>Makefile.objects< $ext_builddir/$cfg <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:83779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then ++ done ++ ++ PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS mbstring.h" + +- ;; +- *) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/mssql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(MSSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/mssql.so '$ext_builddir'/mssql.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(MSSQL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(MSSQL_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/mssql.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/mssql.$suffix" +- fi - ac_cv_pread=yes -@@ -82342,7 +84339,7 @@ fi - php_enable_shmop=no +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mssql" ++ ++ header_path=ext/mbstring ++ for header_file in $PHP_MBSTRING_INSTALL_HEADERS; do ++ hp_hf="$header_path/$header_file" ++ ++ ++ unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ++ ++ fi - echo $ac_n "checking whether to enable shmop support""... $ac_c" 1>&6 --echo "configure:82346: checking whether to enable shmop support" >&5 -+echo "configure:84343: checking whether to enable shmop support" >&5 - # Check whether --enable-shmop or --disable-shmop was given. - if test "${enable_shmop+set}" = set; then - enableval="$enable_shmop" -@@ -82686,7 +84683,7 @@ fi - php_enable_simplexml=yes - - echo $ac_n "checking whether to enable SimpleXML support""... $ac_c" 1>&6 --echo "configure:82690: checking whether to enable SimpleXML support" >&5 -+echo "configure:84687: checking whether to enable SimpleXML support" >&5 - # Check whether --enable-simplexml or --disable-simplexml was given. - if test "${enable_simplexml+set}" = set; then - enableval="$enable_simplexml" -@@ -82731,7 +84728,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no +- cat >>Makefile.objects<&6 --echo "configure:82735: checking libxml2 install dir" >&5 -+echo "configure:84732: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -82759,7 +84756,7 @@ if test "$PHP_SIMPLEXML" != "no"; then +-$ext_builddir/mssql.$suffix: \$(shared_objects_mssql) \$(MSSQL_SHARED_DEPENDENCIES) +- $link_cmd - - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:82763: checking for xml2-config path" >&5 -+echo "configure:84760: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -82917,7 +84914,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path +-EOF ++fi +- ;; +- esac +- cat >> confdefs.h <&6 --echo "configure:82921: checking whether libxml build works" >&5 -+echo "configure:84918: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -82933,7 +84930,7 @@ else - - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:84945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_MSSQL_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/mssql in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac - LIBS=$old_LIBS -@@ -83332,7 +85329,7 @@ fi - php_with_snmp=no +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo - echo $ac_n "checking for SNMP support""... $ac_c" 1>&6 --echo "configure:83336: checking for SNMP support" >&5 -+echo "configure:85333: checking for SNMP support" >&5 - # Check whether --with-snmp or --without-snmp was given. - if test "${with_snmp+set}" = set; then - withval="$with_snmp" -@@ -83376,7 +85373,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_openssl_dir=no - echo $ac_n "checking OpenSSL dir for SNMP""... $ac_c" 1>&6 --echo "configure:83380: checking OpenSSL dir for SNMP" >&5 -+echo "configure:85377: checking OpenSSL dir for SNMP" >&5 - # Check whether --with-openssl-dir or --without-openssl-dir was given. - if test "${with_openssl_dir+set}" = set; then - withval="$with_openssl_dir" -@@ -83399,7 +85396,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_ucd_snmp_hack=no +- old_IFS=$IFS +- for ac_src in php_mssql.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" - echo $ac_n "checking whether to enable UCD SNMP hack""... $ac_c" 1>&6 --echo "configure:83403: checking whether to enable UCD SNMP hack" >&5 -+echo "configure:85400: checking whether to enable UCD SNMP hack" >&5 - # Check whether --enable-ucd-snmp-hack or --disable-ucd-snmp-hack was given. - if test "${enable_ucd_snmp_hack+set}" = set; then - enableval="$enable_ucd_snmp_hack" -@@ -83424,7 +85421,7 @@ if test "$PHP_SNMP" != "no"; then - # Extract the first word of "net-snmp-config", so it can be a program name with args. - set dummy net-snmp-config; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:83428: checking for $ac_word" >&5 -+echo "configure:85425: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_path_SNMP_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -83625,17 +85622,17 @@ EOF - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:83629: checking for $ac_hdr" >&5 -+echo "configure:85626: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:83639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:85636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -83663,9 +85660,9 @@ done +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++php_with_mcrypt=no - if test "$ac_cv_header_default_store_h" = "yes"; then - echo $ac_n "checking for OpenSSL support in SNMP libraries""... $ac_c" 1>&6 --echo "configure:83667: checking for OpenSSL support in SNMP libraries" >&5 -+echo "configure:85664: checking for OpenSSL support in SNMP libraries" >&5 - cat > conftest.$ac_ext <>Makefile.objects<&6 ++echo "configure:60171: checking for mcrypt support" >&5 ++# Check whether --with-mcrypt or --without-mcrypt was given. ++if test "${with_mcrypt+set}" = set; then ++ withval="$with_mcrypt" ++ PHP_MCRYPT=$withval ++else ++ ++ PHP_MCRYPT=no ++ test "$PHP_ENABLE_ALL" && PHP_MCRYPT=$PHP_ENABLE_ALL - #include -@@ -83720,7 +85717,7 @@ rm -f conftest* - # Extract the first word of "pkg-config", so it can be a program name with args. - set dummy pkg-config; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:83724: checking for $ac_word" >&5 -+echo "configure:85721: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -83925,9 +85922,9 @@ fi - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$OPENSSL_INCDIR - echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 --echo "configure:83929: checking for OpenSSL version" >&5 -+echo "configure:85926: checking for OpenSSL version" >&5 - cat > conftest.$ac_ext < -@@ -84082,7 +86079,7 @@ rm -f conftest* - done +- EXT_STATIC="$EXT_STATIC mssql" +- ;; +- *) +- +- +- case ext/mssql in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- - echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 --echo "configure:84086: checking for CRYPTO_free in -lcrypto" >&5 -+echo "configure:86083: checking for CRYPTO_free in -lcrypto" >&5 - ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -84090,7 +86087,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcrypto $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:86102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -84258,7 +86255,7 @@ fi - done +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo - echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 --echo "configure:84262: checking for SSL_CTX_set_ssl_version in -lssl" >&5 -+echo "configure:86259: checking for SSL_CTX_set_ssl_version in -lssl" >&5 - ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -84266,7 +86263,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lssl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:86278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -84390,7 +86387,7 @@ else - fi ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_MCRYPT in ++shared,*) ++ PHP_MCRYPT=`echo "$PHP_MCRYPT"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_MCRYPT=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac - echo $ac_n "checking for kstat_read in -lkstat""... $ac_c" 1>&6 --echo "configure:84394: checking for kstat_read in -lkstat" >&5 -+echo "configure:86391: checking for kstat_read in -lkstat" >&5 - ac_lib_var=`echo kstat'_'kstat_read | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -84398,7 +86395,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lkstat $LIBS" - cat > conftest.$ac_ext <>Makefile.objects<&6 + + +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC mssql" +- fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=mssql +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++if test "$PHP_MCRYPT" != "no"; then ++ for i in $PHP_MCRYPT /usr/local /usr; do ++ test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break ++ done + ++ if test -z "$MCRYPT_DIR"; then ++ { echo "configure: error: mcrypt.h not found. Please reinstall libmcrypt." 1>&2; exit 1; } + fi + +- echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6 +-echo "configure:59496: checking for dnet_addr in -ldnet_stub" >&5 +-ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ldnet_stub $LIBS" +-cat > conftest.$ac_ext <&6 ++echo "configure:60224: checking for libmcrypt version" >&5 ++ cat > conftest.$ac_ext < ++#if MCRYPT_API_VERSION >= 20021217 ++ yes ++#endif ++ EOF --if { (eval echo configure:84413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:86410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:59515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++ echo "$ac_t"">= 2.5.6" 1>&6 ++ else -@@ -84680,7 +86677,7 @@ fi +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ ++ { echo "configure: error: libmcrypt version 2.5.6 or greater required." 1>&2; exit 1; } ++ + fi + rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ++ CPPFLAGS=$old_CPPFLAGS + +- if test "$ext_shared" = "yes"; then +- MSSQL_SHARED_LIBADD="-ldnet_stub $MSSQL_SHARED_LIBADD" +- if test -n ""; then +- +- if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then +- +- if test -z "" || echo "" | grep '^/' >/dev/null ; then +- ai_p= +- else +- +- ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- MSSQL_SHARED_LIBADD="-L$ai_p $MSSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MSSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n ""; then +- +- if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then +- +- if test -z "" || echo "" | grep '^/' >/dev/null ; then +- ai_p= +- else +- +- ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case dnet_stub in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ldnet_stub $LIBS" +- ;; +- esac +- +- +- +- +- fi +- +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBDNET_STUB 1 +-EOF +- +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_MSSQL 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FREETDS 1 +-EOF +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MSSQL_SHARED_LIBADD" +- +-fi +- +- +- +- +- +- +- +- +-php_with_mysql=no +- +-echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 +-echo "configure:59659: checking for MySQL support" >&5 +-# Check whether --with-mysql or --without-mysql was given. +-if test "${with_mysql+set}" = set; then +- withval="$with_mysql" +- PHP_MYSQL=$withval +-else +- +- PHP_MYSQL=no +- test "$PHP_ENABLE_ALL" && PHP_MYSQL=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_MYSQL in +-shared,*) +- PHP_MYSQL=`echo "$PHP_MYSQL"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_MYSQL=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_with_mysql_sock=no +- +-echo $ac_n "checking for specified location of the MySQL UNIX socket""... $ac_c" 1>&6 +-echo "configure:59703: checking for specified location of the MySQL UNIX socket" >&5 +-# Check whether --with-mysql-sock or --without-mysql-sock was given. +-if test "${with_mysql_sock+set}" = set; then +- withval="$with_mysql_sock" +- PHP_MYSQL_SOCK=$withval +-else +- +- PHP_MYSQL_SOCK=no +- +- +-fi +- +- +-ext_output=$PHP_MYSQL_SOCK +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test -z "$PHP_ZLIB_DIR"; then +- +-php_with_zlib_dir=no +- +-echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 +-echo "configure:59727: checking for the location of libz" >&5 +-# Check whether --with-zlib-dir or --without-zlib-dir was given. +-if test "${with_zlib_dir+set}" = set; then +- withval="$with_zlib_dir" +- PHP_ZLIB_DIR=$withval +-else +- +- PHP_ZLIB_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_ZLIB_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +-fi +- +-if test "$PHP_MYSQL" = "mysqlnd"; then +- PHP_MYSQLND_ENABLED=yes +- +-elif test "$PHP_MYSQL" != "no"; then +- MYSQL_DIR= +- MYSQL_INC_DIR= +- +- for i in $PHP_MYSQL /usr/local /usr; do +- if test -r $i/include/mysql/mysql.h; then +- MYSQL_DIR=$i +- MYSQL_INC_DIR=$i/include/mysql +- break +- elif test -r $i/include/mysql.h; then +- MYSQL_DIR=$i +- MYSQL_INC_DIR=$i/include +- break +- fi +- done +- +- if test -z "$MYSQL_DIR"; then +- { echo "configure: error: Cannot find MySQL header files under $PHP_MYSQL. +-Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; } +- fi +- +- if test "$enable_maintainer_zts" = "yes"; then +- MYSQL_LIBNAME=mysqlclient_r +- else +- MYSQL_LIBNAME=mysqlclient +- fi +- case $host_alias in +- *netware*) +- MYSQL_LIBNAME=mysql +- ;; +- esac +- +- if test -z "$PHP_LIBDIR"; then +- PHP_LIBDIR=lib +- fi +- +- for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do +- +- str="$MYSQL_DIR/$i/lib$MYSQL_LIBNAME.*" +- for j in `echo $str`; do +- if test -r $j; then +- MYSQL_LIB_DIR=$MYSQL_DIR/$i +- break 2 +- fi +- done +- +- done +- +- if test -z "$MYSQL_LIB_DIR"; then +- { echo "configure: error: Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. +-Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; } +- fi + + + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$MYSQL_LIB_DIR ++ -L$MCRYPT_DIR/$PHP_LIBDIR -lltdl + " + + save_ext_shared=$ext_shared +@@ -59896,27 +60345,27 @@ Note that the MySQL client library is no + esac done - echo $ac_n "checking for snmp_parse_oid in -l$SNMP_LIBNAME""... $ac_c" 1>&6 --echo "configure:84684: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5 -+echo "configure:86681: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5 - ac_lib_var=`echo $SNMP_LIBNAME'_'snmp_parse_oid | sed 'y%./+-%__p_%'` +- echo $ac_n "checking for mysql_close in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:59901: checking for mysql_close in -l$MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_close | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6 ++echo "configure:60350: checking for mcrypt_module_open in -lmcrypt" >&5 ++ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -84688,7 +86685,7 @@ else + else ac_save_LIBS="$LIBS" - LIBS="-l$SNMP_LIBNAME $LIBS" +-LIBS="-l$MYSQL_LIBNAME $LIBS" ++LIBS="-lmcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:86700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:59920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:60369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -84833,7 +86830,7 @@ fi +@@ -59934,118 +60383,48 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIBNAME_mysql_close +- +- if test "$PHP_ZLIB_DIR" != "no"; then +- +- +- if test "$ext_shared" = "yes"; then +- MYSQL_SHARED_LIBADD="-lz $MYSQL_SHARED_LIBADD" +- if test -n "$PHP_ZLIB_DIR"; then +- +- if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then +- +- if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ZLIB_DIR +- else +- +- ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" +- fi +- + +- if test "$ext_shared" = "yes"; then +- MYSQL_SHARED_LIBADD="-L$ai_p $MYSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$PHP_ZLIB_DIR"; then +- +- if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then +- +- if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ZLIB_DIR +- else +- +- ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" +- fi +- +- ++ case ltdl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ MCRYPT_SHARED_LIBADD="-lltdl $MCRYPT_SHARED_LIBADD" ++ else + + +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case z in ++ case ltdl in + c|c_r|pthread*) ;; + *) +- LIBS="-lz $LIBS" ++ LIBS="-lltdl $LIBS" + ;; + esac + + ++ fi ++ ;; ++ esac + + +- fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBMCRYPT 1 ++EOF + ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + +- ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_mcrypt_mcrypt_module_open ++ ++ + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR +- " ++ -L$MCRYPT_DIR/$PHP_LIBDIR ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -60138,27 +60517,27 @@ else + esac done - echo $ac_n "checking for init_snmp in -l$SNMP_LIBNAME""... $ac_c" 1>&6 --echo "configure:84837: checking for init_snmp in -l$SNMP_LIBNAME" >&5 -+echo "configure:86834: checking for init_snmp in -l$SNMP_LIBNAME" >&5 - ac_lib_var=`echo $SNMP_LIBNAME'_'init_snmp | sed 'y%./+-%__p_%'` +- echo $ac_n "checking for mysql_error in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:60143: checking for mysql_error in -l$MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_error | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6 ++echo "configure:60522: checking for mcrypt_module_open in -lmcrypt" >&5 ++ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -84841,7 +86838,7 @@ else + else ac_save_LIBS="$LIBS" - LIBS="-l$SNMP_LIBNAME $LIBS" +-LIBS="-l$MYSQL_LIBNAME $LIBS" ++LIBS="-lmcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:86853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +-if { (eval echo configure:60162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:60541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -85199,7 +87196,7 @@ fi - php_enable_soap=no - - echo $ac_n "checking whether to enable SOAP support""... $ac_c" 1>&6 --echo "configure:85203: checking whether to enable SOAP support" >&5 -+echo "configure:87200: checking whether to enable SOAP support" >&5 - # Check whether --enable-soap or --disable-soap was given. - if test "${enable_soap+set}" = set; then - enableval="$enable_soap" -@@ -85244,7 +87241,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no - - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:85248: checking libxml2 install dir" >&5 -+echo "configure:87245: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -85272,7 +87269,7 @@ if test "$PHP_SOAP" != "no"; then - +@@ -60177,116 +60556,51 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBMCRYPT 1 ++EOF ++ ++ - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:85276: checking for xml2-config path" >&5 -+echo "configure:87273: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -85430,7 +87427,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path - + echo "$ac_t""no" 1>&6 - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:85434: checking whether libxml build works" >&5 -+echo "configure:87431: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -85446,7 +87443,7 @@ else + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIBNAME_mysql_error ++ unset ac_cv_lib_mcrypt_mcrypt_module_open ++ ++ { echo "configure: error: Sorry, I was not able to diagnose which libmcrypt version you have installed." 1>&2; exit 1; } + +- { echo "configure: error: mysql configure failed. Please check config.log for more information." 1>&2; exit 1; } +- - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:87458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- - LIBS=$old_LIBS -@@ -85807,7 +87804,7 @@ fi - php_enable_sockets=no +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- ++fi - echo $ac_n "checking whether to enable sockets support""... $ac_c" 1>&6 --echo "configure:85811: checking whether to enable sockets support" >&5 -+echo "configure:87808: checking whether to enable sockets support" >&5 - # Check whether --enable-sockets or --disable-sockets was given. - if test "${enable_sockets+set}" = set; then - enableval="$enable_sockets" -@@ -85849,13 +87846,13 @@ echo "$ac_t""$ext_output" 1>&6 - - if test "$PHP_SOCKETS" != "no"; then - echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6 --echo "configure:85853: checking for struct cmsghdr" >&5 -+echo "configure:87850: checking for struct cmsghdr" >&5 - if eval "test \"`echo '$''{'ac_cv_cmsghdr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - cat > conftest.$ac_ext < -@@ -85864,7 +87861,7 @@ int main() { - struct cmsghdr s; s - ; return 0; } - EOF --if { (eval echo configure:85868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:87865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cmsghdr=yes - else -@@ -85889,12 +87886,12 @@ EOF - for ac_func in hstrerror socketpair - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:85893: checking for $ac_func" >&5 -+echo "configure:87890: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:87918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -85945,17 +87942,17 @@ done - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:85949: checking for $ac_hdr" >&5 -+echo "configure:87946: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:85959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:87956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -85982,7 +87979,7 @@ fi - done +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` ++ if test "$ext_shared" = "yes"; then ++ MCRYPT_SHARED_LIBADD="-lmcrypt $MCRYPT_SHARED_LIBADD" ++ if test -n "$MCRYPT_DIR/$PHP_LIBDIR"; then + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$MCRYPT_DIR/$PHP_LIBDIR" || echo "$MCRYPT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MCRYPT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MCRYPT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/$PHP_LIBDIR\"`" + fi - cat > conftest.$ac_ext < -@@ -85992,7 +87989,7 @@ int main() { - static struct msghdr tp; int n = (int) tp.msg_flags; return n - ; return 0; } - EOF --if { (eval echo configure:85996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:87993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - : - else - echo "configure: failed program was:" >&5 -@@ -86326,7 +88323,7 @@ fi +- ;; +- esac +- done ++ fi ++ else ++ +- echo $ac_n "checking for mysql_errno in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:60317: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_errno | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$MYSQL_LIBNAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIBNAME_mysql_errno +- +- { echo "configure: error: Try adding --with-zlib-dir=. Please check config.log for more information." 1>&2; exit 1; } +- +- +-fi +- +- MYSQL_LIBS="-lz" +- fi +- +- +-fi +- +- +- +- +- if test "$ext_shared" = "yes"; then +- MYSQL_SHARED_LIBADD="-l$MYSQL_LIBNAME $MYSQL_SHARED_LIBADD" +- if test -n "$MYSQL_LIB_DIR"; then +- +- if test "$MYSQL_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$MYSQL_LIB_DIR" != "/usr/lib"; then +- +- if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$MYSQL_LIB_DIR +- else +- +- ep_dir="`echo $MYSQL_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- MYSQL_SHARED_LIBADD="-L$ai_p $MYSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$MYSQL_LIB_DIR"; then ++ if test -n "$MCRYPT_DIR/$PHP_LIBDIR"; then + +- if test "$MYSQL_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$MYSQL_LIB_DIR" != "/usr/lib"; then ++ if test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MCRYPT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$MYSQL_LIB_DIR ++ if test -z "$MCRYPT_DIR/$PHP_LIBDIR" || echo "$MCRYPT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MCRYPT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $MYSQL_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MCRYPT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`" ++ ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/$PHP_LIBDIR\"`" + fi - echo $ac_n "checking whether zend_object_value is packed""... $ac_c" 1>&6 --echo "configure:86330: checking whether zend_object_value is packed" >&5 -+echo "configure:88327: checking whether zend_object_value is packed" >&5 - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$INCLUDES -I$abs_srcdir $CPPFLAGS" - if test "$cross_compiling" = yes; then -@@ -86336,7 +88333,7 @@ echo "configure:86330: checking whether + +@@ -60455,10 +60663,10 @@ fi + fi - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:88346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- case $MYSQL_LIBNAME in ++ case mcrypt in + c|c_r|pthread*) ;; + *) +- LIBS="-l$MYSQL_LIBNAME $LIBS" ++ LIBS="-lmcrypt $LIBS" + ;; + esac + +@@ -60469,16 +60677,16 @@ fi + + - ac_result=1 -@@ -86709,7 +88706,7 @@ but you've either not enabled pcre, or h - php_with_sqlite=yes +- if test "$MYSQL_INC_DIR" != "/usr/include"; then ++ if test "$MCRYPT_DIR/include" != "/usr/include"; then + +- if test -z "$MYSQL_INC_DIR" || echo "$MYSQL_INC_DIR" | grep '^/' >/dev/null ; then +- ai_p=$MYSQL_INC_DIR ++ if test -z "$MCRYPT_DIR/include" || echo "$MCRYPT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$MCRYPT_DIR/include + else + +- ep_dir="`echo $MYSQL_INC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MCRYPT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MYSQL_INC_DIR\"`" ++ ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/include\"`" + fi - echo $ac_n "checking for sqlite support""... $ac_c" 1>&6 --echo "configure:86713: checking for sqlite support" >&5 -+echo "configure:88710: checking for sqlite support" >&5 - # Check whether --with-sqlite or --without-sqlite was given. - if test "${with_sqlite+set}" = set; then - withval="$with_sqlite" -@@ -86753,7 +88750,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_enable_sqlite_utf8=no - - echo $ac_n "checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)""... $ac_c" 1>&6 --echo "configure:86757: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5 -+echo "configure:88754: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5 - # Check whether --enable-sqlite-utf8 or --disable-sqlite-utf8 was given. - if test "${enable_sqlite_utf8+set}" = set; then - enableval="$enable_sqlite_utf8" -@@ -86781,13 +88778,13 @@ if test "$PHP_SQLITE" != "no"; then - if test "$PHP_PDO" != "no"; then - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:86785: checking for PDO includes" >&5 -+echo "configure:88782: checking for PDO includes" >&5 - if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 --echo "configure:86791: checking for PDO includes" >&5 -+echo "configure:88788: checking for PDO includes" >&5 - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then -@@ -86821,7 +88818,7 @@ EOF - SQLITE_DIR=$PHP_SQLITE - else # search default path list - echo $ac_n "checking for sqlite files in default path""... $ac_c" 1>&6 --echo "configure:86825: checking for sqlite files in default path" >&5 -+echo "configure:88822: checking for sqlite files in default path" >&5 - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - SQLITE_DIR=$i -@@ -86933,7 +88930,7 @@ echo "configure:86825: checking for sqli - done +@@ -60500,91 +60708,23 @@ fi + fi - echo $ac_n "checking for sqlite_open in -lsqlite""... $ac_c" 1>&6 --echo "configure:86937: checking for sqlite_open in -lsqlite" >&5 -+echo "configure:88934: checking for sqlite_open in -lsqlite" >&5 - ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -86941,7 +88938,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsqlite $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:88953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -87125,7 +89122,7 @@ fi - # Extract the first word of "lemon", so it can be a program name with args. - set dummy lemon; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:87129: checking for $ac_word" >&5 -+echo "configure:89126: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_LEMON'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87153,7 +89150,7 @@ fi - if test "$LEMON"; then - echo $ac_n "checking for lemon version""... $ac_c" 1>&6 --echo "configure:87157: checking for lemon version" >&5 -+echo "configure:89154: checking for lemon version" >&5 - if eval "test \"`echo '$''{'php_cv_lemon_version'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87566,7 +89563,7 @@ but you've either not enabled pdo, or ha +- MYSQL_MODULE_TYPE=external +- MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS" +- MYSQL_INCLUDE=-I$MYSQL_INC_DIR +- +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_MODULE_TYPE" +- +- +- +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_LIBS" +- +- +- +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_INCLUDE" +- +- +-fi +- +-if test "$PHP_MYSQL" != "no"; then +- echo $ac_n "checking for MySQL UNIX socket location""... $ac_c" 1>&6 +-echo "configure:60530: checking for MySQL UNIX socket location" >&5 +- if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then +- MYSQL_SOCK=$PHP_MYSQL_SOCK +- cat >> confdefs.h <&6 +- elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then +- +- for i in \ +- /var/run/mysqld/mysqld.sock \ +- /var/tmp/mysql.sock \ +- /var/run/mysql/mysql.sock \ +- /var/lib/mysql/mysql.sock \ +- /var/mysql/mysql.sock \ +- /usr/local/mysql/var/mysql.sock \ +- /Private/tmp/mysql.sock \ +- /private/tmp/mysql.sock \ +- /tmp/mysql.sock \ +- ; do +- if test -r $i; then +- MYSQL_SOCK=$i +- break 2 +- fi +- done +- +- if test -n "$MYSQL_SOCK"; then +- cat >> confdefs.h <&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_MYSQL 1 +-EOF ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MCRYPT_SHARED_LIBADD" - echo $ac_n "checking size of char *""... $ac_c" 1>&6 --echo "configure:87570: checking size of char *" >&5 -+echo "configure:89567: checking size of char *" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87574,18 +89571,19 @@ else - ac_cv_sizeof_char_p=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(char *)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:87589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:89587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_char_p=`cat conftestval` - else -@@ -87647,12 +89645,12 @@ EOF - for ac_func in usleep nanosleep - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:87651: checking for $ac_func" >&5 -+echo "configure:89649: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:89677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -87703,17 +89701,17 @@ done - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:87707: checking for $ac_hdr" >&5 -+echo "configure:89705: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:87717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:89715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -87744,7 +89742,7 @@ fi + ac_extra= + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_MYSQL_SHARED=no ++ PHP_MCRYPT_SHARED=no + + +- case ext/mysql in ++ case ext/mcrypt in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -60599,7 +60739,7 @@ EOF - echo $ac_n "checking whether flush should be called explicitly after a buffered io""... $ac_c" 1>&6 --echo "configure:87748: checking whether flush should be called explicitly after a buffered io" >&5 -+echo "configure:89746: checking whether flush should be called explicitly after a buffered io" >&5 - if eval "test \"`echo '$''{'ac_cv_flush_io'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87755,7 +89753,7 @@ if test "$cross_compiling" = yes; then - else - cat > conftest.$ac_ext < -@@ -87793,7 +89791,7 @@ int main(int argc, char **argv) - } - EOF --if { (eval echo configure:87797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:89795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- EXT_STATIC="$EXT_STATIC mysql" ++ EXT_STATIC="$EXT_STATIC mcrypt" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC mysql" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mcrypt" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_MYSQL_SHARED=yes ++ PHP_MCRYPT_SHARED=yes + +- case ext/mysql in ++ case ext/mcrypt in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac - ac_cv_flush_io=no -@@ -87821,7 +89819,7 @@ fi - - if test "$ac_cv_func_crypt" = "no"; then - echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 --echo "configure:87825: checking for crypt in -lcrypt" >&5 -+echo "configure:89823: checking for crypt in -lcrypt" >&5 - ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -87829,7 +89827,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lcrypt $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:89842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -87869,7 +89867,7 @@ fi - fi - echo $ac_n "checking for standard DES crypt""... $ac_c" 1>&6 --echo "configure:87873: checking for standard DES crypt" >&5 -+echo "configure:89871: checking for standard DES crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_des'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87880,7 +89878,7 @@ else +@@ -60648,14 +60788,14 @@ EOF - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:89901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + old_IFS=$IFS +- for ac_src in php_mysql.c; do ++ for ac_src in mcrypt.c mcrypt_filter.c; do - ac_cv_crypt_des=yes -@@ -87920,7 +89918,7 @@ fi - echo "$ac_t""$ac_cv_crypt_des" 1>&6 - - echo $ac_n "checking for extended DES crypt""... $ac_c" 1>&6 --echo "configure:87924: checking for extended DES crypt" >&5 -+echo "configure:89922: checking for extended DES crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_ext_des'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87931,7 +89929,7 @@ else + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_mysql="$shared_objects_mysql $ac_bdir$ac_obj.lo" ++ shared_objects_mcrypt="$shared_objects_mcrypt $ac_bdir$ac_obj.lo" - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:89952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmysql.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmcrypt.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmysql.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmcrypt.$suffix" + fi - ac_cv_crypt_ext_des=yes -@@ -87971,7 +89969,7 @@ fi - echo "$ac_t""$ac_cv_crypt_ext_des" 1>&6 +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcrypt" - echo $ac_n "checking for MD5 crypt""... $ac_c" 1>&6 --echo "configure:87975: checking for MD5 crypt" >&5 -+echo "configure:89973: checking for MD5 crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_md5'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -87982,7 +89980,7 @@ if test "$cross_compiling" = yes; then + cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +@@ -60715,31 +60855,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/mysql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/mysql.so '$ext_builddir'/mysql.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/mcrypt.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(MCRYPT_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/mcrypt.so '$ext_builddir'/mcrypt.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(MYSQL, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(MCRYPT, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(MCRYPT_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/mysql.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/mcrypt.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/mysql.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/mcrypt.$suffix" + fi - ac_cv_crypt_md5=yes -@@ -88031,7 +90029,7 @@ fi - echo "$ac_t""$ac_cv_crypt_md5" 1>&6 +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcrypt" - echo $ac_n "checking for Blowfish crypt""... $ac_c" 1>&6 --echo "configure:88035: checking for Blowfish crypt" >&5 -+echo "configure:90033: checking for Blowfish crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_blowfish'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -88042,7 +90040,7 @@ if test "$cross_compiling" = yes; then + cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_crypt_blowfish=yes -@@ -88088,7 +90086,7 @@ fi - echo "$ac_t""$ac_cv_crypt_blowfish" 1>&6 - - echo $ac_n "checking for SHA512 crypt""... $ac_c" 1>&6 --echo "configure:88092: checking for SHA512 crypt" >&5 -+echo "configure:90090: checking for SHA512 crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_SHA512'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -88099,7 +90097,7 @@ if test "$cross_compiling" = yes; then +@@ -60747,22 +60887,22 @@ EOF + ;; + esac + cat >> confdefs.h < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_MYSQL_SHARED=no ++ PHP_MCRYPT_SHARED=no + case "$PHP_SAPI" in + cgi|embed) + - ac_cv_crypt_SHA512=yes -@@ -88144,7 +90142,7 @@ fi - echo "$ac_t""$ac_cv_crypt_SHA512" 1>&6 - - echo $ac_n "checking for SHA256 crypt""... $ac_c" 1>&6 --echo "configure:88148: checking for SHA256 crypt" >&5 -+echo "configure:90146: checking for SHA256 crypt" >&5 - if eval "test \"`echo '$''{'ac_cv_crypt_SHA256'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -88155,7 +90153,7 @@ if test "$cross_compiling" = yes; then +- case ext/mysql in ++ case ext/mcrypt in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -60777,7 +60917,7 @@ EOF - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then + old_IFS=$IFS +- for ac_src in php_mysql.c; do ++ for ac_src in mcrypt.c mcrypt_filter.c; do - ac_cv_crypt_SHA256=yes -@@ -88203,13 +90201,13 @@ echo "$ac_t""$ac_cv_crypt_SHA256" 1>&6 - if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then + IFS=. + set $ac_src +@@ -60800,15 +60940,15 @@ EOF + done - echo $ac_n "checking whether the compiler supports __alignof__""... $ac_c" 1>&6 --echo "configure:88207: checking whether the compiler supports __alignof__" >&5 -+echo "configure:90205: checking whether the compiler supports __alignof__" >&5 - if eval "test \"`echo '$''{'ac_cv_alignof_exists'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:90221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_alignof_exists=yes -@@ -88244,13 +90242,13 @@ EOF - fi +@@ -60823,7 +60963,7 @@ EOF - echo $ac_n "checking whether the compiler supports aligned attribute""... $ac_c" 1>&6 --echo "configure:88248: checking whether the compiler supports aligned attribute" >&5 -+echo "configure:90246: checking whether the compiler supports aligned attribute" >&5 - if eval "test \"`echo '$''{'ac_cv_attribute_aligned'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:90262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_attribute_aligned=yes -@@ -88439,12 +90437,12 @@ fi - for ac_func in getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:88443: checking for $ac_func" >&5 -+echo "configure:90441: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -88492,7 +90490,7 @@ fi - done - echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 --echo "configure:88496: checking for working fnmatch" >&5 -+echo "configure:90494: checking for working fnmatch" >&5 - if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -88503,11 +90501,11 @@ if test "$cross_compiling" = yes; then - ac_cv_func_fnmatch_works=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_func_fnmatch_works=yes - else -@@ -88534,12 +90532,12 @@ fi - for ac_func in fork CreateProcess - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:88538: checking for $ac_func" >&5 -+echo "configure:90536: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -88592,7 +90590,7 @@ fi - done + if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=mysql ++ PHP_PECL_EXTENSION=mcrypt + + PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" - echo $ac_n "checking if your OS can spawn processes with inherited handles""... $ac_c" 1>&6 --echo "configure:88596: checking if your OS can spawn processes with inherited handles" >&5 -+echo "configure:90594: checking if your OS can spawn processes with inherited handles" >&5 - if test "$php_can_support_proc_open" = "yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -@@ -88616,12 +90614,12 @@ fi - unset found - - echo $ac_n "checking for res_nsearch""... $ac_c" 1>&6 --echo "configure:88620: checking for res_nsearch" >&5 -+echo "configure:90618: checking for res_nsearch" >&5 - if eval "test \"`echo '$''{'ac_cv_func_res_nsearch'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_res_nsearch=yes" - else -@@ -88662,12 +90660,12 @@ if eval "test \"`echo '$ac_cv_func_'res_ - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __res_nsearch""... $ac_c" 1>&6 --echo "configure:88666: checking for __res_nsearch" >&5 -+echo "configure:90664: checking for __res_nsearch" >&5 - if eval "test \"`echo '$''{'ac_cv_func___res_nsearch'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension mysql, which depends on extension mysqlnd, +-but you've either not enabled mysqlnd, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- cat >> confdefs.h <<\EOF +-#define MYSQL_USE_MYSQLND 1 +-EOF +- +- fi + fi - ; return 0; } - EOF --if { (eval echo configure:88694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func___res_nsearch=yes" - else -@@ -88728,7 +90726,7 @@ EOF - unset ac_cv_lib_resolv___res_nsearch - unset found - echo $ac_n "checking for res_nsearch in -lresolv""... $ac_c" 1>&6 --echo "configure:88732: checking for res_nsearch in -lresolv" >&5 -+echo "configure:90730: checking for res_nsearch in -lresolv" >&5 - ac_lib_var=`echo resolv'_'res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -88736,7 +90734,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -88767,7 +90765,7 @@ else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __res_nsearch in -lresolv""... $ac_c" 1>&6 --echo "configure:88771: checking for __res_nsearch in -lresolv" >&5 -+echo "configure:90769: checking for __res_nsearch in -lresolv" >&5 - ac_lib_var=`echo resolv'_'__res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -88775,7 +90773,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -88818,11 +90816,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -88864,7 +90862,7 @@ EOF - unset ac_cv_lib_bind___res_nsearch - unset found - echo $ac_n "checking for res_nsearch in -lbind""... $ac_c" 1>&6 --echo "configure:88868: checking for res_nsearch in -lbind" >&5 -+echo "configure:90866: checking for res_nsearch in -lbind" >&5 - ac_lib_var=`echo bind'_'res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -88872,7 +90870,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -88903,7 +90901,7 @@ else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __res_nsearch in -lbind""... $ac_c" 1>&6 --echo "configure:88907: checking for __res_nsearch in -lbind" >&5 -+echo "configure:90905: checking for __res_nsearch in -lbind" >&5 - ac_lib_var=`echo bind'_'__res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -88911,7 +90909,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:90924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -88954,11 +90952,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:90960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -89000,7 +90998,7 @@ EOF - unset ac_cv_lib_socket___res_nsearch - unset found - echo $ac_n "checking for res_nsearch in -lsocket""... $ac_c" 1>&6 --echo "configure:89004: checking for res_nsearch in -lsocket" >&5 -+echo "configure:91002: checking for res_nsearch in -lsocket" >&5 - ac_lib_var=`echo socket'_'res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89008,7 +91006,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89039,7 +91037,7 @@ else - echo "$ac_t""no" 1>&6 +-php_with_mysqli=no ++php_with_mssql=no - echo $ac_n "checking for __res_nsearch in -lsocket""... $ac_c" 1>&6 --echo "configure:89043: checking for __res_nsearch in -lsocket" >&5 -+echo "configure:91041: checking for __res_nsearch in -lsocket" >&5 - ac_lib_var=`echo socket'_'__res_nsearch | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89047,7 +91045,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89090,11 +91088,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:91096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes +-echo $ac_n "checking for MySQLi support""... $ac_c" 1>&6 +-echo "configure:60903: checking for MySQLi support" >&5 +-# Check whether --with-mysqli or --without-mysqli was given. +-if test "${with_mysqli+set}" = set; then +- withval="$with_mysqli" +- PHP_MYSQLI=$withval ++echo $ac_n "checking for MSSQL support via FreeTDS""... $ac_c" 1>&6 ++echo "configure:61014: checking for MSSQL support via FreeTDS" >&5 ++# Check whether --with-mssql or --without-mssql was given. ++if test "${with_mssql+set}" = set; then ++ withval="$with_mssql" ++ PHP_MSSQL=$withval else -@@ -89151,12 +91149,12 @@ EOF - unset found - echo $ac_n "checking for dns_search""... $ac_c" 1>&6 --echo "configure:89155: checking for dns_search" >&5 -+echo "configure:91153: checking for dns_search" >&5 - if eval "test \"`echo '$''{'ac_cv_func_dns_search'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dns_search=yes" - else -@@ -89197,12 +91195,12 @@ if eval "test \"`echo '$ac_cv_func_'dns_ - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __dns_search""... $ac_c" 1>&6 --echo "configure:89201: checking for __dns_search" >&5 -+echo "configure:91199: checking for __dns_search" >&5 - if eval "test \"`echo '$''{'ac_cv_func___dns_search'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func___dns_search=yes" - else -@@ -89263,7 +91261,7 @@ EOF - unset ac_cv_lib_resolv___dns_search - unset found - echo $ac_n "checking for dns_search in -lresolv""... $ac_c" 1>&6 --echo "configure:89267: checking for dns_search in -lresolv" >&5 -+echo "configure:91265: checking for dns_search in -lresolv" >&5 - ac_lib_var=`echo resolv'_'dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89271,7 +91269,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89302,7 +91300,7 @@ else - echo "$ac_t""no" 1>&6 +@@ -60915,12 +61026,12 @@ fi - echo $ac_n "checking for __dns_search in -lresolv""... $ac_c" 1>&6 --echo "configure:89306: checking for __dns_search in -lresolv" >&5 -+echo "configure:91304: checking for __dns_search in -lresolv" >&5 - ac_lib_var=`echo resolv'_'__dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89310,7 +91308,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89353,11 +91351,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:91359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -89399,7 +91397,7 @@ EOF - unset ac_cv_lib_bind___dns_search - unset found - echo $ac_n "checking for dns_search in -lbind""... $ac_c" 1>&6 --echo "configure:89403: checking for dns_search in -lbind" >&5 -+echo "configure:91401: checking for dns_search in -lbind" >&5 - ac_lib_var=`echo bind'_'dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89407,7 +91405,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89438,7 +91436,7 @@ else - echo "$ac_t""no" 1>&6 + ext_output="yes, shared" + ext_shared=yes +-case $PHP_MYSQLI in ++case $PHP_MSSQL in + shared,*) +- PHP_MYSQLI=`echo "$PHP_MYSQLI"|$SED 's/^shared,//'` ++ PHP_MSSQL=`echo "$PHP_MSSQL"|$SED 's/^shared,//'` + ;; + shared) +- PHP_MYSQLI=yes ++ PHP_MSSQL=yes + ;; + no) + ext_output=no +@@ -60939,135 +61050,95 @@ echo "$ac_t""$ext_output" 1>&6 - echo $ac_n "checking for __dns_search in -lbind""... $ac_c" 1>&6 --echo "configure:89442: checking for __dns_search in -lbind" >&5 -+echo "configure:91440: checking for __dns_search in -lbind" >&5 - ac_lib_var=`echo bind'_'__dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89446,7 +91444,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89489,11 +91487,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:91495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -89535,7 +91533,7 @@ EOF - unset ac_cv_lib_socket___dns_search - unset found - echo $ac_n "checking for dns_search in -lsocket""... $ac_c" 1>&6 --echo "configure:89539: checking for dns_search in -lsocket" >&5 -+echo "configure:91537: checking for dns_search in -lsocket" >&5 - ac_lib_var=`echo socket'_'dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89543,7 +91541,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89574,7 +91572,7 @@ else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __dns_search in -lsocket""... $ac_c" 1>&6 --echo "configure:89578: checking for __dns_search in -lsocket" >&5 -+echo "configure:91576: checking for __dns_search in -lsocket" >&5 - ac_lib_var=`echo socket'_'__dns_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89582,7 +91580,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89625,11 +91623,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:91631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -89686,12 +91684,12 @@ EOF - unset found - - echo $ac_n "checking for dn_expand""... $ac_c" 1>&6 --echo "configure:89690: checking for dn_expand" >&5 -+echo "configure:91688: checking for dn_expand" >&5 - if eval "test \"`echo '$''{'ac_cv_func_dn_expand'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dn_expand=yes" - else -@@ -89732,12 +91730,12 @@ if eval "test \"`echo '$ac_cv_func_'dn_e - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __dn_expand""... $ac_c" 1>&6 --echo "configure:89736: checking for __dn_expand" >&5 -+echo "configure:91734: checking for __dn_expand" >&5 - if eval "test \"`echo '$''{'ac_cv_func___dn_expand'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func___dn_expand=yes" - else -@@ -89798,7 +91796,7 @@ EOF - unset ac_cv_lib_resolv___dn_expand - unset found - echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6 --echo "configure:89802: checking for dn_expand in -lresolv" >&5 -+echo "configure:91800: checking for dn_expand in -lresolv" >&5 - ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89806,7 +91804,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89837,7 +91835,7 @@ else - echo "$ac_t""no" 1>&6 +-php_enable_embedded_mysqli=no +- +-echo $ac_n "checking whether to enable embedded MySQLi support""... $ac_c" 1>&6 +-echo "configure:60947: checking whether to enable embedded MySQLi support" >&5 +-# Check whether --enable-embedded_mysqli or --disable-embedded_mysqli was given. +-if test "${enable_embedded_mysqli+set}" = set; then +- enableval="$enable_embedded_mysqli" +- PHP_EMBEDDED_MYSQLI=$enableval +-else +- +- PHP_EMBEDDED_MYSQLI=no +- +- +-fi +- +- +-ext_output=$PHP_EMBEDDED_MYSQLI +-echo "$ac_t""$ext_output" 1>&6 +- +- ++ if test "$PHP_MSSQL" = "yes"; then ++ for i in /usr/local /usr; do ++ if test -f $i/include/sybdb.h; then ++ FREETDS_INSTALLATION_DIR=$i ++ FREETDS_INCLUDE_DIR=$i/include ++ break ++ elif test -f $i/include/freetds/sybdb.h; then ++ FREETDS_INSTALLATION_DIR=$i ++ FREETDS_INCLUDE_DIR=$i/include/freetds ++ break ++ fi ++ done - echo $ac_n "checking for __dn_expand in -lresolv""... $ac_c" 1>&6 --echo "configure:89841: checking for __dn_expand in -lresolv" >&5 -+echo "configure:91839: checking for __dn_expand in -lresolv" >&5 - ac_lib_var=`echo resolv'_'__dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89845,7 +91843,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89888,11 +91886,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:91894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -89934,7 +91932,7 @@ EOF - unset ac_cv_lib_bind___dn_expand - unset found - echo $ac_n "checking for dn_expand in -lbind""... $ac_c" 1>&6 --echo "configure:89938: checking for dn_expand in -lbind" >&5 -+echo "configure:91936: checking for dn_expand in -lbind" >&5 - ac_lib_var=`echo bind'_'dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89942,7 +91940,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -89973,7 +91971,7 @@ else - echo "$ac_t""no" 1>&6 ++ if test -z "$FREETDS_INSTALLATION_DIR"; then ++ { echo "configure: error: Cannot find FreeTDS in known installation directories" 1>&2; exit 1; } ++ fi - echo $ac_n "checking for __dn_expand in -lbind""... $ac_c" 1>&6 --echo "configure:89977: checking for __dn_expand in -lbind" >&5 -+echo "configure:91975: checking for __dn_expand in -lbind" >&5 - ac_lib_var=`echo bind'_'__dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -89981,7 +91979,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:91994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90024,11 +92022,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -90070,7 +92068,7 @@ EOF - unset ac_cv_lib_socket___dn_expand - unset found - echo $ac_n "checking for dn_expand in -lsocket""... $ac_c" 1>&6 --echo "configure:90074: checking for dn_expand in -lsocket" >&5 -+echo "configure:92072: checking for dn_expand in -lsocket" >&5 - ac_lib_var=`echo socket'_'dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90078,7 +92076,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90109,7 +92107,7 @@ else - echo "$ac_t""no" 1>&6 +-if test "$PHP_MYSQLI" = "mysqlnd"; then +- PHP_MYSQLND_ENABLED=yes ++ elif test "$PHP_MSSQL" != "no"; then + +-elif test "$PHP_MYSQLI" != "no"; then ++ if test -f $PHP_MSSQL/include/sybdb.h; then ++ FREETDS_INSTALLATION_DIR=$PHP_MSSQL ++ FREETDS_INCLUDE_DIR=$PHP_MSSQL/include ++ elif test -f $PHP_MSSQL/include/freetds/sybdb.h; then ++ FREETDS_INSTALLATION_DIR=$PHP_MSSQL ++ FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds ++ else ++ { echo "configure: error: Directory $PHP_MSSQL is not a FreeTDS installation directory" 1>&2; exit 1; } ++ fi ++ fi - echo $ac_n "checking for __dn_expand in -lsocket""... $ac_c" 1>&6 --echo "configure:90113: checking for __dn_expand in -lsocket" >&5 -+echo "configure:92111: checking for __dn_expand in -lsocket" >&5 - ac_lib_var=`echo socket'_'__dn_expand | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90117,7 +92115,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90160,11 +92158,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -90221,12 +92219,12 @@ EOF - unset found +- if test "$PHP_MYSQLI" = "yes"; then +- MYSQL_CONFIG=`$php_shtool path mysql_config` +- else +- MYSQL_CONFIG=$PHP_MYSQLI ++ if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then ++ { echo "configure: error: Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a|so" 1>&2; exit 1; } + fi + +- MYSQL_LIB_NAME='mysqlclient' +- if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_EMBEDDED_MYSQLI 1 +-EOF +- +- MYSQL_LIB_CFG='--libmysqld-libs' +- mysqli_extra_sources="mysqli_embedded.c" +- elif test "$enable_maintainer_zts" = "yes"; then +- MYSQL_LIB_CFG='--libs_r' +- MYSQL_LIB_NAME='mysqlclient_r' +- else +- MYSQL_LIB_CFG='--libs' +- fi - echo $ac_n "checking for dn_skipname""... $ac_c" 1>&6 --echo "configure:90225: checking for dn_skipname" >&5 -+echo "configure:92223: checking for dn_skipname" >&5 - if eval "test \"`echo '$''{'ac_cv_func_dn_skipname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < /dev/null 2>&1; then +- MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | $SED -e "s/'//g"` +- MYSQLI_LIBLINE=`$MYSQL_CONFIG $MYSQL_LIB_CFG | $SED -e "s/'//g"` ++ if test "$FREETDS_INCLUDE_DIR" != "/usr/include"; then ++ ++ if test -z "$FREETDS_INCLUDE_DIR" || echo "$FREETDS_INCLUDE_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$FREETDS_INCLUDE_DIR + else +- echo "$ac_t""mysql_config not found" 1>&6 +- { echo "configure: error: Please reinstall the mysql distribution" 1>&2; exit 1; } ++ ++ ep_dir="`echo $FREETDS_INCLUDE_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$FREETDS_INCLUDE_DIR\"`" + fi - ; return 0; } - EOF --if { (eval echo configure:90253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dn_skipname=yes" - else -@@ -90267,12 +92265,12 @@ if eval "test \"`echo '$ac_cv_func_'dn_s - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __dn_skipname""... $ac_c" 1>&6 --echo "configure:90271: checking for __dn_skipname" >&5 -+echo "configure:92269: checking for __dn_skipname" >&5 - if eval "test \"`echo '$''{'ac_cv_func___dn_skipname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func___dn_skipname=yes" - else -@@ -90333,7 +92331,7 @@ EOF - unset ac_cv_lib_resolv___dn_skipname - unset found - echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6 --echo "configure:90337: checking for dn_skipname in -lresolv" >&5 -+echo "configure:92335: checking for dn_skipname in -lresolv" >&5 - ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90341,7 +92339,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90372,7 +92370,7 @@ else - echo "$ac_t""no" 1>&6 +- fi +- ;; +- esac ++ fi - echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6 --echo "configure:90376: checking for __dn_skipname in -lresolv" >&5 -+echo "configure:92374: checking for __dn_skipname in -lresolv" >&5 - ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90380,7 +92378,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90423,11 +92421,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -90469,7 +92467,7 @@ EOF - unset ac_cv_lib_bind___dn_skipname - unset found - echo $ac_n "checking for dn_skipname in -lbind""... $ac_c" 1>&6 --echo "configure:90473: checking for dn_skipname in -lbind" >&5 -+echo "configure:92471: checking for dn_skipname in -lbind" >&5 - ac_lib_var=`echo bind'_'dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90477,7 +92475,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90508,7 +92506,7 @@ else - echo "$ac_t""no" 1>&6 ++ - echo $ac_n "checking for __dn_skipname in -lbind""... $ac_c" 1>&6 --echo "configure:90512: checking for __dn_skipname in -lbind" >&5 -+echo "configure:92510: checking for __dn_skipname in -lbind" >&5 - ac_lib_var=`echo bind'_'__dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90516,7 +92514,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90559,11 +92557,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -90605,7 +92603,7 @@ EOF - unset ac_cv_lib_socket___dn_skipname - unset found - echo $ac_n "checking for dn_skipname in -lsocket""... $ac_c" 1>&6 --echo "configure:90609: checking for dn_skipname in -lsocket" >&5 -+echo "configure:92607: checking for dn_skipname in -lsocket" >&5 - ac_lib_var=`echo socket'_'dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90613,7 +92611,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90644,7 +92642,7 @@ else - echo "$ac_t""no" 1>&6 +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` ++ if test "$ext_shared" = "yes"; then ++ MSSQL_SHARED_LIBADD="-lsybdb $MSSQL_SHARED_LIBADD" ++ if test -n "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" + fi - echo $ac_n "checking for __dn_skipname in -lsocket""... $ac_c" 1>&6 --echo "configure:90648: checking for __dn_skipname in -lsocket" >&5 -+echo "configure:92646: checking for __dn_skipname in -lsocket" >&5 - ac_lib_var=`echo socket'_'__dn_skipname | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90652,7 +92650,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90695,11 +92693,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -90758,12 +92756,12 @@ EOF - unset found + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ MSSQL_SHARED_LIBADD="-L$ai_p $MSSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MSSQL_SHARED_LIBADD" + else + - echo $ac_n "checking for res_search""... $ac_c" 1>&6 --echo "configure:90762: checking for res_search" >&5 -+echo "configure:92760: checking for res_search" >&5 - if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_res_search=yes" - else -@@ -90804,12 +92802,12 @@ if eval "test \"`echo '$ac_cv_func_'res_ - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for __res_search""... $ac_c" 1>&6 --echo "configure:90808: checking for __res_search" >&5 -+echo "configure:92806: checking for __res_search" >&5 - if eval "test \"`echo '$''{'ac_cv_func___res_search'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 +-echo "configure:61098: checking for mysql_set_server_option in -l$MYSQL_LIB_NAME" >&5 +-ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_server_option | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$MYSQL_LIB_NAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- for ac_i in $MYSQLI_INCLINE; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- ;; +- esac +- done ++ fi ++ else ++ - ; return 0; } - EOF --if { (eval echo configure:90836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func___res_search=yes" - else -@@ -90870,7 +92868,7 @@ EOF - unset ac_cv_lib_resolv___res_search - unset found - echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 --echo "configure:90874: checking for res_search in -lresolv" >&5 -+echo "configure:92872: checking for res_search in -lresolv" >&5 - ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90878,7 +92876,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90909,7 +92907,7 @@ else - echo "$ac_t""no" 1>&6 ++ if test -n "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then + +- for ac_i in $MYSQLI_LIBLINE; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- MYSQLI_SHARED_LIBADD="$MYSQLI_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- MYSQLI_SHARED_LIBADD="$MYSQLI_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- MYSQLI_SHARED_LIBADD="-L$ai_p $MYSQLI_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && MYSQLI_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQLI_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- ++ ai_p="$ep_realdir/`basename \"$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" + fi - echo $ac_n "checking for __res_search in -lresolv""... $ac_c" 1>&6 --echo "configure:90913: checking for __res_search in -lresolv" >&5 -+echo "configure:92911: checking for __res_search in -lresolv" >&5 - ac_lib_var=`echo resolv'_'__res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -90917,7 +92915,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lresolv $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:92930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -90960,11 +92958,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:92966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -91006,7 +93004,7 @@ EOF - unset ac_cv_lib_bind___res_search - unset found - echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6 --echo "configure:91010: checking for res_search in -lbind" >&5 -+echo "configure:93008: checking for res_search in -lbind" >&5 - ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -91014,7 +93012,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -91045,7 +93043,7 @@ else - echo "$ac_t""no" 1>&6 +- ;; +- esac +- done +- +- cat >> confdefs.h <<\EOF +-#define HAVE_MYSQLILIB 1 +-EOF +- + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="$MYSQLI_LIBLINE" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -61352,253 +61195,40 @@ EOF + fi + + +- fi + + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for mysql_set_character_set in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 +-echo "configure:61365: checking for mysql_set_character_set in -l$MYSQL_LIB_NAME" >&5 +-ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_character_set | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$MYSQL_LIB_NAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_set_character_set +- +- { echo "configure: error: MySQLI doesn't support versions < 4.1.13 (for MySQL 4.1.x) and < 5.0.7 for (MySQL 5.0.x) anymore. Please update your libraries." 1>&2; exit 1; } +- +- +-fi +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_set_server_option +- +- { echo "configure: error: wrong mysql library version or lib not found. Check config.log for more information." 1>&2; exit 1; } +- +- +-fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $MYSQLI_LIBLINE +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- + +- case $ac_ii in ++ case sybdb in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi ++ LIBS="-lsybdb $LIBS" + ;; + esac + + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi + + +- fi +- + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 +-echo "configure:61528: checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME" >&5 +-ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_stmt_next_result | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$MYSQL_LIB_NAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_STMT_NEXT_RESULT 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_stmt_next_result +- +- +- +-fi + +-fi + +-if test "$PHP_MYSQLI" != "no"; then +- mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \ +- mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \ +- mysqli_exception.c $mysqli_extra_sources" + +- ext_builddir=ext/mysqli +- ext_srcdir=$abs_srcdir/ext/mysqli ++ ext_builddir=ext/mssql ++ ext_srcdir=$abs_srcdir/ext/mssql + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_MYSQLI_SHARED=no ++ PHP_MSSQL_SHARED=no + + +- case ext/mysqli in ++ case ext/mssql in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -61613,7 +61243,7 @@ if test "$PHP_MYSQLI" != "no"; then + + + old_IFS=$IFS +- for ac_src in $mysqli_sources; do ++ for ac_src in php_mssql.c; do + + IFS=. + set $ac_src +@@ -61636,18 +61266,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC mysqli" ++ EXT_STATIC="$EXT_STATIC mssql" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC mysqli" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mssql" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_MYSQLI_SHARED=yes ++ PHP_MSSQL_SHARED=yes + +- case ext/mysqli in ++ case ext/mssql in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -61662,14 +61292,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in $mysqli_sources; do ++ for ac_src in php_mssql.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_mysqli="$shared_objects_mysqli $ac_bdir$ac_obj.lo" ++ shared_objects_mssql="$shared_objects_mssql $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -61692,31 +61322,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmysqli.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) $(PHPMYSQLI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmysqli.so '$ext_builddir'/phpmysqli.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmssql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmssql.so '$ext_builddir'/phpmssql.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMYSQLI, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMSSQL, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) $(PHPMYSQLI_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmysqli.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmssql.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmysqli.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmssql.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysqli" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mssql" + + cat >>Makefile.objects<&6 --echo "configure:91049: checking for __res_search in -lbind" >&5 -+echo "configure:93047: checking for __res_search in -lbind" >&5 - ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -91053,7 +93051,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lbind $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -91096,11 +93094,11 @@ fi - found=no - else - cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -91142,7 +93140,7 @@ EOF - unset ac_cv_lib_socket___res_search - unset found - echo $ac_n "checking for res_search in -lsocket""... $ac_c" 1>&6 --echo "configure:91146: checking for res_search in -lsocket" >&5 -+echo "configure:93144: checking for res_search in -lsocket" >&5 - ac_lib_var=`echo socket'_'res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -91150,7 +93148,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + + fi + fi + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_MYSQLI_SHARED=no ++ PHP_MSSQL_SHARED=no + case "$PHP_SAPI" in + cgi|embed) + + +- case ext/mysqli in ++ case ext/mssql in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + + + +@@ -61791,7 +61421,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in $mysqli_sources; do ++ for ac_src in php_mssql.c; do + + IFS=. + set $ac_src +@@ -61814,15 +61444,15 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC mysqli" ++ EXT_STATIC="$EXT_STATIC mssql" + ;; + *) + + +- case ext/mysqli in ++ case ext/mssql in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -61837,7 +61467,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in $mysqli_sources; do ++ for ac_src in php_mssql.c; do + + IFS=. + set $ac_src +@@ -61862,7 +61492,7 @@ EOF + + ;; + esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC mysqli" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mssql" + fi + + +@@ -61871,71 +61501,165 @@ EOF + + + if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=mysqli ++ PHP_PECL_EXTENSION=mssql + + PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + + fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQLI_SHARED_LIBADD" ++ echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6 ++echo "configure:61512: checking for dnet_addr in -ldnet_stub" >&5 ++ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-ldnet_stub $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ if test "$ext_shared" = "yes"; then ++ MSSQL_SHARED_LIBADD="-ldnet_stub $MSSQL_SHARED_LIBADD" ++ if test -n ""; then + ++ if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ if test -z "" || echo "" | grep '^/' >/dev/null ; then ++ ai_p= ++ else ++ ++ ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ MSSQL_SHARED_LIBADD="-L$ai_p $MSSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MSSQL_SHARED_LIBADD" ++ else ++ + +- unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" ++ eval "LIBPATH$unique=set" + +- INSTALL_HEADERS="$INSTALL_HEADERS $header_file" +- ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- done ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n ""; then ++ ++ if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ if test -z "" || echo "" | grep '^/' >/dev/null ; then ++ ai_p= ++ else ++ ++ ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + + +- if test "$PHP_MYSQLI" = "mysqlnd"; then + +- am_i_shared=$PHP_MYSQLI_SHARED +- is_it_shared=$PHP_MYSQLND_SHARED +- is_it_enabled=$PHP_MYSQLND +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension mysqli to build statically, but it +-depends on extension mysqlnd, which you've configured to build shared. +-You either need to build mysqli shared or build mysqlnd statically for the +-build to be successful. +-" 1>&2; exit 1; } + fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension mysqli, which depends on extension mysqlnd, +-but you've either not enabled mysqlnd, or have disabled it. +-" 1>&2; exit 1; } ++ + fi + +- cat >> confdefs.h <<\EOF +-#define MYSQLI_USE_MYSQLND 1 +-EOF ++ ++ case dnet_stub in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ldnet_stub $LIBS" ++ ;; ++ esac ++ ++ ++ + + fi +-fi + + +-if test -z "$SED"; then +- PHP_OCI8_SED="sed"; ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBDNET_STUB 1 ++EOF ++ ++ else -@@ -91181,7 +93179,7 @@ else - echo "$ac_t""no" 1>&6 +- PHP_OCI8_SED="$SED"; ++ echo "$ac_t""no" 1>&6 + fi + ++ cat >> confdefs.h <<\EOF ++#define HAVE_MSSQL 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_FREETDS 1 ++EOF + ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MSSQL_SHARED_LIBADD" + ++fi + + + +@@ -61944,18 +61668,18 @@ fi + + + +-php_with_oci8=no ++php_with_mysql=no + +-echo $ac_n "checking for Oracle (OCI8) support""... $ac_c" 1>&6 +-echo "configure:61951: checking for Oracle (OCI8) support" >&5 +-# Check whether --with-oci8 or --without-oci8 was given. +-if test "${with_oci8+set}" = set; then +- withval="$with_oci8" +- PHP_OCI8=$withval ++echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 ++echo "configure:61675: checking for MySQL support" >&5 ++# Check whether --with-mysql or --without-mysql was given. ++if test "${with_mysql+set}" = set; then ++ withval="$with_mysql" ++ PHP_MYSQL=$withval + else + +- PHP_OCI8=no +- test "$PHP_ENABLE_ALL" && PHP_OCI8=$PHP_ENABLE_ALL ++ PHP_MYSQL=no ++ test "$PHP_ENABLE_ALL" && PHP_MYSQL=$PHP_ENABLE_ALL + + fi + +@@ -61963,12 +61687,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_OCI8 in ++case $PHP_MYSQL in + shared,*) +- PHP_OCI8=`echo "$PHP_OCI8"|$SED 's/^shared,//'` ++ PHP_MYSQL=`echo "$PHP_MYSQL"|$SED 's/^shared,//'` + ;; + shared) +- PHP_OCI8=yes ++ PHP_MYSQL=yes + ;; + no) + ext_output=no +@@ -61987,364 +61711,318 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_OCI8" != "no"; then + +- if test -z "$PHP_OCI8"; then +- { echo "configure: error: Empty parameter value passed to --with-oci8" 1>&2; exit 1; } +- fi ++php_with_mysql_sock=no + ++echo $ac_n "checking for specified location of the MySQL UNIX socket""... $ac_c" 1>&6 ++echo "configure:61719: checking for specified location of the MySQL UNIX socket" >&5 ++# Check whether --with-mysql-sock or --without-mysql-sock was given. ++if test "${with_mysql_sock+set}" = set; then ++ withval="$with_mysql_sock" ++ PHP_MYSQL_SOCK=$withval ++else ++ ++ PHP_MYSQL_SOCK=no + +- echo $ac_n "checking PHP version""... $ac_c" 1>&6 +-echo "configure:61999: checking PHP version" >&5 + +- tmp_version=$PHP_VERSION +- if test -z "$tmp_version"; then +- if test -z "$PHP_CONFIG"; then +- { echo "configure: error: php-config not found" 1>&2; exit 1; } +- fi +- php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` +- else +- php_version=`echo "$tmp_version"|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` +- fi ++fi + +- if test -z "$php_version"; then +- { echo "configure: error: failed to detect PHP version, please report" 1>&2; exit 1; } +- fi + +- ac_IFS=$IFS +- IFS="." +- set $php_version +- IFS=$ac_IFS +- oci8_php_version=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ext_output=$PHP_MYSQL_SOCK ++echo "$ac_t""$ext_output" 1>&6 ++ + +- if test "$oci8_php_version" -lt "4003009"; then +- { echo "configure: error: You need at least PHP 4.3.9 to be able to use this version of OCI8. PHP $php_version found" 1>&2; exit 1; } +- elif test "$oci8_php_version" -ge "6000000"; then +- { echo "configure: error: This version of OCI8 is not compatible with PHP 6 or higher" 1>&2; exit 1; } +- else +- echo "$ac_t""$php_version, ok" 1>&6 +- fi + ++ ++if test -z "$PHP_ZLIB_DIR"; then + +- echo $ac_n "checking size of long int""... $ac_c" 1>&6 +-echo "configure:62031: checking size of long int" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_long_int=4 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(long int)); +- return(0); +-} +-EOF +-if { (eval echo configure:62050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_long_int=`cat conftestval` ++php_with_zlib_dir=no ++ ++echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 ++echo "configure:61743: checking for the location of libz" >&5 ++# Check whether --with-zlib-dir or --without-zlib-dir was given. ++if test "${with_zlib_dir+set}" = set; then ++ withval="$with_zlib_dir" ++ PHP_ZLIB_DIR=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_long_int=0 +-fi +-rm -fr conftest* +-fi ++ ++ PHP_ZLIB_DIR=no ++ + + fi +-echo "$ac_t""$ac_cv_sizeof_long_int" 1>&6 +-cat >> confdefs.h <&6 +-echo "configure:62070: checking checking if we're on a 64-bit platform" >&5 +- if test "$ac_cv_sizeof_long_int" = "4"; then +- echo "$ac_t""no" 1>&6 +- PHP_OCI8_OH_LIBDIR=lib32 +- PHP_OCI8_IC_LIBDIR_SUFFIX="" +- else +- echo "$ac_t""yes" 1>&6 +- PHP_OCI8_OH_LIBDIR=lib +- PHP_OCI8_IC_LIBDIR_SUFFIX=64 +- fi ++ext_output=$PHP_ZLIB_DIR ++echo "$ac_t""$ext_output" 1>&6 + +- +- PHP_OCI8_INSTANT_CLIENT="no" + +- if test "$PHP_OCI8" = "yes" && test -z "$ORACLE_HOME"; then +- echo "configure: warning: OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead" 1>&2 +- PHP_OCI8=instantclient +- fi + +- if test "`echo $PHP_OCI8`" = "instantclient"; then +- PHP_OCI8_INSTANT_CLIENT="yes" +- elif test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then +- PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f3`" +- PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f1,4`" +- if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then +- PHP_OCI8_INSTANT_CLIENT="yes" +- fi +- if test -z "$PHP_OCI8"; then +- PHP_OCI8=yes +- fi +- elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then +- PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`" +- PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`" +- if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then +- PHP_OCI8_INSTANT_CLIENT="yes" +- fi +- if test -z "$PHP_OCI8"; then +- PHP_OCI8=yes +- fi +- fi ++fi + +- if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then +- +- echo $ac_n "checking Oracle ORACLE_HOME install directory""... $ac_c" 1>&6 +-echo "configure:62114: checking Oracle ORACLE_HOME install directory" >&5 ++if test "$PHP_MYSQL" = "mysqlnd"; then ++ PHP_MYSQLND_ENABLED=yes + +- if test "$PHP_OCI8" = "yes"; then +- OCI8_DIR=$ORACLE_HOME +- else +- OCI8_DIR=$PHP_OCI8 ++elif test "$PHP_MYSQL" != "no"; then ++ MYSQL_DIR= ++ MYSQL_INC_DIR= ++ ++ for i in $PHP_MYSQL /usr/local /usr; do ++ if test -r $i/include/mysql/mysql.h; then ++ MYSQL_DIR=$i ++ MYSQL_INC_DIR=$i/include/mysql ++ break ++ elif test -r $i/include/mysql.h; then ++ MYSQL_DIR=$i ++ MYSQL_INC_DIR=$i/include ++ break + fi +- echo "$ac_t""$OCI8_DIR" 1>&6 ++ done + +- +- echo $ac_n "checking ORACLE_HOME library validity""... $ac_c" 1>&6 +-echo "configure:62125: checking ORACLE_HOME library validity" >&5 +- if test ! -d "$OCI8_DIR"; then +- { echo "configure: error: ${OCI8_DIR} is not a directory" 1>&2; exit 1; } ++ if test -z "$MYSQL_DIR"; then ++ { echo "configure: error: Cannot find MySQL header files under $PHP_MYSQL. ++Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; } + fi +- if test -d "$OCI8_DIR/lib" && test ! -d "$OCI8_DIR/lib32"; then +- OCI8_LIB_DIR=lib +- elif test ! -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then +- OCI8_LIB_DIR=lib32 +- elif test -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then +- OCI8_LIB_DIR=$PHP_OCI8_OH_LIBDIR ++ ++ if test "$enable_maintainer_zts" = "yes"; then ++ MYSQL_LIBNAME=mysqlclient_r + else +- if test -f "$OCI8_DIR/libociei.$SHLIB_SUFFIX_NAME"; then +- { echo "configure: error: Expected an ORACLE_HOME top level directory but ${OCI8_DIR} appears to be an Instant Client directory. Try --with-oci8=instantclient,${OCI8_DIR}" 1>&2; exit 1; } +- else +- { echo "configure: error: Oracle library directory not found in ${OCI8_DIR}" 1>&2; exit 1; } +- fi ++ MYSQL_LIBNAME=mysqlclient + fi +- echo "$ac_t""$OCI8_LIB_DIR" 1>&6 ++ case $host_alias in ++ *netware*) ++ MYSQL_LIBNAME=mysql ++ ;; ++ esac + ++ if test -z "$PHP_LIBDIR"; then ++ PHP_LIBDIR=lib ++ fi + +- if test -d "$OCI8_DIR/rdbms/public"; then +- +- if test "$OCI8_DIR/rdbms/public" != "/usr/include"; then +- +- if test -z "$OCI8_DIR/rdbms/public" || echo "$OCI8_DIR/rdbms/public" | grep '^/' >/dev/null ; then +- ai_p=$OCI8_DIR/rdbms/public +- else +- +- ep_dir="`echo $OCI8_DIR/rdbms/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/public\"`" ++ str="$MYSQL_DIR/$i/lib$MYSQL_LIBNAME.*" ++ for j in `echo $str`; do ++ if test -r $j; then ++ MYSQL_LIB_DIR=$MYSQL_DIR/$i ++ break 2 ++ fi ++ done ++ ++ done ++ ++ if test -z "$MYSQL_LIB_DIR"; then ++ { echo "configure: error: Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. ++Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; } + fi + +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$MYSQL_LIB_DIR ++ " + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" + else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- fi ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ + +- OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public" + fi +- if test -d "$OCI8_DIR/rdbms/demo"; then ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$OCI8_DIR/rdbms/demo" != "/usr/include"; then ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$OCI8_DIR/rdbms/demo" || echo "$OCI8_DIR/rdbms/demo" | grep '^/' >/dev/null ; then +- ai_p=$OCI8_DIR/rdbms/demo ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $OCI8_DIR/rdbms/demo|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/demo\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- fi + +- OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo" +- fi +- if test -d "$OCI8_DIR/network/public"; then +- +- if test "$OCI8_DIR/network/public" != "/usr/include"; then +- +- if test -z "$OCI8_DIR/network/public" || echo "$OCI8_DIR/network/public" | grep '^/' >/dev/null ; then +- ai_p=$OCI8_DIR/network/public +- else +- +- ep_dir="`echo $OCI8_DIR/network/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ fi + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCI8_DIR/network/public\"`" + fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for mysql_close in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:61917: checking for mysql_close in -l$MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_close | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$MYSQL_LIBNAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + +- fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$MYSQL_LIBNAME_mysql_close ++ ++ if test "$PHP_ZLIB_DIR" != "no"; then ++ + +- OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public" +- fi +- if test -d "$OCI8_DIR/plsql/public"; then ++ if test "$ext_shared" = "yes"; then ++ MYSQL_SHARED_LIBADD="-lz $MYSQL_SHARED_LIBADD" ++ if test -n "$PHP_ZLIB_DIR"; then + +- if test "$OCI8_DIR/plsql/public" != "/usr/include"; then ++ if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then + +- if test -z "$OCI8_DIR/plsql/public" || echo "$OCI8_DIR/plsql/public" | grep '^/' >/dev/null ; then +- ai_p=$OCI8_DIR/plsql/public ++ if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_DIR + else + +- ep_dir="`echo $OCI8_DIR/plsql/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCI8_DIR/plsql/public\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" + fi + + +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public" +- fi +- +- if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then +- +- for ac_i in `cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`; do +- case $ac_i in +- -pthread) + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -pthread" ++ MYSQL_SHARED_LIBADD="-L$ai_p $MYSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQL_SHARED_LIBADD" + else + + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac + ++ fi ++ ++ fi + + fi +- ;; +- esac +- ++ else ++ + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test -n "$PHP_ZLIB_DIR"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_DIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" +- test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" +- else +- ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -62360,21 +62038,39 @@ echo "configure:62125: checking ORACLE_H + fi + + +- fi + + fi + +- ;; +- esac +- done ++ fi ++ ++ ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lz $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ + +- elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then + +- for ac_i in `cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`; do ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -pthread" ++ LDFLAGS="$LDFLAGS -pthread" + else + + +@@ -62396,7 +62092,7 @@ echo "configure:62125: checking ORACLE_H + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" ++ LDFLAGS="$LDFLAGS -l$ac_ii" + else + + +@@ -62431,8 +62127,8 @@ echo "configure:62125: checking ORACLE_H + + + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" +- test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -62458,47 +62154,88 @@ echo "configure:62125: checking ORACLE_H + esac + done + +- fi ++ echo $ac_n "checking for mysql_error in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:62159: checking for mysql_error in -l$MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_error | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$MYSQL_LIBNAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared + +- echo $ac_n "checking Oracle version""... $ac_c" 1>&6 +-echo "configure:62466: checking Oracle version" >&5 +- if test -s "$OCI8_DIR/orainst/unix.rgs"; then +- OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/ */:/g' | cut -d: -f 6 | cut -c 2-4` +- test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then +- OCI8_ORACLE_VERSION=11.1 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then +- OCI8_ORACLE_VERSION=10.1 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then +- OCI8_ORACLE_VERSION=9.0 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then +- OCI8_ORACLE_VERSION=8.1 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then +- OCI8_ORACLE_VERSION=8.0 +- elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then +- if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then +- OCI8_ORACLE_VERSION=8.0 ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$MYSQL_LIBNAME_mysql_error ++ ++ { echo "configure: error: mysql configure failed. Please check config.log for more information." 1>&2; exit 1; } ++ ++ ++fi ++ ++ MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz" + else +- OCI8_ORACLE_VERSION=8.1 +- fi +- else +- { echo "configure: error: Oracle client libraries not found" 1>&2; exit 1; } +- fi +- echo "$ac_t""$OCI8_ORACLE_VERSION" 1>&6 ++ ++ ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ MYSQL_SHARED_LIBADD="-lz $MYSQL_SHARED_LIBADD" ++ else ++ ++ ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lz $LIBS" ++ ;; ++ esac + + +- case $OCI8_ORACLE_VERSION in +- 7.3|8.0|8.1) +- { echo "configure: error: Oracle client libraries < 9.2 are not supported" 1>&2; exit 1; } +- ;; ++ fi ++ ;; ++ esac + +- 9.0) +- ++ ++ + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD +- " ++ -L$MYSQL_LIB_DIR ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -62591,27 +62328,27 @@ echo "configure:62466: checking Oracle v + esac + done + +- echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6 +-echo "configure:62596: checking for OCIEnvNlsCreate in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for mysql_errno in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:62333: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_errno | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" ++LIBS="-l$MYSQL_LIBNAME $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:62352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -62630,75 +62367,48 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- OCI8_ORACLE_VERSION=9.2 +- + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCIEnvNlsCreate ++ unset ac_cv_lib_$MYSQL_LIBNAME_mysql_errno + +- { echo "configure: error: Oracle client libraries < 9.2 are not supported" 1>&2; exit 1; } +- ++ { echo "configure: error: Try adding --with-zlib-dir=. Please check config.log for more information." 1>&2; exit 1; } ++ + + fi +- +- ;; +- +- 10.1|11.1) +- cat >> confdefs.h <<\EOF +-#define HAVE_OCI_LOB_READ2 1 +-EOF +- +- ;; +- +- *) +- { echo "configure: error: Oracle version $OCI8_ORACLE_VERSION is not supported" 1>&2; exit 1; } +- ;; +- esac +- +- ++ ++ MYSQL_LIBS="-lz" ++ fi + +- case clntsh in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh" +- else +- + +- case clntsh in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -lclntsh" +- ;; +- esac +- ++fi + +- fi +- ;; +- esac + ++ + ++ if test "$ext_shared" = "yes"; then ++ MYSQL_SHARED_LIBADD="-l$MYSQL_LIBNAME $MYSQL_SHARED_LIBADD" ++ if test -n "$MYSQL_LIB_DIR"; then ++ ++ if test "$MYSQL_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$MYSQL_LIB_DIR" != "/usr/lib"; then + +- if test "$OCI8_DIR/$OCI8_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$OCI8_DIR/$OCI8_LIB_DIR" != "/usr/lib"; then +- +- if test -z "$OCI8_DIR/$OCI8_LIB_DIR" || echo "$OCI8_DIR/$OCI8_LIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$OCI8_DIR/$OCI8_LIB_DIR ++ if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$MYSQL_LIB_DIR + else + +- ep_dir="`echo $OCI8_DIR/$OCI8_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MYSQL_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCI8_DIR/$OCI8_LIB_DIR\"`" ++ ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- OCI8_SHARED_LIBADD="-L$ai_p $OCI8_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p $OCI8_SHARED_LIBADD" ++ MYSQL_SHARED_LIBADD="-L$ai_p $MYSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQL_SHARED_LIBADD" + else + + +@@ -62720,91 +62430,248 @@ EOF + + fi + ++ fi ++ else + +- ext_builddir=ext/oci8 +- ext_srcdir=$abs_srcdir/ext/oci8 + +- ac_extra= ++ if test -n "$MYSQL_LIB_DIR"; then ++ ++ if test "$MYSQL_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$MYSQL_LIB_DIR" != "/usr/lib"; then ++ ++ if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$MYSQL_LIB_DIR ++ else ++ ++ ep_dir="`echo $MYSQL_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`" ++ fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_OCI8_SHARED=no + ++ + +- case ext/oci8 in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + ++ ++ fi + +- old_IFS=$IFS +- for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ fi + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $MYSQL_LIBNAME in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-l$MYSQL_LIBNAME $LIBS" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$MYSQL_INC_DIR + else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_OCI8_SHARED=yes +- +- case ext/oci8 in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ ++ ep_dir="`echo $MYSQL_INC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$MYSQL_INC_DIR\"`" ++ fi ++ ++ + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo ++ fi + + +- old_IFS=$IFS +- for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ MYSQL_MODULE_TYPE=external ++ MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS" ++ MYSQL_INCLUDE=-I$MYSQL_INC_DIR ++ + +- IFS=. +- set $ac_src ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_MODULE_TYPE" ++ ++ ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_LIBS" ++ ++ ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_INCLUDE" ++ ++ ++ ++fi ++ ++if test "$PHP_MYSQL" != "no"; then ++ echo $ac_n "checking for MySQL UNIX socket location""... $ac_c" 1>&6 ++echo "configure:62546: checking for MySQL UNIX socket location" >&5 ++ if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then ++ MYSQL_SOCK=$PHP_MYSQL_SOCK ++ cat >> confdefs.h <&6 ++ elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then ++ ++ for i in \ ++ /var/run/mysqld/mysqld.sock \ ++ /var/tmp/mysql.sock \ ++ /var/run/mysql/mysql.sock \ ++ /var/lib/mysql/mysql.sock \ ++ /var/mysql/mysql.sock \ ++ /usr/local/mysql/var/mysql.sock \ ++ /Private/tmp/mysql.sock \ ++ /private/tmp/mysql.sock \ ++ /tmp/mysql.sock \ ++ ; do ++ if test -r $i; then ++ MYSQL_SOCK=$i ++ break 2 ++ fi ++ done ++ ++ if test -n "$MYSQL_SOCK"; then ++ cat >> confdefs.h <&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_MYSQL 1 ++EOF ++ ++ ++ ext_builddir=ext/mysql ++ ext_srcdir=$abs_srcdir/ext/mysql ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_MYSQL_SHARED=no ++ ++ ++ case ext/mysql in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in php_mysql.c; do ++ ++ IFS=. ++ set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo" ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_OCI8 1 +-EOF ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_SHARED_LIBADD" + + ++ if test "$PHP_MYSQL" = "mysqlnd"; then + ++ am_i_shared=$PHP_MYSQL_SHARED ++ is_it_shared=$PHP_MYSQLND_SHARED ++ is_it_enabled=$PHP_MYSQLND ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension mysql to build statically, but it ++depends on extension mysqlnd, which you've configured to build shared. ++You either need to build mysql shared or build mysqlnd statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension mysql, which depends on extension mysqlnd, ++but you've either not enabled mysqlnd, or have disabled it. ++" 1>&2; exit 1; } ++ fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD" ++ cat >> confdefs.h <<\EOF ++#define MYSQL_USE_MYSQLND 1 ++EOF + +- ++ fi ++fi + +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR" + +- + +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_ORACLE_VERSION" ++php_with_mysqli=no + ++echo $ac_n "checking for MySQLi support""... $ac_c" 1>&6 ++echo "configure:62919: checking for MySQLi support" >&5 ++# Check whether --with-mysqli or --without-mysqli was given. ++if test "${with_mysqli+set}" = set; then ++ withval="$with_mysqli" ++ PHP_MYSQLI=$withval ++else + ++ PHP_MYSQLI=no ++ test "$PHP_ENABLE_ALL" && PHP_MYSQLI=$PHP_ENABLE_ALL + ++fi + +- cat >> confdefs.h <> confdefs.h <&6 +-echo "configure:63052: checking Oracle Instant Client directory" >&5 + +- if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then +- PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` +- if test -z "$PHP_OCI8_INSTANT_CLIENT"; then +- { echo "configure: error: Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR" 1>&2; exit 1; } +- fi +- fi +- echo "$ac_t""$PHP_OCI8_INSTANT_CLIENT" 1>&6 + +- OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT ++echo "$ac_t""$ext_output" 1>&6 + +- echo $ac_n "checking Oracle Instant Client SDK header directory""... $ac_c" 1>&6 +-echo "configure:63065: checking Oracle Instant Client SDK header directory" >&5 + +- OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib/*$!/usr/include/oracle/\1/client\2!'` + +- OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include + +- OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib/*$!\1/include!'` + +- if test -f "$OCISDKRPMINC/oci.h"; then +- echo "$ac_t""$OCISDKRPMINC" 1>&6 +- +- if test "$OCISDKRPMINC" != "/usr/include"; then +- +- if test -z "$OCISDKRPMINC" || echo "$OCISDKRPMINC" | grep '^/' >/dev/null ; then +- ai_p=$OCISDKRPMINC +- else +- +- ep_dir="`echo $OCISDKRPMINC|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCISDKRPMINC\"`" +- fi ++php_enable_embedded_mysqli=no + +- ++echo $ac_n "checking whether to enable embedded MySQLi support""... $ac_c" 1>&6 ++echo "configure:62963: checking whether to enable embedded MySQLi support" >&5 ++# Check whether --enable-embedded_mysqli or --disable-embedded_mysqli was given. ++if test "${enable_embedded_mysqli+set}" = set; then ++ enableval="$enable_embedded_mysqli" ++ PHP_EMBEDDED_MYSQLI=$enableval ++else + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ PHP_EMBEDDED_MYSQLI=no + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + +- fi ++fi + +- OCI8INCDIR=$OCISDKRPMINC +- elif test -f "$OCISDKZIPINC/oci.h"; then +- echo "$ac_t""$OCISDKZIPINC" 1>&6 +- +- if test "$OCISDKZIPINC" != "/usr/include"; then +- +- if test -z "$OCISDKZIPINC" || echo "$OCISDKZIPINC" | grep '^/' >/dev/null ; then +- ai_p=$OCISDKZIPINC ++ ++ext_output=$PHP_EMBEDDED_MYSQLI ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_MYSQLI" = "mysqlnd"; then ++ PHP_MYSQLND_ENABLED=yes ++ ++elif test "$PHP_MYSQLI" != "no"; then ++ ++ if test "$PHP_MYSQLI" = "yes"; then ++ MYSQL_CONFIG=`$php_shtool path mysql_config` + else +- +- ep_dir="`echo $OCISDKZIPINC|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCISDKZIPINC\"`" ++ MYSQL_CONFIG=$PHP_MYSQLI + fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ MYSQL_LIB_NAME='mysqlclient' ++ if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_EMBEDDED_MYSQLI 1 ++EOF + ++ MYSQL_LIB_CFG='--libmysqld-libs' ++ mysqli_extra_sources="mysqli_embedded.c" ++ elif test "$enable_maintainer_zts" = "yes"; then ++ MYSQL_LIB_CFG='--libs_r' ++ MYSQL_LIB_NAME='mysqlclient_r' ++ else ++ MYSQL_LIB_CFG='--libs' + fi +- +- OCI8INCDIR=$OCISDKZIPINC +- elif test -f "$OCISDKMANINC/oci.h"; then +- echo "$ac_t""$OCISDKMANINC" 1>&6 +- +- if test "$OCISDKMANINC" != "/usr/include"; then +- +- if test -z "$OCISDKMANINC" || echo "$OCISDKMANINC" | grep '^/' >/dev/null ; then +- ai_p=$OCISDKMANINC ++ ++ if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then ++ MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | $SED -e "s/'//g"` ++ MYSQLI_LIBLINE=`$MYSQL_CONFIG $MYSQL_LIB_CFG | $SED -e "s/'//g"` + else +- +- ep_dir="`echo $OCISDKMANINC|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OCISDKMANINC\"`" ++ echo "$ac_t""mysql_config not found" 1>&6 ++ { echo "configure: error: Please reinstall the mysql distribution" 1>&2; exit 1; } + fi + +- ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $MYSQLI_LIBLINE ++ " + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ save_ext_shared=$ext_shared ++ ext_shared=yes + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- OCI8INCDIR=$OCISDKMANINC +- else +- { echo "configure: error: Oracle Instant Client SDK header files not found" 1>&2; exit 1; } +- fi +- +- OCISYSLIBLIST=`echo "$OCI8INCDIR" | $PHP_OCI8_SED -e 's!\(.*\)/include$!\1/demo/sysliblist!'` +- if test -f "$OCISYSLIBLIST"; then +- +- for ac_i in `cat $OCISYSLIBLIST`; do ++ for ac_i in $ac_stuff; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -pthread" ++ LDFLAGS="$LDFLAGS -pthread" + else + + +@@ -63204,7 +63047,7 @@ echo "configure:63065: checking Oracle I + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" ++ LDFLAGS="$LDFLAGS -l$ac_ii" + else + + +@@ -63239,8 +63082,8 @@ echo "configure:63065: checking Oracle I + + + if test "$ext_shared" = "yes"; then +- OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" +- test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -63266,50 +63109,120 @@ echo "configure:63065: checking Oracle I + esac + done + +- fi ++ echo $ac_n "checking for mysql_set_server_option in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 ++echo "configure:63114: checking for mysql_set_server_option in -l$MYSQL_LIB_NAME" >&5 ++ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_server_option | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$MYSQL_LIB_NAME $LIBS" ++cat > conftest.$ac_ext <&6 +-echo "configure:63274: checking Oracle Instant Client version" >&5 +- if test -f $PHP_OCI8_INSTANT_CLIENT/libnnz11.$SHLIB_SUFFIX_NAME; then +- if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then +- if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then +- { echo "configure: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.11.1 not found" 1>&2; exit 1; } +- fi +- OCI8_ORACLE_VERSION=11.1 +- else +- { echo "configure: error: Oracle Instant Client library version not supported" 1>&2; exit 1; } +- fi +- elif test -f $PHP_OCI8_INSTANT_CLIENT/libnnz10.$SHLIB_SUFFIX_NAME; then +- if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then +- if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then +- { echo "configure: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found" 1>&2; exit 1; } +- fi +- OCI8_ORACLE_VERSION=10.1 +- else +- { echo "configure: error: Oracle Instant Client library version not supported" 1>&2; exit 1; } +- fi +- else +- { echo "configure: error: Oracle Instant Client libraries not found" 1>&2; exit 1; } +- fi +- echo "$ac_t""$OCI8_ORACLE_VERSION" 1>&6 ++int main() { ++mysql_set_server_option() ++; return 0; } ++EOF ++if { (eval echo configure:63133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- case $OCI8_ORACLE_VERSION in +- 10.1|11.1) +- ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- case clntsh in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh" ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ for ac_i in $MYSQLI_INCLINE; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ for ac_i in $MYSQLI_LIBLINE; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ MYSQLI_SHARED_LIBADD="$MYSQLI_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ MYSQLI_SHARED_LIBADD="$MYSQLI_SHARED_LIBADD -l$ac_ii" + else + + +- case clntsh in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -lclntsh" ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + +@@ -63319,23 +63232,26 @@ echo "configure:63274: checking Oracle I + esac + + +- +- if test "$PHP_OCI8_INSTANT_CLIENT" != "/usr/$PHP_LIBDIR" && test "$PHP_OCI8_INSTANT_CLIENT" != "/usr/lib"; then ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$PHP_OCI8_INSTANT_CLIENT" || echo "$PHP_OCI8_INSTANT_CLIENT" | grep '^/' >/dev/null ; then +- ai_p=$PHP_OCI8_INSTANT_CLIENT ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PHP_OCI8_INSTANT_CLIENT|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_OCI8_INSTANT_CLIENT\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + + if test "$ext_shared" = "yes"; then +- OCI8_SHARED_LIBADD="-L$ai_p $OCI8_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p $OCI8_SHARED_LIBADD" ++ MYSQLI_SHARED_LIBADD="-L$ai_p $MYSQLI_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && MYSQLI_SHARED_LIBADD="$ld_runpath_switch$ai_p $MYSQLI_SHARED_LIBADD" + else + + +@@ -63357,36 +63273,348 @@ echo "configure:63274: checking Oracle I + + fi + +- ;; +- +- *) +- { echo "configure: error: Oracle Instant Client version $PHP_OCI8_INSTANT_CLIENT is not supported" 1>&2; exit 1; } +- ;; ++ ;; + esac ++ done + + cat >> confdefs.h <<\EOF +-#define HAVE_OCI_INSTANT_CLIENT 1 ++#define HAVE_MYSQLILIB 1 ++EOF ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$MYSQLI_LIBLINE" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for mysql_set_character_set in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 ++echo "configure:63381: checking for mysql_set_character_set in -l$MYSQL_LIB_NAME" >&5 ++ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_character_set | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$MYSQL_LIB_NAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_set_character_set ++ ++ { echo "configure: error: MySQLI doesn't support versions < 4.1.13 (for MySQL 4.1.x) and < 5.0.7 for (MySQL 5.0.x) anymore. Please update your libraries." 1>&2; exit 1; } ++ ++ ++fi ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_set_server_option ++ ++ { echo "configure: error: wrong mysql library version or lib not found. Check config.log for more information." 1>&2; exit 1; } ++ ++ ++fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $MYSQLI_LIBLINE ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6 ++echo "configure:63544: checking for mysql_stmt_next_result in -l$MYSQL_LIB_NAME" >&5 ++ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_stmt_next_result | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$MYSQL_LIB_NAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ + cat >> confdefs.h <<\EOF +-#define HAVE_OCI_LOB_READ2 1 ++#define HAVE_STMT_NEXT_RESULT 1 + EOF + ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_stmt_next_result + +- ext_builddir=ext/oci8 +- ext_srcdir=$abs_srcdir/ext/oci8 ++ ++ ++fi ++ ++fi ++ ++if test "$PHP_MYSQLI" != "no"; then ++ mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \ ++ mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \ ++ mysqli_exception.c $mysqli_extra_sources" ++ ++ ext_builddir=ext/mysqli ++ ext_srcdir=$abs_srcdir/ext/mysqli + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_OCI8_SHARED=no ++ PHP_MYSQLI_SHARED=no + + +- case ext/oci8 in ++ case ext/mysqli in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -63401,7 +63629,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ for ac_src in $mysqli_sources; do + + IFS=. + set $ac_src +@@ -63424,18 +63652,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC oci8" ++ EXT_STATIC="$EXT_STATIC mysqli" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC oci8" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC mysqli" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_OCI8_SHARED=yes ++ PHP_MYSQLI_SHARED=yes + +- case ext/oci8 in ++ case ext/mysqli in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/mysqli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/mysqli/"; ac_bdir="ext/mysqli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -63450,14 +63678,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ for ac_src in $mysqli_sources; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo" ++ shared_objects_mysqli="$shared_objects_mysqli $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -63480,31 +63708,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpoci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpoci8.so '$ext_builddir'/phpoci8.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpmysqli.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) $(PHPMYSQLI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpmysqli.so '$ext_builddir'/phpmysqli.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPOCI8, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPMYSQLI, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysqli) $(PHPMYSQLI_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpoci8.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpmysqli.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpoci8.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmysqli.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysqli" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_OCI8 1 +-EOF ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQLI_SHARED_LIBADD" + +- +- + +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD" +- + +- +- ++ for header_file in ext/mysqli/php_mysqli_structs.h; do ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR" +- ++ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` + +- ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_ORACLE_VERSION" ++ INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ++ ++ fi + ++ done + + + ++ if test "$PHP_MYSQLI" = "mysqlnd"; then ++ ++ am_i_shared=$PHP_MYSQLI_SHARED ++ is_it_shared=$PHP_MYSQLND_SHARED ++ is_it_enabled=$PHP_MYSQLND ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension mysqli to build statically, but it ++depends on extension mysqlnd, which you've configured to build shared. ++You either need to build mysqli shared or build mysqlnd statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension mysqli, which depends on extension mysqlnd, ++but you've either not enabled mysqlnd, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define MYSQLI_USE_MYSQLND 1 ++EOF ++ + fi + fi + + ++if test -z "$SED"; then ++ PHP_OCI8_SED="sed"; ++else ++ PHP_OCI8_SED="$SED"; ++fi + + + +@@ -63703,19 +63958,20 @@ fi + + + +-if test -z "$ODBC_TYPE"; then + +-php_with_adabas=no + ++php_with_oci8=no + +-# Check whether --with-adabas or --without-adabas was given. +-if test "${with_adabas+set}" = set; then +- withval="$with_adabas" +- PHP_ADABAS=$withval ++echo $ac_n "checking for Oracle (OCI8) support""... $ac_c" 1>&6 ++echo "configure:63967: checking for Oracle (OCI8) support" >&5 ++# Check whether --with-oci8 or --without-oci8 was given. ++if test "${with_oci8+set}" = set; then ++ withval="$with_oci8" ++ PHP_OCI8=$withval + else + +- PHP_ADABAS=no +- test "$PHP_ENABLE_ALL" && PHP_ADABAS=$PHP_ENABLE_ALL ++ PHP_OCI8=no ++ test "$PHP_ENABLE_ALL" && PHP_OCI8=$PHP_ENABLE_ALL + + fi + +@@ -63723,12 +63979,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_ADABAS in ++case $PHP_OCI8 in + shared,*) +- PHP_ADABAS=`echo "$PHP_ADABAS"|$SED 's/^shared,//'` ++ PHP_OCI8=`echo "$PHP_OCI8"|$SED 's/^shared,//'` + ;; + shared) +- PHP_ADABAS=yes ++ PHP_OCI8=yes + ;; + no) + ext_output=no +@@ -63742,28 +63998,178 @@ esac + + + ++echo "$ac_t""$ext_output" 1>&6 + + + + ++if test "$PHP_OCI8" != "no"; then + +- if test "$PHP_ADABAS" != "no"; then +- echo $ac_n "checking for Adabas support""... $ac_c" 1>&6 +-echo "configure:63753: checking for Adabas support" >&5 +- if test "$PHP_ADABAS" = "yes"; then +- PHP_ADABAS=/usr/local ++ if test -z "$PHP_OCI8"; then ++ { echo "configure: error: Empty parameter value passed to --with-oci8" 1>&2; exit 1; } ++ fi ++ ++ ++ echo $ac_n "checking PHP version""... $ac_c" 1>&6 ++echo "configure:64015: checking PHP version" >&5 ++ ++ tmp_version=$PHP_VERSION ++ if test -z "$tmp_version"; then ++ if test -z "$PHP_CONFIG"; then ++ { echo "configure: error: php-config not found" 1>&2; exit 1; } ++ fi ++ php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` ++ else ++ php_version=`echo "$tmp_version"|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` ++ fi ++ ++ if test -z "$php_version"; then ++ { echo "configure: error: failed to detect PHP version, please report" 1>&2; exit 1; } ++ fi ++ ++ ac_IFS=$IFS ++ IFS="." ++ set $php_version ++ IFS=$ac_IFS ++ oci8_php_version=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ ++ if test "$oci8_php_version" -lt "4003009"; then ++ { echo "configure: error: You need at least PHP 4.3.9 to be able to use this version of OCI8. PHP $php_version found" 1>&2; exit 1; } ++ elif test "$oci8_php_version" -ge "6000000"; then ++ { echo "configure: error: This version of OCI8 is not compatible with PHP 6 or higher" 1>&2; exit 1; } ++ else ++ echo "$ac_t""$php_version, ok" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking size of long int""... $ac_c" 1>&6 ++echo "configure:64047: checking size of long int" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_long_int=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(long int)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:64067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_long_int=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_long_int=0 ++fi ++rm -fr conftest* ++fi ++ ++fi ++echo "$ac_t""$ac_cv_sizeof_long_int" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:64087: checking checking if we're on a 64-bit platform" >&5 ++ if test "$ac_cv_sizeof_long_int" = "4"; then ++ echo "$ac_t""no" 1>&6 ++ PHP_OCI8_OH_LIBDIR=lib32 ++ PHP_OCI8_IC_LIBDIR_SUFFIX="" ++ else ++ echo "$ac_t""yes" 1>&6 ++ PHP_OCI8_OH_LIBDIR=lib ++ PHP_OCI8_IC_LIBDIR_SUFFIX=64 ++ fi ++ ++ ++ PHP_OCI8_INSTANT_CLIENT="no" ++ ++ if test "$PHP_OCI8" = "yes" && test -z "$ORACLE_HOME"; then ++ echo "configure: warning: OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead" 1>&2 ++ PHP_OCI8=instantclient ++ fi ++ ++ if test "`echo $PHP_OCI8`" = "instantclient"; then ++ PHP_OCI8_INSTANT_CLIENT="yes" ++ elif test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then ++ PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f3`" ++ PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f1,4`" ++ if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then ++ PHP_OCI8_INSTANT_CLIENT="yes" ++ fi ++ if test -z "$PHP_OCI8"; then ++ PHP_OCI8=yes ++ fi ++ elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then ++ PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`" ++ PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`" ++ if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then ++ PHP_OCI8_INSTANT_CLIENT="yes" ++ fi ++ if test -z "$PHP_OCI8"; then ++ PHP_OCI8=yes ++ fi ++ fi ++ ++ if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then ++ ++ echo $ac_n "checking Oracle ORACLE_HOME install directory""... $ac_c" 1>&6 ++echo "configure:64131: checking Oracle ORACLE_HOME install directory" >&5 ++ ++ if test "$PHP_OCI8" = "yes"; then ++ OCI8_DIR=$ORACLE_HOME ++ else ++ OCI8_DIR=$PHP_OCI8 + fi ++ echo "$ac_t""$OCI8_DIR" 1>&6 ++ + +- if test "$PHP_ADABAS/incl" != "/usr/include"; then ++ echo $ac_n "checking ORACLE_HOME library validity""... $ac_c" 1>&6 ++echo "configure:64142: checking ORACLE_HOME library validity" >&5 ++ if test ! -d "$OCI8_DIR"; then ++ { echo "configure: error: ${OCI8_DIR} is not a directory" 1>&2; exit 1; } ++ fi ++ if test -d "$OCI8_DIR/lib" && test ! -d "$OCI8_DIR/lib32"; then ++ OCI8_LIB_DIR=lib ++ elif test ! -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then ++ OCI8_LIB_DIR=lib32 ++ elif test -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then ++ OCI8_LIB_DIR=$PHP_OCI8_OH_LIBDIR ++ else ++ if test -f "$OCI8_DIR/libociei.$SHLIB_SUFFIX_NAME"; then ++ { echo "configure: error: Expected an ORACLE_HOME top level directory but ${OCI8_DIR} appears to be an Instant Client directory. Try --with-oci8=instantclient,${OCI8_DIR}" 1>&2; exit 1; } ++ else ++ { echo "configure: error: Oracle library directory not found in ${OCI8_DIR}" 1>&2; exit 1; } ++ fi ++ fi ++ echo "$ac_t""$OCI8_LIB_DIR" 1>&6 ++ ++ ++ if test -d "$OCI8_DIR/rdbms/public"; then ++ ++ if test "$OCI8_DIR/rdbms/public" != "/usr/include"; then + +- if test -z "$PHP_ADABAS/incl" || echo "$PHP_ADABAS/incl" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ADABAS/incl ++ if test -z "$OCI8_DIR/rdbms/public" || echo "$OCI8_DIR/rdbms/public" | grep '^/' >/dev/null ; then ++ ai_p=$OCI8_DIR/rdbms/public + else + +- ep_dir="`echo $PHP_ADABAS/incl|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCI8_DIR/rdbms/public|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ADABAS/incl\"`" ++ ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/public\"`" + fi + + +@@ -63784,189 +64190,88 @@ echo "configure:63753: checking for Adab + + fi + ++ OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public" ++ fi ++ if test -d "$OCI8_DIR/rdbms/demo"; then ++ ++ if test "$OCI8_DIR/rdbms/demo" != "/usr/include"; then + +- if test "$PHP_ADABAS/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ADABAS/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_ADABAS/$PHP_LIBDIR" || echo "$PHP_ADABAS/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ADABAS/$PHP_LIBDIR ++ if test -z "$OCI8_DIR/rdbms/demo" || echo "$OCI8_DIR/rdbms/demo" | grep '^/' >/dev/null ; then ++ ai_p=$OCI8_DIR/rdbms/demo + else + +- ep_dir="`echo $PHP_ADABAS/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCI8_DIR/rdbms/demo|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ADABAS/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/demo\"`" + fi + + +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi + + fi + +- ODBC_OBJS="$PHP_ADABAS/$PHP_LIBDIR/odbclib.a" +- ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a" +- $srcdir/build/shtool mkdir -f -p ext/odbc +- rm -f "$ODBC_LIB" +- cp "$ODBC_OBJS" "$ODBC_LIB" +- +- +- case sqlptc in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsqlptc $LIBS" +- ;; +- esac +- +- +- +- +- case sqlrte in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsqlrte $LIBS" +- ;; +- esac +- +- +- ++ fi + +- if test -n "$abs_builddir/ext/odbc"; then +- +- if test "$abs_builddir/ext/odbc" != "/usr/$PHP_LIBDIR" && test "$abs_builddir/ext/odbc" != "/usr/lib"; then ++ OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo" ++ fi ++ if test -d "$OCI8_DIR/network/public"; then ++ ++ if test "$OCI8_DIR/network/public" != "/usr/include"; then + +- if test -z "$abs_builddir/ext/odbc" || echo "$abs_builddir/ext/odbc" | grep '^/' >/dev/null ; then +- ai_p=$abs_builddir/ext/odbc ++ if test -z "$OCI8_DIR/network/public" || echo "$OCI8_DIR/network/public" | grep '^/' >/dev/null ; then ++ ai_p=$OCI8_DIR/network/public + else + +- ep_dir="`echo $abs_builddir/ext/odbc|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCI8_DIR/network/public|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$abs_builddir/ext/odbc\"`" ++ ai_p="$ep_realdir/`basename \"$OCI8_DIR/network/public\"`" + fi + + +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi + + fi + + fi +- +- +- case odbc_adabas in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lodbc_adabas $LIBS" +- ;; +- esac +- +- +- +- +- ODBC_TYPE=adabas +- ODBC_INCDIR=$PHP_ADABAS/incl +- +-if ! test -f "$ODBC_INCDIR/sqlext.h"; then +- { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlext.h' not found!" 1>&2; exit 1; } +-fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ADABAS 1 +-EOF +- +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_sapdb=no +- +- +-# Check whether --with-sapdb or --without-sapdb was given. +-if test "${with_sapdb+set}" = set; then +- withval="$with_sapdb" +- PHP_SAPDB=$withval +-else +- +- PHP_SAPDB=no +- test "$PHP_ENABLE_ALL" && PHP_SAPDB=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SAPDB in +-shared,*) +- PHP_SAPDB=`echo "$PHP_SAPDB"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SAPDB=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- + +- +- +- +- +- +- if test "$PHP_SAPDB" != "no"; then +- echo $ac_n "checking for SAP DB support""... $ac_c" 1>&6 +-echo "configure:63956: checking for SAP DB support" >&5 +- if test "$PHP_SAPDB" = "yes"; then +- PHP_SAPDB=/usr/local ++ OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public" + fi ++ if test -d "$OCI8_DIR/plsql/public"; then ++ ++ if test "$OCI8_DIR/plsql/public" != "/usr/include"; then + +- if test "$PHP_SAPDB/incl" != "/usr/include"; then +- +- if test -z "$PHP_SAPDB/incl" || echo "$PHP_SAPDB/incl" | grep '^/' >/dev/null ; then +- ai_p=$PHP_SAPDB/incl ++ if test -z "$OCI8_DIR/plsql/public" || echo "$OCI8_DIR/plsql/public" | grep '^/' >/dev/null ; then ++ ai_p=$OCI8_DIR/plsql/public + else + +- ep_dir="`echo $PHP_SAPDB/incl|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCI8_DIR/plsql/public|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_SAPDB/incl\"`" ++ ai_p="$ep_realdir/`basename \"$OCI8_DIR/plsql/public\"`" + fi + + +@@ -63987,21 +64292,76 @@ echo "configure:63956: checking for SAP + + fi + ++ OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public" ++ fi ++ ++ if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then ++ ++ for ac_i in `cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="$OCI8_SYSLIB -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test "$PHP_SAPDB/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_SAPDB/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_SAPDB/$PHP_LIBDIR" || echo "$PHP_SAPDB/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_SAPDB/$PHP_LIBDIR ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PHP_SAPDB/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_SAPDB/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + +- ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" ++ test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" ++ else ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -64017,813 +64377,728 @@ echo "configure:63956: checking for SAP + fi + + ++ fi + + fi + +- ++ ;; ++ esac ++ done ++ ++ elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then ++ ++ for ac_i in `cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="$OCI8_SYSLIB -pthread" ++ else ++ + +- case sqlod in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsqlod $LIBS" +- ;; +- esac ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +- ODBC_TYPE=sapdb +- cat >> confdefs.h <<\EOF +-#define HAVE_SAPDB 1 +-EOF +- +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi + +-if test -z "$ODBC_TYPE"; then ++ fi ++ ;; ++ esac + +-php_with_solid=no + ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +-# Check whether --with-solid or --without-solid was given. +-if test "${with_solid+set}" = set; then +- withval="$with_solid" +- PHP_SOLID=$withval +-else ++ ++ if test "$ext_shared" = "yes"; then ++ OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" ++ test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" ++ else ++ + +- PHP_SOLID=no +- test "$PHP_ENABLE_ALL" && PHP_SOLID=$PHP_ENABLE_ALL +- +-fi ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + ++ fi ++ ++ fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SOLID in +-shared,*) +- PHP_SOLID=`echo "$PHP_SOLID"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SOLID=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ ;; ++ esac ++ done + ++ fi + ++ ++ echo $ac_n "checking Oracle version""... $ac_c" 1>&6 ++echo "configure:64483: checking Oracle version" >&5 ++ if test -s "$OCI8_DIR/orainst/unix.rgs"; then ++ OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/ */:/g' | cut -d: -f 6 | cut -c 2-4` ++ test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then ++ OCI8_ORACLE_VERSION=11.1 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then ++ OCI8_ORACLE_VERSION=10.1 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then ++ OCI8_ORACLE_VERSION=9.0 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then ++ OCI8_ORACLE_VERSION=8.1 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then ++ OCI8_ORACLE_VERSION=8.0 ++ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then ++ if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then ++ OCI8_ORACLE_VERSION=8.0 ++ else ++ OCI8_ORACLE_VERSION=8.1 ++ fi ++ else ++ { echo "configure: error: Oracle client libraries not found" 1>&2; exit 1; } ++ fi ++ echo "$ac_t""$OCI8_ORACLE_VERSION" 1>&6 + + ++ case $OCI8_ORACLE_VERSION in ++ 7.3|8.0|8.1) ++ { echo "configure: error: Oracle client libraries < 9.2 are not supported" 1>&2; exit 1; } ++ ;; + ++ 9.0) ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + + +- if test "$PHP_SOLID" != "no"; then +- echo $ac_n "checking for Solid support""... $ac_c" 1>&6 +-echo "configure:64089: checking for Solid support" >&5 +- if test "$PHP_SOLID" = "yes"; then +- PHP_SOLID=/usr/local/solid + fi +- ODBC_INCDIR=$PHP_SOLID/include +- ODBC_LIBDIR=$PHP_SOLID/$PHP_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_TYPE=solid +- if test -f $ODBC_LIBDIR/soc*35.a; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SOLID_35 1 +-EOF +- +- elif test -f $ODBC_LIBDIR/scl*30.a; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SOLID_30 1 +-EOF ++ ;; ++ esac + +- elif test -f $ODBC_LIBDIR/scl*23.a; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SOLID 1 +-EOF + +- fi +- echo "$ac_t""$ext_output" 1>&6 ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- echo $ac_n "checking Solid library file""... $ac_c" 1>&6 +-echo "configure:64116: checking Solid library file" >&5 +- ac_solid_uname_r=`uname -r 2>/dev/null` +- ac_solid_uname_s=`uname -s 2>/dev/null` +- case $ac_solid_uname_s in +- AIX) ac_solid_os=a3x;; # a4x for AIX4/ Solid 2.3/3.0 only +- HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10 +- IRIX) ac_solid_os=irx;; # Solid 2.3(?)/ 3.0 only +- Linux) +- if ldd -v /bin/sh | grep GLIBC > /dev/null; then +- cat >> confdefs.h <<\EOF +-#define SS_LINUX 1 +-EOF ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +- ac_solid_os=l2x ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else +- cat >> confdefs.h <<\EOF +-#define SS_LINUX 1 +-EOF ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +- ac_solid_os=lux +- fi;; +- SunOS) +- ac_solid_os=ssx;; # should we deal with SunOS 4? +- FreeBSD) +- if test `expr $ac_solid_uname_r : '\(.\)'` -gt "2"; then +- cat >> confdefs.h <<\EOF +-#define SS_FBX 1 +-EOF + +- ac_solid_os=fex +- else +- cat >> confdefs.h <<\EOF +-#define SS_FBX 1 +-EOF ++ fi ++ ++ fi + +- ac_solid_os=fbx +- fi;; +- esac ++ ;; ++ esac ++ done + +- if test -f $ODBC_LIBDIR/soc${ac_solid_os}35.a; then +- ac_solid_version=35 +- ac_solid_prefix=soc +- elif test -f $ODBC_LIBDIR/scl${ac_solid_os}30.a; then +- ac_solid_version=30 +- ac_solid_prefix=scl +- elif test -f $ODBC_LIBDIR/scl${ac_solid_os}23.a; then +- ac_solid_version=23 +- ac_solid_prefix=scl +- fi ++ echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6 ++echo "configure:64613: checking for OCIEnvNlsCreate in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lclntsh $LIBS" ++cat > conftest.$ac_ext < $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a" +- echo "* $ODBC_LIBDIR/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so" +- echo "*********************************************************************" ++int main() { ++OCIEnvNlsCreate() ++; return 0; } ++EOF ++if { (eval echo configure:64632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version} ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- echo "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6 +- +- fi + fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_ibm_db2=no +- +- +-# Check whether --with-ibm-db2 or --without-ibm-db2 was given. +-if test "${with_ibm_db2+set}" = set; then +- withval="$with_ibm_db2" +- PHP_IBM_DB2=$withval +-else ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- PHP_IBM_DB2=no +- test "$PHP_ENABLE_ALL" && PHP_IBM_DB2=$PHP_ENABLE_ALL ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ OCI8_ORACLE_VERSION=9.2 ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_clntsh_OCIEnvNlsCreate ++ ++ { echo "configure: error: Oracle client libraries < 9.2 are not supported" 1>&2; exit 1; } ++ ++ + fi + ++ ;; + ++ 10.1|11.1) ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCI_LOB_READ2 1 ++EOF + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_IBM_DB2 in +-shared,*) +- PHP_IBM_DB2=`echo "$PHP_IBM_DB2"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_IBM_DB2=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- ++ ;; + ++ *) ++ { echo "configure: error: Oracle version $OCI8_ORACLE_VERSION is not supported" 1>&2; exit 1; } ++ ;; ++ esac + +- if test "$PHP_IBM_DB2" != "no"; then +- echo $ac_n "checking for IBM DB2 support""... $ac_c" 1>&6 +-echo "configure:64237: checking for IBM DB2 support" >&5 +- if test "$PHP_IBM_DB2" = "yes"; then +- ODBC_INCDIR=/home/db2inst1/sqllib/include +- ODBC_LIBDIR=/home/db2inst1/sqllib/lib ++ ++ ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh" + else +- ODBC_INCDIR=$PHP_IBM_DB2/include +- ODBC_LIBDIR=$PHP_IBM_DB2/$PHP_LIBDIR +- fi ++ ++ ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -lclntsh" ++ ;; ++ esac + +- +-if ! test -f "$ODBC_INCDIR/sqlcli1.h"; then +- { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlcli1.h' not found!" 1>&2; exit 1; } +-fi + ++ fi ++ ;; ++ esac + +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_TYPE=ibm-db2 +- ODBC_LIBS=-ldb2 + + +- old_LIBS=$LIBS +- LIBS=" +- $ODBC_LFLAGS $ODBC_LIBS +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS +- +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- LIBS=$old_LIBS ++ if test -z "$OCI8_DIR/$OCI8_LIB_DIR" || echo "$OCI8_DIR/$OCI8_LIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$OCI8_DIR/$OCI8_LIB_DIR ++ else + +- cat >> confdefs.h <<\EOF +-#define HAVE_IBMDB2 1 +-EOF ++ ep_dir="`echo $OCI8_DIR/$OCI8_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$OCI8_DIR/$OCI8_LIB_DIR\"`" ++ fi + +- echo "$ac_t""$ext_output" 1>&6 + ++ if test "$ext_shared" = "yes"; then ++ OCI8_SHARED_LIBADD="-L$ai_p $OCI8_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p $OCI8_SHARED_LIBADD" ++ else ++ + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* + +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: +-build test failed. Please check the config.log for details. +-You need to source your DB2 environment before running PHP configure: +-# . \$IBM_DB2/db2profile +-" 1>&2; exit 1; } ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +-fi +-rm -fr conftest* +-fi ++ fi + + ++ fi ++ + fi +-fi +- +-if test -z "$ODBC_TYPE"; then + +-php_with_odbcrouter=no ++ ++ ext_builddir=ext/oci8 ++ ext_srcdir=$abs_srcdir/ext/oci8 + ++ ac_extra= + +-# Check whether --with-ODBCRouter or --without-ODBCRouter was given. +-if test "${with_ODBCRouter+set}" = set; then +- withval="$with_ODBCRouter" +- PHP_ODBCROUTER=$withval +-else ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_OCI8_SHARED=no ++ ++ ++ case ext/oci8 in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +- PHP_ODBCROUTER=no +- test "$PHP_ENABLE_ALL" && PHP_ODBCROUTER=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_ODBCROUTER in +-shared,*) +- PHP_ODBCROUTER=`echo "$PHP_ODBCROUTER"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_ODBCROUTER=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- + ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + + ++ old_IFS=$IFS ++ for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + ++ cat >>Makefile.objects<&6 +-echo "configure:64360: checking for ODBCRouter.com support" >&5 +- if test "$PHP_ODBCROUTER" = "yes"; then +- PHP_ODBCROUTER=/usr ++ EXT_STATIC="$EXT_STATIC oci8" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC oci8" + fi +- ODBC_INCDIR=$PHP_ODBCROUTER/include +- ODBC_LIBDIR=$PHP_ODBCROUTER/lib +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LIBS=-lodbcsdk +- ODBC_TYPE=ODBCRouter +- cat >> confdefs.h <<\EOF +-#define HAVE_ODBC_ROUTER 1 +-EOF ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_OCI8_SHARED=yes ++ ++ case ext/oci8 in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ + +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + +-if test -z "$ODBC_TYPE"; then + +-php_with_empress=no ++ old_IFS=$IFS ++ for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-# Check whether --with-empress or --without-empress was given. +-if test "${with_empress+set}" = set; then +- withval="$with_empress" +- PHP_EMPRESS=$withval +-else +- +- PHP_EMPRESS=no +- test "$PHP_ENABLE_ALL" && PHP_EMPRESS=$PHP_ENABLE_ALL ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<&6 +-echo "configure:64424: checking for Empress support" >&5 +- if test "$PHP_EMPRESS" = "yes"; then +- ODBC_INCDIR=$EMPRESSPATH/include/odbc +- ODBC_LIBDIR=$EMPRESSPATH/shlib +- else +- ODBC_INCDIR=$PHP_EMPRESS/include/odbc +- ODBC_LIBDIR=$PHP_EMPRESS/shlib +- fi +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_TYPE=empress +- cat >> confdefs.h <<\EOF +-#define HAVE_EMPRESS 1 + EOF + +- echo "$ac_t""$ext_output" 1>&6 +- +- echo $ac_n "checking Empress library file""... $ac_c" 1>&6 +-echo "configure:64442: checking Empress library file" >&5 +- ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` +- if test ! -f $ODBC_LIBS; then +- ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` +- fi +- echo "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6 ++ ;; ++ esac ++ cat >> confdefs.h <>Makefile.objects<>Makefile.objects<&6 +-echo "configure:64498: checking for Empress local access support" >&5 +- if test "$PHP_EMPRESS_BCS" = "yes"; then +- ODBC_INCDIR=$EMPRESSPATH/include/odbc +- ODBC_LIBDIR=$EMPRESSPATH/shlib +- else +- ODBC_INCDIR=$PHP_EMPRESS_BCS/include/odbc +- ODBC_LIBDIR=$PHP_EMPRESS_BCS/shlib +- fi +- CC="empocc -bcs";export CC; +- LD="empocc -bcs";export LD; +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- LIST=`empocc -listlines -bcs -o a a.c` ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC oci8" ++ fi ++ ++ ++ BUILD_DIR="$BUILD_DIR $ext_builddir" ++ + +- NEWLIST= +- for I in $LIST +- do +- case $I in +- $EMPRESSPATH/odbccl/lib/* | \ +- $EMPRESSPATH/rdbms/lib/* | \ +- $EMPRESSPATH/common/lib/*) +- NEWLIST="$NEWLIST $I" +- ;; +- esac +- done +- ODBC_LIBS="-lempphpbcs -lms -lmscfg -lbasic -lbasic_os -lnlscstab -lnlsmsgtab -lm -ldl -lcrypt" +- ODBC_TYPE=empress-bcs +- cat >> confdefs.h <<\EOF +-#define HAVE_EMPRESS 1 +-EOF + +- echo "$ac_t""$ext_output" 1>&6 ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=oci8 + +- echo $ac_n "checking Empress local access library file""... $ac_c" 1>&6 +-echo "configure:64532: checking Empress local access library file" >&5 +- ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` +- if test ! -f $ODBCBCS_LIBS; then +- ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` +- fi +- echo "$ac_t""`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'`" 1>&6 ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + + fi +-fi +- +-if test -z "$ODBC_TYPE"; then + +-php_with_birdstep=no ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCI8 1 ++EOF + + +-# Check whether --with-birdstep or --without-birdstep was given. +-if test "${with_birdstep+set}" = set; then +- withval="$with_birdstep" +- PHP_BIRDSTEP=$withval +-else ++ + +- PHP_BIRDSTEP=no +- test "$PHP_ENABLE_ALL" && PHP_BIRDSTEP=$PHP_ENABLE_ALL ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD" + +-fi ++ + ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR" + ++ + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_BIRDSTEP in +-shared,*) +- PHP_BIRDSTEP=`echo "$PHP_BIRDSTEP"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_BIRDSTEP=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_ORACLE_VERSION" + ++ + + ++ cat >> confdefs.h <> confdefs.h <&6 ++echo "configure:65069: checking Oracle Instant Client directory" >&5 + +- +- if test "$PHP_BIRDSTEP" != "no"; then +- echo $ac_n "checking for Birdstep support""... $ac_c" 1>&6 +-echo "configure:64588: checking for Birdstep support" >&5 +- if test "$PHP_BIRDSTEP" = "yes"; then +- ODBC_INCDIR=/usr/local/birdstep/include +- ODBC_LIBDIR=/usr/local/birdstep/lib +- else +- ODBC_INCDIR=$PHP_BIRDSTEP/include +- ODBC_LIBDIR=$PHP_BIRDSTEP/$PHP_LIBDIR ++ if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then ++ PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` ++ if test -z "$PHP_OCI8_INSTANT_CLIENT"; then ++ { echo "configure: error: Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR" 1>&2; exit 1; } ++ fi + fi +- +- case $host_alias in +- *aix*) +- cat >> confdefs.h <<\EOF +-#define AIX 1 +-EOF +-;; +- *hpux*) +- cat >> confdefs.h <<\EOF +-#define HPUX 1 +-EOF +-;; +- *linux*) +- cat >> confdefs.h <<\EOF +-#define LINUX 1 +-EOF +-;; +- *qnx*) +- cat >> confdefs.h <<\EOF +-#define NEUTRINO 1 +-EOF +-;; +- i?86-*-solaris*) +- cat >> confdefs.h <<\EOF +-#define ISOLARIS 1 +-EOF +-;; +- sparc-*-solaris*) +- cat >> confdefs.h <<\EOF +-#define SOLARIS 1 +-EOF +-;; +- *unixware*) +- cat >> confdefs.h <<\EOF +-#define UNIXWARE 1 +-EOF +-;; +- esac ++ echo "$ac_t""$PHP_OCI8_INSTANT_CLIENT" 1>&6 + +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_TYPE=birdstep +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil" ++ OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT + +- if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then +- ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil" +- elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then +- ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil" +- fi ++ echo $ac_n "checking Oracle Instant Client SDK header directory""... $ac_c" 1>&6 ++echo "configure:65082: checking Oracle Instant Client SDK header directory" >&5 + +- cat >> confdefs.h <<\EOF +-#define HAVE_BIRDSTEP 1 +-EOF ++ OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib/*$!/usr/include/oracle/\1/client\2!'` + +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi ++ OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include + +-if test -z "$ODBC_TYPE"; then ++ OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib/*$!\1/include!'` + +-php_with_custom_odbc=no +- +- +-# Check whether --with-custom-odbc or --without-custom-odbc was given. +-if test "${with_custom_odbc+set}" = set; then +- withval="$with_custom_odbc" +- PHP_CUSTOM_ODBC=$withval +-else +- +- PHP_CUSTOM_ODBC=no +- test "$PHP_ENABLE_ALL" && PHP_CUSTOM_ODBC=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_CUSTOM_ODBC in +-shared,*) +- PHP_CUSTOM_ODBC=`echo "$PHP_CUSTOM_ODBC"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_CUSTOM_ODBC=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- +- +- +- if test "$PHP_CUSTOM_ODBC" != "no"; then +- echo $ac_n "checking for a custom ODBC support""... $ac_c" 1>&6 +-echo "configure:64700: checking for a custom ODBC support" >&5 +- if test "$PHP_CUSTOM_ODBC" = "yes"; then +- PHP_CUSTOM_ODBC=/usr/local +- fi +- ODBC_INCDIR=$PHP_CUSTOM_ODBC/include +- ODBC_LIBDIR=$PHP_CUSTOM_ODBC/$PHP_LIBDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LIBS=$CUSTOM_ODBC_LIBS +- ODBC_TYPE=custom-odbc +- cat >> confdefs.h <<\EOF +-#define HAVE_CODBC 1 +-EOF +- +- echo "$ac_t""$ext_ouput" 1>&6 +- fi +-fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_iodbc=no +- +- +-# Check whether --with-iodbc or --without-iodbc was given. +-if test "${with_iodbc+set}" = set; then +- withval="$with_iodbc" +- PHP_IODBC=$withval +-else +- +- PHP_IODBC=no +- test "$PHP_ENABLE_ALL" && PHP_IODBC=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_IODBC in +-shared,*) +- PHP_IODBC=`echo "$PHP_IODBC"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_IODBC=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- +- +- +- if test "$PHP_IODBC" != "no"; then +- echo $ac_n "checking for iODBC support""... $ac_c" 1>&6 +-echo "configure:64764: checking for iODBC support" >&5 +- if test "$PHP_IODBC" = "yes"; then +- PHP_IODBC=/usr/local +- fi +- +- +- if test -n "$PHP_IODBC/$PHP_LIBDIR"; then +- +- if test "$PHP_IODBC/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_IODBC/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PHP_IODBC/$PHP_LIBDIR" || echo "$PHP_IODBC/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_IODBC/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PHP_IODBC/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_IODBC/$PHP_LIBDIR\"`" +- fi +- +- ++ if test -f "$OCISDKRPMINC/oci.h"; then ++ echo "$ac_t""$OCISDKRPMINC" 1>&6 + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case iodbc in +- c|c_r|pthread*) ;; +- *) +- LIBS="-liodbc $LIBS" +- ;; +- esac +- +- +- +- +- +- if test "$PHP_IODBC/include" != "/usr/include"; then ++ if test "$OCISDKRPMINC" != "/usr/include"; then + +- if test -z "$PHP_IODBC/include" || echo "$PHP_IODBC/include" | grep '^/' >/dev/null ; then +- ai_p=$PHP_IODBC/include ++ if test -z "$OCISDKRPMINC" || echo "$OCISDKRPMINC" | grep '^/' >/dev/null ; then ++ ai_p=$OCISDKRPMINC + else + +- ep_dir="`echo $PHP_IODBC/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCISDKRPMINC|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_IODBC/include\"`" ++ ai_p="$ep_realdir/`basename \"$OCISDKRPMINC\"`" + fi + + +@@ -64834,7 +65109,7 @@ echo "configure:64764: checking for iODB + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "INCLUDEPATH$unique=set" + +- if test "1"; then ++ if test ""; then + INCLUDES="-I$ai_p $INCLUDES" + else + INCLUDES="$INCLUDES -I$ai_p" +@@ -64844,302 +65119,54 @@ echo "configure:64764: checking for iODB + + fi + +- ODBC_TYPE=iodbc +- ODBC_INCLUDE=-I$PHP_IODBC/include +- ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR +- ODBC_LIBS=-liodbc +- cat >> confdefs.h <<\EOF +-#define HAVE_IODBC 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ODBC2 1 +-EOF +- +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_esoob=no +- +- +-# Check whether --with-esoob or --without-esoob was given. +-if test "${with_esoob+set}" = set; then +- withval="$with_esoob" +- PHP_ESOOB=$withval +-else +- +- PHP_ESOOB=no +- test "$PHP_ENABLE_ALL" && PHP_ESOOB=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_ESOOB in +-shared,*) +- PHP_ESOOB=`echo "$PHP_ESOOB"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_ESOOB=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- +- +- +- if test "$PHP_ESOOB" != "no"; then +- echo $ac_n "checking for Easysoft ODBC-ODBC Bridge support""... $ac_c" 1>&6 +-echo "configure:64910: checking for Easysoft ODBC-ODBC Bridge support" >&5 +- if test "$PHP_ESOOB" = "yes"; then +- PHP_ESOOB=/usr/local/easysoft/oob/client +- fi +- ODBC_INCDIR=$PHP_ESOOB/include +- ODBC_LIBDIR=$PHP_ESOOB/$PHP_LIBDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LIBS=-lesoobclient +- ODBC_TYPE=esoob +- cat >> confdefs.h <<\EOF +-#define HAVE_ESOOB 1 +-EOF +- +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_unixodbc=no +- +- +-# Check whether --with-unixODBC or --without-unixODBC was given. +-if test "${with_unixODBC+set}" = set; then +- withval="$with_unixODBC" +- PHP_UNIXODBC=$withval +-else +- +- PHP_UNIXODBC=no +- test "$PHP_ENABLE_ALL" && PHP_UNIXODBC=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_UNIXODBC in +-shared,*) +- PHP_UNIXODBC=`echo "$PHP_UNIXODBC"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_UNIXODBC=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- +- +- +- if test "$PHP_UNIXODBC" != "no"; then +- echo $ac_n "checking for unixODBC support""... $ac_c" 1>&6 +-echo "configure:64974: checking for unixODBC support" >&5 +- if test "$PHP_UNIXODBC" = "yes"; then +- PHP_UNIXODBC=/usr/local +- fi +- ODBC_INCDIR=$PHP_UNIXODBC/include +- ODBC_LIBDIR=$PHP_UNIXODBC/$PHP_LIBDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LIBS=-lodbc +- ODBC_TYPE=unixODBC +- +-if ! test -f "$ODBC_INCDIR/sqlext.h"; then +- { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlext.h' not found!" 1>&2; exit 1; } +-fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_UNIXODBC 1 +-EOF +- +- echo "$ac_t""$ext_output" 1>&6 +- fi +-fi +- +-if test -z "$ODBC_TYPE"; then +- +-php_with_dbmaker=no +- +- +-# Check whether --with-dbmaker or --without-dbmaker was given. +-if test "${with_dbmaker+set}" = set; then +- withval="$with_dbmaker" +- PHP_DBMAKER=$withval +-else +- +- PHP_DBMAKER=no +- test "$PHP_ENABLE_ALL" && PHP_DBMAKER=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_DBMAKER in +-shared,*) +- PHP_DBMAKER=`echo "$PHP_DBMAKER"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_DBMAKER=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +- +- +- +- +- +- if test "$PHP_DBMAKER" != "no"; then +- echo $ac_n "checking for DBMaker support""... $ac_c" 1>&6 +-echo "configure:65043: checking for DBMaker support" >&5 +- if test "$PHP_DBMAKER" = "yes"; then +- # find dbmaker's home directory +- DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'` +- +- # check DBMaker version (from 5.0 to 2.0) +- DBMAKER_VERSION=5.0 +- +- while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do +- DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | $AWK '{ print $1-1;}'` +- MAJOR_V=`echo $DM_VER | $AWK '{ print $1/10; }' | $AWK -F. '{ print $1; }'` +- MINOR_V=`echo $DM_VER | $AWK '{ print $1%10; }'` +- DBMAKER_VERSION=$MAJOR_V.$MINOR_V +- done +- +- if test "$DBMAKER_VERSION" = "2.9"; then +- PHP_DBMAKER=$DBMAKER_HOME +- else +- PHP_DBMAKER=$DBMAKER_HOME/$DBMAKER_VERSION +- fi +- fi +- +- ODBC_INCDIR=$PHP_DBMAKER/include +- ODBC_LIBDIR=$PHP_DBMAKER/$PHP_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LFLAGS=-L$ODBC_LIBDIR +- ODBC_INCLUDE=-I$ODBC_INCDIR +- ODBC_LIBS="-ldmapic -lc" +- ODBC_TYPE=dbmaker +- +- cat >> confdefs.h <<\EOF +-#define HAVE_DBMAKER 1 +-EOF +- +- +- if test "$ext_shared" = "yes"; then +- echo "$ac_t""yes (shared)" 1>&6 +- ODBC_LIBS="-ldmapic -lc -lm" +- ODBC_SHARED="odbc.la" +- else +- echo "$ac_t""yes (static)" 1>&6 ++ OCI8INCDIR=$OCISDKRPMINC ++ elif test -f "$OCISDKZIPINC/oci.h"; then ++ echo "$ac_t""$OCISDKZIPINC" 1>&6 + +- +- if test -n "$ODBC_LIBDIR"; then +- +- if test "$ODBC_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ODBC_LIBDIR" != "/usr/lib"; then ++ if test "$OCISDKZIPINC" != "/usr/include"; then + +- if test -z "$ODBC_LIBDIR" || echo "$ODBC_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$ODBC_LIBDIR ++ if test -z "$OCISDKZIPINC" || echo "$OCISDKZIPINC" | grep '^/' >/dev/null ; then ++ ai_p=$OCISDKZIPINC + else + +- ep_dir="`echo $ODBC_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCISDKZIPINC|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ODBC_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$OCISDKZIPINC\"`" + fi + + +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi + + fi + + fi +- +- +- case dmapic in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ldmapic $LIBS" +- ;; +- esac +- +- +- + ++ OCI8INCDIR=$OCISDKZIPINC ++ elif test -f "$OCISDKMANINC/oci.h"; then ++ echo "$ac_t""$OCISDKMANINC" 1>&6 + +- if test "$ODBC_INCDIR" != "/usr/include"; then ++ if test "$OCISDKMANINC" != "/usr/include"; then + +- if test -z "$ODBC_INCDIR" || echo "$ODBC_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$ODBC_INCDIR ++ if test -z "$OCISDKMANINC" || echo "$OCISDKMANINC" | grep '^/' >/dev/null ; then ++ ai_p=$OCISDKMANINC + else + +- ep_dir="`echo $ODBC_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $OCISDKMANINC|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ODBC_INCDIR\"`" ++ ai_p="$ep_realdir/`basename \"$OCISDKMANINC\"`" + fi + + +@@ -65160,19 +65187,19 @@ EOF + + fi + +- ODBC_STATIC="libphpext_odbc.la" ++ OCI8INCDIR=$OCISDKMANINC ++ else ++ { echo "configure: error: Oracle Instant Client SDK header files not found" 1>&2; exit 1; } + fi +- fi +-fi + +-if test -n "$ODBC_TYPE"; then +- if test "$ODBC_TYPE" != "dbmaker"; then +- +- for ac_i in $ODBC_LFLAGS $ODBC_LIBS; do ++ OCISYSLIBLIST=`echo "$OCI8INCDIR" | $PHP_OCI8_SED -e 's!\(.*\)/include$!\1/demo/sysliblist!'` ++ if test -f "$OCISYSLIBLIST"; then ++ ++ for ac_i in `cat $OCISYSLIBLIST`; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- ODBC_SHARED_LIBADD="$ODBC_SHARED_LIBADD -pthread" ++ OCI8_SYSLIB="$OCI8_SYSLIB -pthread" + else + + +@@ -65194,7 +65221,7 @@ if test -n "$ODBC_TYPE"; then + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- ODBC_SHARED_LIBADD="$ODBC_SHARED_LIBADD -l$ac_ii" ++ OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii" + else + + +@@ -65229,8 +65256,8 @@ if test -n "$ODBC_TYPE"; then + + + if test "$ext_shared" = "yes"; then +- ODBC_SHARED_LIBADD="-L$ai_p $ODBC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && ODBC_SHARED_LIBADD="$ld_runpath_switch$ai_p $ODBC_SHARED_LIBADD" ++ OCI8_SYSLIB="-L$ai_p $OCI8_SYSLIB" ++ test -n "$ld_runpath_switch" && OCI8_SYSLIB="$ld_runpath_switch$ai_p $OCI8_SYSLIB" + else + + +@@ -65256,66 +65283,127 @@ if test -n "$ODBC_TYPE"; then + esac + done + +- if test "$ODBC_TYPE" != "birdstep" && test "$ODBC_TYPE" != "solid"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLDATASOURCES 1 +-EOF ++ fi + ++ ++ echo $ac_n "checking Oracle Instant Client version""... $ac_c" 1>&6 ++echo "configure:65291: checking Oracle Instant Client version" >&5 ++ if test -f $PHP_OCI8_INSTANT_CLIENT/libnnz11.$SHLIB_SUFFIX_NAME; then ++ if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then ++ if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then ++ { echo "configure: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.11.1 not found" 1>&2; exit 1; } ++ fi ++ OCI8_ORACLE_VERSION=11.1 ++ else ++ { echo "configure: error: Oracle Instant Client library version not supported" 1>&2; exit 1; } ++ fi ++ elif test -f $PHP_OCI8_INSTANT_CLIENT/libnnz10.$SHLIB_SUFFIX_NAME; then ++ if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then ++ if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then ++ { echo "configure: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found" 1>&2; exit 1; } ++ fi ++ OCI8_ORACLE_VERSION=10.1 ++ else ++ { echo "configure: error: Oracle Instant Client library version not supported" 1>&2; exit 1; } + fi ++ else ++ { echo "configure: error: Oracle Instant Client libraries not found" 1>&2; exit 1; } + fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_UODBC 1 +-EOF ++ echo "$ac_t""$OCI8_ORACLE_VERSION" 1>&6 + ++ case $OCI8_ORACLE_VERSION in ++ 10.1|11.1) ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_SHARED_LIBADD" +- ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh" ++ else ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCDIR" ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -lclntsh" ++ ;; ++ esac + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBDIR" + +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCLUDE" ++ fi ++ ;; ++ esac + +- + +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBS" ++ ++ if test "$PHP_OCI8_INSTANT_CLIENT" != "/usr/$PHP_LIBDIR" && test "$PHP_OCI8_INSTANT_CLIENT" != "/usr/lib"; then ++ ++ if test -z "$PHP_OCI8_INSTANT_CLIENT" || echo "$PHP_OCI8_INSTANT_CLIENT" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_OCI8_INSTANT_CLIENT ++ else ++ ++ ep_dir="`echo $PHP_OCI8_INSTANT_CLIENT|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_OCI8_INSTANT_CLIENT\"`" ++ fi + ++ ++ if test "$ext_shared" = "yes"; then ++ OCI8_SHARED_LIBADD="-L$ai_p $OCI8_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p $OCI8_SHARED_LIBADD" ++ else ++ + +- + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LFLAGS" +- ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_TYPE" + +- ++ fi ++ ++ fi + ++ ;; + +- +- ext_builddir=ext/odbc +- ext_srcdir=$abs_srcdir/ext/odbc ++ *) ++ { echo "configure: error: Oracle Instant Client version $PHP_OCI8_INSTANT_CLIENT is not supported" 1>&2; exit 1; } ++ ;; ++ esac + +- ac_extra=`echo "$ODBC_INCLUDE"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCI_INSTANT_CLIENT 1 ++EOF ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCI_LOB_READ2 1 ++EOF ++ ++ ++ ++ ext_builddir=ext/oci8 ++ ext_srcdir=$abs_srcdir/ext/oci8 ++ ++ ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_ODBC_SHARED=no ++ PHP_OCI8_SHARED=no + + +- case ext/odbc in ++ case ext/oci8 in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -65330,7 +65418,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_odbc.c; do ++ for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do + + IFS=. + set $ac_src +@@ -65353,18 +65441,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC odbc" ++ EXT_STATIC="$EXT_STATIC oci8" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC odbc" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC oci8" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_ODBC_SHARED=yes ++ PHP_OCI8_SHARED=yes + +- case ext/odbc in ++ case ext/oci8 in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -65379,14 +65467,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_odbc.c; do ++ for ac_src in oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_odbc="$shared_objects_odbc $ac_bdir$ac_obj.lo" ++ shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -65409,31 +65497,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpodbc.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpodbc.so '$ext_builddir'/phpodbc.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpoci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpoci8.so '$ext_builddir'/phpoci8.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPODBC, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPOCI8, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpodbc.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpoci8.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpodbc.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpoci8.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_odbc" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_OCI8 1 ++EOF ++ ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD" ++ ++ ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR" ++ ++ ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_ORACLE_VERSION" ++ ++ ++ ++ ++ fi + fi + + + +-php_enable_pcntl=no + +-echo $ac_n "checking whether to enable pcntl support""... $ac_c" 1>&6 +-echo "configure:65605: checking whether to enable pcntl support" >&5 +-# Check whether --enable-pcntl or --disable-pcntl was given. +-if test "${enable_pcntl+set}" = set; then +- enableval="$enable_pcntl" +- PHP_PCNTL=$enableval ++ ++ ++ ++ ++ ++ ++ ++ ++if test -z "$ODBC_TYPE"; then ++ ++php_with_adabas=no ++ ++ ++# Check whether --with-adabas or --without-adabas was given. ++if test "${with_adabas+set}" = set; then ++ withval="$with_adabas" ++ PHP_ADABAS=$withval + else + +- PHP_PCNTL=no +- test "$PHP_ENABLE_ALL" && PHP_PCNTL=$PHP_ENABLE_ALL ++ PHP_ADABAS=no ++ test "$PHP_ENABLE_ALL" && PHP_ADABAS=$PHP_ENABLE_ALL + + fi + +@@ -65617,12 +65740,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PCNTL in ++case $PHP_ADABAS in + shared,*) +- PHP_PCNTL=`echo "$PHP_PCNTL"|$SED 's/^shared,//'` ++ PHP_ADABAS=`echo "$PHP_ADABAS"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PCNTL=yes ++ PHP_ADABAS=yes + ;; + no) + ext_output=no +@@ -65636,554 +65759,316 @@ esac + + + +-echo "$ac_t""$ext_output" 1>&6 + + + + +-if test "$PHP_PCNTL" != "no"; then +- for ac_func in fork +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:65649: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); + +-int main() { ++ if test "$PHP_ADABAS" != "no"; then ++ echo $ac_n "checking for Adabas support""... $ac_c" 1>&6 ++echo "configure:65770: checking for Adabas support" >&5 ++ if test "$PHP_ADABAS" = "yes"; then ++ PHP_ADABAS=/usr/local ++ fi ++ ++ if test "$PHP_ADABAS/incl" != "/usr/include"; then ++ ++ if test -z "$PHP_ADABAS/incl" || echo "$PHP_ADABAS/incl" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ADABAS/incl ++ else ++ ++ ep_dir="`echo $PHP_ADABAS/incl|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ADABAS/incl\"`" ++ fi + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +-; return 0; } +-EOF +-if { (eval echo configure:65677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi ++ fi + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_FORK 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } +-fi +-done ++ ++ if test "$PHP_ADABAS/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ADABAS/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ADABAS/$PHP_LIBDIR" || echo "$PHP_ADABAS/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ADABAS/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_ADABAS/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ADABAS/$PHP_LIBDIR\"`" ++ fi + +- for ac_func in waitpid +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:65708: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++ ++ fi + +-; return 0; } +-EOF +-if { (eval echo configure:65736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi ++ ODBC_OBJS="$PHP_ADABAS/$PHP_LIBDIR/odbclib.a" ++ ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a" ++ $srcdir/build/shtool mkdir -f -p ext/odbc ++ rm -f "$ODBC_LIB" ++ cp "$ODBC_OBJS" "$ODBC_LIB" ++ ++ ++ case sqlptc in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsqlptc $LIBS" ++ ;; ++ esac + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_WAITPID 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } +-fi +-done + +- for ac_func in sigaction +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:65767: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++ ++ ++ case sqlrte in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsqlrte $LIBS" ++ ;; ++ esac + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++ + +-; return 0; } +-EOF +-if { (eval echo configure:65795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi ++ if test -n "$abs_builddir/ext/odbc"; then ++ ++ if test "$abs_builddir/ext/odbc" != "/usr/$PHP_LIBDIR" && test "$abs_builddir/ext/odbc" != "/usr/lib"; then ++ ++ if test -z "$abs_builddir/ext/odbc" || echo "$abs_builddir/ext/odbc" | grep '^/' >/dev/null ; then ++ ai_p=$abs_builddir/ext/odbc ++ else ++ ++ ep_dir="`echo $abs_builddir/ext/odbc|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$abs_builddir/ext/odbc\"`" ++ fi + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_SIGACTION 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: pcntl: sigaction() not supported by this platform" 1>&2; exit 1; } +-fi +-done ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +- for ac_func in getpriority setpriority wait3 sigprocmask sigwaitinfo sigtimedwait +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:65826: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- +-; return 0; } +-EOF +-if { (eval echo configure:65854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done ++ ++ fi + ++ fi + +- ext_builddir=ext/pcntl +- ext_srcdir=$abs_srcdir/ext/pcntl +- +- ac_extra= +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then +- PHP_PCNTL_SHARED=no +- + +- case ext/pcntl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ case odbc_adabas in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lodbc_adabas $LIBS" ++ ;; + esac +- +- + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + + +- old_IFS=$IFS +- for ac_src in pcntl.c php_signal.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ ODBC_TYPE=adabas ++ ODBC_INCDIR=$PHP_ADABAS/incl ++ ++if ! test -f "$ODBC_INCDIR/sqlext.h"; then ++ { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlext.h' not found!" 1>&2; exit 1; } ++fi + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_ADABAS 1 + EOF +- done + ++ echo "$ac_t""$ext_output" 1>&6 ++ fi ++fi + +- EXT_STATIC="$EXT_STATIC pcntl" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC pcntl" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PCNTL_SHARED=yes +- +- case ext/pcntl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++if test -z "$ODBC_TYPE"; then + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo ++php_with_sapdb=no + + +- old_IFS=$IFS +- for ac_src in pcntl.c php_signal.c; do ++# Check whether --with-sapdb or --without-sapdb was given. ++if test "${with_sapdb+set}" = set; then ++ withval="$with_sapdb" ++ PHP_SAPDB=$withval ++else + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_pcntl="$shared_objects_pcntl $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <&6 ++echo "configure:65973: checking for SAP DB support" >&5 ++ if test "$PHP_SAPDB" = "yes"; then ++ PHP_SAPDB=/usr/local + fi ++ ++ if test "$PHP_SAPDB/incl" != "/usr/include"; then ++ ++ if test -z "$PHP_SAPDB/incl" || echo "$PHP_SAPDB/incl" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_SAPDB/incl ++ else ++ ++ ep_dir="`echo $PHP_SAPDB/incl|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_SAPDB/incl\"`" + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" = "cli"; then +- PHP_PCNTL_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/pcntl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++ fi + ++ ++ if test "$PHP_SAPDB/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_SAPDB/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_SAPDB/$PHP_LIBDIR" || echo "$PHP_SAPDB/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_SAPDB/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_SAPDB/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_SAPDB/$PHP_LIBDIR\"`" ++ fi + +- old_IFS=$IFS +- for ac_src in pcntl.c php_signal.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_SAPDB 1 ++EOF + ++ echo "$ac_t""$ext_output" 1>&6 + fi +- + fi + ++if test -z "$ODBC_TYPE"; then + ++php_with_solid=no + + +- +-php_enable_pdo=yes +- +-echo $ac_n "checking whether to enable PDO support""... $ac_c" 1>&6 +-echo "configure:66179: checking whether to enable PDO support" >&5 +-# Check whether --enable-pdo or --disable-pdo was given. +-if test "${enable_pdo+set}" = set; then +- enableval="$enable_pdo" +- PHP_PDO=$enableval ++# Check whether --with-solid or --without-solid was given. ++if test "${with_solid+set}" = set; then ++ withval="$with_solid" ++ PHP_SOLID=$withval + else + +- PHP_PDO=yes +- test "$PHP_ENABLE_ALL" && PHP_PDO=$PHP_ENABLE_ALL ++ PHP_SOLID=no ++ test "$PHP_ENABLE_ALL" && PHP_SOLID=$PHP_ENABLE_ALL + + fi + +@@ -66191,12 +66076,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO in ++case $PHP_SOLID in + shared,*) +- PHP_PDO=`echo "$PHP_PDO"|$SED 's/^shared,//'` ++ PHP_SOLID=`echo "$PHP_SOLID"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO=yes ++ PHP_SOLID=yes + ;; + no) + ext_output=no +@@ -66210,414 +66095,315 @@ esac + + + +-echo "$ac_t""$ext_output" 1>&6 + + + + +-if test "$PHP_PDO" != "no"; then + +- PHP_PDO=yes ++ if test "$PHP_SOLID" != "no"; then ++ echo $ac_n "checking for Solid support""... $ac_c" 1>&6 ++echo "configure:66106: checking for Solid support" >&5 ++ if test "$PHP_SOLID" = "yes"; then ++ PHP_SOLID=/usr/local/solid ++ fi ++ ODBC_INCDIR=$PHP_SOLID/include ++ ODBC_LIBDIR=$PHP_SOLID/$PHP_LIBDIR ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_TYPE=solid ++ if test -f $ODBC_LIBDIR/soc*35.a; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SOLID_35 1 ++EOF + +- +- pdo_running_under_pear=0 +- case `pwd` in +- /var/tmp/pear-build-*) +- pdo_running_under_pear=1 +- ;; +- esac ++ elif test -f $ODBC_LIBDIR/scl*30.a; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SOLID_30 1 ++EOF + +- if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then +- # we're running in an environment that smells like pear, +- # and the PHP_PEAR_VERSION env var is not set. That implies +- # that we're running under a slightly broken pear installer +- { echo "configure: error: +-PDO requires that you upgrade your PEAR installer tools. Please +-do so now by running: ++ elif test -f $ODBC_LIBDIR/scl*23.a; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SOLID 1 ++EOF + +- % sudo pear upgrade pear ++ fi ++ echo "$ac_t""$ext_output" 1>&6 ++ ++ echo $ac_n "checking Solid library file""... $ac_c" 1>&6 ++echo "configure:66133: checking Solid library file" >&5 ++ ac_solid_uname_r=`uname -r 2>/dev/null` ++ ac_solid_uname_s=`uname -s 2>/dev/null` ++ case $ac_solid_uname_s in ++ AIX) ac_solid_os=a3x;; # a4x for AIX4/ Solid 2.3/3.0 only ++ HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10 ++ IRIX) ac_solid_os=irx;; # Solid 2.3(?)/ 3.0 only ++ Linux) ++ if ldd -v /bin/sh | grep GLIBC > /dev/null; then ++ cat >> confdefs.h <<\EOF ++#define SS_LINUX 1 ++EOF + +-or by manually downloading and installing PEAR version 1.3.5 or higher. ++ ac_solid_os=l2x ++ else ++ cat >> confdefs.h <<\EOF ++#define SS_LINUX 1 ++EOF + +-Once you've upgraded, please re-try your PDO install. +- " 1>&2; exit 1; } +- fi ++ ac_solid_os=lux ++ fi;; ++ SunOS) ++ ac_solid_os=ssx;; # should we deal with SunOS 4? ++ FreeBSD) ++ if test `expr $ac_solid_uname_r : '\(.\)'` -gt "2"; then ++ cat >> confdefs.h <<\EOF ++#define SS_FBX 1 ++EOF + ++ ac_solid_os=fex ++ else ++ cat >> confdefs.h <<\EOF ++#define SS_FBX 1 ++EOF + +- if test "$ext_shared" = "yes" ; then +- case $host_alias in +- *darwin*) +- { echo "configure: error: +-Due to the way that loadable modules work on OSX/Darwin, you need to +-compile the PDO package statically into the PHP core. ++ ac_solid_os=fbx ++ fi;; ++ esac + +-Please follow the instructions at: http://netevil.org/node.php?nid=202 +-for more detail on this issue. +- " 1>&2; exit 1; } +- ext_shared=no +- ;; +- esac ++ if test -f $ODBC_LIBDIR/soc${ac_solid_os}35.a; then ++ ac_solid_version=35 ++ ac_solid_prefix=soc ++ elif test -f $ODBC_LIBDIR/scl${ac_solid_os}30.a; then ++ ac_solid_version=30 ++ ac_solid_prefix=scl ++ elif test -f $ODBC_LIBDIR/scl${ac_solid_os}23.a; then ++ ac_solid_version=23 ++ ac_solid_prefix=scl + fi +- +- ext_builddir=ext/pdo +- ext_srcdir=$abs_srcdir/ext/pdo +- +- ac_extra= +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_SHARED=no +- +- +- case ext/pdo in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo/"; ac_bdir="ext/pdo/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++# ++# Check for the library files, and setup the ODBC_LIBS path... ++# ++if test ! -f $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \ ++ ! -f $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then ++ # ++ # we have an error and should bail out, as we can't find the libs! ++ # ++ echo "" ++ echo "*********************************************************************" ++ echo "* Unable to locate $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a" ++ echo "* Please correct this by creating the following links and reconfiguring:" ++ echo "* $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a" ++ echo "* $ODBC_LIBDIR/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so" ++ echo "*********************************************************************" ++else ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version} ++fi + ++ echo "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6 + +- old_IFS=$IFS +- for ac_src in pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ fi ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++if test -z "$ODBC_TYPE"; then + +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<&6 ++echo "configure:66254: checking for IBM DB2 support" >&5 ++ if test "$PHP_IBM_DB2" = "yes"; then ++ ODBC_INCDIR=/home/db2inst1/sqllib/include ++ ODBC_LIBDIR=/home/db2inst1/sqllib/lib ++ else ++ ODBC_INCDIR=$PHP_IBM_DB2/include ++ ODBC_LIBDIR=$PHP_IBM_DB2/$PHP_LIBDIR ++ fi + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/pdo.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo) $(PDO_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/pdo.so '$ext_builddir'/pdo.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PDO, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo) $(PDO_SHARED_LIBADD)' +- ;; +- esac ++ ++if ! test -f "$ODBC_INCDIR/sqlcli1.h"; then ++ { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlcli1.h' not found!" 1>&2; exit 1; } ++fi + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/pdo.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/pdo.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo" + +- cat >>Makefile.objects< conftest.$ac_ext <> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_IBMDB2 1 + EOF + +- fi +- fi +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_PDO_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- ++ echo "$ac_t""$ext_output" 1>&6 ++ + +- case ext/pdo in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo/"; ac_bdir="ext/pdo/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: ++build test failed. Please check the config.log for details. ++You need to source your DB2 environment before running PHP configure: ++# . \$IBM_DB2/db2profile ++" 1>&2; exit 1; } ++ + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++fi ++rm -fr conftest* ++fi + + +- old_IFS=$IFS +- for ac_src in pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ fi ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++if test -z "$ODBC_TYPE"; then + +- cat >>Makefile.objects<>Makefile.objects<&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo, which depends on extension spl, +-but you've either not enabled spl, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- +- +- +- +- header_path=ext/pdo +- for header_file in php_pdo.h php_pdo_driver.h; do +- hp_hf="$header_path/$header_file" +- +- +- unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" +- +- INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" +- +- fi + +- done +- + +- + +- +- src=$ext_srcdir/Makefile.frag +- ac_srcdir=$ext_srcdir +- ac_builddir=$ext_builddir +- test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments ++ if test "$PHP_ODBCROUTER" != "no"; then ++ echo $ac_n "checking for ODBCRouter.com support""... $ac_c" 1>&6 ++echo "configure:66377: checking for ODBCRouter.com support" >&5 ++ if test "$PHP_ODBCROUTER" = "yes"; then ++ PHP_ODBCROUTER=/usr ++ fi ++ ODBC_INCDIR=$PHP_ODBCROUTER/include ++ ODBC_LIBDIR=$PHP_ODBCROUTER/lib ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LIBS=-lodbcsdk ++ ODBC_TYPE=ODBCRouter ++ cat >> confdefs.h <<\EOF ++#define HAVE_ODBC_ROUTER 1 ++EOF + ++ echo "$ac_t""$ext_output" 1>&6 ++ fi + fi + ++if test -z "$ODBC_TYPE"; then + ++php_with_empress=no + + +-php_with_pdo_dblib=no +- +-echo $ac_n "checking for PDO_DBLIB support via FreeTDS""... $ac_c" 1>&6 +-echo "configure:66613: checking for PDO_DBLIB support via FreeTDS" >&5 +-# Check whether --with-pdo-dblib or --without-pdo-dblib was given. +-if test "${with_pdo_dblib+set}" = set; then +- withval="$with_pdo_dblib" +- PHP_PDO_DBLIB=$withval ++# Check whether --with-empress or --without-empress was given. ++if test "${with_empress+set}" = set; then ++ withval="$with_empress" ++ PHP_EMPRESS=$withval + else + +- PHP_PDO_DBLIB=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_DBLIB=$PHP_ENABLE_ALL ++ PHP_EMPRESS=no ++ test "$PHP_ENABLE_ALL" && PHP_EMPRESS=$PHP_ENABLE_ALL + + fi + +@@ -66625,12 +66411,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO_DBLIB in ++case $PHP_EMPRESS in + shared,*) +- PHP_PDO_DBLIB=`echo "$PHP_PDO_DBLIB"|$SED 's/^shared,//'` ++ PHP_EMPRESS=`echo "$PHP_EMPRESS"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO_DBLIB=yes ++ PHP_EMPRESS=yes + ;; + no) + ext_output=no +@@ -66644,146 +66430,371 @@ esac + + + +-echo "$ac_t""$ext_output" 1>&6 +- + + + +-if test "$PHP_PDO_DBLIB" != "no"; then + +- if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } +- fi + +- if test "$PHP_PDO_DBLIB" = "yes"; then ++ if test "$PHP_EMPRESS" != "no"; then ++ echo $ac_n "checking for Empress support""... $ac_c" 1>&6 ++echo "configure:66441: checking for Empress support" >&5 ++ if test "$PHP_EMPRESS" = "yes"; then ++ ODBC_INCDIR=$EMPRESSPATH/include/odbc ++ ODBC_LIBDIR=$EMPRESSPATH/shlib ++ else ++ ODBC_INCDIR=$PHP_EMPRESS/include/odbc ++ ODBC_LIBDIR=$PHP_EMPRESS/shlib ++ fi ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_TYPE=empress ++ cat >> confdefs.h <<\EOF ++#define HAVE_EMPRESS 1 ++EOF + +- for i in /usr/local /usr; do +- if test -f $i/include/sybdb.h; then +- PDO_FREETDS_INSTALLATION_DIR=$i +- PDO_FREETDS_INCLUDE_DIR=$i/include +- break +- elif test -f $i/include/freetds/sybdb.h; then +- PDO_FREETDS_INSTALLATION_DIR=$i +- PDO_FREETDS_INCLUDE_DIR=$i/include/freetds +- break; +- fi +- done ++ echo "$ac_t""$ext_output" 1>&6 ++ ++ echo $ac_n "checking Empress library file""... $ac_c" 1>&6 ++echo "configure:66459: checking Empress library file" >&5 ++ ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` ++ if test ! -f $ODBC_LIBS; then ++ ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1` ++ fi ++ echo "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6 + +- if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then +- { echo "configure: error: Cannot find FreeTDS in known installation directories" 1>&2; exit 1; } +- fi ++ fi ++fi + +- elif test "$PHP_PDO_DBLIB" != "no"; then ++if test -z "$ODBC_TYPE"; then + +- if test -f $PHP_PDO_DBLIB/include/sybdb.h; then +- PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB +- PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include +- elif test -f $PHP_PDO_DBLIB/include/freetds/sybdb.h; then +- PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB +- PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include/freetds ++php_with_empress_bcs=no ++ ++ ++# Check whether --with-empress-bcs or --without-empress-bcs was given. ++if test "${with_empress_bcs+set}" = set; then ++ withval="$with_empress_bcs" ++ PHP_EMPRESS_BCS=$withval ++else ++ ++ PHP_EMPRESS_BCS=no ++ test "$PHP_ENABLE_ALL" && PHP_EMPRESS_BCS=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_EMPRESS_BCS in ++shared,*) ++ PHP_EMPRESS_BCS=`echo "$PHP_EMPRESS_BCS"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_EMPRESS_BCS=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++ ++ ++ ++ ++ ++ if test "$PHP_EMPRESS_BCS" != "no"; then ++ echo $ac_n "checking for Empress local access support""... $ac_c" 1>&6 ++echo "configure:66515: checking for Empress local access support" >&5 ++ if test "$PHP_EMPRESS_BCS" = "yes"; then ++ ODBC_INCDIR=$EMPRESSPATH/include/odbc ++ ODBC_LIBDIR=$EMPRESSPATH/shlib + else +- { echo "configure: error: Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory" 1>&2; exit 1; } ++ ODBC_INCDIR=$PHP_EMPRESS_BCS/include/odbc ++ ODBC_LIBDIR=$PHP_EMPRESS_BCS/shlib + fi +- fi ++ CC="empocc -bcs";export CC; ++ LD="empocc -bcs";export LD; ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ LIST=`empocc -listlines -bcs -o a a.c` + +- if test "x$PHP_LIBDIR" = "x" ; then +- PHP_LIBDIR=lib +- fi ++ NEWLIST= ++ for I in $LIST ++ do ++ case $I in ++ $EMPRESSPATH/odbccl/lib/* | \ ++ $EMPRESSPATH/rdbms/lib/* | \ ++ $EMPRESSPATH/common/lib/*) ++ NEWLIST="$NEWLIST $I" ++ ;; ++ esac ++ done ++ ODBC_LIBS="-lempphpbcs -lms -lmscfg -lbasic -lbasic_os -lnlscstab -lnlsmsgtab -lm -ldl -lcrypt" ++ ODBC_TYPE=empress-bcs ++ cat >> confdefs.h <<\EOF ++#define HAVE_EMPRESS 1 ++EOF + +- if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then +- { echo "configure: error: Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a|so" 1>&2; exit 1; } ++ echo "$ac_t""$ext_output" 1>&6 ++ ++ echo $ac_n "checking Empress local access library file""... $ac_c" 1>&6 ++echo "configure:66549: checking Empress local access library file" >&5 ++ ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` ++ if test ! -f $ODBCBCS_LIBS; then ++ ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1` + fi ++ echo "$ac_t""`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'`" 1>&6 + +- +- if test "$PDO_FREETDS_INCLUDE_DIR" != "/usr/include"; then +- +- if test -z "$PDO_FREETDS_INCLUDE_DIR" || echo "$PDO_FREETDS_INCLUDE_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_FREETDS_INCLUDE_DIR +- else +- +- ep_dir="`echo $PDO_FREETDS_INCLUDE_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INCLUDE_DIR\"`" + fi ++fi + +- ++if test -z "$ODBC_TYPE"; then ++ ++php_with_birdstep=no ++ ++ ++# Check whether --with-birdstep or --without-birdstep was given. ++if test "${with_birdstep+set}" = set; then ++ withval="$with_birdstep" ++ PHP_BIRDSTEP=$withval ++else + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ PHP_BIRDSTEP=no ++ test "$PHP_ENABLE_ALL" && PHP_BIRDSTEP=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_BIRDSTEP in ++shared,*) ++ PHP_BIRDSTEP=`echo "$PHP_BIRDSTEP"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_BIRDSTEP=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++ ++ ++ ++ + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ if test "$PHP_BIRDSTEP" != "no"; then ++ echo $ac_n "checking for Birdstep support""... $ac_c" 1>&6 ++echo "configure:66605: checking for Birdstep support" >&5 ++ if test "$PHP_BIRDSTEP" = "yes"; then ++ ODBC_INCDIR=/usr/local/birdstep/include ++ ODBC_LIBDIR=/usr/local/birdstep/lib ++ else ++ ODBC_INCDIR=$PHP_BIRDSTEP/include ++ ODBC_LIBDIR=$PHP_BIRDSTEP/$PHP_LIBDIR ++ fi ++ ++ case $host_alias in ++ *aix*) ++ cat >> confdefs.h <<\EOF ++#define AIX 1 ++EOF ++;; ++ *hpux*) ++ cat >> confdefs.h <<\EOF ++#define HPUX 1 ++EOF ++;; ++ *linux*) ++ cat >> confdefs.h <<\EOF ++#define LINUX 1 ++EOF ++;; ++ *qnx*) ++ cat >> confdefs.h <<\EOF ++#define NEUTRINO 1 ++EOF ++;; ++ i?86-*-solaris*) ++ cat >> confdefs.h <<\EOF ++#define ISOLARIS 1 ++EOF ++;; ++ sparc-*-solaris*) ++ cat >> confdefs.h <<\EOF ++#define SOLARIS 1 ++EOF ++;; ++ *unixware*) ++ cat >> confdefs.h <<\EOF ++#define UNIXWARE 1 ++EOF ++;; ++ esac ++ ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_TYPE=birdstep ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil" ++ ++ if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then ++ ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil" ++ elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then ++ ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil" ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_BIRDSTEP 1 ++EOF + ++ echo "$ac_t""$ext_output" 1>&6 + fi ++fi ++ ++if test -z "$ODBC_TYPE"; then ++ ++php_with_custom_odbc=no ++ + ++# Check whether --with-custom-odbc or --without-custom-odbc was given. ++if test "${with_custom_odbc+set}" = set; then ++ withval="$with_custom_odbc" ++ PHP_CUSTOM_ODBC=$withval ++else + ++ PHP_CUSTOM_ODBC=no ++ test "$PHP_ENABLE_ALL" && PHP_CUSTOM_ODBC=$PHP_ENABLE_ALL + +- if test "$ext_shared" = "yes"; then +- PDO_DBLIB_SHARED_LIBADD="-lsybdb $PDO_DBLIB_SHARED_LIBADD" +- if test -n "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then +- +- if test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_CUSTOM_ODBC in ++shared,*) ++ PHP_CUSTOM_ODBC=`echo "$PHP_CUSTOM_ODBC"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_CUSTOM_ODBC=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++ ++ ++ ++ ++ ++ if test "$PHP_CUSTOM_ODBC" != "no"; then ++ echo $ac_n "checking for a custom ODBC support""... $ac_c" 1>&6 ++echo "configure:66717: checking for a custom ODBC support" >&5 ++ if test "$PHP_CUSTOM_ODBC" = "yes"; then ++ PHP_CUSTOM_ODBC=/usr/local ++ fi ++ ODBC_INCDIR=$PHP_CUSTOM_ODBC/include ++ ODBC_LIBDIR=$PHP_CUSTOM_ODBC/$PHP_LIBDIR ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LIBS=$CUSTOM_ODBC_LIBS ++ ODBC_TYPE=custom-odbc ++ cat >> confdefs.h <<\EOF ++#define HAVE_CODBC 1 ++EOF ++ ++ echo "$ac_t""$ext_ouput" 1>&6 + fi ++fi + +- +- if test "$ext_shared" = "yes"; then +- PDO_DBLIB_SHARED_LIBADD="-L$ai_p $PDO_DBLIB_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_DBLIB_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_DBLIB_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++if test -z "$ODBC_TYPE"; then ++ ++php_with_iodbc=no ++ ++ ++# Check whether --with-iodbc or --without-iodbc was given. ++if test "${with_iodbc+set}" = set; then ++ withval="$with_iodbc" ++ PHP_IODBC=$withval ++else + +- fi ++ PHP_IODBC=no ++ test "$PHP_ENABLE_ALL" && PHP_IODBC=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_IODBC in ++shared,*) ++ PHP_IODBC=`echo "$PHP_IODBC"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_IODBC=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++ + + +- fi +- +- fi + ++ ++ if test "$PHP_IODBC" != "no"; then ++ echo $ac_n "checking for iODBC support""... $ac_c" 1>&6 ++echo "configure:66781: checking for iODBC support" >&5 ++ if test "$PHP_IODBC" = "yes"; then ++ PHP_IODBC=/usr/local + fi +- else + + +- if test -n "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then ++ if test -n "$PHP_IODBC/$PHP_LIBDIR"; then + +- if test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$PHP_IODBC/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_IODBC/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR ++ if test -z "$PHP_IODBC/$PHP_LIBDIR" || echo "$PHP_IODBC/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_IODBC/$PHP_LIBDIR + else + +- ep_dir="`echo $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_IODBC/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_IODBC/$PHP_LIBDIR\"`" + fi + + +@@ -66809,401 +66820,301 @@ if test "$PHP_PDO_DBLIB" != "no"; then + fi + + +- case sybdb in ++ case iodbc in + c|c_r|pthread*) ;; + *) +- LIBS="-lsybdb $LIBS" ++ LIBS="-liodbc $LIBS" + ;; + esac + + + + ++ ++ if test "$PHP_IODBC/include" != "/usr/include"; then ++ ++ if test -z "$PHP_IODBC/include" || echo "$PHP_IODBC/include" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_IODBC/include ++ else ++ ++ ep_dir="`echo $PHP_IODBC/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_IODBC/include\"`" + fi + +- +- +- + +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:66830: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else + +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:66836: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +-fi ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test "1"; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } + fi + +- ++ ODBC_TYPE=iodbc ++ ODBC_INCLUDE=-I$PHP_IODBC/include ++ ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR ++ ODBC_LIBS=-liodbc ++ cat >> confdefs.h <<\EOF ++#define HAVE_IODBC 1 ++EOF + +- PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" +- +- ext_builddir=ext/pdo_dblib +- ext_srcdir=$abs_srcdir/ext/pdo_dblib ++ cat >> confdefs.h <<\EOF ++#define HAVE_ODBC2 1 ++EOF + +- ac_extra=`echo "-I$pdo_inc_path $PDO_DBLIB_DEFS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ echo "$ac_t""$ext_output" 1>&6 ++ fi ++fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_DBLIB_SHARED=no +- +- +- case ext/pdo_dblib in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_dblib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_dblib/"; ac_bdir="ext/pdo_dblib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++if test -z "$ODBC_TYPE"; then + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++php_with_esoob=no + + +- old_IFS=$IFS +- for ac_src in pdo_dblib.c dblib_driver.c dblib_stmt.c; do ++# Check whether --with-esoob or --without-esoob was given. ++if test "${with_esoob+set}" = set; then ++ withval="$with_esoob" ++ PHP_ESOOB=$withval ++else + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ PHP_ESOOB=no ++ test "$PHP_ENABLE_ALL" && PHP_ESOOB=$PHP_ENABLE_ALL + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++fi + +- cat >>Makefile.objects<>Makefile.objects<&6 ++echo "configure:66927: checking for Easysoft ODBC-ODBC Bridge support" >&5 ++ if test "$PHP_ESOOB" = "yes"; then ++ PHP_ESOOB=/usr/local/easysoft/oob/client ++ fi ++ ODBC_INCDIR=$PHP_ESOOB/include ++ ODBC_LIBDIR=$PHP_ESOOB/$PHP_LIBDIR ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LIBS=-lesoobclient ++ ODBC_TYPE=esoob ++ cat >> confdefs.h <<\EOF ++#define HAVE_ESOOB 1 ++EOF ++ ++ echo "$ac_t""$ext_output" 1>&6 + fi ++fi ++ ++if test -z "$ODBC_TYPE"; then ++ ++php_with_unixodbc=no ++ ++ ++# Check whether --with-unixODBC or --without-unixODBC was given. ++if test "${with_unixODBC+set}" = set; then ++ withval="$with_unixODBC" ++ PHP_UNIXODBC=$withval ++else + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_dblib" ++ PHP_UNIXODBC=no ++ test "$PHP_ENABLE_ALL" && PHP_UNIXODBC=$PHP_ENABLE_ALL + +- cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 ++echo "configure:66991: checking for unixODBC support" >&5 ++ if test "$PHP_UNIXODBC" = "yes"; then ++ PHP_UNIXODBC=/usr/local + fi ++ ODBC_INCDIR=$PHP_UNIXODBC/include ++ ODBC_LIBDIR=$PHP_UNIXODBC/$PHP_LIBDIR ++ ODBC_LFLAGS=-L$ODBC_LIBDIR ++ ODBC_INCLUDE=-I$ODBC_INCDIR ++ ODBC_LIBS=-lodbc ++ ODBC_TYPE=unixODBC ++ ++if ! test -f "$ODBC_INCDIR/sqlext.h"; then ++ { echo "configure: error: ODBC header file '$ODBC_INCDIR/sqlext.h' not found!" 1>&2; exit 1; } ++fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_UNIXODBC 1 ++EOF ++ ++ echo "$ac_t""$ext_output" 1>&6 + fi ++fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_PDO_DBLIB_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/pdo_dblib in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_dblib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_dblib/"; ac_bdir="ext/pdo_dblib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++if test -z "$ODBC_TYPE"; then + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++php_with_dbmaker=no + + +- old_IFS=$IFS +- for ac_src in pdo_dblib.c dblib_driver.c dblib_stmt.c; do ++# Check whether --with-dbmaker or --without-dbmaker was given. ++if test "${with_dbmaker+set}" = set; then ++ withval="$with_dbmaker" ++ PHP_DBMAKER=$withval ++else + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ PHP_DBMAKER=no ++ test "$PHP_ENABLE_ALL" && PHP_DBMAKER=$PHP_ENABLE_ALL + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++fi + +- cat >>Makefile.objects<>Makefile.objects<&6 ++echo "configure:67060: checking for DBMaker support" >&5 ++ if test "$PHP_DBMAKER" = "yes"; then ++ # find dbmaker's home directory ++ DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'` + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=pdo_dblib +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ # check DBMaker version (from 5.0 to 2.0) ++ DBMAKER_VERSION=5.0 + +- fi ++ while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do ++ DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | $AWK '{ print $1-1;}'` ++ MAJOR_V=`echo $DM_VER | $AWK '{ print $1/10; }' | $AWK -F. '{ print $1; }'` ++ MINOR_V=`echo $DM_VER | $AWK '{ print $1%10; }'` ++ DBMAKER_VERSION=$MAJOR_V.$MINOR_V ++ done + +- echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6 +-echo "configure:67150: checking for dnet_addr in -ldnet_stub" >&5 +-ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ldnet_stub $LIBS" +-cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_DBMAKER 1 + EOF +-if { (eval echo configure:67169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- + +- if test "$ext_shared" = "yes"; then +- PDO_DBLIB_SHARED_LIBADD="-ldnet_stub $PDO_DBLIB_SHARED_LIBADD" +- if test -n ""; then ++ if test "$ext_shared" = "yes"; then ++ echo "$ac_t""yes (shared)" 1>&6 ++ ODBC_LIBS="-ldmapic -lc -lm" ++ ODBC_SHARED="odbc.la" ++ else ++ echo "$ac_t""yes (static)" 1>&6 + +- if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ if test -n "$ODBC_LIBDIR"; then + +- if test -z "" || echo "" | grep '^/' >/dev/null ; then +- ai_p= ++ if test "$ODBC_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ODBC_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$ODBC_LIBDIR" || echo "$ODBC_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$ODBC_LIBDIR + else + +- ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ODBC_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"\"`" ++ ai_p="$ep_realdir/`basename \"$ODBC_LIBDIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- PDO_DBLIB_SHARED_LIBADD="-L$ai_p $PDO_DBLIB_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_DBLIB_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_DBLIB_SHARED_LIBADD" +- else +- ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -67219,241 +67130,124 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + +- fi + + fi + +- fi +- else +- ++ fi ++ ++ ++ case dmapic in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ldmapic $LIBS" ++ ;; ++ esac + +- if test -n ""; then +- +- if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ ++ ++ ++ if test "$ODBC_INCDIR" != "/usr/include"; then + +- if test -z "" || echo "" | grep '^/' >/dev/null ; then +- ai_p= ++ if test -z "$ODBC_INCDIR" || echo "$ODBC_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$ODBC_INCDIR + else + +- ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ODBC_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"\"`" ++ ai_p="$ep_realdir/`basename \"$ODBC_INCDIR\"`" + fi + + +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- + fi + ++ fi + +- ++ ODBC_STATIC="libphpext_odbc.la" ++ fi + fi ++fi + ++if test -n "$ODBC_TYPE"; then ++ if test "$ODBC_TYPE" != "dbmaker"; then ++ ++ for ac_i in $ODBC_LFLAGS $ODBC_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ ODBC_SHARED_LIBADD="$ODBC_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ ODBC_SHARED_LIBADD="$ODBC_SHARED_LIBADD -l$ac_ii" ++ else ++ + +- case dnet_stub in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="-ldnet_stub $LIBS" ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + + ++ fi ++ ;; ++ esac + + +- fi +- +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBDNET_STUB 1 +-EOF +- +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_PDO_DBLIB 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FREETDS 1 +-EOF +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_DBLIB_SHARED_LIBADD" +- +- +- +- +- am_i_shared=$PHP_PDO_DBLIB_SHARED +- is_it_shared=$PHP_PDO_SHARED +- is_it_enabled=$PHP_PDO +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension pdo_dblib to build statically, but it +-depends on extension pdo, which you've configured to build shared. +-You either need to build pdo_dblib shared or build pdo statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_dblib, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +-fi +- +- +- +-php_with_pdo_firebird=no +- +-echo $ac_n "checking for Firebird support for PDO""... $ac_c" 1>&6 +-echo "configure:67330: checking for Firebird support for PDO" >&5 +-# Check whether --with-pdo-firebird or --without-pdo-firebird was given. +-if test "${with_pdo_firebird+set}" = set; then +- withval="$with_pdo_firebird" +- PHP_PDO_FIREBIRD=$withval +-else +- +- PHP_PDO_FIREBIRD=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_FIREBIRD=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_PDO_FIREBIRD in +-shared,*) +- PHP_PDO_FIREBIRD=`echo "$PHP_PDO_FIREBIRD"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_PDO_FIREBIRD=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_PDO_FIREBIRD" != "no"; then +- +- if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } +- fi +- +- if test "$PHP_PDO_FIREBIRD" = "yes"; then +- FIREBIRD_INCDIR= +- FIREBIRD_LIBDIR= +- FIREBIRD_LIBDIR_FLAG= +- else +- FIREBIRD_INCDIR=$PHP_PDO_FIREBIRD/include +- FIREBIRD_LIBDIR=$PHP_PDO_FIREBIRD/$PHP_LIBDIR +- FIREBIRD_LIBDIR_FLAG=-L$FIREBIRD_LIBDIR +- fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $FIREBIRD_LIBDIR_FLAG +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ ODBC_SHARED_LIBADD="-L$ai_p $ODBC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && ODBC_SHARED_LIBADD="$ld_runpath_switch$ai_p $ODBC_SHARED_LIBADD" + else + + +@@ -67479,652 +67273,184 @@ if test "$PHP_PDO_FIREBIRD" != "no"; the + esac + done + +- echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6 +-echo "configure:67484: checking for isc_detach_database in -lfbclient" >&5 +-ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lfbclient $LIBS" +-cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_SQLDATASOURCES 1 ++EOF + +-int main() { +-isc_detach_database() +-; return 0; } ++ fi ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_UODBC 1 + EOF +-if { (eval echo configure:67503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- FIREBIRD_LIBNAME=fbclient ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_SHARED_LIBADD" ++ + ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCDIR" ++ + +-else +- echo "$ac_t""no" 1>&6 ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBDIR" + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_fbclient_isc_detach_database +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $FIREBIRD_LIBDIR_FLAG +- " + +- save_ext_shared=$ext_shared +- ext_shared=yes + +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCLUDE" ++ + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBS" + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++ + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LFLAGS" + ++ + +- fi +- ;; +- esac ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_TYPE" + ++ + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- + ++ ext_builddir=ext/odbc ++ ext_srcdir=$abs_srcdir/ext/odbc ++ ++ ac_extra=`echo "$ODBC_INCLUDE"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_ODBC_SHARED=no ++ + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ case ext/odbc in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi + ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- fi +- +- fi + +- ;; +- esac +- done ++ old_IFS=$IFS ++ for ac_src in php_odbc.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- echo $ac_n "checking for isc_detach_database in -lgds""... $ac_c" 1>&6 +-echo "configure:67630: checking for isc_detach_database in -lgds" >&5 +-ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lgds $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ done + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- FIREBIRD_LIBNAME=gds +- +- +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_gds_isc_detach_database +- ++ EXT_STATIC="$EXT_STATIC odbc" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC odbc" ++ fi ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_ODBC_SHARED=yes + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $FIREBIRD_LIBDIR_FLAG +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- ++ case ext/odbc in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in php_odbc.c; do + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ shared_objects_odbc="$shared_objects_odbc $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- ;; +- esac ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$ac_ii ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpodbc.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpodbc.so '$ext_builddir'/phpodbc.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPODBC, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpodbc.$suffix" + else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpodbc.$suffix" + fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6 +-echo "configure:67776: checking for isc_detach_database in -lib_util" >&5 +-ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lib_util $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- FIREBIRD_LIBNAME=ib_util +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_ib_util_isc_detach_database +- +- { echo "configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information." 1>&2; exit 1; } +- +- +-fi +- +- +- +-fi +- +- +- +-fi +- +- +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:67840: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:67846: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi +- +-fi +- +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } +- fi +- +- +- +- +- if test "$ext_shared" = "yes"; then +- PDO_FIREBIRD_SHARED_LIBADD="-l$FIREBIRD_LIBNAME $PDO_FIREBIRD_SHARED_LIBADD" +- if test -n "$FIREBIRD_LIBDIR"; then +- +- if test "$FIREBIRD_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FIREBIRD_LIBDIR" != "/usr/lib"; then +- +- if test -z "$FIREBIRD_LIBDIR" || echo "$FIREBIRD_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$FIREBIRD_LIBDIR +- else +- +- ep_dir="`echo $FIREBIRD_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FIREBIRD_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- PDO_FIREBIRD_SHARED_LIBADD="-L$ai_p $PDO_FIREBIRD_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_FIREBIRD_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_FIREBIRD_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$FIREBIRD_LIBDIR"; then +- +- if test "$FIREBIRD_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FIREBIRD_LIBDIR" != "/usr/lib"; then +- +- if test -z "$FIREBIRD_LIBDIR" || echo "$FIREBIRD_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$FIREBIRD_LIBDIR +- else +- +- ep_dir="`echo $FIREBIRD_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FIREBIRD_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case $FIREBIRD_LIBNAME in +- c|c_r|pthread*) ;; +- *) +- LIBS="-l$FIREBIRD_LIBNAME $LIBS" +- ;; +- esac +- +- +- +- +- fi +- +- +- +- if test "$FIREBIRD_INCDIR" != "/usr/include"; then +- +- if test -z "$FIREBIRD_INCDIR" || echo "$FIREBIRD_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$FIREBIRD_INCDIR +- else +- +- ep_dir="`echo $FIREBIRD_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$FIREBIRD_INCDIR\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_PDO_FIREBIRD 1 +-EOF +- +- +- ext_builddir=ext/pdo_firebird +- ext_srcdir=$abs_srcdir/ext/pdo_firebird +- +- ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_FIREBIRD_SHARED=no +- +- +- case ext/pdo_firebird in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_firebird"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_firebird/"; ac_bdir="ext/pdo_firebird/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in pdo_firebird.c firebird_driver.c firebird_statement.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_firebird, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. +-" 1>&2; exit 1; } +- fi +- + fi + + + +-php_with_pdo_mysql=no ++php_enable_pcntl=no + +-echo $ac_n "checking for MySQL support for PDO""... $ac_c" 1>&6 +-echo "configure:68318: checking for MySQL support for PDO" >&5 +-# Check whether --with-pdo-mysql or --without-pdo-mysql was given. +-if test "${with_pdo_mysql+set}" = set; then +- withval="$with_pdo_mysql" +- PHP_PDO_MYSQL=$withval ++echo $ac_n "checking whether to enable pcntl support""... $ac_c" 1>&6 ++echo "configure:67622: checking whether to enable pcntl support" >&5 ++# Check whether --enable-pcntl or --disable-pcntl was given. ++if test "${enable_pcntl+set}" = set; then ++ enableval="$enable_pcntl" ++ PHP_PCNTL=$enableval + else + +- PHP_PDO_MYSQL=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_MYSQL=$PHP_ENABLE_ALL ++ PHP_PCNTL=no ++ test "$PHP_ENABLE_ALL" && PHP_PCNTL=$PHP_ENABLE_ALL + + fi + +@@ -68330,12 +67634,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO_MYSQL in ++case $PHP_PCNTL in + shared,*) +- PHP_PDO_MYSQL=`echo "$PHP_PDO_MYSQL"|$SED 's/^shared,//'` ++ PHP_PCNTL=`echo "$PHP_PCNTL"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO_MYSQL=yes ++ PHP_PCNTL=yes + ;; + no) + ext_output=no +@@ -68354,1125 +67658,637 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test -z "$PHP_ZLIB_DIR"; then +- +-php_with_zlib_dir=no +- +-echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 +-echo "configure:68363: checking for the location of libz" >&5 +-# Check whether --with-zlib-dir or --without-zlib-dir was given. +-if test "${with_zlib_dir+set}" = set; then +- withval="$with_zlib_dir" +- PHP_ZLIB_DIR=$withval ++if test "$PHP_PCNTL" != "no"; then ++ for ac_func in fork ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:67666: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- PHP_ZLIB_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_ZLIB_DIR +-echo "$ac_t""$ext_output" 1>&6 ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + ++; return 0; } ++EOF ++if { (eval echo configure:67694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* + fi + +-if test "$PHP_PDO_MYSQL" != "no"; then +- +- if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } +- fi +- +- +- +- if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then +- PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL +- elif test "$PHP_PDO_MYSQL" != "yes"; then +- if test -d "$PHP_PDO_MYSQL" ; then +- if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then +- PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config" +- else +- PDO_MYSQL_DIR="$PHP_PDO_MYSQL" +- fi +- fi +- else +- for i in /usr/local /usr ; do +- if test -x "$i/bin/mysql_config" ; then +- PDO_MYSQL_CONFIG="$i/bin/mysql_config" +- break; +- fi +- if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then +- PDO_MYSQL_DIR="$i" +- break; +- fi +- done +- fi +- +- if test "$PHP_PDO_MYSQL" = "mysqlnd"; then +- PHP_MYSQLND_ENABLED=yes +- cat >> confdefs.h <<\EOF +-#define PDO_USE_MYSQLND 1 ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_MYSQL 1 ++ cat >> confdefs.h <<\EOF ++#define HAVE_FORK 1 + EOF +- +- +- echo $ac_n "checking for mysql_config""... $ac_c" 1>&6 +-echo "configure:68427: checking for mysql_config" >&5 +- if test -n "$PDO_MYSQL_CONFIG"; then +- echo "$ac_t""$PDO_MYSQL_CONFIG" 1>&6 +- if test "x$SED" = "x"; then +- # Extract the first word of "sed", so it can be a program name with args. +-set dummy sed; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:68434: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- case "$SED" in +- /*) +- ac_cv_path_SED="$SED" # Let the user override the test with a path. +- ;; +- ?:/*) +- ac_cv_path_SED="$SED" # Let the user override the test with a dos path. +- ;; +- *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_SED="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" +- ;; +-esac +-fi +-SED="$ac_cv_path_SED" +-if test -n "$SED"; then +- echo "$ac_t""$SED" 1>&6 ++ + else + echo "$ac_t""no" 1>&6 ++{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } + fi ++done + +- fi +- if test "$enable_maintainer_zts" = "yes"; then +- PDO_MYSQL_LIBNAME=mysqlclient_r +- PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"` +- else +- PDO_MYSQL_LIBNAME=mysqlclient +- PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` +- fi +- PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"` +- elif test -n "$PDO_MYSQL_DIR"; then +- echo "$ac_t""not found" 1>&6 +- echo $ac_n "checking for mysql install under $PDO_MYSQL_DIR""... $ac_c" 1>&6 +-echo "configure:68478: checking for mysql install under $PDO_MYSQL_DIR" >&5 +- if test -r $PDO_MYSQL_DIR/include/mysql; then +- PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql +- else +- PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include +- fi +- if test -r $PDO_MYSQL_DIR/$PHP_LIBDIR/mysql; then +- PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/$PHP_LIBDIR/mysql +- else +- PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/$PHP_LIBDIR +- fi +- +- if test -r "$PDO_MYSQL_LIB_DIR"; then +- echo "$ac_t""libs under $PDO_MYSQL_LIB_DIR; seems promising" 1>&6 +- else +- echo "$ac_t""can not find it" 1>&6 +- { echo "configure: error: Unable to find your mysql installation" 1>&2; exit 1; } +- fi +- +- +- if test "$PDO_MYSQL_INC_DIR" != "/usr/include"; then +- +- if test -z "$PDO_MYSQL_INC_DIR" || echo "$PDO_MYSQL_INC_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_MYSQL_INC_DIR +- else +- +- ep_dir="`echo $PDO_MYSQL_INC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_MYSQL_INC_DIR\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR +- else +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Unable to find your mysql installation" 1>&2; exit 1; } +- fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $PDO_MYSQL_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++ for ac_func in waitpid ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:67725: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + +- fi +- ;; +- esac ++; return 0; } ++EOF ++if { (eval echo configure:67753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_WAITPID 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } ++fi ++done + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++ for ac_func in sigaction ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:67784: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + +- fi +- +- fi ++; return 0; } ++EOF ++if { (eval echo configure:67812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + +- ;; +- esac +- done ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_SIGACTION 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++{ echo "configure: error: pcntl: sigaction() not supported by this platform" 1>&2; exit 1; } ++fi ++done + +- echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:68632: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ for ac_func in getpriority setpriority wait3 sigprocmask sigwaitinfo sigtimedwait ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:67843: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" +-cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char mysql_query(); ++char $ac_func(); + + int main() { +-mysql_query() ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ + ; return 0; } + EOF +-if { (eval echo configure:68651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:67871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* +-LIBS="$ac_save_LIBS" +- + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- for ac_i in $PDO_MYSQL_INCLUDE; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++ ext_builddir=ext/pcntl ++ ext_srcdir=$abs_srcdir/ext/pcntl ++ ++ ac_extra= + ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then ++ PHP_PCNTL_SHARED=no + + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ case ext/pcntl in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi + +- ;; +- esac +- done ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- +- for ac_i in $PDO_MYSQL_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ old_IFS=$IFS ++ for ac_src in pcntl.c php_signal.c; do + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -l$ac_ii" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- ;; +- esac ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$ac_ii ++ EXT_STATIC="$EXT_STATIC pcntl" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC pcntl" ++ fi + else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_PCNTL_SHARED=yes ++ ++ case ext/pcntl in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi ++ ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + + +- fi +- +- fi ++ old_IFS=$IFS ++ for ac_src in pcntl.c php_signal.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_pcntl="$shared_objects_pcntl $ac_bdir$ac_obj.lo" + +- ;; +- esac ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<&6 ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query +- +- if test "$PHP_ZLIB_DIR" != "no"; then +- ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppcntl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PHPPCNTL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppcntl.so '$ext_builddir'/phppcntl.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPCNTL, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PHPPCNTL_SHARED_LIBADD)' ++ ;; ++ esac + +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="-lz $PDO_MYSQL_SHARED_LIBADD" +- if test -n "$PHP_ZLIB_DIR"; then +- +- if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then +- +- if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ZLIB_DIR ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppcntl.$suffix" + else +- +- ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppcntl.$suffix" + fi +- +- +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcntl" ++ ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$PHP_ZLIB_DIR ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/pcntl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PCNTL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/pcntl.so '$ext_builddir'/pcntl.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PCNTL, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PCNTL_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/pcntl.$suffix" + else +- +- ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/pcntl.$suffix" + fi +- +- +- + +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcntl" ++ ++ cat >>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects</dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC pcntl" + fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- + + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ BUILD_DIR="$BUILD_DIR $ext_builddir" + +- fi + + +- fi ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=pcntl + ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ + fi + +- ;; +- esac +- done ++fi + +- echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:69004: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query +- +- { echo "configure: error: PDO_MYSQL configure failed. Please check config.log for more information." 1>&2; exit 1; } +- ++ ++php_enable_pdo=yes ++ ++echo $ac_n "checking whether to enable PDO support""... $ac_c" 1>&6 ++echo "configure:68196: checking whether to enable PDO support" >&5 ++# Check whether --enable-pdo or --disable-pdo was given. ++if test "${enable_pdo+set}" = set; then ++ enableval="$enable_pdo" ++ PHP_PDO=$enableval ++else + ++ PHP_PDO=yes ++ test "$PHP_ENABLE_ALL" && PHP_PDO=$PHP_ENABLE_ALL ++ + fi +- +- PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz" +- else +- +- +- case z in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="-lz $PDO_MYSQL_SHARED_LIBADD" +- else +- +- +- case z in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lz $LIBS" +- ;; +- esac + + +- fi +- ;; +- esac + ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PDO in ++shared,*) ++ PHP_PDO=`echo "$PHP_PDO"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PDO=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_MYSQL_LIB_DIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac + ++echo "$ac_t""$ext_output" 1>&6 + +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 +-echo "configure:69178: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 +-ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query +- +- { echo "configure: error: Try adding --with-zlib-dir=. Please check config.log for more information." 1>&2; exit 1; } +- +- +-fi +- +- PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -lz" +- fi +- +- +- for ac_i in $PDO_MYSQL_INCLUDE; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + +- fi + +- ;; +- esac +- done ++if test "$PHP_PDO" != "no"; then + +- +- for ac_i in $PDO_MYSQL_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++ PHP_PDO=yes + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -l$ac_ii" +- else +- + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; ++ pdo_running_under_pear=0 ++ case `pwd` in ++ /var/tmp/pear-build-*) ++ pdo_running_under_pear=1 ++ ;; + esac + ++ if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then ++ # we're running in an environment that smells like pear, ++ # and the PHP_PEAR_VERSION env var is not set. That implies ++ # that we're running under a slightly broken pear installer ++ { echo "configure: error: ++PDO requires that you upgrade your PEAR installer tools. Please ++do so now by running: + +- fi +- ;; +- esac +- ++ % sudo pear upgrade pear + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++or by manually downloading and installing PEAR version 1.3.5 or higher. + +- +- if test "$ext_shared" = "yes"; then +- PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- ++Once you've upgraded, please re-try your PDO install. ++ " 1>&2; exit 1; } + fi + + +- fi +- +- fi ++ if test "$ext_shared" = "yes" ; then ++ case $host_alias in ++ *darwin*) ++ { echo "configure: error: ++Due to the way that loadable modules work on OSX/Darwin, you need to ++compile the PDO package statically into the PHP core. + +- ;; ++Please follow the instructions at: http://netevil.org/node.php?nid=202 ++for more detail on this issue. ++ " 1>&2; exit 1; } ++ ext_shared=no ++ ;; + esac +- done +- +- +- +-fi +- +- +- _SAVE_LIBS=$LIBS +- LIBS="$LIBS $PDO_MYSQL_LIBS" +- for ac_func in mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:69371: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- +-; return 0; } +-EOF +-if { (eval echo configure:69399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done +- +- LIBS=$_SAVE_LIBS +- fi +- +- +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:69429: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:69435: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi +- +-fi +- +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } + fi +- + ++ ext_builddir=ext/pdo ++ ext_srcdir=$abs_srcdir/ext/pdo + +- if test -n "$PDO_MYSQL_CONFIG"; then +- PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` +- cat >> confdefs.h <>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } + fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then + { echo "configure: error: +-You've configured extension pdo_mysql, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. ++You've configured extension pdo, which depends on extension spl, ++but you've either not enabled spl, or have disabled it. + " 1>&2; exit 1; } + fi + +- if test "$PHP_MYSQL" = "mysqlnd"; then ++ ++ ++ ++ ++ ++ header_path=ext/pdo ++ for header_file in php_pdo.h php_pdo_driver.h; do ++ hp_hf="$header_path/$header_file" + +- am_i_shared=$PHP_PDO_MYSQL_SHARED +- is_it_shared=$PHP_MYSQLND_SHARED +- is_it_enabled=$PHP_MYSQLND +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension pdo_mysql to build statically, but it +-depends on extension mysqlnd, which you've configured to build shared. +-You either need to build pdo_mysql shared or build mysqlnd statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_mysql, which depends on extension mysqlnd, +-but you've either not enabled mysqlnd, or have disabled it. +-" 1>&2; exit 1; } +- fi + +- fi ++ unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` + +- PDO_MYSQL_MODULE_TYPE=external ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ++ ++ fi + ++ done + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_MYSQL_SHARED_LIBADD" + + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_MYSQL_MODULE_TYPE" + +- ++ ++ src=$ext_srcdir/Makefile.frag ++ ac_srcdir=$ext_srcdir ++ ac_builddir=$ext_builddir ++ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments + + fi + + +-SUPPORTED_LIB_VERS="9.0 10.1 11.1" # This caters for all Oracle 9.x, 10.x and 11.1 installs +- + + ++php_with_pdo_dblib=no + ++echo $ac_n "checking for PDO_DBLIB support via FreeTDS""... $ac_c" 1>&6 ++echo "configure:68630: checking for PDO_DBLIB support via FreeTDS" >&5 ++# Check whether --with-pdo-dblib or --without-pdo-dblib was given. ++if test "${with_pdo_dblib+set}" = set; then ++ withval="$with_pdo_dblib" ++ PHP_PDO_DBLIB=$withval ++else ++ ++ PHP_PDO_DBLIB=no ++ test "$PHP_ENABLE_ALL" && PHP_PDO_DBLIB=$PHP_ENABLE_ALL + +-php_with_pdo_oci=no +- +-echo $ac_n "checking Oracle OCI support for PDO""... $ac_c" 1>&6 +-echo "configure:69820: checking Oracle OCI support for PDO" >&5 +-# Check whether --with-pdo-oci or --without-pdo-oci was given. +-if test "${with_pdo_oci+set}" = set; then +- withval="$with_pdo_oci" +- PHP_PDO_OCI=$withval +-else +- +- PHP_PDO_OCI=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_OCI=$PHP_ENABLE_ALL +- +-fi ++fi + + + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO_OCI in ++case $PHP_PDO_DBLIB in + shared,*) +- PHP_PDO_OCI=`echo "$PHP_PDO_OCI"|$SED 's/^shared,//'` ++ PHP_PDO_DBLIB=`echo "$PHP_PDO_DBLIB"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO_OCI=yes ++ PHP_PDO_DBLIB=yes + ;; + no) + ext_output=no +@@ -69856,81 +68666,62 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_PDO_OCI" != "no"; then ++if test "$PHP_PDO_DBLIB" != "no"; then + + if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then + { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } + fi + +- echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6 +-echo "configure:69867: checking Oracle Install-Dir" >&5 +- if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then +- PDO_OCI_DIR=$ORACLE_HOME +- else +- PDO_OCI_DIR=$PHP_PDO_OCI +- fi +- echo "$ac_t""$PHP_PDO_OCI" 1>&6 ++ if test "$PHP_PDO_DBLIB" = "yes"; then + +- echo $ac_n "checking if that is sane""... $ac_c" 1>&6 +-echo "configure:69876: checking if that is sane" >&5 +- if test -z "$PDO_OCI_DIR"; then +- { echo "configure: error: +-You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_HOME. +-" 1>&2; exit 1; } +- else +- echo "$ac_t""yes" 1>&6 +- fi ++ for i in /usr/local /usr; do ++ if test -f $i/include/sybdb.h; then ++ PDO_FREETDS_INSTALLATION_DIR=$i ++ PDO_FREETDS_INCLUDE_DIR=$i/include ++ break ++ elif test -f $i/include/freetds/sybdb.h; then ++ PDO_FREETDS_INSTALLATION_DIR=$i ++ PDO_FREETDS_INCLUDE_DIR=$i/include/freetds ++ break; ++ fi ++ done + +- if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then +- PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`" +- PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`" +- echo $ac_n "checking for oci.h""... $ac_c" 1>&6 +-echo "configure:69889: checking for oci.h" >&5 +- if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then +- +- if test "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" != "/usr/include"; then +- +- if test -z "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" || echo "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client +- else +- +- ep_dir="`echo $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client\"`" +- fi ++ if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then ++ { echo "configure: error: Cannot find FreeTDS in known installation directories" 1>&2; exit 1; } ++ fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- ++ elif test "$PHP_PDO_DBLIB" != "no"; then ++ ++ if test -f $PHP_PDO_DBLIB/include/sybdb.h; then ++ PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB ++ PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include ++ elif test -f $PHP_PDO_DBLIB/include/freetds/sybdb.h; then ++ PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB ++ PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include/freetds ++ else ++ { echo "configure: error: Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory" 1>&2; exit 1; } ++ fi ++ fi ++ ++ if test "x$PHP_LIBDIR" = "x" ; then ++ PHP_LIBDIR=lib + fi + ++ if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then ++ { echo "configure: error: Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a|so" 1>&2; exit 1; } + fi + +- echo "$ac_t""$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" 1>&6 +- elif test -f $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then +- +- if test "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" != "/usr/include"; then ++ ++ if test "$PDO_FREETDS_INCLUDE_DIR" != "/usr/include"; then + +- if test -z "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" || echo "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include ++ if test -z "$PDO_FREETDS_INCLUDE_DIR" || echo "$PDO_FREETDS_INCLUDE_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_FREETDS_INCLUDE_DIR + else + +- ep_dir="`echo $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_FREETDS_INCLUDE_DIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INCLUDE_DIR\"`" + fi + + +@@ -69951,387 +68742,483 @@ echo "configure:69889: checking for oci. + + fi + +- echo "$ac_t""$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" 1>&6 +- elif test -f $PDO_OCI_IC_PREFIX/sdk/include/oci.h ; then ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_DBLIB_SHARED_LIBADD="-lsybdb $PDO_DBLIB_SHARED_LIBADD" ++ if test -n "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then + +- if test "$PDO_OCI_IC_PREFIX/sdk/include" != "/usr/include"; then ++ if test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PDO_OCI_IC_PREFIX/sdk/include" || echo "$PDO_OCI_IC_PREFIX/sdk/include" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_IC_PREFIX/sdk/include ++ if test -z "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PDO_OCI_IC_PREFIX/sdk/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/sdk/include\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" + fi + + ++ if test "$ext_shared" = "yes"; then ++ PDO_DBLIB_SHARED_LIBADD="-L$ai_p $PDO_DBLIB_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_DBLIB_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_DBLIB_SHARED_LIBADD" ++ else ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- fi +- +- echo "$ac_t""$PDO_OCI_IC_PREFIX/sdk/include" 1>&6 +- elif test -f $PDO_OCI_IC_PREFIX/client/include/oci.h ; then +- +- if test "$PDO_OCI_IC_PREFIX/client/include" != "/usr/include"; then +- +- if test -z "$PDO_OCI_IC_PREFIX/client/include" || echo "$PDO_OCI_IC_PREFIX/client/include" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_IC_PREFIX/client/include +- else +- +- ep_dir="`echo $PDO_OCI_IC_PREFIX/client/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/client/include\"`" +- fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + +- fi +- +- echo "$ac_t""$PDO_OCI_IC_PREFIX/client/include" 1>&6 +- else +- { echo "configure: error: I'm too dumb to figure out where the include dir is in your Instant Client install" 1>&2; exit 1; } +- fi +- if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.so" ; then +- PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib" +- elif test -f "$PDO_OCI_IC_PREFIX/client/lib/libclntsh.so" ; then +- PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/client/lib" +- elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so" ; then +- PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX" +- else +- { echo "configure: error: I'm too dumb to figure out where the libraries are in your Instant Client install" 1>&2; exit 1; } + fi +- PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`" + else + +- echo $ac_n "checking size of long int""... $ac_c" 1>&6 +-echo "configure:70038: checking size of long int" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_long_int=4 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(long int)); +- return(0); +-} +-EOF +-if { (eval echo configure:70057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_long_int=`cat conftestval` +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_long_int=0 +-fi +-rm -fr conftest* +-fi +- +-fi +-echo "$ac_t""$ac_cv_sizeof_long_int" 1>&6 +-cat >> confdefs.h <&6 +-echo "configure:70077: checking if we're on a 64-bit platform" >&5 +- if test "$ac_cv_sizeof_long_int" = "4" ; then +- echo "$ac_t""no" 1>&6 +- TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" +- else +- echo "$ac_t""yes" 1>&6 +- TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" +- fi +- +- echo $ac_n "checking OCI8 libraries dir""... $ac_c" 1>&6 +-echo "configure:70087: checking OCI8 libraries dir" >&5 +- if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then +- PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" +- elif test ! -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then +- PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" +- elif test -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then +- PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR +- else +- { echo "configure: error: Oracle required OCI8 libraries not found" 1>&2; exit 1; } +- fi +- echo "$ac_t""$PDO_OCI_LIB_DIR" 1>&6 +- +- +- if test -d "$PDO_OCI_DIR/rdbms/public"; then +- +- if test "$PDO_OCI_DIR/rdbms/public" != "/usr/include"; then ++ if test -n "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR"; then + +- if test -z "$PDO_OCI_DIR/rdbms/public" || echo "$PDO_OCI_DIR/rdbms/public" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_DIR/rdbms/public ++ if test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" || echo "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PDO_OCI_DIR/rdbms/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/rdbms/public\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR\"`" + fi + + ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- fi + +- PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public" +- fi +- if test -d "$PDO_OCI_DIR/rdbms/demo"; then +- +- if test "$PDO_OCI_DIR/rdbms/demo" != "/usr/include"; then +- +- if test -z "$PDO_OCI_DIR/rdbms/demo" || echo "$PDO_OCI_DIR/rdbms/demo" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_DIR/rdbms/demo +- else +- +- ep_dir="`echo $PDO_OCI_DIR/rdbms/demo|$SED 's%/*[^/][^/]*/*$%%'`" + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/rdbms/demo\"`" + fi + +- ++ fi + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ case sybdb in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybdb $LIBS" ++ ;; ++ esac + +- fi + +- PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/demo" +- fi +- if test -d "$PDO_OCI_DIR/network/public"; then +- +- if test "$PDO_OCI_DIR/network/public" != "/usr/include"; then +- +- if test -z "$PDO_OCI_DIR/network/public" || echo "$PDO_OCI_DIR/network/public" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_DIR/network/public +- else +- +- ep_dir="`echo $PDO_OCI_DIR/network/public|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/network/public\"`" +- fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + + fi + +- PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/network/public" +- fi +- if test -d "$PDO_OCI_DIR/plsql/public"; then +- +- if test "$PDO_OCI_DIR/plsql/public" != "/usr/include"; then +- +- if test -z "$PDO_OCI_DIR/plsql/public" || echo "$PDO_OCI_DIR/plsql/public" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_DIR/plsql/public +- else +- +- ep_dir="`echo $PDO_OCI_DIR/plsql/public|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/plsql/public\"`" +- fi + ++ ++ + ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:68847: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:68853: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi ++fi + +- PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/plsql/public" +- fi +- if test -d "$PDO_OCI_DIR/include"; then +- +- if test "$PDO_OCI_DIR/include" != "/usr/include"; then +- +- if test -z "$PDO_OCI_DIR/include" || echo "$PDO_OCI_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_DIR/include ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: + else +- +- ep_dir="`echo $PDO_OCI_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/include\"`" ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } + fi + +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + +- fi ++ PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" ++ ++ ext_builddir=ext/pdo_dblib ++ ext_srcdir=$abs_srcdir/ext/pdo_dblib + +- PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include" +- fi ++ ac_extra=`echo "-I$pdo_inc_path $PDO_DBLIB_DEFS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` + +- if test -f "$PDO_OCI_LIB_DIR/sysliblist"; then +- +- for ac_i in `cat $PDO_OCI_LIB_DIR/sysliblist`; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -pthread" +- else +- ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PDO_DBLIB_SHARED=no ++ ++ ++ case ext/pdo_dblib in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_dblib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_dblib/"; ac_bdir="ext/pdo_dblib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pdo_dblib.c dblib_driver.c dblib_stmt.c; do + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -l$ac_ii" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- ;; +- esac ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$ac_ii ++ EXT_STATIC="$EXT_STATIC pdo_dblib" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC pdo_dblib" ++ fi + else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_PDO_DBLIB_SHARED=yes ++ ++ case ext/pdo_dblib in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_dblib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_dblib/"; ac_bdir="ext/pdo_dblib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pdo_dblib.c dblib_driver.c dblib_stmt.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_pdo_dblib="$shared_objects_pdo_dblib $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:69167: checking for dnet_addr in -ldnet_stub" >&5 ++ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-ldnet_stub $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_DBLIB_SHARED_LIBADD="-ldnet_stub $PDO_DBLIB_SHARED_LIBADD" ++ if test -n ""; then ++ ++ if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ if test -z "" || echo "" | grep '^/' >/dev/null ; then ++ ai_p= ++ else ++ ++ ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"\"`" + fi + + + if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="-L$ai_p $PDO_OCI_SYSLIB" +- test -n "$ld_runpath_switch" && PDO_OCI_SYSLIB="$ld_runpath_switch$ai_p $PDO_OCI_SYSLIB" ++ PDO_DBLIB_SHARED_LIBADD="-L$ai_p $PDO_DBLIB_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_DBLIB_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_DBLIB_SHARED_LIBADD" + else + + +@@ -70353,17 +69240,179 @@ echo "configure:70087: checking OCI8 lib + + fi + +- ;; +- esac +- done ++ fi ++ else ++ + +- elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then ++ if test -n ""; then ++ ++ if test "" != "/usr/$PHP_LIBDIR" && test "" != "/usr/lib"; then ++ ++ if test -z "" || echo "" | grep '^/' >/dev/null ; then ++ ai_p= ++ else ++ ++ ep_dir="`echo |$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"\"`" ++ fi ++ ++ + +- for ac_i in `cat $PDO_OCI_DIR/rdbms/lib/sysliblist`; do ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case dnet_stub in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ldnet_stub $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBDNET_STUB 1 ++EOF ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_PDO_DBLIB 1 ++EOF ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_FREETDS 1 ++EOF ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_DBLIB_SHARED_LIBADD" ++ ++ ++ ++ ++ am_i_shared=$PHP_PDO_DBLIB_SHARED ++ is_it_shared=$PHP_PDO_SHARED ++ is_it_enabled=$PHP_PDO ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension pdo_dblib to build statically, but it ++depends on extension pdo, which you've configured to build shared. ++You either need to build pdo_dblib shared or build pdo statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_dblib, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++fi ++ ++ ++ ++php_with_pdo_firebird=no ++ ++echo $ac_n "checking for Firebird support for PDO""... $ac_c" 1>&6 ++echo "configure:69347: checking for Firebird support for PDO" >&5 ++# Check whether --with-pdo-firebird or --without-pdo-firebird was given. ++if test "${with_pdo_firebird+set}" = set; then ++ withval="$with_pdo_firebird" ++ PHP_PDO_FIREBIRD=$withval ++else ++ ++ PHP_PDO_FIREBIRD=no ++ test "$PHP_ENABLE_ALL" && PHP_PDO_FIREBIRD=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PDO_FIREBIRD in ++shared,*) ++ PHP_PDO_FIREBIRD=`echo "$PHP_PDO_FIREBIRD"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PDO_FIREBIRD=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PDO_FIREBIRD" != "no"; then ++ ++ if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } ++ fi ++ ++ if test "$PHP_PDO_FIREBIRD" = "yes"; then ++ FIREBIRD_INCDIR= ++ FIREBIRD_LIBDIR= ++ FIREBIRD_LIBDIR_FLAG= ++ else ++ FIREBIRD_INCDIR=$PHP_PDO_FIREBIRD/include ++ FIREBIRD_LIBDIR=$PHP_PDO_FIREBIRD/$PHP_LIBDIR ++ FIREBIRD_LIBDIR_FLAG=-L$FIREBIRD_LIBDIR ++ fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $FIREBIRD_LIBDIR_FLAG ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -pthread" ++ LDFLAGS="$LDFLAGS -pthread" + else + + +@@ -70385,7 +69434,7 @@ echo "configure:70087: checking OCI8 lib + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -l$ac_ii" ++ LDFLAGS="$LDFLAGS -l$ac_ii" + else + + +@@ -70420,8 +69469,8 @@ echo "configure:70087: checking OCI8 lib + + + if test "$ext_shared" = "yes"; then +- PDO_OCI_SYSLIB="-L$ai_p $PDO_OCI_SYSLIB" +- test -n "$ld_runpath_switch" && PDO_OCI_SYSLIB="$ld_runpath_switch$ai_p $PDO_OCI_SYSLIB" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -70447,98 +69496,60 @@ echo "configure:70087: checking OCI8 lib + esac + done + +- fi +- +- echo $ac_n "checking Oracle version""... $ac_c" 1>&6 +-echo "configure:70454: checking Oracle version" >&5 +- for OCI_VER in $SUPPORTED_LIB_VERS; do +- if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then +- PDO_OCI_VERSION="$OCI_VER" +- fi +- done +- if test -z "$PDO_OCI_VERSION"; then +- { echo "configure: error: Oracle required OCI8 libraries not found under $PDO_OCI_DIR" 1>&2; exit 1; } +- fi +- echo "$ac_t""$PDO_OCI_VERSION" 1>&6 ++ echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6 ++echo "configure:69501: checking for isc_detach_database in -lfbclient" >&5 ++ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lfbclient $LIBS" ++cat > conftest.$ac_ext <&2; exit 1; } +- ;; +- esac ++int main() { ++isc_detach_database() ++; return 0; } ++EOF ++if { (eval echo configure:69520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- if test "$PDO_OCI_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PDO_OCI_LIB_DIR" != "/usr/lib"; then +- +- if test -z "$PDO_OCI_LIB_DIR" || echo "$PDO_OCI_LIB_DIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_OCI_LIB_DIR +- else +- +- ep_dir="`echo $PDO_OCI_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_OCI_LIB_DIR\"`" +- fi +- ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared + +- if test "$ext_shared" = "yes"; then +- PDO_OCI_SHARED_LIBADD="-L$ai_p $PDO_OCI_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_OCI_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_OCI_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ FIREBIRD_LIBNAME=fbclient + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi +- ++else ++ echo "$ac_t""no" 1>&6 + +- fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_fbclient_isc_detach_database ++ + +- fi +- +- +- + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " ++ $FIREBIRD_LIBDIR_FLAG ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -70631,27 +69642,27 @@ echo "configure:70454: checking Oracle v + esac + done + +- echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6 +-echo "configure:70636: checking for OCIEnvCreate in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for isc_detach_database in -lgds""... $ac_c" 1>&6 ++echo "configure:69647: checking for isc_detach_database in -lgds" >&5 ++ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" ++LIBS="-lgds $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:69666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -70670,28 +69681,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- cat >> confdefs.h <<\EOF +-#define HAVE_OCIENVCREATE 1 +-EOF +- +- ++ FIREBIRD_LIBNAME=gds ++ + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCIEnvCreate ++ unset ac_cv_lib_gds_isc_detach_database + +- +-fi +- +- +- ++ + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " ++ $FIREBIRD_LIBDIR_FLAG ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -70784,27 +69788,27 @@ fi + esac + done + +- echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6 +-echo "configure:70789: checking for OCIEnvNlsCreate in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6 ++echo "configure:69793: checking for isc_detach_database in -lib_util" >&5 ++ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" ++LIBS="-lib_util $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:69812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -70823,95 +69827,79 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- cat >> confdefs.h <<\EOF +-#define HAVE_OCIENVNLSCREATE 1 +-EOF +- +- ++ FIREBIRD_LIBNAME=ib_util ++ + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCIEnvNlsCreate ++ unset ac_cv_lib_ib_util_isc_detach_database + ++ { echo "configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information." 1>&2; exit 1; } ++ + + fi + +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes ++ + +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- ++fi ++ + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:69857: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:69863: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ ++fi + ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ fi + +- fi +- ;; +- esac + ++ + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` ++ if test "$ext_shared" = "yes"; then ++ PDO_FIREBIRD_SHARED_LIBADD="-l$FIREBIRD_LIBNAME $PDO_FIREBIRD_SHARED_LIBADD" ++ if test -n "$FIREBIRD_LIBDIR"; then + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$FIREBIRD_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FIREBIRD_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$FIREBIRD_LIBDIR" || echo "$FIREBIRD_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$FIREBIRD_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $FIREBIRD_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$FIREBIRD_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ PDO_FIREBIRD_SHARED_LIBADD="-L$ai_p $PDO_FIREBIRD_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_FIREBIRD_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_FIREBIRD_SHARED_LIBADD" + else + + +@@ -70933,136 +69921,26 @@ fi + + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for OCILobIsTemporary in -lclntsh""... $ac_c" 1>&6 +-echo "configure:70942: checking for OCILobIsTemporary in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared ++ fi ++ else + +- cat >> confdefs.h <<\EOF +-#define HAVE_OCILOBISTEMPORARY 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCILobIsTemporary +- ++ if test -n "$FIREBIRD_LIBDIR"; then + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$FIREBIRD_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$FIREBIRD_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$FIREBIRD_LIBDIR" || echo "$FIREBIRD_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$FIREBIRD_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $FIREBIRD_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$FIREBIRD_LIBDIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -71078,446 +69956,74 @@ else + fi + + +- fi + + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for OCILobIsTemporary in -locijdbc8""... $ac_c" 1>&6 +-echo "configure:71091: checking for OCILobIsTemporary in -locijdbc8" >&5 +-ac_lib_var=`echo ocijdbc8'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-locijdbc8 $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- ++ fi + +- case ocijdbc8 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_OCI_SHARED_LIBADD="$PDO_OCI_SHARED_LIBADD -locijdbc8" +- else +- + +- case ocijdbc8 in ++ case $FIREBIRD_LIBNAME in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -locijdbc8" +- ;; +- esac +- +- +- fi ++ LIBS="-l$FIREBIRD_LIBNAME $LIBS" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_OCILOBISTEMPORARY 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_ocijdbc8_OCILobIsTemporary +- +- +-fi +- +- +- +-fi + + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test "$FIREBIRD_INCDIR" != "/usr/include"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$FIREBIRD_INCDIR" || echo "$FIREBIRD_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$FIREBIRD_INCDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $FIREBIRD_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$FIREBIRD_INCDIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + +- ;; +- esac +- done ++ fi + +- echo $ac_n "checking for OCICollAssign in -lclntsh""... $ac_c" 1>&6 +-echo "configure:71271: checking for OCICollAssign in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCICollAssign | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_OCICOLLASSIGN 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCICollAssign +- +- +-fi +- +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for OCIStmtFetch2 in -lclntsh""... $ac_c" 1>&6 +-echo "configure:71424: checking for OCIStmtFetch2 in -lclntsh" >&5 +-ac_lib_var=`echo clntsh'_'OCIStmtFetch2 | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lclntsh $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_OCISTMTFETCH2 1 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PDO_FIREBIRD 1 + EOF + + +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_clntsh_OCIStmtFetch2 +- +- +-fi +- +- +- +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:71482: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:71488: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi +- +-fi +- +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } +- fi +- +- +- +- +- ext_builddir=ext/pdo_oci +- ext_srcdir=$abs_srcdir/ext/pdo_oci ++ ext_builddir=ext/pdo_firebird ++ ext_srcdir=$abs_srcdir/ext/pdo_firebird + + ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_OCI_SHARED=no ++ PHP_PDO_FIREBIRD_SHARED=no + + +- case ext/pdo_oci in ++ case ext/pdo_firebird in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_oci"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_oci/"; ac_bdir="ext/pdo_oci/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_firebird"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_firebird/"; ac_bdir="ext/pdo_firebird/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -71532,7 +70038,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6 + + + old_IFS=$IFS +- for ac_src in pdo_oci.c oci_driver.c oci_statement.c; do ++ for ac_src in pdo_firebird.c firebird_driver.c firebird_statement.c; do + + IFS=. + set $ac_src +@@ -71555,18 +70061,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC pdo_oci" ++ EXT_STATIC="$EXT_STATIC pdo_firebird" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC pdo_oci" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC pdo_firebird" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PDO_OCI_SHARED=yes ++ PHP_PDO_FIREBIRD_SHARED=yes + +- case ext/pdo_oci in ++ case ext/pdo_firebird in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_oci"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_oci/"; ac_bdir="ext/pdo_oci/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_firebird"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_firebird/"; ac_bdir="ext/pdo_firebird/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -71581,14 +70087,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in pdo_oci.c oci_driver.c oci_statement.c; do ++ for ac_src in pdo_firebird.c firebird_driver.c firebird_statement.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_pdo_oci="$shared_objects_pdo_oci $ac_bdir$ac_obj.lo" ++ shared_objects_pdo_firebird="$shared_objects_pdo_firebird $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -71611,31 +70117,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppdo_oci.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) $(PHPPDO_OCI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppdo_oci.so '$ext_builddir'/phppdo_oci.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppdo_firebird.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_firebird) $(PHPPDO_FIREBIRD_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppdo_firebird.so '$ext_builddir'/phppdo_firebird.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPDO_OCI, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_firebird) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPDO_FIREBIRD, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) $(PHPPDO_OCI_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_firebird) $(PHPPDO_FIREBIRD_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppdo_oci.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppdo_firebird.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_oci.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_firebird.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_oci" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_firebird" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } + fi + if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then + { echo "configure: error: +-You've configured extension pdo_oci, which depends on extension pdo, ++You've configured extension pdo_firebird, which depends on extension pdo, + but you've either not enabled pdo, or have disabled it. + " 1>&2; exit 1; } + fi + +- +- +- cat >> confdefs.h <&6 +-echo "configure:71856: checking for ODBC v3 support for PDO" >&5 +-# Check whether --with-pdo-odbc or --without-pdo-odbc was given. +-if test "${with_pdo_odbc+set}" = set; then +- withval="$with_pdo_odbc" +- PHP_PDO_ODBC=$withval ++echo $ac_n "checking for MySQL support for PDO""... $ac_c" 1>&6 ++echo "configure:70335: checking for MySQL support for PDO" >&5 ++# Check whether --with-pdo-mysql or --without-pdo-mysql was given. ++if test "${with_pdo_mysql+set}" = set; then ++ withval="$with_pdo_mysql" ++ PHP_PDO_MYSQL=$withval + else + +- PHP_PDO_ODBC=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_ODBC=$PHP_ENABLE_ALL ++ PHP_PDO_MYSQL=no ++ test "$PHP_ENABLE_ALL" && PHP_PDO_MYSQL=$PHP_ENABLE_ALL + + fi + +@@ -71868,12 +70347,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO_ODBC in ++case $PHP_PDO_MYSQL in + shared,*) +- PHP_PDO_ODBC=`echo "$PHP_PDO_ODBC"|$SED 's/^shared,//'` ++ PHP_PDO_MYSQL=`echo "$PHP_PDO_MYSQL"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO_ODBC=yes ++ PHP_PDO_MYSQL=yes + ;; + no) + ext_output=no +@@ -71892,475 +70371,187 @@ echo "$ac_t""$ext_output" 1>&6 + + + +- +- +- +-if test "$PHP_PDO_ODBC" != "no"; then +- +- if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } +- fi +- ++if test -z "$PHP_ZLIB_DIR"; then + +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:71908: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++php_with_zlib_dir=no ++ ++echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 ++echo "configure:70380: checking for the location of libz" >&5 ++# Check whether --with-zlib-dir or --without-zlib-dir was given. ++if test "${with_zlib_dir+set}" = set; then ++ withval="$with_zlib_dir" ++ PHP_ZLIB_DIR=$withval + else + +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:71914: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi ++ PHP_ZLIB_DIR=no + ++ + fi + +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } +- fi + +- ++ext_output=$PHP_ZLIB_DIR ++echo "$ac_t""$ext_output" 1>&6 + +- echo $ac_n "checking for selected PDO ODBC flavour""... $ac_c" 1>&6 +-echo "configure:71935: checking for selected PDO ODBC flavour" >&5 + +- pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`" +- pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`" + +- if test "$pdo_odbc_dir" = "$PHP_PDO_ODBC" ; then +- pdo_odbc_dir= +- fi ++fi + +- case $pdo_odbc_flavour in +- ibm-db2) +- pdo_odbc_def_libdir=/home/db2inst1/sqllib/lib +- pdo_odbc_def_incdir=/home/db2inst1/sqllib/include +- pdo_odbc_def_lib=db2 +- ;; ++if test "$PHP_PDO_MYSQL" != "no"; then + +- iODBC|iodbc) +- pdo_odbc_def_libdir=/usr/local/$PHP_LIBDIR +- pdo_odbc_def_incdir=/usr/local/include +- pdo_odbc_def_lib=iodbc +- ;; ++ if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } ++ fi + +- unixODBC|unixodbc) +- pdo_odbc_def_libdir=/usr/local/$PHP_LIBDIR +- pdo_odbc_def_incdir=/usr/local/include +- pdo_odbc_def_lib=odbc +- ;; ++ + +- ODBCRouter|odbcrouter) +- pdo_odbc_def_libdir=/usr/$PHP_LIBDIR +- pdo_odbc_def_incdir=/usr/include +- pdo_odbc_def_lib=odbcsdk +- ;; ++ if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then ++ PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL ++ elif test "$PHP_PDO_MYSQL" != "yes"; then ++ if test -d "$PHP_PDO_MYSQL" ; then ++ if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then ++ PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config" ++ else ++ PDO_MYSQL_DIR="$PHP_PDO_MYSQL" ++ fi ++ fi ++ else ++ for i in /usr/local /usr ; do ++ if test -x "$i/bin/mysql_config" ; then ++ PDO_MYSQL_CONFIG="$i/bin/mysql_config" ++ break; ++ fi ++ if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then ++ PDO_MYSQL_DIR="$i" ++ break; ++ fi ++ done ++ fi + +- generic) +- pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`" +- pdo_odbc_def_ldflags="`echo $PHP_PDO_ODBC | cut -d, -f4`" +- pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f5`" +- pdo_odbc_flavour="generic-$pdo_odbc_def_lib" +- ;; ++ if test "$PHP_PDO_MYSQL" = "mysqlnd"; then ++ PHP_MYSQLND_ENABLED=yes ++ cat >> confdefs.h <<\EOF ++#define PDO_USE_MYSQLND 1 ++EOF + +- *) +- { echo "configure: error: Unknown ODBC flavour $pdo_odbc_flavour +- include and lib dirs are looked for under 'dir'. +- +- 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic +- If ',dir' part is omitted, default for the flavour +- you have selected will used. e.g.: +- +- --with-pdo-odbc=unixODBC +- +- will check for unixODBC under /usr/local. You may attempt +- to use an otherwise unsupported driver using the \"generic\" +- flavour. The syntax for generic ODBC support is: +- +- --with-pdo-odbc=generic,dir,libname,ldflags,cflags ++ else ++ cat >> confdefs.h <<\EOF ++#define HAVE_MYSQL 1 ++EOF + +- When build as shared the extension filename is always pdo_odbc.so" 1>&2; exit 1; } +- ;; +- esac + +- if test -n "$pdo_odbc_dir"; then +- PDO_ODBC_INCDIR="$pdo_odbc_dir/include" +- PDO_ODBC_LIBDIR="$pdo_odbc_dir/$PHP_LIBDIR" +- else +- PDO_ODBC_INCDIR="$pdo_odbc_def_incdir" +- PDO_ODBC_LIBDIR="$pdo_odbc_def_libdir" +- fi +- +- echo "$ac_t""$pdo_odbc_flavour +- libs $PDO_ODBC_LIBDIR, +- headers $PDO_ODBC_INCDIR" 1>&6 +- +- if test ! -d "$PDO_ODBC_LIBDIR" ; then +- echo "configure: warning: library dir $PDO_ODBC_LIBDIR does not exist" 1>&2 +- fi +- +- +- echo $ac_n "checking for odbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72014: checking for odbc.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/odbc.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_ODBC_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for odbcsdk.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72028: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/odbcsdk.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_ODBCSDK_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for iodbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72042: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/iodbc.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_IODBC_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sqlunix.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72056: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sqlunix.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLUNIX_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sqltypes.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72070: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sqltypes.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLTYPES_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sqlucode.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72084: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sqlucode.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLUCODE_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72098: checking for sql.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sql.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQL_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for isql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72112: checking for isql.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/isql.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_ISQL_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72126: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sqlext.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLEXT_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for isqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72140: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/isqlext.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_ISQLEXT_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for udbcext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72154: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/udbcext.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_UDBCEXT_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for sqlcli1.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72168: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/sqlcli1.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLCLI1_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for LibraryManager.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72182: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/LibraryManager.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRARYMANAGER_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for cli0core.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72196: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/cli0core.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_CLI0CORE_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for cli0ext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72210: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/cli0ext.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_CLI0EXT_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for cli0cli.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72224: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/cli0cli.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_CLI0CLI_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for cli0defs.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72238: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/cli0defs.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_CLI0DEFS_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- echo $ac_n "checking for cli0env.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 +-echo "configure:72252: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5 +- if test -f "$PDO_ODBC_INCDIR/cli0env.h"; then +- php_pdo_have_header=yes +- cat >> confdefs.h <<\EOF +-#define HAVE_CLI0ENV_H 1 +-EOF +- +- echo "$ac_t""yes" 1>&6 +- else +- echo "$ac_t""no" 1>&6 +- fi +- +- +- if test "$php_pdo_have_header" != "yes"; then +- { echo "configure: error: Cannot find header file(s) for pdo_odbc" 1>&2; exit 1; } +- fi +- +- PDO_ODBC_INCLUDE="$pdo_odbc_def_cflags -I$PDO_ODBC_INCDIR -DPDO_ODBC_TYPE=\\\"$pdo_odbc_flavour\\\"" +- PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags -L$PDO_ODBC_LIBDIR -l$pdo_odbc_def_lib" ++ echo $ac_n "checking for mysql_config""... $ac_c" 1>&6 ++echo "configure:70444: checking for mysql_config" >&5 ++ if test -n "$PDO_MYSQL_CONFIG"; then ++ echo "$ac_t""$PDO_MYSQL_CONFIG" 1>&6 ++ if test "x$SED" = "x"; then ++ # Extract the first word of "sed", so it can be a program name with args. ++set dummy sed; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:70451: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ case "$SED" in ++ /*) ++ ac_cv_path_SED="$SED" # Let the user override the test with a path. ++ ;; ++ ?:/*) ++ ac_cv_path_SED="$SED" # Let the user override the test with a dos path. ++ ;; ++ *) ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_path_SED="$ac_dir/$ac_word" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ ;; ++esac ++fi ++SED="$ac_cv_path_SED" ++if test -n "$SED"; then ++ echo "$ac_t""$SED" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi + +- +- for ac_i in $PDO_ODBC_LDFLAGS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- PDO_ODBC_SHARED_LIBADD="$PDO_ODBC_SHARED_LIBADD -pthread" ++ fi ++ if test "$enable_maintainer_zts" = "yes"; then ++ PDO_MYSQL_LIBNAME=mysqlclient_r ++ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"` + else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- ++ PDO_MYSQL_LIBNAME=mysqlclient ++ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` ++ fi ++ PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"` ++ elif test -n "$PDO_MYSQL_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ echo $ac_n "checking for mysql install under $PDO_MYSQL_DIR""... $ac_c" 1>&6 ++echo "configure:70495: checking for mysql install under $PDO_MYSQL_DIR" >&5 ++ if test -r $PDO_MYSQL_DIR/include/mysql; then ++ PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql ++ else ++ PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include ++ fi ++ if test -r $PDO_MYSQL_DIR/$PHP_LIBDIR/mysql; then ++ PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/$PHP_LIBDIR/mysql ++ else ++ PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/$PHP_LIBDIR + fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- PDO_ODBC_SHARED_LIBADD="$PDO_ODBC_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac + ++ if test -r "$PDO_MYSQL_LIB_DIR"; then ++ echo "$ac_t""libs under $PDO_MYSQL_LIB_DIR; seems promising" 1>&6 ++ else ++ echo "$ac_t""can not find it" 1>&6 ++ { echo "configure: error: Unable to find your mysql installation" 1>&2; exit 1; } ++ fi + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$PDO_MYSQL_INC_DIR" != "/usr/include"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$PDO_MYSQL_INC_DIR" || echo "$PDO_MYSQL_INC_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_MYSQL_INC_DIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_MYSQL_INC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_MYSQL_INC_DIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- PDO_ODBC_SHARED_LIBADD="-L$ai_p $PDO_ODBC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_ODBC_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_ODBC_SHARED_LIBADD" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + +- ;; +- esac +- done ++ fi + ++ PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR ++ else ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Unable to find your mysql installation" 1>&2; exit 1; } ++ fi + + + save_old_LDFLAGS=$LDFLAGS +- ac_stuff="$PDO_ODBC_LDFLAGS" ++ ac_stuff=" ++ $PDO_MYSQL_LIBS ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -72453,27 +70644,27 @@ EOF + esac + done + +- echo $ac_n "checking for SQLBindCol in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 +-echo "configure:72458: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5 +-ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLBindCol | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:70649: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-l$pdo_odbc_def_lib $LIBS" ++LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:70668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -72492,18 +70683,52 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="$PDO_ODBC_LDFLAGS" ++ ++ for ac_i in $PDO_MYSQL_INCLUDE; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ + +- save_ext_shared=$ext_shared +- ext_shared=yes ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- for ac_i in $ac_stuff; do ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ for ac_i in $PDO_MYSQL_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -pthread" + else + + +@@ -72525,7 +70750,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -l$ac_ii" + else + + +@@ -72560,8 +70785,8 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" + else + + +@@ -72587,44 +70812,6 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + esac + done + +- echo $ac_n "checking for SQLAllocHandle in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 +-echo "configure:72592: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5 +-ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLAllocHandle | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$pdo_odbc_def_lib $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared + + + else +@@ -72632,548 +70819,398 @@ else + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_$pdo_odbc_def_lib_SQLAllocHandle ++ unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query + +- { echo "configure: error: +-Your ODBC library does not appear to be ODBC 3 compatible. +-You should consider using iODBC or unixODBC instead, and loading your +-libraries as a driver in that environment; it will emulate the +-functions required for PDO support. +-" 1>&2; exit 1; } +- +-fi ++ if test "$PHP_ZLIB_DIR" != "no"; then ++ + +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$pdo_odbc_def_lib_SQLBindCol ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="-lz $PDO_MYSQL_SHARED_LIBADD" ++ if test -n "$PHP_ZLIB_DIR"; then ++ ++ if test "$PHP_ZLIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR" != "/usr/lib"; then + +- { echo "configure: error: Your ODBC library does not exist or there was an error. Check config.log for more information" 1>&2; exit 1; } +- +- +-fi +- +- +- +- ext_builddir=ext/pdo_odbc +- ext_srcdir=$abs_srcdir/ext/pdo_odbc +- +- ac_extra=`echo "-I$pdo_inc_path $PDO_ODBC_INCLUDE"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_DIR ++ else ++ ++ ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" ++ fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_ODBC_SHARED=no + ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" ++ else ++ + +- case ext/pdo_odbc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_odbc/"; ac_bdir="ext/pdo_odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in pdo_odbc.c odbc_driver.c odbc_stmt.c; do ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ fi + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$PHP_ZLIB_DIR ++ else ++ ++ ep_dir="`echo $PHP_ZLIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`" ++ fi ++ ++ + +- case ext/pdo_odbc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_odbc/"; ac_bdir="ext/pdo_odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + + +- +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo +- +- +- old_IFS=$IFS +- for ac_src in pdo_odbc.c odbc_driver.c odbc_stmt.c; do ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_pdo_odbc="$shared_objects_pdo_odbc $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h </dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_PDO_ODBC_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else + + +- case ext/pdo_odbc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_odbc/"; ac_bdir="ext/pdo_odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + ++ fi ++ ++ fi + +- old_IFS=$IFS +- for ac_src in pdo_odbc.c odbc_driver.c odbc_stmt.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ;; ++ esac ++ done + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:71021: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + +- EXT_STATIC="$EXT_STATIC pdo_odbc" +- ;; +- *) ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query ++ ++ { echo "configure: error: PDO_MYSQL configure failed. Please check config.log for more information." 1>&2; exit 1; } + + +- case ext/pdo_odbc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_odbc/"; ac_bdir="ext/pdo_odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- ++fi + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in pdo_odbc.c odbc_driver.c odbc_stmt.c; do ++ PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz" ++ else ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="-lz $PDO_MYSQL_SHARED_LIBADD" ++ else + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lz $LIBS" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_odbc, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +-fi +- +- +- +-php_with_pdo_pgsql=no +- +-echo $ac_n "checking for PostgreSQL support for PDO""... $ac_c" 1>&6 +-echo "configure:72985: checking for PostgreSQL support for PDO" >&5 +-# Check whether --with-pdo-pgsql or --without-pdo-pgsql was given. +-if test "${with_pdo_pgsql+set}" = set; then +- withval="$with_pdo_pgsql" +- PHP_PDO_PGSQL=$withval +-else +- +- PHP_PDO_PGSQL=no +- test "$PHP_ENABLE_ALL" && PHP_PDO_PGSQL=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_PDO_PGSQL in +-shared,*) +- PHP_PDO_PGSQL=`echo "$PHP_PDO_PGSQL"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_PDO_PGSQL=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_PDO_PGSQL" != "no"; then +- +- if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } +- fi +- +- +- if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then +- PGSQL_INCLUDE=$PGSQL_INCLUDE ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- PGSQL_INCLUDE="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + +- +- echo $ac_n "checking for pg_config""... $ac_c" 1>&6 +-echo "configure:73044: checking for pg_config" >&5 +- for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do +- if test -x $i/pg_config; then +- PG_CONFIG="$i/pg_config" +- break; +- fi +- done +- +- if test -n "$PG_CONFIG"; then +- echo "$ac_t""$PG_CONFIG" 1>&6 +- PGSQL_INCLUDE=`$PG_CONFIG --includedir` +- PGSQL_LIBDIR=`$PG_CONFIG --libdir` +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_CONFIG_H 1 +-EOF +- +- else +- echo "$ac_t""not found" 1>&6 +- if test "$PHP_PDO_PGSQL" = "yes"; then +- PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" +- else +- PGSQL_SEARCH_PATHS=$PHP_PDO_PGSQL +- fi ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- for i in $PGSQL_SEARCH_PATHS; do +- for j in include include/pgsql include/postgres include/postgresql ""; do +- if test -r "$i/$j/libpq-fe.h"; then +- PGSQL_INC_BASE=$i +- PGSQL_INCLUDE=$i/$j +- if test -r "$i/$j/pg_config.h"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_CONFIG_H 1 +-EOF +- +- fi +- fi +- done +- +- for j in $PHP_LIBDIR $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do +- if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then +- PGSQL_LIBDIR=$i/$j +- fi +- done +- done +- fi +- +- if test -z "$PGSQL_INCLUDE"; then +- { echo "configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } + fi + +- if test -z "$PGSQL_LIBDIR"; then +- { echo "configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } +- fi + +- if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then +- { echo "configure: error: Unable to find libpq anywhere under $PGSQL_SEARCH_PATHS" 1>&2; exit 1; } ++ fi ++ + fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_PDO_PGSQL 1 +-EOF +- +- +- echo $ac_n "checking for openssl dependencies""... $ac_c" 1>&6 +-echo "configure:73108: checking for openssl dependencies" >&5 +- if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then +- echo "$ac_t""yes" 1>&6 +- # Extract the first word of "pkg-config", so it can be a program name with args. +-set dummy pkg-config; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:73114: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- case "$PKG_CONFIG" in +- /*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. +- ;; +- ?:/*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. +- ;; +- *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" +- break +- fi ++ ;; ++ esac + done +- IFS="$ac_save_ifs" +- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" +- ;; +-esac +-fi +-PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +-if test -n "$PKG_CONFIG"; then +- echo "$ac_t""$PKG_CONFIG" 1>&6 +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then +- PDO_PGSQL_CFLAGS=`$PKG_CONFIG openssl --cflags` +- fi +- else +- echo "$ac_t""no" 1>&6 +- fi + +- old_LIBS=$LIBS +- old_LDFLAGS=$LDFLAGS +- LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" +- echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 +-echo "configure:73158: checking for PQparameterStatus in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6 ++echo "configure:71195: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5 ++ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-l$PDO_MYSQL_LIBNAME $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:71214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -73188,260 +71225,132 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPARAMETERSTATUS 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +- +- echo "Unable to build the PDO PostgreSQL driver: libpq 7.4+ is required" +- exit 1 + +-fi +- +- +- echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 +-echo "configure:73206: checking for PQprepare in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPREPARE 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 +-echo "configure:73249: checking for PQescapeStringConn in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQESCAPE_CONN 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 +-echo "configure:73292: checking for PQescapeByteaConn in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQESCAPE_BYTEA_CONN 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- +- echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 +-echo "configure:73336: checking for pg_encoding_to_char in -lpq" >&5 +-ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT 1 +-EOF +- ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ + else + echo "$ac_t""no" 1>&6 +-fi +- +- +- +- LIBS=$old_LIBS +- LDFLAGS=$old_LDFLAGS + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query ++ ++ { echo "configure: error: Try adding --with-zlib-dir=. Please check config.log for more information." 1>&2; exit 1; } ++ + ++fi ++ ++ PDO_MYSQL_LIBS="$PDO_MYSQL_LIBS -lz" ++ fi + +- if test "$ext_shared" = "yes"; then +- PDO_PGSQL_SHARED_LIBADD="-lpq $PDO_PGSQL_SHARED_LIBADD" +- if test -n "$PGSQL_LIBDIR"; then + +- if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ for ac_i in $PDO_MYSQL_INCLUDE; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then + +- if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_LIBDIR ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- PDO_PGSQL_SHARED_LIBADD="-L$ai_p $PDO_PGSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_PGSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_PGSQL_SHARED_LIBADD" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- + fi + ++ fi + +- fi +- ++ ;; ++ esac ++ done ++ ++ ++ for ac_i in $PDO_MYSQL_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="$PDO_MYSQL_SHARED_LIBADD -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ + fi +- else +- ++ ;; ++ esac + +- if test -n "$PGSQL_LIBDIR"; then +- +- if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_LIBDIR ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + +- ++ if test "$ext_shared" = "yes"; then ++ PDO_MYSQL_SHARED_LIBADD="-L$ai_p $PDO_MYSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_MYSQL_SHARED_LIBADD" ++ else ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -73457,71 +71366,89 @@ fi + fi + + ++ fi + + fi + +- fi +- +- +- case pq in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lpq $LIBS" +- ;; +- esac +- +- +- ++ ;; ++ esac ++ done + +- fi ++ ++ ++fi + + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_PGSQL_SHARED_LIBADD" ++ _SAVE_LIBS=$LIBS ++ LIBS="$LIBS $PDO_MYSQL_LIBS" ++ for ac_func in mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:71388: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + ++int main() { + +- +- if test "$PGSQL_INCLUDE" != "/usr/include"; then +- +- if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_INCLUDE +- else +- +- ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" +- fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++; return 0; } ++EOF ++if { (eval echo configure:71416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ LIBS=$_SAVE_LIBS + fi + +- + + + echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:73519: checking for PDO includes" >&5 ++echo "configure:71446: checking for PDO includes" >&5 + if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:73525: checking for PDO includes" >&5 ++echo "configure:71452: checking for PDO includes" >&5 + if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then + pdo_inc_path=$abs_srcdir/ext + elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +@@ -73541,20 +71468,28 @@ echo "$ac_t""$pdo_inc_path" 1>&6 + + + +- +- ext_builddir=ext/pdo_pgsql +- ext_srcdir=$abs_srcdir/ext/pdo_pgsql ++ if test -n "$PDO_MYSQL_CONFIG"; then ++ PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` ++ cat >> confdefs.h <&6 + + + old_IFS=$IFS +- for ac_src in pdo_pgsql.c pgsql_driver.c pgsql_statement.c; do ++ for ac_src in pdo_mysql.c mysql_driver.c mysql_statement.c; do + + IFS=. + set $ac_src +@@ -73592,18 +71527,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC pdo_pgsql" ++ EXT_STATIC="$EXT_STATIC pdo_mysql" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC pdo_pgsql" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC pdo_mysql" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PDO_PGSQL_SHARED=yes ++ PHP_PDO_MYSQL_SHARED=yes + +- case ext/pdo_pgsql in ++ case ext/pdo_mysql in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_pgsql/"; ac_bdir="ext/pdo_pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_mysql/"; ac_bdir="ext/pdo_mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -73618,14 +71553,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in pdo_pgsql.c pgsql_driver.c pgsql_statement.c; do ++ for ac_src in pdo_mysql.c mysql_driver.c mysql_statement.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_pdo_pgsql="$shared_objects_pdo_pgsql $ac_bdir$ac_obj.lo" ++ shared_objects_pdo_mysql="$shared_objects_pdo_mysql $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -73648,31 +71583,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppdo_pgsql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_pgsql) $(PHPPDO_PGSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppdo_pgsql.so '$ext_builddir'/phppdo_pgsql.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppdo_mysql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_mysql) $(PHPPDO_MYSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppdo_mysql.so '$ext_builddir'/phppdo_mysql.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_pgsql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPDO_PGSQL, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_mysql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPDO_MYSQL, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_pgsql) $(PHPPDO_PGSQL_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_mysql) $(PHPPDO_MYSQL_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppdo_pgsql.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppdo_mysql.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_pgsql.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_mysql.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_pgsql" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_mysql" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } + fi + if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then + { echo "configure: error: +-You've configured extension pdo_pgsql, which depends on extension pdo, ++You've configured extension pdo_mysql, which depends on extension pdo, + but you've either not enabled pdo, or have disabled it. + " 1>&2; exit 1; } + fi +- + ++ if test "$PHP_MYSQL" = "mysqlnd"; then ++ ++ am_i_shared=$PHP_PDO_MYSQL_SHARED ++ is_it_shared=$PHP_MYSQLND_SHARED ++ is_it_enabled=$PHP_MYSQLND ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension pdo_mysql to build statically, but it ++depends on extension mysqlnd, which you've configured to build shared. ++You either need to build pdo_mysql shared or build mysqlnd statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_mysql, which depends on extension mysqlnd, ++but you've either not enabled mysqlnd, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ fi ++ ++ PDO_MYSQL_MODULE_TYPE=external ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_MYSQL_SHARED_LIBADD" ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_MYSQL_MODULE_TYPE" ++ ++ ++ + fi + + ++SUPPORTED_LIB_VERS="9.0 10.1 11.1" # This caters for all Oracle 9.x, 10.x and 11.1 installs ++ + +-php_with_pdo_sqlite=$PHP_PDO + +-echo $ac_n "checking for sqlite 3 support for PDO""... $ac_c" 1>&6 +-echo "configure:73865: checking for sqlite 3 support for PDO" >&5 +-# Check whether --with-pdo-sqlite or --without-pdo-sqlite was given. +-if test "${with_pdo_sqlite+set}" = set; then +- withval="$with_pdo_sqlite" +- PHP_PDO_SQLITE=$withval ++ ++ ++php_with_pdo_oci=no ++ ++echo $ac_n "checking Oracle OCI support for PDO""... $ac_c" 1>&6 ++echo "configure:71837: checking Oracle OCI support for PDO" >&5 ++# Check whether --with-pdo-oci or --without-pdo-oci was given. ++if test "${with_pdo_oci+set}" = set; then ++ withval="$with_pdo_oci" ++ PHP_PDO_OCI=$withval + else + +- PHP_PDO_SQLITE=$PHP_PDO +- test "$PHP_ENABLE_ALL" && PHP_PDO_SQLITE=$PHP_ENABLE_ALL ++ PHP_PDO_OCI=no ++ test "$PHP_ENABLE_ALL" && PHP_PDO_OCI=$PHP_ENABLE_ALL + + fi + +@@ -73877,12 +71849,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PDO_SQLITE in ++case $PHP_PDO_OCI in + shared,*) +- PHP_PDO_SQLITE=`echo "$PHP_PDO_SQLITE"|$SED 's/^shared,//'` ++ PHP_PDO_OCI=`echo "$PHP_PDO_OCI"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PDO_SQLITE=yes ++ PHP_PDO_OCI=yes + ;; + no) + ext_output=no +@@ -73901,74 +71873,48 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_PDO_SQLITE" != "no"; then ++if test "$PHP_PDO_OCI" != "no"; then + + if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then + { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } + fi + +- +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:73914: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:73920: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi +- +-fi +- +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: ++ echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6 ++echo "configure:71884: checking Oracle Install-Dir" >&5 ++ if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then ++ PDO_OCI_DIR=$ORACLE_HOME + else +-{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ PDO_OCI_DIR=$PHP_PDO_OCI + fi ++ echo "$ac_t""$PHP_PDO_OCI" 1>&6 + +- +- +- php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" +- +- if test "$PHP_PDO_SQLITE" != "yes"; then +- SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this +- SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this +- if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter +- PDO_SQLITE_DIR=$PHP_PDO_SQLITE +- else # search default path list +- echo $ac_n "checking for sqlite3 files in default path""... $ac_c" 1>&6 +-echo "configure:73949: checking for sqlite3 files in default path" >&5 +- for i in $SEARCH_PATH ; do +- if test -r $i/$SEARCH_FOR; then +- PDO_SQLITE_DIR=$i +- echo "$ac_t""found in $i" 1>&6 +- fi +- done +- fi +- if test -z "$PDO_SQLITE_DIR"; then +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Please reinstall the sqlite3 distribution" 1>&2; exit 1; } +- fi ++ echo $ac_n "checking if that is sane""... $ac_c" 1>&6 ++echo "configure:71893: checking if that is sane" >&5 ++ if test -z "$PDO_OCI_DIR"; then ++ { echo "configure: error: ++You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_HOME. ++" 1>&2; exit 1; } ++ else ++ echo "$ac_t""yes" 1>&6 ++ fi + ++ if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then ++ PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`" ++ PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`" ++ echo $ac_n "checking for oci.h""... $ac_c" 1>&6 ++echo "configure:71906: checking for oci.h" >&5 ++ if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then ++ ++ if test "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" != "/usr/include"; then + +- if test "$PDO_SQLITE_DIR/include" != "/usr/include"; then +- +- if test -z "$PDO_SQLITE_DIR/include" || echo "$PDO_SQLITE_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$PDO_SQLITE_DIR/include ++ if test -z "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" || echo "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client + else + +- ep_dir="`echo $PDO_SQLITE_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/include\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client\"`" + fi + + +@@ -73989,209 +71935,423 @@ echo "configure:73949: checking for sqli + + fi + +- +- LIBNAME=sqlite3 +- LIBSYMBOL=sqlite3_open ++ echo "$ac_t""$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" 1>&6 ++ elif test -f $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then ++ ++ if test "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" || echo "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include ++ else ++ ++ ep_dir="`echo $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include\"`" ++ fi + + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes + +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac ++ ++ fi + ++ fi + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` ++ echo "$ac_t""$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include" 1>&6 ++ elif test -f $PDO_OCI_IC_PREFIX/sdk/include/oci.h ; then + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$PDO_OCI_IC_PREFIX/sdk/include" != "/usr/include"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$PDO_OCI_IC_PREFIX/sdk/include" || echo "$PDO_OCI_IC_PREFIX/sdk/include" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_IC_PREFIX/sdk/include + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_OCI_IC_PREFIX/sdk/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/sdk/include\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6 +-echo "configure:74095: checking for $LIBSYMBOL in -l$LIBNAME" >&5 +-ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-l$LIBNAME $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- ++ fi + +- if test "$ext_shared" = "yes"; then +- PDO_SQLITE_SHARED_LIBADD="-l$LIBNAME $PDO_SQLITE_SHARED_LIBADD" +- if test -n "$PDO_SQLITE_DIR/$PHP_LIBDIR"; then ++ echo "$ac_t""$PDO_OCI_IC_PREFIX/sdk/include" 1>&6 ++ elif test -f $PDO_OCI_IC_PREFIX/client/include/oci.h ; then + +- if test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$PDO_OCI_IC_PREFIX/client/include" != "/usr/include"; then + +- if test -z "$PDO_SQLITE_DIR/$PHP_LIBDIR" || echo "$PDO_SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_SQLITE_DIR/$PHP_LIBDIR ++ if test -z "$PDO_OCI_IC_PREFIX/client/include" || echo "$PDO_OCI_IC_PREFIX/client/include" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_IC_PREFIX/client/include + else + +- ep_dir="`echo $PDO_SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_OCI_IC_PREFIX/client/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/client/include\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- PDO_SQLITE_SHARED_LIBADD="-L$ai_p $PDO_SQLITE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PDO_SQLITE_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_SQLITE_SHARED_LIBADD" +- else +- + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ echo "$ac_t""$PDO_OCI_IC_PREFIX/client/include" 1>&6 ++ else ++ { echo "configure: error: I'm too dumb to figure out where the include dir is in your Instant Client install" 1>&2; exit 1; } ++ fi ++ if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.so" ; then ++ PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib" ++ elif test -f "$PDO_OCI_IC_PREFIX/client/lib/libclntsh.so" ; then ++ PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/client/lib" ++ elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so" ; then ++ PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX" ++ else ++ { echo "configure: error: I'm too dumb to figure out where the libraries are in your Instant Client install" 1>&2; exit 1; } ++ fi ++ PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`" ++ else ++ ++ echo $ac_n "checking size of long int""... $ac_c" 1>&6 ++echo "configure:72055: checking size of long int" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_long_int=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(long int)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:72075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_long_int=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_long_int=0 ++fi ++rm -fr conftest* ++fi ++ ++fi ++echo "$ac_t""$ac_cv_sizeof_long_int" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:72095: checking if we're on a 64-bit platform" >&5 ++ if test "$ac_cv_sizeof_long_int" = "4" ; then ++ echo "$ac_t""no" 1>&6 ++ TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" ++ else ++ echo "$ac_t""yes" 1>&6 ++ TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" ++ fi ++ ++ echo $ac_n "checking OCI8 libraries dir""... $ac_c" 1>&6 ++echo "configure:72105: checking OCI8 libraries dir" >&5 ++ if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then ++ PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" ++ elif test ! -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then ++ PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" ++ elif test -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then ++ PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR ++ else ++ { echo "configure: error: Oracle required OCI8 libraries not found" 1>&2; exit 1; } ++ fi ++ echo "$ac_t""$PDO_OCI_LIB_DIR" 1>&6 ++ ++ ++ if test -d "$PDO_OCI_DIR/rdbms/public"; then ++ ++ if test "$PDO_OCI_DIR/rdbms/public" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_DIR/rdbms/public" || echo "$PDO_OCI_DIR/rdbms/public" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_DIR/rdbms/public ++ else ++ ++ ep_dir="`echo $PDO_OCI_DIR/rdbms/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/rdbms/public\"`" ++ fi ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public" ++ fi ++ if test -d "$PDO_OCI_DIR/rdbms/demo"; then ++ ++ if test "$PDO_OCI_DIR/rdbms/demo" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_DIR/rdbms/demo" || echo "$PDO_OCI_DIR/rdbms/demo" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_DIR/rdbms/demo ++ else ++ ++ ep_dir="`echo $PDO_OCI_DIR/rdbms/demo|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/rdbms/demo\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ + fi + ++ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/demo" ++ fi ++ if test -d "$PDO_OCI_DIR/network/public"; then ++ ++ if test "$PDO_OCI_DIR/network/public" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_DIR/network/public" || echo "$PDO_OCI_DIR/network/public" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_DIR/network/public ++ else ++ ++ ep_dir="`echo $PDO_OCI_DIR/network/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/network/public\"`" ++ fi + ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + ++ fi ++ ++ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/network/public" + fi ++ if test -d "$PDO_OCI_DIR/plsql/public"; then ++ ++ if test "$PDO_OCI_DIR/plsql/public" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_DIR/plsql/public" || echo "$PDO_OCI_DIR/plsql/public" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_DIR/plsql/public + else + ++ ep_dir="`echo $PDO_OCI_DIR/plsql/public|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/plsql/public\"`" ++ fi + +- if test -n "$PDO_SQLITE_DIR/$PHP_LIBDIR"; then + +- if test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" + +- if test -z "$PDO_SQLITE_DIR/$PHP_LIBDIR" || echo "$PDO_SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PDO_SQLITE_DIR/$PHP_LIBDIR ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/plsql/public" ++ fi ++ if test -d "$PDO_OCI_DIR/include"; then ++ ++ if test "$PDO_OCI_DIR/include" != "/usr/include"; then ++ ++ if test -z "$PDO_OCI_DIR/include" || echo "$PDO_OCI_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_DIR/include + else + +- ep_dir="`echo $PDO_SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PDO_OCI_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_DIR/include\"`" + fi + + ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include" ++ fi ++ ++ if test -f "$PDO_OCI_LIB_DIR/sysliblist"; then ++ ++ for ac_i in `cat $PDO_OCI_LIB_DIR/sysliblist`; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` + ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="-L$ai_p $PDO_OCI_SYSLIB" ++ test -n "$ld_runpath_switch" && PDO_OCI_SYSLIB="$ld_runpath_switch$ai_p $PDO_OCI_SYSLIB" ++ else ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -74207,46 +72367,196 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + ++ fi + + fi + ++ ;; ++ esac ++ done ++ ++ elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then ++ ++ for ac_i in `cat $PDO_OCI_DIR/rdbms/lib/sysliblist`; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="$PDO_OCI_SYSLIB -l$ac_ii" ++ else ++ + +- case $LIBNAME in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="-l$LIBNAME $LIBS" ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + + ++ fi ++ ;; ++ esac ++ + ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SYSLIB="-L$ai_p $PDO_OCI_SYSLIB" ++ test -n "$ld_runpath_switch" && PDO_OCI_SYSLIB="$ld_runpath_switch$ai_p $PDO_OCI_SYSLIB" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_PDO_SQLITELIB 1 +-EOF ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done + ++ fi + ++ echo $ac_n "checking Oracle version""... $ac_c" 1>&6 ++echo "configure:72472: checking Oracle version" >&5 ++ for OCI_VER in $SUPPORTED_LIB_VERS; do ++ if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then ++ PDO_OCI_VERSION="$OCI_VER" ++ fi ++ done ++ if test -z "$PDO_OCI_VERSION"; then ++ { echo "configure: error: Oracle required OCI8 libraries not found under $PDO_OCI_DIR" 1>&2; exit 1; } ++ fi ++ echo "$ac_t""$PDO_OCI_VERSION" 1>&6 ++ ++ fi ++ ++ case $PDO_OCI_VERSION in ++ 9.0|10.1|10.2|11.1|11.2) ++ + +-else +- echo "$ac_t""no" 1>&6 ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SHARED_LIBADD="$PDO_OCI_SHARED_LIBADD -lclntsh" ++ else ++ ++ ++ case clntsh in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -lclntsh" ++ ;; ++ esac + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$LIBNAME_$LIBSYMBOL ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ ++ *) ++ { echo "configure: error: Unsupported Oracle version $PDO_OCI_VERSION" 1>&2; exit 1; } ++ ;; ++ esac ++ ++ ++ if test "$PDO_OCI_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PDO_OCI_LIB_DIR" != "/usr/lib"; then + +- { echo "configure: error: wrong sqlite lib version or lib not found" 1>&2; exit 1; } ++ if test -z "$PDO_OCI_LIB_DIR" || echo "$PDO_OCI_LIB_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_OCI_LIB_DIR ++ else ++ ++ ep_dir="`echo $PDO_OCI_LIB_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_OCI_LIB_DIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_OCI_SHARED_LIBADD="-L$ai_p $PDO_OCI_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_OCI_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_OCI_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +-fi ++ fi + ++ ++ fi + ++ fi ++ ++ ++ + save_old_LDFLAGS=$LDFLAGS +- ac_stuff="" ++ ac_stuff=" ++ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -74339,27 +72649,27 @@ fi + esac + done + +- echo $ac_n "checking for sqlite3_key in -lsqlite3""... $ac_c" 1>&6 +-echo "configure:74344: checking for sqlite3_key in -lsqlite3" >&5 +-ac_lib_var=`echo sqlite3'_'sqlite3_key | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6 ++echo "configure:72654: checking for OCIEnvCreate in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lsqlite3 $LIBS" ++LIBS="-lclntsh $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:72673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -74378,825 +72688,330 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + +- cat >> confdefs.h <<\EOF +-#define HAVE_SQLITE3_KEY 1 ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCIENVCREATE 1 + EOF + +- ++ + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_sqlite3_sqlite3_key ++ unset ac_cv_lib_clntsh_OCIEnvCreate + + + fi + + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_SQLITE_SHARED_LIBADD" +- +- +- ext_builddir=ext/pdo_sqlite +- ext_srcdir=$abs_srcdir/ext/pdo_sqlite +- +- ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PDO_SQLITE_SHARED=no +- + +- case ext/pdo_sqlite in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_sqlite/"; ac_bdir="ext/pdo_sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ++ " + ++ save_ext_shared=$ext_shared ++ ext_shared=yes + ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in $php_pdo_sqlite_sources_core; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_sqlite.$suffix" ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_sqlite" +- +- cat >>Makefile.objects<>Makefile.objects<&6 ++echo "configure:72807: checking for OCIEnvNlsCreate in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lclntsh $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- esac +- cat >> confdefs.h <&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCIENVNLSCREATE 1 + EOF + +- fi +- fi +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_PDO_SQLITE_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/pdo_sqlite in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pdo_sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pdo_sqlite/"; ac_bdir="ext/pdo_sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + + ++else ++ echo "$ac_t""no" 1>&6 + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in $php_pdo_sqlite_sources_core; do ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_clntsh_OCIEnvNlsCreate ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + + +- BUILD_DIR="$BUILD_DIR $ext_builddir" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=pdo_sqlite ++ fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" +- + fi + +- else +- # use bundled libs +- if test "$enable_maintainer_zts" = "yes"; then +- threadsafe_flags="-DSQLITE_THREADSAFE=1" +- else +- threadsafe_flags="-DSQLITE_THREADSAFE=0" +- fi ++ ;; ++ esac ++ done + +- other_flags="-DSQLITE_ENABLE_FTS3=1 -DSQLITE_CORE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1" ++ echo $ac_n "checking for OCILobIsTemporary in -lclntsh""... $ac_c" 1>&6 ++echo "configure:72960: checking for OCILobIsTemporary in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lclntsh $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- if test "$PHP_SQLITE3" != "yes"; then +- ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- case ext/sqlite3 in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sqlite3"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sqlite3/"; ac_bdir="ext/sqlite3/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCILOBISTEMPORARY 1 ++EOF ++ + + ++else ++ echo "$ac_t""no" 1>&6 + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in libsqlite/sqlite3.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_sqlite, which depends on extension sqlite3, +-but you've either not enabled sqlite3, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- if test "$abs_srcdir/ext/sqlite3/libsqlite" != "/usr/include"; then +- +- if test -z "$abs_srcdir/ext/sqlite3/libsqlite" || echo "$abs_srcdir/ext/sqlite3/libsqlite" | grep '^/' >/dev/null ; then +- ai_p=$abs_srcdir/ext/sqlite3/libsqlite +- else +- +- ep_dir="`echo $abs_srcdir/ext/sqlite3/libsqlite|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$abs_srcdir/ext/sqlite3/libsqlite\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- for ac_func in usleep nanosleep +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:75104: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- +-; return 0; } +-EOF +-if { (eval echo configure:75132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done +- +- for ac_hdr in time.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:75160: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:75170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done +- +- fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="" ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_clntsh_OCILobIsTemporary ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -75289,27 +73104,27 @@ done + esac + done + +- echo $ac_n "checking for fdatasync in -lrt""... $ac_c" 1>&6 +-echo "configure:75294: checking for fdatasync in -lrt" >&5 +-ac_lib_var=`echo rt'_'fdatasync | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for OCILobIsTemporary in -locijdbc8""... $ac_c" 1>&6 ++echo "configure:73109: checking for OCILobIsTemporary in -locijdbc8" >&5 ++ac_lib_var=`echo ocijdbc8'_'OCILobIsTemporary | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lrt $LIBS" ++LIBS="-locijdbc8 $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:73128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -75328,19 +73143,20 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + ++ + +- case rt in ++ case ocijdbc8 in + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- PDO_SQLITE_SHARED_LIBADD="-lrt $PDO_SQLITE_SHARED_LIBADD" ++ PDO_OCI_SHARED_LIBADD="$PDO_OCI_SHARED_LIBADD -locijdbc8" + else + + +- case rt in ++ case ocijdbc8 in + c|c_r|pthread*) ;; + *) +- LIBS="-lrt $LIBS" ++ LIBS="$LIBS -locijdbc8" + ;; + esac + +@@ -75350,188 +73166,145 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + esac + + ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCILOBISTEMPORARY 1 ++EOF ++ ++ + + else + echo "$ac_t""no" 1>&6 + + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared +- unset ac_cv_lib_rt_fdatasync ++ unset ac_cv_lib_ocijdbc8_OCILobIsTemporary + + + fi + +- +- +- +- am_i_shared=$PHP_PDO_SQLITE_SHARED +- is_it_shared=$PHP_PDO_SHARED +- is_it_enabled=$PHP_PDO +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension pdo_sqlite to build statically, but it +-depends on extension pdo, which you've configured to build shared. +-You either need to build pdo_sqlite shared or build pdo statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension pdo_sqlite, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. +-" 1>&2; exit 1; } +- fi + + + fi + + +- +-php_with_pgsql=no +- +-echo $ac_n "checking for PostgreSQL support""... $ac_c" 1>&6 +-echo "configure:75394: checking for PostgreSQL support" >&5 +-# Check whether --with-pgsql or --without-pgsql was given. +-if test "${with_pgsql+set}" = set; then +- withval="$with_pgsql" +- PHP_PGSQL=$withval +-else ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ++ " + +- PHP_PGSQL=no +- test "$PHP_ENABLE_ALL" && PHP_PGSQL=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_PGSQL in +-shared,*) +- PHP_PGSQL=`echo "$PHP_PGSQL"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_PGSQL=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +-echo "$ac_t""$ext_output" 1>&6 ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + + ++ fi ++ ;; ++ esac + + +-if test "$PHP_PGSQL" != "no"; then +- +- if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then +- PGSQL_INCLUDE=$PGSQL_INCLUDE ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- PGSQL_INCLUDE="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + +- +- echo $ac_n "checking for pg_config""... $ac_c" 1>&6 +-echo "configure:75448: checking for pg_config" >&5 +- for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do +- if test -x $i/pg_config; then +- PG_CONFIG="$i/pg_config" +- break; +- fi +- done +- +- if test -n "$PG_CONFIG"; then +- echo "$ac_t""$PG_CONFIG" 1>&6 +- PGSQL_INCLUDE=`$PG_CONFIG --includedir` +- PGSQL_LIBDIR=`$PG_CONFIG --libdir` +- if test -r "$PGSQL_INCLUDE/pg_config.h"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_CONFIG_H 1 +-EOF +- +- fi +- else +- echo "$ac_t""not found" 1>&6 +- if test "$PHP_PGSQL" = "yes"; then +- PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" +- else +- PGSQL_SEARCH_PATHS=$PHP_PGSQL +- fi ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- for i in $PGSQL_SEARCH_PATHS; do +- for j in include include/pgsql include/postgres include/postgresql ""; do +- if test -r "$i/$j/libpq-fe.h"; then +- PGSQL_INC_BASE=$i +- PGSQL_INCLUDE=$i/$j +- if test -r "$i/$j/pg_config.h"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_CONFIG_H 1 +-EOF +- +- fi +- fi +- done +- +- for j in lib $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do +- if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then +- PGSQL_LIBDIR=$i/$j +- fi +- done +- done +- fi +- +- if test -z "$PGSQL_INCLUDE"; then +- { echo "configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } + fi + +- if test -z "$PGSQL_LIBDIR"; then +- { echo "configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } +- fi + +- if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then +- { echo "configure: error: Unable to find libpq anywhere under $PGSQL_SEARCH_PATHS" 1>&2; exit 1; } ++ fi ++ + fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_PGSQL 1 +-EOF ++ ;; ++ esac ++ done + +- old_LIBS=$LIBS +- old_LDFLAGS=$LDFLAGS +- LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" +- echo $ac_n "checking for PQescapeString in -lpq""... $ac_c" 1>&6 +-echo "configure:75516: checking for PQescapeString in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQescapeString | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for OCICollAssign in -lclntsh""... $ac_c" 1>&6 ++echo "configure:73289: checking for OCICollAssign in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCICollAssign | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lclntsh $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:73308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -75546,164 +73319,145 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQESCAPE 1 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCICOLLASSIGN 1 + EOF + ++ ++ + else + echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQunescapeBytea in -lpq""... $ac_c" 1>&6 +-echo "configure:75559: checking for PQunescapeBytea in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQunescapeBytea | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_clntsh_OCICollAssign ++ ++ + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQUNESCAPEBYTEA 1 +-EOF + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- echo $ac_n "checking for PQsetnonblocking in -lpq""... $ac_c" 1>&6 +-echo "configure:75602: checking for PQsetnonblocking in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQsetnonblocking | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQSETNONBLOCKING 1 +-EOF ++ fi ++ ;; ++ esac + +-else +- echo "$ac_t""no" 1>&6 +-fi + +- echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6 +-echo "configure:75645: checking for PQcmdTuples in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext </dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +-int main() { +-PQcmdTuples() +-; return 0; } +-EOF +-if { (eval echo configure:75664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQCMDTUPLES 1 +-EOF + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ fi ++ ++ fi + +- echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6 +-echo "configure:75688: checking for PQoidValue in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for OCIStmtFetch2 in -lclntsh""... $ac_c" 1>&6 ++echo "configure:73442: checking for OCIStmtFetch2 in -lclntsh" >&5 ++ac_lib_var=`echo clntsh'_'OCIStmtFetch2 | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lclntsh $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:73461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -75718,250 +73472,7167 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQOIDVALUE 1 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_OCISTMTFETCH2 1 + EOF + ++ ++ + else + echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6 +-echo "configure:75731: checking for PQclientEncoding in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_clntsh_OCIStmtFetch2 ++ ++ + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQCLIENTENCODING 1 +-EOF + ++ ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:73500: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- echo "$ac_t""no" 1>&6 ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:73506: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ + fi + +- echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 +-echo "configure:75774: checking for PQparameterStatus in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ fi + +-int main() { +-PQparameterStatus() +-; return 0; } +-EOF +-if { (eval echo configure:75793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPARAMETERSTATUS 1 ++ ++ ext_builddir=ext/pdo_oci ++ ext_srcdir=$abs_srcdir/ext/pdo_oci ++ ++ ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PDO_OCI_SHARED=no ++ ++ ++ case ext/pdo_oci in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_oci"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_oci/"; ac_bdir="ext/pdo_oci/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pdo_oci.c oci_driver.c oci_statement.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<&6 +-fi + +- echo $ac_n "checking for PQprotocolVersion in -lpq""... $ac_c" 1>&6 +-echo "configure:75817: checking for PQprotocolVersion in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQprotocolVersion | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ done ++ ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppdo_oci.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) $(PHPPDO_OCI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppdo_oci.so '$ext_builddir'/phppdo_oci.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPDO_OCI, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdo_oci) $(PHPPDO_OCI_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppdo_oci.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdo_oci.$suffix" ++ fi ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdo_oci" ++ ++ cat >>Makefile.objects<&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPROTOCOLVERSION 1 + EOF + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ ;; ++ *) ++ ++ install_modules="install-modules" + +- echo $ac_n "checking for PQtransactionStatus in -lpq""... $ac_c" 1>&6 +-echo "configure:75860: checking for PQtransactionStatus in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQtransactionStatus | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PGTRANSACTIONSTATUS 1 ++ ;; ++ esac ++ cat >> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_oci, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ cat >> confdefs.h <&6 + fi + +- echo $ac_n "checking for PQexecParams in -lpq""... $ac_c" 1>&6 +-echo "configure:75903: checking for PQexecParams in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQexecParams | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ ++ ++ ++ ++ ++php_with_pdo_odbc=no ++ ++echo $ac_n "checking for ODBC v3 support for PDO""... $ac_c" 1>&6 ++echo "configure:73874: checking for ODBC v3 support for PDO" >&5 ++# Check whether --with-pdo-odbc or --without-pdo-odbc was given. ++if test "${with_pdo_odbc+set}" = set; then ++ withval="$with_pdo_odbc" ++ PHP_PDO_ODBC=$withval + else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PDO_ODBC in ++shared,*) ++ PHP_PDO_ODBC=`echo "$PHP_PDO_ODBC"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PDO_ODBC=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++ ++ ++ ++if test "$PHP_PDO_ODBC" != "no"; then ++ ++ if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } ++ fi ++ ++ ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:73926: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:73932: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQEXECPARAMS 1 +-EOF ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ fi ++ ++ ++ ++ echo $ac_n "checking for selected PDO ODBC flavour""... $ac_c" 1>&6 ++echo "configure:73953: checking for selected PDO ODBC flavour" >&5 ++ ++ pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`" ++ pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`" ++ ++ if test "$pdo_odbc_dir" = "$PHP_PDO_ODBC" ; then ++ pdo_odbc_dir= ++ fi ++ ++ case $pdo_odbc_flavour in ++ ibm-db2) ++ pdo_odbc_def_libdir=/home/db2inst1/sqllib/lib ++ pdo_odbc_def_incdir=/home/db2inst1/sqllib/include ++ pdo_odbc_def_lib=db2 ++ ;; ++ ++ iODBC|iodbc) ++ pdo_odbc_def_libdir=/usr/local/$PHP_LIBDIR ++ pdo_odbc_def_incdir=/usr/local/include ++ pdo_odbc_def_lib=iodbc ++ ;; ++ ++ unixODBC|unixodbc) ++ pdo_odbc_def_libdir=/usr/local/$PHP_LIBDIR ++ pdo_odbc_def_incdir=/usr/local/include ++ pdo_odbc_def_lib=odbc ++ ;; ++ ++ ODBCRouter|odbcrouter) ++ pdo_odbc_def_libdir=/usr/$PHP_LIBDIR ++ pdo_odbc_def_incdir=/usr/include ++ pdo_odbc_def_lib=odbcsdk ++ ;; ++ ++ generic) ++ pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`" ++ pdo_odbc_def_ldflags="`echo $PHP_PDO_ODBC | cut -d, -f4`" ++ pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f5`" ++ pdo_odbc_flavour="generic-$pdo_odbc_def_lib" ++ ;; ++ ++ *) ++ { echo "configure: error: Unknown ODBC flavour $pdo_odbc_flavour ++ include and lib dirs are looked for under 'dir'. ++ ++ 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic ++ If ',dir' part is omitted, default for the flavour ++ you have selected will used. e.g.: ++ ++ --with-pdo-odbc=unixODBC ++ ++ will check for unixODBC under /usr/local. You may attempt ++ to use an otherwise unsupported driver using the \"generic\" ++ flavour. The syntax for generic ODBC support is: ++ ++ --with-pdo-odbc=generic,dir,libname,ldflags,cflags ++ ++ When build as shared the extension filename is always pdo_odbc.so" 1>&2; exit 1; } ++ ;; ++ esac ++ ++ if test -n "$pdo_odbc_dir"; then ++ PDO_ODBC_INCDIR="$pdo_odbc_dir/include" ++ PDO_ODBC_LIBDIR="$pdo_odbc_dir/$PHP_LIBDIR" ++ else ++ PDO_ODBC_INCDIR="$pdo_odbc_def_incdir" ++ PDO_ODBC_LIBDIR="$pdo_odbc_def_libdir" ++ fi ++ ++ echo "$ac_t""$pdo_odbc_flavour ++ libs $PDO_ODBC_LIBDIR, ++ headers $PDO_ODBC_INCDIR" 1>&6 ++ ++ if test ! -d "$PDO_ODBC_LIBDIR" ; then ++ echo "configure: warning: library dir $PDO_ODBC_LIBDIR does not exist" 1>&2 ++ fi ++ ++ ++ echo $ac_n "checking for odbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74032: checking for odbc.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/odbc.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_ODBC_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for odbcsdk.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74046: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/odbcsdk.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_ODBCSDK_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for iodbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74060: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/iodbc.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_IODBC_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sqlunix.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74074: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sqlunix.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLUNIX_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sqltypes.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74088: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sqltypes.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLTYPES_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sqlucode.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74102: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sqlucode.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLUCODE_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74116: checking for sql.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sql.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQL_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for isql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74130: checking for isql.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/isql.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_ISQL_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74144: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sqlext.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLEXT_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for isqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74158: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/isqlext.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_ISQLEXT_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for udbcext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74172: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/udbcext.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_UDBCEXT_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for sqlcli1.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74186: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/sqlcli1.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLCLI1_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for LibraryManager.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74200: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/LibraryManager.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRARYMANAGER_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for cli0core.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74214: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/cli0core.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_CLI0CORE_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for cli0ext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74228: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/cli0ext.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_CLI0EXT_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for cli0cli.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74242: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/cli0cli.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_CLI0CLI_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for cli0defs.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74256: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/cli0defs.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_CLI0DEFS_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ echo $ac_n "checking for cli0env.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6 ++echo "configure:74270: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5 ++ if test -f "$PDO_ODBC_INCDIR/cli0env.h"; then ++ php_pdo_have_header=yes ++ cat >> confdefs.h <<\EOF ++#define HAVE_CLI0ENV_H 1 ++EOF ++ ++ echo "$ac_t""yes" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ if test "$php_pdo_have_header" != "yes"; then ++ { echo "configure: error: Cannot find header file(s) for pdo_odbc" 1>&2; exit 1; } ++ fi ++ ++ PDO_ODBC_INCLUDE="$pdo_odbc_def_cflags -I$PDO_ODBC_INCDIR -DPDO_ODBC_TYPE=\\\"$pdo_odbc_flavour\\\"" ++ PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags -L$PDO_ODBC_LIBDIR -l$pdo_odbc_def_lib" ++ ++ ++ for ac_i in $PDO_ODBC_LDFLAGS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ PDO_ODBC_SHARED_LIBADD="$PDO_ODBC_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_ODBC_SHARED_LIBADD="$PDO_ODBC_SHARED_LIBADD -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_ODBC_SHARED_LIBADD="-L$ai_p $PDO_ODBC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_ODBC_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_ODBC_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$PDO_ODBC_LDFLAGS" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for SQLBindCol in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 ++echo "configure:74476: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5 ++ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLBindCol | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$pdo_odbc_def_lib $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$PDO_ODBC_LDFLAGS" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for SQLAllocHandle in -l$pdo_odbc_def_lib""... $ac_c" 1>&6 ++echo "configure:74610: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5 ++ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLAllocHandle | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$pdo_odbc_def_lib $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$pdo_odbc_def_lib_SQLAllocHandle ++ ++ { echo "configure: error: ++Your ODBC library does not appear to be ODBC 3 compatible. ++You should consider using iODBC or unixODBC instead, and loading your ++libraries as a driver in that environment; it will emulate the ++functions required for PDO support. ++" 1>&2; exit 1; } ++ ++fi ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$pdo_odbc_def_lib_SQLBindCol ++ ++ { echo "configure: error: Your ODBC library does not exist or there was an error. Check config.log for more information" 1>&2; exit 1; } ++ ++ ++fi ++ ++ ++ ++ ext_builddir=ext/pdo_odbc ++ ext_srcdir=$abs_srcdir/ext/pdo_odbc ++ ++ ac_extra=`echo "-I$pdo_inc_path $PDO_ODBC_INCLUDE"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PDO_ODBC_SHARED=no ++ ++ ++ case ext/pdo_odbc in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_odbc/"; ac_bdir="ext/pdo_odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pdo_odbc.c odbc_driver.c odbc_stmt.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_odbc, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++fi ++ ++ ++ ++php_with_pdo_pgsql=no ++ ++echo $ac_n "checking for PostgreSQL support for PDO""... $ac_c" 1>&6 ++echo "configure:75003: checking for PostgreSQL support for PDO" >&5 ++# Check whether --with-pdo-pgsql or --without-pdo-pgsql was given. ++if test "${with_pdo_pgsql+set}" = set; then ++ withval="$with_pdo_pgsql" ++ PHP_PDO_PGSQL=$withval ++else ++ ++ PHP_PDO_PGSQL=no ++ test "$PHP_ENABLE_ALL" && PHP_PDO_PGSQL=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PDO_PGSQL in ++shared,*) ++ PHP_PDO_PGSQL=`echo "$PHP_PDO_PGSQL"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PDO_PGSQL=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PDO_PGSQL" != "no"; then ++ ++ if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } ++ fi ++ ++ ++ if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then ++ PGSQL_INCLUDE=$PGSQL_INCLUDE ++ else ++ ++ ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ PGSQL_INCLUDE="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ fi ++ ++ ++ echo $ac_n "checking for pg_config""... $ac_c" 1>&6 ++echo "configure:75062: checking for pg_config" >&5 ++ for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do ++ if test -x $i/pg_config; then ++ PG_CONFIG="$i/pg_config" ++ break; ++ fi ++ done ++ ++ if test -n "$PG_CONFIG"; then ++ echo "$ac_t""$PG_CONFIG" 1>&6 ++ PGSQL_INCLUDE=`$PG_CONFIG --includedir` ++ PGSQL_LIBDIR=`$PG_CONFIG --libdir` ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_CONFIG_H 1 ++EOF ++ ++ else ++ echo "$ac_t""not found" 1>&6 ++ if test "$PHP_PDO_PGSQL" = "yes"; then ++ PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" ++ else ++ PGSQL_SEARCH_PATHS=$PHP_PDO_PGSQL ++ fi ++ ++ for i in $PGSQL_SEARCH_PATHS; do ++ for j in include include/pgsql include/postgres include/postgresql ""; do ++ if test -r "$i/$j/libpq-fe.h"; then ++ PGSQL_INC_BASE=$i ++ PGSQL_INCLUDE=$i/$j ++ if test -r "$i/$j/pg_config.h"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_CONFIG_H 1 ++EOF ++ ++ fi ++ fi ++ done ++ ++ for j in $PHP_LIBDIR $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do ++ if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then ++ PGSQL_LIBDIR=$i/$j ++ fi ++ done ++ done ++ fi ++ ++ if test -z "$PGSQL_INCLUDE"; then ++ { echo "configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } ++ fi ++ ++ if test -z "$PGSQL_LIBDIR"; then ++ { echo "configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } ++ fi ++ ++ if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then ++ { echo "configure: error: Unable to find libpq anywhere under $PGSQL_SEARCH_PATHS" 1>&2; exit 1; } ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_PDO_PGSQL 1 ++EOF ++ ++ ++ echo $ac_n "checking for openssl dependencies""... $ac_c" 1>&6 ++echo "configure:75126: checking for openssl dependencies" >&5 ++ if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then ++ echo "$ac_t""yes" 1>&6 ++ # Extract the first word of "pkg-config", so it can be a program name with args. ++set dummy pkg-config; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:75132: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ case "$PKG_CONFIG" in ++ /*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ ?:/*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. ++ ;; ++ *) ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ++ ;; ++esac ++fi ++PKG_CONFIG="$ac_cv_path_PKG_CONFIG" ++if test -n "$PKG_CONFIG"; then ++ echo "$ac_t""$PKG_CONFIG" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then ++ PDO_PGSQL_CFLAGS=`$PKG_CONFIG openssl --cflags` ++ fi ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ old_LIBS=$LIBS ++ old_LDFLAGS=$LDFLAGS ++ LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" ++ echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 ++echo "configure:75176: checking for PQparameterStatus in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPARAMETERSTATUS 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ echo "Unable to build the PDO PostgreSQL driver: libpq 7.4+ is required" ++ exit 1 ++ ++fi ++ ++ ++ echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 ++echo "configure:75224: checking for PQprepare in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPREPARE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 ++echo "configure:75267: checking for PQescapeStringConn in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQESCAPE_CONN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 ++echo "configure:75310: checking for PQescapeByteaConn in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQESCAPE_BYTEA_CONN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++ echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 ++echo "configure:75354: checking for pg_encoding_to_char in -lpq" >&5 ++ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++ ++ LIBS=$old_LIBS ++ LDFLAGS=$old_LDFLAGS ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_PGSQL_SHARED_LIBADD="-lpq $PDO_PGSQL_SHARED_LIBADD" ++ if test -n "$PGSQL_LIBDIR"; then ++ ++ if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_LIBDIR ++ else ++ ++ ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_PGSQL_SHARED_LIBADD="-L$ai_p $PDO_PGSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_PGSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_PGSQL_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$PGSQL_LIBDIR"; then ++ ++ if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_LIBDIR ++ else ++ ++ ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case pq in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lpq $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_PGSQL_SHARED_LIBADD" ++ ++ ++ ++ if test "$PGSQL_INCLUDE" != "/usr/include"; then ++ ++ if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_INCLUDE ++ else ++ ++ ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:75537: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:75543: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ ++fi ++ ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ fi ++ ++ ++ ++ ++ ext_builddir=ext/pdo_pgsql ++ ext_srcdir=$abs_srcdir/ext/pdo_pgsql ++ ++ ac_extra=`echo "-I$pdo_inc_path $PDO_PGSQL_CFLAGS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PDO_PGSQL_SHARED=no ++ ++ ++ case ext/pdo_pgsql in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_pgsql/"; ac_bdir="ext/pdo_pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pdo_pgsql.c pgsql_driver.c pgsql_statement.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_pgsql, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++fi ++ ++ ++ ++php_with_pdo_sqlite=$PHP_PDO ++ ++echo $ac_n "checking for sqlite 3 support for PDO""... $ac_c" 1>&6 ++echo "configure:75883: checking for sqlite 3 support for PDO" >&5 ++# Check whether --with-pdo-sqlite or --without-pdo-sqlite was given. ++if test "${with_pdo_sqlite+set}" = set; then ++ withval="$with_pdo_sqlite" ++ PHP_PDO_SQLITE=$withval ++else ++ ++ PHP_PDO_SQLITE=$PHP_PDO ++ test "$PHP_ENABLE_ALL" && PHP_PDO_SQLITE=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PDO_SQLITE in ++shared,*) ++ PHP_PDO_SQLITE=`echo "$PHP_PDO_SQLITE"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PDO_SQLITE=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PDO_SQLITE" != "no"; then ++ ++ if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: PDO is not enabled! Add --enable-pdo to your configure line." 1>&2; exit 1; } ++ fi ++ ++ ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:75932: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:75938: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ ++fi ++ ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++{ echo "configure: error: Cannot find php_pdo_driver.h." 1>&2; exit 1; } ++ fi ++ ++ ++ ++ php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" ++ ++ if test "$PHP_PDO_SQLITE" != "yes"; then ++ SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this ++ SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this ++ if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter ++ PDO_SQLITE_DIR=$PHP_PDO_SQLITE ++ else # search default path list ++ echo $ac_n "checking for sqlite3 files in default path""... $ac_c" 1>&6 ++echo "configure:75967: checking for sqlite3 files in default path" >&5 ++ for i in $SEARCH_PATH ; do ++ if test -r $i/$SEARCH_FOR; then ++ PDO_SQLITE_DIR=$i ++ echo "$ac_t""found in $i" 1>&6 ++ fi ++ done ++ fi ++ if test -z "$PDO_SQLITE_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Please reinstall the sqlite3 distribution" 1>&2; exit 1; } ++ fi ++ ++ ++ if test "$PDO_SQLITE_DIR/include" != "/usr/include"; then ++ ++ if test -z "$PDO_SQLITE_DIR/include" || echo "$PDO_SQLITE_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_SQLITE_DIR/include ++ else ++ ++ ep_dir="`echo $PDO_SQLITE_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/include\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ LIBNAME=sqlite3 ++ LIBSYMBOL=sqlite3_open ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6 ++echo "configure:76113: checking for $LIBSYMBOL in -l$LIBNAME" >&5 ++ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$LIBNAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_SQLITE_SHARED_LIBADD="-l$LIBNAME $PDO_SQLITE_SHARED_LIBADD" ++ if test -n "$PDO_SQLITE_DIR/$PHP_LIBDIR"; then ++ ++ if test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PDO_SQLITE_DIR/$PHP_LIBDIR" || echo "$PDO_SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_SQLITE_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PDO_SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PDO_SQLITE_SHARED_LIBADD="-L$ai_p $PDO_SQLITE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PDO_SQLITE_SHARED_LIBADD="$ld_runpath_switch$ai_p $PDO_SQLITE_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$PDO_SQLITE_DIR/$PHP_LIBDIR"; then ++ ++ if test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PDO_SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PDO_SQLITE_DIR/$PHP_LIBDIR" || echo "$PDO_SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PDO_SQLITE_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PDO_SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PDO_SQLITE_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case $LIBNAME in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-l$LIBNAME $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_PDO_SQLITELIB 1 ++EOF ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$LIBNAME_$LIBSYMBOL ++ ++ { echo "configure: error: wrong sqlite lib version or lib not found" 1>&2; exit 1; } ++ ++ ++fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for sqlite3_key in -lsqlite3""... $ac_c" 1>&6 ++echo "configure:76362: checking for sqlite3_key in -lsqlite3" >&5 ++ac_lib_var=`echo sqlite3'_'sqlite3_key | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsqlite3 $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_SQLITE3_KEY 1 ++EOF ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_sqlite3_sqlite3_key ++ ++ ++fi ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_SQLITE_SHARED_LIBADD" ++ ++ ++ ext_builddir=ext/pdo_sqlite ++ ext_srcdir=$abs_srcdir/ext/pdo_sqlite ++ ++ ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PDO_SQLITE_SHARED=no ++ ++ ++ case ext/pdo_sqlite in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pdo_sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pdo_sqlite/"; ac_bdir="ext/pdo_sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in $php_pdo_sqlite_sources_core; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_sqlite, which depends on extension sqlite3, ++but you've either not enabled sqlite3, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ if test "$abs_srcdir/ext/sqlite3/libsqlite" != "/usr/include"; then ++ ++ if test -z "$abs_srcdir/ext/sqlite3/libsqlite" || echo "$abs_srcdir/ext/sqlite3/libsqlite" | grep '^/' >/dev/null ; then ++ ai_p=$abs_srcdir/ext/sqlite3/libsqlite ++ else ++ ++ ep_dir="`echo $abs_srcdir/ext/sqlite3/libsqlite|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$abs_srcdir/ext/sqlite3/libsqlite\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ for ac_func in usleep nanosleep ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:77122: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:77150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ for ac_hdr in time.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:77178: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:77188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for fdatasync in -lrt""... $ac_c" 1>&6 ++echo "configure:77312: checking for fdatasync in -lrt" >&5 ++ac_lib_var=`echo rt'_'fdatasync | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lrt $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case rt in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ PDO_SQLITE_SHARED_LIBADD="-lrt $PDO_SQLITE_SHARED_LIBADD" ++ else ++ ++ ++ case rt in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lrt $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_rt_fdatasync ++ ++ ++fi ++ ++ ++ ++ ++ am_i_shared=$PHP_PDO_SQLITE_SHARED ++ is_it_shared=$PHP_PDO_SHARED ++ is_it_enabled=$PHP_PDO ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension pdo_sqlite to build statically, but it ++depends on extension pdo, which you've configured to build shared. ++You either need to build pdo_sqlite shared or build pdo statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension pdo_sqlite, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++fi ++ ++ ++ ++php_with_pgsql=no ++ ++echo $ac_n "checking for PostgreSQL support""... $ac_c" 1>&6 ++echo "configure:77412: checking for PostgreSQL support" >&5 ++# Check whether --with-pgsql or --without-pgsql was given. ++if test "${with_pgsql+set}" = set; then ++ withval="$with_pgsql" ++ PHP_PGSQL=$withval ++else ++ ++ PHP_PGSQL=no ++ test "$PHP_ENABLE_ALL" && PHP_PGSQL=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PGSQL in ++shared,*) ++ PHP_PGSQL=`echo "$PHP_PGSQL"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PGSQL=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PGSQL" != "no"; then ++ ++ if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then ++ PGSQL_INCLUDE=$PGSQL_INCLUDE ++ else ++ ++ ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ PGSQL_INCLUDE="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ fi ++ ++ ++ echo $ac_n "checking for pg_config""... $ac_c" 1>&6 ++echo "configure:77466: checking for pg_config" >&5 ++ for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do ++ if test -x $i/pg_config; then ++ PG_CONFIG="$i/pg_config" ++ break; ++ fi ++ done ++ ++ if test -n "$PG_CONFIG"; then ++ echo "$ac_t""$PG_CONFIG" 1>&6 ++ PGSQL_INCLUDE=`$PG_CONFIG --includedir` ++ PGSQL_LIBDIR=`$PG_CONFIG --libdir` ++ if test -r "$PGSQL_INCLUDE/pg_config.h"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_CONFIG_H 1 ++EOF ++ ++ fi ++ else ++ echo "$ac_t""not found" 1>&6 ++ if test "$PHP_PGSQL" = "yes"; then ++ PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql" ++ else ++ PGSQL_SEARCH_PATHS=$PHP_PGSQL ++ fi ++ ++ for i in $PGSQL_SEARCH_PATHS; do ++ for j in include include/pgsql include/postgres include/postgresql ""; do ++ if test -r "$i/$j/libpq-fe.h"; then ++ PGSQL_INC_BASE=$i ++ PGSQL_INCLUDE=$i/$j ++ if test -r "$i/$j/pg_config.h"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_CONFIG_H 1 ++EOF ++ ++ fi ++ fi ++ done ++ ++ for j in lib $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do ++ if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then ++ PGSQL_LIBDIR=$i/$j ++ fi ++ done ++ done ++ fi ++ ++ if test -z "$PGSQL_INCLUDE"; then ++ { echo "configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } ++ fi ++ ++ if test -z "$PGSQL_LIBDIR"; then ++ { echo "configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" 1>&2; exit 1; } ++ fi ++ ++ if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then ++ { echo "configure: error: Unable to find libpq anywhere under $PGSQL_SEARCH_PATHS" 1>&2; exit 1; } ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_PGSQL 1 ++EOF ++ ++ old_LIBS=$LIBS ++ old_LDFLAGS=$LDFLAGS ++ LDFLAGS="-L$PGSQL_LIBDIR $LDFLAGS" ++ echo $ac_n "checking for PQescapeString in -lpq""... $ac_c" 1>&6 ++echo "configure:77534: checking for PQescapeString in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQescapeString | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQESCAPE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQunescapeBytea in -lpq""... $ac_c" 1>&6 ++echo "configure:77577: checking for PQunescapeBytea in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQunescapeBytea | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQUNESCAPEBYTEA 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQsetnonblocking in -lpq""... $ac_c" 1>&6 ++echo "configure:77620: checking for PQsetnonblocking in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQsetnonblocking | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQSETNONBLOCKING 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6 ++echo "configure:77663: checking for PQcmdTuples in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQCMDTUPLES 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6 ++echo "configure:77706: checking for PQoidValue in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQOIDVALUE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6 ++echo "configure:77749: checking for PQclientEncoding in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQCLIENTENCODING 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6 ++echo "configure:77792: checking for PQparameterStatus in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPARAMETERSTATUS 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQprotocolVersion in -lpq""... $ac_c" 1>&6 ++echo "configure:77835: checking for PQprotocolVersion in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQprotocolVersion | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPROTOCOLVERSION 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQtransactionStatus in -lpq""... $ac_c" 1>&6 ++echo "configure:77878: checking for PQtransactionStatus in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQtransactionStatus | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PGTRANSACTIONSTATUS 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQexecParams in -lpq""... $ac_c" 1>&6 ++echo "configure:77921: checking for PQexecParams in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQexecParams | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQEXECPARAMS 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 ++echo "configure:77964: checking for PQprepare in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPREPARE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQexecPrepared in -lpq""... $ac_c" 1>&6 ++echo "configure:78007: checking for PQexecPrepared in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQexecPrepared | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQEXECPREPARED 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQresultErrorField in -lpq""... $ac_c" 1>&6 ++echo "configure:78050: checking for PQresultErrorField in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQresultErrorField | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQRESULTERRORFIELD 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQsendQueryParams in -lpq""... $ac_c" 1>&6 ++echo "configure:78093: checking for PQsendQueryParams in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQsendQueryParams | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQSENDQUERYPARAMS 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQsendPrepare in -lpq""... $ac_c" 1>&6 ++echo "configure:78136: checking for PQsendPrepare in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQsendPrepare | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQSENDPREPARE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQsendQueryPrepared in -lpq""... $ac_c" 1>&6 ++echo "configure:78179: checking for PQsendQueryPrepared in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQsendQueryPrepared | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQSENDQUERYPREPARED 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQputCopyData in -lpq""... $ac_c" 1>&6 ++echo "configure:78222: checking for PQputCopyData in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQputCopyData | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPUTCOPYDATA 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQputCopyEnd in -lpq""... $ac_c" 1>&6 ++echo "configure:78265: checking for PQputCopyEnd in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQputCopyEnd | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQPUTCOPYEND 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQgetCopyData in -lpq""... $ac_c" 1>&6 ++echo "configure:78308: checking for PQgetCopyData in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQgetCopyData | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQGETCOPYDATA 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQfreemem in -lpq""... $ac_c" 1>&6 ++echo "configure:78351: checking for PQfreemem in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQfreemem | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQFREEMEM 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQsetErrorVerbosity in -lpq""... $ac_c" 1>&6 ++echo "configure:78394: checking for PQsetErrorVerbosity in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQsetErrorVerbosity | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQSETERRORVERBOSITY 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQftable in -lpq""... $ac_c" 1>&6 ++echo "configure:78437: checking for PQftable in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQftable | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQFTABLE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 ++echo "configure:78480: checking for PQescapeStringConn in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQESCAPE_CONN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 ++echo "configure:78523: checking for PQescapeByteaConn in -lpq" >&5 ++ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PQESCAPE_BYTEA_CONN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 ++echo "configure:78566: checking for pg_encoding_to_char in -lpq" >&5 ++ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for lo_create in -lpq""... $ac_c" 1>&6 ++echo "configure:78609: checking for lo_create in -lpq" >&5 ++ac_lib_var=`echo pq'_'lo_create | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_LO_CREATE 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ echo $ac_n "checking for lo_import_with_oid in -lpq""... $ac_c" 1>&6 ++echo "configure:78652: checking for lo_import_with_oid in -lpq" >&5 ++ac_lib_var=`echo pq'_'lo_import_with_oid | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lpq $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_PG_LO_IMPORT_WITH_OID 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ LIBS=$old_LIBS ++ LDFLAGS=$old_LDFLAGS ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PGSQL_SHARED_LIBADD="-lpq $PGSQL_SHARED_LIBADD" ++ if test -n "$PGSQL_LIBDIR"; then ++ ++ if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_LIBDIR ++ else ++ ++ ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PGSQL_SHARED_LIBADD="-L$ai_p $PGSQL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PGSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PGSQL_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$PGSQL_LIBDIR"; then ++ ++ if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_LIBDIR ++ else ++ ++ ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case pq in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lpq $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PGSQL_SHARED_LIBADD" ++ ++ ++ ++ if test "$PGSQL_INCLUDE" != "/usr/include"; then ++ ++ if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then ++ ai_p=$PGSQL_INCLUDE ++ else ++ ++ ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ ++ ext_builddir=ext/pgsql ++ ext_srcdir=$abs_srcdir/ext/pgsql ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PGSQL_SHARED=no ++ ++ ++ case ext/pgsql in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pgsql.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:79131: checking for phar archive support" >&5 ++# Check whether --enable-phar or --disable-phar was given. ++if test "${enable_phar+set}" = set; then ++ enableval="$enable_phar" ++ PHP_PHAR=$enableval ++else ++ ++ PHP_PHAR=yes ++ test "$PHP_ENABLE_ALL" && PHP_PHAR=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PHAR in ++shared,*) ++ PHP_PHAR=`echo "$PHP_PHAR"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PHAR=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PHAR" != "no"; then ++ ++ ext_builddir=ext/phar ++ ext_srcdir=$abs_srcdir/ext/phar ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PHAR_SHARED=no ++ ++ ++ case ext/phar in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/phar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/phar/"; ac_bdir="ext/phar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:79465: checking for phar openssl support" >&5 ++ if test "$PHP_HASH_SHARED" != "yes"; then ++ if test "$PHP_HASH" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define PHAR_HASH_OK 1 ++EOF ++ ++ fi ++ else ++ echo "configure: warning: Phar: sha256/sha512 signature support disabled if ext/hash is built shared" 1>&2 ++ fi ++ if test "$PHP_OPENSSL_SHARED" = "yes"; then ++ echo "$ac_t""no (shared openssl)" 1>&6 ++ else ++ if test "$PHP_OPENSSL" = "yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define PHAR_HAVE_OPENSSL 1 ++EOF ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ fi ++ ++ am_i_shared=$PHP_PHAR_SHARED ++ is_it_shared=$PHP_HASH_SHARED ++ is_it_enabled=$PHP_HASH ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension phar to build statically, but it ++depends on extension hash, which you've configured to build shared. ++You either need to build phar shared or build hash statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension phar, which depends on extension hash, ++but you've either not enabled hash, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ am_i_shared=$PHP_PHAR_SHARED ++ is_it_shared=$PHP_SPL_SHARED ++ is_it_enabled=$PHP_SPL ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension phar to build statically, but it ++depends on extension spl, which you've configured to build shared. ++You either need to build phar shared or build spl statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension phar, which depends on extension spl, ++but you've either not enabled spl, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ src=$ext_srcdir/Makefile.frag ++ ac_srcdir=$ext_srcdir ++ ac_builddir=$ext_builddir ++ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments ++ ++fi ++ ++ ++ ++php_enable_posix=yes ++ ++echo $ac_n "checking whether to enable POSIX-like functions""... $ac_c" 1>&6 ++echo "configure:79540: checking whether to enable POSIX-like functions" >&5 ++# Check whether --enable-posix or --disable-posix was given. ++if test "${enable_posix+set}" = set; then ++ enableval="$enable_posix" ++ PHP_POSIX=$enableval ++else ++ ++ PHP_POSIX=yes ++ test "$PHP_ENABLE_ALL" && PHP_POSIX=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_POSIX in ++shared,*) ++ PHP_POSIX=`echo "$PHP_POSIX"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_POSIX=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_POSIX" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_POSIX 1 ++EOF ++ ++ ++ ext_builddir=ext/posix ++ ext_srcdir=$abs_srcdir/ext/posix ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_POSIX_SHARED=no ++ ++ ++ case ext/posix in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in posix.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:79882: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:79892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ ++ for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:79922: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:79950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ ++ echo $ac_n "checking for working ttyname_r() implementation""... $ac_c" 1>&6 ++echo "configure:79976: checking for working ttyname_r() implementation" >&5 ++ if test "$cross_compiling" = yes; then ++ ++ echo "$ac_t""no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe" 1>&6 ++ ++else ++ cat > conftest.$ac_ext < ++ ++int main(int argc, char *argv[]) ++{ ++ char buf[64]; ++ ++ return ttyname_r(0, buf, 64) ? 1 : 0; ++} ++ ++EOF ++if { (eval echo configure:79996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_TTYNAME_R 1 ++EOF ++ ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ echo "$ac_t""no, posix_ttyname() will be thread-unsafe" 1>&6 ++ ++fi ++rm -fr conftest* ++fi ++ ++ ++ echo $ac_n "checking for utsname.domainname""... $ac_c" 1>&6 ++echo "configure:80018: checking for utsname.domainname" >&5 ++if eval "test \"`echo '$''{'ac_cv_have_utsname_domainname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ cat > conftest.$ac_ext < ++ ++int main() { ++ ++ return sizeof(((struct utsname *)0)->domainname); ++ ++; return 0; } ++EOF ++if { (eval echo configure:80036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ++ ac_cv_have_utsname_domainname=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ++ ac_cv_have_utsname_domainname=no ++ ++fi ++rm -f conftest* ++ ++fi ++ ++echo "$ac_t""$ac_cv_have_utsname_domainname" 1>&6 ++ if test "$ac_cv_have_utsname_domainname" = yes; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_UTSNAME_DOMAINNAME 1 ++EOF ++ ++ fi ++fi ++ ++ ++ ++php_with_pspell=no ++ ++echo $ac_n "checking for PSPELL support""... $ac_c" 1>&6 ++echo "configure:80067: checking for PSPELL support" >&5 ++# Check whether --with-pspell or --without-pspell was given. ++if test "${with_pspell+set}" = set; then ++ withval="$with_pspell" ++ PHP_PSPELL=$withval ++else ++ ++ PHP_PSPELL=no ++ test "$PHP_ENABLE_ALL" && PHP_PSPELL=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_PSPELL in ++shared,*) ++ PHP_PSPELL=`echo "$PHP_PSPELL"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_PSPELL=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_PSPELL" != "no"; then ++ ++ ext_builddir=ext/pspell ++ ext_srcdir=$abs_srcdir/ext/pspell ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_PSPELL_SHARED=no ++ ++ ++ case ext/pspell in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in pspell.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } ++ fi ++ ++ PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PSPELL_SHARED_LIBADD="-lpspell $PSPELL_SHARED_LIBADD" ++ if test -n "$PSPELL_LIBDIR"; then ++ ++ if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PSPELL_LIBDIR ++ else ++ ++ ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ PSPELL_SHARED_LIBADD="-L$ai_p $PSPELL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && PSPELL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PSPELL_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$PSPELL_LIBDIR"; then ++ ++ if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PSPELL_LIBDIR ++ else ++ ++ ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case pspell in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lpspell $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$PSPELL_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ fi ++ ++ fi + +- echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6 +-echo "configure:75946: checking for PQprepare in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for new_aspell_config in -laspell""... $ac_c" 1>&6 ++echo "configure:80617: checking for new_aspell_config in -laspell" >&5 ++ac_lib_var=`echo aspell'_'new_aspell_config | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-laspell $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:80636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -75976,250 +80647,316 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPREPARE 1 +-EOF ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ if test "$ext_shared" = "yes"; then ++ PSPELL_SHARED_LIBADD="-laspell $PSPELL_SHARED_LIBADD" ++ if test -n "$PSPELL_LIBDIR"; then ++ ++ if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PSPELL_LIBDIR ++ else ++ ++ ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ fi + +- echo $ac_n "checking for PQexecPrepared in -lpq""... $ac_c" 1>&6 +-echo "configure:75989: checking for PQexecPrepared in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQexecPrepared | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQEXECPREPARED 1 +-EOF ++ fi ++ ++ fi + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ fi ++ else ++ + +- echo $ac_n "checking for PQresultErrorField in -lpq""... $ac_c" 1>&6 +-echo "configure:76032: checking for PQresultErrorField in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQresultErrorField | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext </dev/null ; then ++ ai_p=$PSPELL_LIBDIR ++ else ++ ++ ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ fi + +-int main() { +-PQresultErrorField() +-; return 0; } +-EOF +-if { (eval echo configure:76051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQRESULTERRORFIELD 1 +-EOF + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ ++ fi + +- echo $ac_n "checking for PQsendQueryParams in -lpq""... $ac_c" 1>&6 +-echo "configure:76075: checking for PQsendQueryParams in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQsendQueryParams | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQSENDQUERYPARAMS 1 +-EOF + ++ ++ fi ++ ++ ++ ++ + else + echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_aspell_new_aspell_config ++ ++ + fi + +- echo $ac_n "checking for PQsendPrepare in -lpq""... $ac_c" 1>&6 +-echo "configure:76118: checking for PQsendPrepare in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQsendPrepare | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext </dev/null ; then ++ ai_p=$PSPELL_INCDIR ++ else ++ ++ ep_dir="`echo $PSPELL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PSPELL_INCDIR\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PSPELL_SHARED_LIBADD" ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_PSPELL 1 + EOF +-if { (eval echo configure:76137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQSENDPREPARE 1 +-EOF + ++ ++ ++php_with_libedit=no ++ ++echo $ac_n "checking for libedit readline replacement""... $ac_c" 1>&6 ++echo "configure:80810: checking for libedit readline replacement" >&5 ++# Check whether --with-libedit or --without-libedit was given. ++if test "${with_libedit+set}" = set; then ++ withval="$with_libedit" ++ PHP_LIBEDIT=$withval + else +- echo "$ac_t""no" 1>&6 ++ ++ PHP_LIBEDIT=no ++ test "$PHP_ENABLE_ALL" && PHP_LIBEDIT=$PHP_ENABLE_ALL ++ + fi + +- echo $ac_n "checking for PQsendQueryPrepared in -lpq""... $ac_c" 1>&6 +-echo "configure:76161: checking for PQsendQueryPrepared in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQsendQueryPrepared | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_LIBEDIT in ++shared,*) ++ PHP_LIBEDIT=`echo "$PHP_LIBEDIT"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_LIBEDIT=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_LIBEDIT" = "no"; then ++ ++php_with_readline=no ++ ++echo $ac_n "checking for readline support""... $ac_c" 1>&6 ++echo "configure:80855: checking for readline support" >&5 ++# Check whether --with-readline or --without-readline was given. ++if test "${with_readline+set}" = set; then ++ withval="$with_readline" ++ PHP_READLINE=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ ++ PHP_READLINE=no ++ test "$PHP_ENABLE_ALL" && PHP_READLINE=$PHP_ENABLE_ALL + + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQSENDQUERYPREPARED 1 +-EOF ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_READLINE in ++shared,*) ++ PHP_READLINE=`echo "$PHP_READLINE"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_READLINE=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ + + else +- echo "$ac_t""no" 1>&6 ++ php_with_readline=no + fi + +- echo $ac_n "checking for PQputCopyData in -lpq""... $ac_c" 1>&6 +-echo "configure:76204: checking for PQputCopyData in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQputCopyData | sed 'y%./+-%__p_%'` ++if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then ++ for i in $PHP_READLINE /usr/local /usr; do ++ test -f $i/include/readline/readline.h && READLINE_DIR=$i && break ++ done ++ ++ if test -z "$READLINE_DIR"; then ++ { echo "configure: error: Please reinstall readline - I cannot find readline.h" 1>&2; exit 1; } ++ fi ++ ++ ++ if test "$READLINE_DIR/include" != "/usr/include"; then ++ ++ if test -z "$READLINE_DIR/include" || echo "$READLINE_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$READLINE_DIR/include ++ else ++ ++ ep_dir="`echo $READLINE_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$READLINE_DIR/include\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ PHP_READLINE_LIBS="" ++ echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ++echo "configure:80941: checking for tgetent in -lncurses" >&5 ++ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lncurses $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:80960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76234,78 +80971,56 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPUTCOPYDATA 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQputCopyEnd in -lpq""... $ac_c" 1>&6 +-echo "configure:76247: checking for PQputCopyEnd in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQputCopyEnd | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQPUTCOPYEND 1 +-EOF ++ fi ++ ;; ++ esac ++ + ++ PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses" ++ + else + echo "$ac_t""no" 1>&6 +-fi + +- echo $ac_n "checking for PQgetCopyData in -lpq""... $ac_c" 1>&6 +-echo "configure:76290: checking for PQgetCopyData in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQgetCopyData | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ++echo "configure:81005: checking for tgetent in -ltermcap" >&5 ++ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-ltermcap $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76320,35 +81035,158 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQGETCOPYDATA 1 +-EOF ++ ++ ++ ++ case termcap in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD" ++ else ++ ++ ++ case termcap in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ltermcap $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac + ++ ++ PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap" ++ + else + echo "$ac_t""no" 1>&6 + fi + +- echo $ac_n "checking for PQfreemem in -lpq""... $ac_c" 1>&6 +-echo "configure:76333: checking for PQfreemem in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQfreemem | sed 'y%./+-%__p_%'` ++ ++fi ++ ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 ++echo "configure:81171: checking for readline in -lreadline" >&5 ++ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lreadline $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76363,35 +81201,240 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQFREEMEM 1 +-EOF ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ READLINE_SHARED_LIBADD="-lreadline $READLINE_SHARED_LIBADD" ++ if test -n "$READLINE_DIR/$PHP_LIBDIR"; then ++ ++ if test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$READLINE_DIR/$PHP_LIBDIR" || echo "$READLINE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$READLINE_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $READLINE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$READLINE_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ READLINE_SHARED_LIBADD="-L$ai_p $READLINE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p $READLINE_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$READLINE_DIR/$PHP_LIBDIR"; then ++ ++ if test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$READLINE_DIR/$PHP_LIBDIR" || echo "$READLINE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$READLINE_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $READLINE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$READLINE_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case readline in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lreadline $LIBS" ++ ;; ++ esac ++ ++ ++ + ++ fi ++ ++ ++ ++ + else + echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_readline_readline ++ ++ { echo "configure: error: readline library not found" 1>&2; exit 1; } ++ ++ + fi + +- echo $ac_n "checking for PQsetErrorVerbosity in -lpq""... $ac_c" 1>&6 +-echo "configure:76376: checking for PQsetErrorVerbosity in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQsetErrorVerbosity | sed 'y%./+-%__p_%'` ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for rl_pending_input in -lreadline""... $ac_c" 1>&6 ++echo "configure:81419: checking for rl_pending_input in -lreadline" >&5 ++ac_lib_var=`echo readline'_'rl_pending_input | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lreadline $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76406,35 +81449,142 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQSETERRORVERBOSITY 1 +-EOF +- ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ + else + echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_readline_rl_pending_input ++ ++ { echo "configure: error: invalid readline installation detected. Try --with-libedit instead." 1>&2; exit 1; } ++ ++ + fi + +- echo $ac_n "checking for PQftable in -lpq""... $ac_c" 1>&6 +-echo "configure:76419: checking for PQftable in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQftable | sed 'y%./+-%__p_%'` ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for rl_callback_read_char in -lreadline""... $ac_c" 1>&6 ++echo "configure:81569: checking for rl_callback_read_char in -lreadline" >&5 ++ac_lib_var=`echo readline'_'rl_callback_read_char | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lreadline $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76449,121 +81599,95 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQFTABLE 1 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_RL_CALLBACK_READ_CHAR 1 + EOF + ++ ++ + else + echo "$ac_t""no" 1>&6 +-fi +- +- echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6 +-echo "configure:76462: checking for PQescapeStringConn in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_readline_rl_callback_read_char ++ ++ + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ + cat >> confdefs.h <<\EOF +-#define HAVE_PQESCAPE_CONN 1 ++#define HAVE_LIBREADLINE 1 + EOF + +-else +- echo "$ac_t""no" 1>&6 +-fi + +- echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6 +-echo "configure:76505: checking for PQescapeByteaConn in -lpq" >&5 +-ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ for i in $PHP_LIBEDIT /usr/local /usr; do ++ test -f $i/include/editline/readline.h && LIBEDIT_DIR=$i && break ++ done + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PQESCAPE_BYTEA_CONN 1 +-EOF ++ if test -z "$LIBEDIT_DIR"; then ++ { echo "configure: error: Please reinstall libedit - I cannot find readline.h" 1>&2; exit 1; } ++ fi + +-else +- echo "$ac_t""no" 1>&6 +-fi ++ ++ if test "$LIBEDIT_DIR/include" != "/usr/include"; then ++ ++ if test -z "$LIBEDIT_DIR/include" || echo "$LIBEDIT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEDIT_DIR/include ++ else ++ ++ ep_dir="`echo $LIBEDIT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/include\"`" ++ fi + +- echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6 +-echo "configure:76548: checking for pg_encoding_to_char in -lpq" >&5 +-ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'` ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 ++echo "configure:81672: checking for tgetent in -lncurses" >&5 ++ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-lncurses $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76578,35 +81702,55 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT 1 +-EOF ++ ++ ++ ++ case ncurses in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ READLINE_SHARED_LIBADD="-lncurses $READLINE_SHARED_LIBADD" ++ else ++ ++ ++ case ncurses in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lncurses $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ + ++ + else + echo "$ac_t""no" 1>&6 +-fi + +- echo $ac_n "checking for lo_create in -lpq""... $ac_c" 1>&6 +-echo "configure:76591: checking for lo_create in -lpq" >&5 +-ac_lib_var=`echo pq'_'lo_create | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ++echo "configure:81735: checking for tgetent in -ltermcap" >&5 ++ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-ltermcap $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76621,35 +81765,157 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_LO_CREATE 1 +-EOF ++ ++ ++ ++ case termcap in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD" ++ else ++ ++ ++ case termcap in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ltermcap $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ + ++ + else + echo "$ac_t""no" 1>&6 + fi + +- echo $ac_n "checking for lo_import_with_oid in -lpq""... $ac_c" 1>&6 +-echo "configure:76634: checking for lo_import_with_oid in -lpq" >&5 +-ac_lib_var=`echo pq'_'lo_import_with_oid | sed 'y%./+-%__p_%'` ++ ++fi ++ ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$READLINE_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for readline in -ledit""... $ac_c" 1>&6 ++echo "configure:81900: checking for readline in -ledit" >&5 ++ac_lib_var=`echo edit'_'readline | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lpq $LIBS" ++LIBS="-ledit $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:81919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -76664,39 +81930,32 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_PG_LO_IMPORT_WITH_OID 1 +-EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- LIBS=$old_LIBS +- LDFLAGS=$old_LDFLAGS +- + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ + + if test "$ext_shared" = "yes"; then +- PGSQL_SHARED_LIBADD="-lpq $PGSQL_SHARED_LIBADD" +- if test -n "$PGSQL_LIBDIR"; then ++ READLINE_SHARED_LIBADD="-ledit $READLINE_SHARED_LIBADD" ++ if test -n "$LIBEDIT_DIR/$PHP_LIBDIR"; then + +- if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ if test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_LIBDIR ++ if test -z "$LIBEDIT_DIR/$PHP_LIBDIR" || echo "$LIBEDIT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEDIT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $LIBEDIT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- PGSQL_SHARED_LIBADD="-L$ai_p $PGSQL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PGSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PGSQL_SHARED_LIBADD" ++ READLINE_SHARED_LIBADD="-L$ai_p $READLINE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p $READLINE_SHARED_LIBADD" + else + + +@@ -76722,18 +81981,18 @@ fi + else + + +- if test -n "$PGSQL_LIBDIR"; then ++ if test -n "$LIBEDIT_DIR/$PHP_LIBDIR"; then + +- if test "$PGSQL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PGSQL_LIBDIR" != "/usr/lib"; then ++ if test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_LIBDIR ++ if test -z "$LIBEDIT_DIR/$PHP_LIBDIR" || echo "$LIBEDIT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$LIBEDIT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PGSQL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $LIBEDIT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -76759,10 +82018,10 @@ fi + fi + + +- case pq in ++ case edit in + c|c_r|pthread*) ;; + *) +- LIBS="-lpq $LIBS" ++ LIBS="-ledit $LIBS" + ;; + esac + +@@ -76771,57 +82030,98 @@ fi + + fi + +- + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PGSQL_SHARED_LIBADD" +- +- + +- if test "$PGSQL_INCLUDE" != "/usr/include"; then +- +- if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then +- ai_p=$PGSQL_INCLUDE +- else +- +- ep_dir="`echo $PGSQL_INCLUDE|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`" +- fi ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_edit_readline + ++ { echo "configure: error: edit library required by readline not found" 1>&2; exit 1; } + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++fi + +- fi + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBEDIT 1 ++EOF ++ ++fi ++ ++if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then ++ for ac_func in rl_completion_matches ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:82060: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:82088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done + + +- ext_builddir=ext/pgsql +- ext_srcdir=$abs_srcdir/ext/pgsql ++ ext_builddir=ext/readline ++ ext_srcdir=$abs_srcdir/ext/readline + + ac_extra= + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PGSQL_SHARED=no ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then ++ PHP_READLINE_SHARED=no + + +- case ext/pgsql in ++ case ext/readline in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -76836,7 +82136,7 @@ fi + + + old_IFS=$IFS +- for ac_src in pgsql.c; do ++ for ac_src in readline.c; do + + IFS=. + set $ac_src +@@ -76859,18 +82159,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC pgsql" ++ EXT_STATIC="$EXT_STATIC readline" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC pgsql" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC readline" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PGSQL_SHARED=yes ++ PHP_READLINE_SHARED=yes + +- case ext/pgsql in ++ case ext/readline in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -76885,14 +82185,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in pgsql.c; do ++ for ac_src in readline.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_pgsql="$shared_objects_pgsql $ac_bdir$ac_obj.lo" ++ shared_objects_readline="$shared_objects_readline $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -76915,31 +82215,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppgsql.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PHPPGSQL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppgsql.so '$ext_builddir'/phppgsql.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpreadline.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpreadline.so '$ext_builddir'/phpreadline.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPGSQL, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPREADLINE, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PHPPGSQL_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppgsql.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpreadline.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppgsql.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreadline.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pgsql" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline" + +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <&6 +-echo "configure:77113: checking for phar archive support" >&5 +-# Check whether --enable-phar or --disable-phar was given. +-if test "${enable_phar+set}" = set; then +- enableval="$enable_phar" +- PHP_PHAR=$enableval ++echo $ac_n "checking for recode support""... $ac_c" 1>&6 ++echo "configure:82414: checking for recode support" >&5 ++# Check whether --with-recode or --without-recode was given. ++if test "${with_recode+set}" = set; then ++ withval="$with_recode" ++ PHP_RECODE=$withval + else + +- PHP_PHAR=yes +- test "$PHP_ENABLE_ALL" && PHP_PHAR=$PHP_ENABLE_ALL ++ PHP_RECODE=no ++ test "$PHP_ENABLE_ALL" && PHP_RECODE=$PHP_ENABLE_ALL + + fi + +@@ -77125,12 +82426,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_PHAR in ++case $PHP_RECODE in + shared,*) +- PHP_PHAR=`echo "$PHP_PHAR"|$SED 's/^shared,//'` ++ PHP_RECODE=`echo "$PHP_RECODE"|$SED 's/^shared,//'` + ;; + shared) +- PHP_PHAR=yes ++ PHP_RECODE=yes + ;; + no) + ext_output=no +@@ -77149,21 +82450,503 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_PHAR" != "no"; then ++if test "$PHP_RECODE" != "no"; then ++ RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" ++ ++ for i in $RECODE_LIST; do ++ if test -f $i/include/recode.h; then ++ RECODE_DIR=$i ++ RECODE_INC=include ++ RECODE_LIB=$PHP_LIBDIR ++ fi ++ if test -f $i/include/recode/recode.h; then ++ RECODE_DIR=$i ++ RECODE_INC=include/recode ++ RECODE_LIB=$PHP_LIBDIR/recode ++ fi ++ if test -f $i/recode/include/recode.h; then ++ RECODE_DIR=$i/recode ++ RECODE_INC=include ++ RECODE_LIB=$PHP_LIBDIR ++ fi ++ test -n "$RECODE_DIR" && break ++ done ++ ++ if test -z "$RECODE_DIR"; then ++ { echo "configure: error: Can not find recode.h anywhere under $RECODE_LIST." 1>&2; exit 1; } ++ fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$RECODE_DIR/$RECODE_LIB ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for recode_format_table in -lrecode""... $ac_c" 1>&6 ++echo "configure:82578: checking for recode_format_table in -lrecode" >&5 ++ac_lib_var=`echo recode'_'recode_format_table | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lrecode $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD" ++ if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ ++ if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then ++ ai_p=$RECODE_DIR/$RECODE_LIB ++ else ++ ++ ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ RECODE_SHARED_LIBADD="-L$ai_p $RECODE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p $RECODE_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ ++ if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then ++ ai_p=$RECODE_DIR/$RECODE_LIB ++ else ++ ++ ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case recode in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lrecode $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_recode_recode_format_table ++ ++ old_LDFLAGS=$LDFLAGS ++ old_LIBS=$LIBS ++ LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" ++ LIBS="$LIBS -lrecode" ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD" ++ if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ ++ if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then ++ ai_p=$RECODE_DIR/$RECODE_LIB ++ else ++ ++ ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ RECODE_SHARED_LIBADD="-L$ai_p $RECODE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p $RECODE_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ ++ if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then ++ ai_p=$RECODE_DIR/$RECODE_LIB ++ else ++ ++ ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ ++ fi ++ ++ fi ++ ++ ++ case recode in ++ c|c_r|pthread*) ;; ++ *) ++ DLIBS="-lrecode $DLIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_BROKEN_RECODE 1 ++EOF ++ ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ++ { echo "configure: error: I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?" 1>&2; exit 1; } ++ ++fi ++rm -f conftest* ++ LIBS=$old_LIBS ++ LDFLAGS=$old_LDFLAGS ++ ++ ++fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRECODE 1 ++EOF ++ ++ ++ if test "$RECODE_DIR/$RECODE_INC" != "/usr/include"; then ++ ++ if test -z "$RECODE_DIR/$RECODE_INC" || echo "$RECODE_DIR/$RECODE_INC" | grep '^/' >/dev/null ; then ++ ai_p=$RECODE_DIR/$RECODE_INC ++ else ++ ++ ep_dir="`echo $RECODE_DIR/$RECODE_INC|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_INC\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST RECODE_SHARED_LIBADD" ++ ++ for ac_hdr in stdbool.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:82901: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:82911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ + +- ext_builddir=ext/phar +- ext_srcdir=$abs_srcdir/ext/phar ++ ext_builddir=ext/recode ++ ext_srcdir=$abs_srcdir/ext/recode + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PHAR_SHARED=no ++ PHP_RECODE_SHARED=no + + +- case ext/phar in ++ case ext/recode in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/phar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/phar/"; ac_bdir="ext/phar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -77178,7 +82961,7 @@ if test "$PHP_PHAR" != "no"; then + + + old_IFS=$IFS +- for ac_src in util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c; do ++ for ac_src in recode.c; do + + IFS=. + set $ac_src +@@ -77201,18 +82984,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC phar" ++ EXT_STATIC="$EXT_STATIC recode" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC phar" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC recode" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PHAR_SHARED=yes ++ PHP_RECODE_SHARED=yes + +- case ext/phar in ++ case ext/recode in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/phar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/phar/"; ac_bdir="ext/phar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -77227,14 +83010,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c; do ++ for ac_src in recode.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_phar="$shared_objects_phar $ac_bdir$ac_obj.lo" ++ shared_objects_recode="$shared_objects_recode $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -77257,31 +83040,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpphar.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_phar) $(PHPPHAR_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpphar.so '$ext_builddir'/phpphar.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phprecode.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phprecode.so '$ext_builddir'/phprecode.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_phar) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPHAR, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPRECODE, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_phar) $(PHPPHAR_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpphar.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phprecode.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpphar.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phprecode.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_phar" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_recode" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 +-echo "configure:77447: checking for phar openssl support" >&5 +- if test "$PHP_HASH_SHARED" != "yes"; then +- if test "$PHP_HASH" != "no"; then +- cat >> confdefs.h <<\EOF +-#define PHAR_HASH_OK 1 +-EOF +- +- fi +- else +- echo "configure: warning: Phar: sha256/sha512 signature support disabled if ext/hash is built shared" 1>&2 +- fi +- if test "$PHP_OPENSSL_SHARED" = "yes"; then +- echo "$ac_t""no (shared openssl)" 1>&6 +- else +- if test "$PHP_OPENSSL" = "yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define PHAR_HAVE_OPENSSL 1 +-EOF +- +- else +- echo "$ac_t""no" 1>&6 +- fi +- fi +- +- am_i_shared=$PHP_PHAR_SHARED +- is_it_shared=$PHP_HASH_SHARED +- is_it_enabled=$PHP_HASH +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension phar to build statically, but it +-depends on extension hash, which you've configured to build shared. +-You either need to build phar shared or build hash statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension phar, which depends on extension hash, +-but you've either not enabled hash, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- am_i_shared=$PHP_PHAR_SHARED +- is_it_shared=$PHP_SPL_SHARED +- is_it_enabled=$PHP_SPL +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension phar to build statically, but it +-depends on extension spl, which you've configured to build shared. +-You either need to build phar shared or build spl statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension phar, which depends on extension spl, +-but you've either not enabled spl, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- src=$ext_srcdir/Makefile.frag +- ac_srcdir=$ext_srcdir +- ac_builddir=$ext_builddir +- test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments +- +-fi +- +- +- +-php_enable_posix=yes +- +-echo $ac_n "checking whether to enable POSIX-like functions""... $ac_c" 1>&6 +-echo "configure:77522: checking whether to enable POSIX-like functions" >&5 +-# Check whether --enable-posix or --disable-posix was given. +-if test "${enable_posix+set}" = set; then +- enableval="$enable_posix" +- PHP_POSIX=$enableval +-else +- +- PHP_POSIX=yes +- test "$PHP_ENABLE_ALL" && PHP_POSIX=$PHP_ENABLE_ALL +- + fi + + +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_POSIX in +-shared,*) +- PHP_POSIX=`echo "$PHP_POSIX"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_POSIX=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_POSIX" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_POSIX 1 ++cat >> confdefs.h <<\EOF ++#define HAVE_REFLECTION 1 + EOF + +- +- ext_builddir=ext/posix +- ext_srcdir=$abs_srcdir/ext/posix ++ ++ ext_builddir=ext/reflection ++ ext_srcdir=$abs_srcdir/ext/reflection + + ac_extra= + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_POSIX_SHARED=no ++ if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then ++ PHP_REFLECTION_SHARED=no + + +- case ext/posix in ++ case ext/reflection in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/reflection"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/reflection/"; ac_bdir="ext/reflection/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -77591,7 +83260,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in posix.c; do ++ for ac_src in php_reflection.c; do + + IFS=. + set $ac_src +@@ -77614,18 +83283,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC posix" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC posix" ++ EXT_STATIC="$EXT_STATIC reflection" ++ if test "no" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC reflection" + fi + else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_POSIX_SHARED=yes ++ if test "no" = "shared" || test "no" = "yes"; then ++ PHP_REFLECTION_SHARED=yes + +- case ext/posix in ++ case ext/reflection in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/reflection"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/reflection/"; ac_bdir="ext/reflection/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -77640,14 +83309,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in posix.c; do ++ for ac_src in php_reflection.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_posix="$shared_objects_posix $ac_bdir$ac_obj.lo" ++ shared_objects_reflection="$shared_objects_reflection $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -77670,31 +83339,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpposix.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) $(PHPPOSIX_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpposix.so '$ext_builddir'/phpposix.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpreflection.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) $(PHPREFLECTION_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpreflection.so '$ext_builddir'/phpreflection.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPOSIX, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPREFLECTION, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) $(PHPPOSIX_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) $(PHPREFLECTION_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpposix.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpreflection.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpposix.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreflection.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_posix" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_reflection" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 +-echo "configure:77864: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:77874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" ++ ++ ++php_enable_session=yes ++ ++echo $ac_n "checking whether to enable PHP sessions""... $ac_c" 1>&6 ++echo "configure:83534: checking whether to enable PHP sessions" >&5 ++# Check whether --enable-session or --disable-session was given. ++if test "${enable_session+set}" = set; then ++ enableval="$enable_session" ++ PHP_SESSION=$enableval + else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* ++ ++ PHP_SESSION=yes ++ test "$PHP_ENABLE_ALL" && PHP_SESSION=$PHP_ENABLE_ALL ++ + fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 ++ ++ ++ ++ ++ ++php_with_mm=no ++ ++echo $ac_n "checking for mm support""... $ac_c" 1>&6 ++echo "configure:83578: checking for mm support" >&5 ++# Check whether --with-mm or --without-mm was given. ++if test "${with_mm+set}" = set; then ++ withval="$with_mm" ++ PHP_MM=$withval + else +- echo "$ac_t""no" 1>&6 ++ ++ PHP_MM=no ++ ++ + fi +-done + + +- for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:77904: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ext_output=$PHP_MM ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_SESSION" != "no"; then ++ ++ echo $ac_n "checking whether pwrite works""... $ac_c" 1>&6 ++echo "configure:83600: checking whether pwrite works" >&5 ++if eval "test \"`echo '$''{'ac_cv_pwrite'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else ++ ++ ++ if test "$cross_compiling" = yes; then ++ ++ ac_cv_pwrite=no ++ ++else + cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); + +-int main() { ++#include ++#include ++#include ++#include ++#include + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++ main() { ++ int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); + +-; return 0; } +-EOF +-if { (eval echo configure:77932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi ++ if (fd < 0) exit(1); ++ if (pwrite(fd, "text", 4, 0) != 4) exit(1); ++ /* Linux glibc breakage until 2.2.5 */ ++ if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); ++ exit(0); ++ } + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_pwrite=yes ++ + else +- echo "$ac_t""no" 1>&6 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_pwrite=no ++ ++fi ++rm -fr conftest* + fi +-done + + +- echo $ac_n "checking for working ttyname_r() implementation""... $ac_c" 1>&6 +-echo "configure:77958: checking for working ttyname_r() implementation" >&5 ++ if test "$ac_cv_pwrite" = "no"; then ++ + if test "$cross_compiling" = yes; then + +- echo "$ac_t""no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe" 1>&6 ++ ac_cv_pwrite=no + + else + cat > conftest.$ac_ext < ++#include ++#include + #include ++#include ++ssize_t pwrite(int, void *, size_t, off64_t); ++ main() { ++ int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); + +-int main(int argc, char *argv[]) +-{ +- char buf[64]; ++ if (fd < 0) exit(1); ++ if (pwrite(fd, "text", 4, 0) != 4) exit(1); ++ /* Linux glibc breakage until 2.2.5 */ ++ if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); ++ exit(0); ++ } + +- return ttyname_r(0, buf, 64) ? 1 : 0; +-} + + EOF +-if { (eval echo configure:77978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:83679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define HAVE_TTYNAME_R 1 +-EOF +- ++ ac_cv_pwrite=yes + + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + +- echo "$ac_t""no, posix_ttyname() will be thread-unsafe" 1>&6 ++ ac_cv_pwrite=no + + fi + rm -fr conftest* + fi + + +- echo $ac_n "checking for utsname.domainname""... $ac_c" 1>&6 +-echo "configure:78000: checking for utsname.domainname" >&5 +-if eval "test \"`echo '$''{'ac_cv_have_utsname_domainname'+set}'`\" = set"; then ++ if test "$ac_cv_pwrite" = "yes"; then ++ ac_cv_pwrite=64 ++ fi ++ fi ++ ++fi ++ ++echo "$ac_t""$ac_cv_pwrite" 1>&6 ++ ++ if test "$ac_cv_pwrite" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_PWRITE 1 ++EOF ++ ++ if test "$ac_cv_pwrite" = "64"; then ++ cat >> confdefs.h <<\EOF ++#define PHP_PWRITE_64 1 ++EOF ++ ++ fi ++ fi ++ ++ ++ echo $ac_n "checking whether pread works""... $ac_c" 1>&6 ++echo "configure:83720: checking whether pread works" >&5 ++if eval "test \"`echo '$''{'ac_cv_pread'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + +- cat > conftest.$ac_ext < conftest_in ++ if test "$cross_compiling" = yes; then ++ ++ ac_cv_pread=no ++ ++else ++ cat > conftest.$ac_ext < +- +-int main() { ++#include ++#include ++#include ++#include ++#include + +- return sizeof(((struct utsname *)0)->domainname); +- +-; return 0; } ++ main() { ++ char buf[3]; ++ int fd = open("conftest_in", O_RDONLY); ++ if (fd < 0) exit(1); ++ if (pread(fd, buf, 2, 0) != 2) exit(1); ++ /* Linux glibc breakage until 2.2.5 */ ++ if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); ++ exit(0); ++ } ++ + EOF +-if { (eval echo configure:78018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* ++if { (eval echo configure:83753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_pread=yes + +- ac_cv_have_utsname_domainname=yes +- + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -rf conftest* ++ rm -fr conftest* + +- ac_cv_have_utsname_domainname=no +- +-fi +-rm -f conftest* ++ ac_cv_pread=no + + fi +- +-echo "$ac_t""$ac_cv_have_utsname_domainname" 1>&6 +- if test "$ac_cv_have_utsname_domainname" = yes; then +- cat >> confdefs.h <<\EOF +-#define HAVE_UTSNAME_DOMAINNAME 1 +-EOF +- +- fi ++rm -fr conftest* + fi + ++ rm -f conftest_in + ++ if test "$ac_cv_pread" = "no"; then ++ ++ echo test > conftest_in ++ if test "$cross_compiling" = yes; then ++ ++ ac_cv_pread=no ++ ++else ++ cat > conftest.$ac_ext <&6 +-echo "configure:78049: checking for PSPELL support" >&5 +-# Check whether --with-pspell or --without-pspell was given. +-if test "${with_pspell+set}" = set; then +- withval="$with_pspell" +- PHP_PSPELL=$withval ++#include ++#include ++#include ++#include ++#include ++ssize_t pread(int, void *, size_t, off64_t); ++ main() { ++ char buf[3]; ++ int fd = open("conftest_in", O_RDONLY); ++ if (fd < 0) exit(1); ++ if (pread(fd, buf, 2, 0) != 2) exit(1); ++ /* Linux glibc breakage until 2.2.5 */ ++ if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); ++ exit(0); ++ } ++ ++EOF ++if { (eval echo configure:83800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_pread=yes ++ + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_pread=no + +- PHP_PSPELL=no +- test "$PHP_ENABLE_ALL" && PHP_PSPELL=$PHP_ENABLE_ALL +- ++fi ++rm -fr conftest* + fi + ++ rm -f conftest_in + ++ if test "$ac_cv_pread" = "yes"; then ++ ac_cv_pread=64 ++ fi ++ fi ++ ++fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_PSPELL in +-shared,*) +- PHP_PSPELL=`echo "$PHP_PSPELL"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_PSPELL=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 ++echo "$ac_t""$ac_cv_pread" 1>&6 + ++ if test "$ac_cv_pread" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_PREAD 1 ++EOF + ++ if test "$ac_cv_pread" = "64"; then ++ cat >> confdefs.h <<\EOF ++#define PHP_PREAD_64 1 ++EOF + ++ fi ++ fi + +-if test "$PHP_PSPELL" != "no"; then +- +- ext_builddir=ext/pspell +- ext_srcdir=$abs_srcdir/ext/pspell ++ ++ ext_builddir=ext/session ++ ext_srcdir=$abs_srcdir/ext/session + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_PSPELL_SHARED=no ++ PHP_SESSION_SHARED=no + + +- case ext/pspell in ++ case ext/session in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -78114,7 +83864,7 @@ if test "$PHP_PSPELL" != "no"; then + + + old_IFS=$IFS +- for ac_src in pspell.c; do ++ for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do + + IFS=. + set $ac_src +@@ -78137,18 +83887,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC pspell" ++ EXT_STATIC="$EXT_STATIC session" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC pspell" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC session" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_PSPELL_SHARED=yes ++ PHP_SESSION_SHARED=yes + +- case ext/pspell in ++ case ext/session in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -78163,14 +83913,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in pspell.c; do ++ for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_pspell="$shared_objects_pspell $ac_bdir$ac_obj.lo" ++ shared_objects_session="$shared_objects_session $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -78193,31 +83943,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phppspell.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PHPPSPELL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phppspell.so '$ext_builddir'/phppspell.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsession.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsession.so '$ext_builddir'/phpsession.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPPSPELL, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSESSION, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PHPPSPELL_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phppspell.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsession.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppspell.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsession.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pspell" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_session" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } +- fi +- +- PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR +- +- +- +- if test "$ext_shared" = "yes"; then +- PSPELL_SHARED_LIBADD="-lpspell $PSPELL_SHARED_LIBADD" +- if test -n "$PSPELL_LIBDIR"; then +- +- if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PSPELL_LIBDIR +- else +- +- ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- PSPELL_SHARED_LIBADD="-L$ai_p $PSPELL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PSPELL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PSPELL_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$PSPELL_LIBDIR"; then +- +- if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then +- +- if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PSPELL_LIBDIR +- else +- +- ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ am_i_shared=$PHP_SESSION_SHARED ++ is_it_shared=$PHP_HASH_SHARED ++ is_it_enabled=$PHP_HASH ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension session to build statically, but it ++depends on extension hash, which you've configured to build shared. ++You either need to build session shared or build hash statically for the ++build to be successful. ++" 1>&2; exit 1; } + fi +- +- +- +- fi +- ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension session, which depends on extension hash, ++but you've either not enabled hash, or have disabled it. ++" 1>&2; exit 1; } + fi + + +- case pspell in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lpspell $LIBS" +- ;; +- esac +- +- +- +- ++ am_i_shared=$PHP_SESSION_SHARED ++ is_it_shared=$PHP_SPL_SHARED ++ is_it_enabled=$PHP_SPL ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension session to build statically, but it ++depends on extension spl, which you've configured to build shared. ++You either need to build session shared or build spl statically for the ++build to be successful. ++" 1>&2; exit 1; } + fi +- +- +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$PSPELL_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension session, which depends on extension spl, ++but you've either not enabled spl, or have disabled it. ++" 1>&2; exit 1; } + fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++ PHP_VAR_SUBST="$PHP_VAR_SUBST SESSION_SHARED_LIBADD" + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- + + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ header_path=ext/session ++ for header_file in php_session.h mod_files.h mod_user.h; do ++ hp_hf="$header_path/$header_file" ++ + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` + +- fi +- +- +- fi ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" + ++ INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ++ + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for new_aspell_config in -laspell""... $ac_c" 1>&6 +-echo "configure:78599: checking for new_aspell_config in -laspell" >&5 +-ac_lib_var=`echo aspell'_'new_aspell_config | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-laspell $LIBS" +-cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_PHP_SESSION 1 + EOF +-if { (eval echo configure:78618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ ++if test "$PHP_MM" != "no"; then ++ for i in $PHP_MM /usr/local /usr; do ++ test -f "$i/include/mm.h" && MM_DIR=$i && break ++ done ++ ++ if test -z "$MM_DIR" ; then ++ { echo "configure: error: cannot find mm library" 1>&2; exit 1; } ++ fi ++ + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- + + if test "$ext_shared" = "yes"; then +- PSPELL_SHARED_LIBADD="-laspell $PSPELL_SHARED_LIBADD" +- if test -n "$PSPELL_LIBDIR"; then ++ SESSION_SHARED_LIBADD="-lmm $SESSION_SHARED_LIBADD" ++ if test -n "$MM_DIR/$PHP_LIBDIR"; then + +- if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then ++ if test "$MM_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MM_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PSPELL_LIBDIR ++ if test -z "$MM_DIR/$PHP_LIBDIR" || echo "$MM_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MM_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MM_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$MM_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- PSPELL_SHARED_LIBADD="-L$ai_p $PSPELL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && PSPELL_SHARED_LIBADD="$ld_runpath_switch$ai_p $PSPELL_SHARED_LIBADD" ++ SESSION_SHARED_LIBADD="-L$ai_p $SESSION_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SESSION_SHARED_LIBADD="$ld_runpath_switch$ai_p $SESSION_SHARED_LIBADD" + else + + +@@ -78680,18 +84251,18 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + else + + +- if test -n "$PSPELL_LIBDIR"; then ++ if test -n "$MM_DIR/$PHP_LIBDIR"; then + +- if test "$PSPELL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PSPELL_LIBDIR" != "/usr/lib"; then ++ if test "$MM_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MM_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PSPELL_LIBDIR ++ if test -z "$MM_DIR/$PHP_LIBDIR" || echo "$MM_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MM_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PSPELL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MM_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$MM_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -78717,10 +84288,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + +- case aspell in ++ case mm in + c|c_r|pthread*) ;; + *) +- LIBS="-laspell $LIBS" ++ LIBS="-lmm $LIBS" + ;; + esac + +@@ -78730,30 +84301,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_aspell_new_aspell_config +- + +-fi +- +- +- +- if test "$PSPELL_INCDIR" != "/usr/include"; then ++ if test "$MM_DIR/include" != "/usr/include"; then + +- if test -z "$PSPELL_INCDIR" || echo "$PSPELL_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$PSPELL_INCDIR ++ if test -z "$MM_DIR/include" || echo "$MM_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$MM_DIR/include + else + +- ep_dir="`echo $PSPELL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MM_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PSPELL_INCDIR\"`" ++ ai_p="$ep_realdir/`basename \"$MM_DIR/include\"`" + fi + + +@@ -78774,29 +84332,43 @@ fi + + fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PSPELL_SHARED_LIBADD" ++ ++ ++ for header_file in ext/session/mod_mm.h; do ++ ++ ++ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ++ ++ fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_PSPELL 1 ++ done ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBMM 1 + EOF + + fi + + ++php_enable_shmop=no + +-php_with_libedit=no +- +-echo $ac_n "checking for libedit readline replacement""... $ac_c" 1>&6 +-echo "configure:78792: checking for libedit readline replacement" >&5 +-# Check whether --with-libedit or --without-libedit was given. +-if test "${with_libedit+set}" = set; then +- withval="$with_libedit" +- PHP_LIBEDIT=$withval ++echo $ac_n "checking whether to enable shmop support""... $ac_c" 1>&6 ++echo "configure:84364: checking whether to enable shmop support" >&5 ++# Check whether --enable-shmop or --disable-shmop was given. ++if test "${enable_shmop+set}" = set; then ++ enableval="$enable_shmop" ++ PHP_SHMOP=$enableval + else + +- PHP_LIBEDIT=no +- test "$PHP_ENABLE_ALL" && PHP_LIBEDIT=$PHP_ENABLE_ALL ++ PHP_SHMOP=no ++ test "$PHP_ENABLE_ALL" && PHP_SHMOP=$PHP_ENABLE_ALL + + fi + +@@ -78804,12 +84376,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_LIBEDIT in ++case $PHP_SHMOP in + shared,*) +- PHP_LIBEDIT=`echo "$PHP_LIBEDIT"|$SED 's/^shared,//'` ++ PHP_SHMOP=`echo "$PHP_SHMOP"|$SED 's/^shared,//'` + ;; + shared) +- PHP_LIBEDIT=yes ++ PHP_SHMOP=yes + ;; + no) + ext_output=no +@@ -78828,243 +84400,416 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_LIBEDIT" = "no"; then ++if test "$PHP_SHMOP" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SHMOP 1 ++EOF ++ + +-php_with_readline=no ++ ext_builddir=ext/shmop ++ ext_srcdir=$abs_srcdir/ext/shmop + +-echo $ac_n "checking for readline support""... $ac_c" 1>&6 +-echo "configure:78837: checking for readline support" >&5 +-# Check whether --with-readline or --without-readline was given. +-if test "${with_readline+set}" = set; then +- withval="$with_readline" +- PHP_READLINE=$withval +-else ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SHMOP_SHARED=no ++ ++ ++ case ext/shmop in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +- PHP_READLINE=no +- test "$PHP_ENABLE_ALL" && PHP_READLINE=$PHP_ENABLE_ALL + +-fi ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + + ++ old_IFS=$IFS ++ for ac_src in shmop.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_READLINE in +-shared,*) +- PHP_READLINE=`echo "$PHP_READLINE"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_READLINE=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ cat >>Makefile.objects<&6 ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + + ++ old_IFS=$IFS ++ for ac_src in shmop.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_shmop="$shared_objects_shmop $ac_bdir$ac_obj.lo" + +-else +- php_with_readline=no +-fi ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then +- for i in $PHP_READLINE /usr/local /usr; do +- test -f $i/include/readline/readline.h && READLINE_DIR=$i && break ++ cat >>Makefile.objects<&2; exit 1; } +- fi ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpshmop.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpshmop.so '$ext_builddir'/phpshmop.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSHMOP, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD)' ++ ;; ++ esac + ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpshmop.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpshmop.$suffix" ++ fi + +- if test "$READLINE_DIR/include" != "/usr/include"; then +- +- if test -z "$READLINE_DIR/include" || echo "$READLINE_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$READLINE_DIR/include ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_shmop" ++ ++ cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 +-echo "configure:78923: checking for tgetent in -lncurses" >&5 +-ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lncurses $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ done ++ ++ ++ EXT_STATIC="$EXT_STATIC shmop" ++ ;; ++ *) ++ ++ ++ case ext/shmop in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in shmop.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ cat >>Makefile.objects<&6 ++fi + +- echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 +-echo "configure:78987: checking for tgetent in -ltermcap" >&5 +-ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ltermcap $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++php_enable_simplexml=yes ++ ++echo $ac_n "checking whether to enable SimpleXML support""... $ac_c" 1>&6 ++echo "configure:84708: checking whether to enable SimpleXML support" >&5 ++# Check whether --enable-simplexml or --disable-simplexml was given. ++if test "${enable_simplexml+set}" = set; then ++ enableval="$enable_simplexml" ++ PHP_SIMPLEXML=$enableval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ ++ PHP_SIMPLEXML=yes ++ test "$PHP_ENABLE_ALL" && PHP_SIMPLEXML=$PHP_ENABLE_ALL + + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SIMPLEXML in ++shared,*) ++ PHP_SIMPLEXML=`echo "$PHP_SIMPLEXML"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SIMPLEXML=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test -z "$PHP_LIBXML_DIR"; then + +- ++php_with_libxml_dir=no ++ ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:84753: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else + +- case termcap in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD" +- else +- ++ PHP_LIBXML_DIR=no + +- case termcap in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ltermcap $LIBS" +- ;; +- esac + ++fi + +- fi +- ;; +- esac ++ ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 + + +- PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap" +- +-else +- echo "$ac_t""no" 1>&6 +-fi + +- + fi + ++if test "$PHP_SIMPLEXML" != "no"; then ++ ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: SimpleXML extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi + + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:84781: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- for ac_i in $ac_stuff; do ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break ++ fi ++ done ++ ++fi ++ ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 ++ ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` ++ ++ for ac_i in $LIBXML_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ SIMPLEXML_SHARED_LIBADD="$SIMPLEXML_SHARED_LIBADD -pthread" + else + + +@@ -79086,7 +84831,7 @@ fi + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ SIMPLEXML_SHARED_LIBADD="$SIMPLEXML_SHARED_LIBADD -l$ac_ii" + else + + +@@ -79121,8 +84866,8 @@ fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ SIMPLEXML_SHARED_LIBADD="-L$ai_p $SIMPLEXML_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SIMPLEXML_SHARED_LIBADD="$ld_runpath_switch$ai_p $SIMPLEXML_SHARED_LIBADD" + else + + +@@ -79148,486 +84893,608 @@ fi + esac + done + +- echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +-echo "configure:79153: checking for readline in -lreadline" >&5 +-ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ ++ for ac_i in $LIBXML_INCS; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 ++echo "configure:84939: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-lreadline $LIBS" +-cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++if { (eval echo configure:84966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes ++ ++ + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ rm -fr conftest* ++ ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ ++ ++fi ++rm -fr conftest* + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + ++ ++ + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- + +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-lreadline $READLINE_SHARED_LIBADD" +- if test -n "$READLINE_DIR/$PHP_LIBDIR"; then ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 ++EOF ++ ++ fi + +- if test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$READLINE_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$READLINE_DIR/$PHP_LIBDIR" || echo "$READLINE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$READLINE_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $READLINE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ cat >> confdefs.h <<\EOF ++#define HAVE_SIMPLEXML 1 ++EOF ++ + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$READLINE_DIR/$PHP_LIBDIR\"`" +- fi ++ ext_builddir=ext/simplexml ++ ext_srcdir=$abs_srcdir/ext/simplexml ++ ++ ac_extra= + ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SIMPLEXML_SHARED=no + +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-L$ai_p $READLINE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p $READLINE_SHARED_LIBADD" +- else +- + ++ case ext/simplexml in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in simplexml.c sxe.c; do + +- fi ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- +- fi ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h </dev/null ; then +- ai_p=$READLINE_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $READLINE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$READLINE_DIR/$PHP_LIBDIR\"`" ++ fi + fi + +- +- +- ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then ++ PHP_SIMPLEXML_SHARED=no ++ case "$PHP_SAPI" in ++ cgi|embed) ++ + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ case ext/simplexml in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi + ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- +- fi + +- fi +- ++ old_IFS=$IFS ++ for ac_src in simplexml.c sxe.c; do + +- case readline in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lreadline $LIBS" +- ;; +- esac +- +- ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi ++ cat >>Makefile.objects<&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_readline_readline +- +- { echo "configure: error: readline library not found" 1>&2; exit 1; } ++ case ext/simplexml in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + + +-fi + ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ old_IFS=$IFS ++ for ac_src in simplexml.c sxe.c; do + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- ;; +- esac ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC simplexml" ++ fi ++ ++ ++ BUILD_DIR="$BUILD_DIR $ext_builddir" ++ ++ ++ ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=simplexml + +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- ++ PHP_VAR_SUBST="$PHP_VAR_SUBST SIMPLEXML_SHARED_LIBADD" ++ + ++ else ++ { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ fi ++ + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ am_i_shared=$PHP_SIMPLEXML_SHARED ++ is_it_shared=$PHP_LIBXML_SHARED ++ is_it_enabled=$PHP_LIBXML ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension simplexml to build statically, but it ++depends on extension libxml, which you've configured to build shared. ++You either need to build simplexml shared or build libxml statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension simplexml, which depends on extension libxml, ++but you've either not enabled libxml, or have disabled it. ++" 1>&2; exit 1; } ++ fi + ++ ++ am_i_shared=$PHP_SIMPLEXML_SHARED ++ is_it_shared=$PHP_SPL_SHARED ++ is_it_enabled=$PHP_SPL ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension simplexml to build statically, but it ++depends on extension spl, which you've configured to build shared. ++You either need to build simplexml shared or build spl statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension simplexml, which depends on extension spl, ++but you've either not enabled spl, or have disabled it. ++" 1>&2; exit 1; } + fi ++ ++fi + + +- fi +- +- fi + +- ;; +- esac +- done ++php_with_snmp=no + +- echo $ac_n "checking for rl_pending_input in -lreadline""... $ac_c" 1>&6 +-echo "configure:79401: checking for rl_pending_input in -lreadline" >&5 +-ac_lib_var=`echo readline'_'rl_pending_input | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo $ac_n "checking for SNMP support""... $ac_c" 1>&6 ++echo "configure:85354: checking for SNMP support" >&5 ++# Check whether --with-snmp or --without-snmp was given. ++if test "${with_snmp+set}" = set; then ++ withval="$with_snmp" ++ PHP_SNMP=$withval + else +- ac_save_LIBS="$LIBS" +-LIBS="-lreadline $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_readline_rl_pending_input +- +- { echo "configure: error: invalid readline installation detected. Try --with-libedit instead." 1>&2; exit 1; } +- +- +-fi + ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SNMP in ++shared,*) ++ PHP_SNMP=`echo "$PHP_SNMP"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SNMP=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac + ++echo "$ac_t""$ext_output" 1>&6 + +- fi +- ;; +- esac + + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++php_with_openssl_dir=no ++ ++echo $ac_n "checking OpenSSL dir for SNMP""... $ac_c" 1>&6 ++echo "configure:85398: checking OpenSSL dir for SNMP" >&5 ++# Check whether --with-openssl-dir or --without-openssl-dir was given. ++if test "${with_openssl_dir+set}" = set; then ++ withval="$with_openssl_dir" ++ PHP_OPENSSL_DIR=$withval ++else + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ PHP_OPENSSL_DIR=no + +- fi + ++fi + +- fi +- +- fi + +- ;; +- esac +- done ++ext_output=$PHP_OPENSSL_DIR ++echo "$ac_t""$ext_output" 1>&6 + +- echo $ac_n "checking for rl_callback_read_char in -lreadline""... $ac_c" 1>&6 +-echo "configure:79551: checking for rl_callback_read_char in -lreadline" >&5 +-ac_lib_var=`echo readline'_'rl_callback_read_char | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lreadline $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_RL_CALLBACK_READ_CHAR 1 +-EOF + ++ ++php_enable_ucd_snmp_hack=no ++ ++echo $ac_n "checking whether to enable UCD SNMP hack""... $ac_c" 1>&6 ++echo "configure:85421: checking whether to enable UCD SNMP hack" >&5 ++# Check whether --enable-ucd-snmp-hack or --disable-ucd-snmp-hack was given. ++if test "${enable_ucd_snmp_hack+set}" = set; then ++ enableval="$enable_ucd_snmp_hack" ++ PHP_UCD_SNMP_HACK=$enableval ++else + ++ PHP_UCD_SNMP_HACK=no + +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_readline_rl_callback_read_char +- +- + fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBREADLINE 1 +-EOF ++ext_output=$PHP_UCD_SNMP_HACK ++echo "$ac_t""$ext_output" 1>&6 + + +-elif test "$PHP_LIBEDIT" != "no"; then + +- for i in $PHP_LIBEDIT /usr/local /usr; do +- test -f $i/include/editline/readline.h && LIBEDIT_DIR=$i && break ++ ++if test "$PHP_SNMP" != "no"; then ++ ++ if test "$PHP_SNMP" = "yes"; then ++ # Extract the first word of "net-snmp-config", so it can be a program name with args. ++set dummy net-snmp-config; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:85446: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_path_SNMP_CONFIG'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ case "$SNMP_CONFIG" in ++ /*) ++ ac_cv_path_SNMP_CONFIG="$SNMP_CONFIG" # Let the user override the test with a path. ++ ;; ++ ?:/*) ++ ac_cv_path_SNMP_CONFIG="$SNMP_CONFIG" # Let the user override the test with a dos path. ++ ;; ++ *) ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="/usr/local/bin:$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_path_SNMP_CONFIG="$ac_dir/$ac_word" ++ break ++ fi + done ++ IFS="$ac_save_ifs" ++ ;; ++esac ++fi ++SNMP_CONFIG="$ac_cv_path_SNMP_CONFIG" ++if test -n "$SNMP_CONFIG"; then ++ echo "$ac_t""$SNMP_CONFIG" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi + +- if test -z "$LIBEDIT_DIR"; then +- { echo "configure: error: Please reinstall libedit - I cannot find readline.h" 1>&2; exit 1; } ++ else ++ SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config" + fi + +- +- if test "$LIBEDIT_DIR/include" != "/usr/include"; then ++ if test -x "$SNMP_CONFIG"; then ++ SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs` ++ SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`" ++ SNMP_PREFIX=`$SNMP_CONFIG --prefix` ++ ++ if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then ++ ++ if test "${SNMP_PREFIX}/include" != "/usr/include"; then + +- if test -z "$LIBEDIT_DIR/include" || echo "$LIBEDIT_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$LIBEDIT_DIR/include ++ if test -z "${SNMP_PREFIX}/include" || echo "${SNMP_PREFIX}/include" | grep '^/' >/dev/null ; then ++ ai_p=${SNMP_PREFIX}/include + else + +- ep_dir="`echo $LIBEDIT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SNMP_PREFIX/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/include\"`" ++ ai_p="$ep_realdir/`basename \"${SNMP_PREFIX}/include\"`" + fi + + +@@ -79648,152 +85515,12 @@ elif test "$PHP_LIBEDIT" != "no"; then + + fi + +- +- echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 +-echo "configure:79654: checking for tgetent in -lncurses" >&5 +-ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lncurses $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- +- +- case ncurses in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-lncurses $READLINE_SHARED_LIBADD" +- else +- +- +- case ncurses in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lncurses $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 +-echo "configure:79717: checking for tgetent in -ltermcap" >&5 +-ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ltermcap $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- +- +- case termcap in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD" +- else + +- +- case termcap in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ltermcap $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +-else +- echo "$ac_t""no" 1>&6 +-fi +- +- +-fi +- +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$READLINE_DIR/$PHP_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do ++ for ac_i in $SNMP_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -pthread" + else + + +@@ -79815,7 +85542,7 @@ fi + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii" + else + + +@@ -79850,8 +85577,8 @@ fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" + else + + +@@ -79877,212 +85604,74 @@ fi + esac + done + +- echo $ac_n "checking for readline in -ledit""... $ac_c" 1>&6 +-echo "configure:79882: checking for readline in -ledit" >&5 +-ac_lib_var=`echo edit'_'readline | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ledit $LIBS" +-cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_NET_SNMP 1 + EOF +-if { (eval echo configure:79901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-ledit $READLINE_SHARED_LIBADD" +- if test -n "$LIBEDIT_DIR/$PHP_LIBDIR"; then +- +- if test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$LIBEDIT_DIR/$PHP_LIBDIR" || echo "$LIBEDIT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$LIBEDIT_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $LIBEDIT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- READLINE_SHARED_LIBADD="-L$ai_p $READLINE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p $READLINE_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi + ++ SNMP_LIBNAME=netsnmp ++ else ++ { echo "configure: error: Could not find the required paths. Please check your net-snmp installation." 1>&2; exit 1; } + fi +- else +- +- +- if test -n "$LIBEDIT_DIR/$PHP_LIBDIR"; then +- +- if test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$LIBEDIT_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$LIBEDIT_DIR/$PHP_LIBDIR" || echo "$LIBEDIT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$LIBEDIT_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $LIBEDIT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case edit in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ledit $LIBS" +- ;; +- esac +- +- +- +- +- fi +- +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_edit_readline +- +- { echo "configure: error: edit library required by readline not found" 1>&2; exit 1; } +- +- +-fi +- ++ else + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBEDIT 1 +-EOF ++ ++ if test "$PHP_SNMP" = "yes"; then ++ for i in /usr/include /usr/local/include; do ++ test -f $i/snmp.h && SNMP_INCDIR=$i ++ test -f $i/ucd-snmp/snmp.h && SNMP_INCDIR=$i/ucd-snmp ++ test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp ++ test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp ++ done ++ for i in /usr/$PHP_LIBDIR /usr/snmp/lib /usr/local/$PHP_LIBDIR /usr/local/lib /usr/local/snmp/lib; do ++ test -f $i/libsnmp.a || test -f $i/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i ++ done ++ else ++ SNMP_INCDIR=$PHP_SNMP/include ++ test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp ++ SNMP_LIBDIR=$PHP_SNMP/lib ++ fi + +-fi ++ if test -z "$SNMP_INCDIR"; then ++ { echo "configure: error: snmp.h not found. Check your SNMP installation." 1>&2; exit 1; } ++ elif test -z "$SNMP_LIBDIR"; then ++ { echo "configure: error: libsnmp not found. Check your SNMP installation." 1>&2; exit 1; } ++ fi + +-if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then +- for ac_func in rl_completion_matches ++ old_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS=-I$SNMP_INCDIR ++ for ac_hdr in default_store.h + do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:80042: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:85647: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- +-; return 0; } ++#include <$ac_hdr> + EOF +-if { (eval echo configure:80070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:85657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" ++ eval "ac_cv_header_$ac_safe=yes" + else ++ echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" ++ eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi +- +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 ++echo "configure:85685: checking for OpenSSL support in SNMP libraries" >&5 ++ cat > conftest.$ac_ext < ++#if USE_OPENSSL ++ yes ++#endif ++ ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "yes" >/dev/null 2>&1; then ++ rm -rf conftest* + ++ SNMP_SSL=yes ++ ++else ++ rm -rf conftest* + ++ SNMP_SSL=no ++ ++fi ++rm -f conftest* + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in readline.c; do ++ fi ++ CPPFLAGS=$old_CPPFLAGS ++ echo "$ac_t""$SNMP_SSL" 1>&6 + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ if test "$SNMP_SSL" = "yes"; then ++ if test "$PHP_OPENSSL_DIR" != "no"; then ++ PHP_OPENSSL=$PHP_OPENSSL_DIR ++ fi + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ if test "$PHP_OPENSSL" = "no"; then ++ { echo "configure: error: The UCD-SNMP in this system is built with SSL support. + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ Add --with-openssl-dir=DIR to your configure line." 1>&2; exit 1; } ++ else ++ ++ found_openssl=no ++ unset OPENSSL_INCDIR ++ unset OPENSSL_LIBDIR + +- cat >>Makefile.objects<&6 ++echo "configure:85742: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ case "$PKG_CONFIG" in ++ /*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ ?:/*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. ++ ;; ++ *) ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" ++ break ++ fi + done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ++ ;; ++esac ++fi ++PKG_CONFIG="$ac_cv_path_PKG_CONFIG" ++if test -n "$PKG_CONFIG"; then ++ echo "$ac_t""$PKG_CONFIG" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi + ++ fi + +- EXT_STATIC="$EXT_STATIC readline" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC readline" ++ if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then ++ if $PKG_CONFIG --atleast-version=0.9.6 openssl; then ++ found_openssl=yes ++ OPENSSL_LIBS=`$PKG_CONFIG --libs openssl` ++ OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl` ++ OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl` ++ else ++ { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } + fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_READLINE_SHARED=yes ++ ++ if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then + +- case ext/readline in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ for ac_i in $OPENSSL_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -pthread" ++ else ++ + ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo +- +- +- old_IFS=$IFS +- for ac_src in readline.c; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii" ++ else + +- shared_objects_readline="$shared_objects_readline $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreadline.$suffix" ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline" +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/readline.$suffix" ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline" +- +- cat >>Makefile.objects<> confdefs.h <" 1>&2; exit 1; } ++ fi + +- old_IFS=$IFS +- for ac_src in readline.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ if test -z "$OPENSSL_LIBDIR"; then ++ { echo "configure: error: Cannot find OpenSSL's libraries" 1>&2; exit 1; } ++ fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ old_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS=-I$OPENSSL_INCDIR ++ echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 ++echo "configure:85947: checking for OpenSSL version" >&5 ++ cat > conftest.$ac_ext <>Makefile.objects< ++#if OPENSSL_VERSION_NUMBER >= 0x0090600fL ++ yes ++#endif ++ + EOF +- done +- +- +- EXT_STATIC="$EXT_STATIC readline" +- ;; +- *) +- +- +- case ext/readline in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "yes" >/dev/null 2>&1; then ++ rm -rf conftest* + ++ echo "$ac_t"">= 0.9.6" 1>&6 ++ ++else ++ rm -rf conftest* + ++ { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } ++ ++fi ++rm -f conftest* + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++ CPPFLAGS=$old_CPPFLAGS + ++ ++ if test "$OPENSSL_INCDIR" != "/usr/include"; then ++ ++ if test -z "$OPENSSL_INCDIR" || echo "$OPENSSL_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$OPENSSL_INCDIR ++ else ++ ++ ep_dir="`echo $OPENSSL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`" ++ fi + +- old_IFS=$IFS +- for ac_src in readline.c; do ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +-echo $ac_n "checking for recode support""... $ac_c" 1>&6 +-echo "configure:80396: checking for recode support" >&5 +-# Check whether --with-recode or --without-recode was given. +-if test "${with_recode+set}" = set; then +- withval="$with_recode" +- PHP_RECODE=$withval +-else ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- PHP_RECODE=no +- test "$PHP_ENABLE_ALL" && PHP_RECODE=$PHP_ENABLE_ALL +- +-fi ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + ++ fi ++ ++ fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_RECODE in +-shared,*) +- PHP_RECODE=`echo "$PHP_RECODE"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_RECODE=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ ;; ++ esac ++ done + ++ echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 ++echo "configure:86104: checking for CRYPTO_free in -lcrypto" >&5 ++ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcrypto $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +-echo "$ac_t""$ext_output" 1>&6 ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ case crypto in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="-lcrypto $SNMP_SHARED_LIBADD" ++ else ++ ++ ++ case crypto in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lcrypto $LIBS" ++ ;; ++ esac + + ++ fi ++ ;; ++ esac + + +-if test "$PHP_RECODE" != "no"; then +- RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + +- for i in $RECODE_LIST; do +- if test -f $i/include/recode.h; then +- RECODE_DIR=$i +- RECODE_INC=include +- RECODE_LIB=$PHP_LIBDIR +- fi +- if test -f $i/include/recode/recode.h; then +- RECODE_DIR=$i +- RECODE_INC=include/recode +- RECODE_LIB=$PHP_LIBDIR/recode +- fi +- if test -f $i/recode/include/recode.h; then +- RECODE_DIR=$i/recode +- RECODE_INC=include +- RECODE_LIB=$PHP_LIBDIR +- fi +- test -n "$RECODE_DIR" && break +- done ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_crypto_CRYPTO_free ++ ++ { echo "configure: error: libcrypto not found!" 1>&2; exit 1; } ++ ++ ++fi + +- if test -z "$RECODE_DIR"; then +- { echo "configure: error: Can not find recode.h anywhere under $RECODE_LIST." 1>&2; exit 1; } +- fi + +- ++ old_LIBS=$LIBS ++ LIBS="$LIBS -lcrypto" ++ + save_old_LDFLAGS=$LDFLAGS + ac_stuff=" +- -L$RECODE_DIR/$RECODE_LIB +- " ++ -L$OPENSSL_LIBDIR ++ " + + save_ext_shared=$ext_shared + ext_shared=yes +@@ -80555,27 +86275,27 @@ if test "$PHP_RECODE" != "no"; then + esac + done + +- echo $ac_n "checking for recode_format_table in -lrecode""... $ac_c" 1>&6 +-echo "configure:80560: checking for recode_format_table in -lrecode" >&5 +-ac_lib_var=`echo recode'_'recode_format_table | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 ++echo "configure:86280: checking for SSL_CTX_set_ssl_version in -lssl" >&5 ++ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lrecode $LIBS" ++LIBS="-lssl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:86299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -80594,28 +86314,214 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + LDFLAGS=$save_old_LDFLAGS + ext_shared=$save_ext_shared + ++ found_openssl=yes ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version ++ ++ { echo "configure: error: libssl not found!" 1>&2; exit 1; } ++ ++ ++fi ++ ++ LIBS=$old_LIBS ++ ++ ++ case ssl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="-lssl $SNMP_SHARED_LIBADD" ++ else ++ ++ ++ case ssl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lssl $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++ ++ if test "$OPENSSL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$OPENSSL_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$OPENSSL_LIBDIR" || echo "$OPENSSL_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$OPENSSL_LIBDIR ++ else ++ ++ ep_dir="`echo $OPENSSL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ fi ++ ++ if test "$found_openssl" = "yes"; then ++ OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR ++ ++ ++: ++else ++ { echo "configure: error: SNMP: OpenSSL check failed. Please check config.log for more information." 1>&2; exit 1; } ++ ++ fi ++ ++ fi ++ fi ++ ++ echo $ac_n "checking for kstat_read in -lkstat""... $ac_c" 1>&6 ++echo "configure:86412: checking for kstat_read in -lkstat" >&5 ++ac_lib_var=`echo kstat'_'kstat_read | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lkstat $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ case kstat in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SNMP_SHARED_LIBADD="-lkstat $SNMP_SHARED_LIBADD" ++ else ++ ++ ++ case kstat in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lkstat $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++ if test "$SNMP_INCDIR" != "/usr/include"; then ++ ++ if test -z "$SNMP_INCDIR" || echo "$SNMP_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SNMP_INCDIR ++ else ++ ++ ep_dir="`echo $SNMP_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$SNMP_INCDIR\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ + + + if test "$ext_shared" = "yes"; then +- RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD" +- if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ SNMP_SHARED_LIBADD="-lsnmp $SNMP_SHARED_LIBADD" ++ if test -n "$SNMP_LIBDIR"; then + +- if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ if test "$SNMP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SNMP_LIBDIR" != "/usr/lib"; then + +- if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then +- ai_p=$RECODE_DIR/$RECODE_LIB ++ if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SNMP_LIBDIR + else + +- ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SNMP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- RECODE_SHARED_LIBADD="-L$ai_p $RECODE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p $RECODE_SHARED_LIBADD" ++ SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" + else + + +@@ -80641,18 +86547,18 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + else + + +- if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ if test -n "$SNMP_LIBDIR"; then + +- if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ if test "$SNMP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SNMP_LIBDIR" != "/usr/lib"; then + +- if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then +- ai_p=$RECODE_DIR/$RECODE_LIB ++ if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SNMP_LIBDIR + else + +- ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SNMP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`" + fi + + +@@ -80678,10 +86584,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + +- case recode in ++ case snmp in + c|c_r|pthread*) ;; + *) +- LIBS="-lrecode $LIBS" ++ LIBS="-lsnmp $LIBS" + ;; + esac + +@@ -80691,56 +86597,81 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l + fi + + +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_recode_recode_format_table +- +- old_LDFLAGS=$LDFLAGS +- old_LIBS=$LIBS +- LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB" +- LIBS="$LIBS -lrecode" +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else + ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +- if test "$ext_shared" = "yes"; then +- RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD" +- if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then +- ai_p=$RECODE_DIR/$RECODE_LIB ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + + if test "$ext_shared" = "yes"; then +- RECODE_SHARED_LIBADD="-L$ai_p $RECODE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p $RECODE_SHARED_LIBADD" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -80762,26 +86693,140 @@ if { (eval echo configure:80720: \"$ac_l + + fi + +- fi +- else ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for snmp_parse_oid in -l$SNMP_LIBNAME""... $ac_c" 1>&6 ++echo "configure:86702: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5 ++ac_lib_var=`echo $SNMP_LIBNAME'_'snmp_parse_oid | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$SNMP_LIBNAME $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared + ++ cat >> confdefs.h <<\EOF ++#define HAVE_SNMP_PARSE_OID 1 ++EOF + +- if test -n "$RECODE_DIR/$RECODE_LIB"; then ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$SNMP_LIBNAME_snmp_parse_oid + +- if test "$RECODE_DIR/$RECODE_LIB" != "/usr/$PHP_LIBDIR" && test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then ++ ++fi ++ ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $SNMP_SHARED_LIBADD ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then +- ai_p=$RECODE_DIR/$RECODE_LIB ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $RECODE_DIR/$RECODE_LIB|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + +- ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -80797,138 +86842,93 @@ if { (eval echo configure:80720: \"$ac_l + fi + + ++ fi + + fi + +- fi +- +- +- case recode in +- c|c_r|pthread*) ;; +- *) +- DLIBS="-lrecode $DLIBS" +- ;; +- esac +- +- +- +- +- fi ++ ;; ++ esac ++ done + ++ echo $ac_n "checking for init_snmp in -l$SNMP_LIBNAME""... $ac_c" 1>&6 ++echo "configure:86855: checking for init_snmp in -l$SNMP_LIBNAME" >&5 ++ac_lib_var=`echo $SNMP_LIBNAME'_'init_snmp | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-l$SNMP_LIBNAME $LIBS" ++cat > conftest.$ac_ext <> confdefs.h <<\EOF +-#define HAVE_BROKEN_RECODE 1 ++int main() { ++init_snmp() ++; return 0; } + EOF +- +- ++if { (eval echo configure:86874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- +- { echo "configure: error: I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?" 1>&2; exit 1; } +- ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +- LIBS=$old_LIBS +- LDFLAGS=$old_LDFLAGS +- +- +-fi +- ++LIBS="$ac_save_LIBS" + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRECODE 1 ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_SNMP 1 + EOF + + +- if test "$RECODE_DIR/$RECODE_INC" != "/usr/include"; then +- +- if test -z "$RECODE_DIR/$RECODE_INC" || echo "$RECODE_DIR/$RECODE_INC" | grep '^/' >/dev/null ; then +- ai_p=$RECODE_DIR/$RECODE_INC +- else +- +- ep_dir="`echo $RECODE_DIR/$RECODE_INC|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_INC\"`" +- fi ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$SNMP_LIBNAME_init_snmp + ++ { echo "configure: error: SNMP sanity check failed. Please check config.log for more information." 1>&2; exit 1; } + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi ++fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST RECODE_SHARED_LIBADD" + +- for ac_hdr in stdbool.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:80883: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:80893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <> confdefs.h <<\EOF ++#define UCD_SNMP_HACK 1 + EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +-done + ++ fi + +- ext_builddir=ext/recode +- ext_srcdir=$abs_srcdir/ext/recode ++ ++ ext_builddir=ext/snmp ++ ext_srcdir=$abs_srcdir/ext/snmp + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_RECODE_SHARED=no ++ PHP_SNMP_SHARED=no + + +- case ext/recode in ++ case ext/snmp in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -80943,7 +86943,7 @@ done + + + old_IFS=$IFS +- for ac_src in recode.c; do ++ for ac_src in snmp.c; do + + IFS=. + set $ac_src +@@ -80966,18 +86966,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC recode" ++ EXT_STATIC="$EXT_STATIC snmp" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC recode" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC snmp" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_RECODE_SHARED=yes ++ PHP_SNMP_SHARED=yes + +- case ext/recode in ++ case ext/snmp in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -80992,14 +86992,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in recode.c; do ++ for ac_src in snmp.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_recode="$shared_objects_recode $ac_bdir$ac_obj.lo" ++ shared_objects_snmp="$shared_objects_snmp $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -81022,31 +87022,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phprecode.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phprecode.so '$ext_builddir'/phprecode.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsnmp.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsnmp.so '$ext_builddir'/phpsnmp.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPRECODE, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSNMP, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phprecode.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsnmp.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phprecode.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsnmp.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_recode" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_snmp" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 ++echo "configure:87221: checking whether to enable SOAP support" >&5 ++# Check whether --enable-soap or --disable-soap was given. ++if test "${enable_soap+set}" = set; then ++ enableval="$enable_soap" ++ PHP_SOAP=$enableval ++else ++ ++ PHP_SOAP=no ++ test "$PHP_ENABLE_ALL" && PHP_SOAP=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SOAP in ++shared,*) ++ PHP_SOAP=`echo "$PHP_SOAP"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SOAP=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test -z "$PHP_LIBXML_DIR"; then ++ ++php_with_libxml_dir=no ++ ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:87266: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else ++ ++ PHP_LIBXML_DIR=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++fi ++ ++if test "$PHP_SOAP" != "no"; then ++ ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: SOAP extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi ++ ++ ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:87294: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break ++ fi ++ done ++ ++fi ++ ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 ++ ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` ++ ++ for ac_i in $LIBXML_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ SOAP_SHARED_LIBADD="$SOAP_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SOAP_SHARED_LIBADD="$SOAP_SHARED_LIBADD -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ SOAP_SHARED_LIBADD="-L$ai_p $SOAP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SOAP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SOAP_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ for ac_i in $LIBXML_INCS; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 ++echo "configure:87452: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ ++ old_LIBS=$LIBS ++ LIBS=" ++ $SOAP_SHARED_LIBADD ++ $LIBS" ++ if test "$cross_compiling" = yes; then ++ ++ LIBS=$old_LIBS ++ ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- BUILD_DIR="$BUILD_DIR $ext_builddir" ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes ++ + +- +- +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=recode ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ LIBS=$old_LIBS + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ ++ ++fi ++rm -fr conftest* ++fi + +- fi + ++ + fi + +- +-cat >> confdefs.h <<\EOF +-#define HAVE_REFLECTION 1 ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 + EOF + ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_SOAP 1 ++EOF + +- ext_builddir=ext/reflection +- ext_srcdir=$abs_srcdir/ext/reflection ++ ++ ext_builddir=ext/soap ++ ext_srcdir=$abs_srcdir/ext/soap + + ac_extra= + +- if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then +- PHP_REFLECTION_SHARED=no ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SOAP_SHARED=no + + +- case ext/reflection in ++ case ext/soap in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/reflection"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/reflection/"; ac_bdir="ext/reflection/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -81242,7 +87542,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_reflection.c; do ++ for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do + + IFS=. + set $ac_src +@@ -81265,18 +87565,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC reflection" +- if test "no" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC reflection" ++ EXT_STATIC="$EXT_STATIC soap" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC soap" + fi + else +- if test "no" = "shared" || test "no" = "yes"; then +- PHP_REFLECTION_SHARED=yes ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_SOAP_SHARED=yes + +- case ext/reflection in ++ case ext/soap in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/reflection"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/reflection/"; ac_bdir="ext/reflection/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -81291,14 +87591,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_reflection.c; do ++ for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_reflection="$shared_objects_reflection $ac_bdir$ac_obj.lo" ++ shared_objects_soap="$shared_objects_soap $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -81321,31 +87621,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpreflection.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) $(PHPREFLECTION_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpreflection.so '$ext_builddir'/phpreflection.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsoap.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(PHPSOAP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsoap.so '$ext_builddir'/phpsoap.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPREFLECTION, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSOAP, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_reflection) $(PHPREFLECTION_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(PHPSOAP_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpreflection.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsoap.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreflection.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsoap.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_reflection" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_soap" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } ++ ++ fi ++ ++fi + + + +-php_enable_session=yes ++php_enable_sockets=no + +-echo $ac_n "checking whether to enable PHP sessions""... $ac_c" 1>&6 +-echo "configure:81516: checking whether to enable PHP sessions" >&5 +-# Check whether --enable-session or --disable-session was given. +-if test "${enable_session+set}" = set; then +- enableval="$enable_session" +- PHP_SESSION=$enableval ++echo $ac_n "checking whether to enable sockets support""... $ac_c" 1>&6 ++echo "configure:87829: checking whether to enable sockets support" >&5 ++# Check whether --enable-sockets or --disable-sockets was given. ++if test "${enable_sockets+set}" = set; then ++ enableval="$enable_sockets" ++ PHP_SOCKETS=$enableval + else + +- PHP_SESSION=yes +- test "$PHP_ENABLE_ALL" && PHP_SESSION=$PHP_ENABLE_ALL ++ PHP_SOCKETS=no ++ test "$PHP_ENABLE_ALL" && PHP_SOCKETS=$PHP_ENABLE_ALL + + fi + +@@ -81528,12 +87841,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_SESSION in ++case $PHP_SOCKETS in + shared,*) +- PHP_SESSION=`echo "$PHP_SESSION"|$SED 's/^shared,//'` ++ PHP_SOCKETS=`echo "$PHP_SOCKETS"|$SED 's/^shared,//'` + ;; + shared) +- PHP_SESSION=yes ++ PHP_SOCKETS=yes + ;; + no) + ext_output=no +@@ -81552,286 +87865,545 @@ echo "$ac_t""$ext_output" 1>&6 + + + +- +-php_with_mm=no +- +-echo $ac_n "checking for mm support""... $ac_c" 1>&6 +-echo "configure:81560: checking for mm support" >&5 +-# Check whether --with-mm or --without-mm was given. +-if test "${with_mm+set}" = set; then +- withval="$with_mm" +- PHP_MM=$withval ++if test "$PHP_SOCKETS" != "no"; then ++ echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6 ++echo "configure:87871: checking for struct cmsghdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_cmsghdr'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + +- PHP_MM=no +- ++ cat > conftest.$ac_ext < ++#include ++int main() { ++struct cmsghdr s; s ++; return 0; } ++EOF ++if { (eval echo configure:87886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_cmsghdr=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_cmsghdr=no ++fi ++rm -f conftest* ++ + fi + ++echo "$ac_t""$ac_cv_cmsghdr" 1>&6 + +-ext_output=$PHP_MM +-echo "$ac_t""$ext_output" 1>&6 ++ if test "$ac_cv_cmsghdr" = yes; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_CMSGHDR 1 ++EOF ++ ++ fi + ++ for ac_func in hstrerror socketpair ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:87911: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + +-if test "$PHP_SESSION" != "no"; then +- +- echo $ac_n "checking whether pwrite works""... $ac_c" 1>&6 +-echo "configure:81582: checking whether pwrite works" >&5 +-if eval "test \"`echo '$''{'ac_cv_pwrite'+set}'`\" = set"; then ++; return 0; } ++EOF ++if { (eval echo configure:87939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ for ac_hdr in netdb.h netinet/tcp.h sys/un.h errno.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:87967: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- +- if test "$cross_compiling" = yes; then +- +- ac_cv_pwrite=no +- ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:87977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ + cat > conftest.$ac_ext < +-#include +-#include +-#include +-#include ++#include ++ ++int main() { ++static struct msghdr tp; int n = (int) tp.msg_flags; return n ++; return 0; } ++EOF ++if { (eval echo configure:88014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ : ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ cat >> confdefs.h <<\EOF ++#define MISSING_MSGHDR_MSGFLAGS 1 ++EOF ++ ++ ++fi ++rm -f conftest* ++ cat >> confdefs.h <<\EOF ++#define HAVE_SOCKETS 1 ++EOF ++ ++ ++ ++ ext_builddir=ext/sockets ++ ext_srcdir=$abs_srcdir/ext/sockets ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SOCKETS_SHARED=no ++ ++ ++ case ext/sockets in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in sockets.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_pwrite=yes +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_cv_pwrite=no +- +-fi +-rm -fr conftest* +-fi + ++ fi ++ fi + +- if test "$ac_cv_pwrite" = "no"; then +- +- if test "$cross_compiling" = yes; then ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then ++ PHP_SOCKETS_SHARED=no ++ case "$PHP_SAPI" in ++ cgi|embed) ++ ++ ++ case ext/sockets in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- ac_cv_pwrite=no + +-else +- cat > conftest.$ac_ext < +-#include +-#include +-#include +-#include +-ssize_t pwrite(int, void *, size_t, off64_t); +- main() { +- int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- if (fd < 0) exit(1); +- if (pwrite(fd, "text", 4, 0) != 4) exit(1); +- /* Linux glibc breakage until 2.2.5 */ +- if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); +- exit(0); +- } + ++ old_IFS=$IFS ++ for ac_src in sockets.c; do + ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_pwrite=yes ++ done ++ ++ ++ EXT_STATIC="$EXT_STATIC sockets" ++ ;; ++ *) ++ + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ case ext/sockets in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- ac_cv_pwrite=no + +-fi +-rm -fr conftest* +-fi + ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +- if test "$ac_cv_pwrite" = "yes"; then +- ac_cv_pwrite=64 +- fi +- fi +- +-fi + +-echo "$ac_t""$ac_cv_pwrite" 1>&6 ++ old_IFS=$IFS ++ for ac_src in sockets.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" + +- if test "$ac_cv_pwrite" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_PWRITE 1 +-EOF ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- if test "$ac_cv_pwrite" = "64"; then +- cat >> confdefs.h <<\EOF +-#define PHP_PWRITE_64 1 ++ cat >>Makefile.objects<&6 +-echo "configure:81702: checking whether pread works" >&5 +-if eval "test \"`echo '$''{'ac_cv_pread'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- +- echo test > conftest_in +- if test "$cross_compiling" = yes; then + +- ac_cv_pread=no ++ BUILD_DIR="$BUILD_DIR $ext_builddir" + +-else +- cat > conftest.$ac_ext < +-#include +-#include +-#include +-#include + +- main() { +- char buf[3]; +- int fd = open("conftest_in", O_RDONLY); +- if (fd < 0) exit(1); +- if (pread(fd, buf, 2, 0) != 2) exit(1); +- /* Linux glibc breakage until 2.2.5 */ +- if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); +- exit(0); +- } ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=sockets ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ ++ fi ++ + +-EOF +-if { (eval echo configure:81735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then + +- ac_cv_pread=yes ++ header_path=ext/sockets/ ++ for header_file in php_sockets.h; do ++ hp_hf="$header_path/$header_file" ++ + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` + +- ac_cv_pread=no ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ++ ++ fi ++ ++ done + +-fi +-rm -fr conftest* ++ + fi + +- rm -f conftest_in + +- if test "$ac_cv_pread" = "no"; then +- +- echo test > conftest_in ++ echo $ac_n "checking whether zend_object_value is packed""... $ac_c" 1>&6 ++echo "configure:88348: checking whether zend_object_value is packed" >&5 ++ old_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS="$INCLUDES -I$abs_srcdir $CPPFLAGS" + if test "$cross_compiling" = yes; then + +- ac_cv_pread=no ++ ac_result=0 ++ echo "$ac_t""no" 1>&6 + + else + cat > conftest.$ac_ext < +-#include +-#include +-#include +-#include +-ssize_t pread(int, void *, size_t, off64_t); +- main() { +- char buf[3]; +- int fd = open("conftest_in", O_RDONLY); +- if (fd < 0) exit(1); +- if (pread(fd, buf, 2, 0) != 2) exit(1); +- /* Linux glibc breakage until 2.2.5 */ +- if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); +- exit(0); +- } ++#include "Zend/zend_types.h" ++int main(int argc, char **argv) { ++ return ((sizeof(zend_object_handle) + sizeof(zend_object_handlers*)) == sizeof(zend_object_value)) ? 0 : 1; ++} + + EOF +-if { (eval echo configure:81782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:88367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + +- ac_cv_pread=yes ++ ac_result=1 ++ echo "$ac_t""yes" 1>&6 + + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + +- ac_cv_pread=no ++ ac_result=0 ++ echo "$ac_t""no" 1>&6 + + fi + rm -fr conftest* + fi + +- rm -f conftest_in +- +- if test "$ac_cv_pread" = "yes"; then +- ac_cv_pread=64 +- fi +- fi +- +-fi +- +-echo "$ac_t""$ac_cv_pread" 1>&6 +- +- if test "$ac_cv_pread" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_PREAD 1 ++ CPPFLAGS=$old_CPPFLAGS ++ cat >> confdefs.h <> confdefs.h <<\EOF +-#define PHP_PREAD_64 1 ++ cat >> confdefs.h <<\EOF ++#define HAVE_SPL 1 + EOF +- +- fi +- fi +- ++ + +- ext_builddir=ext/session +- ext_srcdir=$abs_srcdir/ext/session ++ ext_builddir=ext/spl ++ ext_srcdir=$abs_srcdir/ext/spl + + ac_extra= + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SESSION_SHARED=no ++ if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then ++ PHP_SPL_SHARED=no + + +- case ext/session in ++ case ext/spl in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -81846,7 +88418,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do ++ for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do + + IFS=. + set $ac_src +@@ -81869,18 +88441,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC session" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC session" ++ EXT_STATIC="$EXT_STATIC spl" ++ if test "no" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC spl" + fi + else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SESSION_SHARED=yes ++ if test "no" = "shared" || test "no" = "yes"; then ++ PHP_SPL_SHARED=yes + +- case ext/session in ++ case ext/spl in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -81895,14 +88467,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do ++ for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_session="$shared_objects_session $ac_bdir$ac_obj.lo" ++ shared_objects_spl="$shared_objects_spl $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -81925,31 +88497,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsession.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsession.so '$ext_builddir'/phpsession.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpspl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(PHPSPL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpspl.so '$ext_builddir'/phpspl.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSESSION, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSPL, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(PHPSPL_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsession.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpspl.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsession.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpspl.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_session" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_spl" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension spl, which depends on extension pcre, ++but you've either not enabled pcre, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ ++php_with_sqlite=yes ++ ++echo $ac_n "checking for sqlite support""... $ac_c" 1>&6 ++echo "configure:88731: checking for sqlite support" >&5 ++# Check whether --with-sqlite or --without-sqlite was given. ++if test "${with_sqlite+set}" = set; then ++ withval="$with_sqlite" ++ PHP_SQLITE=$withval ++else ++ ++ PHP_SQLITE=yes ++ test "$PHP_ENABLE_ALL" && PHP_SQLITE=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SQLITE in ++shared,*) ++ PHP_SQLITE=`echo "$PHP_SQLITE"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SQLITE=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++ ++php_enable_sqlite_utf8=no ++ ++echo $ac_n "checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)""... $ac_c" 1>&6 ++echo "configure:88775: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5 ++# Check whether --enable-sqlite-utf8 or --disable-sqlite-utf8 was given. ++if test "${enable_sqlite_utf8+set}" = set; then ++ enableval="$enable_sqlite_utf8" ++ PHP_SQLITE_UTF8=$enableval ++else ++ ++ PHP_SQLITE_UTF8=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_SQLITE_UTF8 ++echo "$ac_t""$ext_output" 1>&6 ++ + +- cat >>Makefile.objects<&6 ++echo "configure:88803: checking for PDO includes" >&5 ++if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 ++echo "configure:88809: checking for PDO includes" >&5 ++ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$abs_srcdir/ext ++ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then ++ pdo_inc_path=$prefix/include/php/ext ++ fi ++ ++fi + ++echo "$ac_t""$pdo_inc_path" 1>&6 ++ if test -n "$pdo_inc_path"; then ++: ++ else ++echo "configure: warning: Cannot find php_pdo_driver.h." 1>&2 + fi + ++ if test -n "$pdo_inc_path"; then ++ cat >> confdefs.h <<\EOF ++#define PHP_SQLITE2_HAVE_PDO 1 ++EOF ++ ++ pdo_inc_path="-I$pdo_inc_path" ++ fi ++ fi ++ ++ if test "$PHP_SQLITE" != "yes"; then ++ SEARCH_PATH="/usr/local /usr" ++ SEARCH_FOR="/include/sqlite.h" ++ if test -r $PHP_SQLITE/; then # path given as parameter ++ SQLITE_DIR=$PHP_SQLITE ++ else # search default path list ++ echo $ac_n "checking for sqlite files in default path""... $ac_c" 1>&6 ++echo "configure:88843: checking for sqlite files in default path" >&5 ++ for i in $SEARCH_PATH ; do ++ if test -r $i/$SEARCH_FOR; then ++ SQLITE_DIR=$i ++ echo "$ac_t""found in $i" 1>&6 ++ fi ++ done ++ fi + +- am_i_shared=$PHP_SESSION_SHARED +- is_it_shared=$PHP_HASH_SHARED +- is_it_enabled=$PHP_HASH +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension session to build statically, but it +-depends on extension hash, which you've configured to build shared. +-You either need to build session shared or build hash statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension session, which depends on extension hash, +-but you've either not enabled hash, or have disabled it. +-" 1>&2; exit 1; } +- fi ++ if test -z "$SQLITE_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Please reinstall the sqlite distribution from http://www.sqlite.org" 1>&2; exit 1; } ++ fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$SQLITE_DIR/$PHP_LIBDIR -lm ++ " + ++ save_ext_shared=$ext_shared ++ ext_shared=yes + +- am_i_shared=$PHP_SESSION_SHARED +- is_it_shared=$PHP_SPL_SHARED +- is_it_enabled=$PHP_SPL +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension session to build statically, but it +-depends on extension spl, which you've configured to build shared. +-You either need to build session shared or build spl statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension session, which depends on extension spl, +-but you've either not enabled spl, or have disabled it. +-" 1>&2; exit 1; } +- fi ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ + ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- PHP_VAR_SUBST="$PHP_VAR_SUBST SESSION_SHARED_LIBADD" ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ + +- header_path=ext/session +- for header_file in php_session.h mod_files.h mod_user.h; do +- hp_hf="$header_path/$header_file" ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` + ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" ++ eval "LIBPATH$unique=set" + +- INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" +- +- fi +- +- done ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_PHP_SESSION 1 +-EOF + +-fi ++ fi ++ ++ fi + +-if test "$PHP_MM" != "no"; then +- for i in $PHP_MM /usr/local /usr; do +- test -f "$i/include/mm.h" && MM_DIR=$i && break ++ ;; ++ esac + done + +- if test -z "$MM_DIR" ; then +- { echo "configure: error: cannot find mm library" 1>&2; exit 1; } +- fi +- ++ echo $ac_n "checking for sqlite_open in -lsqlite""... $ac_c" 1>&6 ++echo "configure:88955: checking for sqlite_open in -lsqlite" >&5 ++ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsqlite $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ + + if test "$ext_shared" = "yes"; then +- SESSION_SHARED_LIBADD="-lmm $SESSION_SHARED_LIBADD" +- if test -n "$MM_DIR/$PHP_LIBDIR"; then ++ SQLITE_SHARED_LIBADD="-lsqlite $SQLITE_SHARED_LIBADD" ++ if test -n "$SQLITE_DIR/$PHP_LIBDIR"; then + +- if test "$MM_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MM_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$MM_DIR/$PHP_LIBDIR" || echo "$MM_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$MM_DIR/$PHP_LIBDIR ++ if test -z "$SQLITE_DIR/$PHP_LIBDIR" || echo "$SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SQLITE_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $MM_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MM_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$SQLITE_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- SESSION_SHARED_LIBADD="-L$ai_p $SESSION_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SESSION_SHARED_LIBADD="$ld_runpath_switch$ai_p $SESSION_SHARED_LIBADD" ++ SQLITE_SHARED_LIBADD="-L$ai_p $SQLITE_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SQLITE_SHARED_LIBADD="$ld_runpath_switch$ai_p $SQLITE_SHARED_LIBADD" + else + + +@@ -82233,18 +89036,18 @@ if test "$PHP_MM" != "no"; then + else + + +- if test -n "$MM_DIR/$PHP_LIBDIR"; then ++ if test -n "$SQLITE_DIR/$PHP_LIBDIR"; then + +- if test "$MM_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MM_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$MM_DIR/$PHP_LIBDIR" || echo "$MM_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$MM_DIR/$PHP_LIBDIR ++ if test -z "$SQLITE_DIR/$PHP_LIBDIR" || echo "$SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SQLITE_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $MM_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MM_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$SQLITE_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -82270,10 +89073,10 @@ if test "$PHP_MM" != "no"; then + fi + + +- case mm in ++ case sqlite in + c|c_r|pthread*) ;; + *) +- LIBS="-lmm $LIBS" ++ LIBS="-lsqlite $LIBS" + ;; + esac + +@@ -82283,17 +89086,17 @@ if test "$PHP_MM" != "no"; then + fi + + +- +- if test "$MM_DIR/include" != "/usr/include"; then ++ ++ if test "$SQLITE_DIR/include" != "/usr/include"; then + +- if test -z "$MM_DIR/include" || echo "$MM_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$MM_DIR/include ++ if test -z "$SQLITE_DIR/include" || echo "$SQLITE_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$SQLITE_DIR/include + else + +- ep_dir="`echo $MM_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $SQLITE_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$MM_DIR/include\"`" ++ ai_p="$ep_realdir/`basename \"$SQLITE_DIR/include\"`" + fi + + +@@ -82314,93 +89117,121 @@ if test "$PHP_MM" != "no"; then + + fi + +- +- +- for header_file in ext/session/mod_mm.h; do +- +- +- unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" + +- INSTALL_HEADERS="$INSTALL_HEADERS $header_file" +- +- fi +- +- done + ++else ++ echo "$ac_t""no" 1>&6 + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBMM 1 +-EOF +- ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_sqlite_sqlite_open ++ ++ { echo "configure: error: wrong sqlite lib version or lib not found" 1>&2; exit 1; } ++ ++ + fi + ++ SQLITE_MODULE_TYPE=external ++ PHP_SQLITE_CFLAGS=$pdo_inc_path ++ sqlite_extra_sources="libsqlite/src/encode.c" ++ else ++ # use bundled library ++ ++ # we only support certain lemon versions ++ lemon_version_list="1.0" + +-php_enable_shmop=no ++ # Extract the first word of "lemon", so it can be a program name with args. ++set dummy lemon; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:89147: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_LEMON'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$LEMON"; then ++ ac_cv_prog_LEMON="$LEMON" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_LEMON="lemon" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++fi ++fi ++LEMON="$ac_cv_prog_LEMON" ++if test -n "$LEMON"; then ++ echo "$ac_t""$LEMON" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi + +-echo $ac_n "checking whether to enable shmop support""... $ac_c" 1>&6 +-echo "configure:82346: checking whether to enable shmop support" >&5 +-# Check whether --enable-shmop or --disable-shmop was given. +-if test "${enable_shmop+set}" = set; then +- enableval="$enable_shmop" +- PHP_SHMOP=$enableval ++ if test "$LEMON"; then ++ echo $ac_n "checking for lemon version""... $ac_c" 1>&6 ++echo "configure:89175: checking for lemon version" >&5 ++if eval "test \"`echo '$''{'php_cv_lemon_version'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + +- PHP_SHMOP=no +- test "$PHP_ENABLE_ALL" && PHP_SHMOP=$PHP_ENABLE_ALL +- ++ lemon_version=`$LEMON -x 2>/dev/null | $SED -e 's/^.* //'` ++ php_cv_lemon_version=invalid ++ for lemon_check_version in $lemon_version_list; do ++ if test "$lemon_version" = "$lemon_check_version"; then ++ php_cv_lemon_version="$lemon_check_version (ok)" ++ fi ++ done ++ + fi + ++echo "$ac_t""$php_cv_lemon_version" 1>&6 ++ else ++ lemon_version=none ++ fi ++ case $php_cv_lemon_version in ++ ""|invalid) ++ lemon_msg="lemon versions supported for regeneration of libsqlite parsers: $lemon_version_list (found: $lemon_version)." ++ echo "configure: warning: $lemon_msg" 1>&2 ++ LEMON="exit 0;" ++ ;; ++ esac ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST LEMON" + + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SHMOP in +-shared,*) +- PHP_SHMOP=`echo "$PHP_SHMOP"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SHMOP=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_SHMOP" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SHMOP 1 +-EOF +- ++ SQLITE_MODULE_TYPE=builtin ++ PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src -I@ext_builddir@/libsqlite/src $pdo_inc_path" ++ sqlite_extra_sources="libsqlite/src/opcodes.c \ ++ libsqlite/src/parse.c libsqlite/src/encode.c \ ++ libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \ ++ libsqlite/src/delete.c libsqlite/src/expr.c libsqlite/src/func.c \ ++ libsqlite/src/hash.c libsqlite/src/insert.c libsqlite/src/main.c \ ++ libsqlite/src/os.c libsqlite/src/pager.c \ ++ libsqlite/src/printf.c libsqlite/src/random.c \ ++ libsqlite/src/select.c libsqlite/src/table.c libsqlite/src/tokenize.c \ ++ libsqlite/src/update.c libsqlite/src/util.c libsqlite/src/vdbe.c \ ++ libsqlite/src/attach.c libsqlite/src/btree_rb.c libsqlite/src/pragma.c \ ++ libsqlite/src/vacuum.c libsqlite/src/copy.c \ ++ libsqlite/src/vdbeaux.c libsqlite/src/date.c \ ++ libsqlite/src/where.c libsqlite/src/trigger.c" ++ fi ++ sqlite_sources="sqlite.c sess_sqlite.c pdo_sqlite2.c $sqlite_extra_sources" + +- ext_builddir=ext/shmop +- ext_srcdir=$abs_srcdir/ext/shmop ++ ext_builddir=ext/sqlite ++ ext_srcdir=$abs_srcdir/ext/sqlite + +- ac_extra= ++ ac_extra=`echo "$PHP_SQLITE_CFLAGS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SHMOP_SHARED=no ++ PHP_SQLITE_SHARED=no + + +- case ext/shmop in ++ case ext/sqlite in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sqlite/"; ac_bdir="ext/sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -82415,7 +89246,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in shmop.c; do ++ for ac_src in $sqlite_sources; do + + IFS=. + set $ac_src +@@ -82438,18 +89269,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC shmop" ++ EXT_STATIC="$EXT_STATIC sqlite" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC shmop" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC sqlite" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SHMOP_SHARED=yes ++ PHP_SQLITE_SHARED=yes + +- case ext/shmop in ++ case ext/sqlite in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sqlite/"; ac_bdir="ext/sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -82464,14 +89295,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in shmop.c; do ++ for ac_src in $sqlite_sources; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_shmop="$shared_objects_shmop $ac_bdir$ac_obj.lo" ++ shared_objects_sqlite="$shared_objects_sqlite $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -82494,31 +89325,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpshmop.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpshmop.so '$ext_builddir'/phpshmop.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsqlite.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) $(PHPSQLITE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsqlite.so '$ext_builddir'/phpsqlite.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSHMOP, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSQLITE, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) $(PHPSQLITE_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpshmop.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsqlite.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpshmop.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsqlite.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_shmop" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sqlite" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension sqlite, which depends on extension spl, ++but you've either not enabled spl, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ am_i_shared=$PHP_SQLITE_SHARED ++ is_it_shared=$PHP_PDO_SHARED ++ is_it_enabled=$PHP_PDO ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension sqlite to build statically, but it ++depends on extension pdo, which you've configured to build shared. ++You either need to build sqlite shared or build pdo statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension sqlite, which depends on extension pdo, ++but you've either not enabled pdo, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ src=$ext_srcdir/Makefile.frag ++ ac_srcdir=$ext_srcdir ++ ac_builddir=$ext_builddir ++ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments + ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_SHARED_LIBADD" + ++ ++ ++ for header_file in $ext_builddir/libsqlite/src/sqlite.h; do ++ ++ ++ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ++ ++ fi + +-php_enable_simplexml=yes ++ done ++ + +-echo $ac_n "checking whether to enable SimpleXML support""... $ac_c" 1>&6 +-echo "configure:82690: checking whether to enable SimpleXML support" >&5 +-# Check whether --enable-simplexml or --disable-simplexml was given. +-if test "${enable_simplexml+set}" = set; then +- enableval="$enable_simplexml" +- PHP_SIMPLEXML=$enableval +-else + +- PHP_SIMPLEXML=yes +- test "$PHP_ENABLE_ALL" && PHP_SIMPLEXML=$PHP_ENABLE_ALL ++ if test "$SQLITE_MODULE_TYPE" = "builtin"; then ++ ++ ++ $php_shtool mkdir -p $ext_builddir/libsqlite/src ++ + ++ echo $ac_n "checking size of char *""... $ac_c" 1>&6 ++echo "configure:89588: checking size of char *" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_char_p=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(char *)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:89608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_char_p=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_char_p=0 ++fi ++rm -fr conftest* + fi + ++fi ++echo "$ac_t""$ac_cv_sizeof_char_p" 1>&6 ++cat >> confdefs.h <> confdefs.h <<\EOF ++#define SQLITE_PTR_SZ SIZEOF_CHAR_P ++EOF + ++ if test "$PHP_SQLITE_UTF8" = "yes"; then ++ SQLITE_ENCODING="UTF8" ++ cat >> confdefs.h <<\EOF ++#define SQLITE_UTF8 1 ++EOF + ++ else ++ SQLITE_ENCODING="ISO8859" ++ fi ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_ENCODING" + +-echo "$ac_t""$ext_output" 1>&6 + ++ SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION` ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_VERSION" + + ++ sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in > $ext_builddir/libsqlite/src/sqlite.h + +-if test -z "$PHP_LIBXML_DIR"; then ++ if test "$ext_shared" = "no" || test "$ext_srcdir" != "$abs_srcdir"; then ++ echo '#include ' > $ext_builddir/libsqlite/src/config.h ++ else ++ echo "#include \"$abs_builddir/config.h\"" > $ext_builddir/libsqlite/src/config.h ++ fi ++ ++ cat >> $ext_builddir/libsqlite/src/config.h <&6 ++echo "configure:89670: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:82735: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:89698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ for ac_hdr in time.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:89726: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:89736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++fi ++ ++ ++ ++echo $ac_n "checking whether flush should be called explicitly after a buffered io""... $ac_c" 1>&6 ++echo "configure:89767: checking whether flush should be called explicitly after a buffered io" >&5 ++if eval "test \"`echo '$''{'ac_cv_flush_io'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + +- PHP_LIBXML_DIR=no ++if test "$cross_compiling" = yes; then ++ ++ ac_cv_flush_io=no ++ ++else ++ cat > conftest.$ac_ext < ++#include ++ ++int main(int argc, char **argv) ++{ ++ char *filename = tmpnam(NULL); ++ char buffer[64]; ++ int result = 0; ++ ++ FILE *fp = fopen(filename, "wb"); ++ if (NULL == fp) ++ return 0; ++ fputs("line 1\n", fp); ++ fputs("line 2\n", fp); ++ fclose(fp); ++ ++ fp = fopen(filename, "rb+"); ++ if (NULL == fp) ++ return 0; ++ fgets(buffer, sizeof(buffer), fp); ++ fputs("line 3\n", fp); ++ rewind(fp); ++ fgets(buffer, sizeof(buffer), fp); ++ if (0 != strcmp(buffer, "line 1\n")) ++ result = 1; ++ fgets(buffer, sizeof(buffer), fp); ++ if (0 != strcmp(buffer, "line 3\n")) ++ result = 1; ++ fclose(fp); ++ unlink(filename); ++ ++ exit(result); ++} ++ ++EOF ++if { (eval echo configure:89816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_flush_io=no ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + ++ ac_cv_flush_io=yes + + fi ++rm -fr conftest* ++fi + ++fi + +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 ++echo "$ac_t""$ac_cv_flush_io" 1>&6 ++if test "$ac_cv_flush_io" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_FLUSHIO 1 ++EOF + ++fi + ++if test "$ac_cv_func_crypt" = "no"; then ++ echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 ++echo "configure:89844: checking for crypt in -lcrypt" >&5 ++ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcrypt $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +-if test "$PHP_SIMPLEXML" != "no"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LIBS="-lcrypt $LIBS -lcrypt" ++ cat >> confdefs.h <<\EOF ++#define HAVE_CRYPT 1 ++EOF + +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: SimpleXML extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi + ++fi + +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:82763: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++echo $ac_n "checking for standard DES crypt""... $ac_c" 1>&6 ++echo "configure:89892: checking for standard DES crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_des'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done ++ if test "$cross_compiling" = yes; then ++ ++ ac_cv_crypt_des=yes + +-fi ++else ++ cat > conftest.$ac_ext <&6 ++#if HAVE_UNISTD_H ++#include ++#endif + +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- +- for ac_i in $LIBXML_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- SIMPLEXML_SHARED_LIBADD="$SIMPLEXML_SHARED_LIBADD -pthread" +- else +- ++#if HAVE_CRYPT_H ++#include ++#endif ++ ++main() { ++#if HAVE_CRYPT ++ exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M")); ++#else ++ exit(0); ++#endif ++} ++EOF ++if { (eval echo configure:89922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ac_cv_crypt_des=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++ ac_cv_crypt_des=no + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++fi ++rm -fr conftest* ++fi ++ ++fi ++ ++echo "$ac_t""$ac_cv_crypt_des" 1>&6 ++ ++echo $ac_n "checking for extended DES crypt""... $ac_c" 1>&6 ++echo "configure:89943: checking for extended DES crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_ext_des'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SIMPLEXML_SHARED_LIBADD="$SIMPLEXML_SHARED_LIBADD -l$ac_ii" +- else +- ++ if test "$cross_compiling" = yes; then + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ ac_cv_crypt_ext_des=no ++ ++else ++ cat > conftest.$ac_ext < ++#endif ++ ++#if HAVE_CRYPT_H ++#include ++#endif ++ ++main() { ++#if HAVE_CRYPT ++ exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc")); ++#else ++ exit(0); ++#endif ++} ++EOF ++if { (eval echo configure:89973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_crypt_ext_des=yes + ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_crypt_ext_des=no + +- fi +- ;; +- esac ++fi ++rm -fr conftest* ++fi + ++fi + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++echo "$ac_t""$ac_cv_crypt_ext_des" 1>&6 + +- +- if test "$ext_shared" = "yes"; then +- SIMPLEXML_SHARED_LIBADD="-L$ai_p $SIMPLEXML_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SIMPLEXML_SHARED_LIBADD="$ld_runpath_switch$ai_p $SIMPLEXML_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++echo $ac_n "checking for MD5 crypt""... $ac_c" 1>&6 ++echo "configure:89994: checking for MD5 crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_md5'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++if test "$cross_compiling" = yes; then + +- fi ++ ac_cv_crypt_md5=no + ++else ++ cat > conftest.$ac_ext < ++#endif + +- ;; +- esac +- done ++#if HAVE_CRYPT_H ++#include ++#endif + +- +- for ac_i in $LIBXML_INCS; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++main() { ++#if HAVE_CRYPT ++ char salt[15], answer[40]; + +- ++ salt[0]='$'; salt[1]='1'; salt[2]='$'; ++ salt[3]='r'; salt[4]='a'; salt[5]='s'; ++ salt[6]='m'; salt[7]='u'; salt[8]='s'; ++ salt[9]='l'; salt[10]='e'; salt[11]='$'; ++ salt[12]='\0'; ++ strcpy(answer,salt); ++ strcat(answer,"rISCgZzpwk3UhDidwXvin0"); ++ exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); ++#else ++ exit(0); ++#endif ++} ++EOF ++if { (eval echo configure:90033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ac_cv_crypt_md5=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ ac_cv_crypt_md5=no + +- fi ++fi ++rm -fr conftest* ++fi + +- ;; +- esac +- done ++fi + ++echo "$ac_t""$ac_cv_crypt_md5" 1>&6 + +- echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:82921: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++echo $ac_n "checking for Blowfish crypt""... $ac_c" 1>&6 ++echo "configure:90054: checking for Blowfish crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_blowfish'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + +- +- old_LIBS=$LIBS +- LIBS=" +- $SIMPLEXML_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS ++if test "$cross_compiling" = yes; then + ++ ac_cv_crypt_blowfish=no ++ + else + cat > conftest.$ac_ext < ++#endif ++ ++#if HAVE_CRYPT_H ++#include ++#endif ++ ++main() { ++#if HAVE_CRYPT ++ char salt[30], answer[70]; + +- char xmlInitParser(); +- int main() { +- xmlInitParser(); +- return 0; +- } +- ++ salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0'; ++ strcat(salt,"rasmuslerd............"); ++ strcpy(answer,salt); ++ strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra"); ++ exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); ++#else ++ exit(0); ++#endif ++} + EOF +-if { (eval echo configure:82948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:90090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + +- LIBS=$old_LIBS +- +- php_cv_libxml_build_works=yes +- +- ++ ac_cv_crypt_blowfish=yes ++ + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- ++ ac_cv_crypt_blowfish=no ++ + fi + rm -fr conftest* + fi + +- +- + fi + +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF ++echo "$ac_t""$ac_cv_crypt_blowfish" 1>&6 + +- fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SIMPLEXML 1 +-EOF ++echo $ac_n "checking for SHA512 crypt""... $ac_c" 1>&6 ++echo "configure:90111: checking for SHA512 crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_SHA512'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++if test "$cross_compiling" = yes; then ++ ++ ac_cv_crypt_SHA512=no + +- +- ext_builddir=ext/simplexml +- ext_srcdir=$abs_srcdir/ext/simplexml ++else ++ cat > conftest.$ac_ext < ++#endif + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SIMPLEXML_SHARED=no ++#if HAVE_CRYPT_H ++#include ++#endif ++ ++main() { ++#if HAVE_CRYPT ++ char salt[30], answer[80]; + ++ salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; ++ strcpy(answer, salt); ++ strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); ++ exit (strcmp((char *)crypt("foo",salt),answer)); ++#else ++ exit(0); ++#endif ++} ++EOF ++if { (eval echo configure:90146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- case ext/simplexml in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- ++ ac_cv_crypt_SHA512=yes + +- old_IFS=$IFS +- for ac_src in simplexml.c sxe.c; do ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ac_cv_crypt_SHA512=no + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++fi ++rm -fr conftest* ++fi + +- cat >>Makefile.objects<&6 + +- EXT_STATIC="$EXT_STATIC simplexml" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC simplexml" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SIMPLEXML_SHARED=yes +- +- case ext/simplexml in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++echo $ac_n "checking for SHA256 crypt""... $ac_c" 1>&6 ++echo "configure:90167: checking for SHA256 crypt" >&5 ++if eval "test \"`echo '$''{'ac_cv_crypt_SHA256'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + ++if test "$cross_compiling" = yes; then + ++ ac_cv_crypt_SHA256=no + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo +- ++else ++ cat > conftest.$ac_ext < ++#endif + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++#if HAVE_CRYPT_H ++#include ++#endif + +- cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_crypt_SHA256=yes + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsimplexml.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsimplexml.$suffix" +- fi ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_simplexml" ++ ac_cv_crypt_SHA256=no + +- cat >>Makefile.objects<&6 + +- ;; +- *) +- +- install_modules="install-modules" + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/simplexml.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_simplexml) $(SIMPLEXML_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/simplexml.so '$ext_builddir'/simplexml.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_simplexml) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SIMPLEXML, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_simplexml) $(SIMPLEXML_SHARED_LIBADD)' +- ;; +- esac ++if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/simplexml.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/simplexml.$suffix" +- fi ++ echo $ac_n "checking whether the compiler supports __alignof__""... $ac_c" 1>&6 ++echo "configure:90226: checking whether the compiler supports __alignof__" >&5 ++if eval "test \"`echo '$''{'ac_cv_alignof_exists'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_simplexml" +- +- cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ++ ac_cv_alignof_exists=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ++ ac_cv_alignof_exists=no ++ ++fi ++rm -f conftest* ++fi + +- ;; +- esac +- cat >> confdefs.h <&6 ++ if test "$ac_cv_alignof_exists" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ALIGNOF 1 + EOF + +- fi + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_SIMPLEXML_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- ++ echo $ac_n "checking whether the compiler supports aligned attribute""... $ac_c" 1>&6 ++echo "configure:90267: checking whether the compiler supports aligned attribute" >&5 ++if eval "test \"`echo '$''{'ac_cv_attribute_aligned'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- case ext/simplexml in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/simplexml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/simplexml/"; ac_bdir="ext/simplexml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ++ ac_cv_attribute_aligned=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ++ ac_cv_attribute_aligned=no + ++fi ++rm -f conftest* ++fi ++ ++echo "$ac_t""$ac_cv_attribute_aligned" 1>&6 ++ if test "$ac_cv_attribute_aligned" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ATTRIBUTE_ALIGNED 1 ++EOF ++ ++ fi ++ ++ ++ cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <>Makefile.objects<> confdefs.h <>Makefile.objects<> confdefs.h <> confdefs.h <&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } +- ++ if test "$ac_cv_crypt_ext_des" = "yes"; then ++ ac_result=1 ++ ac_crypt_edes=1 ++ else ++ ac_result=0 ++ ac_crypt_edes=0 + fi ++ cat >> confdefs.h <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension simplexml, which depends on extension libxml, +-but you've either not enabled libxml, or have disabled it. +-" 1>&2; exit 1; } ++ ++ if test "$ac_cv_crypt_md5" = "yes"; then ++ ac_result=1 ++ ac_crypt_md5=1 ++ else ++ ac_result=0 ++ ac_crypt_md5=0 + fi ++ cat >> confdefs.h <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension simplexml, which depends on extension spl, +-but you've either not enabled spl, or have disabled it. +-" 1>&2; exit 1; } ++ if test "$ac_cv_crypt_sha512" = "yes"; then ++ ac_result=1 ++ ac_crypt_sha512=1 ++ else ++ ac_result=0 ++ ac_crypt_sha512=0 + fi +- +-fi ++ cat >> confdefs.h <> confdefs.h <&6 +-echo "configure:83336: checking for SNMP support" >&5 +-# Check whether --with-snmp or --without-snmp was given. +-if test "${with_snmp+set}" = set; then +- withval="$with_snmp" +- PHP_SNMP=$withval +-else +- +- PHP_SNMP=no +- test "$PHP_ENABLE_ALL" && PHP_SNMP=$PHP_ENABLE_ALL ++ cat >> confdefs.h <&6 ++echo "configure:90462: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + ++int main() { + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SNMP in +-shared,*) +- PHP_SNMP=`echo "$PHP_SNMP"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SNMP=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_with_openssl_dir=no ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + +-echo $ac_n "checking OpenSSL dir for SNMP""... $ac_c" 1>&6 +-echo "configure:83380: checking OpenSSL dir for SNMP" >&5 +-# Check whether --with-openssl-dir or --without-openssl-dir was given. +-if test "${with_openssl_dir+set}" = set; then +- withval="$with_openssl_dir" +- PHP_OPENSSL_DIR=$withval ++; return 0; } ++EOF ++if { (eval echo configure:90490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" + else +- +- PHP_OPENSSL_DIR=no +- +- ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* + fi + +- +-ext_output=$PHP_OPENSSL_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_enable_ucd_snmp_hack=no +- +-echo $ac_n "checking whether to enable UCD SNMP hack""... $ac_c" 1>&6 +-echo "configure:83403: checking whether to enable UCD SNMP hack" >&5 +-# Check whether --enable-ucd-snmp-hack or --disable-ucd-snmp-hack was given. +-if test "${enable_ucd_snmp_hack+set}" = set; then +- enableval="$enable_ucd_snmp_hack" +- PHP_UCD_SNMP_HACK=$enableval ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 + fi ++done + +- +-ext_output=$PHP_UCD_SNMP_HACK +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_SNMP" != "no"; then +- +- if test "$PHP_SNMP" = "yes"; then +- # Extract the first word of "net-snmp-config", so it can be a program name with args. +-set dummy net-snmp-config; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:83428: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_path_SNMP_CONFIG'+set}'`\" = set"; then ++echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 ++echo "configure:90515: checking for working fnmatch" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- case "$SNMP_CONFIG" in +- /*) +- ac_cv_path_SNMP_CONFIG="$SNMP_CONFIG" # Let the user override the test with a path. +- ;; +- ?:/*) +- ac_cv_path_SNMP_CONFIG="$SNMP_CONFIG" # Let the user override the test with a dos path. +- ;; +- *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="/usr/local/bin:$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_SNMP_CONFIG="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" +- ;; +-esac +-fi +-SNMP_CONFIG="$ac_cv_path_SNMP_CONFIG" +-if test -n "$SNMP_CONFIG"; then +- echo "$ac_t""$SNMP_CONFIG" 1>&6 ++ # Some versions of Solaris or SCO have a broken fnmatch function. ++# So we run a test program. If we are cross-compiling, take no chance. ++# Thanks to John Oleynick and Franc,ois Pinard for this test. ++if test "$cross_compiling" = yes; then ++ ac_cv_func_fnmatch_works=no + else +- echo "$ac_t""no" 1>&6 ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_func_fnmatch_works=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_func_fnmatch_works=no ++fi ++rm -fr conftest* + fi + +- else +- SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config" +- fi +- +- if test -x "$SNMP_CONFIG"; then +- SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs` +- SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`" +- SNMP_PREFIX=`$SNMP_CONFIG --prefix` +- +- if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then +- +- if test "${SNMP_PREFIX}/include" != "/usr/include"; then +- +- if test -z "${SNMP_PREFIX}/include" || echo "${SNMP_PREFIX}/include" | grep '^/' >/dev/null ; then +- ai_p=${SNMP_PREFIX}/include +- else +- +- ep_dir="`echo $SNMP_PREFIX/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"${SNMP_PREFIX}/include\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- for ac_i in $SNMP_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done ++fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_NET_SNMP 1 ++echo "$ac_t""$ac_cv_func_fnmatch_works" 1>&6 ++if test $ac_cv_func_fnmatch_works = yes; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_FNMATCH 1 + EOF + +- SNMP_LIBNAME=netsnmp +- else +- { echo "configure: error: Could not find the required paths. Please check your net-snmp installation." 1>&2; exit 1; } +- fi +- else +- +- +- if test "$PHP_SNMP" = "yes"; then +- for i in /usr/include /usr/local/include; do +- test -f $i/snmp.h && SNMP_INCDIR=$i +- test -f $i/ucd-snmp/snmp.h && SNMP_INCDIR=$i/ucd-snmp +- test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp +- test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp +- done +- for i in /usr/$PHP_LIBDIR /usr/snmp/lib /usr/local/$PHP_LIBDIR /usr/local/lib /usr/local/snmp/lib; do +- test -f $i/libsnmp.a || test -f $i/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i +- done +- else +- SNMP_INCDIR=$PHP_SNMP/include +- test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp +- SNMP_LIBDIR=$PHP_SNMP/lib +- fi +- +- if test -z "$SNMP_INCDIR"; then +- { echo "configure: error: snmp.h not found. Check your SNMP installation." 1>&2; exit 1; } +- elif test -z "$SNMP_LIBDIR"; then +- { echo "configure: error: libsnmp not found. Check your SNMP installation." 1>&2; exit 1; } +- fi ++fi ++ + +- old_CPPFLAGS=$CPPFLAGS +- CPPFLAGS=-I$SNMP_INCDIR +- for ac_hdr in default_store.h ++ ++for ac_func in fork CreateProcess + do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:83629: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:90557: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $ac_func(); below. */ ++#include ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ ++; return 0; } + EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:83639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then ++if { (eval echo configure:90585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" ++ eval "ac_cv_func_$ac_func=yes" + else +- echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" ++ eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 ++php_can_support_proc_open=no ++ + fi + done + +- if test "$ac_cv_header_default_store_h" = "yes"; then +- echo $ac_n "checking for OpenSSL support in SNMP libraries""... $ac_c" 1>&6 +-echo "configure:83667: checking for OpenSSL support in SNMP libraries" >&5 +- cat > conftest.$ac_ext <&6 ++echo "configure:90615: checking if your OS can spawn processes with inherited handles" >&5 ++if test "$php_can_support_proc_open" = "yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define PHP_CAN_SUPPORT_PROC_OPEN 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then ++ cat >> confdefs.h <<\EOF ++#define ENABLE_CHROOT_FUNC 1 ++EOF ++ ++fi ++ ++ ++ unset ac_cv_func_res_nsearch ++ unset ac_cv_func___res_nsearch ++ unset found ++ ++ echo $ac_n "checking for res_nsearch""... $ac_c" 1>&6 ++echo "configure:90639: checking for res_nsearch" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_res_nsearch'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char res_nsearch(); + +-#include +-#if USE_OPENSSL +- yes ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_res_nsearch) || defined (__stub___res_nsearch) ++choke me ++#else ++res_nsearch(); + #endif +- ++ ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "yes" >/dev/null 2>&1; then ++if { (eval echo configure:90667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- +- SNMP_SSL=yes +- ++ eval "ac_cv_func_res_nsearch=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- +- SNMP_SSL=no +- ++ eval "ac_cv_func_res_nsearch=no" + fi + rm -f conftest* ++fi + +- fi +- CPPFLAGS=$old_CPPFLAGS +- echo "$ac_t""$SNMP_SSL" 1>&6 +- +- if test "$SNMP_SSL" = "yes"; then +- if test "$PHP_OPENSSL_DIR" != "no"; then +- PHP_OPENSSL=$PHP_OPENSSL_DIR +- fi +- +- if test "$PHP_OPENSSL" = "no"; then +- { echo "configure: error: The UCD-SNMP in this system is built with SSL support. +- +- Add --with-openssl-dir=DIR to your configure line." 1>&2; exit 1; } +- else +- +- found_openssl=no +- unset OPENSSL_INCDIR +- unset OPENSSL_LIBDIR ++if eval "test \"`echo '$ac_cv_func_'res_nsearch`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __res_nsearch""... $ac_c" 1>&6 ++echo "configure:90685: checking for __res_nsearch" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___res_nsearch'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __res_nsearch(); + +- test -z "$PHP_OPENSSL" && PHP_OPENSSL=no +- test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no ++int main() { + +- if test "$PHP_OPENSSL" != "no"; then +- PHP_OPENSSL_DIR=$PHP_OPENSSL +- elif test "$PHP_IMAP_SSL" != "no"; then +- PHP_OPENSSL_DIR=$PHP_IMAP_SSL +- fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___res_nsearch) || defined (__stub_____res_nsearch) ++choke me ++#else ++__res_nsearch(); ++#endif + +- if test -z "$PKG_CONFIG"; then +- # Extract the first word of "pkg-config", so it can be a program name with args. +-set dummy pkg-config; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:83724: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++; return 0; } ++EOF ++if { (eval echo configure:90713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___res_nsearch=yes" + else +- case "$PKG_CONFIG" in +- /*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. +- ;; +- ?:/*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path. +- ;; +- *) +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" +- break +- fi +- done +- IFS="$ac_save_ifs" +- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" +- ;; +-esac ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___res_nsearch=no" + fi +-PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +-if test -n "$PKG_CONFIG"; then +- echo "$ac_t""$PKG_CONFIG" 1>&6 ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'__res_nsearch`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes + else + echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + fi + +- fi +- +- if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then +- if $PKG_CONFIG --atleast-version=0.9.6 openssl; then +- found_openssl=yes +- OPENSSL_LIBS=`$PKG_CONFIG --libs openssl` +- OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl` +- OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl` +- else +- { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } +- fi +- +- if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then +- +- for ac_i in $OPENSSL_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done + +- +- for ac_i in $OPENSSL_INCS; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_NSEARCH 1 ++EOF + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ac_cv_func_res_nsearch=yes ++ ;; + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- fi +- fi +- +- if test "$found_openssl" = "no"; then ++ *) + +- if test "$PHP_OPENSSL_DIR" = "yes"; then +- PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" +- fi +- +- for i in $PHP_OPENSSL_DIR; do +- if test -r $i/include/openssl/evp.h; then +- OPENSSL_INCDIR=$i/include +- fi +- if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then +- OPENSSL_LIBDIR=$i/$PHP_LIBDIR +- fi +- test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break +- done ++ unset ac_cv_lib_resolv_res_nsearch ++ unset ac_cv_lib_resolv___res_nsearch ++ unset found ++ echo $ac_n "checking for res_nsearch in -lresolv""... $ac_c" 1>&6 ++echo "configure:90751: checking for res_nsearch in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'res_nsearch | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <" 1>&2; exit 1; } +- fi ++int main() { ++res_nsearch() ++; return 0; } ++EOF ++if { (eval echo configure:90770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- if test -z "$OPENSSL_LIBDIR"; then +- { echo "configure: error: Cannot find OpenSSL's libraries" 1>&2; exit 1; } +- fi ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- old_CPPFLAGS=$CPPFLAGS +- CPPFLAGS=-I$OPENSSL_INCDIR +- echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6 +-echo "configure:83929: checking for OpenSSL version" >&5 +- cat > conftest.$ac_ext <&6 ++echo "configure:90790: checking for __res_nsearch in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'__res_nsearch | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext < +-#if OPENSSL_VERSION_NUMBER >= 0x0090600fL +- yes +-#endif +- ++int main() { ++__res_nsearch() ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "yes" >/dev/null 2>&1; then ++if { (eval echo configure:90809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- +- echo "$ac_t"">= 0.9.6" 1>&6 +- ++ eval "ac_cv_lib_$ac_lib_var=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- +- { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 1; } +- ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" + +- CPPFLAGS=$old_CPPFLAGS +- +- +- if test "$OPENSSL_INCDIR" != "/usr/include"; then +- +- if test -z "$OPENSSL_INCDIR" || echo "$OPENSSL_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$OPENSSL_INCDIR +- else +- +- ep_dir="`echo $OPENSSL_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`" +- fi ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++fi ++ ++ ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lresolv" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + ++ LIBS=$ac_libs + fi + +- ++ if test "$found" = "yes"; then + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$OPENSSL_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- + +- case $ac_ii in ++ case resolv in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -l$ac_ii" ++ LIBS="-lresolv $LIBS" + ;; + esac + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_NSEARCH 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRESOLV 1 ++EOF + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ ac_cv_func_res_nsearch=yes + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi +- ++ unset ac_cv_lib_bind_res_nsearch ++ unset ac_cv_lib_bind___res_nsearch ++ unset found ++ echo $ac_n "checking for res_nsearch in -lbind""... $ac_c" 1>&6 ++echo "configure:90887: checking for res_nsearch in -lbind" >&5 ++ac_lib_var=`echo bind'_'res_nsearch | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbind $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- esac +- done ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 +-echo "configure:84086: checking for CRYPTO_free in -lcrypto" >&5 +-ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for __res_nsearch in -lbind""... $ac_c" 1>&6 ++echo "configure:90926: checking for __res_nsearch in -lbind" >&5 ++ac_lib_var=`echo bind'_'__res_nsearch | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lcrypto $LIBS" ++LIBS="-lbind $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:90945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -84116,168 +90956,352 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared ++fi ++ ++ ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lbind" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi ++ ++ LIBS=$ac_libs ++ fi ++ ++ if test "$found" = "yes"; then + +- +- +- case crypto in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-lcrypto $SNMP_SHARED_LIBADD" +- else +- + +- case crypto in ++ case bind in + c|c_r|pthread*) ;; + *) +- LIBS="-lcrypto $LIBS" ++ LIBS="-lbind $LIBS" + ;; + esac + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_NSEARCH 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBBIND 1 ++EOF + ++ ac_cv_func_res_nsearch=yes ++ else + + ++ unset ac_cv_lib_socket_res_nsearch ++ unset ac_cv_lib_socket___res_nsearch ++ unset found ++ echo $ac_n "checking for res_nsearch in -lsocket""... $ac_c" 1>&6 ++echo "configure:91023: checking for res_nsearch in -lsocket" >&5 ++ac_lib_var=`echo socket'_'res_nsearch | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes + else + echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_crypto_CRYPTO_free +- +- { echo "configure: error: libcrypto not found!" 1>&2; exit 1; } +- +- ++ echo $ac_n "checking for __res_nsearch in -lsocket""... $ac_c" 1>&6 ++echo "configure:91062: checking for __res_nsearch in -lsocket" >&5 ++ac_lib_var=`echo socket'_'__res_nsearch | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- old_LIBS=$LIBS +- LIBS="$LIBS -lcrypto" +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$OPENSSL_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++fi ++ ++ ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lsocket" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi ++ ++ LIBS=$ac_libs + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++ if test "$found" = "yes"; then ++ + +- case $ac_ii in ++ case socket in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -l$ac_ii" ++ LIBS="-lsocket $LIBS" + ;; + esac + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_NSEARCH 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBSOCKET 1 ++EOF + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ ac_cv_func_res_nsearch=yes + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ : ++ + fi ++ + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- ++ fi + ++ ++ fi + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ;; + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ esac ++ ++ ++ unset ac_cv_func_dns_search ++ unset ac_cv_func___dns_search ++ unset found + +- fi ++ echo $ac_n "checking for dns_search""... $ac_c" 1>&6 ++echo "configure:91174: checking for dns_search" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_dns_search'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char dns_search(); + ++int main() { + +- fi +- +- fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_dns_search) || defined (__stub___dns_search) ++choke me ++#else ++dns_search(); ++#endif + +- ;; +- esac +- done ++; return 0; } ++EOF ++if { (eval echo configure:91202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_dns_search=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_dns_search=no" ++fi ++rm -f conftest* ++fi + +- echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6 +-echo "configure:84262: checking for SSL_CTX_set_ssl_version in -lssl" >&5 +-ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$ac_cv_func_'dns_search`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __dns_search""... $ac_c" 1>&6 ++echo "configure:91220: checking for __dns_search" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___dns_search'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __dns_search(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___dns_search) || defined (__stub_____dns_search) ++choke me ++#else ++__dns_search(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:91248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___dns_search=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___dns_search=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'__dns_search`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ ++fi ++ ++ ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_DNS_SEARCH 1 ++EOF ++ ++ ac_cv_func_dns_search=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_resolv_dns_search ++ unset ac_cv_lib_resolv___dns_search ++ unset found ++ echo $ac_n "checking for dns_search in -lresolv""... $ac_c" 1>&6 ++echo "configure:91286: checking for dns_search in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'dns_search | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lssl $LIBS" ++LIBS="-lresolv $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:91305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -84292,124 +91316,31 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- found_openssl=yes +- +- ++ found=yes + else + echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version +- +- { echo "configure: error: libssl not found!" 1>&2; exit 1; } +- +- +-fi +- +- LIBS=$old_LIBS +- +- +- case ssl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-lssl $SNMP_SHARED_LIBADD" +- else +- +- +- case ssl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lssl $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +- +- if test "$OPENSSL_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$OPENSSL_LIBDIR" != "/usr/lib"; then +- +- if test -z "$OPENSSL_LIBDIR" || echo "$OPENSSL_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$OPENSSL_LIBDIR +- else +- +- ep_dir="`echo $OPENSSL_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- +- if test "$found_openssl" = "yes"; then +- OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR +- +- +-: +-else +- { echo "configure: error: SNMP: OpenSSL check failed. Please check config.log for more information." 1>&2; exit 1; } +- +- fi +- +- fi +- fi +- +- echo $ac_n "checking for kstat_read in -lkstat""... $ac_c" 1>&6 +-echo "configure:84394: checking for kstat_read in -lkstat" >&5 +-ac_lib_var=`echo kstat'_'kstat_read | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for __dns_search in -lresolv""... $ac_c" 1>&6 ++echo "configure:91325: checking for __dns_search in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'__dns_search | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lkstat $LIBS" ++LIBS="-lresolv $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:91344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -84424,282 +91355,89 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- +- case kstat in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-lkstat $SNMP_SHARED_LIBADD" +- else +- +- +- case kstat in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lkstat $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- ++ found=yes + else + echo "$ac_t""no" 1>&6 ++found=no + fi + +- +- if test "$SNMP_INCDIR" != "/usr/include"; then +- +- if test -z "$SNMP_INCDIR" || echo "$SNMP_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$SNMP_INCDIR +- else +- +- ep_dir="`echo $SNMP_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SNMP_INCDIR\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-lsnmp $SNMP_SHARED_LIBADD" +- if test -n "$SNMP_LIBDIR"; then +- +- if test "$SNMP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SNMP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$SNMP_LIBDIR +- else +- +- ep_dir="`echo $SNMP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- SNMP_SHARED_LIBADD="-L$ai_p $SNMP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SNMP_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$SNMP_LIBDIR"; then +- +- if test "$SNMP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SNMP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$SNMP_LIBDIR +- else +- +- ep_dir="`echo $SNMP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi + +- +- case snmp in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsnmp $LIBS" +- ;; +- esac +- +- +- ++fi + +- fi + ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lresolv" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- SNMP_LIBNAME=snmp ++ LIBS=$ac_libs + fi + ++ if test "$found" = "yes"; then + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $SNMP_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- + +- case $ac_ii in ++ case resolv in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -l$ac_ii" ++ LIBS="-lresolv $LIBS" + ;; + esac + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_DNS_SEARCH 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRESOLV 1 ++EOF + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ ac_cv_func_dns_search=yes + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" + +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for snmp_parse_oid in -l$SNMP_LIBNAME""... $ac_c" 1>&6 +-echo "configure:84684: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5 +-ac_lib_var=`echo $SNMP_LIBNAME'_'snmp_parse_oid | sed 'y%./+-%__p_%'` ++ unset ac_cv_lib_bind_dns_search ++ unset ac_cv_lib_bind___dns_search ++ unset found ++ echo $ac_n "checking for dns_search in -lbind""... $ac_c" 1>&6 ++echo "configure:91422: checking for dns_search in -lbind" >&5 ++ac_lib_var=`echo bind'_'dns_search | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-l$SNMP_LIBNAME $LIBS" ++LIBS="-lbind $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:91441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -84708,151 +91446,37 @@ else + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SNMP_PARSE_OID 1 +-EOF +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$SNMP_LIBNAME_snmp_parse_oid +- +- +-fi +- +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $SNMP_SHARED_LIBADD +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- esac +- done ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for init_snmp in -l$SNMP_LIBNAME""... $ac_c" 1>&6 +-echo "configure:84837: checking for init_snmp in -l$SNMP_LIBNAME" >&5 +-ac_lib_var=`echo $SNMP_LIBNAME'_'init_snmp | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for __dns_search in -lbind""... $ac_c" 1>&6 ++echo "configure:91461: checking for __dns_search in -lbind" >&5 ++ac_lib_var=`echo bind'_'__dns_search | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-l$SNMP_LIBNAME $LIBS" ++LIBS="-lbind $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:91480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -84867,2353 +91491,2361 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SNMP 1 +-EOF +- +- +- ++ found=yes + else + echo "$ac_t""no" 1>&6 ++found=no ++fi + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$SNMP_LIBNAME_init_snmp +- +- { echo "configure: error: SNMP sanity check failed. Please check config.log for more information." 1>&2; exit 1; } +- + + fi + + +- if test "$PHP_UCD_SNMP_HACK" = "yes" ; then +- cat >> confdefs.h <<\EOF +-#define UCD_SNMP_HACK 1 ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lbind" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + ++ LIBS=$ac_libs + fi +- +- +- ext_builddir=ext/snmp +- ext_srcdir=$abs_srcdir/ext/snmp +- +- ac_extra= + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SNMP_SHARED=no ++ if test "$found" = "yes"; then + + +- case ext/snmp in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in snmp.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_DNS_SEARCH 1 + EOF +- done +- +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsnmp.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsnmp.so '$ext_builddir'/phpsnmp.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSNMP, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsnmp.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsnmp.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_snmp" +- +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_LIBBIND 1 + EOF + +- ;; +- *) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/snmp.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(SNMP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/snmp.so '$ext_builddir'/snmp.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SNMP, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(SNMP_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/snmp.$suffix" ++ ac_cv_func_dns_search=yes + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/snmp.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_snmp" +- +- cat >>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&6 ++echo "configure:91558: checking for dns_search in -lsocket" >&5 ++ac_lib_var=`echo socket'_'dns_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- +-php_enable_soap=no +- +-echo $ac_n "checking whether to enable SOAP support""... $ac_c" 1>&6 +-echo "configure:85203: checking whether to enable SOAP support" >&5 +-# Check whether --enable-soap or --disable-soap was given. +-if test "${enable_soap+set}" = set; then +- enableval="$enable_soap" +- PHP_SOAP=$enableval ++ echo $ac_n "checking for __dns_search in -lsocket""... $ac_c" 1>&6 ++echo "configure:91597: checking for __dns_search in -lsocket" >&5 ++ac_lib_var=`echo socket'_'__dns_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- PHP_SOAP=no +- test "$PHP_ENABLE_ALL" && PHP_SOAP=$PHP_ENABLE_ALL ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SOAP in +-shared,*) +- PHP_SOAP=`echo "$PHP_SOAP"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SOAP=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test -z "$PHP_LIBXML_DIR"; then +- +-php_with_libxml_dir=no +- +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:85248: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes + else +- +- PHP_LIBXML_DIR=no +- +- ++ echo "$ac_t""no" 1>&6 ++found=no + fi + +- +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- ++ + fi + +-if test "$PHP_SOAP" != "no"; then +- +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: SOAP extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi + +- +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:85276: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lsocket" ++ if test "$cross_compiling" = yes; then ++ found=no + else +- +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done +- ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* + fi + +-echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 +- +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- +- for ac_i in $LIBXML_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- SOAP_SHARED_LIBADD="$SOAP_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ LIBS=$ac_libs + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SOAP_SHARED_LIBADD="$SOAP_SHARED_LIBADD -l$ac_ii" +- else +- ++ if test "$found" = "yes"; then ++ + +- case $ac_ii in ++ case socket in + c|c_r|pthread*) ;; + *) +- LIBS="$LIBS -l$ac_ii" ++ LIBS="-lsocket $LIBS" + ;; + esac + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_DNS_SEARCH 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBSOCKET 1 ++EOF + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ ac_cv_func_dns_search=yes + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++ : + +- +- if test "$ext_shared" = "yes"; then +- SOAP_SHARED_LIBADD="-L$ai_p $SOAP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SOAP_SHARED_LIBADD="$ld_runpath_switch$ai_p $SOAP_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- + fi ++ + +- +- fi +- + fi ++ + +- ;; +- esac +- done +- +- +- for ac_i in $LIBXML_INCS; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ;; + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ esac + +- fi + +- ;; +- esac +- done ++ unset ac_cv_func_dn_expand ++ unset ac_cv_func___dn_expand ++ unset found ++ ++ echo $ac_n "checking for dn_expand""... $ac_c" 1>&6 ++echo "configure:91709: checking for dn_expand" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_dn_expand'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char dn_expand(); + ++int main() { + +- echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:85434: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_dn_expand) || defined (__stub___dn_expand) ++choke me ++#else ++dn_expand(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:91737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_dn_expand=yes" + else +- +- +- old_LIBS=$LIBS +- LIBS=" +- $SOAP_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS +- ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_dn_expand=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'dn_expand`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __dn_expand""... $ac_c" 1>&6 ++echo "configure:91755: checking for __dn_expand" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___dn_expand'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __dn_expand(); + +- +- char xmlInitParser(); +- int main() { +- xmlInitParser(); +- return 0; +- } +- ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___dn_expand) || defined (__stub_____dn_expand) ++choke me ++#else ++__dn_expand(); ++#endif ++ ++; return 0; } + EOF +-if { (eval echo configure:85461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- LIBS=$old_LIBS +- +- php_cv_libxml_build_works=yes +- +- ++if { (eval echo configure:91783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___dn_expand=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- ++ rm -rf conftest* ++ eval "ac_cv_func___dn_expand=no" + fi +-rm -fr conftest* ++rm -f conftest* + fi + +- +- ++if eval "test \"`echo '$ac_cv_func_'__dn_expand`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + fi + +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF + +- fi +- ++ case $found in ++ yes) + cat >> confdefs.h <<\EOF +-#define HAVE_SOAP 1 ++#define HAVE_DN_EXPAND 1 + EOF + +- +- ext_builddir=ext/soap +- ext_srcdir=$abs_srcdir/ext/soap +- +- ac_extra= +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SOAP_SHARED=no +- +- +- case ext/soap in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ ac_cv_func_dn_expand=yes ++ ;; + ++ *) + ++ unset ac_cv_lib_resolv_dn_expand ++ unset ac_cv_lib_resolv___dn_expand ++ unset found ++ echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6 ++echo "configure:91821: checking for dn_expand in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- old_IFS=$IFS +- for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ echo $ac_n "checking for __dn_expand in -lresolv""... $ac_c" 1>&6 ++echo "configure:91860: checking for __dn_expand in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'__dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- EXT_STATIC="$EXT_STATIC soap" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC soap" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SOAP_SHARED=yes +- +- case ext/soap in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- + ++fi + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo + ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lresolv" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi ++ ++ LIBS=$ac_libs ++ fi + +- old_IFS=$IFS +- for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do ++ if test "$found" = "yes"; then ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_soap="$shared_objects_soap $ac_bdir$ac_obj.lo" ++ case resolv in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lresolv $LIBS" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_DN_EXPAND 1 + EOF +- done +- +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsoap.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(PHPSOAP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsoap.so '$ext_builddir'/phpsoap.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSOAP, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(PHPSOAP_SHARED_LIBADD)' +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRESOLV 1 ++EOF + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsoap.$suffix" ++ ac_cv_func_dn_expand=yes + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsoap.$suffix" +- fi ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_soap" ++ unset ac_cv_lib_bind_dn_expand ++ unset ac_cv_lib_bind___dn_expand ++ unset found ++ echo $ac_n "checking for dn_expand in -lbind""... $ac_c" 1>&6 ++echo "configure:91957: checking for dn_expand in -lbind" >&5 ++ac_lib_var=`echo bind'_'dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbind $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- cat >>Makefile.objects<&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-$ext_builddir/phpsoap.$suffix: \$(shared_objects_soap) \$(PHPSOAP_SHARED_DEPENDENCIES) +- $link_cmd ++ echo $ac_n "checking for __dn_expand in -lbind""... $ac_c" 1>&6 ++echo "configure:91996: checking for __dn_expand in -lbind" >&5 ++ac_lib_var=`echo bind'_'__dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbind $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- *) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/soap.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(SOAP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/soap.so '$ext_builddir'/soap.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SOAP, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_soap) $(SOAP_SHARED_LIBADD)' +- ;; +- esac ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/soap.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/soap.$suffix" +- fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_soap" +- +- cat >>Makefile.objects<> confdefs.h < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- fi ++ LIBS=$ac_libs + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_SOAP_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- ++ if test "$found" = "yes"; then ++ + +- case ext/soap in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ case bind in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lbind $LIBS" ++ ;; + esac +- +- + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + ++ cat >> confdefs.h <<\EOF ++#define HAVE_DN_EXPAND 1 ++EOF + +- old_IFS=$IFS +- for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBBIND 1 ++EOF + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ ac_cv_func_dn_expand=yes ++ else ++ ++ ++ unset ac_cv_lib_socket_dn_expand ++ unset ac_cv_lib_socket___dn_expand ++ unset found ++ echo $ac_n "checking for dn_expand in -lsocket""... $ac_c" 1>&6 ++echo "configure:92093: checking for dn_expand in -lsocket" >&5 ++ac_lib_var=`echo socket'_'dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- EXT_STATIC="$EXT_STATIC soap" +- ;; +- *) +- +- +- case ext/soap in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/soap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/soap/"; ac_bdir="ext/soap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++ echo $ac_n "checking for __dn_expand in -lsocket""... $ac_c" 1>&6 ++echo "configure:92132: checking for __dn_expand in -lsocket" >&5 ++ac_lib_var=`echo socket'_'__dn_expand | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- old_IFS=$IFS +- for ac_src in soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c; do + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC soap" ++ LIBS=$ac_libs + fi ++ ++ if test "$found" = "yes"; then ++ + +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- ++ case socket in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsocket $LIBS" ++ ;; ++ esac + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=soap +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ cat >> confdefs.h <<\EOF ++#define HAVE_DN_EXPAND 1 ++EOF + +- fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBSOCKET 1 ++EOF + ++ ac_cv_func_dn_expand=yes ++ else + +- PHP_VAR_SUBST="$PHP_VAR_SUBST SOAP_SHARED_LIBADD" ++ : + ++ fi + +- else +- { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } ++ ++ fi + ++ + fi ++ ++ ;; ++ ++ esac + +-fi + ++ unset ac_cv_func_dn_skipname ++ unset ac_cv_func___dn_skipname ++ unset found ++ ++ echo $ac_n "checking for dn_skipname""... $ac_c" 1>&6 ++echo "configure:92244: checking for dn_skipname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_dn_skipname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char dn_skipname(); + ++int main() { + +-php_enable_sockets=no ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_dn_skipname) || defined (__stub___dn_skipname) ++choke me ++#else ++dn_skipname(); ++#endif + +-echo $ac_n "checking whether to enable sockets support""... $ac_c" 1>&6 +-echo "configure:85811: checking whether to enable sockets support" >&5 +-# Check whether --enable-sockets or --disable-sockets was given. +-if test "${enable_sockets+set}" = set; then +- enableval="$enable_sockets" +- PHP_SOCKETS=$enableval ++; return 0; } ++EOF ++if { (eval echo configure:92272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_dn_skipname=yes" + else +- +- PHP_SOCKETS=no +- test "$PHP_ENABLE_ALL" && PHP_SOCKETS=$PHP_ENABLE_ALL +- ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_dn_skipname=no" ++fi ++rm -f conftest* + fi + ++if eval "test \"`echo '$ac_cv_func_'dn_skipname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __dn_skipname""... $ac_c" 1>&6 ++echo "configure:92290: checking for __dn_skipname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___dn_skipname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __dn_skipname(); ++ ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___dn_skipname) || defined (__stub_____dn_skipname) ++choke me ++#else ++__dn_skipname(); ++#endif + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SOCKETS in +-shared,*) +- PHP_SOCKETS=`echo "$PHP_SOCKETS"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SOCKETS=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++; return 0; } ++EOF ++if { (eval echo configure:92318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___dn_skipname=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___dn_skipname=no" ++fi ++rm -f conftest* ++fi + ++if eval "test \"`echo '$ac_cv_func_'__dn_skipname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ ++fi + + +-echo "$ac_t""$ext_output" 1>&6 ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_DN_SKIPNAME 1 ++EOF + ++ ac_cv_func_dn_skipname=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_resolv_dn_skipname ++ unset ac_cv_lib_resolv___dn_skipname ++ unset found ++ echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6 ++echo "configure:92356: checking for dn_skipname in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-if test "$PHP_SOCKETS" != "no"; then +- echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6 +-echo "configure:85853: checking for struct cmsghdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_cmsghdr'+set}'`\" = set"; then ++ echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6 ++echo "configure:92395: checking for __dn_skipname in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- cat > conftest.$ac_ext < conftest.$ac_ext < +-#include + int main() { +-struct cmsghdr s; s ++__dn_skipname() + ; return 0; } + EOF +-if { (eval echo configure:85868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:92414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- ac_cv_cmsghdr=yes ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_cmsghdr=no ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + + fi + +-echo "$ac_t""$ac_cv_cmsghdr" 1>&6 + +- if test "$ac_cv_cmsghdr" = yes; then ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lresolv" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi ++ ++ LIBS=$ac_libs ++ fi ++ ++ if test "$found" = "yes"; then ++ ++ ++ case resolv in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lresolv $LIBS" ++ ;; ++ esac ++ ++ + cat >> confdefs.h <<\EOF +-#define HAVE_CMSGHDR 1 ++#define HAVE_DN_SKIPNAME 1 + EOF + +- fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRESOLV 1 ++EOF + +- for ac_func in hstrerror socketpair +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:85893: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ ac_cv_func_dn_skipname=yes ++ else ++ ++ ++ unset ac_cv_lib_bind_dn_skipname ++ unset ac_cv_lib_bind___dn_skipname ++ unset found ++ echo $ac_n "checking for dn_skipname in -lbind""... $ac_c" 1>&6 ++echo "configure:92492: checking for dn_skipname in -lbind" >&5 ++ac_lib_var=`echo bind'_'dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++char dn_skipname(); + + int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- ++dn_skipname() + ; return 0; } + EOF +-if { (eval echo configure:85921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:92511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +-fi ++LIBS="$ac_save_LIBS" + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done + +- for ac_hdr in netdb.h netinet/tcp.h sys/un.h errno.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:85949: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "checking for __dn_skipname in -lbind""... $ac_c" 1>&6 ++echo "configure:92531: checking for __dn_skipname in -lbind" >&5 ++ac_lib_var=`echo bind'_'__dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __dn_skipname(); ++ ++int main() { ++__dn_skipname() ++; return 0; } + EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:85959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then ++if { (eval echo configure:92550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" ++ eval "ac_cv_lib_$ac_lib_var=yes" + else +- echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" ++ + fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 ++found=no ++fi ++ ++ + fi +-done + ++ ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lbind" ++ if test "$cross_compiling" = yes; then ++ found=no ++else + cat > conftest.$ac_ext < +-#include +- +-int main() { +-static struct msghdr tp; int n = (int) tp.msg_flags; return n +-; return 0; } ++main() { return (0); } + EOF +-if { (eval echo configure:85996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- : ++if { (eval echo configure:92586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -rf conftest* +- cat >> confdefs.h <<\EOF +-#define MISSING_MSGHDR_MSGFLAGS 1 +-EOF +- +- ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* + fi +-rm -f conftest* +- cat >> confdefs.h <<\EOF +-#define HAVE_SOCKETS 1 +-EOF +- +- +- +- ext_builddir=ext/sockets +- ext_srcdir=$abs_srcdir/ext/sockets + +- ac_extra= ++ LIBS=$ac_libs ++ fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SOCKETS_SHARED=no ++ if test "$found" = "yes"; then + + +- case ext/sockets in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ case bind in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lbind $LIBS" ++ ;; + esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in sockets.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_DN_SKIPNAME 1 + EOF +- done +- +- +- EXT_STATIC="$EXT_STATIC sockets" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC sockets" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SOCKETS_SHARED=yes +- +- case ext/sockets in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo +- +- +- old_IFS=$IFS +- for ac_src in sockets.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_sockets="$shared_objects_sockets $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_LIBBIND 1 + EOF +- done + +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsockets.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(PHPSOCKETS_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsockets.so '$ext_builddir'/phpsockets.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSOCKETS, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(PHPSOCKETS_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsockets.$suffix" ++ ac_cv_func_dn_skipname=yes + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsockets.$suffix" +- fi ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sockets" +- +- cat >>Makefile.objects<&6 ++echo "configure:92628: checking for dn_skipname in -lsocket" >&5 ++ac_lib_var=`echo socket'_'dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- *) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/sockets.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(SOCKETS_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/sockets.so '$ext_builddir'/sockets.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SOCKETS, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(SOCKETS_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/sockets.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/sockets.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sockets" +- +- cat >>Makefile.objects<&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-EOF ++ echo $ac_n "checking for __dn_skipname in -lsocket""... $ac_c" 1>&6 ++echo "configure:92667: checking for __dn_skipname in -lsocket" >&5 ++ac_lib_var=`echo socket'_'__dn_skipname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- fi +- fi +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_SOCKETS_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/sockets in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- old_IFS=$IFS +- for ac_src in sockets.c; do + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + ++ LIBS=$ac_libs ++ fi + +- old_IFS=$IFS +- for ac_src in sockets.c; do ++ if test "$found" = "yes"; then ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ case socket in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsocket $LIBS" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_DN_SKIPNAME 1 + EOF +- done +- +- +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC sockets" +- fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBSOCKET 1 ++EOF + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=sockets ++ ac_cv_func_dn_skipname=yes ++ else + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ : + + fi +- + ++ ++ fi + +- header_path=ext/sockets/ +- for header_file in php_sockets.h; do +- hp_hf="$header_path/$header_file" +- ++ ++ fi + +- unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ;; + +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" +- +- INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" +- +- fi ++ esac + +- done +- + +-fi + + +- echo $ac_n "checking whether zend_object_value is packed""... $ac_c" 1>&6 +-echo "configure:86330: checking whether zend_object_value is packed" >&5 +- old_CPPFLAGS=$CPPFLAGS +- CPPFLAGS="$INCLUDES -I$abs_srcdir $CPPFLAGS" +- if test "$cross_compiling" = yes; then +- +- ac_result=0 +- echo "$ac_t""no" 1>&6 ++ unset ac_cv_func_res_search ++ unset ac_cv_func___res_search ++ unset found + ++ echo $ac_n "checking for res_search""... $ac_c" 1>&6 ++echo "configure:92781: checking for res_search" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char res_search(); + +-#include "Zend/zend_types.h" +-int main(int argc, char **argv) { +- return ((sizeof(zend_object_handle) + sizeof(zend_object_handlers*)) == sizeof(zend_object_value)) ? 0 : 1; +-} +- ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_res_search) || defined (__stub___res_search) ++choke me ++#else ++res_search(); ++#endif ++ ++; return 0; } + EOF +-if { (eval echo configure:86349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_result=1 +- echo "$ac_t""yes" 1>&6 +- ++if { (eval echo configure:92809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_res_search=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_result=0 +- echo "$ac_t""no" 1>&6 +- ++ rm -rf conftest* ++ eval "ac_cv_func_res_search=no" + fi +-rm -fr conftest* ++rm -f conftest* + fi + +- CPPFLAGS=$old_CPPFLAGS +- cat >> confdefs.h <&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __res_search""... $ac_c" 1>&6 ++echo "configure:92827: checking for __res_search" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___res_search'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __res_search(); + +- cat >> confdefs.h <<\EOF +-#define HAVE_SPL 1 ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___res_search) || defined (__stub_____res_search) ++choke me ++#else ++__res_search(); ++#endif ++ ++; return 0; } + EOF ++if { (eval echo configure:92855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___res_search=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___res_search=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'__res_search`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- +- ext_builddir=ext/spl +- ext_srcdir=$abs_srcdir/ext/spl ++fi + +- ac_extra= + +- if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then +- PHP_SPL_SHARED=no +- +- +- case ext/spl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_SEARCH 1 ++EOF ++ ++ ac_cv_func_res_search=yes ++ ;; + ++ *) + ++ unset ac_cv_lib_resolv_res_search ++ unset ac_cv_lib_resolv___res_search ++ unset found ++ echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 ++echo "configure:92893: checking for res_search in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- old_IFS=$IFS +- for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ echo $ac_n "checking for __res_search in -lresolv""... $ac_c" 1>&6 ++echo "configure:92932: checking for __res_search in -lresolv" >&5 ++ac_lib_var=`echo resolv'_'__res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lresolv $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- EXT_STATIC="$EXT_STATIC spl" +- if test "no" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC spl" +- fi +- else +- if test "no" = "shared" || test "no" = "yes"; then +- PHP_SPL_SHARED=yes +- +- case ext/spl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- + ++fi + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo + ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lresolv" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi ++ ++ LIBS=$ac_libs ++ fi + +- old_IFS=$IFS +- for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do ++ if test "$found" = "yes"; then ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_spl="$shared_objects_spl $ac_bdir$ac_obj.lo" ++ case resolv in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lresolv $LIBS" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_RES_SEARCH 1 + EOF +- done +- +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpspl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(PHPSPL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpspl.so '$ext_builddir'/phpspl.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSPL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(PHPSPL_SHARED_LIBADD)' +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBRESOLV 1 ++EOF + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpspl.$suffix" ++ ac_cv_func_res_search=yes + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpspl.$suffix" +- fi ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_spl" +- +- cat >>Makefile.objects<&6 ++echo "configure:93029: checking for res_search in -lbind" >&5 ++ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbind $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- ;; +- *) +- +- install_modules="install-modules" ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/spl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(SPL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/spl.so '$ext_builddir'/spl.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SPL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_spl) $(SPL_SHARED_LIBADD)' +- ;; +- esac ++ echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6 ++echo "configure:93068: checking for __res_search in -lbind" >&5 ++ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lbind $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- cat >>Makefile.objects<&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +-$ext_builddir/spl.$suffix: \$(shared_objects_spl) \$(SPL_SHARED_DEPENDENCIES) +- $link_cmd ++ ++fi + +-EOF + +- ;; +- esac +- cat >> confdefs.h < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- fi ++ LIBS=$ac_libs + fi + +- if test "no" != "shared" && test "no" != "yes" && test "" = "cli"; then +- PHP_SPL_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- ++ if test "$found" = "yes"; then ++ + +- case ext/spl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ case bind in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lbind $LIBS" ++ ;; + esac +- +- + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_SEARCH 1 ++EOF + +- old_IFS=$IFS +- for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBBIND 1 ++EOF + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ ac_cv_func_res_search=yes ++ else ++ ++ ++ unset ac_cv_lib_socket_res_search ++ unset ac_cv_lib_socket___res_search ++ unset found ++ echo $ac_n "checking for res_search in -lsocket""... $ac_c" 1>&6 ++echo "configure:93165: checking for res_search in -lsocket" >&5 ++ac_lib_var=`echo socket'_'res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +- EXT_STATIC="$EXT_STATIC spl" +- ;; +- *) +- +- +- case ext/spl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/spl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/spl/"; ac_bdir="ext/spl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- ++ echo $ac_n "checking for __res_search in -lsocket""... $ac_c" 1>&6 ++echo "configure:93204: checking for __res_search in -lsocket" >&5 ++ac_lib_var=`echo socket'_'__res_search | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lsocket $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +- old_IFS=$IFS +- for ac_src in php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c; do + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC spl" ++ LIBS=$ac_libs + fi ++ ++ if test "$found" = "yes"; then ++ + +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- ++ case socket in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsocket $LIBS" ++ ;; ++ esac + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=spl +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ cat >> confdefs.h <<\EOF ++#define HAVE_RES_SEARCH 1 ++EOF + +- fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBSOCKET 1 ++EOF + +- +- +- header_path=ext/spl +- for header_file in php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h; do +- hp_hf="$header_path/$header_file" +- +- +- unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" ++ ac_cv_func_res_search=yes ++ else + +- INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" +- +- fi ++ : + +- done ++ fi + + +- +- am_i_shared=$PHP_SPL_SHARED +- is_it_shared=$PHP_PCRE_SHARED +- is_it_enabled=$PHP_PCRE +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension spl to build statically, but it +-depends on extension pcre, which you've configured to build shared. +-You either need to build spl shared or build pcre statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension spl, which depends on extension pcre, +-but you've either not enabled pcre, or have disabled it. +-" 1>&2; exit 1; } + fi + + ++ fi ++ ++ ;; ++ ++ esac + + +-php_with_sqlite=yes +- +-echo $ac_n "checking for sqlite support""... $ac_c" 1>&6 +-echo "configure:86713: checking for sqlite support" >&5 +-# Check whether --with-sqlite or --without-sqlite was given. +-if test "${with_sqlite+set}" = set; then +- withval="$with_sqlite" +- PHP_SQLITE=$withval ++echo $ac_n "checking whether atof() accepts NAN""... $ac_c" 1>&6 ++echo "configure:93312: checking whether atof() accepts NAN" >&5 ++if eval "test \"`echo '$''{'ac_cv_atof_accept_nan'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + +- PHP_SQLITE=yes +- test "$PHP_ENABLE_ALL" && PHP_SQLITE=$PHP_ENABLE_ALL +- +-fi +- ++if test "$cross_compiling" = yes; then ++ ++ ac_cv_atof_accept_nan=no + ++else ++ cat > conftest.$ac_ext < ++#include + ++#ifdef HAVE_ISNAN ++#define zend_isnan(a) isnan(a) ++#elif defined(HAVE_FPCLASS) ++#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) ++#else ++#define zend_isnan(a) 0 ++#endif + ++int main(int argc, char** argv) ++{ ++ return zend_isnan(atof("NAN")) ? 0 : 1; ++} + +-echo "$ac_t""$ext_output" 1>&6 ++EOF ++if { (eval echo configure:93343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_atof_accept_nan=yes + ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_atof_accept_nan=no + ++fi ++rm -fr conftest* ++fi + ++fi + ++echo "$ac_t""$ac_cv_atof_accept_nan" 1>&6 ++if test "$ac_cv_atof_accept_nan" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ATOF_ACCEPTS_NAN 1 ++EOF + +-php_enable_sqlite_utf8=no ++fi + +-echo $ac_n "checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)""... $ac_c" 1>&6 +-echo "configure:86757: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5 +-# Check whether --enable-sqlite-utf8 or --disable-sqlite-utf8 was given. +-if test "${enable_sqlite_utf8+set}" = set; then +- enableval="$enable_sqlite_utf8" +- PHP_SQLITE_UTF8=$enableval ++echo $ac_n "checking whether atof() accepts INF""... $ac_c" 1>&6 ++echo "configure:93370: checking whether atof() accepts INF" >&5 ++if eval "test \"`echo '$''{'ac_cv_atof_accept_inf'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else + +- PHP_SQLITE_UTF8=no ++if test "$cross_compiling" = yes; then + ++ ac_cv_atof_accept_inf=no + +-fi +- ++else ++ cat > conftest.$ac_ext <&6 ++#include ++#include + ++#ifdef HAVE_ISINF ++#define zend_isinf(a) isinf(a) ++#elif defined(INFINITY) ++/* Might not work, but is required by ISO C99 */ ++#define zend_isinf(a) (((a)==INFINITY)?1:0) ++#elif defined(HAVE_FPCLASS) ++#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) ++#else ++#define zend_isinf(a) 0 ++#endif + ++int main(int argc, char** argv) ++{ ++ return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1; ++} + ++EOF ++if { (eval echo configure:93404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ ac_cv_atof_accept_inf=yes + ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_atof_accept_inf=no + ++fi ++rm -fr conftest* ++fi + ++fi + ++echo "$ac_t""$ac_cv_atof_accept_inf" 1>&6 ++if test "$ac_cv_atof_accept_inf" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_ATOF_ACCEPTS_INF 1 ++EOF + ++fi + +-if test "$PHP_SQLITE" != "no"; then +- if test "$PHP_PDO" != "no"; then +- +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:86785: checking for PDO includes" >&5 +-if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then ++echo $ac_n "checking whether HUGE_VAL == INF""... $ac_c" 1>&6 ++echo "configure:93431: checking whether HUGE_VAL == INF" >&5 ++if eval "test \"`echo '$''{'ac_cv_huge_val_inf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + +- echo $ac_n "checking for PDO includes""... $ac_c" 1>&6 +-echo "configure:86791: checking for PDO includes" >&5 +- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$abs_srcdir/ext +- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then +- pdo_inc_path=$prefix/include/php/ext +- fi ++if test "$cross_compiling" = yes; then + +-fi +- +-echo "$ac_t""$pdo_inc_path" 1>&6 +- if test -n "$pdo_inc_path"; then +-: +- else +-echo "configure: warning: Cannot find php_pdo_driver.h." 1>&2 +- fi ++ ac_cv_huge_val_inf=yes + +- if test -n "$pdo_inc_path"; then +- cat >> confdefs.h <<\EOF +-#define PHP_SQLITE2_HAVE_PDO 1 +-EOF ++else ++ cat > conftest.$ac_ext < ++#include + +- if test "$PHP_SQLITE" != "yes"; then +- SEARCH_PATH="/usr/local /usr" +- SEARCH_FOR="/include/sqlite.h" +- if test -r $PHP_SQLITE/; then # path given as parameter +- SQLITE_DIR=$PHP_SQLITE +- else # search default path list +- echo $ac_n "checking for sqlite files in default path""... $ac_c" 1>&6 +-echo "configure:86825: checking for sqlite files in default path" >&5 +- for i in $SEARCH_PATH ; do +- if test -r $i/$SEARCH_FOR; then +- SQLITE_DIR=$i +- echo "$ac_t""found in $i" 1>&6 +- fi +- done +- fi +- +- if test -z "$SQLITE_DIR"; then +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Please reinstall the sqlite distribution from http://www.sqlite.org" 1>&2; exit 1; } +- fi ++#ifdef HAVE_ISINF ++#define zend_isinf(a) isinf(a) ++#elif defined(INFINITY) ++/* Might not work, but is required by ISO C99 */ ++#define zend_isinf(a) (((a)==INFINITY)?1:0) ++#elif defined(HAVE_FPCLASS) ++#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) ++#else ++#define zend_isinf(a) 0 ++#endif + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$SQLITE_DIR/$PHP_LIBDIR -lm +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++int main(int argc, char** argv) ++{ ++ return zend_isinf(HUGE_VAL) ? 0 : 1; ++} + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++EOF ++if { (eval echo configure:93465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ ac_cv_huge_val_inf=yes + ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ ac_cv_huge_val_inf=no + +- fi +- ;; +- esac ++fi ++rm -fr conftest* ++fi + ++fi + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++echo "$ac_t""$ac_cv_huge_val_inf" 1>&6 ++if test "$ac_cv_huge_val_inf" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_HUGE_VAL_INF 1 ++EOF + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- ++fi ++ ++echo $ac_n "checking whether HUGE_VAL + -HUGEVAL == NAN""... $ac_c" 1>&6 ++echo "configure:93492: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5 ++if eval "test \"`echo '$''{'ac_cv_huge_val_nan'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + ++if test "$cross_compiling" = yes; then + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ac_cv_huge_val_nan=yes ++ ++else ++ cat > conftest.$ac_ext < ++#include ++ ++#ifdef HAVE_ISNAN ++#define zend_isnan(a) isnan(a) ++#elif defined(HAVE_FPCLASS) ++#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) ++#else ++#define zend_isnan(a) 0 ++#endif ++ ++int main(int argc, char** argv) ++{ ++#if defined(__sparc__) && !(__GNUC__ >= 3) ++ /* prevent bug #27830 */ ++ return 1; ++#else ++ return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1; ++#endif ++} ++ ++EOF ++if { (eval echo configure:93528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ac_cv_huge_val_nan=yes ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- fi ++ ac_cv_huge_val_nan=no + ++fi ++rm -fr conftest* ++fi + +- fi +- +- fi ++fi + +- ;; +- esac +- done ++echo "$ac_t""$ac_cv_huge_val_nan" 1>&6 ++if test "$ac_cv_huge_val_nan" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_HUGE_VAL_NAN 1 ++EOF + +- echo $ac_n "checking for sqlite_open in -lsqlite""... $ac_c" 1>&6 +-echo "configure:86937: checking for sqlite_open in -lsqlite" >&5 +-ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++fi ++ ++echo $ac_n "checking whether strptime() declaration fails""... $ac_c" 1>&6 ++echo "configure:93555: checking whether strptime() declaration fails" >&5 ++if eval "test \"`echo '$''{'ac_cv_strptime_decl_fails'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-lsqlite $LIBS" ++ + cat > conftest.$ac_ext < + + int main() { +-sqlite_open() ++ ++#ifndef HAVE_STRPTIME ++#error no strptime() on this platform ++#else ++/* use invalid strptime() declaration to see if it fails to compile */ ++int strptime(const char *s, const char *format, struct tm *tm); ++#endif ++ + ; return 0; } + EOF +-if { (eval echo configure:86956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:93577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++ ac_cv_strptime_decl_fails=no ++ + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ ++ ac_cv_strptime_decl_fails=yes ++ + fi + rm -f conftest* +-LIBS="$ac_save_LIBS" +- + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- if test "$ext_shared" = "yes"; then +- SQLITE_SHARED_LIBADD="-lsqlite $SQLITE_SHARED_LIBADD" +- if test -n "$SQLITE_DIR/$PHP_LIBDIR"; then +- +- if test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$SQLITE_DIR/$PHP_LIBDIR" || echo "$SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$SQLITE_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SQLITE_DIR/$PHP_LIBDIR\"`" +- fi + +- +- if test "$ext_shared" = "yes"; then +- SQLITE_SHARED_LIBADD="-L$ai_p $SQLITE_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SQLITE_SHARED_LIBADD="$ld_runpath_switch$ai_p $SQLITE_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++echo "$ac_t""$ac_cv_strptime_decl_fails" 1>&6 ++if test "$ac_cv_strptime_decl_fails" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_STRPTIME_DECL_FAILS 1 ++EOF + ++fi + +- fi +- +- fi ++for ac_hdr in wchar.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:93605: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:93615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done + +- fi +- else +- ++for ac_func in mblen ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:93644: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + +- if test -n "$SQLITE_DIR/$PHP_LIBDIR"; then +- +- if test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SQLITE_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$SQLITE_DIR/$PHP_LIBDIR" || echo "$SQLITE_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$SQLITE_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $SQLITE_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SQLITE_DIR/$PHP_LIBDIR\"`" +- fi ++int main() { + +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + ++; return 0; } ++EOF ++if { (eval echo configure:93672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + +- +- fi ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done + +- fi +- +- +- case sqlite in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsqlite $LIBS" +- ;; +- esac ++for ac_func in mbrlen mbsinit ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:93699: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); + ++int main() { + ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif + ++; return 0; } ++EOF ++if { (eval echo configure:93727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + +- fi ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++fi ++done + ++echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6 ++echo "configure:93752: checking for mbstate_t" >&5 ++if eval "test \"`echo '$''{'ac_cv_type_mbstate_t'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++cat > conftest.$ac_ext </dev/null ; then +- ai_p=$SQLITE_DIR/include +- else +- +- ep_dir="`echo $SQLITE_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SQLITE_DIR/include\"`" +- fi ++#ifdef HAVE_WCHAR_H ++# include ++#endif + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++int main() { + +- fi ++int __tmp__() { mbstate_t a; } + +- ++; return 0; } ++EOF ++if { (eval echo configure:93771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* + +-else +- echo "$ac_t""no" 1>&6 ++ ac_cv_type_mbstate_t=yes + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_sqlite_sqlite_open +- +- { echo "configure: error: wrong sqlite lib version or lib not found" 1>&2; exit 1; } +- ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* + ++ ac_cv_type_mbstate_t=no ++ ++fi ++rm -f conftest* + fi + +- SQLITE_MODULE_TYPE=external +- PHP_SQLITE_CFLAGS=$pdo_inc_path +- sqlite_extra_sources="libsqlite/src/encode.c" +- else +- # use bundled library +- +- # we only support certain lemon versions +- lemon_version_list="1.0" ++echo "$ac_t""$ac_cv_type_mbstate_t" 1>&6 ++if test "$ac_cv_type_mbstate_t" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_MBSTATE_T 1 ++EOF + +- # Extract the first word of "lemon", so it can be a program name with args. +-set dummy lemon; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:87129: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_prog_LEMON'+set}'`\" = set"; then ++fi ++ ++for ac_hdr in atomic.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:93799: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- if test -n "$LEMON"; then +- ac_cv_prog_LEMON="$LEMON" # Let the user override the test. ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:93809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" + else +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_prog_LEMON="lemon" +- break +- fi +- done +- IFS="$ac_save_ifs" +-fi ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" + fi +-LEMON="$ac_cv_prog_LEMON" +-if test -n "$LEMON"; then +- echo "$ac_t""$LEMON" 1>&6 +-else +- echo "$ac_t""no" 1>&6 ++rm -f conftest* + fi +- +- if test "$LEMON"; then +- echo $ac_n "checking for lemon version""... $ac_c" 1>&6 +-echo "configure:87157: checking for lemon version" >&5 +-if eval "test \"`echo '$''{'php_cv_lemon_version'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- lemon_version=`$LEMON -x 2>/dev/null | $SED -e 's/^.* //'` +- php_cv_lemon_version=invalid +- for lemon_check_version in $lemon_version_list; do +- if test "$lemon_version" = "$lemon_check_version"; then +- php_cv_lemon_version="$lemon_check_version (ok)" +- fi +- done +- ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 + fi ++done + +-echo "$ac_t""$php_cv_lemon_version" 1>&6 +- else +- lemon_version=none +- fi +- case $php_cv_lemon_version in +- ""|invalid) +- lemon_msg="lemon versions supported for regeneration of libsqlite parsers: $lemon_version_list (found: $lemon_version)." +- echo "configure: warning: $lemon_msg" 1>&2 +- LEMON="exit 0;" +- ;; +- esac +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST LEMON" + + +- SQLITE_MODULE_TYPE=builtin +- PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src -I@ext_builddir@/libsqlite/src $pdo_inc_path" +- sqlite_extra_sources="libsqlite/src/opcodes.c \ +- libsqlite/src/parse.c libsqlite/src/encode.c \ +- libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \ +- libsqlite/src/delete.c libsqlite/src/expr.c libsqlite/src/func.c \ +- libsqlite/src/hash.c libsqlite/src/insert.c libsqlite/src/main.c \ +- libsqlite/src/os.c libsqlite/src/pager.c \ +- libsqlite/src/printf.c libsqlite/src/random.c \ +- libsqlite/src/select.c libsqlite/src/table.c libsqlite/src/tokenize.c \ +- libsqlite/src/update.c libsqlite/src/util.c libsqlite/src/vdbe.c \ +- libsqlite/src/attach.c libsqlite/src/btree_rb.c libsqlite/src/pragma.c \ +- libsqlite/src/vacuum.c libsqlite/src/copy.c \ +- libsqlite/src/vdbeaux.c libsqlite/src/date.c \ +- libsqlite/src/where.c libsqlite/src/trigger.c" +- fi +- sqlite_sources="sqlite.c sess_sqlite.c pdo_sqlite2.c $sqlite_extra_sources" +- +- ext_builddir=ext/sqlite +- ext_srcdir=$abs_srcdir/ext/sqlite ++ ext_builddir=ext/standard ++ ext_srcdir=$abs_srcdir/ext/standard + +- ac_extra=`echo "$PHP_SQLITE_CFLAGS"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ ac_extra= + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SQLITE_SHARED=no ++ if test "" != "shared" && test "" != "yes" && test "" != "cli"; then ++ PHP_STANDARD_SHARED=no + + +- case ext/sqlite in ++ case ext/standard in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sqlite/"; ac_bdir="ext/sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -87228,7 +93860,17 @@ echo "$ac_t""$php_cv_lemon_version" 1>&6 + + + old_IFS=$IFS +- for ac_src in $sqlite_sources; do ++ for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ ++ cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ ++ flock_compat.c formatted_print.c fsock.c head.c html.c image.c \ ++ info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \ ++ microtime.c pack.c pageinfo.c quot_print.c rand.c \ ++ soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ ++ var.c versioning.c assert.c strnatcmp.c levenshtein.c \ ++ incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ ++ http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ ++ var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \ ++ filters.c proc_open.c streamsfuncs.c http.c; do + + IFS=. + set $ac_src +@@ -87251,18 +93893,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC sqlite" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC sqlite" ++ EXT_STATIC="$EXT_STATIC standard" ++ if test "" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC standard" + fi + else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SQLITE_SHARED=yes ++ if test "" = "shared" || test "" = "yes"; then ++ PHP_STANDARD_SHARED=yes + +- case ext/sqlite in ++ case ext/standard in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sqlite"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sqlite/"; ac_bdir="ext/sqlite/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -87277,14 +93919,24 @@ EOF + + + old_IFS=$IFS +- for ac_src in $sqlite_sources; do ++ for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ ++ cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ ++ flock_compat.c formatted_print.c fsock.c head.c html.c image.c \ ++ info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \ ++ microtime.c pack.c pageinfo.c quot_print.c rand.c \ ++ soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ ++ var.c versioning.c assert.c strnatcmp.c levenshtein.c \ ++ incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ ++ http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ ++ var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \ ++ filters.c proc_open.c streamsfuncs.c http.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_sqlite="$shared_objects_sqlite $ac_bdir$ac_obj.lo" ++ shared_objects_standard="$shared_objects_standard $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -87307,31 +93959,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsqlite.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) $(PHPSQLITE_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsqlite.so '$ext_builddir'/phpsqlite.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpstandard.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpstandard.so '$ext_builddir'/phpstandard.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSQLITE, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSTANDARD, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sqlite) $(PHPSQLITE_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsqlite.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpstandard.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsqlite.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpstandard.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sqlite" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_standard" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects<&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension sqlite, which depends on extension spl, +-but you've either not enabled spl, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- am_i_shared=$PHP_SQLITE_SHARED +- is_it_shared=$PHP_PDO_SHARED +- is_it_enabled=$PHP_PDO +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension sqlite to build statically, but it +-depends on extension pdo, which you've configured to build shared. +-You either need to build sqlite shared or build pdo statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension sqlite, which depends on extension pdo, +-but you've either not enabled pdo, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- +- src=$ext_srcdir/Makefile.frag +- ac_srcdir=$ext_srcdir +- ac_builddir=$ext_builddir +- test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_SHARED_LIBADD" +- +- +- +- for header_file in $ext_builddir/libsqlite/src/sqlite.h; do +- +- +- unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" +- +- INSTALL_HEADERS="$INSTALL_HEADERS $header_file" +- +- fi +- +- done +- +- +- +- if test "$SQLITE_MODULE_TYPE" = "builtin"; then +- +- +- $php_shtool mkdir -p $ext_builddir/libsqlite/src +- +- +- echo $ac_n "checking size of char *""... $ac_c" 1>&6 +-echo "configure:87570: checking size of char *" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_char_p=4 +-else +- cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(char *)); +- return(0); +-} +-EOF +-if { (eval echo configure:87589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_char_p=`cat conftestval` +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_char_p=0 +-fi +-rm -fr conftest* +-fi +- +-fi +-echo "$ac_t""$ac_cv_sizeof_char_p" 1>&6 +-cat >> confdefs.h <> confdefs.h <<\EOF +-#define SQLITE_PTR_SZ SIZEOF_CHAR_P +-EOF +- +- if test "$PHP_SQLITE_UTF8" = "yes"; then +- SQLITE_ENCODING="UTF8" +- cat >> confdefs.h <<\EOF +-#define SQLITE_UTF8 1 +-EOF +- +- else +- SQLITE_ENCODING="ISO8859" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_ENCODING" +- +- +- SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION` +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST SQLITE_VERSION" +- +- +- sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in > $ext_builddir/libsqlite/src/sqlite.h +- +- if test "$ext_shared" = "no" || test "$ext_srcdir" != "$abs_srcdir"; then +- echo '#include ' > $ext_builddir/libsqlite/src/config.h +- else +- echo "#include \"$abs_builddir/config.h\"" > $ext_builddir/libsqlite/src/config.h +- fi +- +- cat >> $ext_builddir/libsqlite/src/config.h <&6 +-echo "configure:87651: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- +-; return 0; } +-EOF +-if { (eval echo configure:87679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi +- +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done +- +- for ac_hdr in time.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:87707: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:87717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done +- +-fi +- +- +- +-echo $ac_n "checking whether flush should be called explicitly after a buffered io""... $ac_c" 1>&6 +-echo "configure:87748: checking whether flush should be called explicitly after a buffered io" >&5 +-if eval "test \"`echo '$''{'ac_cv_flush_io'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then +- +- ac_cv_flush_io=no +- +-else +- cat > conftest.$ac_ext < +-#include +- +-int main(int argc, char **argv) +-{ +- char *filename = tmpnam(NULL); +- char buffer[64]; +- int result = 0; +- +- FILE *fp = fopen(filename, "wb"); +- if (NULL == fp) +- return 0; +- fputs("line 1\n", fp); +- fputs("line 2\n", fp); +- fclose(fp); +- +- fp = fopen(filename, "rb+"); +- if (NULL == fp) +- return 0; +- fgets(buffer, sizeof(buffer), fp); +- fputs("line 3\n", fp); +- rewind(fp); +- fgets(buffer, sizeof(buffer), fp); +- if (0 != strcmp(buffer, "line 1\n")) +- result = 1; +- fgets(buffer, sizeof(buffer), fp); +- if (0 != strcmp(buffer, "line 3\n")) +- result = 1; +- fclose(fp); +- unlink(filename); +- +- exit(result); +-} ++ esac + ++ cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_flush_io=no +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_cv_flush_io=yes ++ done + +-fi +-rm -fr conftest* +-fi + +-fi ++ EXT_STATIC="$EXT_STATIC standard" ++ ;; ++ *) ++ ++ ++ case ext/standard in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ + +-echo "$ac_t""$ac_cv_flush_io" 1>&6 +-if test "$ac_cv_flush_io" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_FLUSHIO 1 +-EOF ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-fi + +-if test "$ac_cv_func_crypt" = "no"; then +- echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +-echo "configure:87825: checking for crypt in -lcrypt" >&5 +-ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lcrypt $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LIBS="-lcrypt $LIBS -lcrypt" +- cat >> confdefs.h <<\EOF +-#define HAVE_CRYPT 1 ++ cat >>Makefile.objects<&6 +-fi + +-fi ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC standard" ++ fi + +-echo $ac_n "checking for standard DES crypt""... $ac_c" 1>&6 +-echo "configure:87873: checking for standard DES crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_des'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else + +- if test "$cross_compiling" = yes; then ++ BUILD_DIR="$BUILD_DIR $ext_builddir" + +- ac_cv_crypt_des=yes +- +-else +- cat > conftest.$ac_ext < +-#endif + +-#if HAVE_CRYPT_H +-#include +-#endif ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=standard ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + +-main() { +-#if HAVE_CRYPT +- exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M")); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:87903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_crypt_des=yes ++ fi + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_cv_crypt_des=no + +-fi +-rm -fr conftest* +-fi + +-fi ++ src=$ext_srcdir/Makefile.frag ++ ac_srcdir=$ext_srcdir ++ ac_builddir=$ext_builddir ++ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments + +-echo "$ac_t""$ac_cv_crypt_des" 1>&6 + +-echo $ac_n "checking for extended DES crypt""... $ac_c" 1>&6 +-echo "configure:87924: checking for extended DES crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_ext_des'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else + +- if test "$cross_compiling" = yes; then ++ for header_file in ext/standard/; do ++ + +- ac_cv_crypt_ext_des=no ++ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ++ ++ fi + +-else +- cat > conftest.$ac_ext < +-#endif + +-#if HAVE_CRYPT_H +-#include +-#endif + +-main() { +-#if HAVE_CRYPT +- exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc")); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:87954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_crypt_ext_des=yes + ++php_with_sybase_ct=no ++ ++echo $ac_n "checking for Sybase-CT support""... $ac_c" 1>&6 ++echo "configure:94199: checking for Sybase-CT support" >&5 ++# Check whether --with-sybase-ct or --without-sybase-ct was given. ++if test "${with_sybase_ct+set}" = set; then ++ withval="$with_sybase_ct" ++ PHP_SYBASE_CT=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* + +- ac_cv_crypt_ext_des=no ++ PHP_SYBASE_CT=no ++ test "$PHP_ENABLE_ALL" && PHP_SYBASE_CT=$PHP_ENABLE_ALL + + fi +-rm -fr conftest* +-fi + +-fi + +-echo "$ac_t""$ac_cv_crypt_ext_des" 1>&6 + +-echo $ac_n "checking for MD5 crypt""... $ac_c" 1>&6 +-echo "configure:87975: checking for MD5 crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_md5'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then +- +- ac_cv_crypt_md5=no ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SYBASE_CT in ++shared,*) ++ PHP_SYBASE_CT=`echo "$PHP_SYBASE_CT"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SYBASE_CT=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + +-else +- cat > conftest.$ac_ext < +-#endif + +-#if HAVE_CRYPT_H +-#include +-#endif ++echo "$ac_t""$ext_output" 1>&6 + +-main() { +-#if HAVE_CRYPT +- char salt[15], answer[40]; + +- salt[0]='$'; salt[1]='1'; salt[2]='$'; +- salt[3]='r'; salt[4]='a'; salt[5]='s'; +- salt[6]='m'; salt[7]='u'; salt[8]='s'; +- salt[9]='l'; salt[10]='e'; salt[11]='$'; +- salt[12]='\0'; +- strcpy(answer,salt); +- strcat(answer,"rISCgZzpwk3UhDidwXvin0"); +- exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:88014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_crypt_md5=yes + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_cv_crypt_md5=no + +-fi +-rm -fr conftest* +-fi ++if test "$PHP_SYBASE_CT" != "no"; then + +-fi ++ if test "$PHP_SYBASE" && test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then ++ { echo "configure: error: You can not use both --with-sybase and --with-sybase-ct in same build!" 1>&2; exit 1; } ++ fi + +-echo "$ac_t""$ac_cv_crypt_md5" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HAVE_SYBASE_CT 1 ++EOF + +-echo $ac_n "checking for Blowfish crypt""... $ac_c" 1>&6 +-echo "configure:88035: checking for Blowfish crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_blowfish'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then + +- ac_cv_crypt_blowfish=no +- +-else +- cat > conftest.$ac_ext < +-#endif ++ ext_builddir=ext/sybase_ct ++ ext_srcdir=$abs_srcdir/ext/sybase_ct + +-#if HAVE_CRYPT_H +-#include +-#endif ++ ac_extra= + +-main() { +-#if HAVE_CRYPT +- char salt[30], answer[70]; ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SYBASE_CT_SHARED=no + +- salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0'; +- strcat(salt,"rasmuslerd............"); +- strcpy(answer,salt); +- strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra"); +- exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer)); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:88071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then + +- ac_cv_crypt_blowfish=yes +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ case ext/sybase_ct in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +- ac_cv_crypt_blowfish=no +- +-fi +-rm -fr conftest* +-fi + +-fi ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-echo "$ac_t""$ac_cv_crypt_blowfish" 1>&6 + +-echo $ac_n "checking for SHA512 crypt""... $ac_c" 1>&6 +-echo "configure:88092: checking for SHA512 crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_SHA512'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then ++ old_IFS=$IFS ++ for ac_src in php_sybase_ct.c; do + +- ac_cv_crypt_SHA512=no ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +-else +- cat > conftest.$ac_ext < +-#endif ++ cat >>Makefile.objects< +-#endif + +-main() { +-#if HAVE_CRYPT +- char salt[30], answer[80]; +- +- salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; +- strcpy(answer, salt); +- strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); +- exit (strcmp((char *)crypt("foo",salt),answer)); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:88127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++ EXT_STATIC="$EXT_STATIC sybase_ct" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC sybase_ct" ++ fi ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_SYBASE_CT_SHARED=yes ++ ++ case ext/sybase_ct in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- ac_cv_crypt_SHA512=yes +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* + +- ac_cv_crypt_SHA512=no +- +-fi +-rm -fr conftest* +-fi + +-fi ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + +-echo "$ac_t""$ac_cv_crypt_SHA512" 1>&6 + +-echo $ac_n "checking for SHA256 crypt""... $ac_c" 1>&6 +-echo "configure:88148: checking for SHA256 crypt" >&5 +-if eval "test \"`echo '$''{'ac_cv_crypt_SHA256'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then ++ old_IFS=$IFS ++ for ac_src in php_sybase_ct.c; do + +- ac_cv_crypt_SHA256=no ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_sybase_ct="$shared_objects_sybase_ct $ac_bdir$ac_obj.lo" + +-else +- cat > conftest.$ac_ext < +-#endif ++ cat >>Makefile.objects< +-#endif ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" + +-main() { +-#if HAVE_CRYPT +- char salt[30], answer[80]; +- salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0'; +- strcat(salt,""); +- strcpy(answer, salt); +- strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5"); +- exit (strcmp((char *)crypt("foo",salt),answer)); +-#else +- exit(0); +-#endif +-} +-EOF +-if { (eval echo configure:88183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_crypt_SHA256=yes ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsybase_ct.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(PHPSYBASE_CT_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsybase_ct.so '$ext_builddir'/phpsybase_ct.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSYBASE_CT, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(PHPSYBASE_CT_SHARED_LIBADD)' ++ ;; ++ esac + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsybase_ct.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsybase_ct.$suffix" ++ fi + +- ac_cv_crypt_SHA256=no ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase_ct" + +-fi +-rm -fr conftest* +-fi ++ cat >>Makefile.objects<&6 ++EOF + ++ ;; ++ *) ++ ++ install_modules="install-modules" + +-if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/sybase_ct.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(SYBASE_CT_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/sybase_ct.so '$ext_builddir'/sybase_ct.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SYBASE_CT, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(SYBASE_CT_SHARED_LIBADD)' ++ ;; ++ esac + +- echo $ac_n "checking whether the compiler supports __alignof__""... $ac_c" 1>&6 +-echo "configure:88207: checking whether the compiler supports __alignof__" >&5 +-if eval "test \"`echo '$''{'ac_cv_alignof_exists'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/sybase_ct.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/sybase_ct.$suffix" ++ fi + +- cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- +- ac_cv_alignof_exists=yes +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- +- ac_cv_alignof_exists=no +- +-fi +-rm -f conftest* +-fi + +-echo "$ac_t""$ac_cv_alignof_exists" 1>&6 +- if test "$ac_cv_alignof_exists" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ALIGNOF 1 ++ ;; ++ esac ++ cat >> confdefs.h <&6 +-echo "configure:88248: checking whether the compiler supports aligned attribute" >&5 +-if eval "test \"`echo '$''{'ac_cv_attribute_aligned'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- +- ac_cv_attribute_aligned=yes ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then ++ PHP_SYBASE_CT_SHARED=no ++ case "$PHP_SAPI" in ++ cgi|embed) ++ + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* ++ case ext/sybase_ct in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- ac_cv_attribute_aligned=no + +-fi +-rm -f conftest* +-fi +- +-echo "$ac_t""$ac_cv_attribute_aligned" 1>&6 +- if test "$ac_cv_attribute_aligned" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ATTRIBUTE_ALIGNED 1 +-EOF +- +- fi +- + +- cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <>Makefile.objects<>Makefile.objects<> confdefs.h <> confdefs.h </dev/null ; then ++ ai_p=$SYBASE_CT_INCDIR ++ else ++ ++ ep_dir="`echo $SYBASE_CT_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$SYBASE_CT_INCDIR\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi + +- if test "$ac_cv_crypt_ext_des" = "yes"; then +- ac_result=1 +- ac_crypt_edes=1 + else +- ac_result=0 +- ac_crypt_edes=0 ++ { echo "configure: error: ctpublic.h missing!" 1>&2; exit 1; } ++ fi ++ ++ ++ if test "$SYBASE_CT_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SYBASE_CT_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$SYBASE_CT_LIBDIR" || echo "$SYBASE_CT_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$SYBASE_CT_LIBDIR ++ else ++ ++ ep_dir="`echo $SYBASE_CT_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$SYBASE_CT_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-L$ai_p $SYBASE_CT_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && SYBASE_CT_SHARED_LIBADD="$ld_runpath_switch$ai_p $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi +- cat >> confdefs.h </dev/null` ++ case $ac_solid_uname_s in ++ *OSF*) ;; # Tru64/DEC OSF does NOT use the SYB_LP64 define ++ *) CFLAGS="${CFLAGS} -DSYB_LP64" ;; # ++ esac ++ SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64" ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $SYBASE_CT_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else +- ac_result=0 +- ac_crypt_md5=0 ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <&6 +-echo "configure:88443: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "checking for netg_errstr in -lsybtcl64""... $ac_c" 1>&6 ++echo "configure:94851: checking for netg_errstr in -lsybtcl64" >&5 ++ac_lib_var=`echo sybtcl64'_'netg_errstr | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++char netg_errstr(); + + int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- ++netg_errstr() + ; return 0; } + EOF +-if { (eval echo configure:88471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:94870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +-fi ++LIBS="$ac_save_LIBS" + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done + +-echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 +-echo "configure:88496: checking for working fnmatch" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- # Some versions of Solaris or SCO have a broken fnmatch function. +-# So we run a test program. If we are cross-compiling, take no chance. +-# Thanks to John Oleynick and Franc,ois Pinard for this test. +-if test "$cross_compiling" = yes; then +- ac_cv_func_fnmatch_works=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_func_fnmatch_works=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_func_fnmatch_works=no +-fi +-rm -fr conftest* +-fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_sybtcl64_netg_errstr ++ ++ ++ ++ case sybtcl64 in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybtcl64 $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybtcl64 in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybtcl64 $LIBS" ++ ;; ++ esac + +-fi + +-echo "$ac_t""$ac_cv_func_fnmatch_works" 1>&6 +-if test $ac_cv_func_fnmatch_works = yes; then +- cat >> confdefs.h <<\EOF +-#define HAVE_FNMATCH 1 +-EOF ++ fi ++ ;; ++ esac ++ + ++ ++ + fi +- + ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +-for ac_func in fork CreateProcess +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:88538: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for insck__getVdate in -linsck64""... $ac_c" 1>&6 ++echo "configure:95045: checking for insck__getVdate in -linsck64" >&5 ++ac_lib_var=`echo insck64'_'insck__getVdate | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++char insck__getVdate(); + + int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif +- ++insck__getVdate() + ; return 0; } + EOF +-if { (eval echo configure:88566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:95064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +-fi ++LIBS="$ac_save_LIBS" + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-php_can_support_proc_open=no + +-fi +-done ++ fi ++ ;; ++ esac + +-echo $ac_n "checking if your OS can spawn processes with inherited handles""... $ac_c" 1>&6 +-echo "configure:88596: checking if your OS can spawn processes with inherited handles" >&5 +-if test "$php_can_support_proc_open" = "yes"; then +- echo "$ac_t""yes" 1>&6 +- cat >> confdefs.h <<\EOF +-#define PHP_CAN_SUPPORT_PROC_OPEN 1 +-EOF + ++ + else + echo "$ac_t""no" 1>&6 +-fi +- +-if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then +- cat >> confdefs.h <<\EOF +-#define ENABLE_CHROOT_FUNC 1 +-EOF + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck64_insck__getVdate ++ ++ + fi + +- +- unset ac_cv_func_res_nsearch +- unset ac_cv_func___res_nsearch +- unset found ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" + +- echo $ac_n "checking for res_nsearch""... $ac_c" 1>&6 +-echo "configure:88620: checking for res_nsearch" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_res_nsearch'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char res_nsearch(); +- +-int main() { ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_res_nsearch) || defined (__stub___res_nsearch) +-choke me +-#else +-res_nsearch(); +-#endif ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +-; return 0; } +-EOF +-if { (eval echo configure:88648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_res_nsearch=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_res_nsearch=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'res_nsearch`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking for __res_nsearch""... $ac_c" 1>&6 +-echo "configure:88666: checking for __res_nsearch" >&5 +-if eval "test \"`echo '$''{'ac_cv_func___res_nsearch'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char __res_nsearch(); ++ fi ++ ;; ++ esac + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub___res_nsearch) || defined (__stub_____res_nsearch) +-choke me +-#else +-__res_nsearch(); +-#endif ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +-; return 0; } +-EOF +-if { (eval echo configure:88694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func___res_nsearch=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func___res_nsearch=no" +-fi +-rm -f conftest* +-fi ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +-if eval "test \"`echo '$ac_cv_func_'__res_nsearch`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- +-fi + ++ fi ++ ++ fi + +- case $found in +- yes) +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_NSEARCH 1 +-EOF ++ ;; ++ esac ++ done + +- ac_cv_func_res_nsearch=yes +- ;; +- +- *) +- +- unset ac_cv_lib_resolv_res_nsearch +- unset ac_cv_lib_resolv___res_nsearch +- unset found +- echo $ac_n "checking for res_nsearch in -lresolv""... $ac_c" 1>&6 +-echo "configure:88732: checking for res_nsearch in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'res_nsearch | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for bsd_tcp in -linsck64""... $ac_c" 1>&6 ++echo "configure:95212: checking for bsd_tcp in -linsck64" >&5 ++ac_lib_var=`echo insck64'_'bsd_tcp | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" ++LIBS="-linsck64 $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:95231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -88762,167 +95242,257 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case insck64 in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-linsck64 $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case insck64 in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-linsck64 $LIBS" ++ ;; ++ esac + +- echo $ac_n "checking for __res_nsearch in -lresolv""... $ac_c" 1>&6 +-echo "configure:88771: checking for __res_nsearch in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'__res_nsearch | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ fi ++ ;; ++ esac + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ + else + echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck64_bsd_tcp ++ + + fi + ++ elif test -f $SYBASE_CT_INCDIR/libsybct.so; then ++ ++ ++ case sybcs in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybcs $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybcs in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybcs $LIBS" ++ ;; ++ esac + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lresolv" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs +- fi ++ fi ++ ;; ++ esac ++ + +- if test "$found" = "yes"; then + + +- case resolv in ++ case sybct in + c|c_r|pthread*) ;; + *) +- LIBS="-lresolv $LIBS" ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybct $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybct in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybct $LIBS" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_NSEARCH 1 +-EOF ++ fi ++ ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRESOLV 1 +-EOF + +- ac_cv_func_res_nsearch=yes ++ ++ ++ case sybcomn in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybcomn $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybcomn in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybcomn $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++ ++ case sybintl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybintl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybintl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybintl $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++ SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl" ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $SYBASE_CT_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- unset ac_cv_lib_bind_res_nsearch +- unset ac_cv_lib_bind___res_nsearch +- unset found +- echo $ac_n "checking for res_nsearch in -lbind""... $ac_c" 1>&6 +-echo "configure:88868: checking for res_nsearch in -lbind" >&5 +-ac_lib_var=`echo bind'_'res_nsearch | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ fi ++ ++ fi + +- echo $ac_n "checking for __res_nsearch in -lbind""... $ac_c" 1>&6 +-echo "configure:88907: checking for __res_nsearch in -lbind" >&5 +-ac_lib_var=`echo bind'_'__res_nsearch | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for netg_errstr in -lsybtcl""... $ac_c" 1>&6 ++echo "configure:95477: checking for netg_errstr in -lsybtcl" >&5 ++ac_lib_var=`echo sybtcl'_'netg_errstr | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" ++LIBS="-lsybtcl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:95496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -88937,89 +95507,186 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybtcl $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++ + else + echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_sybtcl_netg_errstr ++ ++ + +-fi ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybtcl $LIBS" ++ ;; ++ esac + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lbind" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* ++ fi ++ ;; ++ esac ++ ++ ++ ++ + fi + +- LIBS=$ac_libs ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- if test "$found" = "yes"; then ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- case bind in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lbind $LIBS" +- ;; +- esac ++ fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_NSEARCH 1 +-EOF ++ fi ++ ++ fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBBIND 1 +-EOF ++ ;; ++ esac ++ done + +- ac_cv_func_res_nsearch=yes +- else +- +- +- unset ac_cv_lib_socket_res_nsearch +- unset ac_cv_lib_socket___res_nsearch +- unset found +- echo $ac_n "checking for res_nsearch in -lsocket""... $ac_c" 1>&6 +-echo "configure:89004: checking for res_nsearch in -lsocket" >&5 +-ac_lib_var=`echo socket'_'res_nsearch | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 ++echo "configure:95671: checking for insck__getVdate in -linsck" >&5 ++ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" ++LIBS="-linsck $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:95690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -89034,31 +95701,159 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-linsck $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ + else + echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __res_nsearch in -lsocket""... $ac_c" 1>&6 +-echo "configure:89043: checking for __res_nsearch in -lsocket" >&5 +-ac_lib_var=`echo socket'_'__res_nsearch | sed 'y%./+-%__p_%'` ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck_insck__getVdate ++ ++ ++fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6 ++echo "configure:95838: checking for bsd_tcp in -linsck" >&5 ++ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" ++LIBS="-linsck $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:95857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -89073,255 +95868,257 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-linsck $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ + else + echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck_bsd_tcp ++ + + fi + ++ else ++ ++ ++ case cs in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lcs $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case cs in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lcs $LIBS" ++ ;; ++ esac + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lsocket" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs +- fi ++ fi ++ ;; ++ esac ++ + +- if test "$found" = "yes"; then + + +- case socket in ++ case ct in + c|c_r|pthread*) ;; + *) +- LIBS="-lsocket $LIBS" ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lct $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case ct in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lct $LIBS" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_NSEARCH 1 +-EOF ++ fi ++ ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBSOCKET 1 +-EOF + +- ac_cv_func_res_nsearch=yes +- else + +- : +- +- fi + +- +- fi ++ case comn in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lcomn $SYBASE_CT_SHARED_LIBADD" ++ else ++ + ++ case comn in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lcomn $LIBS" ++ ;; ++ esac + +- fi +- +- ;; +- ++ ++ fi ++ ;; + esac + + +- unset ac_cv_func_dns_search +- unset ac_cv_func___dns_search +- unset found ++ + +- echo $ac_n "checking for dns_search""... $ac_c" 1>&6 +-echo "configure:89155: checking for dns_search" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_dns_search'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char dns_search(); +- +-int main() { ++ case intl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lintl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case intl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lintl $LIBS" ++ ;; ++ esac + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_dns_search) || defined (__stub___dns_search) +-choke me +-#else +-dns_search(); +-#endif + +-; return 0; } +-EOF +-if { (eval echo configure:89183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_dns_search=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_dns_search=no" +-fi +-rm -f conftest* +-fi ++ fi ++ ;; ++ esac + +-if eval "test \"`echo '$ac_cv_func_'dns_search`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking for __dns_search""... $ac_c" 1>&6 +-echo "configure:89201: checking for __dns_search" >&5 +-if eval "test \"`echo '$''{'ac_cv_func___dns_search'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char __dns_search(); + +-int main() { ++ ++ SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl" ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ $SYBASE_CT_LIBS ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub___dns_search) || defined (__stub_____dns_search) +-choke me +-#else +-__dns_search(); +-#endif ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +-; return 0; } +-EOF +-if { (eval echo configure:89229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func___dns_search=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func___dns_search=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'__dns_search`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- +-fi ++ fi ++ ;; ++ esac + + +- case $found in +- yes) +- cat >> confdefs.h <<\EOF +-#define HAVE_DNS_SEARCH 1 +-EOF ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +- ac_cv_func_dns_search=yes +- ;; ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- *) + +- unset ac_cv_lib_resolv_dns_search +- unset ac_cv_lib_resolv___dns_search +- unset found +- echo $ac_n "checking for dns_search in -lresolv""... $ac_c" 1>&6 +-echo "configure:89267: checking for dns_search in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'dns_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ fi ++ ++ fi + +- echo $ac_n "checking for __dns_search in -lresolv""... $ac_c" 1>&6 +-echo "configure:89306: checking for __dns_search in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'__dns_search | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6 ++echo "configure:96103: checking for netg_errstr in -ltcl" >&5 ++ac_lib_var=`echo tcl'_'netg_errstr | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" ++LIBS="-ltcl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:96122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -89336,128 +96133,186 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ ++ case tcl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-ltcl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case tcl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-ltcl $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ++ + else + echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_tcl_netg_errstr ++ ++ + +-fi ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case sybtcl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lsybtcl $LIBS" ++ ;; ++ esac + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lresolv" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* ++ fi ++ ;; ++ esac ++ ++ ++ ++ + fi + +- LIBS=$ac_libs ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- if test "$found" = "yes"; then +- ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- case resolv in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="-lresolv $LIBS" ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_DNS_SEARCH 1 +-EOF ++ fi ++ ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRESOLV 1 +-EOF + +- ac_cv_func_dns_search=yes ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- unset ac_cv_lib_bind_dns_search +- unset ac_cv_lib_bind___dns_search +- unset found +- echo $ac_n "checking for dns_search in -lbind""... $ac_c" 1>&6 +-echo "configure:89403: checking for dns_search in -lbind" >&5 +-ac_lib_var=`echo bind'_'dns_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ fi ++ ++ fi + +- echo $ac_n "checking for __dns_search in -lbind""... $ac_c" 1>&6 +-echo "configure:89442: checking for __dns_search in -lbind" >&5 +-ac_lib_var=`echo bind'_'__dns_search | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 ++echo "configure:96297: checking for insck__getVdate in -linsck" >&5 ++ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" ++LIBS="-linsck $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:96316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -89472,89 +96327,159 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- + +-fi ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-linsck $LIBS" ++ ;; ++ esac + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lbind" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes ++ fi ++ ;; ++ esac ++ ++ ++ + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck_insck__getVdate ++ ++ + fi + +- LIBS=$ac_libs ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="-L$SYBASE_CT_LIBDIR" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- if test "$found" = "yes"; then +- ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- case bind in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="-lbind $LIBS" ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_DNS_SEARCH 1 +-EOF ++ fi ++ ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBBIND 1 +-EOF + +- ac_cv_func_dns_search=yes ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- unset ac_cv_lib_socket_dns_search +- unset ac_cv_lib_socket___dns_search +- unset found +- echo $ac_n "checking for dns_search in -lsocket""... $ac_c" 1>&6 +-echo "configure:89539: checking for dns_search in -lsocket" >&5 +-ac_lib_var=`echo socket'_'dns_search | sed 'y%./+-%__p_%'` ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6 ++echo "configure:96464: checking for bsd_tcp in -linsck" >&5 ++ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" ++LIBS="-linsck $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:96483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -89569,1638 +96494,1474 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" ++ else ++ ++ ++ case insck in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-linsck $LIBS" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ + else + echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __dns_search in -lsocket""... $ac_c" 1>&6 +-echo "configure:89578: checking for __dns_search in -lsocket" >&5 +-ac_lib_var=`echo socket'_'__dns_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_insck_bsd_tcp ++ ++ ++fi ++ ++ fi ++fi ++ ++ ++ ++php_enable_sysvmsg=no ++ ++echo $ac_n "checking whether to enable System V IPC support""... $ac_c" 1>&6 ++echo "configure:96543: checking whether to enable System V IPC support" >&5 ++# Check whether --enable-sysvmsg or --disable-sysvmsg was given. ++if test "${enable_sysvmsg+set}" = set; then ++ enableval="$enable_sysvmsg" ++ PHP_SYSVMSG=$enableval ++else ++ ++ PHP_SYSVMSG=no ++ test "$PHP_ENABLE_ALL" && PHP_SYSVMSG=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SYSVMSG in ++shared,*) ++ PHP_SYSVMSG=`echo "$PHP_SYSVMSG"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SYSVMSG=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_SYSVMSG" != "no"; then ++ ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 ++echo "configure:96586: checking for sys/msg.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext < conftest.$ac_ext < + EOF +-if { (eval echo configure:89597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:96596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ eval "ac_cv_header_$ac_safe=yes" + else ++ echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* +-LIBS="$ac_save_LIBS" +- + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes ++ : + else + echo "$ac_t""no" 1>&6 +-found=no +-fi +- ++{ echo "configure: error: Cannot enable System V IPC support, sys/msg.h is missing" 1>&2; exit 1; } + + fi + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lsocket" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_SYSVMSG 1 + EOF +-if { (eval echo configure:89633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs +- fi ++ ++ ext_builddir=ext/sysvmsg ++ ext_srcdir=$abs_srcdir/ext/sysvmsg + +- if test "$found" = "yes"; then ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SYSVMSG_SHARED=no + + +- case socket in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsocket $LIBS" +- ;; ++ case ext/sysvmsg in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac ++ ++ ++ ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + + +- cat >> confdefs.h <<\EOF +-#define HAVE_DNS_SEARCH 1 +-EOF ++ old_IFS=$IFS ++ for ac_src in sysvmsg.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBSOCKET 1 ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <&6 +-echo "configure:89690: checking for dn_expand" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_dn_expand'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char dn_expand(); + +-int main() { ++ old_IFS=$IFS ++ for ac_src in sysvmsg.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_dn_expand) || defined (__stub___dn_expand) +-choke me +-#else +-dn_expand(); +-#endif ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-; return 0; } ++ cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_dn_expand=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_dn_expand=no" +-fi +-rm -f conftest* +-fi ++ done + +-if eval "test \"`echo '$ac_cv_func_'dn_expand`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking for __dn_expand""... $ac_c" 1>&6 +-echo "configure:89736: checking for __dn_expand" >&5 +-if eval "test \"`echo '$''{'ac_cv_func___dn_expand'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char __dn_expand(); + +-int main() { ++ EXT_STATIC="$EXT_STATIC sysvmsg" ++ ;; ++ *) ++ ++ ++ case ext/sysvmsg in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ ++ + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub___dn_expand) || defined (__stub_____dn_expand) +-choke me +-#else +-__dn_expand(); +-#endif ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-; return 0; } +-EOF +-if { (eval echo configure:89764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func___dn_expand=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func___dn_expand=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'__dn_expand`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- +-fi ++ old_IFS=$IFS ++ for ac_src in sysvmsg.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- case $found in +- yes) +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_EXPAND 1 ++ cat >>Makefile.objects<&6 +-echo "configure:89802: checking for dn_expand in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=sysvmsg ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + +- echo $ac_n "checking for __dn_expand in -lresolv""... $ac_c" 1>&6 +-echo "configure:89841: checking for __dn_expand in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'__dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" + fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes ++ ++ ++php_enable_sysvsem=no ++ ++echo $ac_n "checking whether to enable System V semaphore support""... $ac_c" 1>&6 ++echo "configure:96923: checking whether to enable System V semaphore support" >&5 ++# Check whether --enable-sysvsem or --disable-sysvsem was given. ++if test "${enable_sysvsem+set}" = set; then ++ enableval="$enable_sysvsem" ++ PHP_SYSVSEM=$enableval + else +- echo "$ac_t""no" 1>&6 +-found=no ++ ++ PHP_SYSVSEM=no ++ test "$PHP_ENABLE_ALL" && PHP_SYSVSEM=$PHP_ENABLE_ALL ++ + fi + +- +-fi + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lresolv" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SYSVSEM in ++shared,*) ++ PHP_SYSVSEM=`echo "$PHP_SYSVSEM"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SYSVSEM=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 + +- LIBS=$ac_libs +- fi + +- if test "$found" = "yes"; then +- +- +- case resolv in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lresolv $LIBS" +- ;; +- esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_EXPAND 1 +-EOF ++if test "$PHP_SYSVSEM" != "no"; then ++ ++ ext_builddir=ext/sysvsem ++ ext_srcdir=$abs_srcdir/ext/sysvsem + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRESOLV 1 +-EOF ++ ac_extra= + +- ac_cv_func_dn_expand=yes +- else ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SYSVSEM_SHARED=no + + +- unset ac_cv_lib_bind_dn_expand +- unset ac_cv_lib_bind___dn_expand +- unset found +- echo $ac_n "checking for dn_expand in -lbind""... $ac_c" 1>&6 +-echo "configure:89938: checking for dn_expand in -lbind" >&5 +-ac_lib_var=`echo bind'_'dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __dn_expand in -lbind""... $ac_c" 1>&6 +-echo "configure:89977: checking for __dn_expand in -lbind" >&5 +-ac_lib_var=`echo bind'_'__dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ done + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ EXT_STATIC="$EXT_STATIC sysvsem" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC sysvsem" ++ fi ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_SYSVSEM_SHARED=yes ++ ++ case ext/sysvsem in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +-fi +- + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lbind" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + +- LIBS=$ac_libs +- fi + +- if test "$found" = "yes"; then +- ++ old_IFS=$IFS ++ for ac_src in sysvsem.c; do + +- case bind in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lbind $LIBS" +- ;; +- esac ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_sysvsem="$shared_objects_sysvsem $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_EXPAND 1 ++ cat >>Makefile.objects<> confdefs.h <<\EOF +-#define HAVE_LIBBIND 1 +-EOF ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" + +- ac_cv_func_dn_expand=yes ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsysvsem.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(PHPSYSVSEM_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsysvsem.so '$ext_builddir'/phpsysvsem.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSYSVSEM, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(PHPSYSVSEM_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsysvsem.$suffix" + else +- ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvsem.$suffix" ++ fi + +- unset ac_cv_lib_socket_dn_expand +- unset ac_cv_lib_socket___dn_expand +- unset found +- echo $ac_n "checking for dn_expand in -lsocket""... $ac_c" 1>&6 +-echo "configure:90074: checking for dn_expand in -lsocket" >&5 +-ac_lib_var=`echo socket'_'dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvsem" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ cat >>Makefile.objects<&6 +-echo "configure:90113: checking for __dn_expand in -lsocket" >&5 +-ac_lib_var=`echo socket'_'__dn_expand | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi ++ ;; ++ *) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/sysvsem.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(SYSVSEM_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/sysvsem.so '$ext_builddir'/sysvsem.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SYSVSEM, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(SYSVSEM_SHARED_LIBADD)' ++ ;; ++ esac + ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/sysvsem.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvsem.$suffix" ++ fi + +-fi ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvsem" + ++ cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs ++ ;; ++ esac ++ cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_DN_EXPAND 1 +-EOF + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBSOCKET 1 +-EOF ++ old_IFS=$IFS ++ for ac_src in sysvsem.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- ac_cv_func_dn_expand=yes +- else +- +- : ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- fi +- ++ cat >>Makefile.objects<>Makefile.objects<&6 +-echo "configure:90225: checking for dn_skipname" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_dn_skipname'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char dn_skipname(); + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_dn_skipname) || defined (__stub___dn_skipname) +-choke me +-#else +-dn_skipname(); +-#endif ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=sysvsem ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + +-; return 0; } ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_SYSVSEM 1 + EOF +-if { (eval echo configure:90253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_dn_skipname=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_dn_skipname=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'dn_skipname`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking for __dn_skipname""... $ac_c" 1>&6 +-echo "configure:90271: checking for __dn_skipname" >&5 +-if eval "test \"`echo '$''{'ac_cv_func___dn_skipname'+set}'`\" = set"; then ++ echo $ac_n "checking for union semun""... $ac_c" 1>&6 ++echo "configure:97261: checking for union semun" >&5 ++if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char __dn_skipname(); + ++#include ++#include ++#include ++ + int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub___dn_skipname) || defined (__stub_____dn_skipname) +-choke me +-#else +-__dn_skipname(); +-#endif +- ++union semun x; + ; return 0; } + EOF +-if { (eval echo configure:90299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:97277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* +- eval "ac_cv_func___dn_skipname=yes" ++ ++ php_cv_semun=yes ++ + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func___dn_skipname=no" ++ ++ php_cv_semun=no ++ + fi + rm -f conftest* +-fi +- +-if eval "test \"`echo '$ac_cv_func_'__dn_skipname`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi + + fi + +- +- case $found in +- yes) +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_SKIPNAME 1 ++echo "$ac_t""$php_cv_semun" 1>&6 ++ if test "$php_cv_semun" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SEMUN 1 + EOF + +- ac_cv_func_dn_skipname=yes +- ;; +- +- *) +- +- unset ac_cv_lib_resolv_dn_skipname +- unset ac_cv_lib_resolv___dn_skipname +- unset found +- echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6 +-echo "configure:90337: checking for dn_skipname in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_SEMUN 0 + EOF +-if { (eval echo configure:90356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + ++ fi + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6 +-echo "configure:90376: checking for __dn_skipname in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi ++php_enable_sysvshm=no + ++echo $ac_n "checking whether to enable System V shared memory support""... $ac_c" 1>&6 ++echo "configure:97313: checking whether to enable System V shared memory support" >&5 ++# Check whether --enable-sysvshm or --disable-sysvshm was given. ++if test "${enable_sysvshm+set}" = set; then ++ enableval="$enable_sysvshm" ++ PHP_SYSVSHM=$enableval ++else + ++ PHP_SYSVSHM=no ++ test "$PHP_ENABLE_ALL" && PHP_SYSVSHM=$PHP_ENABLE_ALL ++ + fi + + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lresolv" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs +- fi ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_SYSVSHM in ++shared,*) ++ PHP_SYSVSHM=`echo "$PHP_SYSVSHM"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_SYSVSHM=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + +- if test "$found" = "yes"; then +- +- +- case resolv in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lresolv $LIBS" +- ;; +- esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_SKIPNAME 1 +-EOF ++echo "$ac_t""$ext_output" 1>&6 + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRESOLV 1 ++ ++ ++ ++if test "$PHP_SYSVSHM" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_SYSVSHM 1 + EOF + +- ac_cv_func_dn_skipname=yes +- else ++ ++ ext_builddir=ext/sysvshm ++ ext_srcdir=$abs_srcdir/ext/sysvshm ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_SYSVSHM_SHARED=no + + +- unset ac_cv_lib_bind_dn_skipname +- unset ac_cv_lib_bind___dn_skipname +- unset found +- echo $ac_n "checking for dn_skipname in -lbind""... $ac_c" 1>&6 +-echo "configure:90473: checking for dn_skipname in -lbind" >&5 +-ac_lib_var=`echo bind'_'dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __dn_skipname in -lbind""... $ac_c" 1>&6 +-echo "configure:90512: checking for __dn_skipname in -lbind" >&5 +-ac_lib_var=`echo bind'_'__dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ done + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi + ++ EXT_STATIC="$EXT_STATIC sysvshm" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC sysvshm" ++ fi ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_SYSVSHM_SHARED=yes ++ ++ case ext/sysvshm in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +-fi +- + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lbind" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi ++ b_c_pre=$shared_c_pre ++ b_cxx_pre=$shared_cxx_pre ++ b_c_meta=$shared_c_meta ++ b_cxx_meta=$shared_cxx_meta ++ b_c_post=$shared_c_post ++ b_cxx_post=$shared_cxx_post ++ b_lo=$shared_lo + +- LIBS=$ac_libs +- fi + +- if test "$found" = "yes"; then +- ++ old_IFS=$IFS ++ for ac_src in sysvshm.c; do + +- case bind in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lbind $LIBS" +- ;; +- esac ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_sysvshm="$shared_objects_sysvshm $ac_bdir$ac_obj.lo" + ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_DN_SKIPNAME 1 ++ cat >>Makefile.objects<> confdefs.h <<\EOF +-#define HAVE_LIBBIND 1 +-EOF ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" + +- ac_cv_func_dn_skipname=yes ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsysvshm.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(PHPSYSVSHM_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsysvshm.so '$ext_builddir'/phpsysvshm.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSYSVSHM, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(PHPSYSVSHM_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsysvshm.$suffix" + else +- ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvshm.$suffix" ++ fi + +- unset ac_cv_lib_socket_dn_skipname +- unset ac_cv_lib_socket___dn_skipname +- unset found +- echo $ac_n "checking for dn_skipname in -lsocket""... $ac_c" 1>&6 +-echo "configure:90609: checking for dn_skipname in -lsocket" >&5 +-ac_lib_var=`echo socket'_'dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvshm" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ cat >>Makefile.objects<&6 +-echo "configure:90648: checking for __dn_skipname in -lsocket" >&5 +-ac_lib_var=`echo socket'_'__dn_skipname | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi ++ ;; ++ *) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/sysvshm.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(SYSVSHM_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/sysvshm.so '$ext_builddir'/sysvshm.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(SYSVSHM, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(SYSVSHM_SHARED_LIBADD)' ++ ;; ++ esac + ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/sysvshm.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvshm.$suffix" ++ fi + +-fi ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvshm" + ++ cat >>Makefile.objects< conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs ++ ;; ++ esac ++ cat >> confdefs.h <> confdefs.h <<\EOF +-#define HAVE_DN_SKIPNAME 1 +-EOF + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBSOCKET 1 ++ old_IFS=$IFS ++ for ac_src in sysvshm.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<&6 +-echo "configure:90762: checking for res_search" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char res_search(); + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_res_search) || defined (__stub___res_search) +-choke me +-#else +-res_search(); +-#endif ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=sysvshm ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ ++ fi + +-; return 0; } +-EOF +-if { (eval echo configure:90790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_res_search=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_res_search=no" +-fi +-rm -f conftest* + fi + +-if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +- echo $ac_n "checking for __res_search""... $ac_c" 1>&6 +-echo "configure:90808: checking for __res_search" >&5 +-if eval "test \"`echo '$''{'ac_cv_func___res_search'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char __res_search(); + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub___res_search) || defined (__stub_____res_search) +-choke me +-#else +-__res_search(); +-#endif ++php_with_tidy=no + +-; return 0; } +-EOF +-if { (eval echo configure:90836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func___res_search=yes" ++echo $ac_n "checking for TIDY support""... $ac_c" 1>&6 ++echo "configure:97657: checking for TIDY support" >&5 ++# Check whether --with-tidy or --without-tidy was given. ++if test "${with_tidy+set}" = set; then ++ withval="$with_tidy" ++ PHP_TIDY=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func___res_search=no" +-fi +-rm -f conftest* +-fi ++ ++ PHP_TIDY=no ++ test "$PHP_ENABLE_ALL" && PHP_TIDY=$PHP_ENABLE_ALL + +-if eval "test \"`echo '$ac_cv_func_'__res_search`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- + fi + + +- case $found in +- yes) +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_SEARCH 1 +-EOF + +- ac_cv_func_res_search=yes ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_TIDY in ++shared,*) ++ PHP_TIDY=`echo "$PHP_TIDY"|$SED 's/^shared,//'` + ;; +- +- *) +- +- unset ac_cv_lib_resolv_res_search +- unset ac_cv_lib_resolv___res_search +- unset found +- echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 +-echo "configure:90874: checking for res_search in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __res_search in -lresolv""... $ac_c" 1>&6 +-echo "configure:90913: checking for __res_search in -lresolv" >&5 +-ac_lib_var=`echo resolv'_'__res_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lresolv $LIBS" +-cat > conftest.$ac_ext <&6 + +-int main() { +-__res_search() +-; return 0; } +-EOF +-if { (eval echo configure:90932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi + +- +-fi + ++if test "$PHP_TIDY" != "no"; then + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lresolv" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi ++ if test "$PHP_TIDY" != "yes"; then ++ TIDY_SEARCH_DIRS=$PHP_TIDY ++ else ++ TIDY_SEARCH_DIRS="/usr/local /usr" ++ fi + +- LIBS=$ac_libs ++ for i in $TIDY_SEARCH_DIRS; do ++ if test -f $i/include/tidy/tidy.h; then ++ TIDY_DIR=$i ++ TIDY_INCDIR=$i/include/tidy ++ elif test -f $i/include/tidy.h; then ++ TIDY_DIR=$i ++ TIDY_INCDIR=$i/include ++ fi ++ done ++ ++ if test -z "$TIDY_DIR"; then ++ { echo "configure: error: Cannot find libtidy" 1>&2; exit 1; } + fi + +- if test "$found" = "yes"; then ++ TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ TIDY_SHARED_LIBADD="-ltidy $TIDY_SHARED_LIBADD" ++ if test -n "$TIDY_LIBDIR"; then ++ ++ if test "$TIDY_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$TIDY_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$TIDY_LIBDIR" || echo "$TIDY_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$TIDY_LIBDIR ++ else ++ ++ ep_dir="`echo $TIDY_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$TIDY_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ TIDY_SHARED_LIBADD="-L$ai_p $TIDY_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && TIDY_SHARED_LIBADD="$ld_runpath_switch$ai_p $TIDY_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- case resolv in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lresolv $LIBS" +- ;; +- esac ++ fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_SEARCH 1 +-EOF ++ fi ++ ++ fi ++ ++ fi ++ else ++ ++ ++ if test -n "$TIDY_LIBDIR"; then ++ ++ if test "$TIDY_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$TIDY_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$TIDY_LIBDIR" || echo "$TIDY_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$TIDY_LIBDIR ++ else ++ ++ ep_dir="`echo $TIDY_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$TIDY_LIBDIR\"`" ++ fi ++ ++ ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBRESOLV 1 +-EOF + +- ac_cv_func_res_search=yes +- else + ++ fi ++ ++ fi + +- unset ac_cv_lib_bind_res_search +- unset ac_cv_lib_bind___res_search +- unset found +- echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6 +-echo "configure:91010: checking for res_search in -lbind" >&5 +-ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 + +- echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6 +-echo "configure:91049: checking for __res_search in -lbind" >&5 +-ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lbind $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ fi + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi + + +-fi ++ if test "$TIDY_INCDIR" != "/usr/include"; then ++ ++ if test -z "$TIDY_INCDIR" || echo "$TIDY_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$TIDY_INCDIR ++ else ++ ++ ep_dir="`echo $TIDY_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$TIDY_INCDIR\"`" ++ fi + ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lbind" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi ++ fi + +- LIBS=$ac_libs ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="" ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" + fi + +- if test "$found" = "yes"; then +- ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- case bind in ++ case $ac_ii in + c|c_r|pthread*) ;; + *) +- LIBS="-lbind $LIBS" ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" + ;; + esac + + +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_SEARCH 1 +-EOF ++ fi ++ ;; ++ esac + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBBIND 1 +-EOF + +- ac_cv_func_res_search=yes ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- unset ac_cv_lib_socket_res_search +- unset ac_cv_lib_socket___res_search +- unset found +- echo $ac_n "checking for res_search in -lsocket""... $ac_c" 1>&6 +-echo "configure:91146: checking for res_search in -lsocket" >&5 +-ac_lib_var=`echo socket'_'res_search | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 ++ fi ++ ++ fi + +- echo $ac_n "checking for __res_search in -lsocket""... $ac_c" 1>&6 +-echo "configure:91185: checking for __res_search in -lsocket" >&5 +-ac_lib_var=`echo socket'_'__res_search | sed 'y%./+-%__p_%'` ++ ;; ++ esac ++ done ++ ++ echo $ac_n "checking for tidyOptGetDoc in -ltidy""... $ac_c" 1>&6 ++echo "configure:97946: checking for tidyOptGetDoc in -ltidy" >&5 ++ac_lib_var=`echo tidy'_'tidyOptGetDoc | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lsocket $LIBS" ++LIBS="-ltidy $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:97965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -91215,618 +97976,390 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- found=yes +-else +- echo "$ac_t""no" 1>&6 +-found=no +-fi +- + +-fi +- +- +- if test "$found" = "yes"; then +- ac_libs=$LIBS +- LIBS="$LIBS -lsocket" +- if test "$cross_compiling" = yes; then +- found=no +-else +- cat > conftest.$ac_ext <> confdefs.h <<\EOF ++#define HAVE_TIDYOPTGETDOC 1 + EOF +-if { (eval echo configure:91240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- found=yes +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- found=no +-fi +-rm -fr conftest* +-fi + +- LIBS=$ac_libs +- fi ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + +- if test "$found" = "yes"; then ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_tidy_tidyOptGetDoc + + +- case socket in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsocket $LIBS" +- ;; +- esac +- +- +- cat >> confdefs.h <<\EOF +-#define HAVE_RES_SEARCH 1 +-EOF ++fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBSOCKET 1 +-EOF + +- ac_cv_func_res_search=yes +- else +- +- : + +- fi + ++ ext_builddir=ext/tidy ++ ext_srcdir=$abs_srcdir/ext/tidy + +- fi +- ++ ac_extra= + +- fi +- +- ;; ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_TIDY_SHARED=no ++ + ++ case ext/tidy in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac +- +- +-echo $ac_n "checking whether atof() accepts NAN""... $ac_c" 1>&6 +-echo "configure:91293: checking whether atof() accepts NAN" >&5 +-if eval "test \"`echo '$''{'ac_cv_atof_accept_nan'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else + +-if test "$cross_compiling" = yes; then + +- ac_cv_atof_accept_nan=no +- +-else +- cat > conftest.$ac_ext < +-#include +- +-#ifdef HAVE_ISNAN +-#define zend_isnan(a) isnan(a) +-#elif defined(HAVE_FPCLASS) +-#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) +-#else +-#define zend_isnan(a) 0 +-#endif + +-int main(int argc, char** argv) +-{ +- return zend_isnan(atof("NAN")) ? 0 : 1; +-} ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-EOF +-if { (eval echo configure:91324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_atof_accept_nan=yes + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ old_IFS=$IFS ++ for ac_src in tidy.c; do + +- ac_cv_atof_accept_nan=no +- +-fi +-rm -fr conftest* +-fi ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +-fi ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-echo "$ac_t""$ac_cv_atof_accept_nan" 1>&6 +-if test "$ac_cv_atof_accept_nan" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ATOF_ACCEPTS_NAN 1 ++ cat >>Makefile.objects<&6 +-echo "configure:91351: checking whether atof() accepts INF" >&5 +-if eval "test \"`echo '$''{'ac_cv_atof_accept_inf'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else ++ EXT_STATIC="$EXT_STATIC tidy" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC tidy" ++ fi ++ else ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_TIDY_SHARED=yes ++ ++ case ext/tidy in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +-if test "$cross_compiling" = yes; then + +- ac_cv_atof_accept_inf=no + +-else +- cat > conftest.$ac_ext < +-#include + +-#ifdef HAVE_ISINF +-#define zend_isinf(a) isinf(a) +-#elif defined(INFINITY) +-/* Might not work, but is required by ISO C99 */ +-#define zend_isinf(a) (((a)==INFINITY)?1:0) +-#elif defined(HAVE_FPCLASS) +-#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) +-#else +-#define zend_isinf(a) 0 +-#endif ++ old_IFS=$IFS ++ for ac_src in tidy.c; do ++ ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ shared_objects_tidy="$shared_objects_tidy $ac_bdir$ac_obj.lo" + +-int main(int argc, char** argv) +-{ +- return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1; +-} ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + ++ cat >>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_atof_accept_inf=yes ++ done + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ case $host_alias in ++ *netware*) ++ ++ install_modules="install-modules" ++ ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phptidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(PHPTIDY_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phptidy.so '$ext_builddir'/phptidy.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPTIDY, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(PHPTIDY_SHARED_LIBADD)' ++ ;; ++ esac ++ ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phptidy.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phptidy.$suffix" ++ fi + +- ac_cv_atof_accept_inf=no ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tidy" + +-fi +-rm -fr conftest* +-fi ++ cat >>Makefile.objects<&6 +-if test "$ac_cv_atof_accept_inf" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_ATOF_ACCEPTS_INF 1 + EOF + +-fi +- +-echo $ac_n "checking whether HUGE_VAL == INF""... $ac_c" 1>&6 +-echo "configure:91412: checking whether HUGE_VAL == INF" >&5 +-if eval "test \"`echo '$''{'ac_cv_huge_val_inf'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +-if test "$cross_compiling" = yes; then +- +- ac_cv_huge_val_inf=yes +- +-else +- cat > conftest.$ac_ext < +-#include +- +-#ifdef HAVE_ISINF +-#define zend_isinf(a) isinf(a) +-#elif defined(INFINITY) +-/* Might not work, but is required by ISO C99 */ +-#define zend_isinf(a) (((a)==INFINITY)?1:0) +-#elif defined(HAVE_FPCLASS) +-#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) +-#else +-#define zend_isinf(a) 0 +-#endif ++ ;; ++ *) ++ ++ install_modules="install-modules" + +-int main(int argc, char** argv) +-{ +- return zend_isinf(HUGE_VAL) ? 0 : 1; +-} ++ case $host_alias in ++ *aix*) ++ suffix=so ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(TIDY_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/tidy.so '$ext_builddir'/tidy.so' ++ ;; ++ *netware*) ++ suffix=nlm ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(TIDY, 3)_SHARED_LIBADD)' ++ ;; ++ *) ++ suffix=la ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(TIDY_SHARED_LIBADD)' ++ ;; ++ esac + +-EOF +-if { (eval echo configure:91446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++ if test "x" = "xyes"; then ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/tidy.$suffix" ++ else ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/tidy.$suffix" ++ fi + +- ac_cv_huge_val_inf=yes ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tidy" + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- ac_cv_huge_val_inf=no ++ cat >>Makefile.objects<&6 +-if test "$ac_cv_huge_val_inf" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_HUGE_VAL_INF 1 ++ ;; ++ esac ++ cat >> confdefs.h <&6 +-echo "configure:91473: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5 +-if eval "test \"`echo '$''{'ac_cv_huge_val_nan'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then ++ PHP_TIDY_SHARED=no ++ case "$PHP_SAPI" in ++ cgi|embed) ++ ++ ++ case ext/tidy in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +-if test "$cross_compiling" = yes; then + +- ac_cv_huge_val_nan=yes +- +-else +- cat > conftest.$ac_ext < +-#include +- +-#ifdef HAVE_ISNAN +-#define zend_isnan(a) isnan(a) +-#elif defined(HAVE_FPCLASS) +-#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) +-#else +-#define zend_isnan(a) 0 +-#endif + +-int main(int argc, char** argv) +-{ +-#if defined(__sparc__) && !(__GNUC__ >= 3) +- /* prevent bug #27830 */ +- return 1; +-#else +- return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1; +-#endif +-} ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-EOF +-if { (eval echo configure:91509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- ac_cv_huge_val_nan=yes + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ old_IFS=$IFS ++ for ac_src in tidy.c; do + +- ac_cv_huge_val_nan=no +- +-fi +-rm -fr conftest* +-fi ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +-fi ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-echo "$ac_t""$ac_cv_huge_val_nan" 1>&6 +-if test "$ac_cv_huge_val_nan" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_HUGE_VAL_NAN 1 ++ cat >>Makefile.objects<&6 +-echo "configure:91536: checking whether strptime() declaration fails" >&5 +-if eval "test \"`echo '$''{'ac_cv_strptime_decl_fails'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else ++ EXT_STATIC="$EXT_STATIC tidy" ++ ;; ++ *) ++ ++ ++ case ext/tidy in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac ++ + +-cat > conftest.$ac_ext < +- +-int main() { + +-#ifndef HAVE_STRPTIME +-#error no strptime() on this platform +-#else +-/* use invalid strptime() declaration to see if it fails to compile */ +-int strptime(const char *s, const char *format, struct tm *tm); +-#endif ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + +-; return 0; } +-EOF +-if { (eval echo configure:91558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- +- ac_cv_strptime_decl_fails=no + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* ++ old_IFS=$IFS ++ for ac_src in tidy.c; do + +- ac_cv_strptime_decl_fails=yes ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS ++ ++ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" + +-fi +-rm -f conftest* +-fi ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + +-echo "$ac_t""$ac_cv_strptime_decl_fails" 1>&6 +-if test "$ac_cv_strptime_decl_fails" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_STRPTIME_DECL_FAILS 1 ++ cat >>Makefile.objects<&6 +-echo "configure:91586: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:91596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC tidy" ++ fi ++ ++ ++ BUILD_DIR="$BUILD_DIR $ext_builddir" ++ + +-for ac_func in mblen +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:91625: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); + +-int main() { ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=tidy ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++ fi + +-; return 0; } +-EOF +-if { (eval echo configure:91653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST TIDY_SHARED_LIBADD" + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_TIDY 1 + EOF +- +-else +- echo "$ac_t""no" 1>&6 +-fi +-done + +-for ac_func in mbrlen mbsinit +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:91680: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); ++fi + +-int main() { + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif + +-; return 0; } +-EOF +-if { (eval echo configure:91708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" +-fi +-rm -f conftest* +-fi + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 +-fi +-done ++php_enable_tokenizer=yes + +-echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6 +-echo "configure:91733: checking for mbstate_t" >&5 +-if eval "test \"`echo '$''{'ac_cv_type_mbstate_t'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo $ac_n "checking whether to enable tokenizer support""... $ac_c" 1>&6 ++echo "configure:98309: checking whether to enable tokenizer support" >&5 ++# Check whether --enable-tokenizer or --disable-tokenizer was given. ++if test "${enable_tokenizer+set}" = set; then ++ enableval="$enable_tokenizer" ++ PHP_TOKENIZER=$enableval + else + +-cat > conftest.$ac_ext < +-#endif ++ PHP_TOKENIZER=yes ++ test "$PHP_ENABLE_ALL" && PHP_TOKENIZER=$PHP_ENABLE_ALL + +-int main() { ++fi + +-int __tmp__() { mbstate_t a; } + +-; return 0; } +-EOF +-if { (eval echo configure:91752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +- rm -rf conftest* +- +- ac_cv_type_mbstate_t=yes + +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- +- ac_cv_type_mbstate_t=no ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_TOKENIZER in ++shared,*) ++ PHP_TOKENIZER=`echo "$PHP_TOKENIZER"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_TOKENIZER=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + +-fi +-rm -f conftest* +-fi + +-echo "$ac_t""$ac_cv_type_mbstate_t" 1>&6 +-if test "$ac_cv_type_mbstate_t" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_MBSTATE_T 1 +-EOF + +-fi ++echo "$ac_t""$ext_output" 1>&6 + +-for ac_hdr in atomic.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:91780: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:91790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done + + + +- ext_builddir=ext/standard +- ext_srcdir=$abs_srcdir/ext/standard ++if test "$PHP_TOKENIZER" != "no"; then ++ ++ ext_builddir=ext/tokenizer ++ ext_srcdir=$abs_srcdir/ext/tokenizer + + ac_extra= + +- if test "" != "shared" && test "" != "yes" && test "" != "cli"; then +- PHP_STANDARD_SHARED=no ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_TOKENIZER_SHARED=no + + +- case ext/standard in ++ case ext/tokenizer in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -91841,17 +98374,7 @@ done + + + old_IFS=$IFS +- for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ +- cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ +- flock_compat.c formatted_print.c fsock.c head.c html.c image.c \ +- info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \ +- microtime.c pack.c pageinfo.c quot_print.c rand.c \ +- soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ +- var.c versioning.c assert.c strnatcmp.c levenshtein.c \ +- incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ +- http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ +- var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \ +- filters.c proc_open.c streamsfuncs.c http.c; do ++ for ac_src in tokenizer.c tokenizer_data.c; do + + IFS=. + set $ac_src +@@ -91874,18 +98397,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC standard" +- if test "" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC standard" ++ EXT_STATIC="$EXT_STATIC tokenizer" ++ if test "$ext_shared" != "nocli"; then ++ EXT_CLI_STATIC="$EXT_CLI_STATIC tokenizer" + fi + else +- if test "" = "shared" || test "" = "yes"; then +- PHP_STANDARD_SHARED=yes ++ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then ++ PHP_TOKENIZER_SHARED=yes + +- case ext/standard in ++ case ext/tokenizer in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -91900,24 +98423,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \ +- cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \ +- flock_compat.c formatted_print.c fsock.c head.c html.c image.c \ +- info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \ +- microtime.c pack.c pageinfo.c quot_print.c rand.c \ +- soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ +- var.c versioning.c assert.c strnatcmp.c levenshtein.c \ +- incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ +- http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ +- var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \ +- filters.c proc_open.c streamsfuncs.c http.c; do ++ for ac_src in tokenizer.c tokenizer_data.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_standard="$shared_objects_standard $ac_bdir$ac_obj.lo" ++ shared_objects_tokenizer="$shared_objects_tokenizer $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -91940,31 +98453,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpstandard.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpstandard.so '$ext_builddir'/phpstandard.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phptokenizer.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phptokenizer.so '$ext_builddir'/phptokenizer.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSTANDARD, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPTOKENIZER, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpstandard.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phptokenizer.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpstandard.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phptokenizer.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_standard" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tokenizer" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <> Makefile.fragments + +- +- +- for header_file in ext/standard/; do +- +- +- unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INSTALLHEADERS$unique=set" +- +- INSTALL_HEADERS="$INSTALL_HEADERS $header_file" +- +- fi +- +- done +- +- ++fi + + + +-php_with_sybase_ct=no ++php_enable_wddx=no + +-echo $ac_n "checking for Sybase-CT support""... $ac_c" 1>&6 +-echo "configure:92180: checking for Sybase-CT support" >&5 +-# Check whether --with-sybase-ct or --without-sybase-ct was given. +-if test "${with_sybase_ct+set}" = set; then +- withval="$with_sybase_ct" +- PHP_SYBASE_CT=$withval ++echo $ac_n "checking whether to enable WDDX support""... $ac_c" 1>&6 ++echo "configure:98655: checking whether to enable WDDX support" >&5 ++# Check whether --enable-wddx or --disable-wddx was given. ++if test "${enable_wddx+set}" = set; then ++ enableval="$enable_wddx" ++ PHP_WDDX=$enableval + else + +- PHP_SYBASE_CT=no +- test "$PHP_ENABLE_ALL" && PHP_SYBASE_CT=$PHP_ENABLE_ALL ++ PHP_WDDX=no ++ test "$PHP_ENABLE_ALL" && PHP_WDDX=$PHP_ENABLE_ALL + + fi + +@@ -92192,12 +98667,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_SYBASE_CT in ++case $PHP_WDDX in + shared,*) +- PHP_SYBASE_CT=`echo "$PHP_SYBASE_CT"|$SED 's/^shared,//'` ++ PHP_WDDX=`echo "$PHP_WDDX"|$SED 's/^shared,//'` + ;; + shared) +- PHP_SYBASE_CT=yes ++ PHP_WDDX=yes + ;; + no) + ext_output=no +@@ -92216,254 +98691,290 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test "$PHP_SYBASE_CT" != "no"; then ++if test -z "$PHP_LIBXML_DIR"; then ++ ++php_with_libxml_dir=no + +- if test "$PHP_SYBASE" && test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then +- { echo "configure: error: You can not use both --with-sybase and --with-sybase-ct in same build!" 1>&2; exit 1; } +- fi ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:98700: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else ++ ++ PHP_LIBXML_DIR=no ++ + +- cat >> confdefs.h <<\EOF +-#define HAVE_SYBASE_CT 1 +-EOF ++fi + +- +- ext_builddir=ext/sybase_ct +- ext_srcdir=$abs_srcdir/ext/sybase_ct + +- ac_extra= ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SYBASE_CT_SHARED=no +- +- +- case ext/sybase_ct in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ ++ ++fi ++ ++ ++php_with_libexpat_dir=no ++ ++echo $ac_n "checking libexpat dir for WDDX""... $ac_c" 1>&6 ++echo "configure:98724: checking libexpat dir for WDDX" >&5 ++# Check whether --with-libexpat-dir or --without-libexpat-dir was given. ++if test "${with_libexpat_dir+set}" = set; then ++ withval="$with_libexpat_dir" ++ PHP_LIBEXPAT_DIR=$withval ++else + ++ PHP_LIBEXPAT_DIR=no + + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++fi + + +- old_IFS=$IFS +- for ac_src in php_sybase_ct.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ext_output=$PHP_LIBEXPAT_DIR ++echo "$ac_t""$ext_output" 1>&6 + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<&2; exit 1; } + fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SYBASE_CT_SHARED=yes +- +- case ext/sybase_ct in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- ++ ++ ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:98752: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break ++ fi ++ done + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo ++fi + ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 + +- old_IFS=$IFS +- for ac_src in php_sybase_ct.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` + +- shared_objects_sybase_ct="$shared_objects_sybase_ct $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ for ac_i in $LIBXML_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ WDDX_SHARED_LIBADD="$WDDX_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsybase_ct.$suffix" ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase_ct" +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/sybase_ct.$suffix" ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase_ct" + +- cat >>Makefile.objects<> confdefs.h <&6 ++echo "configure:98910: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ ++ old_LIBS=$LIBS ++ LIBS=" ++ $WDDX_SHARED_LIBADD ++ $LIBS" ++ if test "$cross_compiling" = yes; then ++ ++ LIBS=$old_LIBS ++ ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes + + +- case ext/sybase_ct in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++fi ++rm -fr conftest* ++fi + + +- old_IFS=$IFS +- for ac_src in php_sybase_ct.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++fi + +- cat >>Makefile.objects<&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 + EOF +- done + +- +- EXT_STATIC="$EXT_STATIC sybase_ct" +- ;; +- *) ++ fi ++ ++ if test "$PHP_XML" = "no"; then + + +- case ext/sybase_ct in ++ case ext/xml in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -92478,20 +98989,20 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_sybase_ct.c; do ++ for ac_src in compat.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + + case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac + + cat >>Makefile.objects<&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } ++ ++ fi + + fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST SYBASE_CT_SHARED_LIBADD" ++ if test "$PHP_LIBEXPAT_DIR" != "no"; then ++ for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do ++ if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then ++ EXPAT_DIR=$i ++ break ++ fi ++ done + +- +- if test "$PHP_SYBASE_CT" = "yes"; then +- SYBASE_CT_INCDIR=/home/sybase/include +- SYBASE_CT_LIBDIR=/home/sybase/lib +- else +- SYBASE_CT_INCDIR=$PHP_SYBASE_CT/include +- SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib +- fi ++ if test -z "$EXPAT_DIR"; then ++ { echo "configure: error: not found. Please reinstall the expat distribution." 1>&2; exit 1; } ++ fi + +- if test -f $SYBASE_CT_INCDIR/ctpublic.h; then + +- if test "$SYBASE_CT_INCDIR" != "/usr/include"; then ++ if test "$EXPAT_DIR/include" != "/usr/include"; then + +- if test -z "$SYBASE_CT_INCDIR" || echo "$SYBASE_CT_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$SYBASE_CT_INCDIR ++ if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/include + else + +- ep_dir="`echo $SYBASE_CT_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EXPAT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SYBASE_CT_INCDIR\"`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`" + fi + + +@@ -92562,27 +99072,28 @@ EOF + + fi + +- else +- { echo "configure: error: ctpublic.h missing!" 1>&2; exit 1; } +- fi +- +- +- if test "$SYBASE_CT_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$SYBASE_CT_LIBDIR" != "/usr/lib"; then + +- if test -z "$SYBASE_CT_LIBDIR" || echo "$SYBASE_CT_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$SYBASE_CT_LIBDIR ++ ++ if test "$ext_shared" = "yes"; then ++ WDDX_SHARED_LIBADD="-lexpat $WDDX_SHARED_LIBADD" ++ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then ++ ++ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $SYBASE_CT_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$SYBASE_CT_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-L$ai_p $SYBASE_CT_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && SYBASE_CT_SHARED_LIBADD="$ld_runpath_switch$ai_p $SYBASE_CT_SHARED_LIBADD" ++ WDDX_SHARED_LIBADD="-L$ai_p $WDDX_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && WDDX_SHARED_LIBADD="$ld_runpath_switch$ai_p $WDDX_SHARED_LIBADD" + else + + +@@ -92604,772 +99115,522 @@ EOF + + fi + +- if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then +- +- +- case ct in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lct $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case ct in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lct $LIBS" +- ;; +- esac +- +- + fi +- ;; +- esac ++ else ++ + ++ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then ++ ++ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" ++ fi + +- SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct" +- elif test -f $SYBASE_CT_INCDIR/libsybct64.so; then + +- +- case sybcs64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybcs64 $SYBASE_CT_SHARED_LIBADD" +- else + + +- case sybcs64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybcs64 $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- + +- case sybct64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybct64 $SYBASE_CT_SHARED_LIBADD" +- else +- ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- case sybct64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybct64 $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + + ++ fi ++ ++ fi + +- case sybcomn64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybcomn64 $SYBASE_CT_SHARED_LIBADD" +- else +- + +- case sybcomn64 in ++ case expat in + c|c_r|pthread*) ;; + *) +- LIBS="-lsybcomn64 $LIBS" ++ LIBS="-lexpat $LIBS" + ;; + esac + + +- fi +- ;; +- esac + + +- +- +- case sybintl64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybintl64 $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybintl64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybintl64 $LIBS" +- ;; +- esac ++ fi + + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBEXPAT 1 ++EOF + ++ fi + ++ cat >> confdefs.h <<\EOF ++#define HAVE_WDDX 1 ++EOF + +- ac_solid_uname_s=`uname -s 2>/dev/null` +- case $ac_solid_uname_s in +- *OSF*) ;; # Tru64/DEC OSF does NOT use the SYB_LP64 define +- *) CFLAGS="${CFLAGS} -DSYB_LP64" ;; # +- esac +- SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64" + ++ ext_builddir=ext/wddx ++ ext_srcdir=$abs_srcdir/ext/wddx ++ ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_WDDX_SHARED=no + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $SYBASE_CT_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes + +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- ++ case ext/wddx in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ esac + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo ++ ++ ++ old_IFS=$IFS ++ for ac_src in wddx.c; do + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects</dev/null ; then +- ai_p=$ac_ii ++ shared_objects_wddx="$shared_objects_wddx $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<&6 +-echo "configure:92832: checking for netg_errstr in -lsybtcl64" >&5 +-ac_lib_var=`echo sybtcl64'_'netg_errstr | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsybtcl64 $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- case sybtcl64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybtcl64 $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybtcl64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybtcl64 $LIBS" +- ;; +- esac + ++ ;; ++ esac ++ cat >> confdefs.h <&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_sybtcl64_netg_errstr +- +- ++ old_IFS=$IFS ++ for ac_src in wddx.c; do + +- case sybtcl64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybtcl64 $SYBASE_CT_SHARED_LIBADD" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case sybtcl64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybtcl64 $LIBS" +- ;; +- esac +- ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- fi +- ;; +- esac ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac + ++ cat >>Makefile.objects<>Makefile.objects</dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC wddx" + fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ BUILD_DIR="$BUILD_DIR $ext_builddir" + +- fi + + +- fi ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=wddx + +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for insck__getVdate in -linsck64""... $ac_c" 1>&6 +-echo "configure:93026: checking for insck__getVdate in -linsck64" >&5 +-ac_lib_var=`echo insck64'_'insck__getVdate | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck64 $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ fi + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- ++ am_i_shared=$PHP_WDDX_SHARED ++ is_it_shared=$PHP_LIBXML_SHARED ++ is_it_enabled=$PHP_LIBXML ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension wddx to build statically, but it ++depends on extension libxml, which you've configured to build shared. ++You either need to build wddx shared or build libxml statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension wddx, which depends on extension libxml, ++but you've either not enabled libxml, or have disabled it. ++" 1>&2; exit 1; } ++ fi + +- case insck64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck64 $SYBASE_CT_SHARED_LIBADD" +- else +- + +- case insck64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-linsck64 $LIBS" +- ;; +- esac ++ PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD" + ++fi + +- fi +- ;; +- esac + + +- +-else +- echo "$ac_t""no" 1>&6 ++php_enable_xml=yes + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_insck64_insck__getVdate +- ++echo $ac_n "checking whether to enable XML support""... $ac_c" 1>&6 ++echo "configure:99504: checking whether to enable XML support" >&5 ++# Check whether --enable-xml or --disable-xml was given. ++if test "${enable_xml+set}" = set; then ++ enableval="$enable_xml" ++ PHP_XML=$enableval ++else + +-fi ++ PHP_XML=yes ++ test "$PHP_ENABLE_ALL" && PHP_XML=$PHP_ENABLE_ALL + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="-L$SYBASE_CT_LIBDIR" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac + + +- fi +- ;; +- esac ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_XML in ++shared,*) ++ PHP_XML=`echo "$PHP_XML"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_XML=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++echo "$ac_t""$ext_output" 1>&6 + + +- fi +- +- fi + +- ;; +- esac +- done + +- echo $ac_n "checking for bsd_tcp in -linsck64""... $ac_c" 1>&6 +-echo "configure:93193: checking for bsd_tcp in -linsck64" >&5 +-ac_lib_var=`echo insck64'_'bsd_tcp | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck64 $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:99549: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- + +- case insck64 in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck64 $SYBASE_CT_SHARED_LIBADD" +- else +- ++ PHP_LIBXML_DIR=no + +- case insck64 in +- c|c_r|pthread*) ;; +- *) +- LIBS="-linsck64 $LIBS" +- ;; +- esac ++ ++fi + + +- fi +- ;; +- esac ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 + + +- +-else +- echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_insck64_bsd_tcp +- +- + fi + +- elif test -f $SYBASE_CT_INCDIR/libsybct.so; then +- ++ ++php_with_libexpat_dir=no ++ ++echo $ac_n "checking libexpat install dir""... $ac_c" 1>&6 ++echo "configure:99573: checking libexpat install dir" >&5 ++# Check whether --with-libexpat-dir or --without-libexpat-dir was given. ++if test "${with_libexpat_dir+set}" = set; then ++ withval="$with_libexpat_dir" ++ PHP_LIBEXPAT_DIR=$withval ++else + +- case sybcs in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybcs $SYBASE_CT_SHARED_LIBADD" +- else +- ++ PHP_LIBEXPAT_DIR=no + +- case sybcs in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybcs $LIBS" +- ;; +- esac +- + +- fi +- ;; +- esac ++fi + + +- +- +- case sybct in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybct $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybct in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybct $LIBS" +- ;; +- esac ++ext_output=$PHP_LIBEXPAT_DIR ++echo "$ac_t""$ext_output" 1>&6 + + +- fi +- ;; +- esac + + +- +- +- case sybcomn in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybcomn $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybcomn in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybcomn $LIBS" +- ;; +- esac ++if test "$PHP_XML" != "no"; then + ++ if test "$PHP_LIBEXPAT_DIR" = "no"; then + ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: XML extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } + fi +- ;; +- esac +- + + ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:99602: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- case sybintl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybintl $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybintl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybintl $LIBS" +- ;; +- esac +- +- ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break + fi +- ;; +- esac ++ done + ++fi + +- +- SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl" +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- $SYBASE_CT_LIBS +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 ++ ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` ++ ++ for ac_i in $LIBXML_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ XML_SHARED_LIBADD="$XML_SHARED_LIBADD -pthread" + else + + +@@ -93391,7 +99652,7 @@ fi + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ XML_SHARED_LIBADD="$XML_SHARED_LIBADD -l$ac_ii" + else + + +@@ -93426,8 +99687,8 @@ fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ XML_SHARED_LIBADD="-L$ai_p $XML_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XML_SHARED_LIBADD="$ld_runpath_switch$ai_p $XML_SHARED_LIBADD" + else + + +@@ -93453,160 +99714,13 @@ fi + esac + done + +- echo $ac_n "checking for netg_errstr in -lsybtcl""... $ac_c" 1>&6 +-echo "configure:93458: checking for netg_errstr in -lsybtcl" >&5 +-ac_lib_var=`echo sybtcl'_'netg_errstr | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-lsybtcl $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybtcl $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_sybtcl_netg_errstr +- +- +- +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" +- else + +- +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybtcl $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +- +-fi +- +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="-L$SYBASE_CT_LIBDIR" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do ++ for ac_i in $LIBXML_INCS; do + case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) ++ -I*) + ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$ac_ii" != "/usr/include"; then + + if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then + ai_p=$ac_ii +@@ -93619,176 +99733,187 @@ fi + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + ++ fi ++ + ;; + esac + done + +- echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 +-echo "configure:93652: checking for insck__getVdate in -linsck" >&5 +-ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ ++ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 ++echo "configure:99760: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck $LIBS" +-cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++if { (eval echo configure:99787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes ++ ++ + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ rm -fr conftest* + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared ++ LIBS=$old_LIBS + ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ + +- case insck in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case insck in +- c|c_r|pthread*) ;; +- *) +- LIBS="-linsck $LIBS" +- ;; +- esac ++fi ++rm -fr conftest* ++fi + + +- fi +- ;; +- esac ++ ++fi + ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 ++EOF + ++ fi ++ ++ xml_extra_sources="compat.c" ++ ++ am_i_shared=$PHP_XML_SHARED ++ is_it_shared=$PHP_LIBXML_SHARED ++ is_it_enabled=$PHP_LIBXML ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension xml to build statically, but it ++depends on extension libxml, which you've configured to build shared. ++You either need to build xml shared or build libxml statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension xml, which depends on extension libxml, ++but you've either not enabled libxml, or have disabled it. ++" 1>&2; exit 1; } ++ fi + +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_insck_insck__getVdate + ++ else ++ { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } ++ ++ fi ++ ++ fi + +-fi ++ if test "$PHP_LIBEXPAT_DIR" != "no"; then ++ for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do ++ if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then ++ EXPAT_DIR=$i ++ break ++ fi ++ done ++ ++ if test -z "$EXPAT_DIR"; then ++ { echo "configure: error: not found. Please reinstall the expat distribution." 1>&2; exit 1; } ++ fi + + +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="-L$SYBASE_CT_LIBDIR" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ if test "$EXPAT_DIR/include" != "/usr/include"; then ++ ++ if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/include ++ else ++ ++ ep_dir="`echo $EXPAT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`" + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- ++ + +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi + +- fi +- ;; +- esac ++ fi + ++ + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` ++ if test "$ext_shared" = "yes"; then ++ XML_SHARED_LIBADD="-lexpat $XML_SHARED_LIBADD" ++ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ XML_SHARED_LIBADD="-L$ai_p $XML_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XML_SHARED_LIBADD="$ld_runpath_switch$ai_p $XML_SHARED_LIBADD" + else + + +@@ -93810,386 +99935,496 @@ fi + + fi + +- ;; +- esac +- done +- +- echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6 +-echo "configure:93819: checking for bsd_tcp in -linsck" >&5 +-ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then ++ ++ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EXPAT_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" ++ fi + +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 ++ ++ + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- case insck in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" +- else +- ++ fi ++ ++ ++ ++ fi ++ ++ fi + +- case insck in ++ ++ case expat in + c|c_r|pthread*) ;; + *) +- LIBS="-linsck $LIBS" ++ LIBS="-lexpat $LIBS" + ;; + esac + + +- fi +- ;; +- esac + + +- +-else +- echo "$ac_t""no" 1>&6 ++ fi ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBEXPAT 1 ++EOF ++ ++ fi + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_insck_bsd_tcp +- + +-fi ++ ext_builddir=ext/xml ++ ext_srcdir=$abs_srcdir/ext/xml + +- else ++ ac_extra= ++ ++ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then ++ PHP_XML_SHARED=no + + +- case cs in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lcs $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case cs in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lcs $LIBS" +- ;; ++ case ext/xml in ++ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac ++ ++ + +- +- fi +- ;; +- esac ++ b_c_pre=$php_c_pre ++ b_cxx_pre=$php_cxx_pre ++ b_c_meta=$php_c_meta ++ b_cxx_meta=$php_cxx_meta ++ b_c_post=$php_c_post ++ b_cxx_post=$php_cxx_post ++ b_lo=$php_lo + + +- ++ old_IFS=$IFS ++ for ac_src in xml.c $xml_extra_sources; do + +- case ct in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lct $SYBASE_CT_SHARED_LIBADD" +- else ++ IFS=. ++ set $ac_src ++ ac_obj=$1 ++ IFS=$old_IFS + +- +- case ct in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lct $LIBS" +- ;; +- esac ++ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_src in ++ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ esac ++ ++ cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects<>Makefile.objects</dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ;; ++ esac ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xml" + fi ++ ++ ++ BUILD_DIR="$BUILD_DIR $ext_builddir" ++ + ++ ++ if test "$ext_builddir" = "."; then ++ PHP_PECL_EXTENSION=xml + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- ++ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" ++ ++ fi ++ + ++ PHP_VAR_SUBST="$PHP_VAR_SUBST XML_SHARED_LIBADD" ++ + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ for header_file in ext/xml/; do ++ ++ ++ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INSTALLHEADERS$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- ++ INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ++ + fi + ++ done ++ + +- fi +- +- fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_XML 1 ++EOF + +- ;; +- esac +- done ++fi + +- echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6 +-echo "configure:94084: checking for netg_errstr in -ltcl" >&5 +-ac_lib_var=`echo tcl'_'netg_errstr | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-ltcl $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ ++php_enable_xmlreader=yes ++ ++echo $ac_n "checking whether to enable XMLReader support""... $ac_c" 1>&6 ++echo "configure:100323: checking whether to enable XMLReader support" >&5 ++# Check whether --enable-xmlreader or --disable-xmlreader was given. ++if test "${enable_xmlreader+set}" = set; then ++ enableval="$enable_xmlreader" ++ PHP_XMLREADER=$enableval + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" ++ ++ PHP_XMLREADER=yes ++ test "$PHP_ENABLE_ALL" && PHP_XMLREADER=$PHP_ENABLE_ALL + + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- +- case tcl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-ltcl $SYBASE_CT_SHARED_LIBADD" +- else +- +- +- case tcl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-ltcl $LIBS" +- ;; +- esac + + +- fi +- ;; +- esac ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_XMLREADER in ++shared,*) ++ PHP_XMLREADER=`echo "$PHP_XMLREADER"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_XMLREADER=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac + + +- ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test -z "$PHP_LIBXML_DIR"; then + +-else +- echo "$ac_t""no" 1>&6 ++php_with_libxml_dir=no + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_tcl_netg_errstr +- +- ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:100368: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else + +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD" +- else +- ++ PHP_LIBXML_DIR=no + +- case sybtcl in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lsybtcl $LIBS" +- ;; +- esac ++ ++fi + + +- fi +- ;; +- esac ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ + + +- +- + fi + ++if test "$PHP_XMLREADER" != "no"; then ++ ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: XMLReader extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi ++ + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="-L$SYBASE_CT_LIBDIR" +- +- save_ext_shared=$ext_shared +- ext_shared=yes ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:100396: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else + +- for ac_i in $ac_stuff; do ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break ++ fi ++ done ++ ++fi ++ ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 ++ ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` ++ ++ for ac_i in $LIBXML_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" ++ XMLREADER_SHARED_LIBADD="$XMLREADER_SHARED_LIBADD -pthread" + else + + +@@ -94211,7 +100446,7 @@ fi + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" ++ XMLREADER_SHARED_LIBADD="$XMLREADER_SHARED_LIBADD -l$ac_ii" + else + + +@@ -94246,8 +100481,8 @@ fi + + + if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ XMLREADER_SHARED_LIBADD="-L$ai_p $XMLREADER_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLREADER_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLREADER_SHARED_LIBADD" + else + + +@@ -94273,133 +100508,13 @@ fi + esac + done + +- echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 +-echo "configure:94278: checking for insck__getVdate in -linsck" >&5 +-ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- +- case insck in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" +- else + +- +- case insck in +- c|c_r|pthread*) ;; +- *) +- LIBS="-linsck $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- +-else +- echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_insck_insck__getVdate +- +- +-fi +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="-L$SYBASE_CT_LIBDIR" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do ++ for ac_i in $LIBXML_INCS; do + case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) ++ -I*) + ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test "$ac_ii" != "/usr/include"; then + + if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then + ai_p=$ac_ii +@@ -94412,209 +100527,109 @@ fi + fi + + +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" ++ eval "INCLUDEPATH$unique=set" + +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" + fi + + fi + ++ fi ++ + ;; + esac + done + +- echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6 +-echo "configure:94445: checking for bsd_tcp in -linsck" >&5 +-ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- ac_save_LIBS="$LIBS" +-LIBS="-linsck $LIBS" +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 ++echo "configure:100554: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" +-fi +-rm -f conftest* +-LIBS="$ac_save_LIBS" +- +-fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- + +- case insck in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD" +- else +- ++ ++ old_LIBS=$LIBS ++ LIBS=" ++ $XMLREADER_SHARED_LIBADD ++ $LIBS" ++ if test "$cross_compiling" = yes; then + +- case insck in +- c|c_r|pthread*) ;; +- *) +- LIBS="-linsck $LIBS" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- ++ LIBS=$old_LIBS + + else +- echo "$ac_t""no" 1>&6 ++ cat > conftest.$ac_ext <&6 +-echo "configure:94524: checking whether to enable System V IPC support" >&5 +-# Check whether --enable-sysvmsg or --disable-sysvmsg was given. +-if test "${enable_sysvmsg+set}" = set; then +- enableval="$enable_sysvmsg" +- PHP_SYSVMSG=$enableval +-else +- +- PHP_SYSVMSG=no +- test "$PHP_ENABLE_ALL" && PHP_SYSVMSG=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SYSVMSG in +-shared,*) +- PHP_SYSVMSG=`echo "$PHP_SYSVMSG"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SYSVMSG=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_SYSVMSG" != "no"; then +- ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 +-echo "configure:94567: checking for sys/msg.h" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- cat > conftest.$ac_ext < + EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:94577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" ++if { (eval echo configure:100581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes ++ ++ + else +- echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" +-fi +-rm -f conftest* +-fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +- echo "$ac_t""yes" 1>&6 +- : +-else +- echo "$ac_t""no" 1>&6 +-{ echo "configure: error: Cannot enable System V IPC support, sys/msg.h is missing" 1>&2; exit 1; } ++ rm -fr conftest* ++ ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ + + fi ++rm -fr conftest* ++fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_SYSVMSG 1 ++ ++fi ++ ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 + EOF + +- +- ext_builddir=ext/sysvmsg +- ext_srcdir=$abs_srcdir/ext/sysvmsg ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_XMLREADER 1 ++EOF ++ ++ ++ ext_builddir=ext/xmlreader ++ ext_srcdir=$abs_srcdir/ext/xmlreader + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SYSVMSG_SHARED=no ++ PHP_XMLREADER_SHARED=no + + +- case ext/sysvmsg in ++ case ext/xmlreader in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlreader"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlreader/"; ac_bdir="ext/xmlreader/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -94629,7 +100644,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in sysvmsg.c; do ++ for ac_src in php_xmlreader.c; do + + IFS=. + set $ac_src +@@ -94652,18 +100667,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC sysvmsg" ++ EXT_STATIC="$EXT_STATIC xmlreader" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC sysvmsg" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xmlreader" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SYSVMSG_SHARED=yes ++ PHP_XMLREADER_SHARED=yes + +- case ext/sysvmsg in ++ case ext/xmlreader in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlreader"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlreader/"; ac_bdir="ext/xmlreader/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -94678,14 +100693,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in sysvmsg.c; do ++ for ac_src in php_xmlreader.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_sysvmsg="$shared_objects_sysvmsg $ac_bdir$ac_obj.lo" ++ shared_objects_xmlreader="$shared_objects_xmlreader $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -94708,31 +100723,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpsysvmsg.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(PHPSYSVMSG_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpsysvmsg.so '$ext_builddir'/phpsysvmsg.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlreader.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) $(PHPXMLREADER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlreader.so '$ext_builddir'/phpxmlreader.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPSYSVMSG, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLREADER, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(PHPSYSVMSG_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) $(PHPXMLREADER_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpsysvmsg.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlreader.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvmsg.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlreader.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvmsg" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlreader" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension xmlreader, which depends on extension dom, ++but you've either not enabled dom, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST XMLREADER_SHARED_LIBADD" ++ ++ ++ else ++ { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } ++ ++ fi ++ + fi + + ++# Local macros for automake & autoconf + +-php_enable_sysvsem=no + +-echo $ac_n "checking whether to enable System V semaphore support""... $ac_c" 1>&6 +-echo "configure:94904: checking whether to enable System V semaphore support" >&5 +-# Check whether --enable-sysvsem or --disable-sysvsem was given. +-if test "${enable_sysvsem+set}" = set; then +- enableval="$enable_sysvsem" +- PHP_SYSVSEM=$enableval ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++php_with_xmlrpc=no ++ ++echo $ac_n "checking for XMLRPC-EPI support""... $ac_c" 1>&6 ++echo "configure:100963: checking for XMLRPC-EPI support" >&5 ++# Check whether --with-xmlrpc or --without-xmlrpc was given. ++if test "${with_xmlrpc+set}" = set; then ++ withval="$with_xmlrpc" ++ PHP_XMLRPC=$withval + else + +- PHP_SYSVSEM=no +- test "$PHP_ENABLE_ALL" && PHP_SYSVSEM=$PHP_ENABLE_ALL ++ PHP_XMLRPC=no ++ test "$PHP_ENABLE_ALL" && PHP_XMLRPC=$PHP_ENABLE_ALL ++ ++fi ++ ++ ++ ++ext_output="yes, shared" ++ext_shared=yes ++case $PHP_XMLRPC in ++shared,*) ++ PHP_XMLRPC=`echo "$PHP_XMLRPC"|$SED 's/^shared,//'` ++ ;; ++shared) ++ PHP_XMLRPC=yes ++ ;; ++no) ++ ext_output=no ++ ext_shared=no ++ ;; ++*) ++ ext_output=yes ++ ext_shared=no ++ ;; ++esac ++ ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test -z "$PHP_LIBXML_DIR"; then ++ ++php_with_libxml_dir=no ++ ++echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 ++echo "configure:101008: checking libxml2 install dir" >&5 ++# Check whether --with-libxml-dir or --without-libxml-dir was given. ++if test "${with_libxml_dir+set}" = set; then ++ withval="$with_libxml_dir" ++ PHP_LIBXML_DIR=$withval ++else ++ ++ PHP_LIBXML_DIR=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_LIBXML_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++fi ++ ++ ++php_with_libexpat_dir=no ++ ++echo $ac_n "checking libexpat dir for XMLRPC-EPI""... $ac_c" 1>&6 ++echo "configure:101032: checking libexpat dir for XMLRPC-EPI" >&5 ++# Check whether --with-libexpat-dir or --without-libexpat-dir was given. ++if test "${with_libexpat_dir+set}" = set; then ++ withval="$with_libexpat_dir" ++ PHP_LIBEXPAT_DIR=$withval ++else ++ ++ PHP_LIBEXPAT_DIR=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_LIBEXPAT_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++ ++php_with_iconv_dir=no ++ ++echo $ac_n "checking iconv dir for XMLRPC-EPI""... $ac_c" 1>&6 ++echo "configure:101055: checking iconv dir for XMLRPC-EPI" >&5 ++# Check whether --with-iconv-dir or --without-iconv-dir was given. ++if test "${with_iconv_dir+set}" = set; then ++ withval="$with_iconv_dir" ++ PHP_ICONV_DIR=$withval ++else ++ ++ PHP_ICONV_DIR=no ++ ++ ++fi ++ ++ ++ext_output=$PHP_ICONV_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_XMLRPC" != "no"; then ++ ++ ++ am_i_shared=$PHP_XMLRPC_SHARED ++ is_it_shared=$PHP_LIBXML_SHARED ++ is_it_enabled=$PHP_LIBXML ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension xmlrpc to build statically, but it ++depends on extension libxml, which you've configured to build shared. ++You either need to build xmlrpc shared or build libxml statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension xmlrpc, which depends on extension libxml, ++but you've either not enabled libxml, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD" ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_XMLRPC 1 ++EOF ++ ++ ++ if test "$PHP_LIBEXPAT_DIR" = "no"; then ++ ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: XML-RPC extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi ++ ++ ++echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 ++echo "configure:101111: checking for xml2-config path" >&5 ++if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ for i in $PHP_LIBXML_DIR /usr/local /usr; do ++ if test -x "$i/bin/xml2-config"; then ++ ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ break ++ fi ++ done ++ ++fi ++ ++echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 ++ ++ if test -x "$ac_cv_php_xml2_config_path"; then ++ XML2_CONFIG="$ac_cv_php_xml2_config_path" ++ libxml_full_version=`$XML2_CONFIG --version` ++ ac_IFS=$IFS ++ IFS="." ++ set $libxml_full_version ++ IFS=$ac_IFS ++ LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXML_VERSION" -ge "2006011"; then ++ LIBXML_LIBS=`$XML2_CONFIG --libs` ++ LIBXML_INCS=`$XML2_CONFIG --cflags` ++ ++ for ac_i in $LIBXML_LIBS; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="$XMLRPC_SHARED_LIBADD -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="$XMLRPC_SHARED_LIBADD -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi ++ ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ for ac_i in $LIBXML_INCS; do ++ case $ac_i in ++ -I*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/include"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ ;; ++ esac ++ done ++ ++ ++ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 ++echo "configure:101269: checking whether libxml build works" >&5 ++if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ++ ++ old_LIBS=$LIBS ++ LIBS=" ++ $XMLRPC_SHARED_LIBADD ++ $LIBS" ++ if test "$cross_compiling" = yes; then ++ ++ LIBS=$old_LIBS ++ ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ LIBS=$old_LIBS ++ ++ php_cv_libxml_build_works=yes ++ ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ ++ ++fi ++rm -fr conftest* + fi + + ++ ++fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SYSVSEM in +-shared,*) +- PHP_SYSVSEM=`echo "$PHP_SYSVSEM"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SYSVSEM=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_SYSVSEM" != "no"; then +- +- ext_builddir=ext/sysvsem +- ext_srcdir=$abs_srcdir/ext/sysvsem +- +- ac_extra= ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 ++EOF + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SYSVSEM_SHARED=no +- ++ fi ++ ++ if test "$PHP_XML" = "no"; then ++ + +- case ext/sysvsem in ++ case ext/xml in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -94969,7 +101348,7 @@ if test "$PHP_SYSVSEM" != "no"; then + + + old_IFS=$IFS +- for ac_src in sysvsem.c; do ++ for ac_src in compat.c; do + + IFS=. + set $ac_src +@@ -94979,10 +101358,10 @@ if test "$PHP_SYSVSEM" != "no"; then + PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + + case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; ++ *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; ++ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; + esac + + cat >>Makefile.objects<&2; exit 1; } + fi ++else ++ { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } ++ ++ fi ++ + else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_SYSVSEM_SHARED=yes ++ testval=no ++ for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do ++ if test -f $i/$PHP_LIBDIR/libexpat.a || test -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBEXPAT 1 ++EOF ++ ++ ++ ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="-lexpat $XMLRPC_SHARED_LIBADD" ++ if test -n "$i/$PHP_LIBDIR"; then + +- case ext/sysvsem in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ if test "$i/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$i/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$i/$PHP_LIBDIR" || echo "$i/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$i/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $i/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$i/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" ++ else ++ + + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo + ++ fi ++ ++ fi + +- old_IFS=$IFS +- for ac_src in sysvsem.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_sysvsem="$shared_objects_sysvsem $ac_bdir$ac_obj.lo" ++ fi ++ else ++ + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ if test -n "$i/$PHP_LIBDIR"; then ++ ++ if test "$i/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$i/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$i/$PHP_LIBDIR" || echo "$i/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$i/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $i/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$i/$PHP_LIBDIR\"`" ++ fi + +- cat >>Makefile.objects<>Makefile.objects</dev/null ; then ++ ai_p=$i/include + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvsem.$suffix" ++ ++ ep_dir="`echo $i/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$i/include\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvsem" +- +- cat >>Makefile.objects<> confdefs.h < (deprecated!)" 1>&2; exit 1; } + fi + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_SYSVSEM_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- ++ if test "$PHP_ICONV_SHARED" = "yes" || test "$PHP_ICONV" = "no"; then ++ ++ if test "$PHP_ICONV_DIR" != "no"; then ++ PHP_ICONV=$PHP_ICONV_DIR ++ fi + +- case ext/sysvsem in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then ++ PHP_ICONV=yes ++ fi + ++ ++ found_iconv=no ++ unset ICONV_DIR ++ ++ # Create the directories for a VPATH build: ++ $php_shtool mkdir -p ext/iconv ++ ++ echo > ext/iconv/php_have_bsd_iconv.h ++ echo > ext/iconv/php_have_ibm_iconv.h ++ echo > ext/iconv/php_have_glibc_iconv.h ++ echo > ext/iconv/php_have_libiconv.h ++ echo > ext/iconv/php_have_iconv.h ++ echo > ext/iconv/php_php_iconv_impl.h ++ echo > ext/iconv/php_iconv_aliased_libiconv.h ++ echo > ext/iconv/php_php_iconv_h_path.h ++ echo > ext/iconv/php_iconv_supports_errno.h ++ ++ if test "$PHP_ICONV" = "yes"; then ++ echo $ac_n "checking for iconv""... $ac_c" 1>&6 ++echo "configure:101565: checking for iconv" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char iconv(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_iconv) || defined (__stub___iconv) ++choke me ++#else ++iconv(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:101593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_iconv=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_iconv=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'iconv`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + ++ found_iconv=yes ++ ++else ++ echo "$ac_t""no" 1>&6 + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++ echo $ac_n "checking for libiconv""... $ac_c" 1>&6 ++echo "configure:101614: checking for libiconv" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char libiconv(); + ++int main() { + +- old_IFS=$IFS +- for ac_src in sysvsem.c; do ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_libiconv) || defined (__stub___libiconv) ++choke me ++#else ++libiconv(); ++#endif ++ ++; return 0; } ++EOF ++if { (eval echo configure:101642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_libiconv=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_libiconv=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'libiconv`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ ++ echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBICONV 1 ++EOF ++ ++ found_iconv=yes + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++else ++ echo "$ac_t""no" 1>&6 ++fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ ++fi + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_GICONV_H 1 + EOF +- done + ++ ICONV_DIR=$i ++ iconv_lib_name=giconv ++ break ++ elif test -r $i/include/iconv.h; then ++ ICONV_DIR=$i ++ iconv_lib_name=iconv ++ break ++ fi ++ done + +- EXT_STATIC="$EXT_STATIC sysvsem" +- ;; +- *) +- ++ if test -z "$ICONV_DIR"; then ++ { echo "configure: error: Please specify the install prefix of iconv with --with-iconv=" 1>&2; exit 1; } ++ fi + +- case ext/sysvsem in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a || ++ test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME ++ then ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$ICONV_DIR/$PHP_LIBDIR ++ " + ++ save_ext_shared=$ext_shared ++ ext_shared=yes + ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in sysvsem.c; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + + +- BUILD_DIR="$BUILD_DIR $ext_builddir" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=sysvsem ++ fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" +- + fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_SYSVSEM 1 +-EOF ++ ;; ++ esac ++ done + +- echo $ac_n "checking for union semun""... $ac_c" 1>&6 +-echo "configure:95242: checking for union semun" >&5 +-if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then ++ echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6 ++echo "configure:101798: checking for libiconv in -l$iconv_lib_name" >&5 ++ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < +-#include +-#include +- + int main() { +-union semun x; ++libiconv() + ; return 0; } + EOF +-if { (eval echo configure:95258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:101817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- +- php_cv_semun=yes +- ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- +- php_cv_semun=no +- ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +- +-fi +- +-echo "$ac_t""$php_cv_semun" 1>&6 +- if test "$php_cv_semun" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SEMUN 1 +-EOF +- +- else +- cat >> confdefs.h <<\EOF +-#define HAVE_SEMUN 0 +-EOF ++LIBS="$ac_save_LIBS" + +- fi + fi +- +- +- +-php_enable_sysvshm=no +- +-echo $ac_n "checking whether to enable System V shared memory support""... $ac_c" 1>&6 +-echo "configure:95294: checking whether to enable System V shared memory support" >&5 +-# Check whether --enable-sysvshm or --disable-sysvshm was given. +-if test "${enable_sysvshm+set}" = set; then +- enableval="$enable_sysvshm" +- PHP_SYSVSHM=$enableval +-else ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- PHP_SYSVSHM=no +- test "$PHP_ENABLE_ALL" && PHP_SYSVSHM=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_SYSVSHM in +-shared,*) +- PHP_SYSVSHM=`echo "$PHP_SYSVSHM"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_SYSVSHM=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ found_iconv=yes ++ ++ echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBICONV 1 ++EOF + ++ ++ echo "#define ICONV_ALIASED_LIBICONV 1" > ext/iconv/php_iconv_aliased_libiconv.h + +-if test "$PHP_SYSVSHM" != "no"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_SYSVSHM 1 ++ cat >> confdefs.h <<\EOF ++#define ICONV_ALIASED_LIBICONV 1 + EOF + ++ + +- ext_builddir=ext/sysvshm +- ext_srcdir=$abs_srcdir/ext/sysvshm +- +- ac_extra= ++else ++ echo "$ac_t""no" 1>&6 + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_SYSVSHM_SHARED=no ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$iconv_lib_name_libiconv + ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff=" ++ -L$ICONV_DIR/$PHP_LIBDIR ++ " + +- case ext/sysvshm in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ save_ext_shared=$ext_shared ++ ext_shared=yes + ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in sysvshm.c; do ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h <>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi + +- EXT_STATIC="$EXT_STATIC sysvshm" +- ;; +- *) ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else + + +- case ext/sysvshm in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in sysvshm.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<&6 +-echo "configure:95638: checking for TIDY support" >&5 +-# Check whether --with-tidy or --without-tidy was given. +-if test "${with_tidy+set}" = set; then +- withval="$with_tidy" +- PHP_TIDY=$withval ++ echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6 ++echo "configure:101958: checking for iconv in -l$iconv_lib_name" >&5 ++ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- PHP_TIDY=no +- test "$PHP_ENABLE_ALL" && PHP_TIDY=$PHP_ENABLE_ALL ++ ac_save_LIBS="$LIBS" ++LIBS="-l$iconv_lib_name $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ ++ found_iconv=yes ++ ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_$iconv_lib_name_iconv ++ ++ ++fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_TIDY in +-shared,*) +- PHP_TIDY=`echo "$PHP_TIDY"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_TIDY=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_TIDY" != "no"; then +- +- if test "$PHP_TIDY" != "yes"; then +- TIDY_SEARCH_DIRS=$PHP_TIDY +- else +- TIDY_SEARCH_DIRS="/usr/local /usr" +- fi ++ ++ ++fi + +- for i in $TIDY_SEARCH_DIRS; do +- if test -f $i/include/tidy/tidy.h; then +- TIDY_DIR=$i +- TIDY_INCDIR=$i/include/tidy +- elif test -f $i/include/tidy.h; then +- TIDY_DIR=$i +- TIDY_INCDIR=$i/include + fi +- done +- +- if test -z "$TIDY_DIR"; then +- { echo "configure: error: Cannot find libtidy" 1>&2; exit 1; } + fi + +- TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR ++ if test "$found_iconv" = "yes"; then ++ ++ echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h + +- ++ cat >> confdefs.h <<\EOF ++#define HAVE_ICONV 1 ++EOF ++ ++ if test -n "$ICONV_DIR"; then ++ + + if test "$ext_shared" = "yes"; then +- TIDY_SHARED_LIBADD="-ltidy $TIDY_SHARED_LIBADD" +- if test -n "$TIDY_LIBDIR"; then ++ XMLRPC_SHARED_LIBADD="-l$iconv_lib_name $XMLRPC_SHARED_LIBADD" ++ if test -n "$ICONV_DIR/$PHP_LIBDIR"; then + +- if test "$TIDY_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$TIDY_LIBDIR" != "/usr/lib"; then ++ if test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$TIDY_LIBDIR" || echo "$TIDY_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$TIDY_LIBDIR ++ if test -z "$ICONV_DIR/$PHP_LIBDIR" || echo "$ICONV_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$ICONV_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $TIDY_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ICONV_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$TIDY_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$ICONV_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- TIDY_SHARED_LIBADD="-L$ai_p $TIDY_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && TIDY_SHARED_LIBADD="$ld_runpath_switch$ai_p $TIDY_SHARED_LIBADD" ++ XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" + else + + +@@ -95745,18 +102068,18 @@ if test "$PHP_TIDY" != "no"; then + else + + +- if test -n "$TIDY_LIBDIR"; then ++ if test -n "$ICONV_DIR/$PHP_LIBDIR"; then + +- if test "$TIDY_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$TIDY_LIBDIR" != "/usr/lib"; then ++ if test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$TIDY_LIBDIR" || echo "$TIDY_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$TIDY_LIBDIR ++ if test -z "$ICONV_DIR/$PHP_LIBDIR" || echo "$ICONV_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$ICONV_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $TIDY_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ICONV_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$TIDY_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$ICONV_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -95776,223 +102099,642 @@ if test "$PHP_TIDY" != "no"; then + fi + + +- +- fi ++ ++ fi ++ ++ fi ++ ++ ++ case $iconv_lib_name in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-l$iconv_lib_name $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ ++ ++ ++ if test "$ICONV_DIR/include" != "/usr/include"; then ++ ++ if test -z "$ICONV_DIR/include" || echo "$ICONV_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$ICONV_DIR/include ++ else ++ ++ ep_dir="`echo $ICONV_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ICONV_DIR/include\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ fi ++ ++else ++ { echo "configure: error: iconv not found, in order to build xmlrpc you need the iconv library" 1>&2; exit 1; } ++ ++ fi ++ ++ fi ++fi ++ ++if test "$PHP_XMLRPC" = "yes"; then ++ # Extract the first word of "ranlib", so it can be a program name with args. ++set dummy ranlib; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:102167: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$RANLIB"; then ++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_RANLIB="ranlib" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" ++fi ++fi ++RANLIB="$ac_cv_prog_RANLIB" ++if test -n "$RANLIB"; then ++ echo "$ac_t""$RANLIB" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++echo $ac_n "checking for inline""... $ac_c" 1>&6 ++echo "configure:102195: checking for inline" >&5 ++if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_cv_c_inline=no ++for ac_kw in inline __inline__ __inline; do ++ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_c_inline=$ac_kw; break ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++fi ++rm -f conftest* ++done ++ ++fi ++ ++echo "$ac_t""$ac_cv_c_inline" 1>&6 ++case "$ac_cv_c_inline" in ++ inline | yes) ;; ++ no) cat >> confdefs.h <<\EOF ++#define inline ++EOF ++ ;; ++ *) cat >> confdefs.h <> confdefs.h <<\EOF ++#define UNDEF_THREADS_HACK ++EOF ++ ++ ++ ++echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ++echo "configure:102247: checking for ANSI C header files" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++#include ++#include ++#include ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:102260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ ac_cv_header_stdc=yes ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++if test $ac_cv_header_stdc = yes; then ++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ++cat > conftest.$ac_ext < ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "memchr" >/dev/null 2>&1; then ++ : ++else ++ rm -rf conftest* ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++cat > conftest.$ac_ext < ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "free" >/dev/null 2>&1; then ++ : ++else ++ rm -rf conftest* ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ++if test "$cross_compiling" = yes; then ++ : ++else ++ cat > conftest.$ac_ext < ++#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) ++int main () { int i; for (i = 0; i < 256; i++) ++if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); ++exit (0); } ++ ++EOF ++if { (eval echo configure:102327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ : ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_header_stdc=no ++fi ++rm -fr conftest* ++fi ++ ++fi ++fi ++ ++echo "$ac_t""$ac_cv_header_stdc" 1>&6 ++if test $ac_cv_header_stdc = yes; then ++ cat >> confdefs.h <<\EOF ++#define STDC_HEADERS 1 ++EOF ++ ++fi ++ ++for ac_hdr in xmlparse.h xmltok.h stdlib.h strings.h string.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:102354: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:102364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done ++ ++ ++ ++ ++ ++ ++echo $ac_n "checking size of char""... $ac_c" 1>&6 ++echo "configure:102396: checking size of char" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_char=1 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(char)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:102416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_char=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_char=0 ++fi ++rm -fr conftest* ++fi ++ ++fi ++echo "$ac_t""$ac_cv_sizeof_char" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:102437: checking size of int" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_int=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(int)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:102457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_int=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_int=0 ++fi ++rm -fr conftest* ++fi ++ ++fi ++echo "$ac_t""$ac_cv_sizeof_int" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:102477: checking size of long" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_long=4 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(long)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:102497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_long=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_long=0 ++fi ++rm -fr conftest* ++fi ++ ++fi ++echo "$ac_t""$ac_cv_sizeof_long" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:102517: checking size of long long" >&5 ++if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$cross_compiling" = yes; then ++ ac_cv_sizeof_long_long=8 ++else ++ cat > conftest.$ac_ext < ++#include ++main() ++{ ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ fprintf(f, "%d\n", sizeof(long long)); ++ exit(0); ++} ++EOF ++if { (eval echo configure:102537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ac_cv_sizeof_long_long=`cat conftestval` ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ac_cv_sizeof_long_long=0 ++fi ++rm -fr conftest* ++fi + ++fi ++echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 ++cat >> confdefs.h <&6 ++echo "configure:102557: checking for size_t" >&5 ++if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++#if STDC_HEADERS ++#include ++#include ++#endif ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ++ rm -rf conftest* ++ ac_cv_type_size_t=yes ++else ++ rm -rf conftest* ++ ac_cv_type_size_t=no ++fi ++rm -f conftest* + ++fi ++echo "$ac_t""$ac_cv_type_size_t" 1>&6 ++if test $ac_cv_type_size_t = no; then ++ cat >> confdefs.h <<\EOF ++#define size_t unsigned ++EOF + +- +- if test "$TIDY_INCDIR" != "/usr/include"; then +- +- if test -z "$TIDY_INCDIR" || echo "$TIDY_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$TIDY_INCDIR +- else +- +- ep_dir="`echo $TIDY_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$TIDY_INCDIR\"`" +- fi ++fi + +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ++echo "configure:102590: checking whether time.h and sys/time.h may both be included" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++#include ++#include ++int main() { ++struct tm *tp; ++; return 0; } ++EOF ++if { (eval echo configure:102604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_header_time=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_header_time=no ++fi ++rm -f conftest* ++fi + +- fi ++echo "$ac_t""$ac_cv_header_time" 1>&6 ++if test $ac_cv_header_time = yes; then ++ cat >> confdefs.h <<\EOF ++#define TIME_WITH_SYS_TIME 1 ++EOF + ++fi + +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff="" +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi ++echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ++echo "configure:102625: checking for uid_t in sys/types.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "uid_t" >/dev/null 2>&1; then ++ rm -rf conftest* ++ ac_cv_type_uid_t=yes ++else ++ rm -rf conftest* ++ ac_cv_type_uid_t=no ++fi ++rm -f conftest* + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac ++fi + ++echo "$ac_t""$ac_cv_type_uid_t" 1>&6 ++if test $ac_cv_type_uid_t = no; then ++ cat >> confdefs.h <<\EOF ++#define uid_t int ++EOF + +- fi +- ;; +- esac ++ cat >> confdefs.h <<\EOF ++#define gid_t int ++EOF + ++fi + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi + + +- fi +- +- fi + +- ;; +- esac +- done + +- echo $ac_n "checking for tidyOptGetDoc in -ltidy""... $ac_c" 1>&6 +-echo "configure:95927: checking for tidyOptGetDoc in -ltidy" >&5 +-ac_lib_var=`echo tidy'_'tidyOptGetDoc | sed 'y%./+-%__p_%'` +-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++# Standard XMLRPC list ++for ac_func in \ ++ strtoul strtoull snprintf \ ++ strstr strpbrk strerror\ ++ memcpy memmove ++do ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:102670: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_save_LIBS="$LIBS" +-LIBS="-ltidy $LIBS" +-cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char tidyOptGetDoc(); ++char $ac_func(); + + int main() { +-tidyOptGetDoc() ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_$ac_func) || defined (__stub___$ac_func) ++choke me ++#else ++$ac_func(); ++#endif ++ + ; return 0; } + EOF +-if { (eval echo configure:95946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:102698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=yes" ++ eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_lib_$ac_lib_var=no" ++ eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* +-LIBS="$ac_save_LIBS" +- + fi +-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- cat >> confdefs.h <<\EOF +-#define HAVE_TIDYOPTGETDOC 1 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_tidy_tidyOptGetDoc +- +- + fi ++done ++ + + + + +- ext_builddir=ext/tidy +- ext_srcdir=$abs_srcdir/ext/tidy ++ ext_builddir=ext/xmlrpc ++ ext_srcdir=$abs_srcdir/ext/xmlrpc + +- ac_extra= ++ ac_extra=`echo "-I@ext_srcdir@/libxmlrpc -DVERSION="0.50""|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_TIDY_SHARED=no ++ PHP_XMLRPC_SHARED=no + + +- case ext/tidy in ++ case ext/xmlrpc in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -96007,7 +102749,12 @@ fi + + + old_IFS=$IFS +- for ac_src in tidy.c; do ++ for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ ++ libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ ++ libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ ++ libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ ++ libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ ++ libxmlrpc/xml_to_soap.c; do + + IFS=. + set $ac_src +@@ -96030,18 +102777,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC tidy" ++ EXT_STATIC="$EXT_STATIC xmlrpc" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC tidy" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xmlrpc" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_TIDY_SHARED=yes ++ PHP_XMLRPC_SHARED=yes + +- case ext/tidy in ++ case ext/xmlrpc in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/tidy"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/tidy/"; ac_bdir="ext/tidy/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -96056,14 +102803,19 @@ EOF + + + old_IFS=$IFS +- for ac_src in tidy.c; do ++ for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ ++ libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ ++ libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ ++ libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ ++ libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ ++ libxmlrpc/xml_to_soap.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_tidy="$shared_objects_tidy $ac_bdir$ac_obj.lo" ++ shared_objects_xmlrpc="$shared_objects_xmlrpc $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -96086,31 +102838,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phptidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(PHPTIDY_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phptidy.so '$ext_builddir'/phptidy.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlrpc.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlrpc.so '$ext_builddir'/phpxmlrpc.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPTIDY, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLRPC, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tidy) $(PHPTIDY_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phptidy.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlrpc.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phptidy.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlrpc.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tidy" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&6 ++echo "configure:103052: checking for XMLRPC-EPI in default path" >&5 ++ for i in /usr/local /usr; do ++ if test -r $i/include/xmlrpc.h; then ++ XMLRPC_DIR=$i/include ++ echo "$ac_t""found in $i" 1>&6 ++ break ++ fi ++ done ++ fi ++ ++ if test -z "$XMLRPC_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: Please reinstall the XMLRPC-EPI distribution" 1>&2; exit 1; } ++ fi ++ ++ ++ if test "$XMLRPC_DIR" != "/usr/include"; then ++ ++ if test -z "$XMLRPC_DIR" || echo "$XMLRPC_DIR" | grep '^/' >/dev/null ; then ++ ai_p=$XMLRPC_DIR ++ else ++ ++ ep_dir="`echo $XMLRPC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$XMLRPC_DIR\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ + fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- + ++ + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=tidy ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="-lxmlrpc $XMLRPC_SHARED_LIBADD" ++ if test -n "$XMLRPC_DIR/$PHP_LIBDIR"; then ++ ++ if test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" +- ++ if test -z "$XMLRPC_DIR/$PHP_LIBDIR" || echo "$XMLRPC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$XMLRPC_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $XMLRPC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/$PHP_LIBDIR\"`" + fi + ++ ++ if test "$ext_shared" = "yes"; then ++ XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" ++ else ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST TIDY_SHARED_LIBADD" +- +- cat >> confdefs.h <<\EOF +-#define HAVE_TIDY 1 +-EOF +- +-fi ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + ++ fi ++ ++ fi + ++ fi ++ else ++ + +-php_enable_tokenizer=yes ++ if test -n "$XMLRPC_DIR/$PHP_LIBDIR"; then ++ ++ if test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$XMLRPC_DIR/$PHP_LIBDIR" || echo "$XMLRPC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$XMLRPC_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $XMLRPC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/$PHP_LIBDIR\"`" ++ fi + +-echo $ac_n "checking whether to enable tokenizer support""... $ac_c" 1>&6 +-echo "configure:96290: checking whether to enable tokenizer support" >&5 +-# Check whether --enable-tokenizer or --disable-tokenizer was given. +-if test "${enable_tokenizer+set}" = set; then +- enableval="$enable_tokenizer" +- PHP_TOKENIZER=$enableval +-else ++ ++ + +- PHP_TOKENIZER=yes +- test "$PHP_ENABLE_ALL" && PHP_TOKENIZER=$PHP_ENABLE_ALL +- +-fi +- ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi + + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_TOKENIZER in +-shared,*) +- PHP_TOKENIZER=`echo "$PHP_TOKENIZER"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_TOKENIZER=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ ++ fi + ++ fi ++ ++ ++ case xmlrpc in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lxmlrpc $LIBS" ++ ;; ++ esac + + +-echo "$ac_t""$ext_output" 1>&6 + + ++ fi + + +-if test "$PHP_TOKENIZER" != "no"; then + +- ext_builddir=ext/tokenizer +- ext_srcdir=$abs_srcdir/ext/tokenizer ++ ext_builddir=ext/xmlrpc ++ ext_srcdir=$abs_srcdir/ext/xmlrpc + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_TOKENIZER_SHARED=no ++ PHP_XMLRPC_SHARED=no + + +- case ext/tokenizer in ++ case ext/xmlrpc in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -96355,7 +103219,7 @@ if test "$PHP_TOKENIZER" != "no"; then + + + old_IFS=$IFS +- for ac_src in tokenizer.c tokenizer_data.c; do ++ for ac_src in xmlrpc-epi-php.c; do + + IFS=. + set $ac_src +@@ -96378,18 +103242,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC tokenizer" ++ EXT_STATIC="$EXT_STATIC xmlrpc" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC tokenizer" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xmlrpc" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_TOKENIZER_SHARED=yes ++ PHP_XMLRPC_SHARED=yes + +- case ext/tokenizer in ++ case ext/xmlrpc in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -96404,14 +103268,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in tokenizer.c tokenizer_data.c; do ++ for ac_src in xmlrpc-epi-php.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_tokenizer="$shared_objects_tokenizer $ac_bdir$ac_obj.lo" ++ shared_objects_xmlrpc="$shared_objects_xmlrpc $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -96434,31 +103298,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phptokenizer.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phptokenizer.so '$ext_builddir'/phptokenizer.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlrpc.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlrpc.so '$ext_builddir'/phpxmlrpc.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPTOKENIZER, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLRPC, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phptokenizer.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlrpc.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phptokenizer.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlrpc.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tokenizer" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <> Makefile.fragments +- ++ XMLRPC_MODULE_TYPE=external + fi + + + +-php_enable_wddx=no ++php_enable_xmlwriter=yes + +-echo $ac_n "checking whether to enable WDDX support""... $ac_c" 1>&6 +-echo "configure:96636: checking whether to enable WDDX support" >&5 +-# Check whether --enable-wddx or --disable-wddx was given. +-if test "${enable_wddx+set}" = set; then +- enableval="$enable_wddx" +- PHP_WDDX=$enableval ++echo $ac_n "checking whether to enable XMLWriter support""... $ac_c" 1>&6 ++echo "configure:103495: checking whether to enable XMLWriter support" >&5 ++# Check whether --enable-xmlwriter or --disable-xmlwriter was given. ++if test "${enable_xmlwriter+set}" = set; then ++ enableval="$enable_xmlwriter" ++ PHP_XMLWRITER=$enableval + else + +- PHP_WDDX=no +- test "$PHP_ENABLE_ALL" && PHP_WDDX=$PHP_ENABLE_ALL ++ PHP_XMLWRITER=yes ++ test "$PHP_ENABLE_ALL" && PHP_XMLWRITER=$PHP_ENABLE_ALL + + fi + +@@ -96648,12 +103507,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_WDDX in ++case $PHP_XMLWRITER in + shared,*) +- PHP_WDDX=`echo "$PHP_WDDX"|$SED 's/^shared,//'` ++ PHP_XMLWRITER=`echo "$PHP_XMLWRITER"|$SED 's/^shared,//'` + ;; + shared) +- PHP_WDDX=yes ++ PHP_XMLWRITER=yes + ;; + no) + ext_output=no +@@ -96677,7 +103536,7 @@ if test -z "$PHP_LIBXML_DIR"; then + php_with_libxml_dir=no + + echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:96681: checking libxml2 install dir" >&5 ++echo "configure:103540: checking libxml2 install dir" >&5 + # Check whether --with-libxml-dir or --without-libxml-dir was given. + if test "${with_libxml_dir+set}" = set; then + withval="$with_libxml_dir" +@@ -96697,39 +103556,15 @@ echo "$ac_t""$ext_output" 1>&6 + + fi + ++if test "$PHP_XMLWRITER" != "no"; then + +-php_with_libexpat_dir=no ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: XMLWriter extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi + +-echo $ac_n "checking libexpat dir for WDDX""... $ac_c" 1>&6 +-echo "configure:96705: checking libexpat dir for WDDX" >&5 +-# Check whether --with-libexpat-dir or --without-libexpat-dir was given. +-if test "${with_libexpat_dir+set}" = set; then +- withval="$with_libexpat_dir" +- PHP_LIBEXPAT_DIR=$withval +-else +- +- PHP_LIBEXPAT_DIR=no + +- +-fi +- +- +-ext_output=$PHP_LIBEXPAT_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_WDDX" != "no"; then +- +- if test "$PHP_LIBEXPAT_DIR" = "no"; then +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: WDDX extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi +- +- + echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:96733: checking for xml2-config path" >&5 ++echo "configure:103568: checking for xml2-config path" >&5 + if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -96761,7 +103596,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- WDDX_SHARED_LIBADD="$WDDX_SHARED_LIBADD -pthread" ++ XMLWRITER_SHARED_LIBADD="$XMLWRITER_SHARED_LIBADD -pthread" + else + + +@@ -96783,7 +103618,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- WDDX_SHARED_LIBADD="$WDDX_SHARED_LIBADD -l$ac_ii" ++ XMLWRITER_SHARED_LIBADD="$XMLWRITER_SHARED_LIBADD -l$ac_ii" + else + + +@@ -96818,8 +103653,8 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + + + if test "$ext_shared" = "yes"; then +- WDDX_SHARED_LIBADD="-L$ai_p $WDDX_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && WDDX_SHARED_LIBADD="$ld_runpath_switch$ai_p $WDDX_SHARED_LIBADD" ++ XMLWRITER_SHARED_LIBADD="-L$ai_p $XMLWRITER_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XMLWRITER_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLWRITER_SHARED_LIBADD" + else + + +@@ -96887,7 +103722,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + + + echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:96891: checking whether libxml build works" >&5 ++echo "configure:103726: checking whether libxml build works" >&5 + if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -96895,7 +103730,7 @@ else + + old_LIBS=$LIBS + LIBS=" +- $WDDX_SHARED_LIBADD ++ $XMLWRITER_SHARED_LIBADD + $LIBS" + if test "$cross_compiling" = yes; then + +@@ -96903,7 +103738,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:103753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + + LIBS=$old_LIBS +@@ -96925,255 +103760,48 @@ then + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- +-fi +-rm -fr conftest* +-fi +- +- +- +-fi +- +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF +- +- fi +- +- if test "$PHP_XML" = "no"; then +- +- +- case ext/xml in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in compat.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } +- +- fi +- +- fi +- +- if test "$PHP_LIBEXPAT_DIR" != "no"; then +- for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do +- if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then +- EXPAT_DIR=$i +- break +- fi +- done +- +- if test -z "$EXPAT_DIR"; then +- { echo "configure: error: not found. Please reinstall the expat distribution." 1>&2; exit 1; } +- fi +- +- +- if test "$EXPAT_DIR/include" != "/usr/include"; then +- +- if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/include +- else +- +- ep_dir="`echo $EXPAT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- +- +- if test "$ext_shared" = "yes"; then +- WDDX_SHARED_LIBADD="-lexpat $WDDX_SHARED_LIBADD" +- if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then +- +- if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- WDDX_SHARED_LIBADD="-L$ai_p $WDDX_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && WDDX_SHARED_LIBADD="$ld_runpath_switch$ai_p $WDDX_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then +- +- if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- +- fi +- +- fi +- +- +- case expat in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lexpat $LIBS" +- ;; +- esac +- +- +- ++ rm -fr conftest* ++ ++ LIBS=$old_LIBS ++ ++ echo "$ac_t""no" 1>&6 ++ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } ++ ++ ++fi ++rm -fr conftest* ++fi + +- fi + ++ ++fi + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBEXPAT 1 ++echo "$ac_t""$php_cv_libxml_build_works" 1>&6 ++ if test "$php_cv_libxml_build_works" = "yes"; then ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBXML 1 + EOF + +- fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_WDDX 1 ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_XMLWRITER 1 + EOF + +- +- ext_builddir=ext/wddx +- ext_srcdir=$abs_srcdir/ext/wddx ++ ++ ext_builddir=ext/xmlwriter ++ ext_srcdir=$abs_srcdir/ext/xmlwriter + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_WDDX_SHARED=no ++ PHP_XMLWRITER_SHARED=no + + +- case ext/wddx in ++ case ext/xmlwriter in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlwriter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlwriter/"; ac_bdir="ext/xmlwriter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -97188,7 +103816,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in wddx.c; do ++ for ac_src in php_xmlwriter.c; do + + IFS=. + set $ac_src +@@ -97211,18 +103839,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC wddx" ++ EXT_STATIC="$EXT_STATIC xmlwriter" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC wddx" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xmlwriter" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_WDDX_SHARED=yes ++ PHP_XMLWRITER_SHARED=yes + +- case ext/wddx in ++ case ext/xmlwriter in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xmlwriter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xmlwriter/"; ac_bdir="ext/xmlwriter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -97237,14 +103865,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in wddx.c; do ++ for ac_src in php_xmlwriter.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_wddx="$shared_objects_wddx $ac_bdir$ac_obj.lo" ++ shared_objects_xmlwriter="$shared_objects_xmlwriter $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -97267,31 +103895,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpwddx.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(PHPWDDX_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpwddx.so '$ext_builddir'/phpwddx.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlwriter.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlwriter) $(PHPXMLWRITER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlwriter.so '$ext_builddir'/phpxmlwriter.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPWDDX, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlwriter) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLWRITER, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(PHPWDDX_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlwriter) $(PHPXMLWRITER_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpwddx.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlwriter.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpwddx.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlwriter.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_wddx" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlwriter" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension wddx, which depends on extension libxml, +-but you've either not enabled libxml, or have disabled it. +-" 1>&2; exit 1; } +- fi +- ++ else ++ { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } ++ fi ++else ++ { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } + +- PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD" ++ fi + + fi + + + +-php_enable_xml=yes ++php_with_xsl=no + +-echo $ac_n "checking whether to enable XML support""... $ac_c" 1>&6 +-echo "configure:97485: checking whether to enable XML support" >&5 +-# Check whether --enable-xml or --disable-xml was given. +-if test "${enable_xml+set}" = set; then +- enableval="$enable_xml" +- PHP_XML=$enableval ++echo $ac_n "checking for XSL support""... $ac_c" 1>&6 ++echo "configure:104103: checking for XSL support" >&5 ++# Check whether --with-xsl or --without-xsl was given. ++if test "${with_xsl+set}" = set; then ++ withval="$with_xsl" ++ PHP_XSL=$withval + else + +- PHP_XML=yes +- test "$PHP_ENABLE_ALL" && PHP_XML=$PHP_ENABLE_ALL ++ PHP_XSL=no ++ test "$PHP_ENABLE_ALL" && PHP_XSL=$PHP_ENABLE_ALL + + fi + +@@ -97497,12 +104115,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_XML in ++case $PHP_XSL in + shared,*) +- PHP_XML=`echo "$PHP_XML"|$SED 's/^shared,//'` ++ PHP_XSL=`echo "$PHP_XSL"|$SED 's/^shared,//'` + ;; + shared) +- PHP_XML=yes ++ PHP_XSL=yes + ;; + no) + ext_output=no +@@ -97521,97 +104139,41 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test -z "$PHP_LIBXML_DIR"; then +- +-php_with_libxml_dir=no +- +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:97530: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval +-else +- +- PHP_LIBXML_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +-fi +- +- +-php_with_libexpat_dir=no ++if test "$PHP_XSL" != "no"; then + +-echo $ac_n "checking libexpat install dir""... $ac_c" 1>&6 +-echo "configure:97554: checking libexpat install dir" >&5 +-# Check whether --with-libexpat-dir or --without-libexpat-dir was given. +-if test "${with_libexpat_dir+set}" = set; then +- withval="$with_libexpat_dir" +- PHP_LIBEXPAT_DIR=$withval +-else +- +- PHP_LIBEXPAT_DIR=no ++ if test "$PHP_LIBXML" = "no"; then ++ { echo "configure: error: XSL extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } ++ fi + ++ if test "$PHP_DOM" = "no"; then ++ { echo "configure: error: XSL extension requires DOM extension, add --enable-dom" 1>&2; exit 1; } ++ fi + +-fi +- +- +-ext_output=$PHP_LIBEXPAT_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_XML" != "no"; then +- +- if test "$PHP_LIBEXPAT_DIR" = "no"; then +- +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: XML extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi +- +- +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:97583: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" ++ for i in $PHP_XSL /usr/local /usr; do ++ if test -x "$i/bin/xslt-config"; then ++ XSLT_CONFIG=$i/bin/xslt-config + break + fi + done + +-fi +- +-echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 +- +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` ++ if test -z "$XSLT_CONFIG"; then ++ { echo "configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution" 1>&2; exit 1; } ++ else ++ libxslt_full_version=`$XSLT_CONFIG --version` + ac_IFS=$IFS + IFS="." +- set $libxml_full_version ++ set $libxslt_full_version + IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` ++ LIBXSLT_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` ++ if test "$LIBXSLT_VERSION" -ge "1001000"; then ++ XSL_LIBS=`$XSLT_CONFIG --libs` ++ XSL_INCS=`$XSLT_CONFIG --cflags` + +- for ac_i in $LIBXML_LIBS; do ++ for ac_i in $XSL_LIBS; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- XML_SHARED_LIBADD="$XML_SHARED_LIBADD -pthread" ++ XSL_SHARED_LIBADD="$XSL_SHARED_LIBADD -pthread" + else + + +@@ -97633,7 +104195,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- XML_SHARED_LIBADD="$XML_SHARED_LIBADD -l$ac_ii" ++ XSL_SHARED_LIBADD="$XSL_SHARED_LIBADD -l$ac_ii" + else + + +@@ -97668,8 +104230,8 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + + + if test "$ext_shared" = "yes"; then +- XML_SHARED_LIBADD="-L$ai_p $XML_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XML_SHARED_LIBADD="$ld_runpath_switch$ai_p $XML_SHARED_LIBADD" ++ XSL_SHARED_LIBADD="-L$ai_p $XSL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XSL_SHARED_LIBADD="$ld_runpath_switch$ai_p $XSL_SHARED_LIBADD" + else + + +@@ -97696,7 +104258,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + done + + +- for ac_i in $LIBXML_INCS; do ++ for ac_i in $XSL_INCS; do + case $ac_i in + -I*) + ac_ii=`echo $ac_i|cut -c 3-` +@@ -97735,166 +104297,41 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + esac + done + +- +- echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:97741: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- +- old_LIBS=$LIBS +- LIBS=" +- $XML_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS +- +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- LIBS=$old_LIBS +- +- php_cv_libxml_build_works=yes +- +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- +-fi +-rm -fr conftest* +-fi +- +- +- +-fi +- +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF +- +- fi +- +- xml_extra_sources="compat.c" + +- am_i_shared=$PHP_XML_SHARED +- is_it_shared=$PHP_LIBXML_SHARED +- is_it_enabled=$PHP_LIBXML +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension xml to build statically, but it +-depends on extension libxml, which you've configured to build shared. +-You either need to build xml shared or build libxml statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension xml, which depends on extension libxml, +-but you've either not enabled libxml, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- else +- { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } +- +- fi +- +- fi +- +- if test "$PHP_LIBEXPAT_DIR" != "no"; then +- for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do +- if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then +- EXPAT_DIR=$i +- break +- fi +- done +- +- if test -z "$EXPAT_DIR"; then +- { echo "configure: error: not found. Please reinstall the expat distribution." 1>&2; exit 1; } +- fi +- +- +- if test "$EXPAT_DIR/include" != "/usr/include"; then +- +- if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/include +- else +- +- ep_dir="`echo $EXPAT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- ++ echo $ac_n "checking for EXSLT support""... $ac_c" 1>&6 ++echo "configure:104303: checking for EXSLT support" >&5 ++ for i in $PHP_XSL /usr/local /usr; do ++ if test -r "$i/include/libexslt/exslt.h"; then ++ PHP_XSL_EXSL_DIR=$i ++ break ++ fi ++ done ++ if test -z "$PHP_XSL_EXSL_DIR"; then ++ echo "$ac_t""not found" 1>&6 ++ else ++ echo "$ac_t""found" 1>&6 ++ + + if test "$ext_shared" = "yes"; then +- XML_SHARED_LIBADD="-lexpat $XML_SHARED_LIBADD" +- if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then ++ XSL_SHARED_LIBADD="-lexslt $XSL_SHARED_LIBADD" ++ if test -n "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR"; then + +- if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/$PHP_LIBDIR ++ if test -z "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" || echo "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_XSL_EXSL_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_XSL_EXSL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- XML_SHARED_LIBADD="-L$ai_p $XML_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XML_SHARED_LIBADD="$ld_runpath_switch$ai_p $XML_SHARED_LIBADD" ++ XSL_SHARED_LIBADD="-L$ai_p $XSL_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && XSL_SHARED_LIBADD="$ld_runpath_switch$ai_p $XSL_SHARED_LIBADD" + else + + +@@ -97920,18 +104357,18 @@ else + else + + +- if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then ++ if test -n "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR"; then + +- if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$EXPAT_DIR/$PHP_LIBDIR ++ if test -z "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" || echo "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_XSL_EXSL_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_XSL_EXSL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -97957,10 +104394,10 @@ else + fi + + +- case expat in ++ case exslt in + c|c_r|pthread*) ;; + *) +- LIBS="-lexpat $LIBS" ++ LIBS="-lexslt $LIBS" + ;; + esac + +@@ -97970,26 +104407,67 @@ else + fi + + +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBEXPAT 1 ++ ++ if test "$PHP_XSL_EXSL_DIR/include" != "/usr/include"; then ++ ++ if test -z "$PHP_XSL_EXSL_DIR/include" || echo "$PHP_XSL_EXSL_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_XSL_EXSL_DIR/include ++ else ++ ++ ep_dir="`echo $PHP_XSL_EXSL_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/include\"`" ++ fi ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_XSL_EXSLT 1 + EOF + ++ fi ++ else ++ { echo "configure: error: libxslt version 1.1.0 or greater required." 1>&2; exit 1; } ++ fi ++ ++ + fi ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_XSL 1 ++EOF + + +- ext_builddir=ext/xml +- ext_srcdir=$abs_srcdir/ext/xml ++ ext_builddir=ext/xsl ++ ext_srcdir=$abs_srcdir/ext/xsl + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XML_SHARED=no ++ PHP_XSL_SHARED=no + + +- case ext/xml in ++ case ext/xsl in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xsl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xsl/"; ac_bdir="ext/xsl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -98004,7 +104482,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in xml.c $xml_extra_sources; do ++ for ac_src in php_xsl.c xsltprocessor.c; do + + IFS=. + set $ac_src +@@ -98027,18 +104505,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC xml" ++ EXT_STATIC="$EXT_STATIC xsl" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC xml" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC xsl" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_XML_SHARED=yes ++ PHP_XSL_SHARED=yes + +- case ext/xml in ++ case ext/xsl in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/xsl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/xsl/"; ac_bdir="ext/xsl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -98053,14 +104531,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in xml.c $xml_extra_sources; do ++ for ac_src in php_xsl.c xsltprocessor.c; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_xml="$shared_objects_xml $ac_bdir$ac_obj.lo" ++ shared_objects_xsl="$shared_objects_xsl $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -98083,31 +104561,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxml.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxml.so '$ext_builddir'/phpxml.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(PHPXSL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxsl.so '$ext_builddir'/phpxsl.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXML, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXSL, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(PHPXSL_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxml.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxsl.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxml.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxsl.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xml" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xsl" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension xsl, which depends on extension libxml, ++but you've either not enabled libxml, or have disabled it. ++" 1>&2; exit 1; } + fi +- +- done + +- +- cat >> confdefs.h <<\EOF +-#define HAVE_XML 1 +-EOF +- + fi + + + +-php_enable_xmlreader=yes ++php_enable_zip=no + +-echo $ac_n "checking whether to enable XMLReader support""... $ac_c" 1>&6 +-echo "configure:98304: checking whether to enable XMLReader support" >&5 +-# Check whether --enable-xmlreader or --disable-xmlreader was given. +-if test "${enable_xmlreader+set}" = set; then +- enableval="$enable_xmlreader" +- PHP_XMLREADER=$enableval ++echo $ac_n "checking for zip archive read/writesupport""... $ac_c" 1>&6 ++echo "configure:104779: checking for zip archive read/writesupport" >&5 ++# Check whether --enable-zip or --disable-zip was given. ++if test "${enable_zip+set}" = set; then ++ enableval="$enable_zip" ++ PHP_ZIP=$enableval + else + +- PHP_XMLREADER=yes +- test "$PHP_ENABLE_ALL" && PHP_XMLREADER=$PHP_ENABLE_ALL ++ PHP_ZIP=no ++ test "$PHP_ENABLE_ALL" && PHP_ZIP=$PHP_ENABLE_ALL + + fi + +@@ -98316,12 +104791,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_XMLREADER in ++case $PHP_ZIP in + shared,*) +- PHP_XMLREADER=`echo "$PHP_XMLREADER"|$SED 's/^shared,//'` ++ PHP_ZIP=`echo "$PHP_ZIP"|$SED 's/^shared,//'` + ;; + shared) +- PHP_XMLREADER=yes ++ PHP_ZIP=yes + ;; + no) + ext_output=no +@@ -98340,132 +104815,147 @@ echo "$ac_t""$ext_output" 1>&6 + + + +-if test -z "$PHP_LIBXML_DIR"; then ++if test -z "$PHP_ZLIB_DIR"; then + +-php_with_libxml_dir=no ++php_with_zlib_dir=no + +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:98349: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval ++echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 ++echo "configure:104824: checking for the location of libz" >&5 ++# Check whether --with-zlib-dir or --without-zlib-dir was given. ++if test "${with_zlib_dir+set}" = set; then ++ withval="$with_zlib_dir" ++ PHP_ZLIB_DIR=$withval + else + +- PHP_LIBXML_DIR=no ++ PHP_ZLIB_DIR=no + + + fi + + +-ext_output=$PHP_LIBXML_DIR ++ext_output=$PHP_ZLIB_DIR + echo "$ac_t""$ext_output" 1>&6 + + + + fi + +-if test "$PHP_XMLREADER" != "no"; then + +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: XMLReader extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi ++php_with_pcre_dir=no + +- +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:98377: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 ++echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6 ++echo "configure:104848: checking pcre install prefix" >&5 ++# Check whether --with-pcre-dir or --without-pcre-dir was given. ++if test "${with_pcre_dir+set}" = set; then ++ withval="$with_pcre_dir" ++ PHP_PCRE_DIR=$withval + else + +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done ++ PHP_PCRE_DIR=no ++ + + fi + +-echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 + +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` ++ext_output=$PHP_PCRE_DIR ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++if test "$PHP_ZIP" != "no"; then ++ ++ if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then ++ if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then ++ PHP_ZLIB_DIR="$PHP_ZLIB_DIR" ++ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" ++ elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then ++ PHP_ZLIB_DIR="$PHP_ZLIB_DIR" ++ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" ++ else ++ { echo "configure: error: Can not find zlib headers under "$PHP_ZLIB_DIR"" 1>&2; exit 1; } ++ fi ++ else ++ for i in /usr/local /usr; do ++ if test -f "$i/include/zlib/zlib.h"; then ++ PHP_ZLIB_DIR="$i" ++ PHP_ZLIB_INCDIR="$i/include/zlib" ++ elif test -f "$i/include/zlib.h"; then ++ PHP_ZLIB_DIR="$i" ++ PHP_ZLIB_INCDIR="$i/include" ++ fi ++ done ++ fi ++ ++ echo $ac_n "checking for the location of zlib""... $ac_c" 1>&6 ++echo "configure:104892: checking for the location of zlib" >&5 ++ if test "$PHP_ZLIB_DIR" = "no"; then ++ { echo "configure: error: zip support requires ZLIB. Use --with-zlib-dir= to specify prefix where ZLIB include and library are located" 1>&2; exit 1; } ++ else ++ echo "$ac_t""$PHP_ZLIB_DIR" 1>&6 ++ ++ ++ if test "$ext_shared" = "yes"; then ++ ZIP_SHARED_LIBADD="-lz $ZIP_SHARED_LIBADD" ++ if test -n "$PHP_ZLIB_DIR/$PHP_LIBDIR"; then + +- for ac_i in $LIBXML_LIBS; do +- case $ac_i in +- -pthread) ++ if test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ZLIB_DIR/$PHP_LIBDIR" || echo "$PHP_ZLIB_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $PHP_ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ + if test "$ext_shared" = "yes"; then +- XMLREADER_SHARED_LIBADD="$XMLREADER_SHARED_LIBADD -pthread" ++ ZIP_SHARED_LIBADD="-L$ai_p $ZIP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && ZIP_SHARED_LIBADD="$ld_runpath_switch$ai_p $ZIP_SHARED_LIBADD" + else + + +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- XMLREADER_SHARED_LIBADD="$XMLREADER_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac + ++ fi ++ ++ fi + + fi +- ;; +- esac +- ++ else ++ + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ if test -n "$PHP_ZLIB_DIR/$PHP_LIBDIR"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$PHP_ZLIB_DIR/$PHP_LIBDIR" || echo "$PHP_ZLIB_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/$PHP_LIBDIR\"`" + fi + + +- if test "$ext_shared" = "yes"; then +- XMLREADER_SHARED_LIBADD="-L$ai_p $XMLREADER_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLREADER_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLREADER_SHARED_LIBADD" +- else +- ++ + + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +@@ -98481,30 +104971,36 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + fi + + +- fi + + fi + +- ;; +- esac +- done ++ fi ++ ++ ++ case z in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lz $LIBS" ++ ;; ++ esac ++ ++ ++ ++ ++ fi ++ + +- +- for ac_i in $LIBXML_INCS; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test "$PHP_ZLIB_INCDIR" != "/usr/include"; then ++ ++ if test -z "$PHP_ZLIB_INCDIR" || echo "$PHP_ZLIB_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$PHP_ZLIB_INCDIR + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $PHP_ZLIB_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_INCDIR\"`" + fi + + +@@ -98525,92 +105021,97 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + + fi + +- ;; +- esac +- done ++ fi + ++ old_CPPFLAGS=$CPPFLAGS ++ CPPFLAGS=$INCLUDES ++ cat > conftest.$ac_ext <&6 +-echo "configure:98535: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else ++#include
++#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) ++yes ++#endif + +- +- old_LIBS=$LIBS +- LIBS=" +- $XMLREADER_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then ++EOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "yes" >/dev/null 2>&1; then ++ rm -rf conftest* + +- LIBS=$old_LIBS ++ PHP_PCRE_REGEX=yes + + else +- cat > conftest.$ac_ext < conftest.$ac_ext < ++#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE) ++yes ++#endif + +- char xmlInitParser(); +- int main() { +- xmlInitParser(); +- return 0; +- } +- + EOF +-if { (eval echo configure:98562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ egrep "yes" >/dev/null 2>&1; then ++ rm -rf conftest* + +- LIBS=$old_LIBS ++ PHP_PCRE_REGEX=pecl + +- php_cv_libxml_build_works=yes +- +- + else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* ++ rm -rf conftest* + +- LIBS=$old_LIBS ++ PHP_PCRE_REGEX=no + +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- +-fi +-rm -fr conftest* + fi ++rm -f conftest* + +- +- ++ + fi ++rm -f conftest* + +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF ++ CPPFLAGS=$old_CPPFLAGS + +- fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_XMLREADER 1 ++ PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ ++ lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \ ++ lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \ ++ lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \ ++ lib/zip_source_free.c lib/zip_unchange_all.c lib/zip_delete.c \ ++ lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \ ++ lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \ ++ lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \ ++ lib/zip_filerange_crc.c lib/zip_file_strerror.c lib/zip_get_num_files.c \ ++ lib/zip_get_archive_flag.c lib/zip_set_archive_flag.c \ ++ lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \ ++ lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \ ++ lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \ ++ lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \ ++ lib/zip_get_archive_comment.c lib/zip_get_file_comment.c \ ++ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ ++ lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ ++ lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ ++ lib/zip_error_clear.c lib/zip_file_error_clear.c" ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_ZIP 1 + EOF + +- +- ext_builddir=ext/xmlreader +- ext_srcdir=$abs_srcdir/ext/xmlreader ++ ++ ext_builddir=ext/zip ++ ext_srcdir=$abs_srcdir/ext/zip + + ac_extra= + + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XMLREADER_SHARED=no ++ PHP_ZIP_SHARED=no + + +- case ext/xmlreader in ++ case ext/zip in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlreader"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlreader/"; ac_bdir="ext/xmlreader/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -98625,7 +105126,7 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_xmlreader.c; do ++ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do + + IFS=. + set $ac_src +@@ -98648,18 +105149,18 @@ EOF + done + + +- EXT_STATIC="$EXT_STATIC xmlreader" ++ EXT_STATIC="$EXT_STATIC zip" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC xmlreader" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC zip" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_XMLREADER_SHARED=yes ++ PHP_ZIP_SHARED=yes + +- case ext/xmlreader in ++ case ext/zip in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlreader"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlreader/"; ac_bdir="ext/xmlreader/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -98674,14 +105175,14 @@ EOF + + + old_IFS=$IFS +- for ac_src in php_xmlreader.c; do ++ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_xmlreader="$shared_objects_xmlreader $ac_bdir$ac_obj.lo" ++ shared_objects_zip="$shared_objects_zip $ac_bdir$ac_obj.lo" + + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -98704,31 +105205,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlreader.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) $(PHPXMLREADER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlreader.so '$ext_builddir'/phpxmlreader.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpzip.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpzip.so '$ext_builddir'/phpzip.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLREADER, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPZIP, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlreader) $(PHPXMLREADER_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD)' + ;; + esac + + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlreader.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpzip.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlreader.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpzip.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlreader" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip" + + cat >>Makefile.objects<>Makefile.objects<> confdefs.h <&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then +- { echo "configure: error: +-You've configured extension xmlreader, which depends on extension dom, +-but you've either not enabled dom, or have disabled it. +-" 1>&2; exit 1; } +- fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST XMLREADER_SHARED_LIBADD" +- + +- else +- { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } ++ $php_shtool mkdir -p $ext_builddir/lib + +- fi +- +-fi +- +- +-# Local macros for automake & autoconf +- +- +- +- +- +- + ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST ZIP_SHARED_LIBADD" + + ++ ++ src=$ext_srcdir/Makefile.frag ++ ac_srcdir=$ext_srcdir ++ ac_builddir=$ext_builddir ++ test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments + ++fi + + + +-php_with_xmlrpc=no ++php_enable_http=no + +-echo $ac_n "checking for XMLRPC-EPI support""... $ac_c" 1>&6 +-echo "configure:98944: checking for XMLRPC-EPI support" >&5 +-# Check whether --with-xmlrpc or --without-xmlrpc was given. +-if test "${with_xmlrpc+set}" = set; then +- withval="$with_xmlrpc" +- PHP_XMLRPC=$withval ++echo $ac_n "checking whether to enable extended HTTP support""... $ac_c" 1>&6 ++echo "configure:105416: checking whether to enable extended HTTP support" >&5 ++# Check whether --enable-http or --disable-http was given. ++if test "${enable_http+set}" = set; then ++ enableval="$enable_http" ++ PHP_HTTP=$enableval + else + +- PHP_XMLRPC=no +- test "$PHP_ENABLE_ALL" && PHP_XMLRPC=$PHP_ENABLE_ALL ++ PHP_HTTP=no ++ test "$PHP_ENABLE_ALL" && PHP_HTTP=$PHP_ENABLE_ALL + + fi + +@@ -98956,12 +105428,12 @@ fi + + ext_output="yes, shared" + ext_shared=yes +-case $PHP_XMLRPC in ++case $PHP_HTTP in + shared,*) +- PHP_XMLRPC=`echo "$PHP_XMLRPC"|$SED 's/^shared,//'` ++ PHP_HTTP=`echo "$PHP_HTTP"|$SED 's/^shared,//'` + ;; + shared) +- PHP_XMLRPC=yes ++ PHP_HTTP=yes + ;; + no) + ext_output=no +@@ -98973,828 +105445,482 @@ no) + ;; + esac + +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test -z "$PHP_LIBXML_DIR"; then +- +-php_with_libxml_dir=no +- +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:98989: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval +-else +- +- PHP_LIBXML_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +-fi +- +- +-php_with_libexpat_dir=no +- +-echo $ac_n "checking libexpat dir for XMLRPC-EPI""... $ac_c" 1>&6 +-echo "configure:99013: checking libexpat dir for XMLRPC-EPI" >&5 +-# Check whether --with-libexpat-dir or --without-libexpat-dir was given. +-if test "${with_libexpat_dir+set}" = set; then +- withval="$with_libexpat_dir" +- PHP_LIBEXPAT_DIR=$withval +-else +- +- PHP_LIBEXPAT_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_LIBEXPAT_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +- +-php_with_iconv_dir=no +- +-echo $ac_n "checking iconv dir for XMLRPC-EPI""... $ac_c" 1>&6 +-echo "configure:99036: checking iconv dir for XMLRPC-EPI" >&5 +-# Check whether --with-iconv-dir or --without-iconv-dir was given. +-if test "${with_iconv_dir+set}" = set; then +- withval="$with_iconv_dir" +- PHP_ICONV_DIR=$withval +-else +- +- PHP_ICONV_DIR=no +- +- +-fi +- +- +-ext_output=$PHP_ICONV_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test "$PHP_XMLRPC" != "no"; then +- +- +- am_i_shared=$PHP_XMLRPC_SHARED +- is_it_shared=$PHP_LIBXML_SHARED +- is_it_enabled=$PHP_LIBXML +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension xmlrpc to build statically, but it +-depends on extension libxml, which you've configured to build shared. +-You either need to build xmlrpc shared or build libxml statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension xmlrpc, which depends on extension libxml, +-but you've either not enabled libxml, or have disabled it. +-" 1>&2; exit 1; } +- fi +- +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD" +- +- cat >> confdefs.h <<\EOF +-#define HAVE_XMLRPC 1 +-EOF +- +- +- if test "$PHP_LIBEXPAT_DIR" = "no"; then +- +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: XML-RPC extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi +- +- +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:99092: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done +- +-fi +- +-echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 +- +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- +- for ac_i in $LIBXML_LIBS; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="$XMLRPC_SHARED_LIBADD -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="$XMLRPC_SHARED_LIBADD -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- +- for ac_i in $LIBXML_INCS; do +- case $ac_i in +- -I*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/include"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- +- echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:99250: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- +- +- old_LIBS=$LIBS +- LIBS=" +- $XMLRPC_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS +- +-else +- cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- LIBS=$old_LIBS +- +- php_cv_libxml_build_works=yes +- +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- +-fi +-rm -fr conftest* +-fi +- +- +- +-fi +- +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF +- +- fi +- +- if test "$PHP_XML" = "no"; then +- +- +- case ext/xml in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in compat.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Use --with-libxml-dir=" 1>&2; exit 1; } +- +- fi +- +- else +- testval=no +- for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do +- if test -f $i/$PHP_LIBDIR/libexpat.a || test -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBEXPAT 1 +-EOF +- +- +- +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-lexpat $XMLRPC_SHARED_LIBADD" +- if test -n "$i/$PHP_LIBDIR"; then +- +- if test "$i/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$i/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$i/$PHP_LIBDIR" || echo "$i/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$i/$PHP_LIBDIR +- else +- +- ep_dir="`echo $i/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$i/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++php_with_http_shared_deps=$PHP_HTTP ++ ++echo $ac_n "checking whether to depend on extensions which have been built shared""... $ac_c" 1>&6 ++echo "configure:105459: checking whether to depend on extensions which have been built shared" >&5 ++# Check whether --with-http-shared-deps or --without-http-shared-deps was given. ++if test "${with_http_shared_deps+set}" = set; then ++ withval="$with_http_shared_deps" ++ PHP_HTTP_SHARED_DEPS=$withval ++else + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ PHP_HTTP_SHARED_DEPS=$PHP_HTTP + +- fi + ++fi + +- fi +- +- fi + +- fi +- else +- ++ext_output=$PHP_HTTP_SHARED_DEPS ++echo "$ac_t""$ext_output" 1>&6 + +- if test -n "$i/$PHP_LIBDIR"; then +- +- if test "$i/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$i/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$i/$PHP_LIBDIR" || echo "$i/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$i/$PHP_LIBDIR +- else +- +- ep_dir="`echo $i/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$i/$PHP_LIBDIR\"`" +- fi + +- +- ++ ++ ++php_with_http_curl_requests=$PHP_HTTP ++ ++echo $ac_n "checking whether to enable cURL HTTP request support""... $ac_c" 1>&6 ++echo "configure:105481: checking whether to enable cURL HTTP request support" >&5 ++# Check whether --with-http-curl-requests or --without-http-curl-requests was given. ++if test "${with_http_curl_requests+set}" = set; then ++ withval="$with_http_curl_requests" ++ PHP_HTTP_CURL_REQUESTS=$withval ++else + ++ PHP_HTTP_CURL_REQUESTS=$PHP_HTTP + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++fi ++ ++ ++ext_output=$PHP_HTTP_CURL_REQUESTS ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++php_with_http_curl_libevent=$PHP_HTTP_CURL_REQUESTS ++ ++echo $ac_n "checking whether to enable libevent support fur cURL""... $ac_c" 1>&6 ++echo "configure:105503: checking whether to enable libevent support fur cURL" >&5 ++# Check whether --with-http-curl-libevent or --without-http-curl-libevent was given. ++if test "${with_http_curl_libevent+set}" = set; then ++ withval="$with_http_curl_libevent" ++ PHP_HTTP_CURL_LIBEVENT=$withval ++else + +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" ++ PHP_HTTP_CURL_LIBEVENT=$PHP_HTTP_CURL_REQUESTS + +- fi + ++fi + +- +- fi + +- fi ++ext_output=$PHP_HTTP_CURL_LIBEVENT ++echo "$ac_t""$ext_output" 1>&6 ++ ++ ++ ++ ++php_with_http_zlib_compression=$PHP_HTTP ++ ++echo $ac_n "checking whether to enable zlib encodings support""... $ac_c" 1>&6 ++echo "configure:105525: checking whether to enable zlib encodings support" >&5 ++# Check whether --with-http-zlib-compression or --without-http-zlib-compression was given. ++if test "${with_http_zlib_compression+set}" = set; then ++ withval="$with_http_zlib_compression" ++ PHP_HTTP_ZLIB_COMPRESSION=$withval ++else + ++ PHP_HTTP_ZLIB_COMPRESSION=$PHP_HTTP + +- case expat in +- c|c_r|pthread*) ;; +- *) +- LIBS="-lexpat $LIBS" +- ;; +- esac + ++fi + + ++ext_output=$PHP_HTTP_ZLIB_COMPRESSION ++echo "$ac_t""$ext_output" 1>&6 + +- fi + + +- +- if test "$i/include" != "/usr/include"; then +- +- if test -z "$i/include" || echo "$i/include" | grep '^/' >/dev/null ; then +- ai_p=$i/include +- else +- +- ep_dir="`echo $i/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$i/include\"`" +- fi + +- ++php_with_http_magic_mime="no" ++ ++echo $ac_n "checking whether to enable response content type guessing""... $ac_c" 1>&6 ++echo "configure:105547: checking whether to enable response content type guessing" >&5 ++# Check whether --with-http-magic-mime or --without-http-magic-mime was given. ++if test "${with_http_magic_mime+set}" = set; then ++ withval="$with_http_magic_mime" ++ PHP_HTTP_MAGIC_MIME=$withval ++else + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ PHP_HTTP_MAGIC_MIME="no" + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi + +- fi ++fi + +- testval=yes +- break +- fi +- done + +- if test "$testval" = "no"; then +- { echo "configure: error: XML-RPC support requires libexpat. Use --with-libexpat-dir= (deprecated!)" 1>&2; exit 1; } +- fi +- fi ++ext_output=$PHP_HTTP_MAGIC_MIME ++echo "$ac_t""$ext_output" 1>&6 + +- if test "$PHP_ICONV_SHARED" = "yes" || test "$PHP_ICONV" = "no"; then + +- if test "$PHP_ICONV_DIR" != "no"; then +- PHP_ICONV=$PHP_ICONV_DIR ++ ++ ++if test "$PHP_HTTP" != "no"; then ++ ++ ++ echo $ac_n "checking for egrep""... $ac_c" 1>&6 ++echo "configure:105570: checking for egrep" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_egrep'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if echo a | (grep -E '(a|b)') >/dev/null 2>&1 ++ then ac_cv_prog_egrep='grep -E' ++ else ac_cv_prog_egrep='egrep' + fi +- +- if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then +- PHP_ICONV=yes ++fi ++ ++echo "$ac_t""$ac_cv_prog_egrep" 1>&6 ++ EGREP=$ac_cv_prog_egrep ++ ++ ++ ++ ++ ++ echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6 ++echo "configure:105588: checking for a sed that does not truncate output" >&5 ++if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ # Loop through the user's path and test for sed and gsed. ++# Then use that list of sed's as ones to test for truncation. ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for lt_ac_prog in sed gsed; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if test -f "$as_dir/$lt_ac_prog$ac_exec_ext"; then ++ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" ++ fi ++ done ++ done ++done ++lt_ac_max=0 ++lt_ac_count=0 ++# Add /usr/xpg4/bin/sed as it is typically found on Solaris ++# along with /bin/sed that truncates output. ++for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do ++ test ! -f $lt_ac_sed && continue ++ cat /dev/null > conftest.in ++ lt_ac_count=0 ++ echo $ECHO_N "0123456789$ECHO_C" >conftest.in ++ # Check for GNU sed and select it if it is found. ++ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then ++ lt_cv_path_SED=$lt_ac_sed ++ break ++ fi ++ while true; do ++ cat conftest.in conftest.in >conftest.tmp ++ mv conftest.tmp conftest.in ++ cp conftest.in conftest.nl ++ echo >>conftest.nl ++ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break ++ cmp -s conftest.out conftest.nl || break ++ # 10000 chars as input seems more than enough ++ test $lt_ac_count -gt 10 && break ++ lt_ac_count=`expr $lt_ac_count + 1` ++ if test $lt_ac_count -gt $lt_ac_max; then ++ lt_ac_max=$lt_ac_count ++ lt_cv_path_SED=$lt_ac_sed + fi +- +- +- found_iconv=no +- unset ICONV_DIR ++ done ++done + +- # Create the directories for a VPATH build: +- $php_shtool mkdir -p ext/iconv ++fi + +- echo > ext/iconv/php_have_bsd_iconv.h +- echo > ext/iconv/php_have_ibm_iconv.h +- echo > ext/iconv/php_have_glibc_iconv.h +- echo > ext/iconv/php_have_libiconv.h +- echo > ext/iconv/php_have_iconv.h +- echo > ext/iconv/php_php_iconv_impl.h +- echo > ext/iconv/php_iconv_aliased_libiconv.h +- echo > ext/iconv/php_php_iconv_h_path.h +- echo > ext/iconv/php_iconv_supports_errno.h ++SED=$lt_cv_path_SED ++echo "$ac_t""$SED" 1>&6 + +- if test "$PHP_ICONV" = "yes"; then +- echo $ac_n "checking for iconv""... $ac_c" 1>&6 +-echo "configure:99546: checking for iconv" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then ++ ++ ++ ++ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ++echo "configure:105647: checking how to run the C preprocessor" >&5 ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else ++ # This must be in double quotes, not single quotes, because CPP may get ++ # substituted into the Makefile and "${CC-cc}" will confuse make. ++ CPP="${CC-cc} -E" ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. + cat > conftest.$ac_ext < +-/* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char iconv(); ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:105668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -E -traditional-cpp" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:105685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -nologo -E" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:105702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP=/lib/cpp ++fi ++rm -f conftest* ++fi ++rm -f conftest* ++fi ++rm -f conftest* ++ ac_cv_prog_CPP="$CPP" ++fi ++ CPP="$ac_cv_prog_CPP" ++else ++ ac_cv_prog_CPP="$CPP" ++fi ++echo "$ac_t""$CPP" 1>&6 + +-int main() { ++ ++ if test "$PHP_HTTP_SHARED_DEPS" != "no"; then ++ cat >> confdefs.h <<\EOF ++#define HTTP_SHARED_DEPS 1 ++EOF + +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_iconv) || defined (__stub___iconv) +-choke me +-#else +-iconv(); +-#endif ++ else ++ cat >> confdefs.h <<\EOF ++#define HTTP_SHARED_DEPS 0 ++EOF + +-; return 0; } ++ fi ++ ++ ++ ++ ++ ++ if test "x$PHP_LIBDIR" = "x"; then ++ PHP_LIBDIR=lib ++ fi ++ ++ for ac_hdr in netdb.h unistd.h ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:105751: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < + EOF +-if { (eval echo configure:99574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:105761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + rm -rf conftest* +- eval "ac_cv_func_iconv=yes" ++ eval "ac_cv_header_$ac_safe=yes" + else ++ echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_iconv=no" ++ eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi +- +-if eval "test \"`echo '$ac_cv_func_'iconv`\" = yes"; then ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- found_iconv=yes +- ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 ++fi ++done + +- echo $ac_n "checking for libiconv""... $ac_c" 1>&6 +-echo "configure:99595: checking for libiconv" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then ++ ++ unset ac_cv_func_gethostname ++ unset ac_cv_func___gethostname ++ unset found ++ ++ echo $ac_n "checking for gethostname""... $ac_c" 1>&6 ++echo "configure:105793: checking for gethostname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +-char libiconv(); ++char gethostname(); + + int main() { + + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +-#if defined (__stub_libiconv) || defined (__stub___libiconv) ++#if defined (__stub_gethostname) || defined (__stub___gethostname) + choke me + #else +-libiconv(); ++gethostname(); + #endif + + ; return 0; } + EOF +-if { (eval echo configure:99623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:105821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_func_libiconv=yes" ++ eval "ac_cv_func_gethostname=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_libiconv=no" ++ eval "ac_cv_func_gethostname=no" + fi + rm -f conftest* + fi + +-if eval "test \"`echo '$ac_cv_func_'libiconv`\" = yes"; then ++if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- +- echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBICONV 1 +-EOF +- +- found_iconv=yes +- ++ found=yes + else + echo "$ac_t""no" 1>&6 +-fi +- +- +-fi +- +- fi +- +- if test "$found_iconv" = "no"; then +- +- for i in $PHP_ICONV /usr/local /usr; do +- if test -r $i/include/giconv.h; then +- cat >> confdefs.h <<\EOF +-#define HAVE_GICONV_H 1 +-EOF +- +- ICONV_DIR=$i +- iconv_lib_name=giconv +- break +- elif test -r $i/include/iconv.h; then +- ICONV_DIR=$i +- iconv_lib_name=iconv +- break +- fi +- done +- +- if test -z "$ICONV_DIR"; then +- { echo "configure: error: Please specify the install prefix of iconv with --with-iconv=" 1>&2; exit 1; } +- fi +- +- if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a || +- test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME +- then +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$ICONV_DIR/$PHP_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- ++ echo $ac_n "checking for __gethostname""... $ac_c" 1>&6 ++echo "configure:105839: checking for __gethostname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___gethostname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __gethostname(); + +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi ++int main() { + +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___gethostname) || defined (__stub_____gethostname) ++choke me ++#else ++__gethostname(); ++#endif + ++; return 0; } ++EOF ++if { (eval echo configure:105867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___gethostname=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___gethostname=no" ++fi ++rm -f conftest* ++fi + +- fi +- +- fi ++if eval "test \"`echo '$ac_cv_func_'__gethostname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ ++fi + +- ;; +- esac +- done + +- echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6 +-echo "configure:99779: checking for libiconv in -l$iconv_lib_name" >&5 +-ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'` ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_GETHOSTNAME 1 ++EOF ++ ++ ac_cv_func_gethostname=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_nsl_gethostname ++ unset ac_cv_lib_nsl___gethostname ++ unset found ++ echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6 ++echo "configure:105905: checking for gethostname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-l$iconv_lib_name $LIBS" ++LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:105924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -99809,152 +105935,31 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- found_iconv=yes +- +- echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBICONV 1 +-EOF +- +- +- echo "#define ICONV_ALIASED_LIBICONV 1" > ext/iconv/php_iconv_aliased_libiconv.h +- +- cat >> confdefs.h <<\EOF +-#define ICONV_ALIASED_LIBICONV 1 +-EOF +- +- +- ++ found=yes + else + echo "$ac_t""no" 1>&6 + +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$iconv_lib_name_libiconv +- +- +- save_old_LDFLAGS=$LDFLAGS +- ac_stuff=" +- -L$ICONV_DIR/$PHP_LIBDIR +- " +- +- save_ext_shared=$ext_shared +- ext_shared=yes +- +- for ac_i in $ac_stuff; do +- case $ac_i in +- -pthread) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -pthread" +- else +- +- +- unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "EXTRA_LDFLAGS$unique=set" +- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" +- fi +- +- fi +- ;; +- -l*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- if test "$ext_shared" = "yes"; then +- LDFLAGS="$LDFLAGS -l$ac_ii" +- else +- +- +- case $ac_ii in +- c|c_r|pthread*) ;; +- *) +- LIBS="$LIBS -l$ac_ii" +- ;; +- esac +- +- +- fi +- ;; +- esac +- +- +- ;; +- -L*) +- ac_ii=`echo $ac_i|cut -c 3-` +- +- if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then +- +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii +- else +- +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- LDFLAGS="-L$ai_p $LDFLAGS" +- test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- ;; +- esac +- done +- +- echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6 +-echo "configure:99939: checking for iconv in -l$iconv_lib_name" >&5 +-ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'` ++ echo $ac_n "checking for __gethostname in -lnsl""... $ac_c" 1>&6 ++echo "configure:105944: checking for __gethostname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'__gethostname | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-l$iconv_lib_name $LIBS" ++LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:105963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -99969,1088 +105974,1259 @@ LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- +- found_iconv=yes +- +- ++ found=yes + else + echo "$ac_t""no" 1>&6 +- +- LDFLAGS=$save_old_LDFLAGS +- ext_shared=$save_ext_shared +- unset ac_cv_lib_$iconv_lib_name_iconv +- +- ++found=no + fi + +- + + fi + +- fi +- fi +- +- if test "$found_iconv" = "yes"; then +- +- echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h + +- cat >> confdefs.h <<\EOF +-#define HAVE_ICONV 1 ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lnsl" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- if test -n "$ICONV_DIR"; then +- +- +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-l$iconv_lib_name $XMLRPC_SHARED_LIBADD" +- if test -n "$ICONV_DIR/$PHP_LIBDIR"; then +- +- if test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$ICONV_DIR/$PHP_LIBDIR" || echo "$ICONV_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$ICONV_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $ICONV_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ICONV_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" +- else +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- +- fi +- +- +- fi +- +- fi +- +- fi +- else +- +- +- if test -n "$ICONV_DIR/$PHP_LIBDIR"; then +- +- if test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$ICONV_DIR/$PHP_LIBDIR" != "/usr/lib"; then +- +- if test -z "$ICONV_DIR/$PHP_LIBDIR" || echo "$ICONV_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$ICONV_DIR/$PHP_LIBDIR +- else +- +- ep_dir="`echo $ICONV_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ICONV_DIR/$PHP_LIBDIR\"`" +- fi +- +- +- +- +- +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` +- +- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "LIBPATH$unique=set" +- +- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" +- LDFLAGS="$LDFLAGS -L$ai_p" +- PHP_RPATHS="$PHP_RPATHS $ai_p" +- ++ LIBS=$ac_libs + fi + +- ++ if test "$found" = "yes"; then + +- fi +- +- fi + +- +- case $iconv_lib_name in ++ case nsl in + c|c_r|pthread*) ;; + *) +- LIBS="-l$iconv_lib_name $LIBS" ++ LIBS="-lnsl $LIBS" + ;; + esac + + ++ cat >> confdefs.h <<\EOF ++#define HAVE_GETHOSTNAME 1 ++EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBNSL 1 ++EOF + +- fi +- +- +- +- if test "$ICONV_DIR/include" != "/usr/include"; then +- +- if test -z "$ICONV_DIR/include" || echo "$ICONV_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$ICONV_DIR/include ++ ac_cv_func_gethostname=yes + else + +- ep_dir="`echo $ICONV_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" +- +- ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ICONV_DIR/include\"`" +- fi ++ : + +- ++ fi + +- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ;; + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" +- if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi +- +- fi ++ esac + +- fi ++ ++ unset ac_cv_func_getdomainname ++ unset ac_cv_func___getdomainname ++ unset found ++ ++ echo $ac_n "checking for getdomainname""... $ac_c" 1>&6 ++echo "configure:106050: checking for getdomainname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_getdomainname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getdomainname(); + +- fi +- +-else +- { echo "configure: error: iconv not found, in order to build xmlrpc you need the iconv library" 1>&2; exit 1; } +- +- fi ++int main() { + +- fi +-fi ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_getdomainname) || defined (__stub___getdomainname) ++choke me ++#else ++getdomainname(); ++#endif + +-if test "$PHP_XMLRPC" = "yes"; then +- # Extract the first word of "ranlib", so it can be a program name with args. +-set dummy ranlib; ac_word=$2 +-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:100148: checking for $ac_word" >&5 +-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test -n "$RANLIB"; then +- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. ++; return 0; } ++EOF ++if { (eval echo configure:106078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_getdomainname=yes" + else +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +- ac_dummy="$PATH" +- for ac_dir in $ac_dummy; do +- test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$ac_word; then +- ac_cv_prog_RANLIB="ranlib" +- break +- fi +- done +- IFS="$ac_save_ifs" +- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_getdomainname=no" + fi ++rm -f conftest* + fi +-RANLIB="$ac_cv_prog_RANLIB" +-if test -n "$RANLIB"; then +- echo "$ac_t""$RANLIB" 1>&6 ++ ++if eval "test \"`echo '$ac_cv_func_'getdomainname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes + else + echo "$ac_t""no" 1>&6 +-fi +- +-echo $ac_n "checking for inline""... $ac_c" 1>&6 +-echo "configure:100176: checking for inline" >&5 +-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then ++ echo $ac_n "checking for __getdomainname""... $ac_c" 1>&6 ++echo "configure:106096: checking for __getdomainname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___getdomainname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- ac_cv_c_inline=no +-for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getdomainname(); + + int main() { +-} $ac_kw foo() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___getdomainname) || defined (__stub_____getdomainname) ++choke me ++#else ++__getdomainname(); ++#endif ++ + ; return 0; } + EOF +-if { (eval echo configure:100190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:106124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- ac_cv_c_inline=$ac_kw; break ++ eval "ac_cv_func___getdomainname=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func___getdomainname=no" + fi + rm -f conftest* +-done +- + fi + +-echo "$ac_t""$ac_cv_c_inline" 1>&6 +-case "$ac_cv_c_inline" in +- inline | yes) ;; +- no) cat >> confdefs.h <<\EOF +-#define inline +-EOF +- ;; +- *) cat >> confdefs.h <&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ ++fi + + +-cat >> confdefs.h <<\EOF +-#define UNDEF_THREADS_HACK ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_GETDOMAINNAME 1 + EOF + +- +- +-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:100228: checking for ANSI C header files" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then ++ ac_cv_func_getdomainname=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_nsl_getdomainname ++ unset ac_cv_lib_nsl___getdomainname ++ unset found ++ echo $ac_n "checking for getdomainname in -lnsl""... $ac_c" 1>&6 ++echo "configure:106162: checking for getdomainname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'getdomainname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < +-#include +-#include +-#include +-EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:100241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then +- rm -rf conftest* +- ac_cv_header_stdc=yes +-else +- echo "$ac_err" >&5 +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- rm -rf conftest* +- ac_cv_header_stdc=no +-fi +-rm -f conftest* +- +-if test $ac_cv_header_stdc = yes; then +- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ++ ac_save_LIBS="$LIBS" ++LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getdomainname(); ++ ++int main() { ++getdomainname() ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "memchr" >/dev/null 2>&1; then +- : ++if { (eval echo configure:106181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_header_stdc=no ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" + + fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-if test $ac_cv_header_stdc = yes; then +- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++ echo $ac_n "checking for __getdomainname in -lnsl""... $ac_c" 1>&6 ++echo "configure:106201: checking for __getdomainname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'__getdomainname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getdomainname(); ++ ++int main() { ++__getdomainname() ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "free" >/dev/null 2>&1; then +- : ++if { (eval echo configure:106220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_header_stdc=no ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" + + fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi + +-if test $ac_cv_header_stdc = yes; then +- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +-if test "$cross_compiling" = yes; then +- : ++ ++fi ++ ++ ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lnsl" ++ if test "$cross_compiling" = yes; then ++ found=no + else + cat > conftest.$ac_ext < +-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +-int main () { int i; for (i = 0; i < 256; i++) +-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +-exit (0); } +- ++main() { return (0); } + EOF +-if { (eval echo configure:100308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:106256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then +- : ++ found=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* +- ac_cv_header_stdc=no ++ found=no + fi + rm -fr conftest* + fi + +-fi +-fi ++ LIBS=$ac_libs ++ fi + +-echo "$ac_t""$ac_cv_header_stdc" 1>&6 +-if test $ac_cv_header_stdc = yes; then +- cat >> confdefs.h <<\EOF +-#define STDC_HEADERS 1 ++ if test "$found" = "yes"; then ++ ++ ++ case nsl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lnsl $LIBS" ++ ;; ++ esac ++ ++ ++ cat >> confdefs.h <<\EOF ++#define HAVE_GETDOMAINNAME 1 + EOF + +-fi ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBNSL 1 ++EOF + +-for ac_hdr in xmlparse.h xmltok.h stdlib.h strings.h string.h +-do +-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:100335: checking for $ac_hdr" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ ac_cv_func_getdomainname=yes ++ else ++ ++ : ++ ++ fi ++ ++ ;; ++ ++ esac ++ ++ ++ unset ac_cv_func_getservbyport ++ unset ac_cv_func___getservbyport ++ unset found ++ ++ echo $ac_n "checking for getservbyport""... $ac_c" 1>&6 ++echo "configure:106307: checking for getservbyport" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_getservbyport'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char getservbyport(); below. */ ++#include ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getservbyport(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_getservbyport) || defined (__stub___getservbyport) ++choke me ++#else ++getservbyport(); ++#endif ++ ++; return 0; } + EOF +-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:100345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +-if test -z "$ac_err"; then ++if { (eval echo configure:106335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=yes" ++ eval "ac_cv_func_getservbyport=yes" + else +- echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_header_$ac_safe=no" ++ eval "ac_cv_func_getservbyport=no" + fi + rm -f conftest* + fi +-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ ++if eval "test \"`echo '$ac_cv_func_'getservbyport`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +- cat >> confdefs.h <&6 +-fi +-done +- +- +- +- +- +- +-echo $ac_n "checking size of char""... $ac_c" 1>&6 +-echo "configure:100377: checking size of char" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then ++ echo $ac_n "checking for __getservbyport""... $ac_c" 1>&6 ++echo "configure:106353: checking for __getservbyport" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___getservbyport'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_char=1 +-else + cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(char)); +- return(0); +-} ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char __getservbyport(); below. */ ++#include ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getservbyport(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___getservbyport) || defined (__stub_____getservbyport) ++choke me ++#else ++__getservbyport(); ++#endif ++ ++; return 0; } + EOF +-if { (eval echo configure:100396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_char=`cat conftestval` ++if { (eval echo configure:106381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func___getservbyport=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_char=0 ++ rm -rf conftest* ++ eval "ac_cv_func___getservbyport=no" + fi +-rm -fr conftest* ++rm -f conftest* + fi + ++if eval "test \"`echo '$ac_cv_func_'__getservbyport`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + fi +-echo "$ac_t""$ac_cv_sizeof_char" 1>&6 +-cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_GETSERVBYPORT 1 ++EOF + +-echo $ac_n "checking size of int""... $ac_c" 1>&6 +-echo "configure:100417: checking size of int" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then ++ ac_cv_func_getservbyport=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_nsl_getservbyport ++ unset ac_cv_lib_nsl___getservbyport ++ unset found ++ echo $ac_n "checking for getservbyport in -lnsl""... $ac_c" 1>&6 ++echo "configure:106419: checking for getservbyport in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'getservbyport | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_int=4 +-else +- cat > conftest.$ac_ext < conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(int)); +- return(0); +-} ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getservbyport(); ++ ++int main() { ++getservbyport() ++; return 0; } + EOF +-if { (eval echo configure:100436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_int=`cat conftestval` ++if { (eval echo configure:106438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_int=0 +-fi +-rm -fr conftest* ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + + fi +-echo "$ac_t""$ac_cv_sizeof_int" 1>&6 +-cat >> confdefs.h <&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-echo $ac_n "checking size of long""... $ac_c" 1>&6 +-echo "configure:100456: checking size of long" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then ++ echo $ac_n "checking for __getservbyport in -lnsl""... $ac_c" 1>&6 ++echo "configure:106458: checking for __getservbyport in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'__getservbyport | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_long=4 +-else +- cat > conftest.$ac_ext < conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(long)); +- return(0); +-} ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getservbyport(); ++ ++int main() { ++__getservbyport() ++; return 0; } + EOF +-if { (eval echo configure:100475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- ac_cv_sizeof_long=`cat conftestval` ++if { (eval echo configure:106477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- ac_cv_sizeof_long=0 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi +-rm -fr conftest* ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no + fi + ++ + fi +-echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +-cat >> confdefs.h <&6 +-echo "configure:100495: checking size of long long" >&5 +-if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_sizeof_long_long=8 ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lnsl" ++ if test "$cross_compiling" = yes; then ++ found=no + else + cat > conftest.$ac_ext < +-int main() +-{ +- FILE *f=fopen("conftestval", "w"); +- if (!f) return(1); +- fprintf(f, "%d\n", sizeof(long long)); +- return(0); +-} ++main() { return (0); } + EOF +-if { (eval echo configure:100514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:106513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then +- ac_cv_sizeof_long_long=`cat conftestval` ++ found=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* +- ac_cv_sizeof_long_long=0 ++ found=no + fi + rm -fr conftest* + fi + +-fi +-echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 +-cat >> confdefs.h <> confdefs.h <<\EOF ++#define HAVE_GETSERVBYPORT 1 + EOF + ++ cat >> confdefs.h <<\EOF ++#define HAVE_LIBNSL 1 ++EOF + +-echo $ac_n "checking for size_t""... $ac_c" 1>&6 +-echo "configure:100534: checking for size_t" >&5 +-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then ++ ac_cv_func_getservbyport=yes ++ else ++ ++ : ++ ++ fi ++ ++ ;; ++ ++ esac ++ ++ ++ unset ac_cv_func_getservbyname ++ unset ac_cv_func___getservbyname ++ unset found ++ ++ echo $ac_n "checking for getservbyname""... $ac_c" 1>&6 ++echo "configure:106564: checking for getservbyname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_getservbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +-#if STDC_HEADERS +-#include +-#include ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char getservbyname(); below. */ ++#include ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getservbyname(); ++ ++int main() { ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub_getservbyname) || defined (__stub___getservbyname) ++choke me ++#else ++getservbyname(); + #endif ++ ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ++if { (eval echo configure:106592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- ac_cv_type_size_t=yes ++ eval "ac_cv_func_getservbyname=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_type_size_t=no ++ eval "ac_cv_func_getservbyname=no" + fi + rm -f conftest* +- +-fi +-echo "$ac_t""$ac_cv_type_size_t" 1>&6 +-if test $ac_cv_type_size_t = no; then +- cat >> confdefs.h <<\EOF +-#define size_t unsigned +-EOF +- + fi + +-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +-echo "configure:100567: checking whether time.h and sys/time.h may both be included" >&5 +-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then ++if eval "test \"`echo '$ac_cv_func_'getservbyname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++ echo $ac_n "checking for __getservbyname""... $ac_c" 1>&6 ++echo "configure:106610: checking for __getservbyname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func___getservbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +-#include +-#include ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char __getservbyname(); below. */ ++#include ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getservbyname(); ++ + int main() { +-struct tm *tp; ++ ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined (__stub___getservbyname) || defined (__stub_____getservbyname) ++choke me ++#else ++__getservbyname(); ++#endif ++ + ; return 0; } + EOF +-if { (eval echo configure:100581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:106638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- ac_cv_header_time=yes ++ eval "ac_cv_func___getservbyname=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_header_time=no ++ eval "ac_cv_func___getservbyname=no" + fi + rm -f conftest* + fi + +-echo "$ac_t""$ac_cv_header_time" 1>&6 +-if test $ac_cv_header_time = yes; then +- cat >> confdefs.h <<\EOF +-#define TIME_WITH_SYS_TIME 1 +-EOF +- ++if eval "test \"`echo '$ac_cv_func_'__getservbyname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 ++found=no ++fi ++ + fi + +-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +-echo "configure:100602: checking for uid_t in sys/types.h" >&5 +-if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then ++ ++ case $found in ++ yes) ++ cat >> confdefs.h <<\EOF ++#define HAVE_GETSERVBYNAME 1 ++EOF ++ ++ ac_cv_func_getservbyname=yes ++ ;; ++ ++ *) ++ ++ unset ac_cv_lib_nsl_getservbyname ++ unset ac_cv_lib_nsl___getservbyname ++ unset found ++ echo $ac_n "checking for getservbyname in -lnsl""... $ac_c" 1>&6 ++echo "configure:106676: checking for getservbyname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'getservbyname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < ++/* Override any gcc2 internal prototype to avoid an error. */ ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char getservbyname(); ++ ++int main() { ++getservbyname() ++; return 0; } + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "uid_t" >/dev/null 2>&1; then ++if { (eval echo configure:106695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- ac_cv_type_uid_t=yes ++ eval "ac_cv_lib_$ac_lib_var=yes" + else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 + rm -rf conftest* +- ac_cv_type_uid_t=no ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* ++LIBS="$ac_save_LIBS" + + fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ found=yes ++else ++ echo "$ac_t""no" 1>&6 + +-echo "$ac_t""$ac_cv_type_uid_t" 1>&6 +-if test $ac_cv_type_uid_t = no; then +- cat >> confdefs.h <<\EOF +-#define uid_t int +-EOF +- +- cat >> confdefs.h <<\EOF +-#define gid_t int +-EOF +- +-fi +- +- +- +- +- +- +-# Standard XMLRPC list +-for ac_func in \ +- strtoul strtoull snprintf \ +- strstr strpbrk strerror\ +- memcpy memmove +-do +-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:100647: checking for $ac_func" >&5 +-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "checking for __getservbyname in -lnsl""... $ac_c" 1>&6 ++echo "configure:106715: checking for __getservbyname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'__getservbyname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat > conftest.$ac_ext < conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func(); +- +-int main() { +- +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-$ac_func(); +-#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char __getservbyname(); + ++int main() { ++__getservbyname() + ; return 0; } + EOF +-if { (eval echo configure:100675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:106734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* +- eval "ac_cv_func_$ac_func=yes" ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* +- eval "ac_cv_func_$ac_func=no" ++ eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* +-fi ++LIBS="$ac_save_LIBS" + +-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 +- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +- cat >> confdefs.h <&6 ++found=no + fi +-done +- + ++ ++fi + + +- +- ext_builddir=ext/xmlrpc +- ext_srcdir=$abs_srcdir/ext/xmlrpc ++ if test "$found" = "yes"; then ++ ac_libs=$LIBS ++ LIBS="$LIBS -lnsl" ++ if test "$cross_compiling" = yes; then ++ found=no ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ found=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ found=no ++fi ++rm -fr conftest* ++fi + +- ac_extra=`echo "-I@ext_srcdir@/libxmlrpc -DVERSION="0.50""|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g` ++ LIBS=$ac_libs ++ fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XMLRPC_SHARED=no ++ if test "$found" = "yes"; then + + +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ case nsl in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-lnsl $LIBS" ++ ;; + esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ +- libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ +- libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ +- libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ +- libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ +- libxmlrpc/xml_to_soap.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_GETSERVBYNAME 1 + EOF +- done +- +- +- EXT_STATIC="$EXT_STATIC xmlrpc" +- if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC xmlrpc" +- fi +- else +- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_XMLRPC_SHARED=yes +- +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$shared_c_pre +- b_cxx_pre=$shared_cxx_pre +- b_c_meta=$shared_c_meta +- b_cxx_meta=$shared_cxx_meta +- b_c_post=$shared_c_post +- b_cxx_post=$shared_cxx_post +- b_lo=$shared_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ +- libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ +- libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ +- libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ +- libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ +- libxmlrpc/xml_to_soap.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- shared_objects_xmlrpc="$shared_objects_xmlrpc $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_LIBNSL 1 + EOF +- done +- +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxmlrpc.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxmlrpc.so '$ext_builddir'/phpxmlrpc.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXMLRPC, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD)' +- ;; +- esac + +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpxmlrpc.$suffix" ++ ac_cv_func_getservbyname=yes + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlrpc.$suffix" ++ ++ : ++ + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc" +- +- cat >>Makefile.objects<&6 ++echo "configure:106818: checking for zlib.h" >&5 ++ ZLIB_DIR= ++ for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do ++ if test -f "$i/include/zlib.h"; then ++ ZLIB_DIR=$i ++ break; ++ fi ++ done ++ if test "x$ZLIB_DIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: could not find zlib.h" 1>&2; exit 1; } ++ else ++ echo "$ac_t""found in $ZLIB_DIR" 1>&6 ++ echo $ac_n "checking for zlib version >= 1.2.0.4""... $ac_c" 1>&6 ++echo "configure:106832: checking for zlib version >= 1.2.0.4" >&5 ++ ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[^0-9\.]//g'` ++ echo "$ac_t""$ZLIB_VERSION" 1>&6 ++ if test `echo $ZLIB_VERSION | $SED -e 's/[^0-9]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then ++ { echo "configure: error: libz version greater or equal to 1.2.0.4 required" 1>&2; exit 1; } ++ else ++ ++ if test "$ZLIB_DIR/include" != "/usr/include"; then ++ ++ if test -z "$ZLIB_DIR/include" || echo "$ZLIB_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$ZLIB_DIR/include + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/xmlrpc.$suffix" ++ ++ ep_dir="`echo $ZLIB_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ZLIB_DIR/include\"`" + fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc" +- +- cat >>Makefile.objects<> confdefs.h </dev/null ; then ++ ai_p=$ZLIB_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ZLIB_DIR/$PHP_LIBDIR\"`" + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_XMLRPC_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) ++ ++ if test "$ext_shared" = "yes"; then ++ HTTP_SHARED_LIBADD="-L$ai_p $HTTP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && HTTP_SHARED_LIBADD="$ld_runpath_switch$ai_p $HTTP_SHARED_LIBADD" ++ else + + +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ +- libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ +- libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ +- libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ +- libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ +- libxmlrpc/xml_to_soap.c; do ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ fi + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ZLIB_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ZLIB_DIR/$PHP_LIBDIR\"`" ++ fi ++ ++ ++ + +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \ +- libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ +- libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ +- libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ +- libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ +- libxmlrpc/xml_to_soap.c; do ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ fi + +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HTTP_HAVE_ZLIB 1 ++EOF ++ ++ fi ++ fi ++ fi ++ ++ if test "$PHP_HTTP_CURL_REQUESTS" != "no"; then ++ echo $ac_n "checking for curl/curl.h""... $ac_c" 1>&6 ++echo "configure:106976: checking for curl/curl.h" >&5 ++ CURL_DIR= ++ for i in "$PHP_HTTP_CURL_REQUESTS" /usr/local /usr /opt; do ++ if test -f "$i/include/curl/curl.h"; then ++ CURL_DIR=$i ++ break ++ fi ++ done ++ if test "x$CURL_DIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: could not find curl/curl.h" 1>&2; exit 1; } ++ else ++ echo "$ac_t""found in $CURL_DIR" 1>&6 ++ fi ++ ++ echo $ac_n "checking for curl-config""... $ac_c" 1>&6 ++echo "configure:106992: checking for curl-config" >&5 ++ CURL_CONFIG= ++ for i in "$CURL_DIR/bin/curl-config" "$CURL_DIR/curl-config" `which curl-config`; do ++ if test -x "$i"; then ++ CURL_CONFIG=$i ++ break ++ fi ++ done ++ if test "x$CURL_CONFIG" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: could not find curl-config" 1>&2; exit 1; } ++ else ++ echo "$ac_t""found: $CURL_CONFIG" 1>&6 ++ fi ++ ++ echo $ac_n "checking for curl version >= 7.12.3""... $ac_c" 1>&6 ++echo "configure:107008: checking for curl version >= 7.12.3" >&5 ++ CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[^0-9\.]//g'` ++ echo "$ac_t""$CURL_VERSION" 1>&6 ++ if test `echo $CURL_VERSION | $SED -e 's/[^0-9]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71203; then ++ { echo "configure: error: libcurl version greater or equal to 7.12.3 required" 1>&2; exit 1; } ++ fi ++ ++ ++ save_INCLUDES="$INCLUDES" ++ INCLUDES= ++ save_LIBS="$LIBS" ++ LIBS= ++ save_CFLAGS="$CFLAGS" ++ CFLAGS=`$CURL_CONFIG --cflags` ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS=`$CURL_CONFIG --libs` ++ LDFLAGS="$LDFLAGS $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR" ++ ++ echo $ac_n "checking for SSL support in libcurl""... $ac_c" 1>&6 ++echo "configure:107027: checking for SSL support in libcurl" >&5 ++ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` ++ if test "$CURL_SSL" = "SSL"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_SSL 1 ++EOF ++ ++ ++ echo $ac_n "checking for openssl support in libcurl""... $ac_c" 1>&6 ++echo "configure:107037: checking for openssl support in libcurl" >&5 ++ if test "$cross_compiling" = yes; then ++ ++ echo "$ac_t""no" 1>&6 ++ ++else ++ cat > conftest.$ac_ext < ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); ++ } ++ return 1; ++ } ++ ++EOF ++if { (eval echo configure:107059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then + ++ echo "$ac_t""yes" 1>&6 ++ ac_safe=`echo "openssl/crypto.h" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for openssl/crypto.h""... $ac_c" 1>&6 ++echo "configure:107065: checking for openssl/crypto.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:107075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + +- BUILD_DIR="$BUILD_DIR $ext_builddir/libxmlrpc" +- ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_OPENSSL 1 ++EOF + +- XMLRPC_MODULE_TYPE=builtin ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi + +-elif test "$PHP_XMLRPC" != "no"; then ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* ++ ++ echo "$ac_t""no" 1>&6 ++ ++fi ++rm -fr conftest* ++fi + +- if test -r $PHP_XMLRPC/include/xmlrpc.h; then +- XMLRPC_DIR=$PHP_XMLRPC/include +- elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then +- XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi +- else +- echo $ac_n "checking for XMLRPC-EPI in default path""... $ac_c" 1>&6 +-echo "configure:101029: checking for XMLRPC-EPI in default path" >&5 +- for i in /usr/local /usr; do +- if test -r $i/include/xmlrpc.h; then +- XMLRPC_DIR=$i/include +- echo "$ac_t""found in $i" 1>&6 +- break +- fi +- done +- fi ++ ++ echo $ac_n "checking for gnutls support in libcurl""... $ac_c" 1>&6 ++echo "configure:107115: checking for gnutls support in libcurl" >&5 ++ if test "$cross_compiling" = yes; then ++ ++ echo "$ac_t""no" 1>&6 ++ ++else ++ cat > conftest.$ac_ext < ++ int main(int argc, char *argv[]) { ++ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); ++ if (data && data->ssl_version && *data->ssl_version) { ++ const char *ptr = data->ssl_version; ++ while(*ptr == ' ') ++ptr; ++ return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); ++ } ++ return 1; ++ } ++ ++EOF ++if { (eval echo configure:107137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++then ++ ++ echo "$ac_t""yes" 1>&6 ++ ac_safe=`echo "gcrypt.h" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for gcrypt.h""... $ac_c" 1>&6 ++echo "configure:107143: checking for gcrypt.h" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:107153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" ++fi ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_GNUTLS 1 ++EOF + +- if test -z "$XMLRPC_DIR"; then +- echo "$ac_t""not found" 1>&6 +- { echo "configure: error: Please reinstall the XMLRPC-EPI distribution" 1>&2; exit 1; } +- fi ++ ++else ++ echo "$ac_t""no" 1>&6 ++fi + ++ ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -fr conftest* + +- if test "$XMLRPC_DIR" != "/usr/include"; then ++ echo "$ac_t""no" 1>&6 ++ ++fi ++rm -fr conftest* ++fi ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ++ INCLUDES="$save_INCLUDES" ++ LIBS="$save_LIBS" ++ CFLAGS="$save_CFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++ ++ ++ echo $ac_n "checking for bundled SSL CA info""... $ac_c" 1>&6 ++echo "configure:107202: checking for bundled SSL CA info" >&5 ++ CURL_CAINFO= ++ for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do ++ if test -f "$i"; then ++ CURL_CAINFO="$i" ++ break ++ fi ++ done ++ if test "x$CURL_CAINFO" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ else ++ echo "$ac_t""$CURL_CAINFO" 1>&6 ++ cat >> confdefs.h </dev/null ; then +- ai_p=$XMLRPC_DIR ++ if test -z "$CURL_DIR/include" || echo "$CURL_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/include + else + +- ep_dir="`echo $XMLRPC_DIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $CURL_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$XMLRPC_DIR\"`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/include\"`" + fi + + +@@ -101071,28 +107247,28 @@ echo "configure:101029: checking for XML + + fi + +- ++ + + if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-lxmlrpc $XMLRPC_SHARED_LIBADD" +- if test -n "$XMLRPC_DIR/$PHP_LIBDIR"; then ++ HTTP_SHARED_LIBADD="-lcurl $HTTP_SHARED_LIBADD" ++ if test -n "$CURL_DIR/$PHP_LIBDIR"; then + +- if test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$CURL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$CURL_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$XMLRPC_DIR/$PHP_LIBDIR" || echo "$XMLRPC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$XMLRPC_DIR/$PHP_LIBDIR ++ if test -z "$CURL_DIR/$PHP_LIBDIR" || echo "$CURL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $XMLRPC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- XMLRPC_SHARED_LIBADD="-L$ai_p $XMLRPC_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLRPC_SHARED_LIBADD" ++ HTTP_SHARED_LIBADD="-L$ai_p $HTTP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && HTTP_SHARED_LIBADD="$ld_runpath_switch$ai_p $HTTP_SHARED_LIBADD" + else + + +@@ -101118,18 +107294,18 @@ echo "configure:101029: checking for XML + else + + +- if test -n "$XMLRPC_DIR/$PHP_LIBDIR"; then ++ if test -n "$CURL_DIR/$PHP_LIBDIR"; then + +- if test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$XMLRPC_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$CURL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$CURL_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$XMLRPC_DIR/$PHP_LIBDIR" || echo "$XMLRPC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$XMLRPC_DIR/$PHP_LIBDIR ++ if test -z "$CURL_DIR/$PHP_LIBDIR" || echo "$CURL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$CURL_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $XMLRPC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $CURL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$CURL_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -101155,10 +107331,10 @@ echo "configure:101029: checking for XML + fi + + +- case xmlrpc in ++ case curl in + c|c_r|pthread*) ;; + *) +- LIBS="-lxmlrpc $LIBS" ++ LIBS="-lcurl $LIBS" + ;; + esac + +@@ -101168,412 +107344,262 @@ echo "configure:101029: checking for XML + fi + + ++ ++ for ac_i in `$CURL_CONFIG --libs`; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ HTTP_SHARED_LIBADD="$HTTP_SHARED_LIBADD -pthread" ++ else ++ + +- ext_builddir=ext/xmlrpc +- ext_srcdir=$abs_srcdir/ext/xmlrpc +- +- ac_extra= +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XMLRPC_SHARED=no +- +- +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ HTTP_SHARED_LIBADD="$HTTP_SHARED_LIBADD -l$ac_ii" ++ else + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/xmlrpc.$suffix" +- fi +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc" +- +- cat >>Makefile.objects<> confdefs.h <>Makefile.objects<> confdefs.h <<\EOF ++#define HTTP_HAVE_CURL 1 ++EOF + +- EXT_STATIC="$EXT_STATIC xmlrpc" +- ;; +- *) +- ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " + +- case ext/xmlrpc in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ + ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in xmlrpc-epi-php.c; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + +- XMLRPC_MODULE_TYPE=external +-fi +- +- +- +-php_enable_xmlwriter=yes +- +-echo $ac_n "checking whether to enable XMLWriter support""... $ac_c" 1>&6 +-echo "configure:101472: checking whether to enable XMLWriter support" >&5 +-# Check whether --enable-xmlwriter or --disable-xmlwriter was given. +-if test "${enable_xmlwriter+set}" = set; then +- enableval="$enable_xmlwriter" +- PHP_XMLWRITER=$enableval +-else ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + +- PHP_XMLWRITER=yes +- test "$PHP_ENABLE_ALL" && PHP_XMLWRITER=$PHP_ENABLE_ALL +- +-fi +- +- +- +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_XMLWRITER in +-shared,*) +- PHP_XMLWRITER=`echo "$PHP_XMLWRITER"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_XMLWRITER=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac +- +- +- +-echo "$ac_t""$ext_output" 1>&6 +- +- +- +- +-if test -z "$PHP_LIBXML_DIR"; then + +-php_with_libxml_dir=no +- +-echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 +-echo "configure:101517: checking libxml2 install dir" >&5 +-# Check whether --with-libxml-dir or --without-libxml-dir was given. +-if test "${with_libxml_dir+set}" = set; then +- withval="$with_libxml_dir" +- PHP_LIBXML_DIR=$withval +-else ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- PHP_LIBXML_DIR=no ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- +-fi ++ fi + + +-ext_output=$PHP_LIBXML_DIR +-echo "$ac_t""$ext_output" 1>&6 ++ fi ++ ++ fi + ++ ;; ++ esac ++ done + ++ echo $ac_n "checking for curl_share_strerror in -lcurl""... $ac_c" 1>&6 ++echo "configure:107539: checking for curl_share_strerror in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_share_strerror | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +-if test "$PHP_XMLWRITER" != "no"; then +- +- if test "$PHP_LIBXML" = "no"; then +- { echo "configure: error: XMLWriter extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; } +- fi ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_SHARE_STRERROR 1 ++EOF + + +-echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 +-echo "configure:101545: checking for xml2-config path" >&5 +-if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then +- echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- for i in $PHP_LIBXML_DIR /usr/local /usr; do +- if test -x "$i/bin/xml2-config"; then +- ac_cv_php_xml2_config_path="$i/bin/xml2-config" +- break +- fi +- done ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_share_strerror ++ ++ + fi + +-echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6 +- +- if test -x "$ac_cv_php_xml2_config_path"; then +- XML2_CONFIG="$ac_cv_php_xml2_config_path" +- libxml_full_version=`$XML2_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxml_full_version +- IFS=$ac_IFS +- LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXML_VERSION" -ge "2006011"; then +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` +- +- for ac_i in $LIBXML_LIBS; do ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- XMLWRITER_SHARED_LIBADD="$XMLWRITER_SHARED_LIBADD -pthread" ++ LDFLAGS="$LDFLAGS -pthread" + else + + +@@ -101595,7 +107621,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- XMLWRITER_SHARED_LIBADD="$XMLWRITER_SHARED_LIBADD -l$ac_ii" ++ LDFLAGS="$LDFLAGS -l$ac_ii" + else + + +@@ -101630,8 +107656,8 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + + + if test "$ext_shared" = "yes"; then +- XMLWRITER_SHARED_LIBADD="-L$ai_p $XMLWRITER_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XMLWRITER_SHARED_LIBADD="$ld_runpath_switch$ai_p $XMLWRITER_SHARED_LIBADD" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -101657,13 +107683,115 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + esac + done + +- +- for ac_i in $LIBXML_INCS; do ++ echo $ac_n "checking for curl_multi_strerror in -lcurl""... $ac_c" 1>&6 ++echo "configure:107688: checking for curl_multi_strerror in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_multi_strerror | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_MULTI_STRERROR 1 ++EOF ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_multi_strerror ++ ++ ++fi ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do + case $ac_i in +- -I*) ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) + ac_ii=`echo $ac_i|cut -c 3-` + +- if test "$ac_ii" != "/usr/include"; then ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + + if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then + ai_p=$ac_ii +@@ -101676,481 +107804,547 @@ echo "$ac_t""$ac_cv_php_xml2_config_path + fi + + ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ + + unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then +- eval "INCLUDEPATH$unique=set" +- +- if test ""; then +- INCLUDES="-I$ai_p $INCLUDES" +- else +- INCLUDES="$INCLUDES -I$ai_p" +- fi ++ eval "LIBPATH$unique=set" + ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ + fi + ++ ++ fi ++ + fi + + ;; + esac + done + +- +- echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 +-echo "configure:101703: checking whether libxml build works" >&5 +-if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then ++ echo $ac_n "checking for curl_easy_strerror in -lcurl""... $ac_c" 1>&6 ++echo "configure:107837: checking for curl_easy_strerror in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_easy_strerror | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +- +- +- old_LIBS=$LIBS +- LIBS=" +- $XMLWRITER_SHARED_LIBADD +- $LIBS" +- if test "$cross_compiling" = yes; then +- +- LIBS=$old_LIBS +- +-else +- cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +-then +- +- LIBS=$old_LIBS +- +- php_cv_libxml_build_works=yes +- +- ++if { (eval echo configure:107856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- rm -fr conftest* +- +- LIBS=$old_LIBS +- +- echo "$ac_t""no" 1>&6 +- { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; } +- +- +-fi +-rm -fr conftest* ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- +- + fi +- +-echo "$ac_t""$php_cv_libxml_build_works" 1>&6 +- if test "$php_cv_libxml_build_works" = "yes"; then +- cat >> confdefs.h <<\EOF +-#define HAVE_LIBXML 1 +-EOF +- +- fi +- ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared + cat >> confdefs.h <<\EOF +-#define HAVE_XMLWRITER 1 ++#define HAVE_CURL_EASY_STRERROR 1 + EOF + +- +- ext_builddir=ext/xmlwriter +- ext_srcdir=$abs_srcdir/ext/xmlwriter ++ ++else ++ echo "$ac_t""no" 1>&6 + +- ac_extra= ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_easy_strerror ++ ++ ++fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XMLWRITER_SHARED=no +- ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " + +- case ext/xmlwriter in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlwriter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlwriter/"; ac_bdir="ext/xmlwriter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ save_ext_shared=$ext_shared ++ ext_shared=yes + ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in php_xmlwriter.c; do ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<>Makefile.objects<>Makefile.objects<>Makefile.objects<> confdefs.h </dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_XMLWRITER_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else + + +- case ext/xmlwriter in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlwriter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlwriter/"; ac_bdir="ext/xmlwriter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo + ++ fi ++ ++ fi + +- old_IFS=$IFS +- for ac_src in php_xmlwriter.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" ++ ;; ++ esac ++ done + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac ++ echo $ac_n "checking for curl_easy_reset in -lcurl""... $ac_c" 1>&6 ++echo "configure:107986: checking for curl_easy_reset in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_easy_reset | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + +- EXT_STATIC="$EXT_STATIC xmlwriter" +- ;; +- *) +- +- +- case ext/xmlwriter in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xmlwriter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xmlwriter/"; ac_bdir="ext/xmlwriter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_EASY_RESET 1 ++EOF ++ + ++else ++ echo "$ac_t""no" 1>&6 + +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_easy_reset ++ ++ ++fi + ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +- old_IFS=$IFS +- for ac_src in php_xmlwriter.c; do ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else + +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac + +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac + +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi ++ ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ + + +- BUILD_DIR="$BUILD_DIR $ext_builddir" ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + ++ fi + + +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=xmlwriter ++ fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" +- + fi + +- +- PHP_VAR_SUBST="$PHP_VAR_SUBST XMLWRITER_SHARED_LIBADD" ++ ;; ++ esac ++ done + +- +- else +- { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; } +- fi +-else +- { echo "configure: error: xml2-config not found. Please check your libxml2 installation." 1>&2; exit 1; } +- +- fi ++ echo $ac_n "checking for curl_formget in -lcurl""... $ac_c" 1>&6 ++echo "configure:108135: checking for curl_formget in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_formget | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + + fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_FORMGET 1 ++EOF + ++ ++else ++ echo "$ac_t""no" 1>&6 + ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_formget ++ ++ ++fi + +-php_with_xsl=no ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else ++ ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi + +-echo $ac_n "checking for XSL support""... $ac_c" 1>&6 +-echo "configure:102080: checking for XSL support" >&5 +-# Check whether --with-xsl or --without-xsl was given. +-if test "${with_xsl+set}" = set; then +- withval="$with_xsl" +- PHP_XSL=$withval +-else ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ + +- PHP_XSL=no +- test "$PHP_ENABLE_ALL" && PHP_XSL=$PHP_ENABLE_ALL ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac - echo $ac_n "checking for __res_search in -lsocket""... $ac_c" 1>&6 --echo "configure:91185: checking for __res_search in -lsocket" >&5 -+echo "configure:93183: checking for __res_search in -lsocket" >&5 - ac_lib_var=`echo socket'_'__res_search | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -91189,7 +93187,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsocket $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -91232,11 +93230,11 @@ fi - found=no - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - found=yes - else -@@ -91289,7 +93287,7 @@ EOF +-fi ++ fi ++ ;; ++ esac - echo $ac_n "checking whether atof() accepts NAN""... $ac_c" 1>&6 --echo "configure:91293: checking whether atof() accepts NAN" >&5 -+echo "configure:93291: checking whether atof() accepts NAN" >&5 - if eval "test \"`echo '$''{'ac_cv_atof_accept_nan'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -91300,7 +93298,7 @@ if test "$cross_compiling" = yes; then - else - cat > conftest.$ac_ext </dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi - #include -@@ -91320,7 +93318,7 @@ int main(int argc, char** argv) - } ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi - EOF --if { (eval echo configure:91324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_atof_accept_nan=yes -@@ -91347,7 +93345,7 @@ EOF - fi - echo $ac_n "checking whether atof() accepts INF""... $ac_c" 1>&6 --echo "configure:91351: checking whether atof() accepts INF" >&5 -+echo "configure:93349: checking whether atof() accepts INF" >&5 - if eval "test \"`echo '$''{'ac_cv_atof_accept_inf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -91358,7 +93356,7 @@ if test "$cross_compiling" = yes; then +-echo "$ac_t""$ext_output" 1>&6 ++ fi ++ ++ fi - else - cat > conftest.$ac_ext < -@@ -91381,7 +93379,7 @@ int main(int argc, char** argv) - } ++ echo $ac_n "checking for curl_multi_setopt in -lcurl""... $ac_c" 1>&6 ++echo "configure:108284: checking for curl_multi_setopt in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_multi_setopt | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_atof_accept_inf=yes -@@ -91408,7 +93406,7 @@ EOF - fi ++int main() { ++curl_multi_setopt() ++; return 0; } ++EOF ++if { (eval echo configure:108303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" - echo $ac_n "checking whether HUGE_VAL == INF""... $ac_c" 1>&6 --echo "configure:91412: checking whether HUGE_VAL == INF" >&5 -+echo "configure:93410: checking whether HUGE_VAL == INF" >&5 - if eval "test \"`echo '$''{'ac_cv_huge_val_inf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -91419,7 +93417,7 @@ if test "$cross_compiling" = yes; then +-if test "$PHP_XSL" != "no"; then ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_MULTI_SETOPT 1 ++EOF - else - cat > conftest.$ac_ext <&2; exit 1; } +- fi + +- if test "$PHP_DOM" = "no"; then +- { echo "configure: error: XSL extension requires DOM extension, add --enable-dom" 1>&2; exit 1; } +- fi ++else ++ echo "$ac_t""no" 1>&6 - #include -@@ -91442,7 +93440,7 @@ int main(int argc, char** argv) - } +- for i in $PHP_XSL /usr/local /usr; do +- if test -x "$i/bin/xslt-config"; then +- XSLT_CONFIG=$i/bin/xslt-config +- break +- fi +- done ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_multi_setopt ++ ++ ++fi - EOF --if { (eval echo configure:91446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- if test -z "$XSLT_CONFIG"; then +- { echo "configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution" 1>&2; exit 1; } +- else +- libxslt_full_version=`$XSLT_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $libxslt_full_version +- IFS=$ac_IFS +- LIBXSLT_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3` +- if test "$LIBXSLT_VERSION" -ge "1001000"; then +- XSL_LIBS=`$XSLT_CONFIG --libs` +- XSL_INCS=`$XSLT_CONFIG --cflags` +- +- for ac_i in $XSL_LIBS; do ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do + case $ac_i in + -pthread) + if test "$ext_shared" = "yes"; then +- XSL_SHARED_LIBADD="$XSL_SHARED_LIBADD -pthread" ++ LDFLAGS="$LDFLAGS -pthread" + else + - ac_cv_huge_val_inf=yes -@@ -91469,7 +93467,7 @@ EOF - fi +@@ -102172,7 +108366,7 @@ if test "$PHP_XSL" != "no"; then + c|c_r|pthread*) ;; + *) + if test "$ext_shared" = "yes"; then +- XSL_SHARED_LIBADD="$XSL_SHARED_LIBADD -l$ac_ii" ++ LDFLAGS="$LDFLAGS -l$ac_ii" + else + + +@@ -102207,8 +108401,8 @@ if test "$PHP_XSL" != "no"; then - echo $ac_n "checking whether HUGE_VAL + -HUGEVAL == NAN""... $ac_c" 1>&6 --echo "configure:91473: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5 -+echo "configure:93471: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5 - if eval "test \"`echo '$''{'ac_cv_huge_val_nan'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -91480,7 +93478,7 @@ if test "$cross_compiling" = yes; then + + if test "$ext_shared" = "yes"; then +- XSL_SHARED_LIBADD="-L$ai_p $XSL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XSL_SHARED_LIBADD="$ld_runpath_switch$ai_p $XSL_SHARED_LIBADD" ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" + else + + +@@ -102234,22 +108428,128 @@ if test "$PHP_XSL" != "no"; then + esac + done - else - cat > conftest.$ac_ext <&6 ++echo "configure:108433: checking for curl_multi_timeout in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_multi_timeout | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_MULTI_TIMEOUT 1 ++EOF ++ ++ ++else ++ echo "$ac_t""no" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_multi_timeout ++ ++ ++fi ++ ++ ++ ++ if test "$PHP_HTTP_CURL_LIBEVENT" != "no"; then ++ ++ extname=event ++ haveext=$PHP_EVENT ++ ++ echo $ac_n "checking for ext/$extname support""... $ac_c" 1>&6 ++echo "configure:108493: checking for ext/$extname support" >&5 ++ if test -x "$PHP_EXECUTABLE"; then ++ grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$` ++ if test "$grepext" = "$extname"; then ++ HTTP_HAVE_EXT_EVENT=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ echo "configure: warning: event support is incompatible with pecl/event; continuing without libevent support" 1>&2 ++ ++ else ++ HTTP_HAVE_EXT_EVENT= ++ echo "$ac_t""no" 1>&6 ++ ++ echo $ac_n "checking for event.h""... $ac_c" 1>&6 ++echo "configure:108507: checking for event.h" >&5 ++ EVENT_DIR= ++ for i in "$PHP_HTTP_CURL_LIBEVENT" /usr/local /usr /opt; do ++ if test -f "$i/include/event.h"; then ++ EVENT_DIR=$i ++ break ++ fi ++ done ++ if test "x$EVENT_DIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ echo "configure: warning: continuing without libevent support" 1>&2 ++ else ++ echo "$ac_t""found in $EVENT_DIR" 1>&6 ++ ++ echo $ac_n "checking for libevent version, roughly""... $ac_c" 1>&6 ++echo "configure:108522: checking for libevent version, roughly" >&5 ++ EVENT_VER="1.1b or lower" ++ if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then ++ if test -f "$EVENT_DIR/include/evrpc.h"; then ++ EVENT_VER="1.4 or greater" ++ else ++ EVENT_VER="1.2 or greater" ++ fi ++ fi ++ cat >> confdefs.h <&6 ++ ++ echo $ac_n "checking for libcurl version >= 7.16.0""... $ac_c" 1>&6 ++echo "configure:108538: checking for libcurl version >= 7.16.0" >&5 ++ echo "$ac_t""$CURL_VERSION" 1>&6 ++ if test `echo $CURL_VERSION | $SED -e 's/[^0-9]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then ++ echo "configure: warning: libcurl version greater or equal to 7.16.0 required; continuing without libevent support" 1>&2 ++ else ++ ++ if test "$EVENT_DIR/include" != "/usr/include"; then + +- if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then +- ai_p=$ac_ii ++ if test -z "$EVENT_DIR/include" || echo "$EVENT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$EVENT_DIR/include + else + +- ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EVENT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/include\"`" + fi - #include -@@ -91505,7 +93503,7 @@ int main(int argc, char** argv) - } + +@@ -102270,45 +108570,28 @@ if test "$PHP_XSL" != "no"; then - EOF --if { (eval echo configure:91509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:93507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - ac_cv_huge_val_nan=yes -@@ -91532,13 +93530,13 @@ EOF - fi + fi - echo $ac_n "checking whether strptime() declaration fails""... $ac_c" 1>&6 --echo "configure:91536: checking whether strptime() declaration fails" >&5 -+echo "configure:93534: checking whether strptime() declaration fails" >&5 - if eval "test \"`echo '$''{'ac_cv_strptime_decl_fails'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else +- ;; +- esac +- done +- +- +- echo $ac_n "checking for EXSLT support""... $ac_c" 1>&6 +-echo "configure:102280: checking for EXSLT support" >&5 +- for i in $PHP_XSL /usr/local /usr; do +- if test -r "$i/include/libexslt/exslt.h"; then +- PHP_XSL_EXSL_DIR=$i +- break +- fi +- done +- if test -z "$PHP_XSL_EXSL_DIR"; then +- echo "$ac_t""not found" 1>&6 +- else +- echo "$ac_t""found" 1>&6 +- ++ + + if test "$ext_shared" = "yes"; then +- XSL_SHARED_LIBADD="-lexslt $XSL_SHARED_LIBADD" +- if test -n "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR"; then ++ HTTP_SHARED_LIBADD="-levent $HTTP_SHARED_LIBADD" ++ if test -n "$EVENT_DIR/$PHP_LIBDIR"; then + +- if test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" || echo "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_XSL_EXSL_DIR/$PHP_LIBDIR ++ if test -z "$EVENT_DIR/$PHP_LIBDIR" || echo "$EVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EVENT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PHP_XSL_EXSL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- XSL_SHARED_LIBADD="-L$ai_p $XSL_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && XSL_SHARED_LIBADD="$ld_runpath_switch$ai_p $XSL_SHARED_LIBADD" ++ HTTP_SHARED_LIBADD="-L$ai_p $HTTP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && HTTP_SHARED_LIBADD="$ld_runpath_switch$ai_p $HTTP_SHARED_LIBADD" + else + - cat > conftest.$ac_ext < -@@ -91554,7 +93552,7 @@ int strptime(const char *s, const char * +- if test -n "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR"; then ++ if test -n "$EVENT_DIR/$PHP_LIBDIR"; then + +- if test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" || echo "$PHP_XSL_EXSL_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_XSL_EXSL_DIR/$PHP_LIBDIR ++ if test -z "$EVENT_DIR/$PHP_LIBDIR" || echo "$EVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EVENT_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PHP_XSL_EXSL_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $EVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/$PHP_LIBDIR\"`" + fi - ; return 0; } - EOF --if { (eval echo configure:91558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:93556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + +@@ -102371,10 +108654,10 @@ echo "configure:102280: checking for EXS + fi - ac_cv_strptime_decl_fails=no -@@ -91582,17 +93580,17 @@ for ac_hdr in wchar.h - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:91586: checking for $ac_hdr" >&5 -+echo "configure:93584: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:91596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:93594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -91621,12 +93619,12 @@ done - for ac_func in mblen - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:91625: checking for $ac_func" >&5 -+echo "configure:93623: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -91676,12 +93674,12 @@ done - for ac_func in mbrlen mbsinit - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:91680: checking for $ac_func" >&5 -+echo "configure:93678: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:93706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -91729,13 +93727,13 @@ fi - done - echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6 --echo "configure:91733: checking for mbstate_t" >&5 -+echo "configure:93731: checking for mbstate_t" >&5 - if eval "test \"`echo '$''{'ac_cv_type_mbstate_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_EVENT 1 ++EOF ++ ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " ++ ++ save_ext_shared=$ext_shared ++ ext_shared=yes ++ ++ for ac_i in $ac_stuff; do ++ case $ac_i in ++ -pthread) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -pthread" ++ else + +- if test "$PHP_XSL_EXSL_DIR/include" != "/usr/include"; then ++ ++ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "EXTRA_LDFLAGS$unique=set" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i" ++ fi ++ ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ ++ ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac ++ ++ ++ fi ++ ;; ++ esac ++ ++ ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then + +- if test -z "$PHP_XSL_EXSL_DIR/include" || echo "$PHP_XSL_EXSL_DIR/include" | grep '^/' >/dev/null ; then +- ai_p=$PHP_XSL_EXSL_DIR/include ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii + else + +- ep_dir="`echo $PHP_XSL_EXSL_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_XSL_EXSL_DIR/include\"`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" + fi + + ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ - cat > conftest.$ac_ext <> confdefs.h <<\EOF +-#define HAVE_XSL_EXSLT 1 +-EOF - ; return 0; } - EOF --if { (eval echo configure:91752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:93750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - - ac_cv_type_mbstate_t=yes -@@ -91776,17 +93774,17 @@ for ac_hdr in atomic.h - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:91780: checking for $ac_hdr" >&5 -+echo "configure:93778: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:91790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:93788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -92176,7 +94174,7 @@ EOF - php_with_sybase_ct=no + fi +- else +- { echo "configure: error: libxslt version 1.1.0 or greater required." 1>&2; exit 1; } +- fi + +- + fi +- +- cat >> confdefs.h <<\EOF +-#define HAVE_XSL 1 +-EOF +- +- +- ext_builddir=ext/xsl +- ext_srcdir=$abs_srcdir/ext/xsl +- +- ac_extra= +- +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_XSL_SHARED=no +- +- +- case ext/xsl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xsl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xsl/"; ac_bdir="ext/xsl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac +- +- +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in php_xsl.c xsltprocessor.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac - echo $ac_n "checking for Sybase-CT support""... $ac_c" 1>&6 --echo "configure:92180: checking for Sybase-CT support" >&5 -+echo "configure:94178: checking for Sybase-CT support" >&5 - # Check whether --with-sybase-ct or --without-sybase-ct was given. - if test "${with_sybase_ct+set}" = set; then - withval="$with_sybase_ct" -@@ -92828,7 +94826,7 @@ EOF +- cat >>Makefile.objects<&6 --echo "configure:92832: checking for netg_errstr in -lsybtcl64" >&5 -+echo "configure:94830: checking for netg_errstr in -lsybtcl64" >&5 - ac_lib_var=`echo sybtcl64'_'netg_errstr | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -92836,7 +94834,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsybtcl64 $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:94849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -93022,7 +95020,7 @@ fi - done ++ echo $ac_n "checking for curl_multi_socket_action in -lcurl""... $ac_c" 1>&6 ++echo "configure:108772: checking for curl_multi_socket_action in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_multi_socket_action | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" ++LIBS="-lcurl $LIBS" ++cat > conftest.$ac_ext <&6 --echo "configure:93026: checking for insck__getVdate in -linsck64" >&5 -+echo "configure:95024: checking for insck__getVdate in -linsck64" >&5 - ac_lib_var=`echo insck64'_'insck__getVdate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -93030,7 +95028,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck64 $LIBS" - cat > conftest.$ac_ext <>Makefile.objects<&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:95043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -93189,7 +95187,7 @@ fi - done +- done +- +- case $host_alias in +- *netware*) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpxsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(PHPXSL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpxsl.so '$ext_builddir'/phpxsl.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPXSL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(PHPXSL_SHARED_LIBADD)' +- ;; +- esac ++if { (eval echo configure:108791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" - echo $ac_n "checking for bsd_tcp in -linsck64""... $ac_c" 1>&6 --echo "configure:93193: checking for bsd_tcp in -linsck64" >&5 -+echo "configure:95191: checking for bsd_tcp in -linsck64" >&5 - ac_lib_var=`echo insck64'_'bsd_tcp | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -93197,7 +95195,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck64 $LIBS" - cat > conftest.$ac_ext <&6 + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xsl" +- +- cat >>Makefile.objects<> confdefs.h <<\EOF ++#define HAVE_CURL_MULTI_SOCKET_ACTION 1 EOF --if { (eval echo configure:93212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:95210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -93454,7 +95452,7 @@ fi - done - echo $ac_n "checking for netg_errstr in -lsybtcl""... $ac_c" 1>&6 --echo "configure:93458: checking for netg_errstr in -lsybtcl" >&5 -+echo "configure:95456: checking for netg_errstr in -lsybtcl" >&5 - ac_lib_var=`echo sybtcl'_'netg_errstr | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -93462,7 +95460,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-lsybtcl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:95475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -93648,7 +95646,7 @@ fi - done +- ;; +- *) +- +- install_modules="install-modules" +- +- case $host_alias in +- *aix*) +- suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/xsl.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(XSL_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/xsl.so '$ext_builddir'/xsl.so' +- ;; +- *netware*) +- suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(XSL, 3)_SHARED_LIBADD)' +- ;; +- *) +- suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xsl) $(XSL_SHARED_LIBADD)' +- ;; +- esac +- +- if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/xsl.$suffix" +- else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/xsl.$suffix" +- fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xsl" +- +- cat >>Makefile.objects<&6 - echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 --echo "configure:93652: checking for insck__getVdate in -linsck" >&5 -+echo "configure:95650: checking for insck__getVdate in -linsck" >&5 - ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -93656,7 +95654,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:95669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -93815,7 +95813,7 @@ fi - done +- ;; +- esac +- cat >> confdefs.h <&6 --echo "configure:93819: checking for bsd_tcp in -linsck" >&5 -+echo "configure:95817: checking for bsd_tcp in -linsck" >&5 - ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -93823,7 +95821,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:95836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -94080,7 +96078,7 @@ fi - done +- fi ++ fi ++ fi ++ ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ HTTP_HAVE_EXT_EVENT=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ echo "configure: warning: event support is incompatible with pecl/event; continuing without libevent support" 1>&2 ++ ++ else ++ HTTP_HAVE_EXT_EVENT= ++ echo "$ac_t""no" 1>&6 ++ ++ echo $ac_n "checking for event.h""... $ac_c" 1>&6 ++echo "configure:108839: checking for event.h" >&5 ++ EVENT_DIR= ++ for i in "$PHP_HTTP_CURL_LIBEVENT" /usr/local /usr /opt; do ++ if test -f "$i/include/event.h"; then ++ EVENT_DIR=$i ++ break ++ fi ++ done ++ if test "x$EVENT_DIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ echo "configure: warning: continuing without libevent support" 1>&2 ++ else ++ echo "$ac_t""found in $EVENT_DIR" 1>&6 ++ ++ echo $ac_n "checking for libevent version, roughly""... $ac_c" 1>&6 ++echo "configure:108854: checking for libevent version, roughly" >&5 ++ EVENT_VER="1.1b or lower" ++ if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then ++ if test -f "$EVENT_DIR/include/evrpc.h"; then ++ EVENT_VER="1.4 or greater" ++ else ++ EVENT_VER="1.2 or greater" ++ fi ++ fi ++ cat >> confdefs.h <&6 ++ ++ echo $ac_n "checking for libcurl version >= 7.16.0""... $ac_c" 1>&6 ++echo "configure:108870: checking for libcurl version >= 7.16.0" >&5 ++ echo "$ac_t""$CURL_VERSION" 1>&6 ++ if test `echo $CURL_VERSION | $SED -e 's/[^0-9]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then ++ echo "configure: warning: libcurl version greater or equal to 7.16.0 required; continuing without libevent support" 1>&2 ++ else ++ ++ if test "$EVENT_DIR/include" != "/usr/include"; then ++ ++ if test -z "$EVENT_DIR/include" || echo "$EVENT_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$EVENT_DIR/include ++ else ++ ++ ep_dir="`echo $EVENT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/include\"`" + fi - echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6 --echo "configure:94084: checking for netg_errstr in -ltcl" >&5 -+echo "configure:96082: checking for netg_errstr in -ltcl" >&5 - ac_lib_var=`echo tcl'_'netg_errstr | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -94088,7 +96086,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ltcl $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:96101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -94274,7 +96272,7 @@ fi - done +- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_XSL_SHARED=no +- case "$PHP_SAPI" in +- cgi|embed) +- +- +- case ext/xsl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xsl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xsl/"; ac_bdir="ext/xsl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac ++ + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi - echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6 --echo "configure:94278: checking for insck__getVdate in -linsck" >&5 -+echo "configure:96276: checking for insck__getVdate in -linsck" >&5 - ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -94282,7 +96280,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:96295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -94441,7 +96439,7 @@ fi - done +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo ++ fi - echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6 --echo "configure:94445: checking for bsd_tcp in -linsck" >&5 -+echo "configure:96443: checking for bsd_tcp in -linsck" >&5 - ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -94449,7 +96447,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-linsck $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:96462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -94520,7 +96518,7 @@ fi - php_enable_sysvmsg=no ++ - echo $ac_n "checking whether to enable System V IPC support""... $ac_c" 1>&6 --echo "configure:94524: checking whether to enable System V IPC support" >&5 -+echo "configure:96522: checking whether to enable System V IPC support" >&5 - # Check whether --enable-sysvmsg or --disable-sysvmsg was given. - if test "${enable_sysvmsg+set}" = set; then - enableval="$enable_sysvmsg" -@@ -94563,17 +96561,17 @@ echo "$ac_t""$ext_output" 1>&6 - if test "$PHP_SYSVMSG" != "no"; then - ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 --echo "configure:94567: checking for sys/msg.h" >&5 -+echo "configure:96565: checking for sys/msg.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:94577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:96575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -94900,7 +96898,7 @@ fi - php_enable_sysvsem=no +- old_IFS=$IFS +- for ac_src in php_xsl.c xsltprocessor.c; do +- +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS ++ if test "$ext_shared" = "yes"; then ++ HTTP_SHARED_LIBADD="-levent $HTTP_SHARED_LIBADD" ++ if test -n "$EVENT_DIR/$PHP_LIBDIR"; then + +- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects</dev/null ; then ++ ai_p=$EVENT_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $EVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/$PHP_LIBDIR\"`" ++ fi - echo $ac_n "checking whether to enable System V semaphore support""... $ac_c" 1>&6 --echo "configure:94904: checking whether to enable System V semaphore support" >&5 -+echo "configure:96902: checking whether to enable System V semaphore support" >&5 - # Check whether --enable-sysvsem or --disable-sysvsem was given. - if test "${enable_sysvsem+set}" = set; then - enableval="$enable_sysvsem" -@@ -95238,12 +97236,12 @@ EOF - EOF +- EXT_STATIC="$EXT_STATIC xsl" +- ;; +- *) ++ ++ if test "$ext_shared" = "yes"; then ++ HTTP_SHARED_LIBADD="-L$ai_p $HTTP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && HTTP_SHARED_LIBADD="$ld_runpath_switch$ai_p $HTTP_SHARED_LIBADD" ++ else + + +- case ext/xsl in +- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/xsl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/xsl/"; ac_bdir="ext/xsl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; +- esac + ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +- +- b_c_pre=$php_c_pre +- b_cxx_pre=$php_cxx_pre +- b_c_meta=$php_c_meta +- b_cxx_meta=$php_cxx_meta +- b_c_post=$php_c_post +- b_cxx_post=$php_cxx_post +- b_lo=$php_lo +- +- +- old_IFS=$IFS +- for ac_src in php_xsl.c xsltprocessor.c; do ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" + +- IFS=. +- set $ac_src +- ac_obj=$1 +- IFS=$old_IFS +- +- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo" +- +- case $ac_src in +- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; +- esac +- +- cat >>Makefile.objects<&6 --echo "configure:95242: checking for union semun" >&5 -+echo "configure:97240: checking for union semun" >&5 - if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < -@@ -95254,7 +97252,7 @@ int main() { - union semun x; - ; return 0; } - EOF --if { (eval echo configure:95258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:97256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +- ;; +- esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC xsl" ++ fi ++ + fi +- +- +- BUILD_DIR="$BUILD_DIR $ext_builddir" +- + +- +- if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=xsl ++ fi ++ else + +- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" + ++ if test -n "$EVENT_DIR/$PHP_LIBDIR"; then ++ ++ if test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EVENT_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ ++ if test -z "$EVENT_DIR/$PHP_LIBDIR" || echo "$EVENT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$EVENT_DIR/$PHP_LIBDIR ++ else ++ ++ ep_dir="`echo $EVENT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$EVENT_DIR/$PHP_LIBDIR\"`" + fi + ++ ++ + +- PHP_VAR_SUBST="$PHP_VAR_SUBST XSL_SHARED_LIBADD" +- + +- am_i_shared=$PHP_XSL_SHARED +- is_it_shared=$PHP_LIBXML_SHARED +- is_it_enabled=$PHP_LIBXML +- if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then +- { echo "configure: error: +-You've configured extension xsl to build statically, but it +-depends on extension libxml, which you've configured to build shared. +-You either need to build xsl shared or build libxml statically for the +-build to be successful. +-" 1>&2; exit 1; } +- fi +- if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then +- { echo "configure: error: +-You've configured extension xsl, which depends on extension libxml, +-but you've either not enabled libxml, or have disabled it. +-" 1>&2; exit 1; } +- fi ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` + +-fi +- +- +- +-php_enable_zip=no +- +-echo $ac_n "checking for zip archive read/writesupport""... $ac_c" 1>&6 +-echo "configure:102756: checking for zip archive read/writesupport" >&5 +-# Check whether --enable-zip or --disable-zip was given. +-if test "${enable_zip+set}" = set; then +- enableval="$enable_zip" +- PHP_ZIP=$enableval +-else ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" - php_cv_semun=yes -@@ -95290,7 +97288,7 @@ fi - php_enable_sysvshm=no +- PHP_ZIP=no +- test "$PHP_ENABLE_ALL" && PHP_ZIP=$PHP_ENABLE_ALL +- +-fi ++ fi - echo $ac_n "checking whether to enable System V shared memory support""... $ac_c" 1>&6 --echo "configure:95294: checking whether to enable System V shared memory support" >&5 -+echo "configure:97292: checking whether to enable System V shared memory support" >&5 - # Check whether --enable-sysvshm or --disable-sysvshm was given. - if test "${enable_sysvshm+set}" = set; then - enableval="$enable_sysvshm" -@@ -95634,7 +97632,7 @@ fi - php_with_tidy=no - - echo $ac_n "checking for TIDY support""... $ac_c" 1>&6 --echo "configure:95638: checking for TIDY support" >&5 -+echo "configure:97636: checking for TIDY support" >&5 - # Check whether --with-tidy or --without-tidy was given. - if test "${with_tidy+set}" = set; then - withval="$with_tidy" -@@ -95923,7 +97921,7 @@ if test "$PHP_TIDY" != "no"; then - done - echo $ac_n "checking for tidyOptGetDoc in -ltidy""... $ac_c" 1>&6 --echo "configure:95927: checking for tidyOptGetDoc in -ltidy" >&5 -+echo "configure:97925: checking for tidyOptGetDoc in -ltidy" >&5 - ac_lib_var=`echo tidy'_'tidyOptGetDoc | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -95931,7 +97929,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-ltidy $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:97944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -96286,7 +98284,7 @@ fi - php_enable_tokenizer=yes ++ ++ fi + +-ext_output="yes, shared" +-ext_shared=yes +-case $PHP_ZIP in +-shared,*) +- PHP_ZIP=`echo "$PHP_ZIP"|$SED 's/^shared,//'` +- ;; +-shared) +- PHP_ZIP=yes +- ;; +-no) +- ext_output=no +- ext_shared=no +- ;; +-*) +- ext_output=yes +- ext_shared=no +- ;; +-esac ++ fi ++ ++ ++ case event in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="-levent $LIBS" ++ ;; ++ esac - echo $ac_n "checking whether to enable tokenizer support""... $ac_c" 1>&6 --echo "configure:96290: checking whether to enable tokenizer support" >&5 -+echo "configure:98288: checking whether to enable tokenizer support" >&5 - # Check whether --enable-tokenizer or --disable-tokenizer was given. - if test "${enable_tokenizer+set}" = set; then - enableval="$enable_tokenizer" -@@ -96632,7 +98630,7 @@ fi - php_enable_wddx=no - - echo $ac_n "checking whether to enable WDDX support""... $ac_c" 1>&6 --echo "configure:96636: checking whether to enable WDDX support" >&5 -+echo "configure:98634: checking whether to enable WDDX support" >&5 - # Check whether --enable-wddx or --disable-wddx was given. - if test "${enable_wddx+set}" = set; then - enableval="$enable_wddx" -@@ -96677,7 +98675,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:96681: checking libxml2 install dir" >&5 -+echo "configure:98679: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -96701,7 +98699,7 @@ fi - php_with_libexpat_dir=no - echo $ac_n "checking libexpat dir for WDDX""... $ac_c" 1>&6 --echo "configure:96705: checking libexpat dir for WDDX" >&5 -+echo "configure:98703: checking libexpat dir for WDDX" >&5 - # Check whether --with-libexpat-dir or --without-libexpat-dir was given. - if test "${with_libexpat_dir+set}" = set; then - withval="$with_libexpat_dir" -@@ -96729,7 +98727,7 @@ if test "$PHP_WDDX" != "no"; then +-echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:96733: checking for xml2-config path" >&5 -+echo "configure:98731: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -96887,7 +98885,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path ++ fi - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:96891: checking whether libxml build works" >&5 -+echo "configure:98889: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -96903,7 +98901,7 @@ else ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_EVENT 1 ++EOF + +-if test -z "$PHP_ZLIB_DIR"; then ++ ++ save_old_LDFLAGS=$LDFLAGS ++ ac_stuff="$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR ++ " - else - cat > conftest.$ac_ext <&6 +-echo "configure:102801: checking for the location of libz" >&5 +-# Check whether --with-zlib-dir or --without-zlib-dir was given. +-if test "${with_zlib_dir+set}" = set; then +- withval="$with_zlib_dir" +- PHP_ZLIB_DIR=$withval +-else ++ fi ++ ;; ++ -l*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ - EOF --if { (eval echo configure:96918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:98916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- PHP_ZLIB_DIR=no ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="$LDFLAGS -l$ac_ii" ++ else ++ - LIBS=$old_LIBS -@@ -97481,7 +99479,7 @@ fi - php_enable_xml=yes ++ case $ac_ii in ++ c|c_r|pthread*) ;; ++ *) ++ LIBS="$LIBS -l$ac_ii" ++ ;; ++ esac - echo $ac_n "checking whether to enable XML support""... $ac_c" 1>&6 --echo "configure:97485: checking whether to enable XML support" >&5 -+echo "configure:99483: checking whether to enable XML support" >&5 - # Check whether --enable-xml or --disable-xml was given. - if test "${enable_xml+set}" = set; then - enableval="$enable_xml" -@@ -97526,7 +99524,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no +-fi - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:97530: checking libxml2 install dir" >&5 -+echo "configure:99528: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -97550,7 +99548,7 @@ fi - php_with_libexpat_dir=no ++ fi ++ ;; ++ esac - echo $ac_n "checking libexpat install dir""... $ac_c" 1>&6 --echo "configure:97554: checking libexpat install dir" >&5 -+echo "configure:99552: checking libexpat install dir" >&5 - # Check whether --with-libexpat-dir or --without-libexpat-dir was given. - if test "${with_libexpat_dir+set}" = set; then - withval="$with_libexpat_dir" -@@ -97579,7 +99577,7 @@ if test "$PHP_XML" != "no"; then +-ext_output=$PHP_ZLIB_DIR +-echo "$ac_t""$ext_output" 1>&6 - - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:97583: checking for xml2-config path" >&5 -+echo "configure:99581: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -97737,7 +99735,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path ++ ;; ++ -L*) ++ ac_ii=`echo $ac_i|cut -c 3-` ++ ++ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then ++ ++ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then ++ ai_p=$ac_ii ++ else ++ ++ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$ac_ii\"`" ++ fi ++ ++ if test "$ext_shared" = "yes"; then ++ LDFLAGS="-L$ai_p $LDFLAGS" ++ test -n "$ld_runpath_switch" && LDFLAGS="$ld_runpath_switch$ai_p $LDFLAGS" ++ else ++ ++ ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "LIBPATH$unique=set" ++ ++ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" ++ LDFLAGS="$LDFLAGS -L$ai_p" ++ PHP_RPATHS="$PHP_RPATHS $ai_p" ++ ++ fi - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:97741: checking whether libxml build works" >&5 -+echo "configure:99739: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -97753,7 +99751,7 @@ else - +-fi + ++ fi ++ ++ fi + +-php_with_pcre_dir=no ++ ;; ++ esac ++ done + +-echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6 +-echo "configure:102825: checking pcre install prefix" >&5 +-# Check whether --with-pcre-dir or --without-pcre-dir was given. +-if test "${with_pcre_dir+set}" = set; then +- withval="$with_pcre_dir" +- PHP_PCRE_DIR=$withval ++ echo $ac_n "checking for curl_multi_socket_action in -lcurl""... $ac_c" 1>&6 ++echo "configure:109104: checking for curl_multi_socket_action in -lcurl" >&5 ++ac_lib_var=`echo curl'_'curl_multi_socket_action | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:99766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - LIBS=$old_LIBS -@@ -98300,7 +100298,7 @@ fi - php_enable_xmlreader=yes ++int main() { ++curl_multi_socket_action() ++; return 0; } ++EOF ++if { (eval echo configure:109123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" + fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" - echo $ac_n "checking whether to enable XMLReader support""... $ac_c" 1>&6 --echo "configure:98304: checking whether to enable XMLReader support" >&5 -+echo "configure:100302: checking whether to enable XMLReader support" >&5 - # Check whether --enable-xmlreader or --disable-xmlreader was given. - if test "${enable_xmlreader+set}" = set; then - enableval="$enable_xmlreader" -@@ -98345,7 +100343,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ cat >> confdefs.h <<\EOF ++#define HAVE_CURL_MULTI_SOCKET_ACTION 1 ++EOF - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:98349: checking libxml2 install dir" >&5 -+echo "configure:100347: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -98373,7 +100371,7 @@ if test "$PHP_XMLREADER" != "no"; then +-ext_output=$PHP_PCRE_DIR +-echo "$ac_t""$ext_output" 1>&6 +- +- ++ ++else ++ echo "$ac_t""no" 1>&6 - - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:98377: checking for xml2-config path" >&5 -+echo "configure:100375: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -98531,7 +100529,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path ++ LDFLAGS=$save_old_LDFLAGS ++ ext_shared=$save_ext_shared ++ unset ac_cv_lib_curl_curl_multi_socket_action ++ ++ ++fi + +-if test "$PHP_ZIP" != "no"; then ++ fi ++ fi ++ ++ fi ++ ++ fi ++ fi +- if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then +- if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then +- PHP_ZLIB_DIR="$PHP_ZLIB_DIR" +- PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" +- elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then +- PHP_ZLIB_DIR="$PHP_ZLIB_DIR" +- PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" +- else +- { echo "configure: error: Can not find zlib headers under "$PHP_ZLIB_DIR"" 1>&2; exit 1; } +- fi ++ if test "$PHP_HTTP_MAGIC_MIME" != "no"; then ++ echo $ac_n "checking for magic.h""... $ac_c" 1>&6 ++echo "configure:109166: checking for magic.h" >&5 ++ MAGIC_DIR= ++ for i in "$PHP_HTTP_MAGIC_MIME" /usr/local /usr /opt; do ++ if test -f "$i/include/magic.h"; then ++ MAGIC_DIR=$i ++ break ++ fi ++ done ++ if test "x$MAGIC_DIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ { echo "configure: error: could not find magic.h" 1>&2; exit 1; } ++ else ++ echo "$ac_t""found in $MAGIC_DIR" 1>&6 ++ fi ++ ++ ++ if test "$MAGIC_DIR/include" != "/usr/include"; then ++ ++ if test -z "$MAGIC_DIR/include" || echo "$MAGIC_DIR/include" | grep '^/' >/dev/null ; then ++ ai_p=$MAGIC_DIR/include + else +- for i in /usr/local /usr; do +- if test -f "$i/include/zlib/zlib.h"; then +- PHP_ZLIB_DIR="$i" +- PHP_ZLIB_INCDIR="$i/include/zlib" +- elif test -f "$i/include/zlib.h"; then +- PHP_ZLIB_DIR="$i" +- PHP_ZLIB_INCDIR="$i/include" +- fi +- done ++ ++ ep_dir="`echo $MAGIC_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`" ++ ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$MAGIC_DIR/include\"`" + fi - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:98535: checking whether libxml build works" >&5 -+echo "configure:100533: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -98547,7 +100545,7 @@ else +- echo $ac_n "checking for the location of zlib""... $ac_c" 1>&6 +-echo "configure:102869: checking for the location of zlib" >&5 +- if test "$PHP_ZLIB_DIR" = "no"; then +- { echo "configure: error: zip support requires ZLIB. Use --with-zlib-dir= to specify prefix where ZLIB include and library are located" 1>&2; exit 1; } +- else +- echo "$ac_t""$PHP_ZLIB_DIR" 1>&6 + ++ ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi ++ ++ fi ++ ++ + + if test "$ext_shared" = "yes"; then +- ZIP_SHARED_LIBADD="-lz $ZIP_SHARED_LIBADD" +- if test -n "$PHP_ZLIB_DIR/$PHP_LIBDIR"; then ++ HTTP_SHARED_LIBADD="-lmagic $HTTP_SHARED_LIBADD" ++ if test -n "$MAGIC_DIR/$PHP_LIBDIR"; then + +- if test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR/$PHP_LIBDIR" != "/usr/lib"; then ++ if test "$MAGIC_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$MAGIC_DIR/$PHP_LIBDIR" != "/usr/lib"; then + +- if test -z "$PHP_ZLIB_DIR/$PHP_LIBDIR" || echo "$PHP_ZLIB_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ZLIB_DIR/$PHP_LIBDIR ++ if test -z "$MAGIC_DIR/$PHP_LIBDIR" || echo "$MAGIC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MAGIC_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PHP_ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MAGIC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$MAGIC_DIR/$PHP_LIBDIR\"`" + fi + + + if test "$ext_shared" = "yes"; then +- ZIP_SHARED_LIBADD="-L$ai_p $ZIP_SHARED_LIBADD" +- test -n "$ld_runpath_switch" && ZIP_SHARED_LIBADD="$ld_runpath_switch$ai_p $ZIP_SHARED_LIBADD" ++ HTTP_SHARED_LIBADD="-L$ai_p $HTTP_SHARED_LIBADD" ++ test -n "$ld_runpath_switch" && HTTP_SHARED_LIBADD="$ld_runpath_switch$ai_p $HTTP_SHARED_LIBADD" + else + - else - cat > conftest.$ac_ext </dev/null ; then +- ai_p=$PHP_ZLIB_DIR/$PHP_LIBDIR ++ if test -z "$MAGIC_DIR/$PHP_LIBDIR" || echo "$MAGIC_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then ++ ai_p=$MAGIC_DIR/$PHP_LIBDIR + else + +- ep_dir="`echo $PHP_ZLIB_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $MAGIC_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/$PHP_LIBDIR\"`" ++ ai_p="$ep_realdir/`basename \"$MAGIC_DIR/$PHP_LIBDIR\"`" + fi + + +@@ -102954,10 +109292,10 @@ echo "configure:102869: checking for the + fi - EOF --if { (eval echo configure:98562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:100560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - LIBS=$old_LIBS -@@ -98940,7 +100938,7 @@ fi - php_with_xmlrpc=no +- case z in ++ case magic in + c|c_r|pthread*) ;; + *) +- LIBS="-lz $LIBS" ++ LIBS="-lmagic $LIBS" + ;; + esac - echo $ac_n "checking for XMLRPC-EPI support""... $ac_c" 1>&6 --echo "configure:98944: checking for XMLRPC-EPI support" >&5 -+echo "configure:100942: checking for XMLRPC-EPI support" >&5 - # Check whether --with-xmlrpc or --without-xmlrpc was given. - if test "${with_xmlrpc+set}" = set; then - withval="$with_xmlrpc" -@@ -98985,7 +100983,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no +@@ -102967,17 +109305,57 @@ echo "configure:102869: checking for the + fi - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:98989: checking libxml2 install dir" >&5 -+echo "configure:100987: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -99009,7 +101007,7 @@ fi - php_with_libexpat_dir=no - echo $ac_n "checking libexpat dir for XMLRPC-EPI""... $ac_c" 1>&6 --echo "configure:99013: checking libexpat dir for XMLRPC-EPI" >&5 -+echo "configure:101011: checking libexpat dir for XMLRPC-EPI" >&5 - # Check whether --with-libexpat-dir or --without-libexpat-dir was given. - if test "${with_libexpat_dir+set}" = set; then - withval="$with_libexpat_dir" -@@ -99032,7 +101030,7 @@ echo "$ac_t""$ext_output" 1>&6 - php_with_iconv_dir=no - - echo $ac_n "checking iconv dir for XMLRPC-EPI""... $ac_c" 1>&6 --echo "configure:99036: checking iconv dir for XMLRPC-EPI" >&5 -+echo "configure:101034: checking iconv dir for XMLRPC-EPI" >&5 - # Check whether --with-iconv-dir or --without-iconv-dir was given. - if test "${with_iconv_dir+set}" = set; then - withval="$with_iconv_dir" -@@ -99088,7 +101086,7 @@ EOF ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_MAGIC 1 ++EOF ++ ++ fi ++ ++ ++ extname=hash ++ haveext=$PHP_HASH ++ ++ echo $ac_n "checking for ext/$extname support""... $ac_c" 1>&6 ++echo "configure:109320: checking for ext/$extname support" >&5 ++ if test -x "$PHP_EXECUTABLE"; then ++ grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$` ++ if test "$grepext" = "$extname"; then ++ HTTP_HAVE_EXT_HASH=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ echo $ac_n "checking for php_hash.h""... $ac_c" 1>&6 ++echo "configure:109328: checking for php_hash.h" >&5 ++ HTTP_EXT_HASH_INCDIR= ++ for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../hash; do ++ if test -d $i; then ++ if test -f $i/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i ++ break ++ elif test -f $i/ext/hash/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i/ext/hash ++ break ++ fi ++ fi ++ done ++ if test "x$HTTP_EXT_HASH_INCDIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ else ++ echo "$ac_t""$HTTP_EXT_HASH_INCDIR" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_PHP_HASH_H 1 ++EOF ++ ++ ++ if test "$HTTP_EXT_HASH_INCDIR" != "/usr/include"; then + +- if test "$PHP_ZLIB_INCDIR" != "/usr/include"; then +- +- if test -z "$PHP_ZLIB_INCDIR" || echo "$PHP_ZLIB_INCDIR" | grep '^/' >/dev/null ; then +- ai_p=$PHP_ZLIB_INCDIR ++ if test -z "$HTTP_EXT_HASH_INCDIR" || echo "$HTTP_EXT_HASH_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$HTTP_EXT_HASH_INCDIR + else + +- ep_dir="`echo $PHP_ZLIB_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" ++ ep_dir="`echo $HTTP_EXT_HASH_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" + + ep_realdir="`(cd \"$ep_dir\" && pwd)`" +- ai_p="$ep_realdir/`basename \"$PHP_ZLIB_INCDIR\"`" ++ ai_p="$ep_realdir/`basename \"$HTTP_EXT_HASH_INCDIR\"`" + fi - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:99092: checking for xml2-config path" >&5 -+echo "configure:101090: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -99246,7 +101244,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path +@@ -102998,97 +109376,160 @@ echo "configure:102869: checking for the + fi - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:99250: checking whether libxml build works" >&5 -+echo "configure:101248: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -99262,7 +101260,7 @@ else - - else - cat > conftest.$ac_ext < conftest.$ac_ext < +-#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) +-yes +-#endif +- ++ fi ++ ++ else ++ HTTP_HAVE_EXT_HASH= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ HTTP_HAVE_EXT_HASH=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ echo $ac_n "checking for php_hash.h""... $ac_c" 1>&6 ++echo "configure:109392: checking for php_hash.h" >&5 ++ HTTP_EXT_HASH_INCDIR= ++ for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../hash; do ++ if test -d $i; then ++ if test -f $i/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i ++ break ++ elif test -f $i/ext/hash/php_hash.h; then ++ HTTP_EXT_HASH_INCDIR=$i/ext/hash ++ break ++ fi ++ fi ++ done ++ if test "x$HTTP_EXT_HASH_INCDIR" = "x"; then ++ echo "$ac_t""not found" 1>&6 ++ else ++ echo "$ac_t""$HTTP_EXT_HASH_INCDIR" 1>&6 ++ cat >> confdefs.h <<\EOF ++#define HTTP_HAVE_PHP_HASH_H 1 + EOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- egrep "yes" >/dev/null 2>&1; then +- rm -rf conftest* +- +- PHP_PCRE_REGEX=yes +- +-else +- rm -rf conftest* +- +- cat > conftest.$ac_ext < +-#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE) +-yes +-#endif ++ ++ if test "$HTTP_EXT_HASH_INCDIR" != "/usr/include"; then -@@ -99273,7 +101271,7 @@ else - } - - EOF --if { (eval echo configure:99277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:101275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - - LIBS=$old_LIBS -@@ -99542,12 +101540,12 @@ EOF - - if test "$PHP_ICONV" = "yes"; then - echo $ac_n "checking for iconv""... $ac_c" 1>&6 --echo "configure:99546: checking for iconv" >&5 -+echo "configure:101544: checking for iconv" >&5 - if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5 | +- egrep "yes" >/dev/null 2>&1; then +- rm -rf conftest* +- +- PHP_PCRE_REGEX=pecl ++ if test -z "$HTTP_EXT_HASH_INCDIR" || echo "$HTTP_EXT_HASH_INCDIR" | grep '^/' >/dev/null ; then ++ ai_p=$HTTP_EXT_HASH_INCDIR ++ else + +-else +- rm -rf conftest* +- +- PHP_PCRE_REGEX=no ++ ep_dir="`echo $HTTP_EXT_HASH_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`" + +-fi +-rm -f conftest* ++ ep_realdir="`(cd \"$ep_dir\" && pwd)`" ++ ai_p="$ep_realdir/`basename \"$HTTP_EXT_HASH_INCDIR\"`" ++ fi - ; return 0; } - EOF --if { (eval echo configure:99574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:101572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_iconv=yes" - else -@@ -99591,12 +101589,12 @@ else - echo "$ac_t""no" 1>&6 ++ + +-fi +-rm -f conftest* ++ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'` ++ ++ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INCLUDEPATH$unique=set" ++ ++ if test ""; then ++ INCLUDES="-I$ai_p $INCLUDES" ++ else ++ INCLUDES="$INCLUDES -I$ai_p" ++ fi ++ ++ fi - echo $ac_n "checking for libiconv""... $ac_c" 1>&6 --echo "configure:99595: checking for libiconv" >&5 -+echo "configure:101593: checking for libiconv" >&5 - if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:101621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_libiconv=yes" - else -@@ -99775,7 +101773,7 @@ EOF - done +- PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ +- lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \ +- lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \ +- lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \ +- lib/zip_source_free.c lib/zip_unchange_all.c lib/zip_delete.c \ +- lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \ +- lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \ +- lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \ +- lib/zip_filerange_crc.c lib/zip_file_strerror.c lib/zip_get_num_files.c \ +- lib/zip_get_archive_flag.c lib/zip_set_archive_flag.c \ +- lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \ +- lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \ +- lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \ +- lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \ +- lib/zip_get_archive_comment.c lib/zip_get_file_comment.c \ +- lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ +- lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ +- lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ +- lib/zip_error_clear.c lib/zip_file_error_clear.c" ++ fi ++ ++ else ++ HTTP_HAVE_EXT_HASH= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ - echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6 --echo "configure:99779: checking for libiconv in -l$iconv_lib_name" >&5 -+echo "configure:101777: checking for libiconv in -l$iconv_lib_name" >&5 - ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -99783,7 +101781,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$iconv_lib_name $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:101796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -99935,7 +101933,7 @@ else - done +- cat >> confdefs.h <<\EOF +-#define HAVE_ZIP 1 +-EOF ++ ++ extname=iconv ++ haveext=$PHP_ICONV ++ ++ echo $ac_n "checking for ext/$extname support""... $ac_c" 1>&6 ++echo "configure:109458: checking for ext/$extname support" >&5 ++ if test -x "$PHP_EXECUTABLE"; then ++ grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$` ++ if test "$grepext" = "$extname"; then ++ HTTP_HAVE_EXT_ICONV=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ else ++ HTTP_HAVE_EXT_ICONV= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ HTTP_HAVE_EXT_ICONV=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ else ++ HTTP_HAVE_EXT_ICONV= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ - echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6 --echo "configure:99939: checking for iconv in -l$iconv_lib_name" >&5 -+echo "configure:101937: checking for iconv in -l$iconv_lib_name" >&5 - ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -99943,7 +101941,7 @@ else - ac_save_LIBS="$LIBS" - LIBS="-l$iconv_lib_name $LIBS" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:101956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" - else -@@ -100144,7 +102142,7 @@ if test "$PHP_XMLRPC" = "yes"; then - # Extract the first word of "ranlib", so it can be a program name with args. - set dummy ranlib; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:100148: checking for $ac_word" >&5 -+echo "configure:102146: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -100172,21 +102170,21 @@ else - fi +- +- ext_builddir=ext/zip +- ext_srcdir=$abs_srcdir/ext/zip ++ ++ extname=session ++ haveext=$PHP_SESSION ++ ++ echo $ac_n "checking for ext/$extname support""... $ac_c" 1>&6 ++echo "configure:109486: checking for ext/$extname support" >&5 ++ if test -x "$PHP_EXECUTABLE"; then ++ grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$` ++ if test "$grepext" = "$extname"; then ++ HTTP_HAVE_EXT_SESSION=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ else ++ HTTP_HAVE_EXT_SESSION= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ elif test "$haveext" != "no" && test "x$haveext" != "x"; then ++ HTTP_HAVE_EXT_SESSION=1 ++ echo "$ac_t""yes" 1>&6 ++ ++ else ++ HTTP_HAVE_EXT_SESSION= ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ ++ ++ PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \ ++ http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \ ++ http_response_object.c http_exception_object.c http_requestpool_object.c \ ++ http_api.c http_cache_api.c http_request_api.c http_request_info.c http_date_api.c \ ++ http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \ ++ http_info_api.c http_request_method_api.c http_encoding_api.c \ ++ http_filter_api.c http_request_body_api.c http_querystring_object.c \ ++ http_deflatestream_object.c http_inflatestream_object.c http_cookie_api.c \ ++ http_querystring_api.c http_request_datashare_api.c http_requestdatashare_object.c \ ++ http_persistent_handle_api.c" ++ ++ ++ ext_builddir=ext/http ++ ext_srcdir=$abs_srcdir/ext/http - echo $ac_n "checking for inline""... $ac_c" 1>&6 --echo "configure:100176: checking for inline" >&5 -+echo "configure:102174: checking for inline" >&5 - if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_cv_c_inline=no - for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:102188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_inline=$ac_kw; break - else -@@ -100224,12 +102222,12 @@ EOF + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then +- PHP_ZIP_SHARED=no ++ PHP_HTTP_SHARED=no + + +- case ext/zip in ++ case ext/http in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/http"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/http/"; ac_bdir="ext/http/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -103103,7 +109544,7 @@ EOF - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 --echo "configure:100228: checking for ANSI C header files" >&5 -+echo "configure:102226: checking for ANSI C header files" >&5 - if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #include -@@ -100237,7 +102235,7 @@ else - #include - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:100241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:102239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -100254,7 +102252,7 @@ rm -f conftest* - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -100272,7 +102270,7 @@ fi - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -100293,7 +102291,7 @@ if test "$cross_compiling" = yes; then - : - else - cat > conftest.$ac_ext < - #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -@@ -100304,7 +102302,7 @@ if (XOR (islower (i), ISLOWER (i)) || to - exit (0); } + old_IFS=$IFS +- for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do ++ for ac_src in $PHP_HTTP_SOURCES; do + + IFS=. + set $ac_src +@@ -103126,18 +109567,18 @@ EOF + done - EOF --if { (eval echo configure:100308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:102306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - : - else -@@ -100331,17 +102329,17 @@ for ac_hdr in xmlparse.h xmltok.h stdlib - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --echo "configure:100335: checking for $ac_hdr" >&5 -+echo "configure:102333: checking for $ac_hdr" >&5 - if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:100345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:102343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -100373,7 +102371,7 @@ done +- EXT_STATIC="$EXT_STATIC zip" ++ EXT_STATIC="$EXT_STATIC http" + if test "$ext_shared" != "nocli"; then +- EXT_CLI_STATIC="$EXT_CLI_STATIC zip" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC http" + fi + else + if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then +- PHP_ZIP_SHARED=yes ++ PHP_HTTP_SHARED=yes + +- case ext/zip in ++ case ext/http in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/http"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/http/"; ac_bdir="ext/http/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -103152,14 +109593,14 @@ EOF - echo $ac_n "checking size of char""... $ac_c" 1>&6 --echo "configure:100377: checking size of char" >&5 -+echo "configure:102375: checking size of char" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -100381,18 +102379,19 @@ else - ac_cv_sizeof_char=1 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(char)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:100396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:102395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_char=`cat conftestval` - else -@@ -100413,7 +102412,7 @@ EOF + old_IFS=$IFS +- for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do ++ for ac_src in $PHP_HTTP_SOURCES; do + + IFS=. + set $ac_src + ac_obj=$1 + IFS=$old_IFS + +- shared_objects_zip="$shared_objects_zip $ac_bdir$ac_obj.lo" ++ shared_objects_http="$shared_objects_http $ac_bdir$ac_obj.lo" - echo $ac_n "checking size of int""... $ac_c" 1>&6 --echo "configure:100417: checking size of int" >&5 -+echo "configure:102416: checking size of int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -100421,18 +102420,19 @@ else - ac_cv_sizeof_int=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(int)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:100436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:102436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_int=`cat conftestval` - else -@@ -100452,7 +102452,7 @@ EOF + case $ac_src in + *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; +@@ -103182,31 +109623,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpzip.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpzip.so '$ext_builddir'/phpzip.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phphttp.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) $(PHPHTTP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phphttp.so '$ext_builddir'/phphttp.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPZIP, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPHTTP, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) $(PHPHTTP_SHARED_LIBADD)' + ;; + esac + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phpzip.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/phphttp.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpzip.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phphttp.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_http" - echo $ac_n "checking size of long""... $ac_c" 1>&6 --echo "configure:100456: checking size of long" >&5 -+echo "configure:102456: checking size of long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -100460,18 +102460,19 @@ else - ac_cv_sizeof_long=4 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long)); -- return(0); -+ exit(0); - } - EOF --if { (eval echo configure:100475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:102476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_long=`cat conftestval` - else -@@ -100491,7 +102492,7 @@ EOF + cat >>Makefile.objects<&6 --echo "configure:100495: checking size of long long" >&5 -+echo "configure:102496: checking size of long long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -100499,18 +102500,19 @@ else - ac_cv_sizeof_long_long=8 - else - cat > conftest.$ac_ext < --int main() -+#include -+main() - { - FILE *f=fopen("conftestval", "w"); -- if (!f) return(1); -+ if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long long)); -- return(0); -+ exit(0); - } EOF --if { (eval echo configure:100514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:102516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_sizeof_long_long=`cat conftestval` - else -@@ -100530,12 +102532,12 @@ EOF +@@ -103219,31 +109660,31 @@ EOF + case $host_alias in + *aix*) + suffix=so +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/zip.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/zip.so '$ext_builddir'/zip.so' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/http.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) $(HTTP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/http.so '$ext_builddir'/http.so' + ;; + *netware*) + suffix=nlm +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(ZIP, 3)_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(HTTP, 3)_SHARED_LIBADD)' + ;; + *) + suffix=la +- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD)' ++ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_http) $(HTTP_SHARED_LIBADD)' + ;; + esac + if test "x" = "xyes"; then +- PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/zip.$suffix" ++ PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/http.$suffix" + else +- PHP_MODULES="$PHP_MODULES \$(phplibdir)/zip.$suffix" ++ PHP_MODULES="$PHP_MODULES \$(phplibdir)/http.$suffix" + fi + +- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip" ++ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_http" - echo $ac_n "checking for size_t""... $ac_c" 1>&6 --echo "configure:100534: checking for size_t" >&5 -+echo "configure:102536: checking for size_t" >&5 - if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #if STDC_HEADERS -@@ -100563,12 +102565,12 @@ EOF - fi + cat >>Makefile.objects<&6 --echo "configure:100567: checking whether time.h and sys/time.h may both be included" >&5 -+echo "configure:102569: checking whether time.h and sys/time.h may both be included" >&5 - if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #include -@@ -100577,7 +102579,7 @@ int main() { - struct tm *tp; - ; return 0; } - EOF --if { (eval echo configure:100581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:102583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes - else -@@ -100598,12 +102600,12 @@ EOF - fi +-$ext_builddir/zip.$suffix: \$(shared_objects_zip) \$(ZIP_SHARED_DEPENDENCIES) ++$ext_builddir/http.$suffix: \$(shared_objects_http) \$(HTTP_SHARED_DEPENDENCIES) + $link_cmd - echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 --echo "configure:100602: checking for uid_t in sys/types.h" >&5 -+echo "configure:102604: checking for uid_t in sys/types.h" >&5 - if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < EOF -@@ -100643,12 +102645,12 @@ for ac_func in \ - memcpy memmove - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:100647: checking for $ac_func" >&5 -+echo "configure:102649: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <> confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:102677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -101025,7 +103027,7 @@ elif test "$PHP_XMLRPC" != "no"; then - XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi - else - echo $ac_n "checking for XMLRPC-EPI in default path""... $ac_c" 1>&6 --echo "configure:101029: checking for XMLRPC-EPI in default path" >&5 -+echo "configure:103031: checking for XMLRPC-EPI in default path" >&5 - for i in /usr/local /usr; do - if test -r $i/include/xmlrpc.h; then - XMLRPC_DIR=$i/include -@@ -101468,7 +103470,7 @@ fi - php_enable_xmlwriter=yes - - echo $ac_n "checking whether to enable XMLWriter support""... $ac_c" 1>&6 --echo "configure:101472: checking whether to enable XMLWriter support" >&5 -+echo "configure:103474: checking whether to enable XMLWriter support" >&5 - # Check whether --enable-xmlwriter or --disable-xmlwriter was given. - if test "${enable_xmlwriter+set}" = set; then - enableval="$enable_xmlwriter" -@@ -101513,7 +103515,7 @@ if test -z "$PHP_LIBXML_DIR"; then - php_with_libxml_dir=no - echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6 --echo "configure:101517: checking libxml2 install dir" >&5 -+echo "configure:103519: checking libxml2 install dir" >&5 - # Check whether --with-libxml-dir or --without-libxml-dir was given. - if test "${with_libxml_dir+set}" = set; then - withval="$with_libxml_dir" -@@ -101541,7 +103543,7 @@ if test "$PHP_XMLWRITER" != "no"; then + fi + fi + if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then +- PHP_ZIP_SHARED=no ++ PHP_HTTP_SHARED=no + case "$PHP_SAPI" in + cgi|embed) + - echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6 --echo "configure:101545: checking for xml2-config path" >&5 -+echo "configure:103547: checking for xml2-config path" >&5 - if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -101699,7 +103701,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path +- case ext/zip in ++ case ext/http in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/http"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/http/"; ac_bdir="ext/http/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac + + +@@ -103281,7 +109722,7 @@ EOF - echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6 --echo "configure:101703: checking whether libxml build works" >&5 -+echo "configure:103705: checking whether libxml build works" >&5 - if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -101715,7 +103717,7 @@ else + old_IFS=$IFS +- for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do ++ for ac_src in $PHP_HTTP_SOURCES; do - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:103732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then +- case ext/zip in ++ case ext/http in + "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; +- /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; +- *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; ++ /*) ac_srcdir=`echo "ext/http"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; ++ *) ac_srcdir="$abs_srcdir/ext/http/"; ac_bdir="ext/http/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; + esac - LIBS=$old_LIBS -@@ -102076,7 +104078,7 @@ fi - php_with_xsl=no + +@@ -103327,7 +109768,7 @@ EOF - echo $ac_n "checking for XSL support""... $ac_c" 1>&6 --echo "configure:102080: checking for XSL support" >&5 -+echo "configure:104082: checking for XSL support" >&5 - # Check whether --with-xsl or --without-xsl was given. - if test "${with_xsl+set}" = set; then - withval="$with_xsl" -@@ -102276,7 +104278,7 @@ if test "$PHP_XSL" != "no"; then - - echo $ac_n "checking for EXSLT support""... $ac_c" 1>&6 --echo "configure:102280: checking for EXSLT support" >&5 -+echo "configure:104282: checking for EXSLT support" >&5 - for i in $PHP_XSL /usr/local /usr; do - if test -r "$i/include/libexslt/exslt.h"; then - PHP_XSL_EXSL_DIR=$i -@@ -102752,7 +104754,7 @@ fi - php_enable_zip=no - - echo $ac_n "checking for zip archive read/writesupport""... $ac_c" 1>&6 --echo "configure:102756: checking for zip archive read/writesupport" >&5 -+echo "configure:104758: checking for zip archive read/writesupport" >&5 - # Check whether --enable-zip or --disable-zip was given. - if test "${enable_zip+set}" = set; then - enableval="$enable_zip" -@@ -102797,7 +104799,7 @@ if test -z "$PHP_ZLIB_DIR"; then - php_with_zlib_dir=no + old_IFS=$IFS +- for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do ++ for ac_src in $PHP_HTTP_SOURCES; do + + IFS=. + set $ac_src +@@ -103352,7 +109793,7 @@ EOF - echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 --echo "configure:102801: checking for the location of libz" >&5 -+echo "configure:104803: checking for the location of libz" >&5 - # Check whether --with-zlib-dir or --without-zlib-dir was given. - if test "${with_zlib_dir+set}" = set; then - withval="$with_zlib_dir" -@@ -102821,7 +104823,7 @@ fi - php_with_pcre_dir=no + ;; + esac +- EXT_CLI_STATIC="$EXT_CLI_STATIC zip" ++ EXT_CLI_STATIC="$EXT_CLI_STATIC http" + fi + + +@@ -103361,26 +109802,172 @@ EOF + + + if test "$ext_builddir" = "."; then +- PHP_PECL_EXTENSION=zip ++ PHP_PECL_EXTENSION=http + + PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION" - echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6 --echo "configure:102825: checking pcre install prefix" >&5 -+echo "configure:104827: checking pcre install prefix" >&5 - # Check whether --with-pcre-dir or --without-pcre-dir was given. - if test "${with_pcre_dir+set}" = set; then - withval="$with_pcre_dir" -@@ -102865,7 +104867,7 @@ if test "$PHP_ZIP" != "no"; then fi - echo $ac_n "checking for the location of zlib""... $ac_c" 1>&6 --echo "configure:102869: checking for the location of zlib" >&5 -+echo "configure:104871: checking for the location of zlib" >&5 - if test "$PHP_ZLIB_DIR" = "no"; then - { echo "configure: error: zip support requires ZLIB. Use --with-zlib-dir= to specify prefix where ZLIB include and library are located" 1>&2; exit 1; } - else -@@ -103003,7 +105005,7 @@ echo "configure:102869: checking for the - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$INCLUDES - cat > conftest.$ac_ext <&6 ++echo "configure:109818: checking whether to add a dependency on ext/$extname" >&5 ++ if test "$PHP_HTTP_SHARED_DEPS" = "no"; then ++ echo "$ac_t""no" 1>&6 ++ ++ elif test "$haveext"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ am_i_shared=$PHP_HTTP_SHARED ++ is_it_shared=$PHP_HASH_SHARED ++ is_it_enabled=$PHP_HASH ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension http to build statically, but it ++depends on extension hash, which you've configured to build shared. ++You either need to build http shared or build hash statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension http, which depends on extension hash, ++but you've either not enabled hash, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ ++ ++ extname=iconv ++ haveext=$HTTP_HAVE_EXT_ICONV ++ ++ echo $ac_n "checking whether to add a dependency on ext/$extname""... $ac_c" 1>&6 ++echo "configure:109856: checking whether to add a dependency on ext/$extname" >&5 ++ if test "$PHP_HTTP_SHARED_DEPS" = "no"; then ++ echo "$ac_t""no" 1>&6 ++ ++ elif test "$haveext"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ am_i_shared=$PHP_HTTP_SHARED ++ is_it_shared=$PHP_ICONV_SHARED ++ is_it_enabled=$PHP_ICONV ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension http to build statically, but it ++depends on extension iconv, which you've configured to build shared. ++You either need to build http shared or build iconv statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension http, which depends on extension iconv, ++but you've either not enabled iconv, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ ++ ++ extname=session ++ haveext=$HTTP_HAVE_EXT_SESSION ++ ++ echo $ac_n "checking whether to add a dependency on ext/$extname""... $ac_c" 1>&6 ++echo "configure:109894: checking whether to add a dependency on ext/$extname" >&5 ++ if test "$PHP_HTTP_SHARED_DEPS" = "no"; then ++ echo "$ac_t""no" 1>&6 ++ ++ elif test "$haveext"; then ++ echo "$ac_t""yes" 1>&6 ++ ++ ++ am_i_shared=$PHP_HTTP_SHARED ++ is_it_shared=$PHP_SESSION_SHARED ++ is_it_enabled=$PHP_SESSION ++ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then ++ { echo "configure: error: ++You've configured extension http to build statically, but it ++depends on extension session, which you've configured to build shared. ++You either need to build http shared or build session statically for the ++build to be successful. ++" 1>&2; exit 1; } ++ fi ++ if test "x$is_it_enabled" = "xno" && test "xtrue" != "xtrue"; then ++ { echo "configure: error: ++You've configured extension http, which depends on extension session, ++but you've either not enabled session, or have disabled it. ++" 1>&2; exit 1; } ++ fi ++ ++ ++ ++ else ++ echo "$ac_t""no" 1>&6 ++ ++ fi ++ ++ ++ ++ ++ $php_shtool mkdir -p $ext_builddir/phpstr ++ ++ ++ ++ PHP_VAR_SUBST="$PHP_VAR_SUBST HTTP_SHARED_LIBADD" ++ ++ ++ PHP_HTTP_HEADERS="php_http_std_defs.h php_http.h php_http_api.h php_http_cache_api.h \ ++ php_http_date_api.h php_http_headers_api.h php_http_info_api.h php_http_message_api.h \ ++ php_http_request_api.h php_http_request_method_api.h php_http_send_api.h php_http_url_api.h \ ++ php_http_encoding_api.h phpstr/phpstr.h missing.h php_http_request_body_api.h \ ++ php_http_exception_object.h php_http_message_object.h php_http_request_object.h \ ++ php_http_requestpool_object.h php_http_response_object.h php_http_util_object.h \ ++ php_http_querystring_object.h php_http_deflatestream_object.h php_http_inflatestream_object.h \ ++ php_http_cookie_api.h php_http_querystring_api.h php_http_request_datashare_api.h php_http_requestdatashare_object.h \ ++ php_http_persistent_handle_api.h" ++ ++ + ++ header_path=ext/http ++ for header_file in $PHP_HTTP_HEADERS; do ++ hp_hf="$header_path/$header_file" ++ + +- $php_shtool mkdir -p $ext_builddir/lib ++ unique=`echo $hp_hf|$SED 's/[^a-zA-Z0-9]/_/g'` + ++ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" ++ if test -n "$unique" && test "`eval $cmd`" = "" ; then ++ eval "INSTALLHEADERS$unique=set" ++ ++ INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ++ ++ fi - #include
-@@ -103022,7 +105024,7 @@ else - rm -rf conftest* ++ done - cat > conftest.$ac_ext < -@@ -103390,7 +105392,7 @@ fi ++ + +- +- src=$ext_srcdir/Makefile.frag +- ac_srcdir=$ext_srcdir +- ac_builddir=$ext_builddir +- test -f "$src" && $SED -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments ++ cat >> confdefs.h <<\EOF ++#define HAVE_HTTP 1 ++EOF + + fi + +@@ -103390,7 +109977,7 @@ fi php_enable_disable_mysqlnd_compression_support=yes echo $ac_n "checking whether to disable compressed protocol support in mysqlnd""... $ac_c" 1>&6 -echo "configure:103394: checking whether to disable compressed protocol support in mysqlnd" >&5 -+echo "configure:105396: checking whether to disable compressed protocol support in mysqlnd" >&5 ++echo "configure:109981: checking whether to disable compressed protocol support in mysqlnd" >&5 # Check whether --enable-disable_mysqlnd_compression_support or --disable-disable_mysqlnd_compression_support was given. if test "${enable_disable_mysqlnd_compression_support+set}" = set; then enableval="$enable_disable_mysqlnd_compression_support" -@@ -103435,7 +105437,7 @@ if test -z "$PHP_ZLIB_DIR"; then +@@ -103435,7 +110022,7 @@ if test -z "$PHP_ZLIB_DIR"; then php_with_zlib_dir=no echo $ac_n "checking for the location of libz""... $ac_c" 1>&6 -echo "configure:103439: checking for the location of libz" >&5 -+echo "configure:105441: checking for the location of libz" >&5 ++echo "configure:110026: checking for the location of libz" >&5 # Check whether --with-zlib-dir or --without-zlib-dir was given. if test "${with_zlib_dir+set}" = set; then withval="$with_zlib_dir" -@@ -103901,7 +105903,7 @@ if test "$PHP_MYSQLND_ENABLED" = "yes" | +@@ -103901,7 +110488,7 @@ if test "$PHP_MYSQLND_ENABLED" = "yes" | for php_typename in int8 uint8 int16 uint16 int32 uint32 uchar ulong int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t; do echo $ac_n "checking whether $php_typename exists""... $ac_c" 1>&6 -echo "configure:103905: checking whether $php_typename exists" >&5 -+echo "configure:105907: checking whether $php_typename exists" >&5 ++echo "configure:110492: checking whether $php_typename exists" >&5 php_cache_value=php_cv_sizeof_$php_typename if eval "test \"`echo '$''{'php_cv_sizeof_$php_typename'+set}'`\" = set"; then -@@ -103918,7 +105920,7 @@ else +@@ -103918,7 +110505,7 @@ else else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -103948,7 +105950,7 @@ int main() +@@ -103948,7 +110535,7 @@ int main() } EOF -if { (eval echo configure:103952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:105954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:110539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then eval $php_cache_value=`cat conftestval` -@@ -104088,7 +106090,7 @@ if test "$PHP_RECODE" != "no"; then +@@ -104088,7 +110675,7 @@ if test "$PHP_RECODE" != "no"; then done echo $ac_n "checking for hash_insert in -l$MYSQL_LIBNAME""... $ac_c" 1>&6 -echo "configure:104092: checking for hash_insert in -l$MYSQL_LIBNAME" >&5 -+echo "configure:106094: checking for hash_insert in -l$MYSQL_LIBNAME" >&5 ++echo "configure:110679: checking for hash_insert in -l$MYSQL_LIBNAME" >&5 ac_lib_var=`echo $MYSQL_LIBNAME'_'hash_insert | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -104096,7 +106098,7 @@ else +@@ -104096,7 +110683,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$MYSQL_LIBNAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:110698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -104209,7 +106211,7 @@ fi +@@ -104209,7 +110796,7 @@ fi php_with_pear=DEFAULT echo $ac_n "checking whether to install PEAR""... $ac_c" 1>&6 -echo "configure:104213: checking whether to install PEAR" >&5 -+echo "configure:106215: checking whether to install PEAR" >&5 ++echo "configure:110800: checking whether to install PEAR" >&5 # Check whether --with-pear or --without-pear was given. if test "${with_pear+set}" = set; then withval="$with_pear" -@@ -104311,7 +106313,7 @@ fi +@@ -104311,7 +110898,7 @@ fi bison_version=none if test "$YACC"; then echo $ac_n "checking for bison version""... $ac_c" 1>&6 -echo "configure:104315: checking for bison version" >&5 -+echo "configure:106317: checking for bison version" >&5 ++echo "configure:110902: checking for bison version" >&5 if eval "test \"`echo '$''{'php_cv_bison_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -104367,17 +106369,17 @@ dlfcn.h +@@ -104367,17 +110954,17 @@ dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:104371: checking for $ac_hdr" >&5 -+echo "configure:106373: checking for $ac_hdr" >&5 ++echo "configure:110958: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:104381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:106383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:110968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -104405,12 +106407,12 @@ done +@@ -104405,12 +110992,12 @@ done echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:104409: checking for size_t" >&5 -+echo "configure:106411: checking for size_t" >&5 ++echo "configure:110996: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -104438,12 +106440,12 @@ EOF +@@ -104438,12 +111025,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:104442: checking return type of signal handlers" >&5 -+echo "configure:106444: checking return type of signal handlers" >&5 ++echo "configure:111029: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -@@ -104460,7 +106462,7 @@ int main() { +@@ -104460,7 +111047,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:104464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:106466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:111051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else -@@ -104484,12 +106486,12 @@ EOF +@@ -104484,12 +111071,12 @@ EOF echo $ac_n "checking for uint""... $ac_c" 1>&6 -echo "configure:104488: checking for uint" >&5 -+echo "configure:106490: checking for uint" >&5 ++echo "configure:111075: checking for uint" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -104517,12 +106519,12 @@ EOF +@@ -104517,12 +111104,12 @@ EOF fi echo $ac_n "checking for ulong""... $ac_c" 1>&6 -echo "configure:104521: checking for ulong" >&5 -+echo "configure:106523: checking for ulong" >&5 ++echo "configure:111108: checking for ulong" >&5 if eval "test \"`echo '$''{'ac_cv_type_ulong'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS -@@ -104552,9 +106554,9 @@ fi +@@ -104552,9 +111139,9 @@ fi echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:104556: checking for int32_t" >&5 -+echo "configure:106558: checking for int32_t" >&5 ++echo "configure:111143: checking for int32_t" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:106579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:111164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <&6 -echo "configure:104596: checking for uint32_t" >&5 -+echo "configure:106598: checking for uint32_t" >&5 ++echo "configure:111183: checking for uint32_t" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:106619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:111204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <&6 -echo "configure:104636: checking for vprintf" >&5 -+echo "configure:106638: checking for vprintf" >&5 ++echo "configure:111223: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else -@@ -104684,12 +106686,12 @@ fi +@@ -104684,12 +111271,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:104688: checking for _doprnt" >&5 -+echo "configure:106690: checking for _doprnt" >&5 ++echo "configure:111275: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else -@@ -104737,7 +106739,7 @@ fi +@@ -104737,7 +111324,7 @@ fi fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:104741: checking for 8-bit clean memcmp" >&5 -+echo "configure:106743: checking for 8-bit clean memcmp" >&5 ++echo "configure:111328: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -104745,7 +106747,7 @@ else +@@ -104745,7 +111332,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:106761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:111346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else -@@ -104775,19 +106777,19 @@ test $ac_cv_func_memcmp_clean = no && LI +@@ -104775,19 +111362,19 @@ test $ac_cv_func_memcmp_clean = no && LI # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:104779: checking for working alloca.h" >&5 -+echo "configure:106781: checking for working alloca.h" >&5 ++echo "configure:111366: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -19680,355 +89938,355 @@ ; return 0; } EOF -if { (eval echo configure:104791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else -@@ -104808,12 +106810,12 @@ EOF +@@ -104808,12 +111395,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:104812: checking for alloca" >&5 -+echo "configure:106814: checking for alloca" >&5 ++echo "configure:111399: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else -@@ -104873,12 +106875,12 @@ EOF +@@ -104873,12 +111460,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:104877: checking whether alloca needs Cray hooks" >&5 -+echo "configure:106879: checking whether alloca needs Cray hooks" >&5 ++echo "configure:111464: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 +@@ -104903,12 +111490,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:104907: checking for $ac_func" >&5 -+echo "configure:106909: checking for $ac_func" >&5 ++echo "configure:111494: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:106937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -104958,7 +106960,7 @@ done +@@ -104958,7 +111545,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:104962: checking stack direction for C alloca" >&5 -+echo "configure:106964: checking stack direction for C alloca" >&5 ++echo "configure:111549: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -104966,7 +106968,7 @@ else +@@ -104966,7 +111553,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:106991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:111576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else -@@ -105009,12 +107011,12 @@ fi +@@ -105009,12 +111596,12 @@ fi for ac_func in memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:105013: checking for $ac_func" >&5 -+echo "configure:107015: checking for $ac_func" >&5 ++echo "configure:111600: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -105063,7 +107065,7 @@ done +@@ -105063,7 +111650,7 @@ done echo $ac_n "checking whether sprintf is broken""... $ac_c" 1>&6 -echo "configure:105067: checking whether sprintf is broken" >&5 -+echo "configure:107069: checking whether sprintf is broken" >&5 ++echo "configure:111654: checking whether sprintf is broken" >&5 if eval "test \"`echo '$''{'ac_cv_broken_sprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -105074,11 +107076,11 @@ else +@@ -105074,11 +111661,11 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:107084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:111669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_sprintf=no -@@ -105112,12 +107114,12 @@ EOF +@@ -105112,12 +111699,12 @@ EOF for ac_func in finite isfinite isinf isnan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:105116: checking for $ac_func" >&5 -+echo "configure:107118: checking for $ac_func" >&5 ++echo "configure:111703: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -105167,13 +107169,13 @@ done +@@ -105167,13 +111754,13 @@ done echo $ac_n "checking whether fp_except is defined""... $ac_c" 1>&6 -echo "configure:105171: checking whether fp_except is defined" >&5 -+echo "configure:107173: checking whether fp_except is defined" >&5 ++echo "configure:111758: checking whether fp_except is defined" >&5 if eval "test \"`echo '$''{'ac_cv_type_fp_except'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -@@ -105184,7 +107186,7 @@ fp_except x = (fp_except) 0; +@@ -105184,7 +111771,7 @@ fp_except x = (fp_except) 0; ; return 0; } EOF -if { (eval echo configure:105188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:107190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:111775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_fp_except=yes -@@ -105211,9 +107213,9 @@ EOF +@@ -105211,9 +111798,9 @@ EOF echo $ac_n "checking for usable _FPU_SETCW""... $ac_c" 1>&6 -echo "configure:105215: checking for usable _FPU_SETCW" >&5 -+echo "configure:107217: checking for usable _FPU_SETCW" >&5 ++echo "configure:111802: checking for usable _FPU_SETCW" >&5 cat > conftest.$ac_ext < -@@ -105233,7 +107235,7 @@ int main() { +@@ -105233,7 +111820,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:105237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cfp_have__fpu_setcw=yes else -@@ -105254,9 +107256,9 @@ EOF +@@ -105254,9 +111841,9 @@ EOF fi echo $ac_n "checking for usable fpsetprec""... $ac_c" 1>&6 -echo "configure:105258: checking for usable fpsetprec" >&5 -+echo "configure:107260: checking for usable fpsetprec" >&5 ++echo "configure:111845: checking for usable fpsetprec" >&5 cat > conftest.$ac_ext < -@@ -105275,7 +107277,7 @@ int main() { +@@ -105275,7 +111862,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:105279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cfp_have_fpsetprec=yes else -@@ -105296,9 +107298,9 @@ EOF +@@ -105296,9 +111883,9 @@ EOF fi echo $ac_n "checking for usable _controlfp""... $ac_c" 1>&6 -echo "configure:105300: checking for usable _controlfp" >&5 -+echo "configure:107302: checking for usable _controlfp" >&5 ++echo "configure:111887: checking for usable _controlfp" >&5 cat > conftest.$ac_ext < -@@ -105317,7 +107319,7 @@ int main() { +@@ -105317,7 +111904,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:105321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cfp_have__controlfp=yes else -@@ -105338,9 +107340,9 @@ EOF +@@ -105338,9 +111925,9 @@ EOF fi echo $ac_n "checking for usable _controlfp_s""... $ac_c" 1>&6 -echo "configure:105342: checking for usable _controlfp_s" >&5 -+echo "configure:107344: checking for usable _controlfp_s" >&5 ++echo "configure:111929: checking for usable _controlfp_s" >&5 cat > conftest.$ac_ext < -@@ -105360,7 +107362,7 @@ int main() { +@@ -105360,7 +111947,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:105364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cfp_have__controlfp_s=yes else -@@ -105381,9 +107383,9 @@ EOF +@@ -105381,9 +111968,9 @@ EOF fi echo $ac_n "checking whether FPU control word can be manipulated by inline assembler""... $ac_c" 1>&6 -echo "configure:105385: checking whether FPU control word can be manipulated by inline assembler" >&5 -+echo "configure:107387: checking whether FPU control word can be manipulated by inline assembler" >&5 ++echo "configure:111972: checking whether FPU control word can be manipulated by inline assembler" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:107411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:111996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cfp_have_fpu_inline_asm_x86=yes else -@@ -105427,7 +107429,7 @@ EOF +@@ -105427,7 +112014,7 @@ EOF echo $ac_n "checking whether double cast to long preserves least significant bits""... $ac_c" 1>&6 -echo "configure:105431: checking whether double cast to long preserves least significant bits" >&5 -+echo "configure:107433: checking whether double cast to long preserves least significant bits" >&5 ++echo "configure:112018: checking whether double cast to long preserves least significant bits" >&5 if test "$cross_compiling" = yes; then -@@ -105435,7 +107437,7 @@ if test "$cross_compiling" = yes; then +@@ -105435,7 +112022,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -105459,7 +107461,7 @@ int main() +@@ -105459,7 +112046,7 @@ int main() } EOF -if { (eval echo configure:105463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:107465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF -@@ -105485,17 +107487,17 @@ for ac_hdr in dlfcn.h +@@ -105485,17 +112072,17 @@ for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:105489: checking for $ac_hdr" >&5 -+echo "configure:107491: checking for $ac_hdr" >&5 ++echo "configure:112076: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:105499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:107501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:112086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -105523,14 +107525,14 @@ done +@@ -105523,14 +112110,14 @@ done echo $ac_n "checking whether dlsym() requires a leading underscore in symbol names""... $ac_c" 1>&6 -echo "configure:105527: checking whether dlsym() requires a leading underscore in symbol names" >&5 -+echo "configure:107529: checking whether dlsym() requires a leading underscore in symbol names" >&5 ++echo "configure:112114: checking whether dlsym() requires a leading underscore in symbol names" >&5 if test "$cross_compiling" = yes; then : else @@ -20036,54 +90294,54 @@ lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then -+ if { (eval echo configure:107599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then ++ if { (eval echo configure:112184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in -@@ -105676,23 +107678,23 @@ fi +@@ -105676,23 +112263,23 @@ fi echo $ac_n "checking virtual machine dispatch method""... $ac_c" 1>&6 -echo "configure:105680: checking virtual machine dispatch method" >&5 -+echo "configure:107682: checking virtual machine dispatch method" >&5 ++echo "configure:112267: checking virtual machine dispatch method" >&5 echo "$ac_t""$PHP_ZEND_VM" 1>&6 echo $ac_n "checking whether to enable thread-safety""... $ac_c" 1>&6 -echo "configure:105684: checking whether to enable thread-safety" >&5 -+echo "configure:107686: checking whether to enable thread-safety" >&5 ++echo "configure:112271: checking whether to enable thread-safety" >&5 echo "$ac_t""$ZEND_MAINTAINER_ZTS" 1>&6 echo $ac_n "checking whether to enable inline optimization for GCC""... $ac_c" 1>&6 -echo "configure:105688: checking whether to enable inline optimization for GCC" >&5 -+echo "configure:107690: checking whether to enable inline optimization for GCC" >&5 ++echo "configure:112275: checking whether to enable inline optimization for GCC" >&5 echo "$ac_t""$ZEND_INLINE_OPTIMIZATION" 1>&6 echo $ac_n "checking whether to enable Zend debugging""... $ac_c" 1>&6 -echo "configure:105692: checking whether to enable Zend debugging" >&5 -+echo "configure:107694: checking whether to enable Zend debugging" >&5 ++echo "configure:112279: checking whether to enable Zend debugging" >&5 echo "$ac_t""$ZEND_DEBUG" 1>&6 echo $ac_n "checking whether to enable Zend multibyte""... $ac_c" 1>&6 -echo "configure:105696: checking whether to enable Zend multibyte" >&5 -+echo "configure:107698: checking whether to enable Zend multibyte" >&5 ++echo "configure:112283: checking whether to enable Zend multibyte" >&5 echo "$ac_t""$ZEND_MULTIBYTE" 1>&6 case $PHP_ZEND_VM in -@@ -105765,21 +107767,21 @@ fi +@@ -105765,21 +112352,21 @@ fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:105769: checking for inline" >&5 -+echo "configure:107771: checking for inline" >&5 ++echo "configure:112356: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -20091,7 +90349,7 @@ for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:107785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:112370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else -@@ -105808,7 +107810,7 @@ esac +@@ -105808,7 +112395,7 @@ esac echo $ac_n "checking target system is Darwin""... $ac_c" 1>&6 -echo "configure:105812: checking target system is Darwin" >&5 -+echo "configure:107814: checking target system is Darwin" >&5 ++echo "configure:112399: checking target system is Darwin" >&5 if echo "$target" | grep "darwin" > /dev/null; then cat >> confdefs.h <<\EOF #define DARWIN 1 -@@ -105820,7 +107822,7 @@ else +@@ -105820,7 +112407,7 @@ else fi echo $ac_n "checking for MM alignment and log values""... $ac_c" 1>&6 -echo "configure:105824: checking for MM alignment and log values" >&5 -+echo "configure:107826: checking for MM alignment and log values" >&5 ++echo "configure:112411: checking for MM alignment and log values" >&5 if test "$cross_compiling" = yes; then -@@ -105828,7 +107830,7 @@ if test "$cross_compiling" = yes; then +@@ -105828,7 +112415,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -105864,7 +107866,7 @@ int main() +@@ -105864,7 +112451,7 @@ int main() } EOF -if { (eval echo configure:105868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:107870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1` -@@ -105889,7 +107891,7 @@ fi +@@ -105889,7 +112476,7 @@ fi echo "$ac_t""done" 1>&6 echo $ac_n "checking for memory allocation using mmap(MAP_ANON)""... $ac_c" 1>&6 -echo "configure:105893: checking for memory allocation using mmap(MAP_ANON)" >&5 -+echo "configure:107895: checking for memory allocation using mmap(MAP_ANON)" >&5 ++echo "configure:112480: checking for memory allocation using mmap(MAP_ANON)" >&5 if test "$cross_compiling" = yes; then -@@ -105897,7 +107899,7 @@ if test "$cross_compiling" = yes; then +@@ -105897,7 +112484,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -105933,7 +107935,7 @@ int main() +@@ -105933,7 +112520,7 @@ int main() } EOF -if { (eval echo configure:105937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:107939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF -@@ -105955,7 +107957,7 @@ fi +@@ -105955,7 +112542,7 @@ fi echo $ac_n "checking for memory allocation using mmap("/dev/zero")""... $ac_c" 1>&6 -echo "configure:105959: checking for memory allocation using mmap("/dev/zero")" >&5 -+echo "configure:107961: checking for memory allocation using mmap("/dev/zero")" >&5 ++echo "configure:112546: checking for memory allocation using mmap("/dev/zero")" >&5 if test "$cross_compiling" = yes; then -@@ -105963,7 +107965,7 @@ if test "$cross_compiling" = yes; then +@@ -105963,7 +112550,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -106009,7 +108011,7 @@ int main() +@@ -106009,7 +112596,7 @@ int main() } EOF -if { (eval echo configure:106013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:108015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF -@@ -106033,12 +108035,12 @@ fi +@@ -106033,12 +112620,12 @@ fi for ac_func in mremap do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:106037: checking for $ac_func" >&5 -+echo "configure:108039: checking for $ac_func" >&5 ++echo "configure:112624: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:108067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:112652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else -@@ -106128,17 +108130,17 @@ for ac_hdr in stdarg.h +@@ -106128,17 +112715,17 @@ for ac_hdr in stdarg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:106132: checking for $ac_hdr" >&5 -+echo "configure:108134: checking for $ac_hdr" >&5 ++echo "configure:112719: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:106142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:108144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:112729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -106215,7 +108217,7 @@ if test "$TSRM_PTH" != "no"; then +@@ -106215,7 +112802,7 @@ if test "$TSRM_PTH" != "no"; then echo $ac_n "checking for GNU Pth""... $ac_c" 1>&6 -echo "configure:106219: checking for GNU Pth" >&5 -+echo "configure:108221: checking for GNU Pth" >&5 ++echo "configure:112806: checking for GNU Pth" >&5 PTH_PREFIX="`$TSRM_PTH --prefix`" if test -z "$PTH_PREFIX"; then echo "$ac_t""Please check your Pth installation" 1>&6 -@@ -106245,17 +108247,17 @@ elif test "$TSRM_ST" != "no"; then +@@ -106245,17 +112832,17 @@ elif test "$TSRM_ST" != "no"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:106249: checking for $ac_hdr" >&5 -+echo "configure:108251: checking for $ac_hdr" >&5 ++echo "configure:112836: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:106259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:108261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:112846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* -@@ -106285,7 +108287,7 @@ done +@@ -106285,7 +112872,7 @@ done LIBS="$LIBS -lst" echo $ac_n "checking for SGI's State Threads""... $ac_c" 1>&6 -echo "configure:106289: checking for SGI's State Threads" >&5 -+echo "configure:108291: checking for SGI's State Threads" >&5 ++echo "configure:112876: checking for SGI's State Threads" >&5 echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define TSRM_ST 1 -@@ -106324,7 +108326,7 @@ if test "$cross_compiling" = yes; then +@@ -106324,7 +112911,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -106342,7 +108344,7 @@ int main() { +@@ -106342,7 +112929,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:106346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:108348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -106362,7 +108364,7 @@ fi +@@ -106362,7 +112949,7 @@ fi CFLAGS=$save_CFLAGS echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6 -echo "configure:106366: checking for pthreads_cflags" >&5 -+echo "configure:108368: checking for pthreads_cflags" >&5 ++echo "configure:112953: checking for pthreads_cflags" >&5 if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -106384,7 +108386,7 @@ if test "$cross_compiling" = yes; then +@@ -106384,7 +112971,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -106402,7 +108404,7 @@ int main() { +@@ -106402,7 +112989,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:106406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:108408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:112993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -106432,7 +108434,7 @@ fi +@@ -106432,7 +113019,7 @@ fi echo "$ac_t""$ac_cv_pthreads_cflags" 1>&6 echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6 -echo "configure:106436: checking for pthreads_lib" >&5 -+echo "configure:108438: checking for pthreads_lib" >&5 ++echo "configure:113023: checking for pthreads_lib" >&5 if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -106454,7 +108456,7 @@ if test "$cross_compiling" = yes; then +@@ -106454,7 +113041,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < -@@ -106472,7 +108474,7 @@ int main() { +@@ -106472,7 +113059,7 @@ int main() { return pthread_create(&thd, NULL, thread_routine, &data); } EOF -if { (eval echo configure:106476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:108478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:113063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then pthreads_working=yes -@@ -106523,7 +108525,7 @@ EOF +@@ -106523,7 +113110,7 @@ EOF echo $ac_n "checking for POSIX threads""... $ac_c" 1>&6 -echo "configure:106527: checking for POSIX threads" >&5 -+echo "configure:108529: checking for POSIX threads" >&5 ++echo "configure:113114: checking for POSIX threads" >&5 echo "$ac_t""yes" 1>&6 fi -@@ -107157,7 +109159,7 @@ fi +@@ -107157,7 +113744,7 @@ fi echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:107161: checking build system type" >&5 -+echo "configure:109163: checking build system type" >&5 ++echo "configure:113748: checking build system type" >&5 build_alias=$build case "$build_alias" in -@@ -107186,7 +109188,7 @@ ac_prog=ld +@@ -107186,7 +113773,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by $CC""... $ac_c" 1>&6 -echo "configure:107190: checking for ld used by $CC" >&5 -+echo "configure:109192: checking for ld used by $CC" >&5 ++echo "configure:113777: checking for ld used by $CC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw -@@ -107216,10 +109218,10 @@ echo "configure:107190: checking for ld +@@ -107216,10 +113803,10 @@ echo "configure:107190: checking for ld esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:107220: checking for GNU ld" >&5 -+echo "configure:109222: checking for GNU ld" >&5 ++echo "configure:113807: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:107223: checking for non-GNU ld" >&5 -+echo "configure:109225: checking for non-GNU ld" >&5 ++echo "configure:113810: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -107258,7 +109260,7 @@ else +@@ -107258,7 +113845,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:107262: checking if the linker ($LD) is GNU ld" >&5 -+echo "configure:109264: checking if the linker ($LD) is GNU ld" >&5 ++echo "configure:113849: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107278,7 +109280,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld +@@ -107278,7 +113865,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:107282: checking for $LD option to reload object files" >&5 -+echo "configure:109284: checking for $LD option to reload object files" >&5 ++echo "configure:113869: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107303,7 +109305,7 @@ case $host_os in +@@ -107303,7 +113890,7 @@ case $host_os in esac echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:107307: checking for BSD-compatible nm" >&5 -+echo "configure:109309: checking for BSD-compatible nm" >&5 ++echo "configure:113894: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107356,7 +109358,7 @@ echo "$ac_t""$lt_cv_path_NM" 1>&6 +@@ -107356,7 +113943,7 @@ echo "$ac_t""$lt_cv_path_NM" 1>&6 NM="$lt_cv_path_NM" echo $ac_n "checking how to recognize dependent libraries""... $ac_c" 1>&6 -echo "configure:107360: checking how to recognize dependent libraries" >&5 -+echo "configure:109362: checking how to recognize dependent libraries" >&5 ++echo "configure:113947: checking how to recognize dependent libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107548,13 +109550,13 @@ deplibs_check_method=$lt_cv_deplibs_chec +@@ -107548,13 +114135,13 @@ deplibs_check_method=$lt_cv_deplibs_chec test -z "$deplibs_check_method" && deplibs_check_method=unknown echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:107552: checking for object suffix" >&5 -+echo "configure:109554: checking for object suffix" >&5 ++echo "configure:114139: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:107558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:109560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:114145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; -@@ -107574,7 +109576,7 @@ ac_objext=$ac_cv_objext +@@ -107574,7 +114161,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:107578: checking for executable suffix" >&5 -+echo "configure:109580: checking for executable suffix" >&5 ++echo "configure:114165: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107584,10 +109586,10 @@ else +@@ -107584,10 +114171,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:107588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ if { (eval echo configure:109590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ if { (eval echo configure:114175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; @@ -20463,50 +90721,50 @@ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done -@@ -107630,7 +109632,7 @@ case $host in +@@ -107630,7 +114217,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:107634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ if { (eval echo configure:109636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ if { (eval echo configure:114221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" -@@ -107644,8 +109646,8 @@ ia64-*-hpux*) +@@ -107644,8 +114231,8 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 107648 "configure"' > conftest.$ac_ext - if { (eval echo configure:107649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ echo '#line 109650 "configure"' > conftest.$ac_ext -+ if { (eval echo configure:109651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ echo '#line 114235 "configure"' > conftest.$ac_ext ++ if { (eval echo configure:114236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) -@@ -107679,7 +109681,7 @@ x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc +@@ -107679,7 +114266,7 @@ x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:107683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ if { (eval echo configure:109685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ if { (eval echo configure:114270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in -@@ -107729,7 +109731,7 @@ s390*-*linux*|sparc*-*linux*) +@@ -107729,7 +114316,7 @@ s390*-*linux*|sparc*-*linux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:107733: checking whether the C compiler needs -belf" >&5 -+echo "configure:109735: checking whether the C compiler needs -belf" >&5 ++echo "configure:114320: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107742,14 +109744,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext +@@ -107742,14 +114329,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:109755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:114340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else -@@ -107777,7 +109779,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 +@@ -107777,7 +114364,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:107781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ if { (eval echo configure:109783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ if { (eval echo configure:114368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in -@@ -107806,7 +109808,7 @@ if test -n "$CXX" && ( test "X$CXX" != " +@@ -107806,7 +114393,7 @@ if test -n "$CXX" && ( test "X$CXX" != " ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:107810: checking how to run the C++ preprocessor" >&5 -+echo "configure:109812: checking how to run the C++ preprocessor" >&5 ++echo "configure:114397: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -107819,12 +109821,12 @@ ac_link='${CXX-g++} -o conftest${ac_exee +@@ -107819,12 +114406,12 @@ ac_link='${CXX-g++} -o conftest${ac_exee cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:107828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:109830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:114415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : -@@ -107854,7 +109856,7 @@ fi +@@ -107854,7 +114441,7 @@ fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo $ac_n "checking the maximum length of command line arguments""... $ac_c" 1>&6 -echo "configure:107858: checking the maximum length of command line arguments" >&5 -+echo "configure:109860: checking the maximum length of command line arguments" >&5 ++echo "configure:114445: checking the maximum length of command line arguments" >&5 if eval "test \"`echo '$''{'lt_cv_sys_max_cmd_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -107976,7 +109978,7 @@ fi +@@ -107976,7 +114563,7 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output from $compiler object""... $ac_c" 1>&6 -echo "configure:107980: checking command to parse $NM output from $compiler object" >&5 -+echo "configure:109982: checking command to parse $NM output from $compiler object" >&5 ++echo "configure:114567: checking command to parse $NM output from $compiler object" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108080,10 +110082,10 @@ void nm_test_func(){} +@@ -108080,10 +114667,10 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func();return(0);} EOF - if { (eval echo configure:108084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ if { (eval echo configure:110086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ if { (eval echo configure:114671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo configure:108087: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then -+ if { (eval echo configure:110089: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then ++ if { (eval echo configure:114674: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" -@@ -108134,7 +110136,7 @@ EOF +@@ -108134,7 +114721,7 @@ EOF lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo configure:108138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+ if { (eval echo configure:110140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ if { (eval echo configure:114725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" -@@ -108174,7 +110176,7 @@ else +@@ -108174,7 +114761,7 @@ else fi echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:108178: checking for objdir" >&5 -+echo "configure:110180: checking for objdir" >&5 ++echo "configure:114765: checking for objdir" >&5 if eval "test \"`echo '$''{'lt_cv_objdir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108240,7 +110242,7 @@ with_gnu_ld="$lt_cv_prog_gnu_ld" +@@ -108240,7 +114827,7 @@ with_gnu_ld="$lt_cv_prog_gnu_ld" # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108244: checking for $ac_word" >&5 -+echo "configure:110246: checking for $ac_word" >&5 ++echo "configure:114831: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108272,7 +110274,7 @@ if test -n "$ac_tool_prefix"; then +@@ -108272,7 +114859,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108276: checking for $ac_word" >&5 -+echo "configure:110278: checking for $ac_word" >&5 ++echo "configure:114863: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108307,7 +110309,7 @@ fi +@@ -108307,7 +114894,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108311: checking for $ac_word" >&5 -+echo "configure:110313: checking for $ac_word" >&5 ++echo "configure:114898: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108339,7 +110341,7 @@ if test -n "$ac_tool_prefix"; then +@@ -108339,7 +114926,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108343: checking for $ac_word" >&5 -+echo "configure:110345: checking for $ac_word" >&5 ++echo "configure:114930: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108374,7 +110376,7 @@ fi +@@ -108374,7 +114961,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108378: checking for $ac_word" >&5 -+echo "configure:110380: checking for $ac_word" >&5 ++echo "configure:114965: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108406,7 +110408,7 @@ if test -n "$ac_tool_prefix"; then +@@ -108406,7 +114993,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108410: checking for $ac_word" >&5 -+echo "configure:110412: checking for $ac_word" >&5 ++echo "configure:114997: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108493,7 +110495,7 @@ case $deplibs_check_method in +@@ -108493,7 +115080,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:108497: checking for ${ac_tool_prefix}file" >&5 -+echo "configure:110499: checking for ${ac_tool_prefix}file" >&5 ++echo "configure:115084: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108553,7 +110555,7 @@ fi +@@ -108553,7 +115140,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:108557: checking for file" >&5 -+echo "configure:110559: checking for file" >&5 ++echo "configure:115144: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108625,7 +110627,7 @@ esac +@@ -108625,7 +115212,7 @@ esac # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108629: checking for $ac_word" >&5 -+echo "configure:110631: checking for $ac_word" >&5 ++echo "configure:115216: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DSYMUTIL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108657,7 +110659,7 @@ if test -n "$ac_tool_prefix"; then +@@ -108657,7 +115244,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108661: checking for $ac_word" >&5 -+echo "configure:110663: checking for $ac_word" >&5 ++echo "configure:115248: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DSYMUTIL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108692,7 +110694,7 @@ fi +@@ -108692,7 +115279,7 @@ fi # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108696: checking for $ac_word" >&5 -+echo "configure:110698: checking for $ac_word" >&5 ++echo "configure:115283: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NMEDIT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108724,7 +110726,7 @@ if test -n "$ac_tool_prefix"; then +@@ -108724,7 +115311,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:108728: checking for $ac_word" >&5 -+echo "configure:110730: checking for $ac_word" >&5 ++echo "configure:115315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NMEDIT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108758,7 +110760,7 @@ fi +@@ -108758,7 +115345,7 @@ fi echo $ac_n "checking for -single_module linker flag""... $ac_c" 1>&6 -echo "configure:108762: checking for -single_module linker flag" >&5 -+echo "configure:110764: checking for -single_module linker flag" >&5 ++echo "configure:115349: checking for -single_module linker flag" >&5 if eval "test \"`echo '$''{'lt_cv_apple_cc_single_mod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108781,7 +110783,7 @@ fi +@@ -108781,7 +115368,7 @@ fi echo "$ac_t""$lt_cv_apple_cc_single_mod" 1>&6 echo $ac_n "checking for -exported_symbols_list linker flag""... $ac_c" 1>&6 -echo "configure:108785: checking for -exported_symbols_list linker flag" >&5 -+echo "configure:110787: checking for -exported_symbols_list linker flag" >&5 ++echo "configure:115372: checking for -exported_symbols_list linker flag" >&5 if eval "test \"`echo '$''{'lt_cv_ld_exported_symbols_list'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108791,12 +110793,12 @@ else +@@ -108791,12 +115378,12 @@ else LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:110802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:115387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then lt_cv_ld_exported_symbols_list=yes rm -rf conftest* else -@@ -108930,7 +110932,7 @@ if test "$GCC" = yes; then +@@ -108930,7 +115517,7 @@ if test "$GCC" = yes; then echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:108934: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -+echo "configure:110936: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 ++echo "configure:115521: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_rtti_exceptions'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -108947,11 +110949,11 @@ else +@@ -108947,11 +115534,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:108951: $lt_compile\"" >&5) -+ (eval echo "\"configure:110953: $lt_compile\"" >&5) ++ (eval echo "\"configure:115538: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:108955: \$? = $ac_status" >&5 -+ echo "configure:110957: \$? = $ac_status" >&5 ++ echo "configure:115542: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. -@@ -108980,7 +110982,7 @@ lt_prog_compiler_pic= +@@ -108980,7 +115567,7 @@ lt_prog_compiler_pic= lt_prog_compiler_static= echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:108984: checking for $compiler option to produce PIC" >&5 -+echo "configure:110986: checking for $compiler option to produce PIC" >&5 ++echo "configure:115571: checking for $compiler option to produce PIC" >&5 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' -@@ -109227,7 +111229,7 @@ echo "$ac_t""$lt_prog_compiler_pic" 1>&6 +@@ -109227,7 +115814,7 @@ echo "$ac_t""$lt_prog_compiler_pic" 1>&6 if test -n "$lt_prog_compiler_pic"; then echo $ac_n "checking if $compiler PIC flag $lt_prog_compiler_pic works""... $ac_c" 1>&6 -echo "configure:109231: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -+echo "configure:111233: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 ++echo "configure:115818: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -109244,11 +111246,11 @@ else +@@ -109244,11 +115831,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:109248: $lt_compile\"" >&5) -+ (eval echo "\"configure:111250: $lt_compile\"" >&5) ++ (eval echo "\"configure:115835: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:109252: \$? = $ac_status" >&5 -+ echo "configure:111254: \$? = $ac_status" >&5 ++ echo "configure:115839: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. -@@ -109290,7 +111292,7 @@ esac +@@ -109290,7 +115877,7 @@ esac # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo $ac_n "checking if $compiler static flag $lt_tmp_static_flag works""... $ac_c" 1>&6 -echo "configure:109294: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -+echo "configure:111296: checking if $compiler static flag $lt_tmp_static_flag works" >&5 ++echo "configure:115881: checking if $compiler static flag $lt_tmp_static_flag works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -109328,7 +111330,7 @@ fi +@@ -109328,7 +115915,7 @@ fi echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:109332: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo "configure:111334: checking if $compiler supports -c -o file.$ac_objext" >&5 ++echo "configure:115919: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -109348,11 +111350,11 @@ else +@@ -109348,11 +115935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:109352: $lt_compile\"" >&5) -+ (eval echo "\"configure:111354: $lt_compile\"" >&5) ++ (eval echo "\"configure:115939: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "configure:109356: \$? = $ac_status" >&5 -+ echo "configure:111358: \$? = $ac_status" >&5 ++ echo "configure:115943: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized -@@ -109382,7 +111384,7 @@ hard_links="nottested" +@@ -109382,7 +115969,7 @@ hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:109386: checking if we can lock with hard links" >&5 -+echo "configure:111388: checking if we can lock with hard links" >&5 ++echo "configure:115973: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no -@@ -109399,7 +111401,7 @@ else +@@ -109399,7 +115986,7 @@ else fi echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:109403: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo "configure:111405: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++echo "configure:115990: checking whether the $compiler linker ($LD) supports shared libraries" >&5 runpath_var= allow_undefined_flag= -@@ -109810,12 +111812,12 @@ _LT_EOF +@@ -109810,12 +116397,12 @@ _LT_EOF # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:111821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:116406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { -@@ -109848,12 +111850,12 @@ if test -z "$aix_libpath"; then aix_libp +@@ -109848,12 +116435,12 @@ if test -z "$aix_libpath"; then aix_libp # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:111859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:116444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { -@@ -110343,11 +112345,11 @@ x|xyes) +@@ -110343,11 +116930,11 @@ x|xyes) # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:110347: checking whether -lc should be explicitly linked in" >&5 -+echo "configure:112349: checking whether -lc should be explicitly linked in" >&5 ++echo "configure:116934: checking whether -lc should be explicitly linked in" >&5 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo configure:110351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then -+ if { (eval echo configure:112353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then ++ if { (eval echo configure:116938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext -@@ -110361,7 +112363,7 @@ echo "configure:110347: checking whether +@@ -110361,7 +116948,7 @@ echo "configure:110347: checking whether libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= - if { (eval echo configure:110365: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } -+ if { (eval echo configure:112367: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } ++ if { (eval echo configure:116952: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then archive_cmds_need_lc=no else -@@ -110380,7 +112382,7 @@ echo "configure:110347: checking whether +@@ -110380,7 +116967,7 @@ echo "configure:110347: checking whether esac echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:110384: checking dynamic linker characteristics" >&5 -+echo "configure:112386: checking dynamic linker characteristics" >&5 ++echo "configure:116971: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= -@@ -111005,7 +113007,7 @@ if test "$GCC" = yes; then +@@ -111005,7 +117592,7 @@ if test "$GCC" = yes; then fi echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:111009: checking how to hardcode library paths into programs" >&5 -+echo "configure:113011: checking how to hardcode library paths into programs" >&5 ++echo "configure:117596: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ -@@ -111043,7 +113045,7 @@ fi +@@ -111043,7 +117630,7 @@ fi striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:111047: checking whether stripping libraries is possible" >&5 -+echo "configure:113049: checking whether stripping libraries is possible" >&5 ++echo "configure:117634: checking whether stripping libraries is possible" >&5 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" -@@ -111094,7 +113096,7 @@ else +@@ -111094,7 +117681,7 @@ else darwin*) # if libdl is installed we need to link against it echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:111098: checking for dlopen in -ldl" >&5 -+echo "configure:113100: checking for dlopen in -ldl" >&5 ++echo "configure:117685: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -111102,7 +113104,7 @@ else +@@ -111102,7 +117689,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -111142,12 +113144,12 @@ fi +@@ -111142,12 +117729,12 @@ fi *) echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:111146: checking for shl_load" >&5 -+echo "configure:113148: checking for shl_load" >&5 ++echo "configure:117733: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else -@@ -111188,7 +113190,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_ +@@ -111188,7 +117775,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:111192: checking for shl_load in -ldld" >&5 -+echo "configure:113194: checking for shl_load in -ldld" >&5 ++echo "configure:117779: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -111196,7 +113198,7 @@ else +@@ -111196,7 +117783,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -111226,12 +113228,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l +@@ -111226,12 +117813,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:111230: checking for dlopen" >&5 -+echo "configure:113232: checking for dlopen" >&5 ++echo "configure:117817: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else -@@ -111272,7 +113274,7 @@ if eval "test \"`echo '$ac_cv_func_'dlop +@@ -111272,7 +117859,7 @@ if eval "test \"`echo '$ac_cv_func_'dlop else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:111276: checking for dlopen in -ldl" >&5 -+echo "configure:113278: checking for dlopen in -ldl" >&5 ++echo "configure:117863: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -111280,7 +113282,7 @@ else +@@ -111280,7 +117867,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -111310,7 +113312,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l +@@ -111310,7 +117897,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:111314: checking for dlopen in -lsvld" >&5 -+echo "configure:113316: checking for dlopen in -lsvld" >&5 ++echo "configure:117901: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -111318,7 +113320,7 @@ else +@@ -111318,7 +117905,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -111348,7 +113350,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l +@@ -111348,7 +117935,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "configure:111352: checking for dld_link in -ldld" >&5 -+echo "configure:113354: checking for dld_link in -ldld" >&5 ++echo "configure:117939: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -111356,7 +113358,7 @@ else +@@ -111356,7 +117943,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:113373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:117958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else -@@ -111423,7 +113425,7 @@ fi +@@ -111423,7 +118010,7 @@ fi LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:111427: checking whether a program can dlopen itself" >&5 -+echo "configure:113429: checking whether a program can dlopen itself" >&5 ++echo "configure:118014: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -111433,7 +113435,7 @@ else +@@ -111433,7 +118020,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then -+ if { (eval echo configure:113502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then ++ if { (eval echo configure:118087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in -@@ -111519,7 +113521,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 +@@ -111519,7 +118106,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:111523: checking whether a statically linked program can dlopen itself" >&5 -+echo "configure:113525: checking whether a statically linked program can dlopen itself" >&5 ++echo "configure:118110: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -111529,7 +113531,7 @@ else +@@ -111529,7 +118116,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then -+ if { (eval echo configure:113598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then ++ if { (eval echo configure:118183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in -@@ -111633,11 +113635,11 @@ fi +@@ -111633,11 +118220,11 @@ fi # Report which library types will actually be built echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:111637: checking if libtool supports shared libraries" >&5 -+echo "configure:113639: checking if libtool supports shared libraries" >&5 ++echo "configure:118224: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6 -echo "configure:111641: checking whether to build shared libraries" >&5 -+echo "configure:113643: checking whether to build shared libraries" >&5 ++echo "configure:118228: checking whether to build shared libraries" >&5 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and -@@ -111660,7 +113662,7 @@ esac +@@ -111660,7 +118247,7 @@ esac echo "$ac_t""$enable_shared" 1>&6 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6 -echo "configure:111664: checking whether to build static libraries" >&5 -+echo "configure:113666: checking whether to build static libraries" >&5 ++echo "configure:118251: checking whether to build static libraries" >&5 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$ac_t""$enable_static" 1>&6 -@@ -112346,7 +114348,7 @@ ac_prog=ld +@@ -112346,7 +118933,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by $CC""... $ac_c" 1>&6 -echo "configure:112350: checking for ld used by $CC" >&5 -+echo "configure:114352: checking for ld used by $CC" >&5 ++echo "configure:118937: checking for ld used by $CC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw -@@ -112376,10 +114378,10 @@ echo "configure:112350: checking for ld +@@ -112376,10 +118963,10 @@ echo "configure:112350: checking for ld esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:112380: checking for GNU ld" >&5 -+echo "configure:114382: checking for GNU ld" >&5 ++echo "configure:118967: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:112383: checking for non-GNU ld" >&5 -+echo "configure:114385: checking for non-GNU ld" >&5 ++echo "configure:118970: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 -@@ -112418,7 +114420,7 @@ else +@@ -112418,7 +119005,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:112422: checking if the linker ($LD) is GNU ld" >&5 -+echo "configure:114424: checking if the linker ($LD) is GNU ld" >&5 ++echo "configure:119009: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -112484,7 +114486,7 @@ fi +@@ -112484,7 +119071,7 @@ fi # PORTME: fill in a description of your system's C++ link characteristics echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:112488: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo "configure:114490: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++echo "configure:119075: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ld_shlibs_CXX=yes case $host_os in aix3*) -@@ -112582,12 +114584,12 @@ case $host_os in +@@ -112582,12 +119169,12 @@ case $host_os in # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:114593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:119178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { -@@ -112621,12 +114623,12 @@ if test -z "$aix_libpath"; then aix_libp +@@ -112621,12 +119208,12 @@ if test -z "$aix_libpath"; then aix_libp # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:114632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:119217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { -@@ -113393,7 +115395,7 @@ private: +@@ -113393,7 +119980,7 @@ private: }; EOF -if { (eval echo configure:113397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:115399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:119984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. -@@ -113549,7 +115551,7 @@ lt_prog_compiler_pic_CXX= +@@ -113549,7 +120136,7 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:113553: checking for $compiler option to produce PIC" >&5 -+echo "configure:115555: checking for $compiler option to produce PIC" >&5 ++echo "configure:120140: checking for $compiler option to produce PIC" >&5 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then -@@ -113846,7 +115848,7 @@ echo "$ac_t""$lt_prog_compiler_pic_CXX" +@@ -113846,7 +120433,7 @@ echo "$ac_t""$lt_prog_compiler_pic_CXX" if test -n "$lt_prog_compiler_pic_CXX"; then echo $ac_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works""... $ac_c" 1>&6 -echo "configure:113850: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -+echo "configure:115852: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 ++echo "configure:120437: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_pic_works_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -113863,11 +115865,11 @@ else +@@ -113863,11 +120450,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:113867: $lt_compile\"" >&5) -+ (eval echo "\"configure:115869: $lt_compile\"" >&5) ++ (eval echo "\"configure:120454: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:113871: \$? = $ac_status" >&5 -+ echo "configure:115873: \$? = $ac_status" >&5 ++ echo "configure:120458: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. -@@ -113909,7 +115911,7 @@ esac +@@ -113909,7 +120496,7 @@ esac # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo $ac_n "checking if $compiler static flag $lt_tmp_static_flag works""... $ac_c" 1>&6 -echo "configure:113913: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -+echo "configure:115915: checking if $compiler static flag $lt_tmp_static_flag works" >&5 ++echo "configure:120500: checking if $compiler static flag $lt_tmp_static_flag works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_static_works_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -113947,7 +115949,7 @@ fi +@@ -113947,7 +120534,7 @@ fi echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:113951: checking if $compiler supports -c -o file.$ac_objext" >&5 -+echo "configure:115953: checking if $compiler supports -c -o file.$ac_objext" >&5 ++echo "configure:120538: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_prog_compiler_c_o_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -@@ -113967,11 +115969,11 @@ else +@@ -113967,11 +120554,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:113971: $lt_compile\"" >&5) -+ (eval echo "\"configure:115973: $lt_compile\"" >&5) ++ (eval echo "\"configure:120558: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "configure:113975: \$? = $ac_status" >&5 -+ echo "configure:115977: \$? = $ac_status" >&5 ++ echo "configure:120562: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized -@@ -114001,7 +116003,7 @@ hard_links="nottested" +@@ -114001,7 +120588,7 @@ hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:114005: checking if we can lock with hard links" >&5 -+echo "configure:116007: checking if we can lock with hard links" >&5 ++echo "configure:120592: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no -@@ -114018,7 +116020,7 @@ else +@@ -114018,7 +120605,7 @@ else fi echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:114022: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -+echo "configure:116024: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++echo "configure:120609: checking whether the $compiler linker ($LD) supports shared libraries" >&5 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in -@@ -114064,11 +116066,11 @@ x|xyes) +@@ -114064,11 +120651,11 @@ x|xyes) # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:114068: checking whether -lc should be explicitly linked in" >&5 -+echo "configure:116070: checking whether -lc should be explicitly linked in" >&5 ++echo "configure:120655: checking whether -lc should be explicitly linked in" >&5 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo configure:114072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then -+ if { (eval echo configure:116074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then ++ if { (eval echo configure:120659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext -@@ -114082,7 +116084,7 @@ echo "configure:114068: checking whether +@@ -114082,7 +120669,7 @@ echo "configure:114068: checking whether libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= - if { (eval echo configure:114086: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } -+ if { (eval echo configure:116088: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } ++ if { (eval echo configure:120673: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then archive_cmds_need_lc_CXX=no else -@@ -114101,7 +116103,7 @@ echo "configure:114068: checking whether +@@ -114101,7 +120688,7 @@ echo "configure:114068: checking whether esac echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:114105: checking dynamic linker characteristics" >&5 -+echo "configure:116107: checking dynamic linker characteristics" >&5 ++echo "configure:120692: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= -@@ -114674,7 +116676,7 @@ if test "$GCC" = yes; then +@@ -114674,7 +121261,7 @@ if test "$GCC" = yes; then fi echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:114678: checking how to hardcode library paths into programs" >&5 -+echo "configure:116680: checking how to hardcode library paths into programs" >&5 ++echo "configure:121265: checking how to hardcode library paths into programs" >&5 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ @@ -21394,7 +91652,7 @@ makefile_am_files = Zend/Makefile.am TSRM/Makefile.am config_h_files = Zend/acconfig.h TSRM/acconfig.h -config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 Zend/acinclude.m4 ext/bcmath/config.m4 ext/bz2/config.m4 ext/calendar/config.m4 ext/ctype/config.m4 ext/curl/config.m4 ext/date/config0.m4 ext/dba/config.m4 ext/dom/config.m4 ext/enchant/config.m4 ext/ereg/config0.m4 ext/exif/config.m4 ext/fileinfo/config.m4 ext/filter/config.m4 ext/ftp/config.m4 ext/gd/config.m4 ext/gettext/config.m4 ext/gmp/config.m4 ext/hash/config.m4 ext/iconv/config.m4 ext/imap/config.m4 ext/interbase/config.m4 ext/intl/config.m4 ext/json/config.m4 ext/ldap/config.m4 ext/libxml/config0.m4 ext/mbstring/config.m4 ext/mcrypt/config.m4 ext/mssql/config.m4 ext/mysql/config.m4 ext/mysqli/config.m4 ext/mysqlnd/config9.m4 ext/oci8/config.m4 ext/odbc/config.m4 ext/openssl/config0.m4 ext/pcntl/config.m4 ext/pcre/config0.m4 ext/pdo/config.m4 ext/pdo_dblib/config.m4 ext/pdo_firebird/config.m4 ext/pdo_mysql/config.m4 ext/pdo_oci/config.m4 ext/pdo_odbc/config.m4 ext/pdo_pgsql/config.m4 ext/pdo_sqlite/config.m4 ext/pgsql/config.m4 ext/phar/config.m4 ext/posix/config.m4 ext/pspell/config.m4 ext/readline/config.m4 ext/recode/config.m4 ext/recode/config9.m4 ext/reflection/config.m4 ext/session/config.m4 ext/shmop/config.m4 ext/simplexml/config.m4 ext/snmp/config.m4 ext/soap/config.m4 ext/sockets/config.m4 ext/spl/config.m4 ext/sqlite/config.m4 ext/sqlite3/config0.m4 ext/standard/config.m4 ext/sybase_ct/config.m4 ext/sysvmsg/config.m4 ext/sysvsem/config.m4 ext/sysvshm/config.m4 ext/tidy/config.m4 ext/tokenizer/config.m4 ext/wddx/config.m4 ext/xml/config.m4 ext/xmlreader/config.m4 ext/xmlrpc/config.m4 ext/xmlwriter/config.m4 ext/xsl/config.m4 ext/zip/config.m4 ext/zlib/config0.m4 sapi/aolserver/config.m4 sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 sapi/apache_hooks/config.m4 sapi/caudium/config.m4 sapi/cli/config.m4 sapi/continuity/config.m4 sapi/embed/config.m4 sapi/fpm/config.m4 sapi/isapi/config.m4 sapi/litespeed/config.m4 sapi/milter/config.m4 sapi/nsapi/config.m4 sapi/phttpd/config.m4 sapi/pi3web/config.m4 sapi/roxen/config.m4 sapi/thttpd/config.m4 sapi/tux/config.m4 sapi/webjames/config.m4 -+config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 Zend/acinclude.m4 ext/apc/config.m4 ext/bcmath/config.m4 ext/bz2/config.m4 ext/calendar/config.m4 ext/ctype/config.m4 ext/curl/config.m4 ext/date/config0.m4 ext/dba/config.m4 ext/dio/config.m4 ext/dom/config.m4 ext/enchant/config.m4 ext/ereg/config0.m4 ext/exif/config.m4 ext/fileinfo/config.m4 ext/filter/config.m4 ext/ftp/config.m4 ext/gd/config.m4 ext/gettext/config.m4 ext/gmp/config.m4 ext/hash/config.m4 ext/iconv/config.m4 ext/imap/config.m4 ext/interbase/config.m4 ext/intl/config.m4 ext/json/config.m4 ext/ldap/config.m4 ext/libevent/config.m4 ext/libxml/config0.m4 ext/mbstring/config.m4 ext/mcrypt/config.m4 ext/mssql/config.m4 ext/mysql/config.m4 ext/mysqli/config.m4 ext/mysqlnd/config9.m4 ext/oci8/config.m4 ext/odbc/config.m4 ext/openssl/config0.m4 ext/pcntl/config.m4 ext/pcre/config0.m4 ext/pdo/config.m4 ext/pdo_dblib/config.m4 ext/pdo_firebird/config.m4 ext/pdo_mysql/config.m4 ext/pdo_oci/config.m4 ext/pdo_odbc/config.m4 ext/pdo_pgsql/config.m4 ext/pdo_sqlite/config.m4 ext/pgsql/config.m4 ext/phar/config.m4 ext/posix/config.m4 ext/pspell/config.m4 ext/readline/config.m4 ext/recode/config9.m4 ext/recode/config.m4 ext/reflection/config.m4 ext/session/config.m4 ext/shmop/config.m4 ext/simplexml/config.m4 ext/snmp/config.m4 ext/soap/config.m4 ext/sockets/config.m4 ext/spl/config.m4 ext/sqlite3/config0.m4 ext/sqlite/config.m4 ext/standard/config.m4 ext/sybase_ct/config.m4 ext/sysvmsg/config.m4 ext/sysvsem/config.m4 ext/sysvshm/config.m4 ext/tidy/config.m4 ext/tokenizer/config.m4 ext/wddx/config.m4 ext/xml/config.m4 ext/xmlreader/config.m4 ext/xmlrpc/config.m4 ext/xmlwriter/config.m4 ext/xsl/config.m4 ext/zip/config.m4 ext/zlib/config0.m4 sapi/aolserver/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 sapi/apache/config.m4 sapi/apache_hooks/config.m4 sapi/caudium/config.m4 sapi/cli/config.m4 sapi/continuity/config.m4 sapi/embed/config.m4 sapi/fpm/config.m4 sapi/isapi/config.m4 sapi/litespeed/config.m4 sapi/milter/config.m4 sapi/nsapi/config.m4 sapi/phttpd/config.m4 sapi/pi3web/config.m4 sapi/roxen/config.m4 sapi/thttpd/config.m4 sapi/tux/config.m4 sapi/webjames/config.m4 ++config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 Zend/acinclude.m4 ext/apc/config.m4 ext/bcmath/config.m4 ext/bz2/config.m4 ext/calendar/config.m4 ext/ctype/config.m4 ext/curl/config.m4 ext/date/config0.m4 ext/dba/config.m4 ext/dio/config.m4 ext/dom/config.m4 ext/enchant/config.m4 ext/ereg/config0.m4 ext/exif/config.m4 ext/fileinfo/config.m4 ext/filter/config.m4 ext/ftp/config.m4 ext/gd/config.m4 ext/gettext/config.m4 ext/gmp/config.m4 ext/hash/config.m4 ext/http/config9.m4 ext/http/config.m4 ext/iconv/config.m4 ext/imap/config.m4 ext/interbase/config.m4 ext/intl/config.m4 ext/json/config.m4 ext/ldap/config.m4 ext/libevent/config.m4 ext/libxml/config0.m4 ext/mbstring/config.m4 ext/mcrypt/config.m4 ext/mssql/config.m4 ext/mysql/config.m4 ext/mysqli/config.m4 ext/mysqlnd/config9.m4 ext/oci8/config.m4 ext/odbc/config.m4 ext/openssl/config0.m4 ext/pcntl/config.m4 ext/pcre/config0.m4 ext/pdo/config.m4 ext/pdo_dblib/config.m4 ext/pdo_firebird/config.m4 ext/pdo_mysql/config.m4 ext/pdo_oci/config.m4 ext/pdo_odbc/config.m4 ext/pdo_pgsql/config.m4 ext/pdo_sqlite/config.m4 ext/pgsql/config.m4 ext/phar/config.m4 ext/posix/config.m4 ext/pspell/config.m4 ext/readline/config.m4 ext/recode/config9.m4 ext/recode/config.m4 ext/reflection/config.m4 ext/session/config.m4 ext/shmop/config.m4 ext/simplexml/config.m4 ext/snmp/config.m4 ext/soap/config.m4 ext/sockets/config.m4 ext/spl/config.m4 ext/sqlite3/config0.m4 ext/sqlite/config.m4 ext/standard/config.m4 ext/sybase_ct/config.m4 ext/sysvmsg/config.m4 ext/sysvsem/config.m4 ext/sysvshm/config.m4 ext/tidy/config.m4 ext/tokenizer/config.m4 ext/wddx/config.m4 ext/xml/config.m4 ext/xmlreader/config.m4 ext/xmlrpc/config.m4 ext/xmlwriter/config.m4 ext/xsl/config.m4 ext/zip/config.m4 ext/zlib/config0.m4 sapi/aolserver/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 sapi/apache/config.m4 sapi/apache_hooks/config.m4 sapi/caudium/config.m4 sapi/cli/config.m4 sapi/continuity/config.m4 sapi/embed/config.m4 sapi/fpm/config.m4 sapi/isapi/config.m4 sapi/litespeed/config.m4 sapi/milter/config.m4 sapi/nsapi/config.m4 sapi/phttpd/config.m4 sapi/pi3web/config.m4 sapi/roxen/config.m4 sapi/thttpd/config.m4 sapi/tux/config.m4 sapi/webjames/config.m4 --- a/main/php_config.h.in +++ b/main/php_config.h.in @@ -1,4 +1,4 @@ @@ -21475,3 +91733,124 @@ /* whether to have multibyte string support */ #undef HAVE_MBSTRING +@@ -2804,6 +2855,120 @@ + /* Whether to build zip as dynamic module */ + #undef COMPILE_DL_ZIP + ++/* */ ++#undef HTTP_SHARED_DEPS ++ ++/* */ ++#undef HTTP_SHARED_DEPS ++ ++/* */ ++#undef HAVE_GETHOSTNAME ++ ++/* */ ++#undef HAVE_GETHOSTNAME ++ ++/* */ ++#undef HAVE_LIBNSL ++ ++/* */ ++#undef HAVE_GETDOMAINNAME ++ ++/* */ ++#undef HAVE_GETDOMAINNAME ++ ++/* */ ++#undef HAVE_LIBNSL ++ ++/* */ ++#undef HAVE_GETSERVBYPORT ++ ++/* */ ++#undef HAVE_GETSERVBYPORT ++ ++/* */ ++#undef HAVE_LIBNSL ++ ++/* */ ++#undef HAVE_GETSERVBYNAME ++ ++/* */ ++#undef HAVE_GETSERVBYNAME ++ ++/* */ ++#undef HAVE_LIBNSL ++ ++/* Have zlib support */ ++#undef HTTP_HAVE_ZLIB ++ ++/* */ ++#undef HTTP_HAVE_SSL ++ ++/* */ ++#undef HTTP_HAVE_OPENSSL ++ ++/* */ ++#undef HTTP_HAVE_GNUTLS ++ ++/* path to bundled SSL CA info */ ++#undef HTTP_CURL_CAINFO ++ ++/* Have cURL support */ ++#undef HTTP_HAVE_CURL ++ ++/* */ ++#undef HAVE_CURL_SHARE_STRERROR ++ ++/* */ ++#undef HAVE_CURL_MULTI_STRERROR ++ ++/* */ ++#undef HAVE_CURL_EASY_STRERROR ++ ++/* */ ++#undef HAVE_CURL_EASY_RESET ++ ++/* */ ++#undef HAVE_CURL_FORMGET ++ ++/* */ ++#undef HAVE_CURL_MULTI_SETOPT ++ ++/* */ ++#undef HAVE_CURL_MULTI_TIMEOUT ++ ++/* */ ++#undef HTTP_EVENT_VERSION ++ ++/* Have libevent support for cURL */ ++#undef HTTP_HAVE_EVENT ++ ++/* */ ++#undef HAVE_CURL_MULTI_SOCKET_ACTION ++ ++/* */ ++#undef HTTP_EVENT_VERSION ++ ++/* Have libevent support for cURL */ ++#undef HTTP_HAVE_EVENT ++ ++/* */ ++#undef HAVE_CURL_MULTI_SOCKET_ACTION ++ ++/* Have magic mime support */ ++#undef HTTP_HAVE_MAGIC ++ ++/* Have ext/hash support */ ++#undef HTTP_HAVE_PHP_HASH_H ++ ++/* Have ext/hash support */ ++#undef HTTP_HAVE_PHP_HASH_H ++ ++/* Whether to build http as dynamic module */ ++#undef COMPILE_DL_HTTP ++ ++/* Have extended HTTP support */ ++#undef HAVE_HTTP ++ + /* Whether to build mysqlnd as dynamic module */ + #undef COMPILE_DL_MYSQLND + -- 2.11.0