← Back to team overview

maria-developers team mailing list archive

Crash during configure without development SSL libraries installed

 

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.


ERROR LOG:
----------------------

CMake Error at cmake/ssl.cmake:162 (FILE):
  file STRINGS file
  "/home/vicentiu/Workspace/MariaDB/10.0/OPENSSL_INCLUDE_DIR-NOTFOUND/openssl/opensslv.h"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:356 (MYSQL_CHECK_SSL)

Regards,
Vicentiu
=== 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})
+
       SET(SSL_SOURCES "")
       SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
       IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")


Follow ups