Replaced HAVE_LIBZ with HAVE_ZLIB

pull/1/head
Tatsuhiro Tsujikawa 2011-02-18 22:34:38 +09:00
parent 5b62fa9ab1
commit 7230fbd2f7
13 changed files with 41 additions and 41 deletions

View File

@ -143,7 +143,7 @@ fi
# Check availability of libz
if test "x$with_libz" = "xyes"; then
AM_PATH_LIBZ
if test "x$have_libz" = "xyes"; then
if test "x$have_zlib" = "xyes"; then
LIBS="$ZLIB_LIBS $LIBS"
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
elif test "x$with_libz_requested" = "xyes"; then
@ -225,7 +225,7 @@ else
fi
# 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
AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
@ -518,7 +518,7 @@ echo "CA Bundle: $ca_bundle"
echo "LibXML2: $have_libxml2"
echo "LibExpat: $have_libexpat"
echo "LibCares: $have_libcares"
echo "Libz: $have_libz"
echo "Zlib: $have_zlib"
echo "Epoll: $have_epoll"
echo "Bittorrent: $enable_bittorrent"
echo "Metalink: $enable_metalink"

View File

@ -1,7 +1,7 @@
AC_DEFUN([AM_PATH_LIBZ],
[
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=""])
@ -14,24 +14,24 @@ CPPFLAGS_save=$CPPFLAGS
PKG_CONFIG_PATH_save=$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_include=$libz_prefix/include
LIBS="-L$libz_prefix_lib $LIBS"
CPPFLAGS="-I$libz_prefix_include $CPPFLAGS"
AC_CHECK_LIB([z], [zlibVersion], [have_libz=yes])
if test "x$have_libz" = "xyes"; then
AC_CHECK_LIB([z], [zlibVersion], [have_zlib=yes])
if test "x$have_zlib" = "xyes"; then
ZLIB_LIBS="-L$libz_prefix_lib -lz"
ZLIB_CFLAGS="-I$libz_prefix_include"
fi
fi
if test "x$have_libz" = "xyes"; then
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have libz.])
if test "x$have_zlib" = "xyes"; then
AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
fi
LIBS=$LIBS_save

View File

@ -89,11 +89,11 @@ const std::string FeatureConfig::FEATURE_FIREFOX3_COOKIE("Firefox3 Cookie");
# define XML_RPC_ENABLED false
#endif // !ENABLE_XML_RPC
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
# define GZIP_ENABLED true
#else // !HAVE_LIBZ
#else // !HAVE_ZLIB
# define GZIP_ENABLED false
#endif // !HAVE_LIBZ
#endif // !HAVE_ZLIB
#ifdef HAVE_SQLITE3
# define FIREFOX3_COOKIE_ENABLED true

View File

@ -176,11 +176,11 @@ std::string HttpRequest::createRequest()
builtinHds.push_back(std::make_pair("Accept:", acceptTypes));
if(contentEncodingEnabled_) {
std::string acceptableEncodings;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(acceptGzip_) {
acceptableEncodings += "deflate, gzip";
}
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
if(!acceptableEncodings.empty()) {
builtinHds.push_back
(std::make_pair("Accept-Encoding:", acceptableEncodings));

View File

@ -51,9 +51,9 @@
#include "AuthConfig.h"
#include "ChunkedDecodingStreamFilter.h"
#include "error_code.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
# include "GZipDecodingStreamFilter.h"
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
namespace aria2 {
@ -203,12 +203,12 @@ const std::string& HttpResponse::getContentEncoding() const
SharedHandle<StreamFilter> HttpResponse::getContentEncodingStreamFilter() const
{
SharedHandle<StreamFilter> filter;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
if(getContentEncoding() == HttpHeader::GZIP ||
getContentEncoding() == HttpHeader::DEFLATE) {
filter.reset(new GZipDecodingStreamFilter());
}
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
return filter;
}

View File

@ -72,9 +72,9 @@
#include "ChunkedDecodingStreamFilter.h"
#include "uri.h"
#include "SocketRecvBuffer.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
# include "GZipDecodingStreamFilter.h"
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
namespace aria2 {
@ -447,7 +447,7 @@ namespace {
bool decideFileAllocation
(const SharedHandle<StreamFilter>& filter)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
for(SharedHandle<StreamFilter> f = filter; f; f = f->getDelegate()){
// Since the compressed file's length are returned in the response header
// and the decompressed file size is unknown at this point, disable file
@ -456,7 +456,7 @@ bool decideFileAllocation
return false;
}
}
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
return true;
}
} // namespace

View File

@ -66,11 +66,11 @@ HttpServerCommand::HttpServerCommand
e_->addSocketForReadCheck(socket_, this);
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_XML_RPC_USER),
e_->getOption()->get(PREF_XML_RPC_PASSWD));
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
httpServer_->enableGZip();
#else // !HAVE_LIBZ
#else // !HAVE_ZLIB
httpServer_->disableGZip();
#endif // !HAVE_LIBZ
#endif // !HAVE_ZLIB
checkSocketRecvBuffer();
}

View File

@ -270,11 +270,11 @@ SRCS += LibsslTLSContext.cc LibsslTLSContext.h\
LibsslDHKeyExchange.cc LibsslDHKeyExchange.h
endif # HAVE_LIBSSL
if HAVE_LIBZ
if HAVE_ZLIB
SRCS += GZipDecoder.cc GZipDecoder.h\
GZipEncoder.cc GZipEncoder.h\
GZipDecodingStreamFilter.cc GZipDecodingStreamFilter.h
endif # HAVE_LIBZ
endif # HAVE_ZLIB
if HAVE_SQLITE3
SRCS += Sqlite3CookieParser.cc Sqlite3CookieParser.h\

View File

@ -38,9 +38,9 @@
#include <sstream>
#include "util.h"
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
# include "GZipEncoder.h"
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
namespace aria2 {
@ -140,13 +140,13 @@ XmlRpcResponse& XmlRpcResponse::operator=(const XmlRpcResponse& c)
std::string XmlRpcResponse::toXml(bool gzip) const
{
if(gzip) {
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
GZipEncoder o;
o.init();
return encodeAll(o, code, param);
#else // !HAVE_LIBZ
#else // !HAVE_ZLIB
abort();
#endif // !HAVE_LIBZ
#endif // !HAVE_ZLIB
} else {
std::stringstream o;
return encodeAll(o, code, param);

View File

@ -65,9 +65,9 @@ void FeatureConfigTest::testFeatureSummary() {
"Firefox3 Cookie",
#endif // HAVE_SQLITE3
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
"GZip",
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
#ifdef ENABLE_SSL
"HTTPS",

View File

@ -795,9 +795,9 @@ void HttpRequestTest::testEnableAcceptEncoding()
httpRequest.setAuthConfigFactory(authConfigFactory_, option_.get());
std::string acceptEncodings;
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
acceptEncodings += "deflate, gzip";
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
std::string expectedTextHead =
"GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"

View File

@ -304,7 +304,7 @@ void HttpResponseTest::testGetContentEncodingStreamFilter()
CPPUNIT_ASSERT(!httpResponse.getContentEncodingStreamFilter());
#ifdef HAVE_LIBZ
#ifdef HAVE_ZLIB
httpHeader->put("Content-Encoding", "gzip");
{
SharedHandle<StreamFilter> filter =
@ -323,7 +323,7 @@ void HttpResponseTest::testGetContentEncodingStreamFilter()
CPPUNIT_ASSERT_EQUAL(std::string("GZipDecodingStreamFilter"),
filter->getName());
}
#endif // HAVE_LIBZ
#endif // HAVE_ZLIB
httpHeader.reset(new HttpHeader());
httpResponse.setHttpHeader(httpHeader);
httpHeader->put("Content-Encoding", "bzip2");

View File

@ -88,11 +88,11 @@ if HAVE_SOME_FALLOCATE
aria2c_SOURCES += FallocFileAllocationIteratorTest.cc
endif # HAVE_SOME_FALLOCATE
if HAVE_LIBZ
if HAVE_ZLIB
aria2c_SOURCES += GZipDecoderTest.cc\
GZipEncoderTest.cc\
GZipDecodingStreamFilterTest.cc
endif # HAVE_LIBZ
endif # HAVE_ZLIB
if HAVE_SQLITE3
aria2c_SOURCES += Sqlite3CookieParserTest.cc