Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-06-26 17:26:08 +0300
committerRemi Collet <remi@remirepo.net>2019-07-09 11:00:40 +0300
commit2abc61da318e2b8287fe0647f84a2b028ca913b0 (patch)
tree91e3a880ed26a618b47a9ead7bc6d64ca9ba17a1 /config.m4
parent52764748121bf0c6980b53f1212fa5a25e98fa5b (diff)
Add support for Zstd compression
Diffstat (limited to 'config.m4')
-rw-r--r--config.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/config.m4 b/config.m4
index 512fc615..bc4dd40d 100644
--- a/config.m4
+++ b/config.m4
@@ -23,6 +23,12 @@ PHP_ARG_ENABLE(redis-lzf, whether to enable lzf compression,
PHP_ARG_WITH(liblzf, use system liblzf,
[ --with-liblzf[=DIR] Use system liblzf], no, no)
+PHP_ARG_ENABLE(redis-zstd, whether to enable Zstd compression,
+[ --enable-redis-zstd Enable Zstd compression support], no, no)
+
+PHP_ARG_WITH(libzstd, use system libsztd,
+[ --with-libzstd[=DIR] Use system libzstd], yes, no)
+
if test "$PHP_REDIS" != "no"; then
if test "$PHP_REDIS_SESSION" != "no"; then
@@ -188,6 +194,35 @@ if test "$PHP_REDIS" != "no"; then
fi
fi
+ if test "$PHP_REDIS_ZSTD" != "no"; then
+ AC_DEFINE(HAVE_REDIS_ZSTD, 1, [ ])
+ if test "$PHP_LIBZSTD" != "no"; then
+ AC_MSG_CHECKING(for libzstd files in default path)
+ for i in $PHP_LIBZSTD /usr/local /usr; do
+ if test -r $i/include/zstd.h; then
+ AC_MSG_RESULT(found in $i)
+ LIBZSTD_DIR=$i
+ break
+ fi
+ done
+ if test -z "$LIBZSTD_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the libzstd distribution])
+ fi
+ PHP_CHECK_LIBRARY(zstd, ZSTD_getFrameContentSize,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH(zstd, $LIBZSTD_DIR/$PHP_LIBDIR, REDIS_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR([could not find usable libzstd, version 1.3.0 required])
+ ], [
+ -L$LIBZSTD_DIR/$PHP_LIBDIR
+ ])
+ PHP_SUBST(REDIS_SHARED_LIBADD)
+ else
+ AC_MSG_ERROR([only system libzstd is supported])
+ fi
+ fi
+
AC_CHECK_PROG([GIT], [git], [yes], [no])
if test "$GIT" == "yes" && test -d "$srcdir/.git"; then
AC_DEFINE_UNQUOTED(GIT_REVISION, ["$(git log -1 --format=%H)"], [ ])