Changeset: 6cd8460abf77 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6cd8460abf77 Modified Files: CMakeLists.txt monetdb_config.h.in sql/backends/monet5/UDF/pyapi/undef.h Branch: cmake-fun Log Message:
Compilation fixes. diffs (138 lines): diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -906,14 +906,14 @@ set(DL_LIBRARIES "") set(MATH_LIBRARIES "") set(PSAPI_LIBRARIES "") if(UNIX) - find_library(M_LIBRARY NAMES m DOC "m library to link") set(DL_LIBRARIES "${CMAKE_DL_LIBS}") -endif() -if(M_LIBRARY) - set(MATH_LIBRARIES "${M_LIBRARY}") + set(MATH_LIBRARIES "m") endif() if(WIN32) find_library(PSAPI_LIBRARY NAMES Psapi psapi DOC "psapi library to link") + if("${PSAPI_LIBRARY}" STREQUAL "") + message(FATAL_ERROR "Psapi library is required to compile MonetDB on Windows") + endif() endif() if(PSAPI_LIBRARY) set(PSAPI_LIBRARIES "${PSAPI_LIBRARY}") @@ -1113,14 +1113,12 @@ else() message(WARNING "${WHY_NOT_MONETDB5}") endif() endif() + elseif(${ENABLE_MONETDB5} STREQUAL "YES") + message(FATAL_ERROR "OpenSSL library not found but required for MonetDB5") else() - if(${ENABLE_MONETDB5} STREQUAL "YES") - message(FATAL_ERROR "OpenSSL library not found but required for MonetDB5") - else() - set(ENABLE_MONETDB5 "NO") - set(WHY_NOT_MONETDB5 "OpenSSL library not found but required for MonetDB5") - message(WARNING "${WHY_NOT_MONETDB5}") - endif() + set(ENABLE_MONETDB5 "NO") + set(WHY_NOT_MONETDB5 "OpenSSL library not found but required for MonetDB5") + message(WARNING "${WHY_NOT_MONETDB5}") endif() endif() endif() @@ -1672,7 +1670,6 @@ if(${WITH_GDAL} STREQUAL "NO") set(ENABLE_SHP "NO") endif() endif() - if(NOT ${WITH_GDAL} STREQUAL "NO") include(FindGDAL) @@ -1832,7 +1829,19 @@ check_include_file("winsock.h" HAVE_WINS # Socket libraries set(SOCKET_LIBRARIES ) if(MSVC) - list(APPEND SOCKET_LIBRARIES wsock32 Ws2_32) + set(HAVE_GETADDRINFO ON) + find_library(WSOCK32_LIBRARY NAMES Wsock32 wsock32) + if(WSOCK32_LIBRARY) + list(APPEND SOCKET_LIBRARIES "${WSOCK32_LIBRARY}") + else() + message(FATAL_ERROR "Wsock32 library is missing and required to compile MonetDB on Windows") + endif() + find_library(WS2_32_LIBRARY NAMES Ws2_32 ws2_32) + if(WS2_32_LIBRARY) + list(APPEND SOCKET_LIBRARIES "${WS2_32_LIBRARY}") + else() + message(FATAL_ERROR "ws2_32 library is missing and required to compile MonetDB on Windows") + endif() else() check_symbol_exists("gethostbyname" "netdb.h;sys/socket.h" HAVE_GETHOSTBYNAME) if(NOT HAVE_GETHOSTBYNAME) @@ -1901,8 +1910,8 @@ else() endif() cmake_push_check_state() -if(HAVE_WINSOCK_H) - set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES};winsock.h") +if(MSVC) + set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES};WS2tcpip.h;winsock.h") else() set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES};sys/types.h;sys/socket.h") endif() @@ -2032,11 +2041,14 @@ check_symbol_exists("popen" "stdio.h" HA check_symbol_exists("posix_fadvise" "fcntl.h" HAVE_POSIX_FADVISE) check_symbol_exists("posix_fallocate" "fcntl.h" HAVE_POSIX_FALLOCATE) check_symbol_exists("posix_madvise" "sys/mman.h" HAVE_POSIX_MADVISE) -check_symbol_exists("putenv" "stdlib.h" HAVE_PUTENV) check_symbol_exists("semtimedop" "sys/types.h;sys/ipc.h;sys/sem.h" HAVE_SEMTIMEDOP) check_symbol_exists("setenv" "stdlib.h" HAVE_SETENV) check_symbol_exists("setsid" "sys/types.h;unistd.h" HAVE_SETSID) -check_symbol_exists("shutdown" "sys/socket.h" HAVE_SHUTDOWN) +if(MSVC) + set(HAVE_SHUTDOWN ON) # check_symbol_exists on Windows doesn't link to aditional libraries +else() + check_symbol_exists("shutdown" "sys/socket.h" HAVE_SHUTDOWN) +endif() check_symbol_exists("sigaction" "signal.h" HAVE_SIGACTION) check_symbol_exists("stpcpy" "string.h" HAVE_STPCPY) check_symbol_exists("strcasestr" "string.h" HAVE_STRCASESTR) @@ -2048,8 +2060,12 @@ check_symbol_exists("sysconf" "unistd.h" check_symbol_exists("task_info" "mach/task_info.h" HAVE_TASK_INFO) check_symbol_exists("times" "sys/times.h" HAVE_TIMES) check_symbol_exists("uname" "sys/utsname.h" HAVE_UNAME) -check_symbol_exists("_wfopen" "stdio.h" HAVE__WFOPEN) -check_symbol_exists("_mul128" "intrin.h" HAVE__MUL128) +if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8) # Windows 64 bit + set(HAVE__MUL128 ON) +else() + check_symbol_exists("_mul128" "intrin.h" HAVE__MUL128) +endif() +check_symbol_exists("_wfopen_s" "wchar.h" HAVE__WFOPEN) # Check for _wfopen_s to avoid warnings check_symbol_exists("_stat64" "sys/types.h;sys/stat.h" HAVE_STAT64) if(HAVE_ASCTIME_R) diff --git a/monetdb_config.h.in b/monetdb_config.h.in --- a/monetdb_config.h.in +++ b/monetdb_config.h.in @@ -362,9 +362,6 @@ /* Define if you have the pthread_sigmask function */ #cmakedefine HAVE_PTHREAD_SIGMASK -/* Define if you have the `putenv' function. */ -#cmakedefine HAVE_PUTENV - /* Define if you have the <pwd.h> header file. */ #cmakedefine HAVE_PWD_H diff --git a/sql/backends/monet5/UDF/pyapi/undef.h b/sql/backends/monet5/UDF/pyapi/undef.h --- a/sql/backends/monet5/UDF/pyapi/undef.h +++ b/sql/backends/monet5/UDF/pyapi/undef.h @@ -22,7 +22,6 @@ #undef EXEC_PREFIX #undef SIZEOF_VOID_P #undef SIZEOF_SIZE_T -#undef HAVE_PUTENV #undef HAVE_FTIME #undef snprintf #undef vsnprintf _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list