summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGilles Vollant <info@winimage.com>2020-05-25 17:49:46 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-07-12 18:11:37 +0200
commite13357b14b7de013043d704dc9c80697e62616c6 (patch)
tree47146c8bc1645313653e15fdeb8e1f9f8f0e3bff /configure.ac
parentc4026a98979f6ed0f6cf9e544d6544ea3b23464c (diff)
downloadcurl-e13357b14b7de013043d704dc9c80697e62616c6.tar.gz
content_encoding: add zstd decoding support
include zstd curl patch for Makefile.m32 from vszakats and include Add CMake support for zstd from Peter Wu Helped-by: Viktor Szakats Helped-by: Peter Wu Closes #5453
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac91
1 files changed, 91 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ffce699a4..ed1b5fcec 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1116,6 +1116,93 @@ if test X"$OPT_BROTLI" != Xno; then
fi
dnl **********************************************************************
+dnl Check for libzstd
+dnl **********************************************************************
+
+dnl Default to compiler & linker defaults for libzstd
+OPT_ZSTD=off
+AC_ARG_WITH(zstd,dnl
+AC_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
+AC_HELP_STRING([--without-zstd], [disable libzstd]),
+ OPT_ZSTD=$withval)
+
+if test X"$OPT_ZSTD" != Xno; then
+ dnl backup the pre-zstd variables
+ CLEANLDFLAGS="$LDFLAGS"
+ CLEANCPPFLAGS="$CPPFLAGS"
+ CLEANLIBS="$LIBS"
+
+ case "$OPT_ZSTD" in
+ yes)
+ dnl --with-zstd (without path) used
+ CURL_CHECK_PKGCONFIG(libzstd)
+
+ if test "$PKGCONFIG" != "no" ; then
+ LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
+ LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
+ CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
+ version=`$PKGCONFIG --modversion libzstd`
+ DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
+ fi
+
+ ;;
+ off)
+ dnl no --with-zstd option given, just check default places
+ ;;
+ *)
+ dnl use the given --with-zstd spot
+ PREFIX_ZSTD=$OPT_ZSTD
+ ;;
+ esac
+
+ dnl if given with a prefix, we set -L and -I based on that
+ if test -n "$PREFIX_ZSTD"; then
+ LIB_ZSTD="-lzstd"
+ LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
+ CPP_ZSTD=-I${PREFIX_ZSTD}/include
+ DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
+ fi
+
+ LDFLAGS="$LDFLAGS $LD_ZSTD"
+ CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
+ LIBS="$LIB_ZSTD $LIBS"
+
+ AC_CHECK_LIB(zstd, ZSTD_createDStream)
+
+ AC_CHECK_HEADERS(zstd.h,
+ curl_zstd_msg="enabled (libzstd)"
+ HAVE_ZSTD=1
+ AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
+ AC_SUBST(HAVE_ZSTD, [1])
+ )
+
+ if test X"$OPT_ZSTD" != Xoff &&
+ test "$HAVE_ZSTD" != "1"; then
+ AC_MSG_ERROR([libzstd was not found where specified!])
+ fi
+
+ if test "$HAVE_ZSTD" = "1"; then
+ if test -n "$DIR_ZSTD"; then
+ dnl when the zstd shared lib were found in a path that the run-time
+ dnl linker doesn't search through, we need to add it to
+ dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
+ dnl this
+
+ if test "x$cross_compiling" != "xyes"; then
+ CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
+ export CURL_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
+ fi
+ fi
+ else
+ dnl no zstd, revert back to clean variables
+ LDFLAGS=$CLEANLDFLAGS
+ CPPFLAGS=$CLEANCPPFLAGS
+ LIBS=$CLEANLIBS
+ fi
+fi
+
+dnl **********************************************************************
dnl Check for LDAP
dnl **********************************************************************
@@ -4825,6 +4912,9 @@ fi
if test "x$HAVE_BROTLI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
fi
+if test "x$HAVE_ZSTD" = "x1"; then
+ SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
+fi
if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
-o "x$USE_THREADS_WIN32" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
@@ -5067,6 +5157,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
SSH: ${curl_ssh_msg}
zlib: ${curl_zlib_msg}
brotli: ${curl_brotli_msg}
+ zstd: ${curl_zstd_msg}
GSS-API: ${curl_gss_msg}
TLS-SRP: ${curl_tls_srp_msg}
resolver: ${curl_res_msg}