-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-6613 build system endianness test fails for ppc64le (i.e. Ubuntu)
* remove bundled jemalloc, use the system one * force jemalloc in release builds on linux
- Loading branch information
Sergei Golubchik
committed
Sep 12, 2014
1 parent
ae3cc4f
commit 3d94523
Showing
105 changed files
with
22 additions
and
45,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,23 @@ | ||
# old cmake does not have ExternalProject file | ||
IF(CMAKE_VERSION VERSION_LESS "2.8.6") | ||
MACRO (CHECK_JEMALLOC) | ||
ENDMACRO() | ||
RETURN() | ||
ENDIF() | ||
INCLUDE (CheckLibraryExists) | ||
|
||
INCLUDE(ExternalProject) | ||
SET(WITH_JEMALLOC auto CACHE STRING | ||
"Build with jemalloc (possible values are 'yes', 'no', 'auto')") | ||
|
||
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} ${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) | ||
MACRO (CHECK_JEMALLOC) | ||
# compatibility with old WITH_JEMALLOC values | ||
IF(WITH_JEMALLOC STREQUAL "bundled") | ||
MESSAGE(FATAL_ERROR "MariaDB no longer bundles jemalloc") | ||
ENDIF() | ||
|
||
IF(CMAKE_GENERATOR MATCHES "Makefiles") | ||
SET(MAKE_COMMAND ${CMAKE_MAKE_PROGRAM}) | ||
ELSE() # Xcode/Ninja generators | ||
SET(MAKE_COMMAND make) | ||
IF(WITH_JEMALLOC STREQUAL "system") | ||
SET(WITH_JEMALLOC "yes") | ||
ENDIF() | ||
|
||
ExternalProject_Add(jemalloc | ||
PREFIX extra/jemalloc | ||
SOURCE_DIR ${SOURCE_DIR} | ||
BINARY_DIR ${BINARY_DIR} | ||
STAMP_DIR ${BINARY_DIR} | ||
CONFIGURE_COMMAND "${SOURCE_DIR}/configure" ${JEMALLOC_CONFIGURE_OPTS} | ||
BUILD_COMMAND ${MAKE_COMMAND} "build_lib_static" | ||
INSTALL_COMMAND "" | ||
) | ||
ADD_LIBRARY(libjemalloc STATIC IMPORTED) | ||
SET_TARGET_PROPERTIES(libjemalloc PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/lib/libjemalloc_pic.a") | ||
ADD_DEPENDENCIES(libjemalloc jemalloc) | ||
ENDMACRO() | ||
|
||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR APPLE) | ||
# Linux and OSX are the only systems where bundled jemalloc can be built without problems, | ||
# as they both have GNU make and jemalloc actually compiles. | ||
# Also, BSDs use jemalloc as malloc already | ||
SET(WITH_JEMALLOC_DEFAULT "yes") | ||
ELSE() | ||
SET(WITH_JEMALLOC_DEFAULT "no") | ||
ENDIF() | ||
|
||
SET(WITH_JEMALLOC ${WITH_JEMALLOC_DEFAULT} CACHE STRING | ||
"Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)") | ||
|
||
MACRO (CHECK_JEMALLOC) | ||
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes") | ||
IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto") | ||
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) | ||
MESSAGE(FATAL_ERROR "jemalloc is not found") | ||
ENDIF() | ||
ENDIF() | ||
IF(WITH_JEMALLOC STREQUAL "bundled" OR trybundled) | ||
USE_BUNDLED_JEMALLOC() | ||
ENDIF() | ||
ENDMACRO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.