Skip to content

Commit 89b29ed

Browse files
committed
Merge branch 'v1.8'
2 parents 7f2700c + 2305e98 commit 89b29ed

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

php_phongo.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,6 +3730,11 @@ PHP_MINFO_FUNCTION(mongodb)
37303730
#else
37313731
php_info_print_table_row(2, "libmongoc compression zlib", "disabled");
37323732
#endif
3733+
#ifdef MONGOC_ENABLE_COMPRESSION_ZSTD
3734+
php_info_print_table_row(2, "libmongoc compression zstd", "enabled");
3735+
#else
3736+
php_info_print_table_row(2, "libmongoc compression zstd", "disabled");
3737+
#endif
37333738
#else /* MONGOC_ENABLE_COMPRESSION */
37343739
php_info_print_table_row(2, "libmongoc compression", "disabled");
37353740
#endif

scripts/autotools/libmongoc/CheckCompression.m4

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
found_snappy="no"
22
found_zlib="no"
33
bundled_zlib="no"
4+
found_zstd="no"
45

56
PKG_CHECK_MODULES([PHP_MONGODB_SNAPPY],[snappy],[
67
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS $PHP_MONGODB_SNAPPY_CFLAGS"
@@ -47,7 +48,27 @@ AS_IF([test "$found_zlib" != "yes"],[
4748
bundled_zlib="yes"
4849
])
4950

50-
if test "$found_snappy" = "yes" -o "$found_zlib" = "yes" -o "$bundled_zlib" = "yes"; then
51+
PKG_CHECK_MODULES([PHP_MONGODB_ZSTD],[libzstd],[
52+
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS $PHP_MONGODB_ZSTD_CFLAGS"
53+
PHP_EVAL_LIBLINE([$PHP_MONGODB_ZSTD_LIBS],[MONGODB_SHARED_LIBADD])
54+
found_zstd="yes"
55+
],[
56+
PHP_CHECK_LIBRARY([zstd],
57+
[ZSTD_compress],
58+
[have_zstd_lib="yes"],
59+
[have_zstd_lib="no"])
60+
61+
AC_CHECK_HEADER([zstd.h],
62+
[have_zstd_headers=yes],
63+
[have_zstd_headers=no])
64+
65+
if test "$have_zstd_lib" = "yes" -a "$have_zstd_headers" = "yes"; then
66+
PHP_ADD_LIBRARY([zstd],,[MONGODB_SHARED_LIBADD])
67+
found_zstd="yes"
68+
fi
69+
])
70+
71+
if test "$found_snappy" = "yes" -o "$found_zlib" = "yes" -o "$bundled_zlib" = "yes" -o "$found_zstd" = "yes"; then
5172
AC_SUBST(MONGOC_ENABLE_COMPRESSION, 1)
5273
if test "$found_snappy" = "yes"; then
5374
AC_SUBST(MONGOC_ENABLE_COMPRESSION_SNAPPY, 1)
@@ -59,10 +80,14 @@ if test "$found_snappy" = "yes" -o "$found_zlib" = "yes" -o "$bundled_zlib" = "y
5980
else
6081
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZLIB, 0)
6182
fi
83+
if test "$found_zstd" = "yes"; then
84+
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZSTD, 1)
85+
else
86+
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZSTD, 0)
87+
fi
6288
else
6389
AC_SUBST(MONGOC_ENABLE_COMPRESSION, 0)
64-
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZLIB, 0)
6590
AC_SUBST(MONGOC_ENABLE_COMPRESSION_SNAPPY, 0)
91+
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZLIB, 0)
92+
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZSTD, 0)
6693
fi
67-
68-
AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZSTD, 0)

0 commit comments

Comments
 (0)