diff options
author | Gilles Vollant <info@winimage.com> | 2020-05-25 17:49:46 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-07-12 18:11:37 +0200 |
commit | e13357b14b7de013043d704dc9c80697e62616c6 (patch) | |
tree | 47146c8bc1645313653e15fdeb8e1f9f8f0e3bff /src | |
parent | c4026a98979f6ed0f6cf9e544d6544ea3b23464c (diff) | |
download | curl-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 'src')
-rw-r--r-- | src/Makefile.m32 | 14 | ||||
-rw-r--r-- | src/tool_getparam.c | 3 | ||||
-rw-r--r-- | src/tool_help.c | 1 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/Makefile.m32 b/src/Makefile.m32 index 802a1da0f..afb4fd547 100644 --- a/src/Makefile.m32 +++ b/src/Makefile.m32 @@ -24,7 +24,7 @@ # ## Makefile for building curl.exe with MingW (GCC-3.2 or later or LLVM/Clang) ## and optionally OpenSSL (1.0.2a), libssh2 (1.5), zlib (1.2.8), librtmp (2.4), -## brotli (1.0.1) +## brotli (1.0.1), zstd (1.4.5) ## ## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...] ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-sspi-winidn @@ -39,6 +39,10 @@ ifndef ZLIB_PATH ZLIB_PATH = ../../zlib-1.2.8 endif +# Edit the path below to point to the base of your Zstandard sources. +ifndef ZSTD_PATH +ZSTD_PATH = ../../zstd-1.4.5 +endif # Edit the path below to point to the base of your Brotli sources. ifndef BROTLI_PATH BROTLI_PATH = ../../brotli-1.0.1 @@ -189,6 +193,9 @@ endif ifeq ($(findstring -zlib,$(CFG)),-zlib) ZLIB = 1 endif +ifeq ($(findstring -zstd,$(CFG)),-zstd) +ZSTD = 1 +endif ifeq ($(findstring -brotli,$(CFG)),-brotli) BROTLI = 1 endif @@ -302,6 +309,11 @@ ifdef ZLIB CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H curl_LDADD += -L"$(ZLIB_PATH)" -lz endif +ifdef ZSTD + INCLUDES += -I"$(ZSTD_PATH)/include" + CFLAGS += -DHAVE_ZSTD + curl_LDADD += -L"$(ZSTD_PATH)/lib" -lzstd +endif ifdef BROTLI INCLUDES += -I"$(BROTLI_PATH)/include" CFLAGS += -DHAVE_BROTLI diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 9c6bc8a14..0648c29b9 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -695,7 +695,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case 'j': /* --compressed */ if(toggle && - !(curlinfo->features & (CURL_VERSION_LIBZ | CURL_VERSION_BROTLI))) + !(curlinfo->features & (CURL_VERSION_LIBZ | + CURL_VERSION_BROTLI | CURL_VERSION_ZSTD))) return PARAM_LIBCURL_DOESNT_SUPPORT; config->encoding = toggle; break; diff --git a/src/tool_help.c b/src/tool_help.c index ae319271c..f60681ced 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -546,6 +546,7 @@ static const struct feat feats[] = { {"SSL", CURL_VERSION_SSL}, {"libz", CURL_VERSION_LIBZ}, {"brotli", CURL_VERSION_BROTLI}, + {"zstd", CURL_VERSION_ZSTD}, {"CharConv", CURL_VERSION_CONV}, {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, {"HTTP2", CURL_VERSION_HTTP2}, |