Skip to content

Commit 7c7ce87

Browse files
committed
build: Add a check that Valgrind actually supports a host platform
1 parent 49f608d commit 7c7ce87

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build-aux/m4/bitcoin_secp.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ AC_DEFUN([SECP_VALGRIND_CHECK],[
1313
if test x"$has_valgrind" != x"yes"; then
1414
CPPFLAGS_TEMP="$CPPFLAGS"
1515
CPPFLAGS="$VALGRIND_CPPFLAGS $CPPFLAGS"
16-
AC_CHECK_HEADER([valgrind/memcheck.h], [has_valgrind=yes; AC_DEFINE(HAVE_VALGRIND,1,[Define this symbol if valgrind is installed])])
16+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
17+
#include <valgrind/memcheck.h>
18+
]], [[
19+
#if defined(NVALGRIND)
20+
# error "Valgrind does not support this platform."
21+
#endif
22+
]])], [has_valgrind=yes; AC_DEFINE(HAVE_VALGRIND,1,[Define this symbol if valgrind is installed, and it supports the host platform])])
1723
fi
1824
])
1925

0 commit comments

Comments
 (0)