blob: 204bfa46a484b838224ccc841c8a62cb99917ad7 [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
12 link=$2
13 origin=$3
14 svn=$4
15 dir=`basename $src`
16 # Clone Linaro repo
17 if [ ! -d $src/.git ]; then
18 mkdir -p $src
19 cd $src/..
20 safe_run git clone $origin $dir
21 fi
22 # Link with upstream SVN
23 if [[ $LLVM_GITRW = 'yes' && ! -d $src/.git/svn ]]; then
24 cd $src
25 safe_run git svn init $svn --username=$LLVM_SVNUSER
26 safe_run git config svn-remote.svn.fetch :refs/remotes/origin/master
27 safe_run git svn fetch
28 fi
29 # Create the symlink into LLVM's source
30 if [[ $link != "no" && ! -x $link ]]; then
31 cd $src
32 ln -sf $src $link
33 fi
34}
35
36echo " + Setting up LLVM"
37prepare $LLVM_SRC $LLVM_SRC \
38 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/llvm \
39 https://llvm.org/svn/llvm-project/llvm/trunk
40echo " + Setting up Clang"
41prepare $LLVM_SRC/../clang $LLVM_SRC/tools/clang \
42 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/clang \
43 https://llvm.org/svn/llvm-project/cfe/trunk
44echo " + Setting up Clang Tools Extra"
45prepare $LLVM_SRC/../clang-tools-extra $LLVM_SRC/../clang/tools/extra \
46 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/clang-tools-extra \
47 https://llvm.org/svn/llvm-project/clang-tools-extra/trunk
48echo " + Setting up Compiler-RT"
49prepare $LLVM_SRC/../compiler-rt $LLVM_SRC/projects/compiler-rt \
50 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/compiler-rt \
51 https://llvm.org/svn/llvm-project/compiler-rt/trunk
52echo " + Setting up LLD Linker"
53prepare $LLVM_SRC/../lld $LLVM_SRC/tools/lld \
54 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/lld \
55 https://llvm.org/svn/llvm-project/lld/trunk
56echo " + Setting up LibC++"
57prepare $LLVM_SRC/../libcxx no \
58 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/libcxx \
59 https://llvm.org/svn/llvm-project/libcxx/trunk
60echo " + Setting up LibC++ABI"
61prepare $LLVM_SRC/../libcxxabi no \
62 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/libcxxabi \
63 https://llvm.org/svn/llvm-project/libcxxabi/trunk
64echo " + Setting up LibUnwind"
65prepare $LLVM_SRC/../libunwind $LLVM_SRC/projects/libunwind \
66 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/libunwind \
67 https://llvm.org/svn/llvm-project/libunwind/trunk
68echo " + Setting up LLDB Debugger"
69prepare $LLVM_SRC/../lldb $LLVM_SRC/tools/lldb \
70 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/lldb \
71 https://llvm.org/svn/llvm-project/lldb/trunk
72echo " + Setting up Test Suite"
73prepare $LLVM_SRC/../test-suite $LLVM_SRC/projects/test-suite \
74 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/test-suite \
75 https://llvm.org/svn/llvm-project/test-suite/trunk
76echo " + Setting up LNT Test harness"
77prepare $LLVM_SRC/../lnt $LLVM_SRC/projects/lnt \
78 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/lnt \
79 https://llvm.org/svn/llvm-project/lnt/trunk
80echo " + Setting up Zorg Buildbot Config"
81prepare $LLVM_SRC/../zorg $LLVM_SRC/projects/zorg \
82 ssh://$LLVM_GITUSER@review.linaro.org:29418/toolchain/llvm/zorg \
83 https://llvm.org/svn/llvm-project/zorg/trunk
84
85mkdir -p $LLVM_BLD
86
87echo " + Done"