summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2013-09-27 13:48:58 +0300
committerJan Lindström <jplindst@mariadb.org>2013-09-27 13:48:58 +0300
commit6a6522319316204bbe46d52140151935ecde938f (patch)
tree84e471aad74e90821ca5f4988ce9adfeebbd4b3d /cmake
parent8ad1b5b1086b6791b95a33c664184bfb56993d94 (diff)
parent28ec372744e6dbeab9ecae7a3a9a7ef23b0866d5 (diff)
downloadmariadb-git-6a6522319316204bbe46d52140151935ecde938f.tar.gz
mariadb-5.5.33a merge
Diffstat (limited to 'cmake')
-rw-r--r--cmake/jemalloc.cmake17
1 files changed, 13 insertions, 4 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 50aa7768317..5cb9c493a20 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -11,7 +11,7 @@ MACRO (USE_BUNDLED_JEMALLOC)
SET(SOURCE_DIR "${CMAKE_SOURCE_DIR}/extra/jemalloc")
SET(BINARY_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/extra/jemalloc/build")
SET(LIBJEMALLOC "libjemalloc")
- SET(JEMALLOC_CONFIGURE_OPTS "CC=${CMAKE_C_COMPILER}" "--with-private-namespace=jemalloc_internal_" "--enable-cc-silence")
+ SET(JEMALLOC_CONFIGURE_OPTS "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" "--with-private-namespace=jemalloc_internal_" "--enable-cc-silence")
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT APPLE) # see the comment in CMakeLists.txt
LIST(APPEND JEMALLOC_CONFIGURE_OPTS --enable-debug)
ENDIF()
@@ -30,14 +30,23 @@ MACRO (USE_BUNDLED_JEMALLOC)
ENDMACRO()
SET(WITH_JEMALLOC "yes" CACHE STRING
- "Which jemalloc to use (possible values are 'no', 'bundled', 'yes' (same as bundled)")
-#"Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
+ "Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
MACRO (CHECK_JEMALLOC)
IF(WIN32)
SET(WITH_JEMALLOC "no")
ENDIF()
- IF(WITH_JEMALLOC STREQUAL "bundled" OR WITH_JEMALLOC STREQUAL "yes")
+ IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
+ CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
+ IF (HAVE_JEMALLOC)
+ SET(LIBJEMALLOC jemalloc)
+ ELSEIF (WITH_JEMALLOC STREQUAL "system")
+ MESSAGE(FATAL_ERROR "system jemalloc is not found")
+ ELSEIF (WITH_JEMALLOC STREQUAL "yes")
+ SET(trybundled 1)
+ ENDIF()
+ ENDIF()
+ IF(WITH_JEMALLOC STREQUAL "bundled" OR trybundled)
USE_BUNDLED_JEMALLOC()
ENDIF()
ENDMACRO()