-
Notifications
You must be signed in to change notification settings - Fork 0
/
00-set-env.sh
executable file
·77 lines (62 loc) · 3.4 KB
/
00-set-env.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
77
#!/bin/sh
#
# YAGARTO toolchain
#
# Copyright (C) 2006-2012 by Michael Fischer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#---------------------------------------------------------------------------------
# Setup the environment
#
# This is done by a separate script, because if you have close your shell
# you can set the environment again with this script only.
#---------------------------------------------------------------------------------
. ./_env-only.sh
#---------------------------------------------------------------------------------
# Extract source packages
#---------------------------------------------------------------------------------
echo "Extracting $BINUTILS_SRC"
tar -xjvf download/binutils-$BINUTILS_VER.tar.bz2 || { echo "Error extracting "$BINUTILS_SRC; exit; }
echo "Extracting $GCC_SRC"
tar -xjvf download/$GCC_SRC.tar.bz2 || { echo "Error extracting "$GCC_SRC; exit; }
echo "Extracting $NEWLIB_SRC"
tar -xzvf download/$NEWLIB_SRC.tar.gz || { echo "Error extracting "$NEWLIB_SRC; exit; }
echo "Extracting $GDB_SRC"
tar -xjvf download/$GDB_SRC.tar.bz2 || { echo "Error extracting "$GDB_SRC; exit; }
echo "Extracting $GMP_SRC"
tar -xjvf download/$GMP_SRC.tar.bz2 || { echo "Error extracting "$GMP_SRC; exit; }
echo "Extracting $MPFR_SRC"
tar -xjvf download/$MPFR_SRC.tar.bz2 || { echo "Error extracting "$MPFR_SRC; exit; }
echo "Extracting $EXPAT_SRC"
tar -xzvf download/$EXPAT_SRC.tar.gz || { echo "Error extracting "$EXPAT_SRC; exit; }
echo "Extracting $MPC_SRC"
tar -xzvf download/$MPC_SRC.tar.gz || { echo "Error extracting "$MPC_SRC; exit; }
#---------------------------------------------------------------------------------
# Apply patches
#---------------------------------------------------------------------------------
echo
echo "Patching $BINUTILS_SRC"
patch -p1 -d $BINUTILS_SRC < patches/$BINUTILS_SRC.patch || { echo "Error patching "$BINUTILS_SRC; exit; }
echo
echo
echo "Patching $GCC_SRC"
patch -p1 -d $GCC_SRC < patches/$GCC_SRC.patch || { echo "Error patching "$GCC_SRC; exit; }
echo
echo
echo "Patching $NEWLIB_SRC"
patch -p1 -d $NEWLIB_SRC < patches/$NEWLIB_SRC.patch || { echo "Error patching "$NEWLIB_SRC; exit; }
echo