Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") | 72 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") |
| 73 if [[ -z "$force_local_build" ]] && \ | 73 if [[ -z "$force_local_build" ]] && \ |
| 74 [[ "${PREVIOUSLY_BUILT_REVISON}" = "${CLANG_REVISION}" ]]; then | 74 [[ "${PREVIOUSLY_BUILT_REVISON}" = "${CLANG_REVISION}" ]]; then |
| 75 echo "Clang already at ${CLANG_REVISION}" | 75 echo "Clang already at ${CLANG_REVISION}" |
| 76 exit 0 | 76 exit 0 |
| 77 fi | 77 fi |
| 78 fi | 78 fi |
| 79 # To always force a new build if someone interrupts their build half way. | 79 # To always force a new build if someone interrupts their build half way. |
| 80 rm -f "${STAMP_FILE}" | 80 rm -f "${STAMP_FILE}" |
| 81 | 81 |
| 82 # Clobber pch files, since they only work with the compiler version that | |
| 83 # created them. | |
| 84 if [[ "${OS}" = "Darwin" ]]; then | |
| 85 XCODEBUILD_DIR="${THIS_DIR}/../../../xcodebuild" | |
| 86 MAKE_DIR="${THIS_DIR}/../../../out" | |
| 87 for CONFIG in Debug Release; do | |
| 88 if [[ -d "${MAKE_DIR}/${CONFIG}/obj.target" ]]; then | |
| 89 echo "Clobbering ${CONFIG} PCH files for make build" | |
| 90 find "${MAKE_DIR}/${CONFIG}/obj.target" -name '*.gch' -exec rm {} + | |
| 91 fi | |
| 92 | |
| 93 if [[ -d "${XCODEBUILD_DIR}/${CONFIG}/SharedPrecompiledHeaders" ]]; then | |
| 94 echo "Clobbering ${CONFIG} PCH files for Xcode build" | |
| 95 rm -rf "${XCODEBUILD_DIR}/${CONFIG}/SharedPrecompiledHeaders" | |
|
Mark Mentovai
2011/09/15 03:06:50
When this had a *, the " should have enclosed ever
| |
| 96 fi | |
| 97 done | |
| 98 fi | |
| 99 | |
| 82 if [ -z "$force_local_build" ]; then | 100 if [ -z "$force_local_build" ]; then |
| 83 # Check if there's a prebuilt binary and if so just fetch that. That's faster, | 101 # Check if there's a prebuilt binary and if so just fetch that. That's faster, |
| 84 # and goma relies on having matching binary hashes on client and server too. | 102 # and goma relies on having matching binary hashes on client and server too. |
| 85 CDS_URL=http://commondatastorage.googleapis.com/chromium-browser-clang | 103 CDS_URL=http://commondatastorage.googleapis.com/chromium-browser-clang |
| 86 CDS_FILE="clang-${CLANG_REVISION}.tgz" | 104 CDS_FILE="clang-${CLANG_REVISION}.tgz" |
| 87 echo Trying to download prebuilt clang | 105 echo Trying to download prebuilt clang |
| 88 if [ "${OS}" = "Linux" ]; then | 106 if [ "${OS}" = "Linux" ]; then |
| 89 wget "${CDS_URL}/Linux_x64/${CDS_FILE}" || rm -f "${CDS_FILE}" | 107 wget "${CDS_URL}/Linux_x64/${CDS_FILE}" || rm -f "${CDS_FILE}" |
| 90 elif [ "${OS}" = "Darwin" ]; then | 108 elif [ "${OS}" = "Darwin" ]; then |
| 91 curl -L --fail -O "${CDS_URL}/Mac/${CDS_FILE}" || rm -f "${CDS_FILE}" | 109 curl -L --fail -O "${CDS_URL}/Mac/${CDS_FILE}" || rm -f "${CDS_FILE}" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 PLUGIN_BUILD_DIR="${LLVM_BUILD_DIR}/tools/clang/tools/chrome-plugin" | 173 PLUGIN_BUILD_DIR="${LLVM_BUILD_DIR}/tools/clang/tools/chrome-plugin" |
| 156 rm -rf "${PLUGIN_DST_DIR}" | 174 rm -rf "${PLUGIN_DST_DIR}" |
| 157 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}" | 175 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}" |
| 158 rm -rf "${PLUGIN_BUILD_DIR}" | 176 rm -rf "${PLUGIN_BUILD_DIR}" |
| 159 mkdir -p "${PLUGIN_BUILD_DIR}" | 177 mkdir -p "${PLUGIN_BUILD_DIR}" |
| 160 cp "${PLUGIN_SRC_DIR}/Makefile" "${PLUGIN_BUILD_DIR}" | 178 cp "${PLUGIN_SRC_DIR}/Makefile" "${PLUGIN_BUILD_DIR}" |
| 161 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}" | 179 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}" |
| 162 | 180 |
| 163 # After everything is done, log success for this revision. | 181 # After everything is done, log success for this revision. |
| 164 echo "${CLANG_REVISION}" > "${STAMP_FILE}" | 182 echo "${CLANG_REVISION}" > "${STAMP_FILE}" |
| OLD | NEW |