summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-06 19:35:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-06 21:02:41 +0900
commit166d148355384c73d18c8465eb99dbc69e3eb400 (patch)
tree48d3d3c744b70d556505f62cb18e507e872c2c0a
parentc5e6fa4853a2e71b43377931f686d6eb41aacc52 (diff)
downloadruby-166d148355384c73d18c8465eb99dbc69e3eb400.tar.gz
Fix check for malloc_conf when no library is required
-rw-r--r--configure.ac9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index d6f00aac6d..015237c43a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1303,8 +1303,11 @@ AS_IF([test "x$with_jemalloc" != xno],[
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],[
@%:@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])