summaryrefslogtreecommitdiffstats
path: root/couchbase-fastlz.patch
diff options
context:
space:
mode:
Diffstat (limited to 'couchbase-fastlz.patch')
-rw-r--r--couchbase-fastlz.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/couchbase-fastlz.patch b/couchbase-fastlz.patch
new file mode 100644
index 0000000..e40f2e2
--- /dev/null
+++ b/couchbase-fastlz.patch
@@ -0,0 +1,84 @@
+From 8e3c76129ff52964d6043076ed2e1c443ceb262c Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Sat, 6 Sep 2014 08:45:03 +0200
+Subject: [PATCH] add --with-system-fastlz option
+
+---
+ config.m4 | 27 +++++++++++++++++++++------
+ internal.h | 4 ++++
+ 2 files changed, 25 insertions(+), 6 deletions(-)
+
+diff --git a/config.m4 b/config.m4
+index fc730d6..b3661f5 100644
+--- a/config.m4
++++ b/config.m4
+@@ -1,6 +1,9 @@
+ PHP_ARG_WITH([couchbase], [for Couchbase support],
+ [ --with-couchbase Include Couchbase support])
+
++PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary,
++ [ --with-system-fastlz Use system FastLZ bibrary], no, no)
++
+ if test "$PHP_COUCHBASE" != "no"; then
+ dnl PCBC-180 Add support for igbinary.
+ dnl The PHP include directories is not searched by default, so
+@@ -25,9 +28,7 @@ if test "$PHP_COUCHBASE" != "no"; then
+ PHP_ADD_EXTENSION_DEP(couchbase, igbinary)
+ ])
+
+- PHP_SUBST(COUCHBASE_SHARED_LIBADD)
+- PHP_NEW_EXTENSION([couchbase],
+- [ \
++ COUCHBASE_FILES="\
+ apidecl.c \
+ arithmetic.c \
+ ccache.c \
+@@ -38,7 +39,6 @@ if test "$PHP_COUCHBASE" != "no"; then
+ designdoc.c \
+ error.c \
+ exceptions.c \
+- fastlz/fastlz.c \
+ flush.c \
+ get.c \
+ ht.c \
+@@ -60,7 +60,22 @@ if test "$PHP_COUCHBASE" != "no"; then
+ version.c \
+ viewopts.c \
+ views.c \
+- ], [$ext_shared])
++ "
++ if test "$PHP_SYSTEM_FASTLZ" != "no"; then
++ AC_CHECK_HEADERS([fastlz.h], [have_fastlz="yes"], [have_fastlz="no"])
++ PHP_CHECK_LIBRARY(fastlz, fastlz_compress,
++ [PHP_ADD_LIBRARY(fastlz, 1, COUCHBASE_SHARED_LIBADD)],
++ [AC_MSG_ERROR(FastLZ library not found)])
++ else
++ have_fastlz="no"
++ COUCHBASE_FILES="${COUCHBASE_FILES} fastlz/fastlz.c"
++ fi
++ PHP_SUBST(COUCHBASE_SHARED_LIBADD)
++
++ PHP_NEW_EXTENSION([couchbase],
++ [ $COUCHBASE_FILES ], [$ext_shared])
++ if test "have_fastlz" != "yes"; then
+ PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
+- PHP_ADD_BUILD_DIR($ext_builddir/management, 1)
++ fi
++ PHP_ADD_BUILD_DIR($ext_builddir/management, 1)
+ fi
+diff --git a/internal.h b/internal.h
+index 8939d9c..56cab92 100644
+--- a/internal.h
++++ b/internal.h
+@@ -56,7 +56,11 @@
+ #include "ext/standard/php_var.h"
+ #include <libcouchbase/couchbase.h>
+ #include "php_couchbase.h"
++#ifdef HAVE_FASTLZ_H
++#include <fastlz.h>
++#else
+ #include "fastlz/fastlz.h"
++#endif
+
+ #ifdef PHP_WIN32
+ #ifndef PRIu64