summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-12 18:16:51 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-12 18:16:51 +0200
commitcacb57b7c2762e91d3fac89b0ee4753a3ad8a6e4 (patch)
tree024d006af3cf2228d9d05e6ae4c17e0bb0178219
parent0aa6817e861bf9f63c819c60077921d53b90727b (diff)
downloadmariadb-git-cacb57b7c2762e91d3fac89b0ee4753a3ad8a6e4.tar.gz
pass openssl config to C/C
* set OPENSSL_FOUND * use FindOpenSSL.cmake compatible variable names in ssl.cmake * show openssl version in full
-rw-r--r--cmake/mariadb_connector_c.cmake1
-rw-r--r--cmake/ssl.cmake39
m---------libmariadb0
3 files changed, 20 insertions, 20 deletions
diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake
index cd45ab1a457..5dc1b2ab2de 100644
--- a/cmake/mariadb_connector_c.cmake
+++ b/cmake/mariadb_connector_c.cmake
@@ -35,6 +35,7 @@ IF(SSL_DEFINES MATCHES "YASSL")
ENDIF()
ELSE()
SET(CONC_WITH_SSL "OPENSSL")
+ SET(OPENSSL_FOUND TRUE)
ENDIF()
SET(CONC_WITH_CURL OFF)
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 0173cf026f1..9f2c8797d2c 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -111,9 +111,9 @@ MACRO (MYSQL_CHECK_SSL)
UNSET(OPENSSL_APPLINK_C)
UNSET(OPENSSL_APPLINK_C CACHE)
ENDIF()
- IF (OPENSSL_LIBRARIES)
- UNSET(OPENSSL_LIBRARIES)
- UNSET(OPENSSL_LIBRARIES CACHE)
+ IF (OPENSSL_SSL_LIBRARY)
+ UNSET(OPENSSL_SSL_LIBRARY)
+ UNSET(OPENSSL_SSL_LIBRARY CACHE)
ENDIF()
ELSEIF(WITH_SSL STREQUAL "system" OR
WITH_SSL STREQUAL "yes" OR
@@ -149,13 +149,13 @@ MACRO (MYSQL_CHECK_SSL)
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
ENDIF()
- FIND_LIBRARY(OPENSSL_LIBRARIES
+ FIND_LIBRARY(OPENSSL_SSL_LIBRARY
NAMES ssl ssleay32 ssleay32MD
HINTS ${OPENSSL_ROOT_DIR}/lib)
- FIND_LIBRARY(CRYPTO_LIBRARY
+ FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
NAMES crypto libeay32
HINTS ${OPENSSL_ROOT_DIR}/lib)
- MARK_AS_ADVANCED(CRYPTO_LIBRARY OPENSSL_LIBRARIES OPENSSL_ROOT_DIR
+ MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY OPENSSL_ROOT_DIR
OPENSSL_INCLUDE_DIR)
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
@@ -166,10 +166,10 @@ MACRO (MYSQL_CHECK_SSL)
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
SET(CMAKE_REQUIRED_INCLUDES)
- IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND
- CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
+ IF(OPENSSL_INCLUDE_DIR AND OPENSSL_SSL_LIBRARY AND
+ OPENSSL_CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
SET(SSL_SOURCES "")
- SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
+ SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBSOCKET})
ENDIF()
@@ -181,17 +181,16 @@ MACRO (MYSQL_CHECK_SSL)
# #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].*"
- )
+ OPENSSL_VERSION_TEXT
+ REGEX "^# *define[\t ]+OPENSSL_VERSION_TEXT[\t ]+")
STRING(REGEX REPLACE
- "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1"
- OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}"
- )
+ "^.*OPENSSL_VERSION_TEXT[\t ]+\"OpenSSL ([-0-9a-z.]+).*$" "\\1"
+ OPENSSL_VERSION "${OPENSSL_VERSION_TEXT}")
+
MESSAGE_ONCE(OPENSSL_INCLUDE_DIR "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
- MESSAGE_ONCE(OPENSSL_LIBRARIES "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}")
- MESSAGE_ONCE(CRYPTO_LIBRARY "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}")
- MESSAGE_ONCE(OPENSSL_MAJOR_VERSION "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}")
+ MESSAGE_ONCE(OPENSSL_SSL_LIBRARY "OPENSSL_SSL_LIBRARY = ${OPENSSL_SSL_LIBRARY}")
+ MESSAGE_ONCE(OPENSSL_CRYPTO_LIBRARY "OPENSSL_CRYPTO_LIBRARY = ${OPENSSL_CRYPTO_LIBRARY}")
+ MESSAGE_ONCE(OPENSSL_VERSION "OPENSSL_VERSION = ${OPENSSL_VERSION}")
MESSAGE_ONCE(SSL_LIBRARIES "SSL_LIBRARIES = ${SSL_LIBRARIES}")
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
SET(SSL_INTERNAL_INCLUDE_DIRS "")
@@ -225,8 +224,8 @@ ENDMACRO()
# So we should be linking static versions of the libraries.
MACRO (COPY_OPENSSL_DLLS target_name)
IF (WIN32 AND WITH_SSL_PATH)
- GET_FILENAME_COMPONENT(CRYPTO_NAME "${CRYPTO_LIBRARY}" NAME_WE)
- GET_FILENAME_COMPONENT(OPENSSL_NAME "${OPENSSL_LIBRARIES}" NAME_WE)
+ GET_FILENAME_COMPONENT(CRYPTO_NAME "${OPENSSL_CRYPTO_LIBRARY}" NAME_WE)
+ GET_FILENAME_COMPONENT(OPENSSL_NAME "${OPENSSL_SSL_LIBRARY}" NAME_WE)
FILE(GLOB HAVE_CRYPTO_DLL "${WITH_SSL_PATH}/bin/${CRYPTO_NAME}.dll")
FILE(GLOB HAVE_OPENSSL_DLL "${WITH_SSL_PATH}/bin/${OPENSSL_NAME}.dll")
IF (HAVE_CRYPTO_DLL AND HAVE_OPENSSL_DLL)
diff --git a/libmariadb b/libmariadb
-Subproject 3e924b356fd0ea51da31e5a31bdd00b4c5c441f
+Subproject 110aa7ddca3d3c128c5dcc716c40b6e6f7dabfa