summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac14
-rw-r--r--tests/extra/Makefile.am6
2 files changed, 17 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c62bf9a4..ea2533a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -714,6 +714,20 @@ dnl The C++ compiler test is pretty useless because even if it fails
dnl it sets CXX=g++. So test the compiler actually works.
AM_CONDITIONAL([HAVE_CXX], [$CXX --version])
+dnl If valgrind is present (it's not required), check whether or not
+dnl it supports the new 'valgrind --vgdb' option.
+AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[no])
+AS_IF([test "x$valgrind" != "xno"],[
+ AC_MSG_CHECKING([if $VALGRIND supports the --vgdb option])
+ if $VALGRIND --help | grep -sq -- --vgdb; then
+ AC_MSG_RESULT([yes])
+ AC_SUBST([VALGRIND_NO_VGDB],[--vgdb=no])
+ else
+ AC_MSG_RESULT([no])
+ AC_SUBST([VALGRIND_NO_VGDB],[])
+ fi
+])
+
dnl Check for OCaml (optional, for OCaml bindings).
OCAMLC=no
OCAMLFIND=no
diff --git a/tests/extra/Makefile.am b/tests/extra/Makefile.am
index 2085cc80..911c83eb 100644
--- a/tests/extra/Makefile.am
+++ b/tests/extra/Makefile.am
@@ -50,12 +50,12 @@
EXTRA_DIST = pick-guests.pl suppressions
-VG = valgrind \
+VG = $(VALGRIND) \
+ $(VALGRIND_NO_VGDB) \
--log-file=$(abs_builddir)/valgrind.log \
--leak-check=full \
--error-exitcode=119 \
- --suppressions=$(abs_srcdir)/suppressions \
- --vgdb=no
+ --suppressions=$(abs_srcdir)/suppressions
RUN_VG = $(abs_top_builddir)/run $(VG)
export LIBVIRT_DEFAULT_URI = \