Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # This script creates the source tree as the other LLVM scripts would like to |
| 4 | # find. It's recommended that you use this script before all, and keep the |
| 5 | # format correct, so all the other scripts work accordingly. This script |
| 6 | # honours the LLVM_GITRW requirement and creates the appropriate type. |
| 7 | |
| 8 | . llvm-common |
| 9 | |
| 10 | function prepare() { |
| 11 | src=$1 |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 12 | origin=$2 |
| 13 | svn=$3 |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 14 | dir=`basename $src` |
| 15 | # Clone Linaro repo |
| 16 | if [ ! -d $src/.git ]; then |
| 17 | mkdir -p $src |
| 18 | cd $src/.. |
| 19 | safe_run git clone $origin $dir |
| 20 | fi |
| 21 | # Link with upstream SVN |
| 22 | if [[ $LLVM_GITRW = 'yes' && ! -d $src/.git/svn ]]; then |
| 23 | cd $src |
| 24 | safe_run git svn init $svn --username=$LLVM_SVNUSER |
| 25 | safe_run git config svn-remote.svn.fetch :refs/remotes/origin/master |
| 26 | safe_run git svn fetch |
| 27 | fi |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 28 | } |
| 29 | |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 30 | gitroot=ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm |
| 31 | svnroot=https://llvm.org/svn/llvm-project |
| 32 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 33 | echo " + Setting up LLVM" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 34 | prepare $LLVM_SRC $gitroot/llvm $svnroot/llvm/trunk |
| 35 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 36 | echo " + Setting up Clang" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 37 | prepare $LLVM_SRC/../clang $gitroot/clang $svnroot/cfe/trunk |
| 38 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 39 | echo " + Setting up Clang Tools Extra" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 40 | prepare $LLVM_SRC/../clang-tools-extra \ |
| 41 | $gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk |
| 42 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 43 | echo " + Setting up Compiler-RT" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 44 | prepare $LLVM_SRC/../compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk |
| 45 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 46 | echo " + Setting up LLD Linker" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 47 | prepare $LLVM_SRC/../lld $gitroot/lld $svnroot/lld/trunk |
| 48 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 49 | echo " + Setting up LibC++" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 50 | prepare $LLVM_SRC/../libcxx $gitroot/libcxx $svnroot/libcxx/trunk |
| 51 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 52 | echo " + Setting up LibC++ABI" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 53 | prepare $LLVM_SRC/../libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk |
| 54 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 55 | echo " + Setting up LibUnwind" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 56 | prepare $LLVM_SRC/../libunwind $gitroot/libunwind $svnroot/libunwind/trunk |
| 57 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 58 | echo " + Setting up LLDB Debugger" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 59 | prepare $LLVM_SRC/../lldb $gitroot/lldb $svnroot/lldb/trunk |
| 60 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 61 | echo " + Setting up Test Suite" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 62 | prepare $LLVM_SRC/../test-suite $gitroot/test-suite $svnroot/test-suite/trunk |
| 63 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 64 | echo " + Setting up LNT Test harness" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 65 | prepare $LLVM_SRC/../lnt $gitroot/lnt $svnroot/lnt/trunk |
| 66 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 67 | echo " + Setting up Zorg Buildbot Config" |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame^] | 68 | prepare $LLVM_SRC/../zorg $gitroot/zorg $svnroot/zorg/trunk |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 69 | |
| 70 | mkdir -p $LLVM_BLD |
| 71 | |
| 72 | echo " + Done" |