Commits

Ruslan Osmanov  committed dab3739

Fix: Bitbucket issue #2: Static build fails
Fix: build failed when EVENTFD was not available

  • Participants
  • Parent commits e73232e
  • Tags 1.2.5

Comments (0)

Files changed (4)

 
 
 
-dnl {{{ eio support 
+dnl {{{ eio support
 if test "$PHP_EIO" != "no"; then
 
 dnl {{{ COMMENTED OUT
 dnl     dnl {{{ Include paths
-dnl 
+dnl
 dnl     SEARCH_PATH="/usr/local /usr /opt"
-dnl     
+dnl
 dnl     dnl {{{ --with-eio
 dnl     SEARCH_FOR="include/eio.h"
 dnl     if test -r $PHP_EIO/$SEARCH_FOR; then # path given as parameter
 dnl     fi
 dnl     PHP_ADD_INCLUDE($EIO_DIR/include)
 dnl     dnl }}}
-dnl 
+dnl
 dnl     dnl }}}
-dnl 
+dnl
 dnl     dnl {{{ Library checks
 dnl     # --with-eio -> check for lib and symbol presence
 dnl     LIBNAME=eio
 dnl     LIBSYMBOL=eio_init
-dnl 
+dnl
 dnl     PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
 dnl     [
 dnl     PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $EIO_DIR/lib, EIO_SHARED_LIBADD)
 dnl     ],[
 dnl     -L$EIO_DIR/lib
 dnl     ])
-dnl 
+dnl
 dnl     PHP_SUBST(EIO_SHARED_LIBADD)
 dnl     dnl }}}
 dnl
 
     dnl AC_CHECK_HEADERS(sys/eventfd.h linux/falloc.h)
     dnl AC_CHECK_FUNCS(eventfd fallocate)
-    
-    PHP_ADD_INCLUDE(.)
-    AC_CONFIG_SRCDIR([libeio/eio.h])
-    dnl AC_CONFIG_HEADERS([config.h])
-    m4_include([libeio/libeio.m4])
 
-    dnl Build extension 
+    if test "$ext_shared" != "yes" && test "$ext_shared" != "shared"; then
+      PHP_EIO_CONFIG_H='\"main/php_config.h\"'
+      AC_DEFINE(EIO_CONFIG_H, "main/php_config.h", [Overide config.h included in libeio/eio.c])
+      CFLAGS="$CFLAGS -DEIO_CONFIG_H="$PHP_EIO_CONFIG_H
+      define('PHP_EIO_STATIC', 1)
+    fi
+
+    dnl PHP_ADD_INCLUDE(.)
+    PHP_ADD_INCLUDE($ext_builddir)
+    dnl AC_CONFIG_SRCDIR([libeio/eio.h])
+    AC_CONFIG_SRCDIR(ifdef('PHP_EIO_STATIC',PHP_EXT_BUILDDIR(eio)[/],)[libeio/eio.h])
+    dnl dnl AC_CONFIG_HEADERS([config.h])
+    m4_include(ifdef('PHP_EIO_STATIC',PHP_EXT_BUILDDIR(eio)[/],)[libeio/libeio.m4])
+
+    dnl Build extension
     eio_src="php_eio.c eio_fe.c"
     PHP_NEW_EXTENSION(eio, $eio_src, $ext_shared,,$CFLAGS)
     PHP_ADD_EXTENSION_DEP(eio, sockets, true)
     <email>osmanov@php.net</email>
     <active>yes</active>
   </lead>
-  <date>2014-03-14</date>
+  <date>2014-03-27</date>
   <!--{{{ Current version -->
   <version>
-    <release>1.2.4</release>
+    <release>1.2.5</release>
     <api>1.1.0</api>
   </version>
   <stability>
   </stability>
   <license uri="http://www.php.net/license">php</license>
   <notes>
-    Fix: Bitbucket issue #1: eio_open fails when file is owned by root
+    Fix: Bitbucket issue #2: Static build fails
+    Fix: build failed when EVENTFD was not available
   </notes>
   <!--}}}-->
   <!--{{{ contents -->
   </extsrcrelease>
   <!--{{{ Changelog-->
   <changelog>
+    <!--{{{ 1.2.5 -->
+    <release>
+      <version>
+        <release>1.2.5</release>
+        <api>1.1.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.php.net/license">php</license>
+      <notes>
+    Fix: Bitbucket issue #2: Static build fails
+    Fix: build failed when EVENTFD was not available
+  </notes>
+    </release>
+    <!--}}}-->
     <!--{{{ 1.2.4 -->
     <release>
       <version>
 	/* Save extra calls to fcntl() */
 	return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
 # else
+	php_eio_pipe_t *ep = &php_eio_pipe;
 	int fd = eventfd(0, 0);
 
 	if (fd >= 0) {
 #  define phpext_eio_ptr &eio_module_entry
 
 #  ifndef PHP_EIO_VERSION
-#    define PHP_EIO_VERSION "1.2.4"
+#    define PHP_EIO_VERSION "1.2.5"
 #  endif
 
 #  ifdef ZTS