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 | # Clone Linaro repo |
| 15 | if [ ! -d $src/.git ]; then |
| 16 | mkdir -p $src |
| 17 | cd $src/.. |
Renato Golin | 98312fe | 2017-04-13 17:05:31 +0100 | [diff] [blame] | 18 | safe_run git clone --no-checkout $origin $src |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 19 | fi |
| 20 | # Link with upstream SVN |
| 21 | if [[ $LLVM_GITRW = 'yes' && ! -d $src/.git/svn ]]; then |
| 22 | cd $src |
| 23 | safe_run git svn init $svn --username=$LLVM_SVNUSER |
| 24 | safe_run git config svn-remote.svn.fetch :refs/remotes/origin/master |
| 25 | safe_run git svn fetch |
| 26 | fi |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 27 | } |
| 28 | |
Diana Picus | 4b4dd18 | 2016-05-20 15:14:28 +0300 | [diff] [blame] | 29 | if [ -z $LLVM_SVNUSER ]; then |
Diana Picus | 600c05a | 2016-06-16 19:28:38 +0300 | [diff] [blame] | 30 | gitroot=https://git.linaro.org/toolchain/llvm |
Diana Picus | 4b4dd18 | 2016-05-20 15:14:28 +0300 | [diff] [blame] | 31 | svnroot=https://llvm.org/svn/llvm-project |
| 32 | else |
Diana Picus | 600c05a | 2016-06-16 19:28:38 +0300 | [diff] [blame] | 33 | gitroot=ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm |
Diana Picus | 4b4dd18 | 2016-05-20 15:14:28 +0300 | [diff] [blame] | 34 | svnroot=https://$LLVM_SVNUSER@llvm.org/svn/llvm-project |
| 35 | fi |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 36 | |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 37 | llvm_repos=$LLVM_ROOT/repos |
| 38 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 39 | echo " + Setting up LLVM" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 40 | prepare $llvm_repos/llvm $gitroot/llvm $svnroot/llvm/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 41 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 42 | echo " + Setting up Clang" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 43 | prepare $llvm_repos/clang $gitroot/clang $svnroot/cfe/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 44 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 45 | echo " + Setting up Compiler-RT" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 46 | prepare $llvm_repos/compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 47 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 48 | echo " + Setting up LLD Linker" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 49 | prepare $llvm_repos/lld $gitroot/lld $svnroot/lld/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 50 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 51 | echo " + Setting up LibC++" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 52 | prepare $llvm_repos/libcxx $gitroot/libcxx $svnroot/libcxx/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 53 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 54 | echo " + Setting up LibC++ABI" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 55 | prepare $llvm_repos/libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 56 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 57 | echo " + Setting up LibUnwind" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 58 | prepare $llvm_repos/libunwind $gitroot/libunwind $svnroot/libunwind/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 59 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 60 | echo " + Setting up LLDB Debugger" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 61 | prepare $llvm_repos/lldb $gitroot/lldb $svnroot/lldb/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 62 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 63 | echo " + Setting up Test Suite" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 64 | prepare $llvm_repos/test-suite $gitroot/test-suite $svnroot/test-suite/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 65 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 66 | echo " + Setting up LNT Test harness" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 67 | prepare $llvm_repos/lnt $gitroot/lnt $svnroot/lnt/trunk |
Diana Picus | ec97c50 | 2016-04-22 18:12:13 +0300 | [diff] [blame] | 68 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 69 | echo " + Setting up Zorg Buildbot Config" |
Diana Picus | 72189fd | 2016-05-23 19:32:46 +0300 | [diff] [blame] | 70 | prepare $llvm_repos/zorg $gitroot/zorg $svnroot/zorg/trunk |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 71 | |
| 72 | echo " + Done" |