Removing warning about OSNAME.
[minix.git] / external / gpl3 / gcc / fetch.sh
blobb67e9b34328a8f07c1c7bbe4e0028c3a6a15d5ad
1 #!/bin/sh
3 # Make sure we're in our directory (i.e., where this shell script is)
4 echo $0
5 cd `dirname $0`
7 # Configure fetch method
8 URL="http://www.minix3.org/distfiles-minix/gcc-4.5.3.tar.bz2"
9 BACKUP_URL="ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.5.3/gcc-4.5.3.tar.bz2"
10 FETCH=wget
11 which curl >/dev/null
12 if [ $? -eq 0 ]; then
13 FETCH="curl -O -f"
16 # Remove a few directories from the start, so we do not end up with a 165MB patch...
17 DELETEDIRS="include/elf
18 libada libjava libffi libgfortran
19 boehm-gc gnattools
20 gcc/ada gcc/fortran gcc/java
21 gcc/testsuite/ada gcc/testsuite/gnat gcc/testsuite/gnat.dg
22 gcc/testsuite/gfortran.dg gcc/testsuite/gfortran.fortran-torture
24 # Fetch sources if not available
25 if [ ! -d dist ];
26 then
27 if [ ! -f gcc-4.5.3.tar.bz2 ];
28 then
29 $FETCH $URL
30 if [ $? -ne 0 ]; then
31 $FETCH $BACKUP_URL
35 tar -oxjf gcc-4.5.3.tar.bz2 && \
36 mv gcc-4.5.3 dist && \
37 cd dist && \
38 rm -rf $DELETEDIRS && \
39 cat ../patches/* | patch -p1 && \
40 cp ../files/minix.h gcc/config/ && \
41 cp ../files/minix-spec.h gcc/config/ && \
42 cp ../files/i386-minix.h gcc/config/i386/minix.h && \
43 cp ../files/gcov-minix-fs-wrapper.h gcc/