You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 line
1.5KB

  1. #!/bin/bash
  2. set -ex
  3. BUILD_DIR=${TRAVIS_BUILD_DIR}
  4. mkdir -p "${DEPENDENCY_DIR}" && cd "${DEPENDENCY_DIR}"
  5. # --- CMake
  6. CMAKE_INSTALLER=install-cmake.sh
  7. if [[ ! -f ${CMAKE_INSTALLER} ]]
  8. then
  9. curl -sSL https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh -o ${CMAKE_INSTALLER}
  10. chmod +x ${CMAKE_INSTALLER}
  11. fi
  12. sudo ./${CMAKE_INSTALLER} --prefix=/usr/local --skip-license
  13. cmake --version
  14. cd ${DEPENDENCY_DIR}
  15. # --- LibC++
  16. if [[ "${CXX}" = clang* ]]
  17. then
  18. if [[ ! -d "${DEPENDENCY_DIR}/llvm-source" ]]
  19. then
  20. LLVM_RELEASE=release_50
  21. git clone --depth=1 -b ${LLVM_RELEASE} https://github.com/llvm-mirror/llvm.git llvm-source
  22. git clone --depth=1 -b ${LLVM_RELEASE} https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
  23. git clone --depth=1 -b ${LLVM_RELEASE} https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi
  24. if [[ -z "${BUILD_32_BITS}" ]]
  25. then
  26. export BUILD_32_BITS=OFF
  27. echo disabling 32 bit build
  28. fi
  29. mkdir -p build && cd build
  30. cmake -DCMAKE_C_COMPILER=${CC} \
  31. -DCMAKE_CXX_COMPILER=${CXX} \
  32. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  33. -DCMAKE_INSTALL_PREFIX=/usr \
  34. -DLIBCXX_ABI_UNSTABLE=ON \
  35. -DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
  36. ../llvm-source
  37. make cxx -j4
  38. else
  39. cd build
  40. fi
  41. sudo make install-cxxabi install-cxx
  42. fi
  43. cd ${BUILD_DIR}