Commit 72dffd87 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-5062 : disable jemalloc by default everywhere, except Linux and OSX.

Bundled jemalloc can only be on  Linux and OSX without problems.
  
On BSDs, build fails because make does not understand GNU extensions (also BSDs do not need  jemalloc, it is already system malloc).
On Solaris, build fails with compile error.
parent 11fc6b49
......@@ -3,6 +3,6 @@
export LDFLAGS='-m64 -lmtmalloc -R/usr/sfw/lib/64'
export CFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64'
export CXXFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64'
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON -DWITH_JEMALLOC=NO
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON
gmake -j6 VERBOSE=1
......@@ -36,13 +36,19 @@ MACRO (USE_BUNDLED_JEMALLOC)
ADD_DEPENDENCIES(libjemalloc jemalloc)
ENDMACRO()
SET(WITH_JEMALLOC "yes" CACHE STRING
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(WIN32)
SET(WITH_JEMALLOC "no")
ENDIF()
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
IF (HAVE_JEMALLOC)
......
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