aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-04-28 14:01:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-04-28 14:01:40 +0000
commit279a935ff4bc1df86e090f8e28f15d70384514eb (patch)
treea5bc6249aa24285c664840fc0a7c18d7aea148b9 /gcc/configure
parent07357f2f5a81e008b78af738e5e0050d850425a8 (diff)
downloadgcc-279a935ff4bc1df86e090f8e28f15d70384514eb.zip
gcc-279a935ff4bc1df86e090f8e28f15d70384514eb.tar.gz
gcc-279a935ff4bc1df86e090f8e28f15d70384514eb.tar.bz2
configure.ac: Do valgrind header checks unconditionally.
2014-04-28 Richard Biener <rguenther@suse.de> * configure.ac: Do valgrind header checks unconditionally. Add --enable-valgrind-annotations. * system.h: Guard valgrind header inclusion with ENABLE_VALGRIND_ANNOTATIONS instead of ENABLE_VALGRIND_CHECKING. * alloc-pool.c (pool_alloc, pool_free): Use ENABLE_VALGRIND_ANNOTATIONS instead of ENABLE_VALGRIND_CHECKING to guard possibly dead code. * config.in: Regenerated. * configure: Likewise. From-SVN: r209861
Diffstat (limited to 'gcc/configure')
-rwxr-xr-xgcc/configure65
1 files changed, 44 insertions, 21 deletions
diff --git a/gcc/configure b/gcc/configure
index e806873..d912261 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -882,6 +882,7 @@ enable_werror_always
enable_checking
enable_coverage
enable_gather_detailed_mem_stats
+enable_valgrind_annotations
with_stabs
enable_multilib
enable_multiarch
@@ -1591,6 +1592,8 @@ Optional Features:
Values are opt, noopt, default is noopt
--enable-gather-detailed-mem-stats
enable detailed memory allocation stats gathering
+ --enable-valgrind-annotations
+ enable valgrind runtime interaction
--enable-multilib enable library support for multiple ABIs
--enable-multiarch enable support for multiarch paths
--enable-__cxa_atexit enable __cxa_atexit for C++
@@ -6772,12 +6775,11 @@ fi
-if test x$ac_valgrind_checking != x ; then
- # It is certainly possible that there's valgrind but no valgrind.h.
- # GCC relies on making annotations so we must have both.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND_DISCARD in <valgrind/memcheck.h>" >&5
+# It is certainly possible that there's valgrind but no valgrind.h.
+# GCC relies on making annotations so we must have both.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND_DISCARD in <valgrind/memcheck.h>" >&5
$as_echo_n "checking for VALGRIND_DISCARD in <valgrind/memcheck.h>... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <valgrind/memcheck.h>
#ifndef VALGRIND_DISCARD
@@ -6790,11 +6792,11 @@ else
gcc_cv_header_valgrind_memcheck_h=no
fi
rm -f conftest.err conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_valgrind_memcheck_h" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_valgrind_memcheck_h" >&5
$as_echo "$gcc_cv_header_valgrind_memcheck_h" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
$as_echo_n "checking for VALGRIND_DISCARD in <memcheck.h>... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <memcheck.h>
#ifndef VALGRIND_DISCARD
@@ -6807,8 +6809,20 @@ else
gcc_cv_header_memcheck_h=no
fi
rm -f conftest.err conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_memcheck_h" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_memcheck_h" >&5
$as_echo "$gcc_cv_header_memcheck_h" >&6; }
+if test $gcc_cv_header_valgrind_memcheck_h = yes; then
+
+$as_echo "#define HAVE_VALGRIND_MEMCHECK_H 1" >>confdefs.h
+
+fi
+if test $gcc_cv_header_memcheck_h = yes; then
+
+$as_echo "#define HAVE_MEMCHECK_H 1" >>confdefs.h
+
+fi
+
+if test x$ac_valgrind_checking != x ; then
# Prepare PATH_SEPARATOR.
# The user is always right.
@@ -6887,16 +6901,6 @@ fi
$as_echo "#define ENABLE_VALGRIND_CHECKING 1" >>confdefs.h
- if test $gcc_cv_header_valgrind_memcheck_h = yes; then
-
-$as_echo "#define HAVE_VALGRIND_MEMCHECK_H 1" >>confdefs.h
-
- fi
- if test $gcc_cv_header_memcheck_h = yes; then
-
-$as_echo "#define HAVE_MEMCHECK_H 1" >>confdefs.h
-
- fi
fi
@@ -6939,6 +6943,25 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+# Check whether --enable-valgrind-annotations was given.
+if test "${enable_valgrind_annotations+set}" = set; then :
+ enableval=$enable_valgrind_annotations;
+else
+ enable_valgrind_annotations=no
+fi
+
+if test x$enable_valgrind_annotations != xno \
+ || test x$ac_valgrind_checking != x; then
+ if (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ as_fn_error "*** Can't find valgrind/memcheck.h, memcheck.h or valgrind.h" "$LINENO" 5
+ fi
+
+$as_echo "#define ENABLE_VALGRIND_ANNOTATIONS 1" >>confdefs.h
+
+fi
+
# -------------------------------
# Miscenalleous configure options
# -------------------------------
@@ -17971,7 +17994,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17974 "configure"
+#line 17997 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18077,7 +18100,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18080 "configure"
+#line 18103 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H