configure: Fix building with --disable-tests
diff --git a/configure.ac b/configure.ac
index 20a11ee..aef8ae7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,7 @@
# Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS
# It is important that this comes before AC_PROG_C{C,XX}, as we are attempting
# to stop them from populating default CFLAGS and CXXFLAGS.
+AS_IF([test "x$enable_tests" = "xno"], [enable_code_coverage=no])
AS_IF([test "x$enable_code_coverage" != "xno"], [
AS_IF([test "x${CXXFLAGS+set}" != "xset"], [
AC_SUBST(CXXFLAGS, [""])
@@ -118,21 +119,18 @@
])
# Check for valgrind
-AS_IF([test "x$enable_tests" != "xno"], [
- 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)])
-])
+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
-AS_IF([test "x$enable_tests" != "xno"], [
- AX_CODE_COVERAGE
- AM_EXTRA_RECURSIVE_TARGETS([check-code-coverage])
-])
+AX_CODE_COVERAGE
+AM_EXTRA_RECURSIVE_TARGETS([check-code-coverage])
# Append -Werror after doing autoconf compiler checks
# Otherwise some perfectly valid checks can fail and cause our