Skip to content

Commit 412bf87

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

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
@@ -168,7 +168,21 @@ 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 checks 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+
enable_valgrind=no
178+
else
179+
AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [
180+
if test x"$req_valgrind" = x"yes"; then
181+
AC_MSG_ERROR([Valgrind support explicitly requested but valgrind/memcheck.h header not available])
182+
fi
183+
enable_valgrind=no
184+
], [])
185+
fi
172186
AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
173187

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

0 commit comments

Comments
 (0)