[前][次][番号順一覧][スレッド一覧]

ruby-changes:35049

From: nobu <ko1@a...>
Date: Mon, 11 Aug 2014 10:40:42 +0900 (JST)
Subject: [ruby-changes:35049] nobu:r47131 (trunk): configure.in: fix jemalloc check

nobu	2014-08-11 10:40:23 +0900 (Mon, 11 Aug 2014)

  New Revision: 47131

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47131

  Log:
    configure.in: fix jemalloc check
    
    * configure.in (jemalloc): check with JEMALLOC_MANGLE if not found
      without the mangling.

  Modified files:
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 47130)
+++ configure.in	(revision 47131)
@@ -1159,11 +1159,26 @@ AC_ARG_WITH([jemalloc], https://github.com/ruby/ruby/blob/trunk/configure.in#L1159
   [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, [<jemalloc/jemalloc.h>])
+  ])
+  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 <jemalloc.h>
+      @%:@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],
     [

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]