Created
October 30, 2014 19:23
-
-
Save springmeyer/89087fe5575270e75b73 to your computer and use it in GitHub Desktop.
setup clang/llvm on osx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://clang-developers.42468.n3.nabble.com/How-to-determine-clang-s-system-include-dirs-to-set-in-ASTVisitor-td4029080.html | |
: ' | |
https://gist.github.com/springmeyer/4480481 | |
https://gist.github.com/springmeyer/4279264 | |
' | |
git clone http://llvm.org/git/llvm.git | |
cd llvm/tools | |
git clone http://llvm.org/git/clang.git | |
cd tools | |
git clone http://llvm.org/git/clang-tools-extra.git | |
# https://code.google.com/p/include-what-you-use/issues/detail?id=150 | |
: ' | |
cd tools/clang/tools/include-what-you-use/ | |
svn up | |
wget "https://include-what-you-use.googlecode.com/issues/attachment?aid=1500008000&name=alias_template_fix_idea.patch&token=ABZ6GAecOtZ2gCosJPt7xJaWoJYd_6h8VA%3A1403814359790" | |
mv attachment\?aid\=1500008000\&name\=alias_template_fix_idea.patch\&token\=ABZ6GAecOtZ2gCosJPt7xJaWoJYd_6h8VA%3A1403814359790 patch.diff | |
patch -p0 < patch.diff | |
' | |
svn co http://include-what-you-use.googlecode.com/svn/trunk/ include-what-you-use | |
perl -p -i -e 's/diagtool/diagtool include-what-you-use/g' Makefile | |
cd ../../../ | |
cd ./projects | |
git clone http://llvm.org/git/compiler-rt.git | |
cd ../ | |
git config branch.master.rebase true | |
./configure --prefix=/opt/llvm/ --enable-clang-static-analyzer --enable-optimized | |
make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e -u | |
set -o pipefail | |
#CLEAN="make clean" | |
CLEAN="" | |
rm -rf /opt/llvm/ | |
${CLEAN} && git-up | |
cd tools/clang | |
${CLEAN} && git-up | |
cd tools/clang-tools-extra | |
${CLEAN} && git-up | |
cd ../include-what-you-use | |
${CLEAN} && svn up | |
cd ../../../../projects/compiler-rt/ | |
${CLEAN} && git-up | |
cd ../../ | |
CLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.0/include:/usr/include | |
CPPLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ | |
./configure --prefix=/opt/llvm/ --enable-optimized --enable-clang-static-analyzer | |
# --with-c-include-dirs=${CLIB}:${CPPLIB} | |
time make ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 | |
make install ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment