ENH: Attempt to speedup cmake of cmake on Windows

This commit is contained in:
Andy Cedilnik 2003-07-08 15:47:18 -04:00
parent db77d2e019
commit 4494326f5e
2 changed files with 207 additions and 196 deletions

View File

@ -31,64 +31,64 @@ INCLUDE (${LIBCURL_SOURCE_DIR}/CMake/CheckSymbolExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
SET(libCurl_SRCS
file.c
timeval.c
base64.c
hostip.c
progress.c
formdata.c
cookie.c
http.c
sendf.c
ftp.c
url.c
dict.c
if2ip.c
speedcheck.c
getdate.c
ldap.c
ssluse.c
version.c
getenv.c
escape.c
mprintf.c
telnet.c
getpass.c
netrc.c
getinfo.c
transfer.c
strequal.c
easy.c
security.c
krb4.c
http_chunks.c
strtok.c
connect.c
llist.c
hash.c
multi.c
content_encoding.c
)
file.c
timeval.c
base64.c
hostip.c
progress.c
formdata.c
cookie.c
http.c
sendf.c
ftp.c
url.c
dict.c
if2ip.c
speedcheck.c
getdate.c
ldap.c
ssluse.c
version.c
getenv.c
escape.c
mprintf.c
telnet.c
getpass.c
netrc.c
getinfo.c
transfer.c
strequal.c
easy.c
security.c
krb4.c
http_chunks.c
strtok.c
connect.c
llist.c
hash.c
multi.c
content_encoding.c
)
OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF)
MARK_AS_ADVANCED(CURL_MALLOC_DEBUG)
IF(CURL_MALLOC_DEBUG)
SET(libCurl_SRCS ${libCurl_SRCS}
memdebug.c
)
)
ENDIF(CURL_MALLOC_DEBUG)
# On windows preload settings
#IF(WIN32)
# INCLUDE(${LIBCURL_SOURCE_DIR}/Platforms/WindowsCache.cmake)
#ENDIF(WIN32)
IF(WIN32)
INCLUDE(${LIBCURL_SOURCE_DIR}/Platforms/WindowsCache.cmake)
ENDIF(WIN32)
# This macro checks if the symbol exists in the library and if it
# does, it appends library to the list.
SET(CURL_LIBS "")
MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
CHECK_LIBRARY_EXISTS("${LIBRARY};${CURL_LIBS}" ${SYMBOL} ""
${VARIABLE})
${VARIABLE})
IF(${VARIABLE})
SET(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
ENDIF(${VARIABLE})
@ -108,7 +108,10 @@ 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)
CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
IF(CMAKE_USE_OPENSSL)
CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
ENDIF(CMAKE_USE_OPENSSL)
# Check for symbol dlopen (same as HAVE_LIBDL)
CHECK_LIBRARY_EXISTS("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
@ -171,7 +174,7 @@ 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)
CHECK_INCLUDE_FILE_CONCAT("netinet/if_ether.h"
HAVE_NETINET_IF_ETHER_H)
HAVE_NETINET_IF_ETHER_H)
CHECK_INCLUDE_FILE_CONCAT("sys/select.h" HAVE_SYS_SELECT_H)
CHECK_INCLUDE_FILE_CONCAT("utime.h" HAVE_UTIME_H)
CHECK_INCLUDE_FILE_CONCAT("netinet/in.h" HAVE_NETINET_IN_H)
@ -268,19 +271,19 @@ ENDIF(NOT HAVE_SIGSETJMP)
MACRO(CURL_INTERNAL_TEST CURL_TEST)
IF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CURL_TEST_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ENDIF(CMAKE_REQUIRED_LIBRARIES)
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST}")
TRY_COMPILE(${CURL_TEST}
${CMAKE_BINARY_DIR}
${LIBCURL_SOURCE_DIR}/CMake/CurlTests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CURL_TEST_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
${CMAKE_BINARY_DIR}
${LIBCURL_SOURCE_DIR}/CMake/CurlTests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CURL_TEST_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
IF(${CURL_TEST})
SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
@ -296,40 +299,40 @@ ENDMACRO(CURL_INTERNAL_TEST)
# Do curl specific tests
FOREACH(CURL_TEST
TIME_WITH_SYS_TIME
HAVE_O_NONBLOCK
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYADDR_R_5_REENTRANT
HAVE_GETHOSTBYADDR_R_7_REENTRANT
HAVE_GETHOSTBYADDR_R_8_REENTRANT
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6
HAVE_GETHOSTBYNAME_R_3_REENTRANT
HAVE_GETHOSTBYNAME_R_5_REENTRANT
HAVE_GETHOSTBYNAME_R_6_REENTRANT
HAVE_SOCKLEN_T
HAVE_IN_ADDR_T
STDC_HEADERS
RETSIGTYPE_TEST
HAVE_INET_NTOA_R_DECL
HAVE_INET_NTOA_R_DECL_REENTRANT
HAVE_GETADDRINFO
)
TIME_WITH_SYS_TIME
HAVE_O_NONBLOCK
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYADDR_R_5_REENTRANT
HAVE_GETHOSTBYADDR_R_7_REENTRANT
HAVE_GETHOSTBYADDR_R_8_REENTRANT
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6
HAVE_GETHOSTBYNAME_R_3_REENTRANT
HAVE_GETHOSTBYNAME_R_5_REENTRANT
HAVE_GETHOSTBYNAME_R_6_REENTRANT
HAVE_SOCKLEN_T
HAVE_IN_ADDR_T
STDC_HEADERS
RETSIGTYPE_TEST
HAVE_INET_NTOA_R_DECL
HAVE_INET_NTOA_R_DECL_REENTRANT
HAVE_GETADDRINFO
)
CURL_INTERNAL_TEST(${CURL_TEST})
ENDFOREACH(CURL_TEST)
# Check for reentrant
FOREACH(CURL_TEST
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6
HAVE_INET_NTOA_R_DECL_REENTRANT)
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6
HAVE_INET_NTOA_R_DECL_REENTRANT)
IF(NOT ${CURL_TEST})
IF(${CURL_TEST}_REENTRANT)
SET(NEED_REENTRANT 1)
@ -339,12 +342,12 @@ ENDFOREACH(CURL_TEST)
IF(NEED_REENTRANT)
FOREACH(CURL_TEST
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6)
HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYNAME_R_3
HAVE_GETHOSTBYNAME_R_5
HAVE_GETHOSTBYNAME_R_6)
SET(${CURL_TEST} 0)
IF(${CURL_TEST}_REENTRANT)
SET(${CURL_TEST} 1)
@ -381,10 +384,10 @@ ENDIF(NOT HAVE_ZLIB_H)
SET(HAVE_SOME_NONBLOCK 0)
FOREACH(CURL_TEST
HAVE_FIONBIO
HAVE_IOCTLSOCKET
HAVE_IOCTLSOCKET_CASE
HAVE_O_NONBLOCK)
HAVE_FIONBIO
HAVE_IOCTLSOCKET
HAVE_IOCTLSOCKET_CASE
HAVE_O_NONBLOCK)
IF(${CURL_TEST})
SET(HAVE_SOME_NONBLOCK 1)
ENDIF(${CURL_TEST})
@ -405,7 +408,7 @@ INCLUDE_DIRECTORIES(${LIBCURL_SOURCE_DIR})
INCLUDE_DIRECTORIES(${LIBCURL_BINARY_DIR})
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
CONFIGURE_FILE(${LIBCURL_SOURCE_DIR}/config.h.in
${LIBCURL_BINARY_DIR}/config.h)
${LIBCURL_BINARY_DIR}/config.h)
ADD_LIBRARY(Curl STATIC ${libCurl_SRCS})

View File

@ -1,108 +1,116 @@
IF(NOT UNIX)
IF(WIN32)
#SET(HAVE_LIBWINMM 1)
SET(HAVE_LIBWS2_32 1)
SET(HAVE_GETHOSTBYADDR 1)
SET(HAVE_INET_ADDR 1)
SET(HAVE_INET_NTOA 1)
SET(HAVE_SELECT 1)
SET(HAVE_SOCKET 1)
SET(HAVE_ARPA_INET 1)
SET(HAVE_NETDB_H 1)
SET(HAVE_SYS_SOCKET_H 0)
SET(HAVE_TERMIO_H 1)
SET(HAVE_TERMIOS_H 1)
SET(HAVE_ARPA_INET_H 1)
SET(HAVE_UTIME_H 0)
SET(HAVE_CLOSESOCKET 1)
SET(HAVE_RAND_SCREEN 1)
SET(HAVE_RAND_STATUS 1)
SET(HAVE_SIGNAL 0)
SET(OPERATING_SYSTEM "win32")
SET(HAVE_SYS_TYPES_H 1)
SET(HAVE_INTTYPES_H 0)
SET(HAVE_ALLOCA_H 0)
SET(HAVE_DLFCN_H 0)
SET(HAVE_FCNTL_H 1)
SET(HAVE_MALLOC_H 1)
SET(HAVE_MEMORY_H 1)
SET(HAVE_NETINET_IN_H 0)
SET(HAVE_NETINET_IF_ETHER_H 0)
SET(HAVE_NET_IF_H 0)
SET(HAVE_PWD_H 0)
SET(HAVE_SGTTY_H 0)
SET(HAVE_STDINT_H 0)
SET(HAVE_STDLIB_H 1)
SET(HAVE_STRING_H 1)
SET(HAVE_STRINGS_H 0)
SET(HAVE_SYS_PARAM_H 0)
SET(HAVE_SYS_SELECT_H 0)
SET(HAVE_SYS_SOCKIO_H 1)
SET(HAVE_SYS_STAT_H 1)
SET(HAVE_SYS_TIME_H 0)
SET(HAVE_IO_H 1)
SET(HAVE_TIME_H 1)
SET(HAVE_WINSOCK_H 1)
SET(HAVE_SOCK_H 0)
SET(HAVE_X509_H 0)
SET(SIZEOF_SSIZE_T 0)
SET(HAVE_STRDUP 1)
SET(HAVE_STRSTR 1)
SET(HAVE_STRTOK_R 0)
SET(HAVE_STRFTIME 1)
SET(HAVE_UNAME 0)
SET(HAVE_STRCASECMP 0)
SET(HAVE_STRICMP 1)
SET(HAVE_STRCMPI 0)
SET(HAVE_GETTIMEOFDAY 0)
SET(HAVE_TCGETATTR 0)
SET(HAVE_PERROR 1)
SET(HAVE_SETVBUF 1)
SET(HAVE_SIGACTION 0)
SET(HAVE_GETPASS_R 0)
SET(HAVE_STRLCAT 0)
SET(HAVE_GETPWUID 0)
SET(HAVE_GETEUID 0)
SET(HAVE_UTIME 0)
SET(HAVE_RAND_STATUS 0)
SET(HAVE_RAND_EGD 0)
SET(HAVE_DLOPEN 0)
SET(HAVE_CONNECT 0)
SET(HAVE_GETHOSTBYNAME 0)
SET(HAVE_LOCALTIME_R 0)
SET(HAVE_GMTIME_R 0)
SET(HAVE_LIBNSL 0)
SET(HAVE_LIBUCB 0)
SET(HAVE_LIBDL 0)
SET(HAVE_LIBSOCKET 0)
SET(HAVE_UNISTD_H 0)
SET(HAVE_SYS_UTIME_H 1)
SET(HAVE_SOCKIO_H 0)
SET(HAVE_INET_NTOA_R 0)
SET(HAVE_TCSETATTR 0)
SET(HAVE_GETHOSTBYNAME_R 0)
SET(HAVE_GETHOSTBYADDR_R 0)
SET(TIME_WITH_SYS_TIME 0)
SET(HAVE_O_NONBLOCK 0)
SET(HAVE_GETHOSTBYADDR_R_5 0)
SET(HAVE_GETHOSTBYADDR_R_7 0)
SET(HAVE_GETHOSTBYADDR_R_8 0)
SET(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_3 0)
SET(HAVE_GETHOSTBYNAME_R_5 0)
SET(HAVE_GETHOSTBYNAME_R_6 0)
SET(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
SET(HAVE_SOCKLEN_T 0)
SET(HAVE_IN_ADDR_T 0)
SET(STDC_HEADERS 1)
SET(RETSIGTYPE_TEST 1)
IF(WIN32)
SET(HAVE_LIBDL 0)
SET(HAVE_LIBUCB 0)
SET(HAVE_LIBSOCKET 0)
SET(NOT_NEED_LIBNSL 0)
SET(HAVE_LIBNSL 0)
SET(HAVE_LIBZ 0)
SET(HAVE_LIBCRYPTO 0)
ELSE(WIN32)
MESSAGE("This file should be included on Windows platform only")
ENDIF(WIN32)
SET(HAVE_DLOPEN 0)
SET(HAVE_ALLOCA_H 0)
SET(HAVE_ARPA_INET_H 0)
SET(HAVE_DLFCN_H 0)
SET(HAVE_FCNTL_H 1)
SET(HAVE_FEATURES_H 0)
SET(HAVE_INTTYPES_H 0)
SET(HAVE_IO_H 1)
SET(HAVE_MALLOC_H 1)
SET(HAVE_MEMORY_H 1)
SET(HAVE_NETDB_H 0)
SET(HAVE_NETINET_IF_ETHER_H 0)
SET(HAVE_NETINET_IN_H 0)
SET(HAVE_NET_IF_H 0)
SET(HAVE_PWD_H 0)
SET(HAVE_SETJMP_H 1)
SET(HAVE_SGTTY_H 0)
SET(HAVE_SIGNAL_H 1)
SET(HAVE_SOCKIO_H 0)
SET(HAVE_STDINT_H 0)
SET(HAVE_STDLIB_H 1)
SET(HAVE_STRINGS_H 0)
SET(HAVE_STRING_H 1)
SET(HAVE_SYS_PARAM_H 0)
SET(HAVE_SYS_POLL_H 0)
SET(HAVE_SYS_SELECT_H 0)
SET(HAVE_SYS_SOCKET_H 0)
SET(HAVE_SYS_SOCKIO_H 0)
SET(HAVE_SYS_STAT_H 1)
SET(HAVE_SYS_TIME_H 0)
SET(HAVE_SYS_TYPES_H 1)
SET(HAVE_SYS_UTIME_H 1)
SET(HAVE_TERMIOS_H 0)
SET(HAVE_TERMIO_H 0)
SET(HAVE_TIME_H 1)
SET(HAVE_UNISTD_H 0)
SET(HAVE_UTIME_H 0)
SET(HAVE_WINSOCK_H 1)
SET(HAVE_X509_H 0)
SET(HAVE_ZLIB_H 0)
SET(HAVE_SOCKET 1)
SET(HAVE_POLL 0)
SET(HAVE_SELECT 1)
SET(HAVE_STRDUP 1)
SET(HAVE_STRSTR 1)
SET(HAVE_STRTOK_R 0)
SET(HAVE_STRFTIME 1)
SET(HAVE_UNAME 0)
SET(HAVE_STRCASECMP 0)
SET(HAVE_STRICMP 1)
SET(HAVE_STRCMPI 1)
SET(HAVE_GETHOSTBYADDR 1)
SET(HAVE_GETTIMEOFDAY 0)
SET(HAVE_INET_ADDR 1)
SET(HAVE_INET_NTOA 1)
SET(HAVE_INET_NTOA_R 0)
SET(HAVE_TCGETATTR 0)
SET(HAVE_TCSETATTR 0)
SET(HAVE_PERROR 1)
SET(HAVE_CLOSESOCKET 1)
SET(HAVE_SETVBUF 0)
SET(HAVE_SIGSETJMP 0)
SET(HAVE_GETPASS_R 0)
SET(HAVE_STRLCAT 0)
SET(HAVE_GETPWUID 0)
SET(HAVE_GETEUID 0)
SET(HAVE_UTIME 1)
SET(HAVE_RAND_EGD 0)
SET(HAVE_RAND_SCREEN 0)
SET(HAVE_RAND_STATUS 0)
SET(HAVE_GMTIME_R 0)
SET(HAVE_LOCALTIME_R 0)
SET(HAVE_GETHOSTBYADDR_R 0)
SET(HAVE_GETHOSTBYNAME_R 0)
SET(HAVE_SIGNAL_FUNC 1)
SET(HAVE_SIGNAL_MACRO 0)
SET(HAVE_GETHOSTBYADDR_R_5 0)
SET(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_7 0)
SET(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_8 0)
SET(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_3 0)
SET(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_5 0)
SET(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_6 0)
SET(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
SET(TIME_WITH_SYS_TIME 0)
SET(HAVE_O_NONBLOCK 0)
SET(HAVE_SOCKLEN_T 0)
SET(HAVE_INET_NTOA_R_DECL 0)
SET(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
SET(HAVE_GETADDRINFO 0)
SET(STDC_HEADERS 1)
SET(RETSIGTYPE_TEST 1)
ELSE(WIN32)
MESSAGE("This file should be included on Windows platform only")
ENDIF(WIN32)
ENDIF(NOT UNIX)