@@ -40,9 +40,9 @@ case $host_os in
40
40
dnl These Homebrew packages may be keg-only, meaning that they won't be found
41
41
dnl in expected paths because they may conflict with system files. Ask
42
42
dnl Homebrew where each one is located, then adjust paths accordingly.
43
-
44
43
openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
45
44
gmp_prefix=`$BREW --prefix gmp 2>/dev/null`
45
+ valgrind_prefix=`$BREW --prefix valgrind 2>/dev/null`
46
46
if test x$openssl_prefix != x; then
47
47
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
48
48
export PKG_CONFIG_PATH
@@ -52,6 +52,9 @@ case $host_os in
52
52
GMP_CPPFLAGS="-I$gmp_prefix/include"
53
53
GMP_LIBS="-L$gmp_prefix/lib"
54
54
fi
55
+ if test x$valgrind_prefix != x; then
56
+ VALGRIND_CPPFLAGS="-I$valgrind_prefix/include"
57
+ fi
55
58
else
56
59
AC_PATH_PROG ( [ PORT] ,port ,)
57
60
dnl if homebrew isn't installed and macports is, add the macports default paths
@@ -180,12 +183,15 @@ AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
180
183
if test x"$req_valgrind" = x"no"; then
181
184
enable_valgrind=no
182
185
else
183
- AC_CHECK_HEADER ( [ valgrind/memcheck.h] , [ enable_valgrind=yes] , [
186
+ SECP_VALGRIND_CHECK
187
+ if test x"$has_valgrind" != x"yes"; then
184
188
if test x"$req_valgrind" = x"yes"; then
185
189
AC_MSG_ERROR ( [ Valgrind support explicitly requested but valgrind/memcheck.h header not available] )
186
190
fi
187
191
enable_valgrind=no
188
- ] , [ ] )
192
+ else
193
+ enable_valgrind=yes
194
+ fi
189
195
fi
190
196
AM_CONDITIONAL([ VALGRIND_ENABLED] ,[ test "$enable_valgrind" = "yes"] )
191
197
@@ -424,6 +430,10 @@ if test x"$set_bignum" = x"gmp"; then
424
430
SECP_INCLUDES="$SECP_INCLUDES $GMP_CPPFLAGS"
425
431
fi
426
432
433
+ if test x"$enable_valgrind" = x"yes"; then
434
+ SECP_INCLUDES="$SECP_INCLUDES $VALGRIND_CPPFLAGS"
435
+ fi
436
+
427
437
if test x"$set_precomp" = x"yes"; then
428
438
AC_DEFINE ( USE_ECMULT_STATIC_PRECOMPUTATION , 1 , [ Define this symbol to use a statically generated ecmult table] )
429
439
fi
0 commit comments