1
0
Fork 0

Add optional support to link against tcmalloc.

Just do --enable-tcmalloc at ./configure. You need a system-wide
installation such that
  -ltcmalloc
works without further -L.
This commit is contained in:
Max Neunhoeffer 2015-05-28 11:01:24 -07:00
parent 4d8863070d
commit c81d8410e8
3 changed files with 26 additions and 0 deletions

View File

@ -140,6 +140,7 @@ AM_LDFLAGS = \
################################################################################
LIBS = \
@TCMALLOC_LIBS@ \
@RT_LIBS@ \
@LIBEV_LIBS@ \
@MATH_LIBS@ \

View File

@ -15,9 +15,15 @@
/* define if the compiler supports basic C++11 syntax */
#undef HAVE_CXX11
/* Define to 1 if you have the `futimes' function. */
#undef HAVE_FUTIMES
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `tcmalloc' library (-ltcmalloc). */
#undef HAVE_LIBTCMALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

View File

@ -114,6 +114,25 @@ if test "x$tr_INTERNAL_GO" = "xno"; then
fi
fi
dnl ----------------------------------------------------------------------------
dnl tcmalloc
dnl ----------------------------------------------------------------------------
AC_ARG_ENABLE(tcmalloc,
AS_HELP_STRING([--enable-tcmalloc], [use system-installed tcmalloc library (default: no)]),
[tr_TCMALLOC="${enableval:-yes}"],
[tr_TCMALLOC=no]
)
AM_CONDITIONAL(ENABLE_TCMALLOC, test "x$tr_TCMALLOC" = xyes)
if test "x$tr_TCMALLOC" = "xyes"; then
TCMALLOC_LIBS="-ltcmalloc"
else
TCMALLOC_LIBS=""
fi
AC_SUBST(TCMALLOC_LIBS)
dnl ============================================================================
dnl --SECTION-- OPTIONS
dnl ============================================================================