| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Do NOT CHANGE this if you don't know what you're doing -- see | 8 # Do NOT CHANGE this if you don't know what you're doing -- see |
| 9 # https://code.google.com/p/chromium/wiki/UpdatingClang | 9 # https://code.google.com/p/chromium/wiki/UpdatingClang |
| 10 # Reverting problematic clang rolls is safe, though. | 10 # Reverting problematic clang rolls is safe, though. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}" | 183 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}" |
| 184 echo Done | 184 echo Done |
| 185 fi | 185 fi |
| 186 gcc_toolchain="${LLVM_BUILD_TOOLS_DIR}/gcc482" | 186 gcc_toolchain="${LLVM_BUILD_TOOLS_DIR}/gcc482" |
| 187 else | 187 else |
| 188 # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++. | 188 # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++. |
| 189 gcc_toolchain="$(dirname $(dirname $(which gcc)))" | 189 gcc_toolchain="$(dirname $(dirname $(which gcc)))" |
| 190 fi | 190 fi |
| 191 fi | 191 fi |
| 192 | 192 |
| 193 if [[ "${OS}" == "Linux" ]]; then | 193 if [[ "${OS}" == "Linux" || "${OS}" == "Darwin" ]]; then |
| 194 # TODO(hans): Might need to make this work on Mac eventually. | |
| 195 if [[ $(cmake --version | grep -Eo '[0-9.]+') < "3.0" ]]; then | 194 if [[ $(cmake --version | grep -Eo '[0-9.]+') < "3.0" ]]; then |
| 196 # We need a newer CMake version. | 195 # We need a newer CMake version. |
| 197 if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/cmake310" ]]; then | 196 if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/cmake310" ]]; then |
| 198 echo "Downloading pre-built CMake 3.10..." | 197 echo "Downloading pre-built CMake 3.10..." |
| 199 mkdir -p "${LLVM_BUILD_TOOLS_DIR}" | 198 mkdir -p "${LLVM_BUILD_TOOLS_DIR}" |
| 200 curl --fail -L "${CDS_URL}/tools/cmake310.tgz" | \ | 199 curl --fail -L "${CDS_URL}/tools/cmake310_${OS}.tgz" | \ |
| 201 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}" | 200 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}" |
| 202 echo Done | 201 echo Done |
| 203 fi | 202 fi |
| 204 export PATH="${LLVM_BUILD_TOOLS_DIR}/cmake310/bin:${PATH}" | 203 export PATH="${LLVM_BUILD_TOOLS_DIR}/cmake310/bin:${PATH}" |
| 205 fi | 204 fi |
| 206 fi | 205 fi |
| 207 | 206 |
| 208 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}" | 207 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}" |
| 209 fi | 208 fi |
| 210 | 209 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 | 673 |
| 675 if [[ -n "$run_tests" ]]; then | 674 if [[ -n "$run_tests" ]]; then |
| 676 # Run Chrome tool tests. | 675 # Run Chrome tool tests. |
| 677 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 676 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
| 678 # Run the LLVM and Clang tests. | 677 # Run the LLVM and Clang tests. |
| 679 ninja -C "${LLVM_BUILD_DIR}" check-all | 678 ninja -C "${LLVM_BUILD_DIR}" check-all |
| 680 fi | 679 fi |
| 681 | 680 |
| 682 # After everything is done, log success for this revision. | 681 # After everything is done, log success for this revision. |
| 683 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" | 682 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" |
| OLD | NEW |