Commit d30868d9 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

ENH: Make sure to use internal zlib

parent 2073646e
......@@ -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)
......
......@@ -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)
......
......@@ -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}"
......@@ -78,9 +78,14 @@
#include "timeval.h"
#ifdef HAVE_ZLIB_H
#error goo
#include <zlib.h> /* for content-encoding */
#endif
#ifdef CURL_SPECIAL_ZLIB_H
#include CURL_SPECIAL_ZLIB_H
#endif
#ifdef USE_ARES
#include <ares.h>
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment