From ced219ebbd3b266ac8326223bad62f994907ae6b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 13 Feb 2012 00:19:17 +0000 Subject: configure: Fix pkg-config test in absence of valgrind The empty string used for the not case is replaced by the default if-else clause and so causes the configure to fail in the absence of valgrind. Which is not quite what was intended. Instead use the common idiom of setting a variable depending on whether the true or false branch is taken and emit the conditional code as a second step. Reported-by: Tobias Jakobi Signed-off-by: Chris Wilson --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d72874bc..97bbcb72 100644 --- a/configure.ac +++ b/configure.ac @@ -261,8 +261,10 @@ if test "x$INTEL" != "xno" -o "x$RADEON" != "xno"; then fi fi -PKG_CHECK_MODULES(VALGRIND, [valgrind], - AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warings]),) +PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) +if test "x$have_valgrind" = "xyes"; then + AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings]) +fi AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" != "xno"]) AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" != "xno"]) -- cgit v1.2.3