Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5463

cmake with default parameters fails if there is no SSL library in the system

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 10.0.6
    • N/A
    • N/A
    • Linux

    Description

      The default value for WITH_SSL on non-Windows in 10.0 is "yes", which is supposed to prefer the system library if there is one, and retreat to the bundled otherwise. But it doesn't work this way:

      cmake .
       
      ...
      -- Looking for deflateBound - found
      -- suffixes <.so;.a>
      CMake Error at cmake/ssl.cmake:162 (FILE):
        file STRINGS file
        "/home/elenst/bzr/10.0-release/OPENSSL_INCLUDE_DIR-NOTFOUND/openssl/opensslv.h"
        cannot be read.
      Call Stack (most recent call first):
        CMakeLists.txt:271 (MYSQL_CHECK_SSL)
       
       
      -- OPENSSL_INCLUDE_DIR = OPENSSL_INCLUDE_DIR-NOTFOUND
      -- OPENSSL_LIBRARIES = OPENSSL_LIBRARIES-NOTFOUND
      -- CRYPTO_LIBRARY = CRYPTO_LIBRARY-NOTFOUND
      -- OPENSSL_MAJOR_VERSION = 
      -- Looking for SHA512_DIGEST_LENGTH
      -- Looking for SHA512_DIGEST_LENGTH - not found.
      -- Check size of mbstate_t
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of mbstate_t - failed
      -- Performing Test HAVE_LANGINFO_CODESET
       
      ...
       
      -- Looking for iswctype - found
      -- Check size of wchar_t
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of wchar_t - failed
      -- Check size of wctype_t
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of wctype_t - failed
      -- Check size of wint_t
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of wint_t - failed
      -- Found Curses: /usr/lib/x86_64-linux-gnu/libcurses.so  
       
       
      ...
       
      -- Looking for asprintf - found
      -- Check size of pthread_t
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of pthread_t - failed
      -- Configuring OQGraph
       
      ...
       
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      OPENSSL_INCLUDE_DIR
         used as include directory in directory /home/elenst/bzr/10.0-release/CMakeFiles/CMakeTmp
       
      CMake Error: Internal CMake error, TryCompile configure of cmake failed
      -- Check size of unsigned long long - failed

      This is what seemingly makes it work, although I'm not quite sure it's the right way (specifically, I doubt about moving INCLUDE(CheckSymbolExists) as I don't know what it is supposed to do, exactly).

      === modified file 'cmake/ssl.cmake'
      --- cmake/ssl.cmake	2013-11-20 11:05:39 +0000
      +++ cmake/ssl.cmake	2013-12-18 12:26:54 +0000
      @@ -156,23 +156,26 @@
             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
             )
             SET(OPENSSL_FOUND TRUE)
      +      # 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)
      +      )
           ELSE()
             SET(OPENSSL_FOUND FALSE)
           ENDIF()
      @@ -182,10 +185,6 @@
           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)
             SET(SSL_SOURCES "")
             SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.