com php-src: Merge branch 'PHP-5.3' into PHP-5.4: configure.in ext/soap/php_http.c

From: Date: Sat, 24 Mar 2012 16:20:14 +0000
Subject: com php-src: Merge branch 'PHP-5.3' into PHP-5.4: configure.in ext/soap/php_http.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-68183@lists.php.net to get a copy of this message
Commit: 7a1c76538541e74719faf2311d72a70acd3c01e4 Author: Hannes Magnusson <bjori@php.net> Sat, 24 Mar 2012 17:20:14 +0100 Parents: 69b647c43be5729337024abdc6bf8565a1aa9a5b 4fc4dd8760ddd8a53df9b59921093cc6b523154e Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7a1c76538541e74719faf2311d72a70acd3c01e4 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: This is a git checkout Revert incorrect fix Changed paths: MM configure.in MM ext/soap/php_http.c

7a1c76538541e74719faf2311d72a70acd3c01e4 diff --combined configure.in index 0a6fcd1,d3f96b0..49a88b1 --- a/configure.in +++ b/configure.in @@@ -1,6 -1,28 +1,6 @@@ ## $Id$ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. -divert(1) - -dnl ## Diversion 1 is the autoconf + automake setup phase. We also -dnl ## set the PHP version, deal with platform-specific compile -dnl ## options and check for the basic compile tools. - -dnl ## Diversion 2 is the initial checking of OS features, programs, -dnl ## libraries and so on. - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. -dnl ## This includes whether debugging or short tags are enabled -dnl ## and the default behaviour of php.ini options. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - -dnl ## In diversion 4 we check user-configurable general settings. - -dnl ## In diversion 5 we check which extensions should be compiled. -dnl ## All of these are normally in the extension directories. -dnl ## Diversion 5 is the last one. Here we generate files and clean up. - dnl include Zend specific macro definitions first dnl ------------------------------------------------------------------------- sinclude(Zend/acinclude.m4) @@@ -8,119 -30,19 +8,119 @@@ dnl Basic autoconf + automake initialization, generation of config.nice. dnl ------------------------------------------------------------------------- -AC_PREREQ(2.13) +AC_PREREQ(2.59) AC_INIT(README.SVN-RULES) +ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], []) PHP_CONFIG_NICE(config.nice) PHP_CANONICAL_HOST_TARGET AC_CONFIG_HEADER(main/php_config.h) +AH_TOP([ +#if defined(__GNUC__) && __GNUC__ >= 4 +# define ZEND_API __attribute__ ((visibility("default"))) +# define ZEND_DLEXPORT __attribute__ ((visibility("default"))) +#else +# define ZEND_API +# define ZEND_DLEXPORT +#endif + +#define ZEND_DLIMPORT + +#undef uint +#undef ulong + +/* Define if you want to enable memory limit support */ +#define MEMORY_LIMIT 0 +]) +AH_BOTTOM([ +#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS + +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif + +#ifdef HAVE_IEEEFP_H +# include <ieeefp.h> +#endif + +#ifdef HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif + +#if ZEND_BROKEN_SPRINTF +int zend_sprintf(char *buffer, const char *format, ...); +#else +# define zend_sprintf sprintf +#endif + +#include <math.h> + +/* To enable the is_nan, is_infinite and is_finite PHP functions */ +#ifdef NETWARE + #define HAVE_ISNAN 1 + #define HAVE_ISINF 1 + #define HAVE_ISFINITE 1 +#endif + +#ifndef zend_isnan +#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 +#endif + +#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 + +#ifdef HAVE_FINITE +#define zend_finite(a) finite(a) +#elif defined(HAVE_ISFINITE) || defined(isfinite) +#define zend_finite(a) isfinite(a) +#elif defined(fpclassify) +#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0) +#else +#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1) +#endif + +#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */ + +#ifdef NETWARE +#ifdef USE_WINSOCK +#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T +#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H +#endif +#endif + +#undef PTHREADS +]) PHP_MAJOR_VERSION=5 -PHP_MINOR_VERSION=3 -PHP_RELEASE_VERSION=11 -PHP_EXTRA_VERSION="-dev" +PHP_MINOR_VERSION=4 +PHP_RELEASE_VERSION=1 +PHP_EXTRA_VERSION="RC1-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` @@@ -233,7 -155,7 +233,7 @@@ dnl Check if bison generated files exis case $php_cv_bison_version in ""|invalid[)] if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then - AC_MSG_ERROR([bison is required to build PHP/Zend when building a SVN checkout!]) + AC_MSG_ERROR([bison is required to build PHP/Zend when building a GIT checkout!]) fi ;; esac @@@ -367,14 -289,23 +367,14 @@@ sinclude(Zend/Zend.m4 sinclude(TSRM/threads.m4) sinclude(TSRM/tsrm.m4) - -divert(2) - -dnl ## Diversion 2 is where we set PHP-specific options and come up -dnl ## with reasonable default values for them. We check for pthreads here -dnl ## because the information is needed by the SAPI configuration. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - dnl . dnl ------------------------------------------------------------------------- PTHREADS_CHECK PHP_HELP_SEPARATOR([SAPI modules:]) PHP_SHLIB_SUFFIX_NAMES -PHP_SAPI=default PHP_BUILD_PROGRAM +PHP_SAPI=none dnl SAPI configuration. @@@ -393,25 -324,18 +393,25 @@@ dnl Show which main SAPI was selecte AC_MSG_CHECKING([for chosen SAPI module]) AC_MSG_RESULT([$PHP_SAPI]) +dnl Show which binaries were selected +AC_MSG_CHECKING([for executable SAPI binaries]) +if test "$PHP_BINARIES"; then + AC_MSG_RESULT([$PHP_BINARIES]) +else + AC_MSG_RESULT([none]) +fi + +dnl Exit early +if test -z "$PHP_INSTALLED_SAPIS"; then + AC_MSG_ERROR([Nothing to build.]) +fi + +dnl force ZTS if test "$enable_maintainer_zts" = "yes"; then PTHREADS_ASSIGN_VARS PTHREADS_FLAGS fi -divert(3) - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. -dnl ## This includes whether debugging or short tags are enabled -dnl ## and the default behaviour of php.ini options. - dnl Starting system checks. dnl ------------------------------------------------------------------------- @@@ -759,6 -683,10 +759,6 @@@ if test "x$php_crypt_r" = "x1"; the PHP_CRYPT_R_STYLE fi -divert(4) - -dnl ## In diversion 4 we check user-configurable general settings. - dnl General settings. dnl ------------------------------------------------------------------------- PHP_CONFIGURE_PART(General settings) @@@ -863,7 -791,7 +863,7 @@@ f PHP_ARG_WITH(layout, layout of installed files, [ --with-layout=TYPE Set how installed files will be laid out. Type can - be either PHP or GNU [PHP]], PHP, no) + be either PHP or GNU @<:@PHP@:>@], PHP, no) case $PHP_LAYOUT in GNU) @@@ -876,7 -804,7 +876,7 @@@ esa PHP_ARG_WITH(config-file-path, path to configuration file, [ --with-config-file-path=PATH - Set the path in which to look for php.ini [PREFIX/lib]], DEFAULT, no) + Set the path in which to look for php.ini @<:@PREFIX/lib@:>@], DEFAULT, no) if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then case $PHP_LAYOUT in @@@ -900,6 -828,28 +900,6 @@@ AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DI test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" -PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default, -[ --enable-safe-mode Enable safe mode by default], no, no) - -if test "$PHP_SAFE_MODE" = "yes"; then - AC_DEFINE(PHP_SAFE_MODE,1,[ ]) -else - AC_DEFINE(PHP_SAFE_MODE,0,[ ]) -fi - -AC_MSG_CHECKING([for safe mode exec dir]) -PHP_ARG_WITH(exec-dir,, -[ --with-exec-dir[=DIR] Only allow executables in DIR under safe-mode - [/usr/local/php/bin]], no, no) - -if test "$PHP_EXEC_DIR" != "no" && test "$PHP_EXEC_DIR" != "yes" ; then - AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR, "$PHP_EXEC_DIR", [ ]) - AC_MSG_RESULT([$PHP_EXEC_DIR]) -else - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR, "/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) -fi - PHP_ARG_ENABLE(sigchild, whether to enable PHP's own SIGCHLD handler, [ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no) @@@ -909,6 -859,15 +909,6 @@@ els AC_DEFINE(PHP_SIGCHILD, 0, [ ]) fi -PHP_ARG_ENABLE(magic-quotes, whether to enable magic quotes by default, -[ --enable-magic-quotes Enable magic quotes by default.], no, no) - -if test "$PHP_MAGIC_QUOTES" = "yes"; then - AC_DEFINE(MAGIC_QUOTES, 1, [ ]) -else - AC_DEFINE(MAGIC_QUOTES, 0, [ ]) -fi - PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc, [ --enable-libgcc Enable explicitly linking against libgcc], no, no) @@@ -950,25 -909,6 +950,25 @@@ if test "$PHP_IPV6" != "no" && test "$a AC_DEFINE(HAVE_IPV6, 1, [Whether to enable IPv6 support]) fi +dnl ## +dnl ## DTRACE CHECKS +dnl ## Note: this has to be done after SAPI configuration! +dnl ## +PHP_ARG_ENABLE(dtrace, whether to enable DTrace support, +[ --enable-dtrace Enable DTrace support], no, no) + +if test "$PHP_DTRACE" = "yes"; then + AC_CHECK_HEADERS([sys/sdt.h], [ + PHP_INIT_DTRACE([Zend/zend_dtrace.d],[Zend/zend_dtrace_gen.h],[main/main.c Zend/zend_API.c \ + Zend/zend_execute.c Zend/zend_exceptions.c \ + Zend/zend_dtrace.c Zend/zend.c]) + AC_DEFINE(HAVE_DTRACE, 1, [Whether to enable DTrace support]) + PHP_SUBST(PHP_DTRACE_OBJS) + ], [ + AC_MSG_ERROR([Cannot find sys/sdt.h which is required for DTrace support]) + ]) +fi + AC_MSG_CHECKING([how big to make fd sets]) PHP_ARG_ENABLE(fd-setsize,, [ --enable-fd-setsize Set size of descriptor sets], no, no) @@@ -984,6 -924,11 +984,6 @@@ els AC_MSG_RESULT([using system default]) fi -divert(5) - -dnl ## In diversion 5 we check which extensions should be compiled. -dnl ## All of these are normally in the extension directories. - dnl Extension configuration. dnl ------------------------------------------------------------------------- @@@ -1020,8 -965,14 +1020,8 @@@ dnl ----------------------------------- enable_shared=yes enable_static=yes -case $php_build_target in - program|static) - standard_libtool_flag='-prefer-non-pic -static' - if test -z "$PHP_MODULES" && test -z "$PHP_ZEND_EX"; then - enable_shared=no - fi - ;; - shared) +case $php_sapi_module in + shared[)] enable_static=no case $with_pic in yes) @@@ -1033,12 -984,6 +1033,12 @@@ esac EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module" ;; + *[)] + standard_libtool_flag='-prefer-non-pic -static' + if test -z "$PHP_MODULES" && test -z "$PHP_ZEND_EX"; then + enable_shared=no + fi + ;; esac EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS" @@@ -1068,7 -1013,7 +1068,7 @@@ if test "$PHP_CLI" = "no"; the fi PHP_ARG_WITH(pear, [whether to install PEAR], -[ --with-pear=DIR Install PEAR in DIR [PREFIX/lib/php] +[ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php@:>@ --without-pear Do not install PEAR], DEFAULT, yes) if test "$PHP_PEAR" != "no"; then @@@ -1276,15 -1221,24 +1276,15 @@@ case $host_alias i ;; esac PHP_SUBST_OLD(PHP_INSTALLED_SAPIS) PHP_SUBST(PHP_EXECUTABLE) -PHP_SUBST(PHP_CLI_TARGET) + PHP_SUBST(PHP_SAPI_OBJS) -PHP_SUBST(PHP_CLI_OBJS) +PHP_SUBST(PHP_BINARY_OBJS) PHP_SUBST(PHP_GLOBAL_OBJS) +PHP_SUBST(PHP_BINARIES) PHP_SUBST(PHP_MODULES) PHP_SUBST(PHP_ZEND_EX) @@@ -1428,19 -1382,27 +1428,19 @@@ els pharcmd_install= fi; -all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET) $pharcmd" -install_targets="$install_modules install-build install-headers install-programs $install_pear $pharcmd_install" - -case $PHP_SAPI in - cli) - install_targets="$PHP_INSTALL_CLI_TARGET $install_targets" - ;; - *) - install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets" - ;; -esac +all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd" +install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install" PHP_SUBST(all_targets) PHP_SUBST(install_targets) +PHP_SUBST(install_binary_targets) PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/]) PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c) PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \ - safe_mode.c fopen_wrappers.c alloca.c php_scandir.c \ + fopen_wrappers.c alloca.c php_scandir.c \ php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \ network.c php_open_temporary_file.c php_logos.c \ @@@ -1458,21 -1420,21 +1458,21 @@@ case $host_alias i PHP_ADD_BUILD_DIR(netware) ;; *) - PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli) + PHP_ADD_SOURCES_X(/main, internal_functions_cli.c,, PHP_BINARY_OBJS) ;; esac PHP_ADD_SOURCES(Zend, \ zend_language_parser.c zend_language_scanner.c \ zend_ini_parser.c zend_ini_scanner.c \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ + zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c zend_dtrace.c \ zend_execute_API.c zend_highlight.c zend_llist.c \ zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \ zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \ - zend_closures.c zend_float.c) + zend_closures.c zend_float.c zend_string.c zend_signal.c) if test -r "$abs_srcdir/Zend/zend_objects.c"; then PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c) @@@ -1489,6 -1451,7 +1489,6 @@@ f PHP_ADD_SOURCES_X(Zend, zend_execute.c,,PHP_GLOBAL_OBJS,,$flag) PHP_ADD_BUILD_DIR(main main/streams) -PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli) PHP_ADD_BUILD_DIR(TSRM) PHP_ADD_BUILD_DIR(Zend) diff --combined ext/soap/php_http.c index 69deccd,358877d..a156488 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@@ -192,7 -192,7 +192,7 @@@ static php_stream* http_connect(zval* t namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port); stream = php_stream_xport_create(name, namelen, - ENFORCE_SAFE_MODE | REPORT_ERRORS, + REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL /*persistent_id*/, timeout, @@@ -336,7 -336,7 +336,7 @@@ int make_http_soap_request(zval *this_ n = 3; ZVAL_STRING(&func, "gzencode", 0); smart_str_append_const(&soap_headers_z,"Content-Encoding: gzip\r\n"); - ZVAL_LONG(params[2], 0x1f); + ZVAL_LONG(params[2], 1); } if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS && Z_TYPE(retval) == IS_STRING) { @@@ -461,7 -461,7 +461,7 @@@ try_again if (stream) { zval **cookies, **login, **password; - int ret = zend_list_insert(phpurl, le_url); + int ret = zend_list_insert(phpurl, le_url TSRMLS_CC); add_property_resource(this_ptr, "httpurl", ret); /*zend_list_addref(ret);*/ @@@ -507,14 -507,12 +507,14 @@@ smart_str_appendc(&soap_headers, ':'); smart_str_append_unsigned(&soap_headers, phpurl->port); } - if (http_1_1) { + if (!http_1_1 || + (zend_hash_find(Z_OBJPROP_P(this_ptr), "_keep_alive", sizeof("_keep_alive"), (void **)&tmp) == SUCCESS && + Z_LVAL_PP(tmp) == 0)) { smart_str_append_const(&soap_headers, "\r\n" - "Connection: Keep-Alive\r\n"); + "Connection: close\r\n"); } else { smart_str_append_const(&soap_headers, "\r\n" - "Connection: close\r\n"); + "Connection: Keep-Alive\r\n"); } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { @@@ -1403,7 -1401,7 +1403,7 @@@ static int get_http_body(php_stream *st if (header_length < 0 || header_length >= INT_MAX) { return FALSE; } - http_buf = emalloc(header_length + 1); + http_buf = safe_emalloc(1, header_length, 1); while (http_buf_size < header_length) { int len_read = php_stream_read(stream, http_buf + http_buf_size, header_length - http_buf_size); if (len_read <= 0) {
« previous php.cvs (#68183) next »