| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009-2010 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 # This script contains some functions useful to build | 7 # This script contains some functions useful to build |
| 8 # Valgrind and ThreadSanitizer for use with chromium | 8 # Valgrind and ThreadSanitizer for use with chromium |
| 9 | 9 |
| 10 THISDIR=$(dirname "${0}") | 10 THISDIR=$(dirname "${0}") |
| 11 THISDIR=$(cd "${THISDIR}" && /bin/pwd) | 11 THISDIR=$(cd "${THISDIR}" && /bin/pwd) |
| 12 VG_SRC_DIR=/tmp/valgrind-src | 12 VG_SRC_DIR=/tmp/valgrind-src |
| 13 | 13 |
| 14 system_is_snow_leopard() { | 14 system_is_snow_leopard() { |
| 15 uname -r | grep 10\.[0-9]\.[0-9] >/dev/null | 15 uname -r | grep 10\.[0-9]\.[0-9] >/dev/null |
| 16 } | 16 } |
| 17 | 17 |
| 18 system_is_lion() { | 18 system_is_lion() { |
| 19 uname -r | grep 11\.[0-9]\.[0-9] >/dev/null | 19 uname -r | grep 11\.[0-9]\.[0-9] >/dev/null |
| 20 } | 20 } |
| 21 | 21 |
| 22 system_is_mountain_lion() { |
| 23 uname -r | grep 12\.[0-9]\.[0-9] >/dev/null |
| 24 } |
| 25 |
| 22 checkout_and_patch_valgrind_variant() { | 26 checkout_and_patch_valgrind_variant() { |
| 23 # $1 = Valgrind-variant revision | 27 # $1 = Valgrind-variant revision |
| 24 # $2 = source dir | 28 # $2 = source dir |
| 25 # Checkout Valgrind, apply our patches to Valgrind. | 29 # Checkout Valgrind, apply our patches to Valgrind. |
| 26 # The source will be put in $VG_SRC_DIR/valgrind-source | 30 # The source will be put in $VG_SRC_DIR/valgrind-source |
| 27 mkdir -p "$VG_SRC_DIR" | 31 mkdir -p "$VG_SRC_DIR" |
| 28 cd "$VG_SRC_DIR" | 32 cd "$VG_SRC_DIR" |
| 29 VG_REV="$1" | 33 VG_REV="$1" |
| 30 SOURCE_DIR="$2" | 34 SOURCE_DIR="$2" |
| 31 SVN_URI="http://valgrind-variant.googlecode.com/svn/trunk" | 35 SVN_URI="http://valgrind-variant.googlecode.com/svn/trunk" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 "Darwin i386") | 162 "Darwin i386") |
| 159 if uname -r | grep 9\.[0-9]\.[0-9] >/dev/null | 163 if uname -r | grep 9\.[0-9]\.[0-9] >/dev/null |
| 160 then | 164 then |
| 161 build_valgrind "mac" | 165 build_valgrind "mac" |
| 162 elif system_is_snow_leopard | 166 elif system_is_snow_leopard |
| 163 then | 167 then |
| 164 build_valgrind "mac_10.6" "--build=amd64-darwin" | 168 build_valgrind "mac_10.6" "--build=amd64-darwin" |
| 165 elif system_is_lion | 169 elif system_is_lion |
| 166 then | 170 then |
| 167 build_valgrind "mac_10.7" | 171 build_valgrind "mac_10.7" |
| 172 elif system_is_mountain_lion |
| 173 then |
| 174 build_valgrind "mac_10.7" |
| 168 else | 175 else |
| 169 echo "You have Darwin kernel different from 9.X.X--11.X.X" >&2 | 176 echo "You have Darwin kernel different from 9.X.X--11.X.X" >&2 |
| 170 echo "Please, don't put the resulting binaries into Chromium SVN" >&2 | 177 echo "Please, don't put the resulting binaries into Chromium SVN" >&2 |
| 171 build_valgrind "local" | 178 build_valgrind "local" |
| 172 fi | 179 fi |
| 173 ;; | 180 ;; |
| 174 "Darwin x86_64") | 181 "Darwin x86_64") |
| 175 if system_is_lion | 182 if system_is_lion |
| 176 then | 183 then |
| 177 build_valgrind "mac_10.7" | 184 build_valgrind "mac_10.7" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 193 # Check that the binaries directory exists. | 200 # Check that the binaries directory exists. |
| 194 BINARIES_DIR="$THISDIR/../binaries" | 201 BINARIES_DIR="$THISDIR/../binaries" |
| 195 if ! [ -a "$BINARIES_DIR" ] | 202 if ! [ -a "$BINARIES_DIR" ] |
| 196 then | 203 then |
| 197 echo "Error: $BINARIES_DIR doesn't exist!" >&2 | 204 echo "Error: $BINARIES_DIR doesn't exist!" >&2 |
| 198 exit 1 | 205 exit 1 |
| 199 fi | 206 fi |
| 200 | 207 |
| 201 set -e | 208 set -e |
| 202 set -x | 209 set -x |
| OLD | NEW |