summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-23 21:35:05 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-23 21:35:05 +0100
commita5679af1b13bb0c7c4eaa75f27551072dc18fb7d (patch)
tree7d039fb5e83c331daa75f9b9b67625b0469f6a9b /cmake
parent20c4dfd4a9e7c5f2f570488a7ead0b7c74e61817 (diff)
parent5f2f3c4fa81851b45dcee33601f14e05f6407333 (diff)
downloadmariadb-git-a5679af1b13bb0c7c4eaa75f27551072dc18fb7d.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'cmake')
-rw-r--r--cmake/dtrace.cmake3
-rw-r--r--cmake/jemalloc.cmake49
2 files changed, 25 insertions, 27 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 05402668c7d..5ad636d0e6c 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -3,20 +3,6 @@ INCLUDE (CheckLibraryExists)
SET(WITH_JEMALLOC auto CACHE STRING
"Build with jemalloc. Possible values are 'yes', 'no', 'static', 'auto'")
-MACRO(JEMALLOC_TRY_STATIC)
- SET(libname jemalloc_pic)
- SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
- SET(what bundled)
- CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_STATIC_JEMALLOC)
- SET(CMAKE_REQUIRED_LIBRARIES)
-ENDMACRO()
-
-MACRO(JEMALLOC_TRY_DYNAMIC)
- SET(libname jemalloc)
- SET(what system)
- CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_DYNAMIC_JEMALLOC)
-ENDMACRO()
-
MACRO (CHECK_JEMALLOC)
# compatibility with old WITH_JEMALLOC values
IF(WITH_JEMALLOC STREQUAL "bundled")
@@ -26,21 +12,30 @@ MACRO (CHECK_JEMALLOC)
SET(WITH_JEMALLOC "yes")
ENDIF()
- IF (WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto")
- JEMALLOC_TRY_DYNAMIC()
- ENDIF()
+ IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto" OR
+ WITH_JEMALLOC STREQUAL "static")
- IF (WITH_JEMALLOC STREQUAL "static" OR WITH_JEMALLOC STREQUAL "auto"
- AND NOT HAVE_DYNAMIC_JEMALLOC)
- JEMALLOC_TRY_STATIC()
- ENDIF()
+ IF(WITH_JEMALLOC STREQUAL "static")
+ SET(libname jemalloc_pic)
+ SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
+ SET(what bundled)
+ ELSE()
+ SET(libname jemalloc c)
+ SET(what system)
+ ENDIF()
+
+ 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 (libname)
- IF (HAVE_DYNAMIC_JEMALLOC OR HAVE_STATIC_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()