diff options
Diffstat (limited to 'cmake/ssl.cmake')
-rw-r--r-- | cmake/ssl.cmake | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index c76e73927c0..6985932d165 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -174,15 +174,24 @@ MACRO (MYSQL_CHECK_SSL) OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" ) INCLUDE(CheckSymbolExists) + INCLUDE(CheckCSourceCompiles) SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" HAVE_SHA512_DIGEST_LENGTH) + CHECK_C_SOURCE_COMPILES(" + #include <openssl/dh.h> + int main() + { + DH dh; + return sizeof(dh.version); + }" OLD_OPENSSL_API) + SET(OPENSSL_FOUND TRUE) ELSE() SET(OPENSSL_FOUND FALSE) ENDIF() - IF(OPENSSL_FOUND AND OPENSSL_MAJOR_VERSION STRLESS "101" AND + IF(OPENSSL_FOUND AND OLD_OPENSSL_API AND HAVE_SHA512_DIGEST_LENGTH) MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}") |