1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2018-05-15 08:08:24 +00:00
parent c3b77e704a
commit f50051ad5f

View file

@ -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])
])
])