Commit 417c53af authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in fix for xcode 3.1 build from main tree

parent e5d5a646
......@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 1)
SET(CMake_VERSION_RC 10)
SET(CMake_VERSION_RC 11)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
......
Changes in CMake 2.6.1 RC 11
- Fix curl build issue with Xcode 3.1
Changes in CMake 2.6.1 RC 10
- Add a fix for bug # 7340, CMAKE_USER_MAKE_RULES_OVERRIDE was
not able to support a try-compile in cmake 2.6
......
# - Check if the source code provided in the SOURCE argument compiles.
# CHECK_C_SOURCE_COMPILES(SOURCE VAR)
# CURL_CHECK_C_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles
# SOURCE - source code to try to compile
# VAR - variable to store whether the source code compiled
......@@ -12,7 +12,7 @@
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
SET(message "${VAR}")
# If the number of arguments is greater than 2 (SOURCE VAR)
......@@ -23,16 +23,16 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
SET(src "")
FOREACH(def ${EXTRA_DEFINES})
......@@ -53,8 +53,8 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${message}")
......@@ -72,4 +72,4 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
"Source file was:\n${src}\n")
ENDIF(${VAR})
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
ENDMACRO(CHECK_C_SOURCE_COMPILES)
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
# - Check if the source code provided in the SOURCE argument compiles and runs.
# CHECK_C_SOURCE_RUNS(SOURCE VAR)
# CURL_CHECK_C_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code runs
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
......@@ -12,7 +12,7 @@
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
MACRO(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
SET(message "${VAR}")
# If the number of arguments is greater than 2 (SOURCE VAR)
......@@ -23,16 +23,16 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
SET(src "")
FOREACH(def ${EXTRA_DEFINES})
......@@ -53,8 +53,8 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
IF(NOT ${VAR}_COMPILED)
......@@ -80,4 +80,4 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
"Source file was:\n${src}\n")
ENDIF("${result_var}" EQUAL 0)
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
ENDMACRO(CHECK_C_SOURCE_RUNS)
ENDMACRO(CURL_CHECK_C_SOURCE_RUNS)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CurlCheckCSourceCompiles)
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
SET(HEADER_INCLUDES)
SET(headers_hack)
......@@ -28,7 +28,7 @@ ENDIF(HAVE_WINDOWS_H)
SET(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CHECK_C_SOURCE_COMPILES("recv(0, 0, 0, 0)" curl_cv_recv)
CURL_CHECK_C_SOURCE_COMPILES("recv(0, 0, 0, 0)" curl_cv_recv)
IF(curl_cv_recv)
# AC_CACHE_CHECK([types of arguments and return type for recv],
#[curl_cv_func_recv_args], [
......@@ -44,7 +44,7 @@ IF(curl_cv_recv)
SET(curl_cv_func_recv_test "UNKNOWN")
SET(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CHECK_C_SOURCE_COMPILES("
CURL_CHECK_C_SOURCE_COMPILES("
${recv_arg1} s=0;
${recv_arg2} buf=0;
${recv_arg3} len=0;
......@@ -91,7 +91,7 @@ ENDIF(curl_cv_recv)
SET(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
SET(HAVE_RECV 1)
CHECK_C_SOURCE_COMPILES("send(0, 0, 0, 0)" curl_cv_send)
CURL_CHECK_C_SOURCE_COMPILES("send(0, 0, 0, 0)" curl_cv_send)
IF(curl_cv_send)
# AC_CACHE_CHECK([types of arguments and return type for send],
#[curl_cv_func_send_args], [
......@@ -107,7 +107,7 @@ IF(curl_cv_send)
SET(curl_cv_func_send_test "UNKNOWN")
SET(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CHECK_C_SOURCE_COMPILES("
CURL_CHECK_C_SOURCE_COMPILES("
${send_arg1} s=0;
${send_arg2} buf=0;
${send_arg3} len=0;
......@@ -161,7 +161,7 @@ SET(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments
SET(HAVE_SEND 1)
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CHECK_C_SOURCE_COMPILES("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
CURL_CHECK_C_SOURCE_COMPILES("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
SET(HEADER_INCLUDES)
......@@ -190,16 +190,16 @@ ELSE(HAVE_WINDOWS_H)
add_header_include(HAVE_TIME_H "time.h")
ENDIF(HAVE_WINDOWS_H)
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
INCLUDE(CheckCSourceRuns)
INCLUDE(CurlCheckCSourceRuns)
SET(EXTRA_DEFINES)
SET(HEADER_INCLUDES)
IF(HAVE_SYS_POLL_H)
SET(HEADER_INCLUDES "sys/poll.h")
ENDIF(HAVE_SYS_POLL_H)
CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
SET(HAVE_SIG_ATOMIC_T 1)
SET(EXTRA_DEFINES)
......@@ -210,7 +210,7 @@ IF(HAVE_SIGNAL_H)
ENDIF(HAVE_SIGNAL_H)
CHECK_TYPE_SIZE("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
IF(HAVE_SIZEOF_SIG_ATOMIC_T)
CHECK_C_SOURCE_COMPILES("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
CURL_CHECK_C_SOURCE_COMPILES("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
IF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
SET(HAVE_SIG_ATOMIC_T_VOLATILE 1)
ENDIF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
......
......@@ -675,15 +675,19 @@ ELSE(RETSIGTYPE_TEST)
ENDIF(RETSIGTYPE_TEST)
IF(CMAKE_COMPILER_IS_GNUCC AND APPLE)
# The Mac version of GCC warns about use of long double. Disable it.
GET_SOURCE_FILE_PROPERTY(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
IF(MPRINTF_COMPILE_FLAGS)
SET(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
ELSE(MPRINTF_COMPILE_FLAGS)
SET(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
ENDIF(MPRINTF_COMPILE_FLAGS)
SET_SOURCE_FILES_PROPERTIES(mprintf.c PROPERTIES
COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
INCLUDE(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
IF(HAVE_C_FLAG_Wno_long_double)
# The Mac version of GCC warns about use of long double. Disable it.
GET_SOURCE_FILE_PROPERTY(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
IF(MPRINTF_COMPILE_FLAGS)
SET(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
ELSE(MPRINTF_COMPILE_FLAGS)
SET(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
ENDIF(MPRINTF_COMPILE_FLAGS)
SET_SOURCE_FILES_PROPERTIES(mprintf.c PROPERTIES
COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
ENDIF(HAVE_C_FLAG_Wno_long_double)
ENDIF(CMAKE_COMPILER_IS_GNUCC AND APPLE)
INCLUDE(CMake/OtherTests.cmake)
......
Markdown is supported
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