| 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 CLANG_DIR="${LLVM_DIR}"/tools/clang | 10 CLANG_DIR="${LLVM_DIR}"/tools/clang |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 # Echo all commands. | 38 # Echo all commands. |
| 39 set -x | 39 set -x |
| 40 | 40 |
| 41 # Build clang (in a separate directory). | 41 # Build clang (in a separate directory). |
| 42 # The clang bots have this path hardcoded in built/scripts/slave/compile.py, | 42 # The clang bots have this path hardcoded in built/scripts/slave/compile.py, |
| 43 # so if you change it you also need to change these links. | 43 # so if you change it you also need to change these links. |
| 44 mkdir -p "${LLVM_DIR}"/../llvm-build | 44 mkdir -p "${LLVM_DIR}"/../llvm-build |
| 45 cd "${LLVM_DIR}"/../llvm-build | 45 cd "${LLVM_DIR}"/../llvm-build |
| 46 if [ ! -f ./config.status ]; then | 46 if [ ! -f ./config.status ]; then |
| 47 ../llvm/configure --enable-optimized | 47 ../llvm/configure \ |
| 48 --enable-optimized \ |
| 49 --without-llvmgcc \ |
| 50 --without-llvmgxx |
| 48 fi | 51 fi |
| 49 | 52 |
| 50 NUM_JOBS=3 | 53 NUM_JOBS=3 |
| 51 if [ "$(uname -s)" = "Linux" ]; then | 54 if [ "$(uname -s)" = "Linux" ]; then |
| 52 NUM_JOBS="$(grep -c "^processor" /proc/cpuinfo)" | 55 NUM_JOBS="$(grep -c "^processor" /proc/cpuinfo)" |
| 53 elif [ "$(uname -s)" = "Darwin" ]; then | 56 elif [ "$(uname -s)" = "Darwin" ]; then |
| 54 NUM_JOBS="$(sysctl -n hw.ncpu)" | 57 NUM_JOBS="$(sysctl -n hw.ncpu)" |
| 55 fi | 58 fi |
| 56 make -j"${NUM_JOBS}" | 59 make -j"${NUM_JOBS}" |
| 57 cd - | 60 cd - |
| 58 | 61 |
| 59 # Build plugin. | 62 # Build plugin. |
| 60 # Copy it into the clang tree and use clang's build system to compile the | 63 # Copy it into the clang tree and use clang's build system to compile the |
| 61 # plugin. | 64 # plugin. |
| 62 PLUGIN_SRC_DIR="${THIS_DIR}"/../plugins | 65 PLUGIN_SRC_DIR="${THIS_DIR}"/../plugins |
| 63 PLUGIN_DST_DIR="${LLVM_DIR}"/../llvm/tools/clang/tools/chrome-plugin | 66 PLUGIN_DST_DIR="${LLVM_DIR}"/../llvm/tools/clang/tools/chrome-plugin |
| 64 PLUGIN_BUILD_DIR="${LLVM_DIR}"/../llvm-build/tools/clang/tools/chrome-plugin | 67 PLUGIN_BUILD_DIR="${LLVM_DIR}"/../llvm-build/tools/clang/tools/chrome-plugin |
| 65 rm -rf "${PLUGIN_DST_DIR}" | 68 rm -rf "${PLUGIN_DST_DIR}" |
| 66 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}" | 69 cp -R "${PLUGIN_SRC_DIR}" "${PLUGIN_DST_DIR}" |
| 67 rm -rf "${PLUGIN_BUILD_DIR}" | 70 rm -rf "${PLUGIN_BUILD_DIR}" |
| 68 mkdir -p "${PLUGIN_BUILD_DIR}" | 71 mkdir -p "${PLUGIN_BUILD_DIR}" |
| 69 cp "${PLUGIN_SRC_DIR}"/Makefile "${PLUGIN_BUILD_DIR}" | 72 cp "${PLUGIN_SRC_DIR}"/Makefile "${PLUGIN_BUILD_DIR}" |
| 70 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}" | 73 make -j"${NUM_JOBS}" -C "${PLUGIN_BUILD_DIR}" |
| OLD | NEW |