ruby-changes:66701
From: Nobuyoshi <ko1@a...>
Date: Tue, 6 Jul 2021 21:03:21 +0900 (JST)
Subject: [ruby-changes:66701] 166d148355 (master): Fix check for malloc_conf when no library is required
https://git.ruby-lang.org/ruby.git/commit/?id=166d148355 From 166d148355384c73d18c8465eb99dbc69e3eb400 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 6 Jul 2021 19:35:38 +0900 Subject: Fix check for malloc_conf when no library is required --- configure.ac | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d6f00aa..015237c 100644 --- a/configure.ac +++ b/configure.ac @@ -1303,8 +1303,11 @@ AS_IF([test "x$with_jemalloc" != xno],[ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1303 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>]) + for malloc_header in jemalloc/jemalloc.h jemalloc.h; do + AC_CHECK_HEADER($malloc_header, [break], [malloc_header=]) + done + AS_IF([test "$malloc_header" != ""], [ + AC_DEFINE_UNQUOTED(RUBY_ALTERNATIVE_MALLOC_HEADER, [<$malloc_header>]) ], [test x$with_jemalloc = xyes && with_jemalloc=no]) AS_IF([test "x$with_jemalloc" != xyes], [ @@ -1313,7 +1316,7 @@ AS_IF([test "x$with_jemalloc" != xno],[ https://github.com/ruby/ruby/blob/trunk/configure.ac#L1316 @%:@ifdef RUBY_ALTERNATIVE_MALLOC_HEADER @%:@include RUBY_ALTERNATIVE_MALLOC_HEADER @%:@else - @%:@include <jemalloc.h> + extern const char *malloc_conf; @%:@endif], [return !&malloc_conf])], [rb_cv_jemalloc_demangle=yes], [rb_cv_jemalloc_demangle=no]) -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/