blob: 66a223b7d19ca277963b176ae3f98fcb92a6b73f [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/..
Renato Golin98312fe2017-04-13 17:05:31 +010018 safe_run git clone --no-checkout $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 Compiler-RT"
Diana Picus72189fd2016-05-23 19:32:46 +030046prepare $llvm_repos/compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
Diana Picusec97c502016-04-22 18:12:13 +030047
Renato Golin94cc1042016-04-26 11:02:23 +010048echo " + Setting up LLD Linker"
Diana Picus72189fd2016-05-23 19:32:46 +030049prepare $llvm_repos/lld $gitroot/lld $svnroot/lld/trunk
Diana Picusec97c502016-04-22 18:12:13 +030050
Renato Golin94cc1042016-04-26 11:02:23 +010051echo " + Setting up LibC++"
Diana Picus72189fd2016-05-23 19:32:46 +030052prepare $llvm_repos/libcxx $gitroot/libcxx $svnroot/libcxx/trunk
Diana Picusec97c502016-04-22 18:12:13 +030053
Renato Golin94cc1042016-04-26 11:02:23 +010054echo " + Setting up LibC++ABI"
Diana Picus72189fd2016-05-23 19:32:46 +030055prepare $llvm_repos/libcxxabi $gitroot/libcxxabi $svnroot/libcxxabi/trunk
Diana Picusec97c502016-04-22 18:12:13 +030056
Renato Golin94cc1042016-04-26 11:02:23 +010057echo " + Setting up LibUnwind"
Diana Picus72189fd2016-05-23 19:32:46 +030058prepare $llvm_repos/libunwind $gitroot/libunwind $svnroot/libunwind/trunk
Diana Picusec97c502016-04-22 18:12:13 +030059
Renato Golin94cc1042016-04-26 11:02:23 +010060echo " + Setting up LLDB Debugger"
Diana Picus72189fd2016-05-23 19:32:46 +030061prepare $llvm_repos/lldb $gitroot/lldb $svnroot/lldb/trunk
Diana Picusec97c502016-04-22 18:12:13 +030062
Renato Golin94cc1042016-04-26 11:02:23 +010063echo " + Setting up Test Suite"
Diana Picus72189fd2016-05-23 19:32:46 +030064prepare $llvm_repos/test-suite $gitroot/test-suite $svnroot/test-suite/trunk
Diana Picusec97c502016-04-22 18:12:13 +030065
Renato Golin94cc1042016-04-26 11:02:23 +010066echo " + Setting up LNT Test harness"
Diana Picus72189fd2016-05-23 19:32:46 +030067prepare $llvm_repos/lnt $gitroot/lnt $svnroot/lnt/trunk
Diana Picusec97c502016-04-22 18:12:13 +030068
Renato Golin94cc1042016-04-26 11:02:23 +010069echo " + Setting up Zorg Buildbot Config"
Diana Picus72189fd2016-05-23 19:32:46 +030070prepare $llvm_repos/zorg $gitroot/zorg $svnroot/zorg/trunk
Renato Golin94cc1042016-04-26 11:02:23 +010071
72echo " + Done"