From d30868d952e13e5814d3ed50d96af3ef33db4177 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 16 Mar 2005 12:54:35 -0500 Subject: ENH: Make sure to use internal zlib --- Source/CMakeLists.txt | 4 +++- Source/CTest/Curl/CMakeLists.txt | 30 +++++++++++++++++++++--------- Source/CTest/Curl/config.h.in | 3 +++ Source/CTest/Curl/urldata.h | 5 +++++ 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index badbf76..2e20be1 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -10,6 +10,8 @@ CONFIGURE_FILE( INCLUDE_DIRECTORIES( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" + ${CMAKE_ZLIB_INCLUDES} + ${CMAKE_EXPAT_INCLUDES} ) # let cmake know it is supposed to use it @@ -127,7 +129,7 @@ ENDIF (WIN32) # create a library used by the command line and the GUI ADD_LIBRARY(CMakeLib ${SRCS}) -TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} cmzlib) +TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}) IF (UNIX) TARGET_LINK_LIBRARIES(CMakeLib ${CMAKE_DL_LIBS}) ENDIF (UNIX) diff --git a/Source/CTest/Curl/CMakeLists.txt b/Source/CTest/Curl/CMakeLists.txt index b29512d..b169a6c 100644 --- a/Source/CTest/Curl/CMakeLists.txt +++ b/Source/CTest/Curl/CMakeLists.txt @@ -124,6 +124,13 @@ MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) ENDIF(${VARIABLE}) ENDMACRO(CHECK_LIBRARY_EXISTS_CONCAT) +IF(CURL_SPECIAL_LIBZ) + SET(CURL_LIBS ${CURL_LIBS} "${CURL_SPECIAL_LIBZ}") + INCLUDE_DIRECTORIES(${CURL_SPECIAL_LIBZ_INCLUDES}) + SET(HAVE_LIBZ 0) + SET(HAVE_ZLIB_H 0) +ENDIF(CURL_SPECIAL_LIBZ) + # Check for all needed libraries CHECK_LIBRARY_EXISTS_CONCAT("dl" dlopen HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT("ucb" gethostname HAVE_LIBUCB) @@ -136,7 +143,9 @@ ENDIF(NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT("ws2_32" getch HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT("winmm" getch HAVE_LIBWINMM) -CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ) +IF(NOT CURL_SPECIAL_LIBZ) + CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ) +ENDIF(NOT CURL_SPECIAL_LIBZ) #OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF) MARK_AS_ADVANCED(CMAKE_USE_OPENSSL) @@ -206,7 +215,9 @@ IF(CMAKE_USE_OPENSSL) CHECK_INCLUDE_FILE_CONCAT("openssl/rand.h" HAVE_OPENSSL_RAND_H) ENDIF(CMAKE_USE_OPENSSL) -CHECK_INCLUDE_FILE_CONCAT("zlib.h" HAVE_ZLIB_H) +IF(NOT CURL_SPECIAL_LIBZ) + CHECK_INCLUDE_FILE_CONCAT("zlib.h" HAVE_ZLIB_H) +ENDIF(NOT CURL_SPECIAL_LIBZ) CHECK_INCLUDE_FILE_CONCAT("sys/socket.h" HAVE_SYS_SOCKET_H) CHECK_INCLUDE_FILE_CONCAT("netinet/in.h" HAVE_NETINET_IN_H) CHECK_INCLUDE_FILE_CONCAT("net/if.h" HAVE_NET_IF_H) @@ -503,13 +514,15 @@ ENDIF(NOT HAVE_IN_ADDR_T) # Fix libz / zlib.h -IF(NOT HAVE_LIBZ) - SET(HAVE_ZLIB_H 0) -ENDIF(NOT HAVE_LIBZ) +IF(NOT CURL_SPECIAL_LIBZ) + IF(NOT HAVE_LIBZ) + SET(HAVE_ZLIB_H 0) + ENDIF(NOT HAVE_LIBZ) -IF(NOT HAVE_ZLIB_H) - SET(HAVE_LIBZ 0) -ENDIF(NOT HAVE_ZLIB_H) + IF(NOT HAVE_ZLIB_H) + SET(HAVE_LIBZ 0) + ENDIF(NOT HAVE_ZLIB_H) +ENDIF(NOT CURL_SPECIAL_LIBZ) IF(_FILE_OFFSET_BITS) SET(_FILE_OFFSET_BITS 64) @@ -560,7 +573,6 @@ CONFIGURE_FILE(${LIBCURL_SOURCE_DIR}/config.h.in ${LIBCURL_BINARY_DIR}/config.h) ADD_LIBRARY(Curl ${libCurl_SRCS}) - TARGET_LINK_LIBRARIES(Curl ${CURL_LIBS}) OPTION(CURL_TESTING "Do libCurl testing" OFF) diff --git a/Source/CTest/Curl/config.h.in b/Source/CTest/Curl/config.h.in index c5fe652..1086027 100644 --- a/Source/CTest/Curl/config.h.in +++ b/Source/CTest/Curl/config.h.in @@ -507,3 +507,6 @@ /* define if the compiler supports number 0x3627676LL */ #cmakedefine HAVE_LONG_LONG_CONSTANT ${HAVE_LONG_LONG_CONSTANT} + +/* Special handling of zlib library */ +#cmakedefine CURL_SPECIAL_ZLIB_H "${CURL_SPECIAL_ZLIB_H}" diff --git a/Source/CTest/Curl/urldata.h b/Source/CTest/Curl/urldata.h index d951c93..144cba3 100644 --- a/Source/CTest/Curl/urldata.h +++ b/Source/CTest/Curl/urldata.h @@ -78,9 +78,14 @@ #include "timeval.h" #ifdef HAVE_ZLIB_H +#error goo #include /* for content-encoding */ #endif +#ifdef CURL_SPECIAL_ZLIB_H +#include CURL_SPECIAL_ZLIB_H +#endif + #ifdef USE_ARES #include #endif -- cgit v0.12