refactor: Assume inet_atom on unix
ported ed2d44c346\#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
This commit is contained in:
committed by
Nick Bolton
parent
6ff8b053af
commit
90d6fc6f08
@ -121,31 +121,6 @@ macro(configure_unix_libs)
|
||||
message(FATAL_ERROR "Missing posix sigwait")
|
||||
endif()
|
||||
|
||||
check_function_exists(inet_aton HAVE_INET_ATON)
|
||||
|
||||
# For some reason, the check_function_exists macro doesn't detect the
|
||||
# inet_aton on some pure Unix platforms (e.g. sunos5). So we need to do a more
|
||||
# detailed check and also include some extra libs.
|
||||
if(NOT HAVE_INET_ATON)
|
||||
set(CMAKE_REQUIRED_LIBRARIES nsl)
|
||||
|
||||
check_c_source_compiles(
|
||||
"#include <arpa/inet.h>\n int main() { inet_aton (0, 0); }"
|
||||
HAVE_INET_ATON_ADV)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
if(HAVE_INET_ATON_ADV)
|
||||
# Override the previous fail.
|
||||
set(HAVE_INET_ATON 1)
|
||||
|
||||
# Assume that both nsl and socket will be needed, it seems safe to add
|
||||
# socket on the back of nsl, since socket only ever needed when nsl is
|
||||
# needed.
|
||||
list(APPEND libs nsl socket)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# pthread is used on both Linux and Mac
|
||||
check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
|
||||
Reference in New Issue
Block a user