endif()
endmacro()
-# Convert the passed paths (or list of paths) to libpath linker options
-# and add them to CMAKE_REQUIRED_LINK_OPTIONS.
-macro(curl_required_libpaths)
- set(_libpaths "${ARGN}")
+# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_LINK_OPTIONS.
+macro(curl_required_libpaths _libpaths_arg)
+ set(_libpaths "${_libpaths_arg}")
foreach(_libpath IN LISTS _libpaths)
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
endforeach()
endif()
# Check for all needed libraries
-check_library_exists("socket" "connect" "" HAVE_LIBSOCKET)
-if(HAVE_LIBSOCKET)
- set(CURL_LIBS "socket;${CURL_LIBS}")
+if(NOT WIN32)
+ check_library_exists("socket" "connect" "" HAVE_LIBSOCKET)
+ if(HAVE_LIBSOCKET)
+ set(CURL_LIBS "socket;${CURL_LIBS}")
+ endif()
endif()
check_function_exists("gethostname" HAVE_GETHOSTNAME)
check_include_files("${_include_list};gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
if(GSS_FLAVOUR STREQUAL "MIT")
- check_include_files("${_include_list};gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
- if(HAVE_GSSAPI_GSSAPI_H)
- list(APPEND _include_list "gssapi/gssapi.h")
- endif()
+ check_include_files("${_include_list};gssapi/gssapi_krb5.h" _have_gssapi_gssapi_krb5_h)
if(HAVE_GSSAPI_GSSAPI_GENERIC_H)
list(APPEND _include_list "gssapi/gssapi_generic.h")
endif()
if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE)
set(CMAKE_REQUIRED_FLAGS "${GSS_CFLAGS} ${GSS_LDFLAGS}")
set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
- check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" ${_include_list} HAVE_GSS_C_NT_HOSTBASED_SERVICE)
+ check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE)
endif()
if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE)
set(HAVE_OLD_GSSMIT ON)
# Earlier MSVC compilers had faulty snprintf implementations
check_function_exists("snprintf" HAVE_SNPRINTF)
endif()
-check_function_exists("mach_absolute_time" HAVE_MACH_ABSOLUTE_TIME)
+if(APPLE)
+ check_function_exists("mach_absolute_time" HAVE_MACH_ABSOLUTE_TIME)
+endif()
check_symbol_exists("inet_ntop" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_NTOP) # arpa/inet.h
if(MSVC AND (MSVC_VERSION LESS_EQUAL 1600))
set(HAVE_INET_NTOP OFF)
endif()
cmake_push_check_state()
-set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
-check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T)
-set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T})
-cmake_pop_check_state()
-
if(WIN32)
- cmake_push_check_state()
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY)
set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY})
- cmake_pop_check_state()
+elseif(HAVE_SYS_SOCKET_H)
+ set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
+ check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T)
+ set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T})
endif()
+cmake_pop_check_state()
# Do curl specific tests
foreach(_curl_test IN ITEMS