Commit f2b1e0a2 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Add support for system libjemalloc

Use system libjemalloc if found, if not we use the bundled one.
parent 589f8f65
......@@ -236,6 +236,29 @@ if test "$ac_cv_have_viz" = no; then
fi
CFLAGS="${save_CFLAGS}"
# Use jemalloc on Linux
JEMALLOC_SUBDIR=
JEMALLOC_LDADD=
AC_ARG_WITH([jemalloc],
[AS_HELP_STRING([--with-jemalloc],
[use jemalloc memory allocator. Default is yes on Linux, no elsewhere])],
[],
[with_jemalloc=check])
case $target in
*-*-linux*)
if test "x$with_jemalloc" != xno; then
AC_CHECK_LIB([jemalloc], [malloc_conf],
[JEMALLOC_LDADD="-ljemalloc"],
[AC_MSG_NOTICE([No system jemalloc found, using bundled version])
JEMALLOC_SUBDIR=libjemalloc
JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'])
fi
;;
esac
AC_SUBST(JEMALLOC_SUBDIR)
AC_SUBST(JEMALLOC_LDADD)
# Userland slab allocator, available only on Solaris
case $target in
*-*-solaris*)
......@@ -477,28 +500,6 @@ fi
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
# Use jemalloc on Linux
JEMALLOC_SUBDIR=
JEMALLOC_LDADD=
AC_ARG_ENABLE(jemalloc,
AS_HELP_STRING([--disable-jemalloc],[do not use jemalloc (default is yes on Linux, no everywhere else)]),
[if test "x$enableval" = "xyes"; then
JEMALLOC_SUBDIR=libjemalloc
JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
fi],
[case $target in #(
*-*-linux*)
JEMALLOC_SUBDIR=libjemalloc
JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
;; #(
*)
true
;;
esac])
AC_SUBST(JEMALLOC_SUBDIR)
AC_SUBST(JEMALLOC_LDADD)
# Generate output
AC_CONFIG_FILES([
Makefile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment