summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2017-03-11 20:12:15 +0000
committerSergei Petrunia <psergey@askmonty.org>2017-03-11 20:12:15 +0000
commit5b30c7896e8514b29dba0909272cda49910243ae (patch)
tree9f4213363cb529795ae15fdb00b3e4f6ecd72ed5 /cmake
parent5c1c2f67ec9373f55f9b69bdaf4adad416e4788b (diff)
parenteded6243bc4796ab44e70403edd059d32225f589 (diff)
downloadmariadb-git-5b30c7896e8514b29dba0909272cda49910243ae.tar.gz
Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks
Diffstat (limited to 'cmake')
-rw-r--r--cmake/configure.pl13
-rw-r--r--cmake/for_clients.cmake4
-rw-r--r--cmake/lz4.cmake10
-rw-r--r--cmake/ssl.cmake70
4 files changed, 32 insertions, 65 deletions
diff --git a/cmake/configure.pl b/cmake/configure.pl
index 68baf436c1c..c502a172a22 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -165,21 +165,26 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DWITH_LIBEVENT=bundled";
next;
}
- if($option =~ /with-ssl=/)
+ if($option =~ /with-ssl=yes/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=yes";
next;
}
- if($option =~ /with-debug/)
+ if($option =~ /with-ssl=system/)
{
- $cmakeargs = $cmakeargs." -DCMAKE_BUILD_TYPE=Debug -DSECURITY_HARDENED=OFF";
+ $cmakeargs = $cmakeargs." -DWITH_SSL=system";
next;
}
- if($option =~ /with-ssl/)
+ if($option =~ /with-ssl$/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=bundled";
next;
}
+ if($option =~ /with-debug/)
+ {
+ $cmakeargs = $cmakeargs." -DCMAKE_BUILD_TYPE=Debug -DSECURITY_HARDENED=OFF";
+ next;
+ }
if($option =~ /prefix=/)
{
$cmake_install_prefix= substr($option, 7);
diff --git a/cmake/for_clients.cmake b/cmake/for_clients.cmake
index dd79ea1039d..f6a076f9632 100644
--- a/cmake/for_clients.cmake
+++ b/cmake/for_clients.cmake
@@ -45,10 +45,10 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
ENDIF()
ENDMACRO()
-EXTRACT_LINK_LIBRARIES(mysqlclient LIBS)
+EXTRACT_LINK_LIBRARIES(mariadb LIBS)
EXTRACT_LINK_LIBRARIES(mysqlserver EMB_LIBS)
-SET(LIBS "-lmysqlclient ${ZLIB_DEPS} ${LIBS} ${openssl_libs}")
+SET(LIBS "-lmariadb ${ZLIB_DEPS} ${LIBS} ${openssl_libs}")
SET(EMB_LIBS "-lmysqld ${ZLIB_DEPS} ${EMB_LIBS} ${openssl_libs}")
MACRO(REPLACE_FOR_CLIENTS VAR)
diff --git a/cmake/lz4.cmake b/cmake/lz4.cmake
index 1607c68c5fb..075904589f0 100644
--- a/cmake/lz4.cmake
+++ b/cmake/lz4.cmake
@@ -19,9 +19,13 @@ MACRO (MYSQL_CHECK_LZ4)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
+ CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
+ IF (HAVE_LZ4_COMPRESS_DEFAULT)
+ ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
+ ENDIF()
LINK_LIBRARIES(lz4)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@@ -35,9 +39,13 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
+ CHECK_LIBRARY_EXISTS(liblz3.a LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
+ IF (HAVE_LZ4_COMPRESS_DEFAULT)
+ ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
+ ENDIF()
LINK_LIBRARIES(liblz4.a)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
@@ -45,4 +53,4 @@ MACRO (MYSQL_CHECK_LZ4_STATIC)
ENDIF()
ENDIF()
ENDIF()
-ENDMACRO() \ No newline at end of file
+ENDMACRO()
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 9f2c8797d2c..d407ea3d26f 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -119,55 +119,19 @@ MACRO (MYSQL_CHECK_SSL)
WITH_SSL STREQUAL "yes" OR
WITH_SSL_PATH
)
- # First search in WITH_SSL_PATH.
- FIND_PATH(OPENSSL_ROOT_DIR
- NAMES include/openssl/ssl.h
- NO_CMAKE_PATH
- NO_CMAKE_ENVIRONMENT_PATH
- HINTS ${WITH_SSL_PATH}
- )
- # Then search in standard places (if not found above).
- FIND_PATH(OPENSSL_ROOT_DIR
- NAMES include/openssl/ssl.h
- )
-
- FIND_PATH(OPENSSL_INCLUDE_DIR
- NAMES openssl/ssl.h
- HINTS ${OPENSSL_ROOT_DIR}/include
- )
-
- IF (WIN32)
- FIND_FILE(OPENSSL_APPLINK_C
- NAMES openssl/applink.c
- HINTS ${OPENSSL_ROOT_DIR}/include
- )
- MESSAGE_ONCE(OPENSSL_APPLINK_C "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
- ENDIF()
-
- # On mac this list is <.dylib;.so;.a>
- # We prefer static libraries, so we revert it here.
- IF (WITH_SSL_PATH)
- LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
- ENDIF()
- FIND_LIBRARY(OPENSSL_SSL_LIBRARY
- NAMES ssl ssleay32 ssleay32MD
- HINTS ${OPENSSL_ROOT_DIR}/lib)
- FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
- NAMES crypto libeay32
- HINTS ${OPENSSL_ROOT_DIR}/lib)
- 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)
+ IF(NOT OPENSSL_ROOT_DIR)
+ IF(WITH_SSL_PATH)
+ SET(OPENSSL_ROOT_DIR ${WITH_SSL_PATH})
+ ENDIF()
ENDIF()
-
- INCLUDE(CheckSymbolExists)
- SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
- CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
- HAVE_SHA512_DIGEST_LENGTH)
- SET(CMAKE_REQUIRED_INCLUDES)
- IF(OPENSSL_INCLUDE_DIR AND OPENSSL_SSL_LIBRARY AND
- OPENSSL_CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
+ FIND_PACKAGE(OpenSSL)
+ IF(OPENSSL_FOUND)
+ SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
+ INCLUDE(CheckSymbolExists)
+ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
+ CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
+ HAVE_SHA512_DIGEST_LENGTH)
+ SET(CMAKE_REQUIRED_INCLUDES)
SET(SSL_SOURCES "")
SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
@@ -177,16 +141,6 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBDL})
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_TEXT
- REGEX "^# *define[\t ]+OPENSSL_VERSION_TEXT[\t ]+")
- STRING(REGEX REPLACE
- "^.*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_SSL_LIBRARY "OPENSSL_SSL_LIBRARY = ${OPENSSL_SSL_LIBRARY}")
MESSAGE_ONCE(OPENSSL_CRYPTO_LIBRARY "OPENSSL_CRYPTO_LIBRARY = ${OPENSSL_CRYPTO_LIBRARY}")