blob: a6cd8cfbf11a57c71384e4bb57bd3f51cb1de39d [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 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 Golin94cc1042016-04-26 11:02:23 +010028}
29
Diana Picusec97c502016-04-22 18:12:13 +030030gitroot=ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm
31svnroot=https://llvm.org/svn/llvm-project
32
Renato Golin94cc1042016-04-26 11:02:23 +010033echo " + Setting up LLVM"
Diana Picusec97c502016-04-22 18:12:13 +030034prepare $LLVM_SRC $gitroot/llvm $svnroot/llvm/trunk
35
Renato Golin94cc1042016-04-26 11:02:23 +010036echo " + Setting up Clang"
Diana Picusec97c502016-04-22 18:12:13 +030037prepare $LLVM_SRC/../clang $gitroot/clang $svnroot/cfe/trunk
38
Renato Golin94cc1042016-04-26 11:02:23 +010039echo " + Setting up Clang Tools Extra"
Diana Picusec97c502016-04-22 18:12:13 +030040prepare $LLVM_SRC/../clang-tools-extra \
41 $gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk
42
Renato Golin94cc1042016-04-26 11:02:23 +010043echo " + Setting up Compiler-RT"
Diana Picusec97c502016-04-22 18:12:13 +030044prepare $LLVM_SRC/../compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
45
Renato Golin94cc1042016-04-26 11:02:23 +010046echo " + Setting up LLD Linker"
Diana Picusec97c502016-04-22 18:12:13 +030047prepare $LLVM_SRC/../lld $gitroot/lld $svnroot/lld/trunk
48
Renato Golin94cc1042016-04-26 11:02:23 +010049echo " + Setting up LibC++"
Diana Picusec97c502016-04-22 18:12:13 +030050prepare $LLVM_SRC/../libcxx $gitroot/libcxx $svnroot/libcxx/trunk
51
Renato Golin94cc1042016-04-26 11:02:23 +010052echo " + Setting up LibC++ABI"
Diana Picusec97c502016-04-22 18:12:13 +030053prepare $LLVM_SRC/../libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk
54
Renato Golin94cc1042016-04-26 11:02:23 +010055echo " + Setting up LibUnwind"
Diana Picusec97c502016-04-22 18:12:13 +030056prepare $LLVM_SRC/../libunwind $gitroot/libunwind $svnroot/libunwind/trunk
57
Renato Golin94cc1042016-04-26 11:02:23 +010058echo " + Setting up LLDB Debugger"
Diana Picusec97c502016-04-22 18:12:13 +030059prepare $LLVM_SRC/../lldb $gitroot/lldb $svnroot/lldb/trunk
60
Renato Golin94cc1042016-04-26 11:02:23 +010061echo " + Setting up Test Suite"
Diana Picusec97c502016-04-22 18:12:13 +030062prepare $LLVM_SRC/../test-suite $gitroot/test-suite $svnroot/test-suite/trunk
63
Renato Golin94cc1042016-04-26 11:02:23 +010064echo " + Setting up LNT Test harness"
Diana Picusec97c502016-04-22 18:12:13 +030065prepare $LLVM_SRC/../lnt $gitroot/lnt $svnroot/lnt/trunk
66
Renato Golin94cc1042016-04-26 11:02:23 +010067echo " + Setting up Zorg Buildbot Config"
Diana Picusec97c502016-04-22 18:12:13 +030068prepare $LLVM_SRC/../zorg $gitroot/zorg $svnroot/zorg/trunk
Renato Golin94cc1042016-04-26 11:02:23 +010069
70mkdir -p $LLVM_BLD
71
72echo " + Done"