]> Git Repo - secp256k1.git/commitdiff
configure: Allow specifying --with[out]-valgrind explicitly
authorLuke Dashjr <[email protected]>
Sat, 12 Sep 2020 19:15:56 +0000 (19:15 +0000)
committerLuke Dashjr <[email protected]>
Mon, 14 Sep 2020 21:43:45 +0000 (21:43 +0000)
configure.ac

index 1c01c4f981bd1cbd00293fbeef8cd95d61badacc..97ace61b80398c0fbcb97697d9f5af6929d9c5f6 100644 (file)
@@ -168,7 +168,21 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
 )],
 [req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto])
 
-AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [enable_valgrind=no], [])
+AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
+[Build with extra checks for running inside Valgrind [default=auto]]
+)],
+[req_valgrind=$withval], [req_valgrind=auto])
+
+if test x"$req_valgrind" = x"no"; then
+  enable_valgrind=no
+else
+  AC_CHECK_HEADER([valgrind/memcheck.h], [enable_valgrind=yes], [
+    if test x"$req_valgrind" = x"yes"; then
+      AC_MSG_ERROR([Valgrind support explicitly requested but valgrind/memcheck.h header not available])
+    fi
+    enable_valgrind=no
+  ], [])
+fi
 AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
 
 if test x"$enable_coverage" = x"yes"; then
This page took 0.024139 seconds and 4 git commands to generate.