build: Add a check that Valgrind actually supports a host platform

This commit is contained in:
Hennadii Stepanov 2021-12-03 15:14:30 +02:00
parent 49f608de47
commit 7c7ce872a5
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
1 changed files with 7 additions and 1 deletions

View File

@ -13,7 +13,13 @@ AC_DEFUN([SECP_VALGRIND_CHECK],[
if test x"$has_valgrind" != x"yes"; then
CPPFLAGS_TEMP="$CPPFLAGS"
CPPFLAGS="$VALGRIND_CPPFLAGS $CPPFLAGS"
AC_CHECK_HEADER([valgrind/memcheck.h], [has_valgrind=yes; AC_DEFINE(HAVE_VALGRIND,1,[Define this symbol if valgrind is installed])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <valgrind/memcheck.h>
]], [[
#if defined(NVALGRIND)
# error "Valgrind does not support this platform."
#endif
]])], [has_valgrind=yes; AC_DEFINE(HAVE_VALGRIND,1,[Define this symbol if valgrind is installed, and it supports the host platform])])
fi
])