-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path01_setup
executable file
·63 lines (52 loc) · 1.33 KB
/
01_setup
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
#!/bin/bash
#
# 01_setup
#
# Rob Laswick
# May 2 2013
#
# Script to prepare the previously downloaded files to be built.
if [ $# -ne 5 ]; then
echo
echo
echo *** RUNNING SCRIPT STAND ALONE ***
echo
echo
WORKING_DIR=/home/rlaswick/engineering/arm-toolchain-build
BINUTILS_VER=2.23.2
GCC_VER=4.8.0
NEWLIB_VER=2.0.0
GDB_VER=7.6
else
WORKING_DIR=$1
BINUTILS_VER=$2
GCC_VER=$3
NEWLIB_VER=$4
GDB_VER=$5
fi
SCRIPTS_DIR=`pwd`
cd ${WORKING_DIR}/src
cp binutils-${BINUTILS_VER}.tar.bz2 ../build
cp gcc-${GCC_VER}.tar.bz2 ../build
cp newlib-${NEWLIB_VER}.tar.gz ../build
cp gdb-${GDB_VER}.tar.bz2 ../build
cd ../build
tar xvfj binutils-${BINUTILS_VER}.tar.bz2 || exit 1
ln -fs binutils-${BINUTILS_VER} binutils || exit 1
rm -f binutils-${BINUTILS_VER}.tar.bz2
tar xvfj gcc-${GCC_VER}.tar.bz2 || exit 1
ln -fs gcc-${GCC_VER} gcc || exit 1
rm -f gcc-${GCC_VER}.tar.bz2
patch -b gcc/gcc/config/arm/t-arm-elf ${SCRIPTS_DIR}/gcc.patch || exit 1
tar xvfz newlib-${NEWLIB_VER}.tar.gz || exit 1
ln -fs newlib-${NEWLIB_VER} newlib || exit 1
rm -f newlib-${NEWLIB_VER}.tar.gz
tar xvfj gdb-${GDB_VER}.tar.bz2 || exit 1
ln -fs gdb-${GDB_VER} gdb || exit 1
rm -f gdb-${GDB_VER}.tar.bz2
patch -b openocd.git/src/flash/nor/at91sam4.c ${SCRIPTS_DIR}/openocd.sam4e.patch || exit 1
echo
echo
echo
echo binutils, gcc, newlib, gdb, and openocd are ready to be built and installed!
echo