Fixes a bug in our zstd-static code. Bug not in any released
version of Tor.
AC_DEFINE(HAVE_ZSTD,1,[Have Zstd])
TOR_ZSTD_CFLAGS="${ZSTD_CFLAGS}"
TOR_ZSTD_LIBS="${ZSTD_LIBS}"
+
+ dnl now check for zstd functions
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$LIBS $ZSTD_LIBS"
+ CFLAGS="$CFLAGS $ZSTD_CFLAGS"
+ AC_CHECK_FUNCS(ZSTD_estimateCStreamSize \
+ ZSTD_estimateDCtxSize)
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
fi
AC_SUBST(TOR_ZSTD_CFLAGS)
AC_SUBST(TOR_ZSTD_LIBS)
#ifdef ZSTD_STATIC_LINKING_ONLY
if (tor_zstd_can_use_static_apis()) {
if (compress) {
+#ifdef HAVE_ZSTD_ESTIMATECSTREAMSIZE
return ZSTD_estimateCStreamSize(preset);
+#endif
} else {
+#ifdef HAVE_ZSTD_ESTIMATEDCTXSIZE
/* Could use DStream, but that takes a windowSize. */
return ZSTD_estimateDCtxSize();
+#endif
}
}
#endif