summaryrefslogtreecommitdiffstats
path: root/memcached-fastlz.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-09-05 19:35:36 +0200
committerRemi Collet <fedora@famillecollet.com>2014-09-05 19:35:36 +0200
commit52c2cd770a8782171e3f8bd67b635ec850725a0c (patch)
tree03f8cc3e860d40c1fda642bb5f0a409d7807dfb4 /memcached-fastlz.patch
parent5042b970223dc15a86e9ef7ba328500d94ca9de8 (diff)
php-pecl-memcached: test build with system fastlz
Diffstat (limited to 'memcached-fastlz.patch')
-rw-r--r--memcached-fastlz.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/memcached-fastlz.patch b/memcached-fastlz.patch
new file mode 100644
index 0000000..d788a52
--- /dev/null
+++ b/memcached-fastlz.patch
@@ -0,0 +1,61 @@
+diff -up ./config.m4.old ./config.m4
+--- ./config.m4.old 2014-04-01 12:23:39.000000000 +0200
++++ ./config.m4 2014-09-05 19:33:38.000000000 +0200
+@@ -26,6 +26,9 @@ PHP_ARG_ENABLE(memcached-sasl, whether t
+ PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support,
+ [ --enable-memcached-protocol Enable memcached protocoll support], no, no)
+
++PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary,
++[ --with-system-fastlz Use system FastLZ bibrary], no, no)
++
+ if test -z "$PHP_ZLIB_DIR"; then
+ PHP_ARG_WITH(zlib-dir, for ZLIB,
+ [ --with-zlib-dir[=DIR] Set the path to ZLIB install prefix.], no)
+@@ -336,7 +339,17 @@ if test "$PHP_MEMCACHED" != "no"; then
+ AC_MSG_RESULT([no])
+ fi
+
+- PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c fastlz/fastlz.c g_fmt.c"
++ PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c g_fmt.c"
++
++ if test "$PHP_SYSTEM_FASTLZ" != "no"; then
++ AC_CHECK_HEADERS([fastlz.h], [ac_cv_have_fastlz="yes"], [ac_cv_have_fastlz="no"])
++ PHP_CHECK_LIBRARY(fastlz, fastlz_compress,
++ [PHP_ADD_LIBRARY(fastlz, 1, MEMCACHED_SHARED_LIBADD)],
++ [AC_MSG_ERROR(FastLZ library not found)])
++ else
++ ac_cv_have_fastlz="no"
++ PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} fastlz/fastlz.c"
++ fi
+
+ if test "$PHP_MEMCACHED_SESSION" != "no"; then
+ PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} php_memcached_session.c"
+@@ -390,8 +403,10 @@ if test "$PHP_MEMCACHED" != "no"; then
+ PHP_SUBST(MEMCACHED_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(memcached, $PHP_MEMCACHED_FILES, $ext_shared,,$SESSION_INCLUDES $IGBINARY_INCLUDES $LIBEVENT_INCLUDES $MSGPACK_INCLUDES)
+- PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
+-
++ if test "ac_cv_have_fastlz" != "yes"; then
++ PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
++ fi
++
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(memcached, spl, true)
+diff -up ./php_memcached.c.old ./php_memcached.c
+--- ./php_memcached.c.old 2014-09-05 19:17:42.000000000 +0200
++++ ./php_memcached.c 2014-09-05 19:17:49.000000000 +0200
+@@ -30,8 +30,11 @@
+ #ifdef HAVE_MEMCACHED_SESSION
+ # include "php_memcached_session.h"
+ #endif
+-
++#ifdef HAVE_FASTLZ_H
++#include <fastlz.h>
++#else
+ #include "fastlz/fastlz.h"
++#endif
+ #include <zlib.h>
+
+ #ifdef HAVE_JSON_API