forked from jbrandwood/v810-gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep0_download_prereqs.sh
executable file
·142 lines (117 loc) · 3.46 KB
/
step0_download_prereqs.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#! /bin/sh
#
# Download script for V810-GCC.
#
# Use this to download the GNU source code files and libraries.
#
OSNAME=`uname -s`
SRCDIR=$(pwd)
echo SRCDIR is $SRCDIR
#---------------------------------------------------------------------------------
# Check Prerequisites
#---------------------------------------------------------------------------------
## Test for executables
TestEXE()
{
TEMP=`type $1`
if [ $? != 0 ]; then
echo "Error: $1 not installed";
exit 1;
fi
}
TestEXE "curl";
#---------------------------------------------------------------------------------
# Download the source files from GNU and Sourceware (Redhat)
#---------------------------------------------------------------------------------
mkdir -p archive
cd archive
if [ ! -e binutils-2.27.tar.bz2 ] ; then
echo
echo "Downloading binutils-2.27.tar.bz2 from ftp.gnu.org mirror site";
curl -L -O -R http://ftpmirror.gnu.org/binutils/binutils-2.27.tar.bz2
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the binutils source";
rm binutils-2.27.tar.bz2
cd ..
exit 1;
fi
fi
if [ ! -e gcc-4.9.4.tar.bz2 ] ; then
echo
echo "Downloading gcc-4.9.4.tar.bz2 from ftp.gnu.org mirror site";
curl -L -O -R http://ftpmirror.gnu.org/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the gcc source";
rm gcc-4.9.4.tar.bz2
cd ..
exit 1;
fi
fi
if [ ! -e cloog-0.18.5.tar.gz ] ; then
echo
echo "Downloading cloog-0.18.5.tar.gz from cloog-development github site";
curl -L -O -R https://github.com/periscop/cloog/releases/download/cloog-0.18.5/cloog-0.18.5.tar.gz
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the cloog source";
rm cloog-0.18.5.tar.gz
cd ..
exit 1;
fi
fi
if [ ! -e isl-0.18.tar.bz2 ] ; then
echo
echo "Downloading isl-0.18.tar.bz2 from gnu gcc infrastructure site";
curl -L -O -R --insecure https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the isl source";
rm isl-0.18.tar.bz2
cd ..
exit 1;
fi
fi
if [ ! -e gmp-6.1.2.tar.bz2 ] ; then
echo
echo "Downloading gmp-6.1.2.tar.bz2 from ftp.gnu.org mirror site";
curl -L -O -R http://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the gmp source";
rm gmp-6.1.2.tar.bz2
cd ..
exit 1;
fi
fi
if [ ! -e mpfr-3.1.6.tar.bz2 ] ; then
echo
echo "Downloading mpfr-3.1.6.tar.bz2 from ftp.gnu.org mirror site";
curl -L -O -R http://ftpmirror.gnu.org/mpfr/mpfr-3.1.6.tar.bz2
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the mpfr source";
rm mpfr-3.1.6.tar.bz2
cd ..
exit 1;
fi
fi
if [ ! -e mpc-1.0.3.tar.gz ] ; then
echo
echo "Downloading mpc-1.0.2.tar.gz from ftp.gnu.org mirror site";
curl -L -O -R http://ftpmirror.gnu.org/mpc/mpc-1.0.3.tar.gz
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the mpc source";
rm mpc-1.0.3.tar.gz
cd ..
exit 1;
fi
fi
if [ ! -e newlib-2.2.0-1.tar.gz ] ; then
echo
echo "Downloading newlib-2.2.0-1.tar.gz from sourceware.org";
curl -L -O -R ftp://sourceware.org/pub/newlib/newlib-2.2.0-1.tar.gz
if [ $? != 0 ]; then
echo "Error: Cannot download the required version of the newlib source";
rm newlib-2.2.0-1.tar.gz
cd ..
exit 1;
fi
fi
cd ..
exit 0