@@ -650,6 +650,7 @@ CFLAGS_ARMV8_CRC32C
650
650
CFLAGS_SSE42
651
651
have_win32_dbghelp
652
652
LIBOBJS
653
+ ZSTD
653
654
LZ4
654
655
UUID_LIBS
655
656
LDAP_LIBS_BE
@@ -700,6 +701,9 @@ with_gnu_ld
700
701
LD
701
702
LDFLAGS_SL
702
703
LDFLAGS_EX
704
+ ZSTD_LIBS
705
+ ZSTD_CFLAGS
706
+ with_zstd
703
707
LZ4_LIBS
704
708
LZ4_CFLAGS
705
709
with_lz4
@@ -869,6 +873,7 @@ with_libxslt
869
873
with_system_tzdata
870
874
with_zlib
871
875
with_lz4
876
+ with_zstd
872
877
with_gnu_ld
873
878
with_ssl
874
879
with_openssl
@@ -898,6 +903,8 @@ XML2_CFLAGS
898
903
XML2_LIBS
899
904
LZ4_CFLAGS
900
905
LZ4_LIBS
906
+ ZSTD_CFLAGS
907
+ ZSTD_LIBS
901
908
LDFLAGS_EX
902
909
LDFLAGS_SL
903
910
PERL
@@ -1577,6 +1584,7 @@ Optional Packages:
1577
1584
use system time zone data in DIR
1578
1585
--without-zlib do not use Zlib
1579
1586
--with-lz4 build with LZ4 support
1587
+ --with-zstd build with ZSTD support
1580
1588
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
1581
1589
--with-ssl=LIB use LIB for SSL/TLS support (openssl)
1582
1590
--with-openssl obsolete spelling of --with-ssl=openssl
@@ -1606,6 +1614,8 @@ Some influential environment variables:
1606
1614
XML2_LIBS linker flags for XML2, overriding pkg-config
1607
1615
LZ4_CFLAGS C compiler flags for LZ4, overriding pkg-config
1608
1616
LZ4_LIBS linker flags for LZ4, overriding pkg-config
1617
+ ZSTD_CFLAGS C compiler flags for ZSTD, overriding pkg-config
1618
+ ZSTD_LIBS linker flags for ZSTD, overriding pkg-config
1609
1619
LDFLAGS_EX extra linker flags for linking executables only
1610
1620
LDFLAGS_SL extra linker flags for linking shared libraries only
1611
1621
PERL Perl program
@@ -9034,6 +9044,146 @@ fi
9034
9044
done
9035
9045
fi
9036
9046
9047
+ #
9048
+ # ZSTD
9049
+ #
9050
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ZSTD support" >&5
9051
+ $as_echo_n "checking whether to build with ZSTD support... " >&6; }
9052
+
9053
+
9054
+
9055
+ # Check whether --with-zstd was given.
9056
+ if test "${with_zstd+set}" = set; then :
9057
+ withval=$with_zstd;
9058
+ case $withval in
9059
+ yes)
9060
+
9061
+ $as_echo "#define USE_ZSTD 1" >>confdefs.h
9062
+
9063
+ ;;
9064
+ no)
9065
+ :
9066
+ ;;
9067
+ *)
9068
+ as_fn_error $? "no argument expected for --with-zstd option" "$LINENO" 5
9069
+ ;;
9070
+ esac
9071
+
9072
+ else
9073
+ with_zstd=no
9074
+
9075
+ fi
9076
+
9077
+
9078
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_zstd" >&5
9079
+ $as_echo "$with_zstd" >&6; }
9080
+
9081
+
9082
+ if test "$with_zstd" = yes; then
9083
+
9084
+ pkg_failed=no
9085
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5
9086
+ $as_echo_n "checking for libzstd... " >&6; }
9087
+
9088
+ if test -n "$ZSTD_CFLAGS"; then
9089
+ pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS"
9090
+ elif test -n "$PKG_CONFIG"; then
9091
+ if test -n "$PKG_CONFIG" && \
9092
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
9093
+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
9094
+ ac_status=$?
9095
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9096
+ test $ac_status = 0; }; then
9097
+ pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null`
9098
+ test "x$?" != "x0" && pkg_failed=yes
9099
+ else
9100
+ pkg_failed=yes
9101
+ fi
9102
+ else
9103
+ pkg_failed=untried
9104
+ fi
9105
+ if test -n "$ZSTD_LIBS"; then
9106
+ pkg_cv_ZSTD_LIBS="$ZSTD_LIBS"
9107
+ elif test -n "$PKG_CONFIG"; then
9108
+ if test -n "$PKG_CONFIG" && \
9109
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
9110
+ ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
9111
+ ac_status=$?
9112
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9113
+ test $ac_status = 0; }; then
9114
+ pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null`
9115
+ test "x$?" != "x0" && pkg_failed=yes
9116
+ else
9117
+ pkg_failed=yes
9118
+ fi
9119
+ else
9120
+ pkg_failed=untried
9121
+ fi
9122
+
9123
+
9124
+
9125
+ if test $pkg_failed = yes; then
9126
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9127
+ $as_echo "no" >&6; }
9128
+
9129
+ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9130
+ _pkg_short_errors_supported=yes
9131
+ else
9132
+ _pkg_short_errors_supported=no
9133
+ fi
9134
+ if test $_pkg_short_errors_supported = yes; then
9135
+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1`
9136
+ else
9137
+ ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1`
9138
+ fi
9139
+ # Put the nasty error message in config.log where it belongs
9140
+ echo "$ZSTD_PKG_ERRORS" >&5
9141
+
9142
+ as_fn_error $? "Package requirements (libzstd) were not met:
9143
+
9144
+ $ZSTD_PKG_ERRORS
9145
+
9146
+ Consider adjusting the PKG_CONFIG_PATH environment variable if you
9147
+ installed software in a non-standard prefix.
9148
+
9149
+ Alternatively, you may set the environment variables ZSTD_CFLAGS
9150
+ and ZSTD_LIBS to avoid the need to call pkg-config.
9151
+ See the pkg-config man page for more details." "$LINENO" 5
9152
+ elif test $pkg_failed = untried; then
9153
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9154
+ $as_echo "no" >&6; }
9155
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
9156
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
9157
+ as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
9158
+ is in your PATH or set the PKG_CONFIG environment variable to the full
9159
+ path to pkg-config.
9160
+
9161
+ Alternatively, you may set the environment variables ZSTD_CFLAGS
9162
+ and ZSTD_LIBS to avoid the need to call pkg-config.
9163
+ See the pkg-config man page for more details.
9164
+
9165
+ To get pkg-config, see <http://pkg-config.freedesktop.org/>.
9166
+ See \`config.log' for more details" "$LINENO" 5; }
9167
+ else
9168
+ ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS
9169
+ ZSTD_LIBS=$pkg_cv_ZSTD_LIBS
9170
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9171
+ $as_echo "yes" >&6; }
9172
+
9173
+ fi
9174
+ # We only care about -I, -D, and -L switches;
9175
+ # note that -lzstd will be added by AC_CHECK_LIB below.
9176
+ for pgac_option in $ZSTD_CFLAGS; do
9177
+ case $pgac_option in
9178
+ -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
9179
+ esac
9180
+ done
9181
+ for pgac_option in $ZSTD_LIBS; do
9182
+ case $pgac_option in
9183
+ -L*) LDFLAGS="$LDFLAGS $pgac_option";;
9184
+ esac
9185
+ done
9186
+ fi
9037
9187
#
9038
9188
# Assignments
9039
9189
#
@@ -13130,6 +13280,56 @@ fi
13130
13280
13131
13281
fi
13132
13282
13283
+ if test "$with_zstd" = yes ; then
13284
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5
13285
+ $as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; }
13286
+ if ${ac_cv_lib_zstd_ZSTD_compress+:} false; then :
13287
+ $as_echo_n "(cached) " >&6
13288
+ else
13289
+ ac_check_lib_save_LIBS=$LIBS
13290
+ LIBS="-lzstd $LIBS"
13291
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13292
+ /* end confdefs.h. */
13293
+
13294
+ /* Override any GCC internal prototype to avoid an error.
13295
+ Use char because int might match the return type of a GCC
13296
+ builtin and then its argument prototype would still apply. */
13297
+ #ifdef __cplusplus
13298
+ extern "C"
13299
+ #endif
13300
+ char ZSTD_compress ();
13301
+ int
13302
+ main ()
13303
+ {
13304
+ return ZSTD_compress ();
13305
+ ;
13306
+ return 0;
13307
+ }
13308
+ _ACEOF
13309
+ if ac_fn_c_try_link "$LINENO"; then :
13310
+ ac_cv_lib_zstd_ZSTD_compress=yes
13311
+ else
13312
+ ac_cv_lib_zstd_ZSTD_compress=no
13313
+ fi
13314
+ rm -f core conftest.err conftest.$ac_objext \
13315
+ conftest$ac_exeext conftest.$ac_ext
13316
+ LIBS=$ac_check_lib_save_LIBS
13317
+ fi
13318
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_compress" >&5
13319
+ $as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; }
13320
+ if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then :
13321
+ cat >>confdefs.h <<_ACEOF
13322
+ #define HAVE_LIBZSTD 1
13323
+ _ACEOF
13324
+
13325
+ LIBS="-lzstd $LIBS"
13326
+
13327
+ else
13328
+ as_fn_error $? "library 'zstd' is required for ZSTD support" "$LINENO" 5
13329
+ fi
13330
+
13331
+ fi
13332
+
13133
13333
# Note: We can test for libldap_r only after we know PTHREAD_LIBS;
13134
13334
# also, on AIX, we may need to have openssl in LIBS for this step.
13135
13335
if test "$with_ldap" = yes ; then
@@ -13902,6 +14102,71 @@ fi
13902
14102
13903
14103
done
13904
14104
14105
+ fi
14106
+
14107
+ if test -z "$ZSTD"; then
14108
+ for ac_prog in zstd
14109
+ do
14110
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
14111
+ set dummy $ac_prog; ac_word=$2
14112
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14113
+ $as_echo_n "checking for $ac_word... " >&6; }
14114
+ if ${ac_cv_path_ZSTD+:} false; then :
14115
+ $as_echo_n "(cached) " >&6
14116
+ else
14117
+ case $ZSTD in
14118
+ [\\/]* | ?:[\\/]*)
14119
+ ac_cv_path_ZSTD="$ZSTD" # Let the user override the test with a path.
14120
+ ;;
14121
+ *)
14122
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14123
+ for as_dir in $PATH
14124
+ do
14125
+ IFS=$as_save_IFS
14126
+ test -z "$as_dir" && as_dir=.
14127
+ for ac_exec_ext in '' $ac_executable_extensions; do
14128
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14129
+ ac_cv_path_ZSTD="$as_dir/$ac_word$ac_exec_ext"
14130
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14131
+ break 2
14132
+ fi
14133
+ done
14134
+ done
14135
+ IFS=$as_save_IFS
14136
+
14137
+ ;;
14138
+ esac
14139
+ fi
14140
+ ZSTD=$ac_cv_path_ZSTD
14141
+ if test -n "$ZSTD"; then
14142
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZSTD" >&5
14143
+ $as_echo "$ZSTD" >&6; }
14144
+ else
14145
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14146
+ $as_echo "no" >&6; }
14147
+ fi
14148
+
14149
+
14150
+ test -n "$ZSTD" && break
14151
+ done
14152
+
14153
+ else
14154
+ # Report the value of ZSTD in configure's output in all cases.
14155
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD" >&5
14156
+ $as_echo_n "checking for ZSTD... " >&6; }
14157
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZSTD" >&5
14158
+ $as_echo "$ZSTD" >&6; }
14159
+ fi
14160
+
14161
+ if test "$with_zstd" = yes; then
14162
+ ac_fn_c_check_header_mongrel "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default"
14163
+ if test "x$ac_cv_header_zstd_h" = xyes; then :
14164
+
14165
+ else
14166
+ as_fn_error $? "zstd.h header file is required for ZSTD" "$LINENO" 5
14167
+ fi
14168
+
14169
+
13905
14170
fi
13906
14171
13907
14172
if test "$with_gssapi" = yes ; then