1
1
found_snappy="no"
2
2
found_zlib="no"
3
3
bundled_zlib="no"
4
+ found_zstd="no"
4
5
5
6
PKG_CHECK_MODULES([ PHP_MONGODB_SNAPPY] ,[ snappy] ,[
6
7
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS $PHP_MONGODB_SNAPPY_CFLAGS"
@@ -47,7 +48,27 @@ AS_IF([test "$found_zlib" != "yes"],[
47
48
bundled_zlib="yes"
48
49
] )
49
50
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
51
72
AC_SUBST ( MONGOC_ENABLE_COMPRESSION , 1 )
52
73
if test "$found_snappy" = "yes"; then
53
74
AC_SUBST ( MONGOC_ENABLE_COMPRESSION_SNAPPY , 1 )
@@ -59,10 +80,14 @@ if test "$found_snappy" = "yes" -o "$found_zlib" = "yes" -o "$bundled_zlib" = "y
59
80
else
60
81
AC_SUBST ( MONGOC_ENABLE_COMPRESSION_ZLIB , 0 )
61
82
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
62
88
else
63
89
AC_SUBST ( MONGOC_ENABLE_COMPRESSION , 0 )
64
- AC_SUBST ( MONGOC_ENABLE_COMPRESSION_ZLIB , 0 )
65
90
AC_SUBST ( MONGOC_ENABLE_COMPRESSION_SNAPPY , 0 )
91
+ AC_SUBST ( MONGOC_ENABLE_COMPRESSION_ZLIB , 0 )
92
+ AC_SUBST ( MONGOC_ENABLE_COMPRESSION_ZSTD , 0 )
66
93
fi
67
-
68
- AC_SUBST ( MONGOC_ENABLE_COMPRESSION_ZSTD , 0 )
0 commit comments