librelp/0001-configure-Fix-valgrind-usage.patch
2023-01-07 12:15:30 +08:00

46 lines
1.6 KiB
Diff

From 94d9b9f7e449535ebe3647bd74f177fe6cbbdd68 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@whissi.de>
Date: Thu, 17 May 2018 16:52:35 +0200
Subject: [PATCH] configure: Fix valgrind usage
Valgrind will now only used when explicitly requested via
"--enable-valgrind" configure switch. Therefore, if requested but
valgrind isn't available, configure will fail with an error.
Fixes: 88600be7bb55 ("testbench: valgrind can be disabled in configure")
Fixes: https://github.com/rsyslog/librelp/issues/100
---
configure.ac | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index ede924d..79106af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,16 +176,20 @@ fi
# valgrind
AC_ARG_ENABLE(valgrind,
- [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])],
+ [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_valgrind="yes" ;;
no) enable_valgrind="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
esac],
- [enable_valgrind="yes"]
+ [enable_valgrind="no"]
)
if test "$enable_valgrind" = "yes"; then
AC_CHECK_PROG(VALGRIND, [valgrind], [valgrind], [no])
+
+ if test "x$VALGRIND" = "xno"; then
+ AC_MSG_ERROR([valgrind is missing but forced with --enable-valgrind. Either install valgrind or remove the option!])
+ fi
fi
AM_CONDITIONAL([HAVE_VALGRIND], test "$enable_valgrind" == "yes")
--
2.39.0.windows.2