Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: tools/clang/scripts/update.sh

Issue 980633003: Clang update script: download pre-built modern gcc and CMake if necessary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/scripts/update.sh
diff --git a/tools/clang/scripts/update.sh b/tools/clang/scripts/update.sh
index e8b929f1808ae12a3d990a2ad6c222191ec524f1..6ae953d74d78edd3bb24ecad546a58f91081a0e9 100755
--- a/tools/clang/scripts/update.sh
+++ b/tools/clang/scripts/update.sh
@@ -34,6 +34,8 @@ ABS_COMPILER_RT_DIR="${PWD}/${COMPILER_RT_DIR}"
# ${A:-a} returns $A if it's set, a else.
LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project}
+CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang
+
if [[ -z "$GYP_DEFINES" ]]; then
GYP_DEFINES=
fi
@@ -161,9 +163,36 @@ if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
with_android=
fi
- if [[ "${OS}" == "Linux" ]] && [[ -z ${gcc_toolchain:-''} ]]; then
- # Set gcc_toolchain on Linux; llvm-symbolizer needs the bundled libstdc++.
- gcc_toolchain="$(dirname $(dirname $(which gcc)))"
+ LLVM_BUILD_TOOLS_DIR="${ABS_LLVM_DIR}/../llvm-build-tools"
+
+ if [[ "${OS}" == "Linux" ]] && [[ -z "${gcc_toolchain}" ]]; then
+ if [[ $(gcc -dumpversion) < "4.7.0" ]]; then
+ # We need a newer GCC version.
+ if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/gcc482" ]]; then
Nico 2015/03/05 03:55:18 This if seems to not work for some reason, looks l
+ echo "Downloading pre-built GCC 4.8.2"
+ mkdir -p "${LLVM_BUILD_TOOLS_DIR}"
+ curl --fail -L "${CDS_URL}/tools/gcc482.tgz" | \
+ tar vzxf - -C "${LLVM_BUILD_TOOLS_DIR}"
+ fi
+ gcc_toolchain="${LLVM_BUILD_TOOLS_DIR}/gcc482"
+ else
+ # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++.
+ gcc_toolchain="$(dirname $(dirname $(which gcc)))"
+ fi
+ fi
+
+ if [[ "${OS}" == "Linux" ]]; then
+ # TODO(hans): Might need to make this work on Mac eventually.
+ if [[ $(cmake --version | grep -Eo '[0-9.]+') < "3.0" ]]; then
+ # We need a newer CMake version.
+ if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/cmake310" ]]; then
+ echo "Downloading pre-built CMake 3.10"
+ mkdir -p "${LLVM_BUILD_TOOLS_DIR}"
+ curl --fail -L "${CDS_URL}/tools/cmake310.tgz" | \
+ tar vzxf - -C "${LLVM_BUILD_TOOLS_DIR}"
+ fi
+ export PATH="${LLVM_BUILD_TOOLS_DIR}/cmake310/bin:${PATH}"
Nico 2015/03/05 03:58:39 …and this should probably run before the `cmake --
+ fi
fi
echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}"
@@ -210,7 +239,6 @@ rm -f "${STAMP_FILE}"
if [[ -z "$force_local_build" ]]; then
# Check if there's a prebuilt binary and if so just fetch that. That's faster,
# and goma relies on having matching binary hashes on client and server too.
- CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang
CDS_FILE="clang-${CLANG_REVISION}.tgz"
CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698