ruby-changes:51226
From: nobu <ko1@a...>
Date: Tue, 15 May 2018 17:08:29 +0900 (JST)
Subject: [ruby-changes:51226] nobu:r63433 (trunk): configure.ac: maybe with jemalloc
nobu 2018-05-15 17:08:24 +0900 (Tue, 15 May 2018) New Revision: 63433 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63433 Log: configure.ac: maybe with jemalloc * configure.ac (--with-jemalloc): accept `maybe` (other than `yes` and `no`), check for jemalloc and use it if possible. Modified files: trunk/configure.ac Index: configure.ac =================================================================== --- configure.ac (revision 63432) +++ configure.ac (revision 63433) @@ -1016,13 +1016,17 @@ AS_IF([test "x$with_gmp" != xno], https://github.com/ruby/ruby/blob/trunk/configure.ac#L1016 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],[ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1042 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]) ]) ]) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/