From b6d23e450b63a7d6edaaf80911fa1c391b51c581 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 11 Aug 2014 01:40:23 +0000 Subject: [PATCH] configure.in: fix jemalloc check * configure.in (jemalloc): check with JEMALLOC_MANGLE if not found without the mangling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 400e0af561..ca5bc01698 100644 --- a/configure.in +++ b/configure.in @@ -1159,11 +1159,26 @@ AC_ARG_WITH([jemalloc], [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])], [with_jemalloc=yes], [with_jemalloc=no]) AS_IF([test "x$with_jemalloc" = xyes],[ - AC_CHECK_LIB([jemalloc],[malloc_conf],[], [with_jemalloc=no]) + AC_CHECK_LIB([jemalloc], [malloc_conf], [], [with_jemalloc=no]) AC_CHECK_HEADER(jemalloc/jemalloc.h, [ AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, []) + ]) + AS_IF([test "x$with_jemalloc" = xno], [ + 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 + @%:@include RUBY_ALTERNATIVE_MALLOC_HEADER + @%:@else + @%:@include + @%:@endif], [return !&malloc_conf])], + [rb_cv_jemalloc_demangle=yes], + [rb_cv_jemalloc_demangle=no]) + ]) + ]) + AS_IF([test "x$rb_cv_jemalloc_demangle" = xyes], [ AC_DEFINE(JEMALLOC_MANGLE) with_jemalloc=yes + LIBS="-ljemalloc $LIBS" ]) AS_IF([test "x$with_jemalloc" = xyes], [