summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)