blob: 4f57447fe2a3e9a353f7b32db6c96035298ba809 [file] [log] [blame]
Renato Golin94cc1042016-04-26 11:02:23 +01001#!/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
10function prepare() {
11 src=$1
Diana Picusec97c502016-04-22 18:12:13 +030012 origin=$2
13 svn=$3
Renato Golin94cc1042016-04-26 11:02:23 +010014 # Clone Linaro repo
15 if [ ! -d $src/.git ]; then
16 mkdir -p $src
17 cd $src/..
Diana Picus416bc4f2016-04-22 16:47:57 +030018 safe_run git clone $origin $src
Renato Golin94cc1042016-04-26 11:02:23 +010019 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 Golin94cc1042016-04-26 11:02:23 +010027}
28
Diana Picus4b4dd182016-05-20 15:14:28 +030029if [ -z $LLVM_SVNUSER ]; then
Diana Picus600c05a2016-06-16 19:28:38 +030030 gitroot=https://git.linaro.org/toolchain/llvm
Diana Picus4b4dd182016-05-20 15:14:28 +030031 svnroot=https://llvm.org/svn/llvm-project
32else
Diana Picus600c05a2016-06-16 19:28:38 +030033 gitroot=ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm
Diana Picus4b4dd182016-05-20 15:14:28 +030034 svnroot=https://$LLVM_SVNUSER@llvm.org/svn/llvm-project
35fi
Diana Picusec97c502016-04-22 18:12:13 +030036
Diana Picus72189fd2016-05-23 19:32:46 +030037llvm_repos=$LLVM_ROOT/repos
38
Renato Golin94cc1042016-04-26 11:02:23 +010039echo " + Setting up LLVM"
Diana Picus72189fd2016-05-23 19:32:46 +030040prepare $llvm_repos/llvm $gitroot/llvm $svnroot/llvm/trunk
Diana Picusec97c502016-04-22 18:12:13 +030041
Renato Golin94cc1042016-04-26 11:02:23 +010042echo " + Setting up Clang"
Diana Picus72189fd2016-05-23 19:32:46 +030043prepare $llvm_repos/clang $gitroot/clang $svnroot/cfe/trunk
Diana Picusec97c502016-04-22 18:12:13 +030044
Renato Golin94cc1042016-04-26 11:02:23 +010045echo " + Setting up Clang Tools Extra"
Diana Picus72189fd2016-05-23 19:32:46 +030046prepare $llvm_repos/clang-tools-extra \
Diana Picusec97c502016-04-22 18:12:13 +030047 $gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk
48
Renato Golin94cc1042016-04-26 11:02:23 +010049echo " + Setting up Compiler-RT"
Diana Picus72189fd2016-05-23 19:32:46 +030050prepare $llvm_repos/compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
Diana Picusec97c502016-04-22 18:12:13 +030051
Renato Golin94cc1042016-04-26 11:02:23 +010052echo " + Setting up LLD Linker"
Diana Picus72189fd2016-05-23 19:32:46 +030053prepare $llvm_repos/lld $gitroot/lld $svnroot/lld/trunk
Diana Picusec97c502016-04-22 18:12:13 +030054
Renato Golin94cc1042016-04-26 11:02:23 +010055echo " + Setting up LibC++"
Diana Picus72189fd2016-05-23 19:32:46 +030056prepare $llvm_repos/libcxx $gitroot/libcxx $svnroot/libcxx/trunk
Diana Picusec97c502016-04-22 18:12:13 +030057
Renato Golin94cc1042016-04-26 11:02:23 +010058echo " + Setting up LibC++ABI"
Diana Picus72189fd2016-05-23 19:32:46 +030059prepare $llvm_repos/libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk
Diana Picusec97c502016-04-22 18:12:13 +030060
Renato Golin94cc1042016-04-26 11:02:23 +010061echo " + Setting up LibUnwind"
Diana Picus72189fd2016-05-23 19:32:46 +030062prepare $llvm_repos/libunwind $gitroot/libunwind $svnroot/libunwind/trunk
Diana Picusec97c502016-04-22 18:12:13 +030063
Renato Golin94cc1042016-04-26 11:02:23 +010064echo " + Setting up LLDB Debugger"
Diana Picus72189fd2016-05-23 19:32:46 +030065prepare $llvm_repos/lldb $gitroot/lldb $svnroot/lldb/trunk
Diana Picusec97c502016-04-22 18:12:13 +030066
Renato Golin94cc1042016-04-26 11:02:23 +010067echo " + Setting up Test Suite"
Diana Picus72189fd2016-05-23 19:32:46 +030068prepare $llvm_repos/test-suite $gitroot/test-suite $svnroot/test-suite/trunk
Diana Picusec97c502016-04-22 18:12:13 +030069
Renato Golin94cc1042016-04-26 11:02:23 +010070echo " + Setting up LNT Test harness"
Diana Picus72189fd2016-05-23 19:32:46 +030071prepare $llvm_repos/lnt $gitroot/lnt $svnroot/lnt/trunk
Diana Picusec97c502016-04-22 18:12:13 +030072
Renato Golin94cc1042016-04-26 11:02:23 +010073echo " + Setting up Zorg Buildbot Config"
Diana Picus72189fd2016-05-23 19:32:46 +030074prepare $llvm_repos/zorg $gitroot/zorg $svnroot/zorg/trunk
Renato Golin94cc1042016-04-26 11:02:23 +010075
76echo " + Done"