build: enable valgrind
Enable valgrind to check memory usage.
Change-Id: If6b91a6239ba9b1cb182fd4ecf4572fec13a872f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index bb12c7b..d4ed168 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,6 +105,16 @@
AX_RESTORE_FLAGS_WITH_PREFIX(OLD, [LDFLAGS])
])
+# Check for valgrind
+AS_IF([test "x$enable_tests" = "xno"], [enable_valgrind=no])
+m4_foreach([vgtool], [valgrind_tool_list],
+ [AX_VALGRIND_DFLT(vgtool, [off])])
+AX_VALGRIND_DFLT([memcheck], [on])
+AX_VALGRIND_CHECK
+AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
+m4_foreach([vgtool], [valgrind_tool_list],
+ [AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool)])
+
# Code coverage
AX_CODE_COVERAGE
m4_ifdef([_AX_CODE_COVERAGE_RULES],