summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-02-23 20:53:29 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-23 20:53:29 -0500
commit0d58323e2645460907280b0482811729822a7ef1 (patch)
tree1b0400c627851e0cb9c9445e24367a5ce9fd5d4d /cmake
parent276d65b324f4f0021bc457b4d5723153d4e12608 (diff)
parenta4b271496888e1f8628d0af36309e35293093577 (diff)
downloadmariadb-git-0d58323e2645460907280b0482811729822a7ef1.tar.gz
Merge tag 'mariadb-10.0.24' into 10.0-galera
Diffstat (limited to 'cmake')
-rw-r--r--cmake/dtrace.cmake3
-rw-r--r--cmake/jemalloc.cmake18
-rw-r--r--cmake/libutils.cmake5
-rw-r--r--cmake/plugin.cmake2
-rw-r--r--cmake/ssl.cmake5
5 files changed, 25 insertions, 8 deletions
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake
index 5d0bb7ff8c9..3edcdc4c1c5 100644
--- a/cmake/dtrace.cmake
+++ b/cmake/dtrace.cmake
@@ -86,6 +86,9 @@ IF(ENABLE_DTRACE)
${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
)
+ELSE()
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/probes_mysql_nodtrace.h.in
+ ${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h COPYONLY)
ENDIF()
FUNCTION(DTRACE_INSTRUMENT target)
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 876688f02f6..5a3c1bd935b 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -20,18 +20,22 @@ MACRO (CHECK_JEMALLOC)
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
SET(what bundled)
ELSE()
- SET(libname jemalloc)
+ SET(libname jemalloc c)
SET(what system)
ENDIF()
- CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC)
+ FOREACH(lib ${libname})
+ CHECK_LIBRARY_EXISTS(${lib} malloc_stats_print "" HAVE_JEMALLOC_IN_${lib})
+ IF (HAVE_JEMALLOC_IN_${lib})
+ SET(LIBJEMALLOC ${lib})
+ SET(MALLOC_LIBRARY "${what} jemalloc")
+ BREAK()
+ ENDIF()
+ ENDFOREACH()
SET(CMAKE_REQUIRED_LIBRARIES)
- IF (HAVE_JEMALLOC)
- SET(LIBJEMALLOC ${libname})
- SET(MALLOC_LIBRARY "${what} jemalloc")
- ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
- MESSAGE(FATAL_ERROR "${libname} is not found")
+ IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
+ MESSAGE(FATAL_ERROR "jemalloc is not found")
ENDIF()
ENDIF()
ENDMACRO()
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index 636737b2083..5125b9482cd 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -87,6 +87,11 @@ MACRO(CREATE_EXPORT_FILE VAR TARGET API_FUNCTIONS)
ENDFOREACH()
SET(CONTENT "${CONTENT} (void *)0\n}\;")
CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS})
+ # Avoid "function redeclared as variable" error
+ # when using gcc/clang option -flto(link time optimization)
+ IF(" ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} " MATCHES " -flto")
+ SET_SOURCE_FILES_PROPERTIES(${EXPORTS} PROPERTIES COMPILE_FLAGS "-fno-lto")
+ ENDIF()
SET(${VAR} ${EXPORTS})
ENDIF()
ENDMACRO()
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 009f2551636..8e3af8d745f 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -74,7 +74,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(WITH_${plugin} 1)
ELSEIF(WITHOUT_${plugin} OR WITHOUT_${plugin}_STORAGE_ENGINE OR
- WITH_NONE OR ${plugin}_DISABLED)
+ WITH_NONE OR ARG_DISABLED)
SET(WITHOUT_${plugin} 1)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITH_${plugin} 0)
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 26df7a47e0a..f9daa29f4b9 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -55,6 +55,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
+ SET(HAVE_ERR_remove_thread_state OFF CACHE INTERNAL "yassl doesn't have ERR_remove_thread_state")
CHANGE_SSL_SETTINGS("bundled")
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
@@ -199,6 +200,10 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
SET(SSL_INTERNAL_INCLUDE_DIRS "")
SET(SSL_DEFINES "-DHAVE_OPENSSL")
+
+ SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
+ CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
+ HAVE_ERR_remove_thread_state)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")