Skip to content

Commit 22da7f7

Browse files
committed
configure: Allow specifying --with[out]-valgrind explicitly
1 parent 79f1f7a commit 22da7f7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

configure.ac

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,19 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
168168
)],
169169
[req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto])
170170

171-
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [enable_valgrind=no], [])
171+
AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
172+
[Build with extra check for running inside Valgrind [default=auto]]
173+
)],
174+
[req_valgrind=$withval], [req_valgrind=auto])
175+
176+
if test x"$req_valgrind" != x"no"; then
177+
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [
178+
if test x"$req_valgrind" = x"yes"; then
179+
AC_MSG_ERROR([Valgrind support explicitly requested but valgrind/memcheck.h header not available])
180+
fi
181+
enable_valgrind=no
182+
], [])
183+
fi
172184
AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
173185

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

0 commit comments

Comments
 (0)