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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 if [[ -z "$GYP_GENERATORS" ]]; then | 49 if [[ -z "$GYP_GENERATORS" ]]; then |
50 GYP_GENERATORS= | 50 GYP_GENERATORS= |
51 fi | 51 fi |
52 | 52 |
53 | 53 |
54 # Die if any command dies, error on undefined variable expansions. | 54 # Die if any command dies, error on undefined variable expansions. |
55 set -eu | 55 set -eu |
56 | 56 |
57 | 57 |
58 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then | 58 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then |
59 # Use a real version number rather than HEAD to make sure that | 59 # Use a real revision number rather than HEAD to make sure that the stamp file |
60 # --print-revision, stamp file logic, etc. all works naturally. | 60 # logic works. |
61 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \ | 61 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \ |
62 | grep 'Last Changed Rev' | awk '{ printf $4; }') | 62 | grep 'Revision:' | awk '{ printf $2; }') |
63 PACKAGE_VERSION="${CLANG_REVISION}-0" | 63 PACKAGE_VERSION="${CLANG_REVISION}-0" |
64 fi | 64 fi |
65 | 65 |
66 OS="$(uname -s)" | 66 OS="$(uname -s)" |
67 | 67 |
68 # Parse command line options. | 68 # Parse command line options. |
69 if_needed= | 69 if_needed= |
70 force_local_build= | 70 force_local_build= |
71 run_tests= | 71 run_tests= |
72 bootstrap= | 72 bootstrap= |
(...skipping 11 matching lines...) Expand all Loading... |
84 --bootstrap) | 84 --bootstrap) |
85 bootstrap=yes | 85 bootstrap=yes |
86 ;; | 86 ;; |
87 --if-needed) | 87 --if-needed) |
88 if_needed=yes | 88 if_needed=yes |
89 ;; | 89 ;; |
90 --force-local-build) | 90 --force-local-build) |
91 force_local_build=yes | 91 force_local_build=yes |
92 ;; | 92 ;; |
93 --print-revision) | 93 --print-revision) |
94 echo $PACKAGE_VERSION | 94 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then |
| 95 svn info "$LLVM_DIR" | grep 'Revision:' | awk '{ printf $2; }' |
| 96 else |
| 97 echo $PACKAGE_VERSION |
| 98 fi |
95 exit 0 | 99 exit 0 |
96 ;; | 100 ;; |
97 --run-tests) | 101 --run-tests) |
98 run_tests=yes | 102 run_tests=yes |
99 ;; | 103 ;; |
100 --without-android) | 104 --without-android) |
101 with_android= | 105 with_android= |
102 ;; | 106 ;; |
103 --without-patches) | 107 --without-patches) |
104 with_patches= | 108 with_patches= |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 700 |
697 if [[ -n "$run_tests" ]]; then | 701 if [[ -n "$run_tests" ]]; then |
698 # Run Chrome tool tests. | 702 # Run Chrome tool tests. |
699 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 703 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
700 # Run the LLVM and Clang tests. | 704 # Run the LLVM and Clang tests. |
701 ninja -C "${LLVM_BUILD_DIR}" check-all | 705 ninja -C "${LLVM_BUILD_DIR}" check-all |
702 fi | 706 fi |
703 | 707 |
704 # After everything is done, log success for this revision. | 708 # After everything is done, log success for this revision. |
705 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" | 709 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" |
OLD | NEW |