Commits

rickysu  committed f69445d Merge

Merge remote-tracking branch 'upstream/master'

  • Participants
  • Parent commits 6e2cc79, 7da635c

Comments (0)

Files changed (4)

 PHP_ARG_WITH(event-openssl, for OpenSSL support in event,
 [  --with-event-openssl Include libevent OpenSSL support], yes, no)
 
-PHP_ARG_WITH(openssl-dir, OpenSSL installation prefix,
+PHP_ARG_WITH(openssl-dir, for OpenSSL installation prefix,
 [  --with-openssl-dir[=DIR]  Event: openssl installation prefix], no, no)
 
 PHP_ARG_WITH([event-libevent-dir], [],
 [  --with-event-libevent-dir[=DIR] Event: libevent installation prefix], no, no)
 
-PHP_ARG_ENABLE(event-debug, Event: debug support,
+PHP_ARG_ENABLE(event-debug, whether Event debugging support enabled,
 [  --enable-event-debug     Enable debug support in event], no, no)
 
 if test "$PHP_EVENT_CORE" != "no"; then
   dnl {{{ Check for PHP version
-  export OLD_CPPFLAGS="$CPPFLAGS"
-  export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_EV"
-  AC_MSG_CHECKING(PHP version)
-  AC_TRY_COMPILE([#include <php_version.h>], [
-  #if PHP_VERSION_ID < 50400
-  # error  this extension requires at least PHP version 5.4.0
-  #endif
-  ],
-  [AC_MSG_RESULT(ok)],
-  [AC_MSG_ERROR([need at least PHP 5.4.0])])
-  export CPPFLAGS="$OLD_CPPFLAGS"
+
+  dnl The following fails sometimes. See bug #65319
+  dnl
+  dnl export OLD_CPPFLAGS="$CPPFLAGS"
+  dnl export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_EV"
+  dnl AC_MSG_CHECKING(PHP version)
+  dnl AC_TRY_COMPILE([#include <php_version.h>], [
+  dnl #if PHP_VERSION_ID < 50400
+  dnl # error  this extension requires at least PHP version 5.4.0
+  dnl #endif
+  dnl ],
+  dnl [AC_MSG_RESULT(ok)],
+  dnl [AC_MSG_ERROR([need at least PHP 5.4.0])])
+  dnl export CPPFLAGS="$OLD_CPPFLAGS"
+  dnl
+
+  AC_MSG_CHECKING(whether Event supports the current PHP version)
+  tmp_php_version=$PHP_VERSION
+  if test -z "$tmp_php_version"; then
+    if test -z "$PHP_CONFIG"; then
+      AC_MSG_ERROR([php-config not found])
+    fi
+    PHP_EVENT_VERSION_ORIG=`$PHP_CONFIG --version`;
+  else
+    PHP_EVENT_VERSION_ORIG=$tmp_php_version
+  fi
+
+  if test -z $PHP_EVENT_VERSION_ORIG; then
+    AC_MSG_ERROR([failed to detect PHP version, please file a bug])
+  fi
+
+  PHP_EVENT_VERSION_MASK=`echo ${PHP_EVENT_VERSION_ORIG} | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+  if test $PHP_EVENT_VERSION_MASK -lt 5004000; then
+    AC_MSG_ERROR([need at least PHP 5.4.0])
+  else
+    AC_MSG_RESULT([ok])
+  fi
   dnl }}}
   
   dnl {{{ --enable-event-debug
     EVENT_LIBS="-L$EVENT_DIR/$PHP_LIBDIR"
     EVENT_LIBDIR=$EVENT_DIR/$PHP_LIBDIR
   fi
-  LDFLAGS="$EVENT_LIBS -levent_core -levent_pthreads $LDFLAGS"
+  LDFLAGS="$EVENT_LIBS -levent_core $LDFLAGS"
 
   dnl {{{ event_core
 	AC_CHECK_LIB(event_core, event_free, [
   if test "$PHP_EVENT_PTHREADS" != "no"; then
 	  AC_CHECK_LIB(event_pthreads, evthread_use_pthreads, [
 	    PHP_ADD_LIBRARY_WITH_PATH(event_pthreads, $EVENT_LIBDIR, EVENT_SHARED_LIBADD)
-      LDFLAGS="-lpthread -levent_pthreads $LDFLAGS"
+      LDFLAGS="$LDFLAGS -lpthread -levent_pthreads"
       AC_DEFINE(HAVE_EVENT_PTHREADS_LIB, 1, [ ])
 	  ], [
       AC_MSG_ERROR([evthread_use_pthreads not found in event_pthreads library, or the library is not installed])
   if test "$PHP_EVENT_EXTRA" != "no"; then
     AC_CHECK_LIB(event_extra, evdns_base_free, [
 	    PHP_ADD_LIBRARY_WITH_PATH(event_extra, $EVENT_LIBDIR, EVENT_SHARED_LIBADD)
-      LDFLAGS="-levent_extra $LDFLAGS"
+      LDFLAGS="$LDFLAGS -levent_extra"
       AC_DEFINE(HAVE_EVENT_EXTRA_LIB, 1, [ ])
     ], [
       AC_MSG_ERROR([evdns_base_free not found in event_extra library, or the library is not installed])
 
     AC_CHECK_LIB(event_openssl, bufferevent_openssl_get_ssl, [
       PHP_ADD_LIBRARY_WITH_PATH(event_openssl, $EVENT_LIBDIR, EVENT_SHARED_LIBADD)
-      LDFLAGS="-levent_openssl $LDFLAGS"
+      LDFLAGS="$LDFLAGS -levent_openssl"
       AC_DEFINE(HAVE_EVENT_OPENSSL_LIB, 1, [ ])
     ], [
       AC_MSG_ERROR([bufferevent_openssl_get_ssl not found in event_openssl library, or the library is not installed])
   PHP_ADD_BUILD_DIR($ext_builddir/classes)
   PHP_ADD_INCLUDE($ext_builddir/src)
   PHP_ADD_INCLUDE($ext_builddir/classes)
+  PHP_ADD_INCLUDE($ext_builddir)
   PHP_ADD_EXTENSION_DEP(event, sockets, true)
   PHP_SUBST(EVENT_SHARED_LIBADD)
   PHP_SUBST(CFLAGS)
     <email>osmanov@php.net</email>
     <active>yes</active>
   </lead>
-  <date>2013-07-21</date>
+  <date>2013-07-29</date>
   <!--{{{ Current version -->
   <version>
-    <release>1.7.1</release>
+    <release>1.7.3</release>
     <api>1.7.0</api>
   </version>
   <stability>
   </stability>
   <license uri="http://www.php.net/license">PHP</license>
   <notes><![CDATA[
-  Fix: segmentation fault on gc_collect_cycles() after calling Event::free(), 5lava @ Bitbucket reported
-  Fix: assignment reference to "data" property caused 'Fatal error:  Cannot assign by reference to overloaded object'
-  Fix: evnt object dtors sometimes didn't free the 'data' member until the script shutdown phase
+  Fix: in php_event.c write_property function wasn't static
   ]]></notes>
   <!--}}}-->
   <!--{{{ Contents -->
   </extsrcrelease>
   <!--{{{ changelog-->
   <changelog>
+    <!--{{{ Current version -->
+    <release>
+      <version>
+        <release>1.7.3</release>
+        <api>1.7.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.php.net/license">PHP</license>
+      <notes><![CDATA[
+  Fix: in php_event.c write_property function wasn't static
+  ]]></notes>
+    </release>
+    <!--}}}-->
+    <!--{{{ 1.7.2 -->
+    <release>
+      <version>
+        <release>1.7.2</release>
+        <api>1.7.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.php.net/license">PHP</license>
+      <notes><![CDATA[
+  Fix: bug #65320 where we got build errors in attempts to compile event statically(thanks to florin)
+  Fix: bug #65319 where config.m4 used <php_version.h> to detect current PHP version
+  Fix: config.m4 included -levent_pthreads into LDFLAGS even --without-event-pthreads configuration
+  Fix: evthread_use_pthreads() call skept due to a "macro magic"(PHP_EVENT_ASSERT)
+  ]]></notes>
+    </release>
+    <!--}}}-->
     <!--{{{ 1.7.1 -->
     <release>
       <version>
 /* }}} */
 
 /* {{{ write_property */
-void write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
+static void write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
 {
 	zval                         tmp_member;
 	php_event_abstract_object_t *obj;
 # error "Windows is not supported right now"
 	evthread_use_windows_threads();
 # else
-	PHP_EVENT_ASSERT(evthread_use_pthreads() == 0);
+	if (evthread_use_pthreads()) {
+		php_error_docref(NULL TSRMLS_CC, E_ERROR,
+				"evthread_use_pthreads failed, submit a bug");
+	}
 # endif
 #endif
 
 #ifndef PHP_EVENT_H
 #define PHP_EVENT_H
 
-#define PHP_EVENT_VERSION "1.7.1"
+#define PHP_EVENT_VERSION "1.7.3"
 
 #define PHP_EVENT_SUN_PREFIX "unix:"