release.sh changes & fixes
[minix3.git] / external / gpl3 / gcc / fetch.sh
blob720cc8ca548b64ea0d5155990b613af9e3549e72
1 #!/bin/sh
3 set -e
5 # Make sure we're in our directory (i.e., where this shell script is)
6 echo $0
7 cd `dirname $0`
9 # Default sed: whatever's in $PATH; set by the buildsystem to be the
10 # host-built sed tool we know supports the syntax we use
11 : ${SED=sed}
13 # Configure fetch method
14 URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.3.0/gcc-4.5.3.tar.bz2"
15 BACKUP_URL="ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.5.3/gcc-4.5.3.tar.bz2"
16 FETCH=ftp
17 if which curl >/dev/null
18 then
19 FETCH="curl -O -f"
22 # Remove a few directories from the start, so we do not end up with a 165MB patch...
23 DELETEDIRS="include/elf
24 libada libjava libffi libgfortran
25 boehm-gc gnattools
26 gcc/ada gcc/fortran gcc/java
27 gcc/testsuite/ada gcc/testsuite/gnat gcc/testsuite/gnat.dg
28 gcc/testsuite/gfortran.dg gcc/testsuite/gfortran.fortran-torture
30 # Fetch sources if not available
31 if [ ! -d dist ];
32 then
33 if [ ! -f gcc-4.5.3.tar.bz2 ];
34 then
35 $FETCH $URL
36 if [ $? -ne 0 ]; then
37 $FETCH $BACKUP_URL
41 tar -oxjf gcc-4.5.3.tar.bz2
42 mv gcc-4.5.3 dist
43 cd dist
44 rm -rf $DELETEDIRS
45 for f in gcc/doc/gccinstall.info gcc/doc/gccint.info
46 do # This is a hack to remove NUL characters in these .info
47 # files. They make some patch(1)es fail.
48 $SED 's/^..\[index..\]$/[index]/' <$f >k && mv k $f
49 done
50 cat ../patches/* | patch -p1
51 cp ../files/minix.h gcc/config/
52 cp ../files/t-minix gcc/config/
53 cp ../files/minix-spec.h gcc/config/
54 cp ../files/arm-minix.h gcc/config/arm/minix.h
55 cp ../files/i386-minix.h gcc/config/i386/minix.h
56 cp ../files/gcov-minix-fs-wrapper.h gcc/