| 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 | 12 |
| 13 system_is_snow_leopard() { |
| 14 uname -r | grep 10\.[0-9]\.[0-9] >/dev/null |
| 15 } |
| 16 |
| 13 checkout_and_patch_valgrind() { | 17 checkout_and_patch_valgrind() { |
| 14 # $1 = Valgrind revision | 18 # $1 = Valgrind revision |
| 15 # $2 = VEX revision | 19 # $2 = VEX revision |
| 16 # $3 = source dir | 20 # $3 = source dir |
| 17 # Checkout Valgrind, apply our patches to Valgrind. | 21 # Checkout Valgrind, apply our patches to Valgrind. |
| 18 # The source will be put in $THISDIR/valgrind-source | 22 # The source will be put in $THISDIR/valgrind-source |
| 19 cd $THISDIR | 23 cd $THISDIR |
| 20 VG_REV="$1" | 24 VG_REV="$1" |
| 21 VEX_REV="$2" | 25 VEX_REV="$2" |
| 22 SOURCE_DIR="$3" | 26 SOURCE_DIR="$3" |
| 23 | 27 |
| 28 if system_is_snow_leopard |
| 29 then |
| 30 SVN_URI="svn://svn.valgrind.org/valgrind/branches/MACOSX106" |
| 31 else |
| 32 SVN_URI="svn://svn.valgrind.org/valgrind/trunk" |
| 33 fi |
| 34 |
| 24 test -d "$SOURCE_DIR" && rm -rf "$SOURCE_DIR" | 35 test -d "$SOURCE_DIR" && rm -rf "$SOURCE_DIR" |
| 25 mkdir "$SOURCE_DIR" | 36 mkdir "$SOURCE_DIR" |
| 26 | 37 |
| 27 # Check out latest version that following patches known to apply against | 38 # Check out latest version that following patches known to apply against |
| 28 svn co -r "$VG_REV" "svn://svn.valgrind.org/valgrind/trunk" "$SOURCE_DIR" | 39 svn co -r "$VG_REV" "$SVN_URI" "$SOURCE_DIR" |
| 29 | 40 |
| 30 cd "$SOURCE_DIR" | 41 cd "$SOURCE_DIR" |
| 31 # Make sure svn gets the right version of the external VEX repo, too | 42 # Make sure svn gets the right version of the external VEX repo, too |
| 32 svn up -r "$VEX_REV" VEX/ | 43 svn up -r "$VEX_REV" VEX/ |
| 33 | 44 |
| 34 # Apply common patches to Valgrind {{{1 | 45 # Apply common patches to Valgrind {{{1 |
| 35 # Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 | 46 # Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 |
| 36 # "fork() not handled properly" | 47 # "fork() not handled properly" |
| 37 patch -p0 -i "${THISDIR}/fork.patch" | 48 patch -p0 -i "${THISDIR}/fork.patch" |
| 38 | 49 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 # $2 = flags to pass to configure | 72 # $2 = flags to pass to configure |
| 62 # {{{1 | 73 # {{{1 |
| 63 OUTPUT_DIR="$BINARIES_DIR/$1" | 74 OUTPUT_DIR="$BINARIES_DIR/$1" |
| 64 CONFIGURE_FLAGS=$2 | 75 CONFIGURE_FLAGS=$2 |
| 65 | 76 |
| 66 PREV_DIR=`pwd` | 77 PREV_DIR=`pwd` |
| 67 | 78 |
| 68 # Wipe out all Makefiles which could be left by the previous installation. | 79 # Wipe out all Makefiles which could be left by the previous installation. |
| 69 make distclean || true | 80 make distclean || true |
| 70 | 81 |
| 71 sh autogen.sh | 82 sh autogen.sh || autoreconf -fvi |
| 72 if test -L install-sh | 83 if test -L install-sh |
| 73 then | 84 then |
| 74 # replace symlink with actual contents! | 85 # replace symlink with actual contents! |
| 75 cp install-sh install-sh.new | 86 cp install-sh install-sh.new |
| 76 mv -f install-sh.new install-sh | 87 mv -f install-sh.new install-sh |
| 77 chmod +x install-sh | 88 chmod +x install-sh |
| 78 fi | 89 fi |
| 79 | 90 |
| 80 # If gold is installed as a linker, use the old one | 91 # If gold is installed as a linker, use the old one |
| 81 OVERRIDE_LD_DIR="${THISDIR}/override_ld" | 92 OVERRIDE_LD_DIR="${THISDIR}/override_ld" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 case `uname -sm` in | 206 case `uname -sm` in |
| 196 "Linux x86_64") | 207 "Linux x86_64") |
| 197 # We can build both 64/32-bit and 32-bit Valgrinds | 208 # We can build both 64/32-bit and 32-bit Valgrinds |
| 198 build_valgrind "linux_x64" | 209 build_valgrind "linux_x64" |
| 199 build_valgrind "linux_x86" "--enable-only32bit" | 210 build_valgrind "linux_x86" "--enable-only32bit" |
| 200 ;; | 211 ;; |
| 201 "Darwin i386") | 212 "Darwin i386") |
| 202 if uname -r | grep 9\.[0-9]\.[0-9] >/dev/null | 213 if uname -r | grep 9\.[0-9]\.[0-9] >/dev/null |
| 203 then | 214 then |
| 204 build_valgrind "mac" | 215 build_valgrind "mac" |
| 216 elif system_is_snow_leopard |
| 217 then |
| 218 build_valgrind "mac_10.6" "--build=amd64-darwin" |
| 205 else | 219 else |
| 206 echo "You have Darwin kernel different from 9.X.X" >&2 | 220 echo "You have Darwin kernel different from 9.X.X or 10.X.X" >&2 |
| 207 echo "Please, don't put the resulting binaries into Chromium SVN" >&2 | 221 echo "Please, don't put the resulting binaries into Chromium SVN" >&2 |
| 208 build_valgrind "local" | 222 build_valgrind "local" |
| 209 fi | 223 fi |
| 210 ;; | 224 ;; |
| 211 *) | 225 *) |
| 212 build_valgrind "local" | 226 build_valgrind "local" |
| 213 ;; | 227 ;; |
| 214 esac | 228 esac |
| 215 } | 229 } |
| 216 | 230 |
| 217 # Check that the binaries directory exists. | 231 # Check that the binaries directory exists. |
| 218 BINARIES_DIR="$THISDIR/../binaries" | 232 BINARIES_DIR="$THISDIR/../binaries" |
| 219 if ! [ -a $BINARIES_DIR ] | 233 if ! [ -a $BINARIES_DIR ] |
| 220 then | 234 then |
| 221 echo "Error: $BINARIES_DIR doesn't exist!" >&2 | 235 echo "Error: $BINARIES_DIR doesn't exist!" >&2 |
| 222 exit 1 | 236 exit 1 |
| 223 fi | 237 fi |
| 224 | 238 |
| 225 set -e | 239 set -e |
| 226 set -x | 240 set -x |
| OLD | NEW |