From f00505a763ac805d2123004dd498dc79aff7f7b2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 6 May 2022 11:07:26 +0200 Subject: [PATCH] Add configure --with-efence to debug memory issues --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index dbdc2f5..3d312f6 100644 --- a/configure.ac +++ b/configure.ac @@ -147,6 +147,27 @@ else TREXIO_DEVEL="" fi + +AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no) +if test "$ok" = "yes"; then + AC_CHECK_LIB([efence], [malloc]) + ARGS="${ARGS} efence" +fi + +AC_ARG_ENABLE(malloc-trace, [AS_HELP_STRING([--enable-malloc-trace],[use debug malloc/free])], ok=$enableval, ok=no) +if test "$ok" = "yes"; then + AC_DEFINE(MALLOC_TRACE,"malloc_trace.dat",[Define to use debugging malloc/free]) + ARGS="${ARGS} malloc-trace" +fi + +AC_ARG_ENABLE(prof, [AS_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no) +if test "$ok" = "yes"; then + CFLAGS="${CFLAGS} -pg" + AC_DEFINE(ENABLE_PROF,1,[Define when using the profiler tool]) + ARGS="${ARGS} prof" +fi + + AM_CONDITIONAL([TREXIO_DEVEL],[test "x$TREXIO_DEVEL" != x]) if test "x${TREXIO_DEVEL}" != "x"; then