Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Clang 3.6 recipe. Written and placed in public domain by Jeffrey
- # Walton (noloader, gmail) and Mobile Mouse (mouse008, gmail).
- # The script fetches and builds LLVM, Compiler FE (Clang, front end),
- # Compiler RT (Runtime), and Extra Tools.
- # The script should be run from a scratch directory.
- # Fetch
- if [ ! -e llvm-3.6.0.src.tar.xz ]; then
- wget http://llvm.org/releases/3.6.0/llvm-3.6.0.src.tar.xz
- fi
- if [ ! -e cfe-3.6.0.src.tar.xz ]; then
- wget http://llvm.org/releases/3.6.0/cfe-3.6.0.src.tar.xz
- fi
- if [ ! -e compiler-rt-3.6.0.src.tar.xz ]; then
- wget http://llvm.org/releases/3.6.0/compiler-rt-3.6.0.src.tar.xz
- fi
- if [ ! -e clang-tools-extra-3.6.0.src.tar.xz ]; then
- wget http://llvm.org/releases/3.6.0/clang-tools-extra-3.6.0.src.tar.xz
- fi
- # Cleanup
- rm -rf llvm build llvm-3.6.0.src
- # LLVM
- tar xvf llvm-3.6.0.src.tar.xz
- mv llvm-3.6.0.src/ llvm
- # Clang Front End
- cd llvm/tools
- tar xvf ../../cfe-3.6.0.src.tar.xz
- mv cfe-3.6.0.src clang
- cd ../../
- # Extra Tools
- cd llvm/tools/clang/tools/
- tar xvf ../../../../clang-tools-extra-3.6.0.src.tar.xz
- mv clang-tools-extra-3.6.0.src extra
- cd ../../../../
- # Compiler RT
- cd llvm/projects
- tar xvf ../../compiler-rt-3.6.0.src.tar.xz
- mv compiler-rt-3.6.0.src/ compiler-rt
- cd ../../
- # Determine if Apple
- IS_DARWIN=`uname -s | egrep -i -c "Darwin"`
- if [ $IS_DARWIN -ne 0 ]; then
- OTHER_OPTIONS=" --enable-libcpp"
- fi
- # Build
- mkdir -p build
- cd build
- ../llvm/configure --enable-optimized --enable-cxx11 $OTHER_OPTIONS --prefix=/usr/local
- make -j2
- RET=$?
- if [ $RET -eq 0 ];then
- echo "****************************************"
- read -p "Press [ENTER] to install, or [CTRL]+C to quit"
- sudo make install
- fi
- # ****************************************
- # ****************************************
- # Install does not install scan-build and scan-view
- # Perform the copy, and/or put them on-path
- # 2to3 -w llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
- #sudo cp llvm/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py /usr/local/bin
- #sudo mkdir /usr/local/bin/scan-build
- #sudo cp -r llvm/tools/clang/tools/scan-build /usr/local/bin
- #sudo mkdir /usr/local/bin/scan-view
- #sudo cp -r llvm/tools/clang/tools/scan-view /usr/local/bin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement