diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-01-14 12:33:52 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-01-21 17:30:07 +0100 |
commit | 0d3c49ef5de3fa7356851dd7a05052f5360d0ae6 (patch) | |
tree | ad39975fd533924fe4e2732bcbbb47378b54dbfb /cmake | |
parent | e292d1a800312f4e0330a519e0d980e27a7172f3 (diff) | |
download | mariadb-git-0d3c49ef5de3fa7356851dd7a05052f5360d0ae6.tar.gz |
MDEV-17615 cmake ssl error on musl/libressl
don't shortcut trying to test for openssl version,
test what is actually needed for a code to compile
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/ssl.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index 0c6cde31299..60d2cb48387 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -71,15 +71,23 @@ MACRO (MYSQL_CHECK_SSL) FIND_LIBRARY(CRYPTO_LIBRARY crypto) MARK_AS_ADVANCED(CRYPTO_LIBRARY) INCLUDE(CheckSymbolExists) + INCLUDE(CheckCSourceCompiles) SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" HAVE_SHA512_DIGEST_LENGTH) CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h" HAVE_ERR_remove_thread_state) + CHECK_C_SOURCE_COMPILES(" + #include <openssl/dh.h> + int main() + { + DH dh; + return sizeof(dh.version); + }" OLD_OPENSSL_API) SET(CMAKE_REQUIRED_INCLUDES) SET(CMAKE_REQUIRED_LIBRARIES) - IF(OPENSSL_FOUND AND OPENSSL_VERSION VERSION_LESS "1.1.0" AND + IF(OPENSSL_FOUND AND OLD_OPENSSL_API AND CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH) SET(SSL_SOURCES "") SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY}) |