Commit 1bd1c29e authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6895 switch to dynamic libjemalloc.so

parent 0438f125
...@@ -111,8 +111,6 @@ IF(UNIX) ...@@ -111,8 +111,6 @@ IF(UNIX)
SET(WITH_EXTRA_CHARSETS all CACHE STRING "") SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(WITH_JEMALLOC "static" CACHE STRING "")
IF(NOT IGNORE_AIO_CHECK) IF(NOT IGNORE_AIO_CHECK)
# Ensure aio is available on Linux (required by InnoDB) # Ensure aio is available on Linux (required by InnoDB)
CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H) CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
......
INCLUDE (CheckLibraryExists) INCLUDE (CheckLibraryExists)
SET(WITH_JEMALLOC auto CACHE STRING SET(WITH_JEMALLOC auto CACHE STRING
"Build with jemalloc. Possible values are 'yes', 'no', 'auto'") "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) MACRO (CHECK_JEMALLOC)
# compatibility with old WITH_JEMALLOC values # compatibility with old WITH_JEMALLOC values
...@@ -12,22 +26,17 @@ MACRO (CHECK_JEMALLOC) ...@@ -12,22 +26,17 @@ MACRO (CHECK_JEMALLOC)
SET(WITH_JEMALLOC "yes") SET(WITH_JEMALLOC "yes")
ENDIF() ENDIF()
IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto" OR IF (WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto")
WITH_JEMALLOC STREQUAL "static") JEMALLOC_TRY_DYNAMIC()
ENDIF()
IF(WITH_JEMALLOC STREQUAL "static")
SET(libname jemalloc_pic)
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
SET(what bundled)
ELSE()
SET(libname jemalloc)
SET(what system)
ENDIF()
CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC) IF (WITH_JEMALLOC STREQUAL "static" OR WITH_JEMALLOC STREQUAL "auto"
SET(CMAKE_REQUIRED_LIBRARIES) AND NOT HAVE_DYNAMIC_JEMALLOC)
JEMALLOC_TRY_STATIC()
ENDIF()
IF (HAVE_JEMALLOC) IF (libname)
IF (HAVE_DYNAMIC_JEMALLOC OR HAVE_STATIC_JEMALLOC)
SET(LIBJEMALLOC ${libname}) SET(LIBJEMALLOC ${libname})
SET(MALLOC_LIBRARY "${what} jemalloc") SET(MALLOC_LIBRARY "${what} jemalloc")
ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto") ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment