-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·48 lines (38 loc) · 1.14 KB
/
build
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
#!/bin/sh
#
# build arm-none-eabi gcc toolchain
# for the raspberry pi
#
VG="4.9.0"
VB="2.24"
JN="-j 6"
export TARGET="arm-none-eabi"
export PREFIX="$HOME/opt/gnuarm"
export PATH="$PREFIX/bin:$PATH"
./clean
mkdir -p build-binutils build-gcc "$PREFIX" >/dev/null 2>&1
# build binutils
cd build-binutils
curl http://ftp.gnu.org/gnu/binutils/binutils-${VB}.tar.gz |tar xz
binutils-${VB}/configure --target="$TARGET" \
--prefix="$PREFIX" \
--enable-interwork \
--disable-nls \
--disable-werror
make ${JN} && \
make install
[ "$?" -ne "0" ] && exit 1
# build gcc
cd ../build-gcc
curl http://ftp.gnu.org/gnu/gcc/gcc-${VG}/gcc-${VG}.tar.gz |tar xz
gcc-${VG}/configure --target="$TARGET" \
--prefix="$PREFIX" \
--without-headers \
--with-newlib \
--enable-interwork \
--enable-languages='c' \
--disable-nls
make ${JN} all-gcc && \
make install-gcc && \
make ${JN} all-target-libgcc CFLAGS_FOR_TARGET="-g -O2" && \
make install-target-libgcc