Skip to content

Commit 73aaab9

Browse files
luke-jrdeadalnix
authored andcommitted
configure: Allow specifying --with[out]-valgrind explicitly
Summary: This is a backport of secp256k1 [[bitcoin-core/secp256k1#813 | PR813]] Test Plan: make check Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D7614
1 parent a1e34a7 commit 73aaab9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

configure.ac

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,21 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
187187

188188
AC_CHECK_TYPES([__int128])
189189

190-
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [enable_valgrind=no], [])
190+
AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
191+
[Build with extra checks for running inside Valgrind [default=auto]]
192+
)],
193+
[req_valgrind=$withval], [req_valgrind=auto])
194+
195+
if test x"$req_valgrind" = x"no"; then
196+
enable_valgrind=no
197+
else
198+
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [
199+
if test x"$req_valgrind" = x"yes"; then
200+
AC_MSG_ERROR([Valgrind support explicitly requested but valgrind/memcheck.h header not available])
201+
fi
202+
enable_valgrind=no
203+
], [])
204+
fi
191205
AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
192206

193207
if test x"$enable_coverage" = x"yes"; then

0 commit comments

Comments
 (0)