From 6ab08d2e8dd0c382d41e477f8255d7d6e4e67d9b Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 5 Jun 2014 05:16:46 +0000 Subject: configure.in, missing.h: jemalloc mangling * configure.in (with-jemalloc): also check for header, for ABIs which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF platforms. [ruby-core:62939] [Feature #9113] * include/ruby/missing.h: include alternative malloc header to replace memory management functions. * dln.c, io.c, parse.y, st.c: undef malloc family before re-definition to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 90219af803..555c323321 100644 --- a/configure.in +++ b/configure.in @@ -1177,8 +1177,22 @@ 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],[LIBS="-ljemalloc $LIBS"], - [AC_MSG_ERROR([jemalloc requested but not found])])]) + AC_CHECK_LIB([jemalloc],[malloc_conf],[], [with_jemalloc=no]) + AS_IF([test "x$with_jemalloc" != xyes],[ + AC_CHECK_HEADER(jemalloc/jemalloc.h, [ + AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, []) + AC_DEFINE(JEMALLOC_MANGLE) + with_jemalloc=yes + ]) + ]) + AS_IF([test "x$with_jemalloc" = xyes], + [ + ac_cv_func_malloc_usable_size=yes + LIBS="-ljemalloc $LIBS" + ], + [AC_MSG_ERROR([jemalloc requested but not found]) + ]) +]) dnl check for large file stuff mv confdefs.h confdefs1.h -- cgit v1.2.3