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

Side by Side Diff: tools/clang/scripts/update.sh

Issue 7741026: clang: add an option to update.sh to pull lldb as well (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 CLANG_DIR="${LLVM_DIR}/tools/clang" 11 CLANG_DIR="${LLVM_DIR}/tools/clang"
12 LLDB_DIR="${LLVM_DIR}/tools/lldb"
12 DEPS_FILE="${THIS_DIR}/../../../DEPS" 13 DEPS_FILE="${THIS_DIR}/../../../DEPS"
13 STAMP_FILE="${LLVM_BUILD_DIR}/cr_build_revision" 14 STAMP_FILE="${LLVM_BUILD_DIR}/cr_build_revision"
14 15
15 # ${A:-a} returns $A if it's set, a else. 16 # ${A:-a} returns $A if it's set, a else.
16 LLVM_REPO_URL=${LLVM_URL:-http://llvm.org/svn/llvm-project} 17 LLVM_REPO_URL=${LLVM_URL:-http://llvm.org/svn/llvm-project}
17 18
18 # Die if any command dies. 19 # Die if any command dies.
19 set -e 20 set -e
20 21
22 # Parse command line options.
23 use_lldb=
24 while [[ $# > 0 ]]; do
25 case $1 in
26 --lldb)
27 use_lldb=yes
28 ;;
29 --help)
30 echo "usage: $0 [--lldb]"
31 echo "If --lldb is passed, check out lldb as well."
32 echo "(Once lldb is checked out once, it will implicitly be updated and"
33 echo "built on further updates.)"
34 exit 1
35 ;;
36 esac
37 shift
38 done
39
21 # Since people need to run this script anyway to compile clang, let it check out 40 # Since people need to run this script anyway to compile clang, let it check out
22 # clang as well if it's not in DEPS, so that people don't have to change their 41 # clang as well if it's not in DEPS, so that people don't have to change their
23 # DEPS if they just want to give clang a try. 42 # DEPS if they just want to give clang a try.
24 CLANG_REVISION=$(grep 'clang_revision":' "${DEPS_FILE}" | egrep -o [[:digit:]]+) 43 CLANG_REVISION=$(grep 'clang_revision":' "${DEPS_FILE}" | egrep -o [[:digit:]]+)
25 44
26 # Check if there's anything to be done, exit early if not. 45 # Check if there's anything to be done, exit early if not.
27 if [ -f "${STAMP_FILE}" ]; then 46 if [ -f "${STAMP_FILE}" ]; then
28 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") 47 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}")
29 if [ "${PREVIOUSLY_BUILT_REVISON}" = "${CLANG_REVISION}" ]; then 48 if [ "${PREVIOUSLY_BUILT_REVISON}" = "${CLANG_REVISION}" ]; then
30 echo "Clang already at ${CLANG_REVISION}" 49 echo "Clang already at ${CLANG_REVISION}"
(...skipping 10 matching lines...) Expand all
41 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" 60 svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}"
42 fi 61 fi
43 62
44 if grep -q 'src/third_party/llvm/tools/clang":' "${DEPS_FILE}"; then 63 if grep -q 'src/third_party/llvm/tools/clang":' "${DEPS_FILE}"; then
45 echo clang pulled in through DEPS, skipping clang update step 64 echo clang pulled in through DEPS, skipping clang update step
46 else 65 else
47 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}" 66 echo Getting clang r"${CLANG_REVISION}" in "${CLANG_DIR}"
48 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}" 67 svn co --force "${LLVM_REPO_URL}/cfe/trunk@${CLANG_REVISION}" "${CLANG_DIR}"
49 fi 68 fi
50 69
70 # Update lldb either if the flag is passed or we have a previous checkout.
71 if [ -n "$use_lldb" -o -d "${LLDB_DIR}" ]; then
72 if grep -q 'src/third_party/llvm/tools/lldb":' "${DEPS_FILE}"; then
73 echo lldb pulled in through DEPS, skipping lldb update step
74 else
75 echo Getting lldb r"${CLANG_REVISION}" in "${LLDB_DIR}"
76 svn co --force "${LLVM_REPO_URL}/lldb/trunk@${CLANG_REVISION}" "${LLDB_DIR}"
77 fi
78 fi
79
51 # Echo all commands. 80 # Echo all commands.
52 set -x 81 set -x
53 82
54 # Build clang (in a separate directory). 83 # Build clang (in a separate directory).
55 # The clang bots have this path hardcoded in built/scripts/slave/compile.py, 84 # The clang bots have this path hardcoded in built/scripts/slave/compile.py,
56 # so if you change it you also need to change these links. 85 # so if you change it you also need to change these links.
57 mkdir -p "${LLVM_BUILD_DIR}" 86 mkdir -p "${LLVM_BUILD_DIR}"
58 cd "${LLVM_BUILD_DIR}" 87 cd "${LLVM_BUILD_DIR}"
59 if [ ! -f ./config.status ]; then 88 if [ ! -f ./config.status ]; then
60 ../llvm/configure \ 89 ../llvm/configure \
(...skipping 19 matching lines...) Expand all
80 PLUGIN_BUILD_DIR="${LLVM_BUILD_DIR}/tools/clang/tools/chrome-plugin" 109 PLUGIN_BUILD_DIR="${LLVM_BUILD_DIR}/tools/clang/tools/chrome-plugin"
81 rm -rf "${PLUGIN_DST_DIR}" 110 rm -rf "${PLUGIN_DST_DIR}"
82 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}" 111 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}"
83 rm -rf "${PLUGIN_BUILD_DIR}" 112 rm -rf "${PLUGIN_BUILD_DIR}"
84 mkdir -p "${PLUGIN_BUILD_DIR}" 113 mkdir -p "${PLUGIN_BUILD_DIR}"
85 cp "${PLUGIN_SRC_DIR}/Makefile" "${PLUGIN_BUILD_DIR}" 114 cp "${PLUGIN_SRC_DIR}/Makefile" "${PLUGIN_BUILD_DIR}"
86 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}" 115 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}"
87 116
88 # After everything is done, log success for this revision. 117 # After everything is done, log success for this revision.
89 echo "${CLANG_REVISION}" > "${STAMP_FILE}" 118 echo "${CLANG_REVISION}" > "${STAMP_FILE}"
OLDNEW
« 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