Changeset: 88fab3f73d5f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=88fab3f73d5f
Modified Files:
        cmake/monetdb-defines.cmake
Branch: default
Log Message:

getaddrinfo functions requires more header files on Linux and pthread_kill and 
pthread_sigmask require linking to pthread library on Linux and FreeBSD (other 
BSDs we have to check but it doesn't matter now)


diffs (28 lines):

diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake
--- a/cmake/monetdb-defines.cmake
+++ b/cmake/monetdb-defines.cmake
@@ -57,7 +57,7 @@ function(monetdb_configure_defines)
   check_symbol_exists("gettimeofday" "sys/time.h" HAVE_SYS_TIME_H)
   # Linux specific, in the future, it might be ported to other platforms
   check_symbol_exists("S_ISREG" "sys/stat.h" HAVE_SYS_STAT_H)
-  check_symbol_exists("getaddrinfo" "netdb.h" UNIX_GETADDRINFO)
+  check_symbol_exists("getaddrinfo" "sys/types.h;sys/socket.h;netdb.h" 
UNIX_GETADDRINFO)
   check_symbol_exists("getaddrinfo" "ws2tcpip.h" WIN_GETADDRINFO)
   #check_symbol_exists("WSADATA" "winsock2.h" HAVE_WINSOCK_H)
   check_symbol_exists("fdatasync" "unistd.h" HAVE_FDATASYNC)
@@ -113,8 +113,13 @@ function(monetdb_configure_defines)
   check_function_exists("uname" HAVE_UNAME)
   # Some libc versions on Linux distributions don't have it
   check_symbol_exists("semtimedop" "sys/types.h;sys/ipc.h;sys/sem.h" 
HAVE_SEMTIMEDOP)
-  check_function_exists("pthread_kill" HAVE_PTHREAD_KILL)
-  check_function_exists("pthread_sigmask" HAVE_PTHREAD_SIGMASK)
+  cmake_push_check_state()
+    if (NOT APPLE)
+      set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};pthread")
+    endif()
+    check_symbol_exists("pthread_kill" "pthread.h;signal.h" HAVE_PTHREAD_KILL)
+    check_symbol_exists("pthread_sigmask" "pthread.h;signal.h" 
HAVE_PTHREAD_SIGMASK)
+  cmake_pop_check_state()
   check_symbol_exists("regcomp" "regex.h" HAVE_POSIX_REGEX)
 endfunction()
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to