|
1 #!/bin/bash |
|
2 |
|
3 gcc_version=4.7.3 |
|
4 binutils_version=2.23.1 |
|
5 this_path=$(readlink -f $(dirname $0)) |
|
6 gcc_bt_patch=${this_path}/gcc-bt.patch |
|
7 gcc_pr55650_patch=${this_path}/gcc48-pr55650.patch |
|
8 make_flags='-j12' |
|
9 |
|
10 root_dir=$(mktemp -d) |
|
11 cd $root_dir |
|
12 |
|
13 if test -z $TMPDIR; then |
|
14 TMPDIR=/tmp/ |
|
15 fi |
|
16 |
|
17 wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2 || exit 1 |
|
18 tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2 |
|
19 mkdir binutils-objdir |
|
20 cd binutils-objdir |
|
21 ../binutils-$binutils_version/configure --prefix /tools/gcc/ --enable-gold --enable-plugins --disable-nls || exit 1 |
|
22 make $make_flags || exit 1 |
|
23 make install $make_flags DESTDIR=$root_dir || exit 1 |
|
24 cd .. |
|
25 |
|
26 wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 |
|
27 tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2 |
|
28 cd gcc-$gcc_version |
|
29 |
|
30 ./contrib/download_prerequisites |
|
31 |
|
32 # gcc 4.7 doesn't dump a stack on ICE so hack that in |
|
33 patch -p1 < $gcc_bt_patch || exit 1 |
|
34 |
|
35 patch -p0 < $gcc_pr55650_patch || exit 1 |
|
36 |
|
37 cd .. |
|
38 mkdir gcc-objdir |
|
39 cd gcc-objdir |
|
40 ../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++ --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro || exit 1 |
|
41 make $make_flags || exit 1 |
|
42 make $make_flags install DESTDIR=$root_dir || exit 1 |
|
43 |
|
44 cd $root_dir/tools |
|
45 tar caf $root_dir/gcc.tar.xz gcc/ |