diff options
Diffstat (limited to 'external/unbound')
-rw-r--r-- | external/unbound/CMakeLists.txt | 14 | ||||
-rw-r--r-- | external/unbound/configure_checks.cmake | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/external/unbound/CMakeLists.txt b/external/unbound/CMakeLists.txt index 3dae8b425..a2e475232 100644 --- a/external/unbound/CMakeLists.txt +++ b/external/unbound/CMakeLists.txt @@ -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) @@ -60,6 +65,15 @@ if (CMAKE_USE_WIN32_THREADS_INIT) else () set(HAVE_WINDOWS_THREADS 0) endif () + +# determine if we have libressl +check_symbol_exists(LIBRESSL_VERSION_TEXT "openssl/opensslv.h" HAVE_LIBRESSL) +# check if we have found HAVE_DECL_REALLOCARRAY already, so we can safely undefine and redefine it with value 1 +if (HAVE_LIBRESSL AND HAVE_DECL_REALLOCARRAY) + unset(HAVE_DECL_REALLOCARRAY CACHE) + add_definitions(-DHAVE_DECL_REALLOCARRAY=1) +endif () + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h") diff --git a/external/unbound/configure_checks.cmake b/external/unbound/configure_checks.cmake index 258f28138..2acf556d1 100644 --- a/external/unbound/configure_checks.cmake +++ b/external/unbound/configure_checks.cmake @@ -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) |