summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-09-24 19:52:51 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-09-24 19:52:51 +0200
commit72dffd878e47e4fcfd224cadfea06caed0ac956b (patch)
tree7e7bfd20293d5f0e5f33769b543940009b924b04
parent11fc6b49d96931d08bb8d266270014c0633a0fa5 (diff)
downloadmariadb-git-72dffd878e47e4fcfd224cadfea06caed0ac956b.tar.gz
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.
-rwxr-xr-xBUILD/compile-solaris-amd642
-rw-r--r--cmake/jemalloc.cmake14
2 files changed, 11 insertions, 5 deletions
diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64
index 58e5cba7d8c..2ae8ff333e8 100755
--- a/BUILD/compile-solaris-amd64
+++ b/BUILD/compile-solaris-amd64
@@ -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
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index fc7b2a73e72..bc6bf60781d 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -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)