| #!/usr/bin/env bash |
| |
| # This script creates the source tree as the other LLVM scripts would like to |
| # find. It's recommended that you use this script before all, and keep the |
| # format correct, so all the other scripts work accordingly. This script |
| # honours the LLVM_GITRW requirement and creates the appropriate type. |
| |
| . llvm-common |
| |
| function prepare() { |
| src=$1 |
| origin=$2 |
| svn=$3 |
| # Clone Linaro repo |
| if [ ! -d $src/.git ]; then |
| mkdir -p $src |
| cd $src/.. |
| safe_run git clone $origin $src |
| fi |
| # Link with upstream SVN |
| if [[ $LLVM_GITRW = 'yes' && ! -d $src/.git/svn ]]; then |
| cd $src |
| safe_run git svn init $svn --username=$LLVM_SVNUSER |
| safe_run git config svn-remote.svn.fetch :refs/remotes/origin/master |
| safe_run git svn fetch |
| fi |
| } |
| |
| gitroot=ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm |
| svnroot=https://llvm.org/svn/llvm-project |
| |
| echo " + Setting up LLVM" |
| prepare $LLVM_SRC $gitroot/llvm $svnroot/llvm/trunk |
| |
| echo " + Setting up Clang" |
| prepare $LLVM_SRC/../clang $gitroot/clang $svnroot/cfe/trunk |
| |
| echo " + Setting up Clang Tools Extra" |
| prepare $LLVM_SRC/../clang-tools-extra \ |
| $gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk |
| |
| echo " + Setting up Compiler-RT" |
| prepare $LLVM_SRC/../compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk |
| |
| echo " + Setting up LLD Linker" |
| prepare $LLVM_SRC/../lld $gitroot/lld $svnroot/lld/trunk |
| |
| echo " + Setting up LibC++" |
| prepare $LLVM_SRC/../libcxx $gitroot/libcxx $svnroot/libcxx/trunk |
| |
| echo " + Setting up LibC++ABI" |
| prepare $LLVM_SRC/../libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk |
| |
| echo " + Setting up LibUnwind" |
| prepare $LLVM_SRC/../libunwind $gitroot/libunwind $svnroot/libunwind/trunk |
| |
| echo " + Setting up LLDB Debugger" |
| prepare $LLVM_SRC/../lldb $gitroot/lldb $svnroot/lldb/trunk |
| |
| echo " + Setting up Test Suite" |
| prepare $LLVM_SRC/../test-suite $gitroot/test-suite $svnroot/test-suite/trunk |
| |
| echo " + Setting up LNT Test harness" |
| prepare $LLVM_SRC/../lnt $gitroot/lnt $svnroot/lnt/trunk |
| |
| echo " + Setting up Zorg Buildbot Config" |
| prepare $LLVM_SRC/../zorg $gitroot/zorg $svnroot/zorg/trunk |
| |
| mkdir -p $LLVM_BLD |
| |
| echo " + Done" |