3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Prints a path to Valgrind binaries to be used for Chromium.
8 # Select the valgrind from third_party/valgrind by default,
9 # but allow users to override this default without editing scripts and
10 # without specifying a commandline option
12 export THISDIR
=`dirname $0`
14 # User may use his own valgrind by giving its path with CHROME_VALGRIND env.
15 if [ "$CHROME_VALGRIND" = "" ]
17 # Guess which binaries we should use by uname
25 *Darwin
*9.
[678].
[01]*i386
*)
26 # Didn't test other kernels.
29 *Darwin
*10.
[0-9].
[0-9]*i386
*)
32 *Darwin
*10.
[0-9].
[0-9]*x86_64
*)
35 *Darwin
*11.
[0-9].
[0-9]*x86_64
*)
39 (echo "Sorry, your platform is not supported:" &&
42 echo "If you're on Mac OS X, please see http://crbug.com/441425") >&2
46 # The binaries should be in third_party/valgrind
47 # (checked out from deps/third_party/valgrind/binaries).
48 CHROME_VALGRIND
="$THISDIR/../../third_party/valgrind/$PLATFORM"
50 # TODO(timurrrr): readlink -f is not present on Mac...
51 if [ "$PLATFORM" != "mac" ] && \
52 [ "$PLATFORM" != "mac_10.6" ] && \
53 [ "$PLATFORM" != "mac_10.7" ]
55 # Get rid of all "../" dirs
56 CHROME_VALGRIND
=$
(readlink
-f $CHROME_VALGRIND)
60 if ! test -x $CHROME_VALGRIND/bin
/valgrind
62 echo "Oops, could not find Valgrind binaries in your checkout." >&2
64 echo " http://dev.chromium.org/developers/how-tos/using-valgrind/get-valgrind" >&2
65 echo "for the instructions on how to download pre-built binaries." >&2