mirror of https://github.com/aria2/aria2
Replaced HAVE_LIBZ with HAVE_ZLIB
parent
5b62fa9ab1
commit
7230fbd2f7
|
@ -143,7 +143,7 @@ fi
|
||||||
# Check availability of libz
|
# Check availability of libz
|
||||||
if test "x$with_libz" = "xyes"; then
|
if test "x$with_libz" = "xyes"; then
|
||||||
AM_PATH_LIBZ
|
AM_PATH_LIBZ
|
||||||
if test "x$have_libz" = "xyes"; then
|
if test "x$have_zlib" = "xyes"; then
|
||||||
LIBS="$ZLIB_LIBS $LIBS"
|
LIBS="$ZLIB_LIBS $LIBS"
|
||||||
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
||||||
elif test "x$with_libz_requested" = "xyes"; then
|
elif test "x$with_libz_requested" = "xyes"; then
|
||||||
|
@ -225,7 +225,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set conditional for libz
|
# Set conditional for libz
|
||||||
AM_CONDITIONAL([HAVE_LIBZ], [test "x$have_libz" = "xyes"])
|
AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"])
|
||||||
|
|
||||||
# Set conditional for sqlite3
|
# Set conditional for sqlite3
|
||||||
AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
|
AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
|
||||||
|
@ -518,7 +518,7 @@ echo "CA Bundle: $ca_bundle"
|
||||||
echo "LibXML2: $have_libxml2"
|
echo "LibXML2: $have_libxml2"
|
||||||
echo "LibExpat: $have_libexpat"
|
echo "LibExpat: $have_libexpat"
|
||||||
echo "LibCares: $have_libcares"
|
echo "LibCares: $have_libcares"
|
||||||
echo "Libz: $have_libz"
|
echo "Zlib: $have_zlib"
|
||||||
echo "Epoll: $have_epoll"
|
echo "Epoll: $have_epoll"
|
||||||
echo "Bittorrent: $enable_bittorrent"
|
echo "Bittorrent: $enable_bittorrent"
|
||||||
echo "Metalink: $enable_metalink"
|
echo "Metalink: $enable_metalink"
|
||||||
|
|
14
m4/libz.m4
14
m4/libz.m4
|
@ -1,7 +1,7 @@
|
||||||
AC_DEFUN([AM_PATH_LIBZ],
|
AC_DEFUN([AM_PATH_LIBZ],
|
||||||
[
|
[
|
||||||
AC_ARG_WITH([libz-prefix],
|
AC_ARG_WITH([libz-prefix],
|
||||||
[ --with-libz-prefix=PREFIX Prefix where libz installed (optional)],
|
[ --with-libz-prefix=PREFIX Prefix where zlib installed (optional)],
|
||||||
[libz_prefix=$withval],
|
[libz_prefix=$withval],
|
||||||
[libz_prefix=""])
|
[libz_prefix=""])
|
||||||
|
|
||||||
|
@ -14,24 +14,24 @@ CPPFLAGS_save=$CPPFLAGS
|
||||||
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
||||||
|
|
||||||
PKG_CONFIG_PATH="$libz_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
PKG_CONFIG_PATH="$libz_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_libz=yes], [have_libz=no])
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
||||||
|
|
||||||
if test "x$have_libz" != "xyes"; then
|
if test "x$have_zlib" != "xyes"; then
|
||||||
libz_prefix_lib=$libz_prefix/lib
|
libz_prefix_lib=$libz_prefix/lib
|
||||||
libz_prefix_include=$libz_prefix/include
|
libz_prefix_include=$libz_prefix/include
|
||||||
|
|
||||||
LIBS="-L$libz_prefix_lib $LIBS"
|
LIBS="-L$libz_prefix_lib $LIBS"
|
||||||
CPPFLAGS="-I$libz_prefix_include $CPPFLAGS"
|
CPPFLAGS="-I$libz_prefix_include $CPPFLAGS"
|
||||||
|
|
||||||
AC_CHECK_LIB([z], [zlibVersion], [have_libz=yes])
|
AC_CHECK_LIB([z], [zlibVersion], [have_zlib=yes])
|
||||||
if test "x$have_libz" = "xyes"; then
|
if test "x$have_zlib" = "xyes"; then
|
||||||
ZLIB_LIBS="-L$libz_prefix_lib -lz"
|
ZLIB_LIBS="-L$libz_prefix_lib -lz"
|
||||||
ZLIB_CFLAGS="-I$libz_prefix_include"
|
ZLIB_CFLAGS="-I$libz_prefix_include"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$have_libz" = "xyes"; then
|
if test "x$have_zlib" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have libz.])
|
AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
LIBS=$LIBS_save
|
||||||
|
|
|
@ -89,11 +89,11 @@ const std::string FeatureConfig::FEATURE_FIREFOX3_COOKIE("Firefox3 Cookie");
|
||||||
# define XML_RPC_ENABLED false
|
# define XML_RPC_ENABLED false
|
||||||
#endif // !ENABLE_XML_RPC
|
#endif // !ENABLE_XML_RPC
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
# define GZIP_ENABLED true
|
# define GZIP_ENABLED true
|
||||||
#else // !HAVE_LIBZ
|
#else // !HAVE_ZLIB
|
||||||
# define GZIP_ENABLED false
|
# define GZIP_ENABLED false
|
||||||
#endif // !HAVE_LIBZ
|
#endif // !HAVE_ZLIB
|
||||||
|
|
||||||
#ifdef HAVE_SQLITE3
|
#ifdef HAVE_SQLITE3
|
||||||
# define FIREFOX3_COOKIE_ENABLED true
|
# define FIREFOX3_COOKIE_ENABLED true
|
||||||
|
|
|
@ -176,11 +176,11 @@ std::string HttpRequest::createRequest()
|
||||||
builtinHds.push_back(std::make_pair("Accept:", acceptTypes));
|
builtinHds.push_back(std::make_pair("Accept:", acceptTypes));
|
||||||
if(contentEncodingEnabled_) {
|
if(contentEncodingEnabled_) {
|
||||||
std::string acceptableEncodings;
|
std::string acceptableEncodings;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(acceptGzip_) {
|
if(acceptGzip_) {
|
||||||
acceptableEncodings += "deflate, gzip";
|
acceptableEncodings += "deflate, gzip";
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
if(!acceptableEncodings.empty()) {
|
if(!acceptableEncodings.empty()) {
|
||||||
builtinHds.push_back
|
builtinHds.push_back
|
||||||
(std::make_pair("Accept-Encoding:", acceptableEncodings));
|
(std::make_pair("Accept-Encoding:", acceptableEncodings));
|
||||||
|
|
|
@ -51,9 +51,9 @@
|
||||||
#include "AuthConfig.h"
|
#include "AuthConfig.h"
|
||||||
#include "ChunkedDecodingStreamFilter.h"
|
#include "ChunkedDecodingStreamFilter.h"
|
||||||
#include "error_code.h"
|
#include "error_code.h"
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
# include "GZipDecodingStreamFilter.h"
|
# include "GZipDecodingStreamFilter.h"
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -203,12 +203,12 @@ const std::string& HttpResponse::getContentEncoding() const
|
||||||
SharedHandle<StreamFilter> HttpResponse::getContentEncodingStreamFilter() const
|
SharedHandle<StreamFilter> HttpResponse::getContentEncodingStreamFilter() const
|
||||||
{
|
{
|
||||||
SharedHandle<StreamFilter> filter;
|
SharedHandle<StreamFilter> filter;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(getContentEncoding() == HttpHeader::GZIP ||
|
if(getContentEncoding() == HttpHeader::GZIP ||
|
||||||
getContentEncoding() == HttpHeader::DEFLATE) {
|
getContentEncoding() == HttpHeader::DEFLATE) {
|
||||||
filter.reset(new GZipDecodingStreamFilter());
|
filter.reset(new GZipDecodingStreamFilter());
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,9 @@
|
||||||
#include "ChunkedDecodingStreamFilter.h"
|
#include "ChunkedDecodingStreamFilter.h"
|
||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
#include "SocketRecvBuffer.h"
|
#include "SocketRecvBuffer.h"
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
# include "GZipDecodingStreamFilter.h"
|
# include "GZipDecodingStreamFilter.h"
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ namespace {
|
||||||
bool decideFileAllocation
|
bool decideFileAllocation
|
||||||
(const SharedHandle<StreamFilter>& filter)
|
(const SharedHandle<StreamFilter>& filter)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
for(SharedHandle<StreamFilter> f = filter; f; f = f->getDelegate()){
|
for(SharedHandle<StreamFilter> f = filter; f; f = f->getDelegate()){
|
||||||
// Since the compressed file's length are returned in the response header
|
// Since the compressed file's length are returned in the response header
|
||||||
// and the decompressed file size is unknown at this point, disable file
|
// and the decompressed file size is unknown at this point, disable file
|
||||||
|
@ -456,7 +456,7 @@ bool decideFileAllocation
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -66,11 +66,11 @@ HttpServerCommand::HttpServerCommand
|
||||||
e_->addSocketForReadCheck(socket_, this);
|
e_->addSocketForReadCheck(socket_, this);
|
||||||
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_XML_RPC_USER),
|
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_XML_RPC_USER),
|
||||||
e_->getOption()->get(PREF_XML_RPC_PASSWD));
|
e_->getOption()->get(PREF_XML_RPC_PASSWD));
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
httpServer_->enableGZip();
|
httpServer_->enableGZip();
|
||||||
#else // !HAVE_LIBZ
|
#else // !HAVE_ZLIB
|
||||||
httpServer_->disableGZip();
|
httpServer_->disableGZip();
|
||||||
#endif // !HAVE_LIBZ
|
#endif // !HAVE_ZLIB
|
||||||
checkSocketRecvBuffer();
|
checkSocketRecvBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,11 +270,11 @@ SRCS += LibsslTLSContext.cc LibsslTLSContext.h\
|
||||||
LibsslDHKeyExchange.cc LibsslDHKeyExchange.h
|
LibsslDHKeyExchange.cc LibsslDHKeyExchange.h
|
||||||
endif # HAVE_LIBSSL
|
endif # HAVE_LIBSSL
|
||||||
|
|
||||||
if HAVE_LIBZ
|
if HAVE_ZLIB
|
||||||
SRCS += GZipDecoder.cc GZipDecoder.h\
|
SRCS += GZipDecoder.cc GZipDecoder.h\
|
||||||
GZipEncoder.cc GZipEncoder.h\
|
GZipEncoder.cc GZipEncoder.h\
|
||||||
GZipDecodingStreamFilter.cc GZipDecodingStreamFilter.h
|
GZipDecodingStreamFilter.cc GZipDecodingStreamFilter.h
|
||||||
endif # HAVE_LIBZ
|
endif # HAVE_ZLIB
|
||||||
|
|
||||||
if HAVE_SQLITE3
|
if HAVE_SQLITE3
|
||||||
SRCS += Sqlite3CookieParser.cc Sqlite3CookieParser.h\
|
SRCS += Sqlite3CookieParser.cc Sqlite3CookieParser.h\
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
# include "GZipEncoder.h"
|
# include "GZipEncoder.h"
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -140,13 +140,13 @@ XmlRpcResponse& XmlRpcResponse::operator=(const XmlRpcResponse& c)
|
||||||
std::string XmlRpcResponse::toXml(bool gzip) const
|
std::string XmlRpcResponse::toXml(bool gzip) const
|
||||||
{
|
{
|
||||||
if(gzip) {
|
if(gzip) {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
GZipEncoder o;
|
GZipEncoder o;
|
||||||
o.init();
|
o.init();
|
||||||
return encodeAll(o, code, param);
|
return encodeAll(o, code, param);
|
||||||
#else // !HAVE_LIBZ
|
#else // !HAVE_ZLIB
|
||||||
abort();
|
abort();
|
||||||
#endif // !HAVE_LIBZ
|
#endif // !HAVE_ZLIB
|
||||||
} else {
|
} else {
|
||||||
std::stringstream o;
|
std::stringstream o;
|
||||||
return encodeAll(o, code, param);
|
return encodeAll(o, code, param);
|
||||||
|
|
|
@ -65,9 +65,9 @@ void FeatureConfigTest::testFeatureSummary() {
|
||||||
"Firefox3 Cookie",
|
"Firefox3 Cookie",
|
||||||
#endif // HAVE_SQLITE3
|
#endif // HAVE_SQLITE3
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
"GZip",
|
"GZip",
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
|
|
||||||
#ifdef ENABLE_SSL
|
#ifdef ENABLE_SSL
|
||||||
"HTTPS",
|
"HTTPS",
|
||||||
|
|
|
@ -795,9 +795,9 @@ void HttpRequestTest::testEnableAcceptEncoding()
|
||||||
httpRequest.setAuthConfigFactory(authConfigFactory_, option_.get());
|
httpRequest.setAuthConfigFactory(authConfigFactory_, option_.get());
|
||||||
|
|
||||||
std::string acceptEncodings;
|
std::string acceptEncodings;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
acceptEncodings += "deflate, gzip";
|
acceptEncodings += "deflate, gzip";
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
|
|
||||||
std::string expectedTextHead =
|
std::string expectedTextHead =
|
||||||
"GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
"GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
||||||
|
|
|
@ -304,7 +304,7 @@ void HttpResponseTest::testGetContentEncodingStreamFilter()
|
||||||
|
|
||||||
CPPUNIT_ASSERT(!httpResponse.getContentEncodingStreamFilter());
|
CPPUNIT_ASSERT(!httpResponse.getContentEncodingStreamFilter());
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
httpHeader->put("Content-Encoding", "gzip");
|
httpHeader->put("Content-Encoding", "gzip");
|
||||||
{
|
{
|
||||||
SharedHandle<StreamFilter> filter =
|
SharedHandle<StreamFilter> filter =
|
||||||
|
@ -323,7 +323,7 @@ void HttpResponseTest::testGetContentEncodingStreamFilter()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("GZipDecodingStreamFilter"),
|
CPPUNIT_ASSERT_EQUAL(std::string("GZipDecodingStreamFilter"),
|
||||||
filter->getName());
|
filter->getName());
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_ZLIB
|
||||||
httpHeader.reset(new HttpHeader());
|
httpHeader.reset(new HttpHeader());
|
||||||
httpResponse.setHttpHeader(httpHeader);
|
httpResponse.setHttpHeader(httpHeader);
|
||||||
httpHeader->put("Content-Encoding", "bzip2");
|
httpHeader->put("Content-Encoding", "bzip2");
|
||||||
|
|
|
@ -88,11 +88,11 @@ if HAVE_SOME_FALLOCATE
|
||||||
aria2c_SOURCES += FallocFileAllocationIteratorTest.cc
|
aria2c_SOURCES += FallocFileAllocationIteratorTest.cc
|
||||||
endif # HAVE_SOME_FALLOCATE
|
endif # HAVE_SOME_FALLOCATE
|
||||||
|
|
||||||
if HAVE_LIBZ
|
if HAVE_ZLIB
|
||||||
aria2c_SOURCES += GZipDecoderTest.cc\
|
aria2c_SOURCES += GZipDecoderTest.cc\
|
||||||
GZipEncoderTest.cc\
|
GZipEncoderTest.cc\
|
||||||
GZipDecodingStreamFilterTest.cc
|
GZipDecodingStreamFilterTest.cc
|
||||||
endif # HAVE_LIBZ
|
endif # HAVE_ZLIB
|
||||||
|
|
||||||
if HAVE_SQLITE3
|
if HAVE_SQLITE3
|
||||||
aria2c_SOURCES += Sqlite3CookieParserTest.cc
|
aria2c_SOURCES += Sqlite3CookieParserTest.cc
|
||||||
|
|
Loading…
Reference in New Issue