| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 fi | 467 fi |
| 468 | 468 |
| 469 CFLAGS="" | 469 CFLAGS="" |
| 470 CXXFLAGS="" | 470 CXXFLAGS="" |
| 471 LDFLAGS="" | 471 LDFLAGS="" |
| 472 | 472 |
| 473 # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is | 473 # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is |
| 474 # needed, on OS X it requires libc++. clang only automatically links to libc++ | 474 # needed, on OS X it requires libc++. clang only automatically links to libc++ |
| 475 # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run on | 475 # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run on |
| 476 # OS X versions as old as 10.7. | 476 # OS X versions as old as 10.7. |
| 477 # TODO(thakis): Some bots are still on 10.6 (nacl...), so for now bundle | 477 # TODO(thakis): Some bots are still on 10.6, so for now bundle libc++.dylib. |
| 478 # libc++.dylib. Remove this once all bots are on 10.7+, then use | 478 # Remove this once all bots are on 10.7+, then use --enable-libcpp=yes and |
| 479 # -DLLVM_ENABLE_LIBCXX=ON and change deployment_target to 10.7. | 479 # change deployment_target to 10.7. |
| 480 deployment_target="" | 480 deployment_target="" |
| 481 | 481 |
| 482 if [ "${OS}" = "Darwin" ]; then | 482 if [ "${OS}" = "Darwin" ]; then |
| 483 # When building on 10.9, /usr/include usually doesn't exist, and while | 483 # When building on 10.9, /usr/include usually doesn't exist, and while |
| 484 # Xcode's clang automatically sets a sysroot, self-built clangs don't. | 484 # Xcode's clang automatically sets a sysroot, self-built clangs don't. |
| 485 CFLAGS="-isysroot $(xcrun --show-sdk-path)" | 485 CFLAGS="-isysroot $(xcrun --show-sdk-path)" |
| 486 CPPFLAGS="${CFLAGS}" |
| 486 CXXFLAGS="-stdlib=libc++ -nostdinc++ -I${ABS_LIBCXX_DIR}/include ${CFLAGS}" | 487 CXXFLAGS="-stdlib=libc++ -nostdinc++ -I${ABS_LIBCXX_DIR}/include ${CFLAGS}" |
| 487 | 488 |
| 488 if [[ -n "${bootstrap}" ]]; then | 489 if [[ -n "${bootstrap}" ]]; then |
| 489 deployment_target=10.6 | 490 deployment_target=10.6 |
| 490 fi | 491 fi |
| 491 fi | 492 fi |
| 492 | 493 |
| 493 # Build bootstrap clang if requested. | 494 # Build bootstrap clang if requested. |
| 494 if [[ -n "${bootstrap}" ]]; then | 495 if [[ -n "${bootstrap}" ]]; then |
| 495 ABS_INSTALL_DIR="${PWD}/${LLVM_BOOTSTRAP_INSTALL_DIR}" | 496 ABS_INSTALL_DIR="${PWD}/${LLVM_BOOTSTRAP_INSTALL_DIR}" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 # Run Chrome tool tests. | 711 # Run Chrome tool tests. |
| 711 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 712 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
| 712 fi | 713 fi |
| 713 if [[ -n "$run_tests" ]]; then | 714 if [[ -n "$run_tests" ]]; then |
| 714 # Run the LLVM and Clang tests. | 715 # Run the LLVM and Clang tests. |
| 715 ninja -C "${LLVM_BUILD_DIR}" check-all | 716 ninja -C "${LLVM_BUILD_DIR}" check-all |
| 716 fi | 717 fi |
| 717 | 718 |
| 718 # After everything is done, log success for this revision. | 719 # After everything is done, log success for this revision. |
| 719 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" | 720 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}" |
| OLD | NEW |