diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-15 08:08:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-15 08:08:24 +0000 |
commit | f50051ad5f915d01e959a84c5b9e368f39c9deb1 (patch) | |
tree | ce8925dd5d6cedfceb950c9b43695cd65b207b53 /configure.ac | |
parent | c3b77e704abac0571316640be85dddd6c695c65d (diff) | |
download | ruby-f50051ad5f915d01e959a84c5b9e368f39c9deb1.tar.gz |
configure.ac: maybe with jemalloc
* configure.ac (--with-jemalloc): accept `maybe` (other than `yes`
and `no`), check for jemalloc and use it if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index e59ecf5b20..f467a85ee9 100644 --- a/configure.ac +++ b/configure.ac @@ -1016,13 +1016,17 @@ AS_IF([test "x$with_gmp" != xno], AC_ARG_WITH([jemalloc], [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])], [with_jemalloc=$withval], [with_jemalloc=no]) -AS_IF([test "x$with_jemalloc" = xyes],[ +AS_IF([test "x$with_jemalloc" != xno],[ AC_SEARCH_LIBS([malloc_conf], [jemalloc], - [AC_DEFINE(HAVE_LIBJEMALLOC, 1)], [with_jemalloc=no]) + [ + AC_DEFINE(HAVE_LIBJEMALLOC, 1) + with_jemalloc=yes + ], + [test x$with_jemalloc = xyes && with_jemalloc=no]) AC_CHECK_HEADER(jemalloc/jemalloc.h, [ AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>]) ]) - AS_IF([test "x$with_jemalloc" = xno], [ + AS_IF([test "x$with_jemalloc" != xyes], [ AC_CACHE_CHECK([for jemalloc with JEMALLOC_MANGLE], rb_cv_jemalloc_demangle, [AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@define JEMALLOC_MANGLE 1 @%:@ifdef RUBY_ALTERNATIVE_MALLOC_HEADER @@ -1038,11 +1042,13 @@ AS_IF([test "x$with_jemalloc" = xyes],[ AC_DEFINE(JEMALLOC_MANGLE) with_jemalloc=yes ]) - AS_IF([test "x$with_jemalloc" = xyes], + AS_CASE(["$with_jemalloc"], + [yes], [ AC_DEFINE(HAVE_MALLOC_CONF) ac_cv_func_malloc_usable_size=yes ], + [no], [AC_MSG_ERROR([jemalloc requested but not found]) ]) ]) |