configure.in: Check for <memcheck.h>.

* configure.in: Check for <memcheck.h>.
        * configure: Regenerated.

	* config.in: Define HAVE_MEMCHECK_H.

	* ggc-common.c: Use <memcheck.h> if available instead of
	<valgrind.h>.
	* ggc-page.c: Likewise.
	* cppfiles.c: Likewise.

From-SVN: r63788
This commit is contained in:
Andreas Jaeger 2003-03-04 18:51:00 +01:00
parent 6b919a8ab9
commit 14011ca451
6 changed files with 322 additions and 262 deletions

View File

@ -347,6 +347,9 @@
through valgrind (a memory checker). This is extremely expensive. */
#undef ENABLE_VALGRIND_CHECKING
/* Define if valgrind's memcheck.h header is installed. */
#undef HAVE_MEMCHECK_H
/* Define if you want to use __cxa_atexit, rather than atexit, to
register C++ destructors for local statics and global objects.
This is essential for fully standards-compliant handling of

547
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -389,6 +389,15 @@ valgrind_command=
if test x$ac_checking_valgrind != x ; then
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
AC_MSG_CHECKING(for VALGRIND_DISCARD in <memcheck.h>)
AC_TRY_CPP(
[#include <memcheck.h>
#ifndef VALGRIND_DISCARD
#error VALGRIND_DISCARD not defined
#endif],
[gcc_cv_header_memcheck_h=yes],
gcc_cv_header_memcheck_h=no)
AC_MSG_RESULT($gcc_cv_header_memcheck_h)
AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
[$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
@ -400,6 +409,10 @@ if test x$ac_checking_valgrind != x ; then
AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
[Define if you want to run subprograms and generated programs
through valgrind (a memory checker). This is extremely expensive.])
if test $gcc_cv_header_memcheck_h = yes; then
AC_DEFINE(HAVE_MEMCHECK_H, 1,
[Define if valgrind's memcheck.h header is installed.])
fi
fi
AC_SUBST(valgrind_path_defines)
AC_SUBST(valgrind_command)

View File

@ -31,7 +31,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "mkdeps.h"
#include "splay-tree.h"
#ifdef ENABLE_VALGRIND_CHECKING
#include <valgrind.h>
# ifdef HAVE_MEMCHECK_H
# include <memcheck.h>
# else
# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)

View File

@ -1,5 +1,6 @@
/* Simple garbage collection for the GNU compiler.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@ -38,7 +39,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#ifdef ENABLE_VALGRIND_CHECKING
#include <valgrind.h>
# ifdef HAVE_MEMCHECK_H
# include <memcheck.h>
# else
# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)

View File

@ -32,7 +32,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "timevar.h"
#include "params.h"
#ifdef ENABLE_VALGRIND_CHECKING
#include <valgrind.h>
# ifdef HAVE_MEMCHECK_H
# include <memcheck.h>
# else
# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)