-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·77 lines (62 loc) · 1.44 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
set -e
DIRNAME=`dirname $0`
CWD=`realpath ${DIRNAME}`
PREFIX=${CWD}/toolchain
BUILD_PREFIX=${PREFIX}/build
TARGET=aarch64-none-freebsd10
update_git()
{
subdir=$1
cd ${PREFIX}
if [ ! -d "${subdir}" ] ; then
git clone git://github.com/zxombie/${subdir}.git
else
cd ${subdir}
git pull
fi
cd ${CWD}
}
update_binutils()
{
update_git aarch64-freebsd-binutils
}
build_binutils()
{
cd ${PREFIX}/aarch64-freebsd-binutils
./configure --prefix=${BUILD_PREFIX} --target=${TARGET} --with-sysroot=yes
gmake
gmake install
cd ${CWD}
}
update_gcc()
{
update_git aarch64-freebsd-gcc
}
build_gcc()
{
mkdir -p ${PREFIX}/aarch64-freebsd-gcc-build
cd ${PREFIX}/aarch64-freebsd-gcc-build
CONFIG_ARGS=""
CONFIG_ARGS="${CONFIG_ARGS} --prefix=${BUILD_PREFIX}"
CONFIG_ARGS="${CONFIG_ARGS} --target=${TARGET}"
CONFIG_ARGS="${CONFIG_ARGS} --enable-languages=c"
CONFIG_ARGS="${CONFIG_ARGS} --disable-threads"
CONFIG_ARGS="${CONFIG_ARGS} --disable-shared"
CONFIG_ARGS="${CONFIG_ARGS} --disable-libmudflap"
CONFIG_ARGS="${CONFIG_ARGS} --disable-libssp"
CONFIG_ARGS="${CONFIG_ARGS} --disable-libgomp"
CONFIG_ARGS="${CONFIG_ARGS} --disable-libquadmath"
CONFIG_ARGS="${CONFIG_ARGS} --with-gmp=/usr/local"
${PREFIX}/aarch64-freebsd-gcc/aarch64-branch/configure ${CONFIG_ARGS}
# Only build gcc, skip libgcc for now
gmake all-gcc
gmake install-gcc
cd ${CWD}
}
cd ${CWD}
mkdir -p ${BUILD_PREFIX}
update_binutils
build_binutils
#update_gcc
#build_gcc