| 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}") |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 sh autogen.sh || autoreconf -fvi | 50 sh autogen.sh || autoreconf -fvi |
| 51 if test -L install-sh | 51 if test -L install-sh |
| 52 then | 52 then |
| 53 # replace symlink with actual contents! | 53 # replace symlink with actual contents! |
| 54 cp install-sh install-sh.new | 54 cp install-sh install-sh.new |
| 55 mv -f install-sh.new install-sh | 55 mv -f install-sh.new install-sh |
| 56 chmod +x install-sh | 56 chmod +x install-sh |
| 57 fi | 57 fi |
| 58 | 58 |
| 59 ./configure $CONFIGURE_FLAGS --prefix="${OUTPUT_DIR}" | 59 ./configure $CONFIGURE_FLAGS --prefix="${OUTPUT_DIR}" |
| 60 make -j4 | 60 make -j8 |
| 61 | 61 |
| 62 # Test if Valgrind binary works on a simple program {{{2 | 62 # Test if Valgrind binary works on a simple program {{{2 |
| 63 cat > simpletest.c <<EOF | 63 cat > simpletest.c <<EOF |
| 64 #include <stdio.h> | 64 #include <stdio.h> |
| 65 int main(void) { | 65 int main(void) { |
| 66 printf("OK\n"); | 66 printf("OK\n"); |
| 67 return 0; | 67 return 0; |
| 68 } | 68 } |
| 69 EOF | 69 EOF |
| 70 if echo "$CONFIGURE_FLAGS" | grep "\-\-enable\-only32bit"; | 70 if echo "$CONFIGURE_FLAGS" | grep "\-\-enable\-only32bit"; |
| 71 then | 71 then |
| 72 gcc -m32 simpletest.c -o simpletest | 72 gcc -m32 simpletest.c -o simpletest |
| 73 else | 73 else |
| 74 gcc simpletest.c -o simpletest | 74 gcc simpletest.c -o simpletest |
| 75 fi | 75 fi |
| 76 | 76 |
| 77 if ! ./vg-in-place ./simpletest | 77 if ! ./vg-in-place ./simpletest |
| 78 then | 78 then |
| 79 echo built valgrind fails smoke test | 79 echo built valgrind fails smoke test |
| 80 exit 1 | 80 exit 1 |
| 81 fi | 81 fi |
| 82 # }}} | 82 # }}} |
| 83 | 83 |
| 84 test -d "${OVERRIDE_LD_DIR}" && rm -rf "${OVERRIDE_LD_DIR}" | 84 test -d "${OVERRIDE_LD_DIR}" && rm -rf "${OVERRIDE_LD_DIR}" |
| 85 | 85 |
| 86 # Finally install valgrind to $OUTPUT_DIR. | 86 # Finally install valgrind to $OUTPUT_DIR. |
| 87 make install | 87 make -j8 install |
| 88 | 88 |
| 89 if [ "$CONFIGURE_FLAGS" == "" ] ; then | 89 if [ "$CONFIGURE_FLAGS" == "" ] ; then |
| 90 rm -rf "$BINARIES_DIR/local" | 90 rm -rf "$BINARIES_DIR/local" |
| 91 ln -s "$OUTPUT_DIR" "$BINARIES_DIR/local" | 91 ln -s "$OUTPUT_DIR" "$BINARIES_DIR/local" |
| 92 fi | 92 fi |
| 93 | 93 |
| 94 maybe_build_gdb_for_mac "$OUTPUT_DIR" | 94 maybe_build_gdb_for_mac "$OUTPUT_DIR" |
| 95 | 95 |
| 96 # Delete un-needed stuff from the $OUTPUT_DIR | 96 # Delete un-needed stuff from the $OUTPUT_DIR |
| 97 # TODO(timurrrr): probably, we should just don't build the unused tools | 97 # TODO(timurrrr): probably, we should just don't build the unused tools |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 # Check that the binaries directory exists. | 173 # Check that the binaries directory exists. |
| 174 BINARIES_DIR="$THISDIR/../binaries" | 174 BINARIES_DIR="$THISDIR/../binaries" |
| 175 if ! [ -a "$BINARIES_DIR" ] | 175 if ! [ -a "$BINARIES_DIR" ] |
| 176 then | 176 then |
| 177 echo "Error: $BINARIES_DIR doesn't exist!" >&2 | 177 echo "Error: $BINARIES_DIR doesn't exist!" >&2 |
| 178 exit 1 | 178 exit 1 |
| 179 fi | 179 fi |
| 180 | 180 |
| 181 set -e | 181 set -e |
| 182 set -x | 182 set -x |
| OLD | NEW |