Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This script will check out llvm and clang into third_party/llvm and build it. | 6 # This script will check out llvm and clang into third_party/llvm and build it. |
| 7 | 7 |
| 8 THIS_DIR="$(dirname "${0}")" | 8 THIS_DIR="$(dirname "${0}")" |
| 9 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 9 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
| 10 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build" | 10 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 ;; | 35 ;; |
| 36 --mac-only) | 36 --mac-only) |
| 37 mac_only=yes | 37 mac_only=yes |
| 38 ;; | 38 ;; |
| 39 --run-tests) | 39 --run-tests) |
| 40 run_tests=yes | 40 run_tests=yes |
| 41 ;; | 41 ;; |
| 42 --help) | 42 --help) |
| 43 echo "usage: $0 [--force-local-build] [--mac-only] [--run-tests] " | 43 echo "usage: $0 [--force-local-build] [--mac-only] [--run-tests] " |
| 44 echo "--force-local-build: Don't try to download prebuilt binaries." | 44 echo "--force-local-build: Don't try to download prebuilt binaries." |
| 45 echo "--mac-only: Do nothing on non-Mac systems." | 45 echo "--mac-only: Do initial download only on Mac systems." |
| 46 echo "--run-tests: Run tests after building. Only for local builds." | 46 echo "--run-tests: Run tests after building. Only for local builds." |
| 47 exit 1 | 47 exit 1 |
| 48 ;; | 48 ;; |
| 49 esac | 49 esac |
| 50 shift | 50 shift |
| 51 done | 51 done |
| 52 | 52 |
| 53 if [[ -n "$mac_only" ]] && [[ "${OS}" != "Darwin" ]]; then | 53 # --mac-only prevents the initial download on non-mac systems, but if clang has |
| 54 exit 0 | 54 # already been downloaded in the past, this script keeps it up to date even if |
| 55 # --mac-only is passed in and the system isn't a mac. People who don't like this | |
| 56 # can just delete their third_party/llvm-build directory. | |
| 57 if ! [ -d "${LLVM_BUILD_DIR}" ]; then | |
|
Mark Mentovai
2011/10/31 21:06:02
Use [[ double ]] square brackets.
(unused - use chromium)
2011/10/31 21:16:32
Done.
| |
| 58 if [[ -n "$mac_only" ]] && [[ "${OS}" != "Darwin" ]]; then | |
|
Mark Mentovai
2011/10/31 21:06:02
Instead of wrapping an if instead of another if li
(unused - use chromium)
2011/10/31 21:16:32
Seemed clearer to me for some reason. Changed.
| |
| 59 exit 0 | |
| 60 fi | |
| 55 fi | 61 fi |
| 56 | 62 |
| 57 # TODO(thakis): Remove this after Sept 29 2011. http://crbug.com/96722 | 63 # TODO(thakis): Remove this after Sept 29 2011. http://crbug.com/96722 |
| 58 for rev in 138188 138417 139029 139473 139990; do | 64 for rev in 138188 138417 139029 139473 139990; do |
| 59 rm -f clang-$rev.tgz | 65 rm -f clang-$rev.tgz |
| 60 rm -rf clang-$rev | 66 rm -rf clang-$rev |
| 61 done | 67 done |
| 62 | 68 |
| 63 # Xcode and clang don't get along when predictive compilation is enabled. | 69 # Xcode and clang don't get along when predictive compilation is enabled. |
| 64 # http://crbug.com/96315 | 70 # http://crbug.com/96315 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 if [[ -n "$run_tests" ]]; then | 223 if [[ -n "$run_tests" ]]; then |
| 218 # Run a few tests. | 224 # Run a few tests. |
| 219 "${PLUGIN_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" | 225 "${PLUGIN_SRC_DIR}/tests/test.sh" "${LLVM_BUILD_DIR}/Release+Asserts" |
| 220 cd "${LLVM_BUILD_DIR}" | 226 cd "${LLVM_BUILD_DIR}" |
| 221 make check-all | 227 make check-all |
| 222 cd - | 228 cd - |
| 223 fi | 229 fi |
| 224 | 230 |
| 225 # After everything is done, log success for this revision. | 231 # After everything is done, log success for this revision. |
| 226 echo "${CLANG_REVISION}" > "${STAMP_FILE}" | 232 echo "${CLANG_REVISION}" > "${STAMP_FILE}" |
| OLD | NEW |