diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-02-12 15:44:44 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-02-12 15:44:44 +0200 |
commit | 356ae629f0b8ecd5e4b277bdaedf6d55ce09a603 (patch) | |
tree | d94a5ea6befd26218c5d6ae8ea6575d8f509cdbf /cmake | |
parent | 56da6252f7db32bc966f4c46e9cf444e78a2eb35 (diff) | |
download | mariadb-git-356ae629f0b8ecd5e4b277bdaedf6d55ce09a603.tar.gz |
Crash during configure without development SSL libraries installed
Incorrect usage of OPENSSL_INCLUDE_DIR variable within cmake caused the
configure step to fail. The variable was used before being checked if
the include directory actually existed.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/ssl.cmake | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index 2a8d1f17fbc..26df7a47e0a 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -156,37 +156,37 @@ MACRO (MYSQL_CHECK_SSL) LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) ENDIF() - # Verify version number. Version information looks like: - # #define OPENSSL_VERSION_NUMBER 0x1000103fL - # Encoded as MNNFFPPS: major minor fix patch status - FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" - OPENSSL_VERSION_NUMBER - REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" - ) - STRING(REGEX REPLACE - "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" - OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" - ) - IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND CRYPTO_LIBRARY ) + # Verify version number. Version information looks like: + # #define OPENSSL_VERSION_NUMBER 0x1000103fL + # Encoded as MNNFFPPS: major minor fix patch status + FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" + OPENSSL_VERSION_NUMBER + REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" + ) + STRING(REGEX REPLACE + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" + OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" + ) + INCLUDE(CheckSymbolExists) + SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) + CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" + HAVE_SHA512_DIGEST_LENGTH) SET(OPENSSL_FOUND TRUE) ELSE() SET(OPENSSL_FOUND FALSE) ENDIF() - MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") - MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}") - MESSAGE(STATUS "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}") - MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}") - - INCLUDE(CheckSymbolExists) - SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) - CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" - HAVE_SHA512_DIGEST_LENGTH) IF(OPENSSL_FOUND AND HAVE_SHA512_DIGEST_LENGTH) + MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") + MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}") + MESSAGE(STATUS "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}") + MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}") + + SET(SSL_SOURCES "") SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY}) IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") |