| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Prints a path to Valgrind binaries to be used for Chromium. | 7 # Prints a path to Valgrind binaries to be used for Chromium. |
| 8 # Select the valgrind from third_party/valgrind by default, | 8 # Select the valgrind from third_party/valgrind by default, |
| 9 # but allow users to override this default without editing scripts and | 9 # but allow users to override this default without editing scripts and |
| 10 # without specifying a commandline option | 10 # without specifying a commandline option |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 *Darwin*10.[0-9].[0-9]*i386*) | 29 *Darwin*10.[0-9].[0-9]*i386*) |
| 30 PLATFORM="mac_10.6" | 30 PLATFORM="mac_10.6" |
| 31 ;; | 31 ;; |
| 32 *Darwin*10.[0-9].[0-9]*x86_64*) | 32 *Darwin*10.[0-9].[0-9]*x86_64*) |
| 33 PLATFORM="mac_10.6" | 33 PLATFORM="mac_10.6" |
| 34 ;; | 34 ;; |
| 35 *Darwin*11.[0-9].[0-9]*x86_64*) | 35 *Darwin*11.[0-9].[0-9]*x86_64*) |
| 36 PLATFORM="mac_10.7" | 36 PLATFORM="mac_10.7" |
| 37 ;; | 37 ;; |
| 38 *) | 38 *) |
| 39 echo "Unknown platform:" >&2 | 39 (echo "Sorry, your platform is not supported:" && |
| 40 uname -a >&2 | 40 uname -a |
| 41 echo "We'll try to search for valgrind binaries installed in /usr/local" >&2 | 41 echo |
| 42 PLATFORM= | 42 echo "If you're on Mac OS X, please see http://crbug.com/441425") >&2 |
| 43 exit 42 |
| 43 esac | 44 esac |
| 44 | 45 |
| 45 if [ "$PLATFORM" != "" ] | 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" |
| 49 |
| 50 # TODO(timurrrr): readlink -f is not present on Mac... |
| 51 if [ "$PLATFORM" != "mac" ] && \ |
| 52 [ "$PLATFORM" != "mac_10.6" ] && \ |
| 53 [ "$PLATFORM" != "mac_10.7" ] |
| 46 then | 54 then |
| 47 # The binaries should be in third_party/valgrind | 55 # Get rid of all "../" dirs |
| 48 # (checked out from deps/third_party/valgrind/binaries). | 56 CHROME_VALGRIND=$(readlink -f $CHROME_VALGRIND) |
| 49 CHROME_VALGRIND="$THISDIR/../../third_party/valgrind/$PLATFORM" | |
| 50 | |
| 51 # TODO(timurrrr): readlink -f is not present on Mac... | |
| 52 if [ "$PLATFORM" != "mac" ] && \ | |
| 53 [ "$PLATFORM" != "mac_10.6" ] && \ | |
| 54 [ "$PLATFORM" != "mac_10.7" ] | |
| 55 then | |
| 56 # Get rid of all "../" dirs | |
| 57 CHROME_VALGRIND=`readlink -f $CHROME_VALGRIND` | |
| 58 fi | |
| 59 | |
| 60 if ! test -x $CHROME_VALGRIND/bin/valgrind | |
| 61 then | |
| 62 # We couldn't find the binaries in third_party/valgrind | |
| 63 CHROME_VALGRIND="" | |
| 64 fi | |
| 65 fi | 57 fi |
| 66 fi | 58 fi |
| 67 | 59 |
| 68 if ! test -x $CHROME_VALGRIND/bin/valgrind | 60 if ! test -x $CHROME_VALGRIND/bin/valgrind |
| 69 then | 61 then |
| 70 echo "Oops, could not find Valgrind binaries in your checkout." >&2 | 62 echo "Oops, could not find Valgrind binaries in your checkout." >&2 |
| 71 echo "Please see" >&2 | 63 echo "Please see" >&2 |
| 72 echo " http://dev.chromium.org/developers/how-tos/using-valgrind/get-valgrind
" >&2 | 64 echo " http://dev.chromium.org/developers/how-tos/using-valgrind/get-valgrind
" >&2 |
| 73 echo "for the instructions on how to download pre-built binaries." >&2 | 65 echo "for the instructions on how to download pre-built binaries." >&2 |
| 74 exit 1 | 66 exit 1 |
| 75 fi | 67 fi |
| 76 | 68 |
| 77 echo $CHROME_VALGRIND | 69 echo $CHROME_VALGRIND |
| OLD | NEW |