← Back to team overview

maria-developers team mailing list archive

Re: Crash during configure without development SSL libraries installed

 

Hi, Vicențiu!

On Feb 12, Vicențiu Ciorbaru wrote:
> Hi Sergei!
> 
> The following error occurs while trying to configure MariaDB 10.0
> using the command "cmake ." without the development SSL libraries
> installed.
> 
> I've attached the patch to fix the errors.
> 
> === modified file 'cmake/ssl.cmake'
> --- cmake/ssl.cmake	2013-11-20 11:05:39 +0000
> +++ cmake/ssl.cmake	2015-02-12 10:45:19 +0000
> @@ -156,37 +156,37 @@
>        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}"
> +      )
>        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(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
> +

Not quite, sorry. CMAKE_REQUIRED_INCLUDES must be set before
CHECK_SYMBOL_EXISTS, because it's the variable that affects the check.
See "cmake --help-module CheckSymbolExists"

Also, I thought you can put CHECK_SYMBOL_EXISTS together with
SET(OPENSSL_FOUND TRUE) - there's no need to run the check if OpenSSL
isn't found. It doesn't do any harm, but is kind of a waste :)

>        SET(SSL_SOURCES "")
>        SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
>        IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
> 

Regards,
Sergei


References