Skip to content

Commit d7838ba

Browse files
committed
Merge #813: Enable configuring Valgrind support
412bf87 configure: Allow specifying --with[out]-valgrind explicitly (Luke Dashjr) Pull request description: ACKs for top commit: sipa: ACK 412bf87. Tested by running configure on a system with and without valgrind, and with no argument, with `--with-valgrind`, and with `--without-valgrind`. real-or-random: ACK 412bf87 jonasnick: ACK 412bf87 Tree-SHA512: 92417609751e5af813faff1661055cd37f3d00dbcf109a8f14f8ba59d9f3d620c9c6b67d2b1629b6ab75e2afcd47d2b3898a0427931567fb505bc92fa5ee3532
2 parents 7ceb0b7 + 412bf87 commit d7838ba

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
@@ -178,7 +178,21 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
178178
)],
179179
[req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto])
180180

181-
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [enable_valgrind=no], [])
181+
AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
182+
[Build with extra checks for running inside Valgrind [default=auto]]
183+
)],
184+
[req_valgrind=$withval], [req_valgrind=auto])
185+
186+
if test x"$req_valgrind" = x"no"; then
187+
enable_valgrind=no
188+
else
189+
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [
190+
if test x"$req_valgrind" = x"yes"; then
191+
AC_MSG_ERROR([Valgrind support explicitly requested but valgrind/memcheck.h header not available])
192+
fi
193+
enable_valgrind=no
194+
], [])
195+
fi
182196
AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
183197

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

0 commit comments

Comments
 (0)