This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix check for valgrind


Andreas Jaeger <aj at suse dot de> writes:

> Including <valgrind.h> produces now an error and advices to include
> only <memcheck.h> - but the configure test required a working
> <valgrind.h>.
>
> I've tested the appended patch with new valgridn and commit it now as
> obvious,

Mark, is this ok for 3.3?

Andreas

> Andreas
>
> 2003-03-16  Andreas Jaeger  <aj at suse dot de>
>
> 	* configure.in: Improve check for memcheck.h.
>
> ============================================================
> Index: gcc/configure
> --- gcc/configure	12 Mar 2003 20:56:04 -0000	1.667
> +++ gcc/configure	16 Mar 2003 09:24:04 -0000
> @@ -2179,8 +2179,8 @@ else
>    echo "$ac_t""no" 1>&6
>  fi
>  
> -  if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then
> -	{ echo "configure: error: *** Can't find both valgrind and valgrind.h" 1>&2; exit 1; }
> +  if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
> +	{ echo "configure: error: *** Can't find both valgrind and valgrind.h/memcheck.h" 1>&2; exit 1; }
>    fi
>    valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
>    valgrind_command="$valgrind_path -q"
> ============================================================
> Index: gcc/configure.in
> --- gcc/configure.in	12 Mar 2003 20:56:04 -0000	1.652
> +++ gcc/configure.in	16 Mar 2003 09:24:06 -0000
> @@ -417,8 +417,8 @@ if test x$ac_checking_valgrind != x ; th
>    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])
> -  if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then
> -	AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h])
> +  if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
> +	AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h/memcheck.h])
>    fi
>    valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
>    valgrind_command="$valgrind_path -q"

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj at suse dot de
   private aj at arthur dot inka dot de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]