make this build on SunOS/Solaris

This commit is contained in:
Pavel Maryanov 2017-10-10 14:05:28 +01:00 committed by moneromooo-monero
parent f48aeab5c4
commit a17efcb039
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
9 changed files with 42 additions and 3 deletions

View file

@ -36,6 +36,9 @@ if (NOT WIN32)
# add_definitions (-D_POSIX_C_SOURCE=200112L)
add_definitions (-D_XOPEN_SOURCE=600)
endif (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "DragonFly")
if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
add_definitions (-D__EXTENSIONS__ -std=c99)
endif ()
else (NOT WIN32)
add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
endif (NOT WIN32)

View file

@ -44,7 +44,12 @@ endif ()
set(RETSIGTYPE void)
if(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
add_definitions(-D_XOPEN_SOURCE=600)
else()
add_definitions(-D_GNU_SOURCE)
endif()
add_definitions(-std=c99)
option(USE_ECDSA "Use ECDSA algorithms" ON)
option(USE_SHA2 "Enable SHA2 support" ON)

View file

@ -49,6 +49,11 @@ if (WIN32)
iphlpapi
ws2_32)
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(CMAKE_REQUIRED_LIBRARIES
socket
nsl)
endif ()
check_function_exists(_beginthreadex HAVE__BEGINTHREADEX)
check_function_exists(arc4random HAVE_ARC4RANDOM)