diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-15 18:05:05 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-17 15:16:19 +0100 |
commit | 289fe3720e9467d84cf86fd76d52cc481916d884 (patch) | |
tree | ea4432b385a6300cfc17ab0051a8519d21a1153a /cmake/jemalloc.cmake | |
parent | 74d86d1d2762b4441b1d68aa8ea636d9d675f8d3 (diff) | |
download | mariadb-git-289fe3720e9467d84cf86fd76d52cc481916d884.tar.gz |
MDEV-9350 Fix jemalloc detection for FreeBSD
on FreeBSD 10 jemalloc is in libc, no separate libjemalloc is needed
Diffstat (limited to 'cmake/jemalloc.cmake')
-rw-r--r-- | cmake/jemalloc.cmake | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake index 876688f02f6..5a3c1bd935b 100644 --- a/cmake/jemalloc.cmake +++ b/cmake/jemalloc.cmake @@ -20,18 +20,22 @@ MACRO (CHECK_JEMALLOC) SET(CMAKE_REQUIRED_LIBRARIES pthread dl m) SET(what bundled) ELSE() - SET(libname jemalloc) + SET(libname jemalloc c) SET(what system) ENDIF() - CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC) + FOREACH(lib ${libname}) + CHECK_LIBRARY_EXISTS(${lib} malloc_stats_print "" HAVE_JEMALLOC_IN_${lib}) + IF (HAVE_JEMALLOC_IN_${lib}) + SET(LIBJEMALLOC ${lib}) + SET(MALLOC_LIBRARY "${what} jemalloc") + BREAK() + ENDIF() + ENDFOREACH() SET(CMAKE_REQUIRED_LIBRARIES) - IF (HAVE_JEMALLOC) - SET(LIBJEMALLOC ${libname}) - SET(MALLOC_LIBRARY "${what} jemalloc") - ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto") - MESSAGE(FATAL_ERROR "${libname} is not found") + IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto") + MESSAGE(FATAL_ERROR "jemalloc is not found") ENDIF() ENDIF() ENDMACRO() |