From a3866114e343edc50fb47bd5253ca16ced703340 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 21 May 2014 21:59:46 +0800 Subject: [PATCH] Add --with-malloc option to check jemalloc --- configure.ac | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 224c326..bfafdcd 100644 --- a/configure.ac +++ b/configure.ac @@ -46,9 +46,19 @@ AC_ARG_ENABLE(debug, [enable debug]), , enable_debug=unset) -AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes") -AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes") -AC_DEFINE(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes", "whether graphviz is enable") +AC_ARG_WITH([malloc], + AS_HELP_STRING([--without-malloc], [Use the default malloc])) + +AS_IF([test "x$with_malloc" != "xno"], + [AC_CHECK_HEADERS([jemalloc/jemalloc.h], [ + found_jemalloc=yes; break + ])]) +AM_CONDITIONAL(USE_JEMALLOC, test "x$found_jemalloc" = "xyes") +AC_DEFINE(USE_JEMALLOC, test "x$found_jemalloc" = "xyes" , "use jemalloc") + +AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" == "xyes") +AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" == "xyes") +AC_DEFINE(ENABLE_GRAPHVIZ, test "x$enable_graphviz" == "xyes", "whether graphviz is enable") PKG_CHECK_MODULES(DEPS, [libpcre check])