etc/protocols - sync with NetBSD-8
[minix.git] / external / gpl3 / gcc / fetch.sh
blobd3d7eec395deed24876e9d113f26b1ed5df5af6d
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 # Default sed: whatever's in $PATH; set by the buildsystem to be the
8 # host-built sed tool we know supports the syntax we use
9 : ${SED=sed}
11 # Configure fetch method
12 URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/gcc-4.8.5.tar.bz2"
13 BACKUP_URL="ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.8.5/gcc-4.8.5.tar.bz2"
14 FETCH=ftp
15 if which curl >/dev/null
16 then
17 FETCH="curl -O -f"
20 # Remove a few directories from the start, so we do not end up with a 165MB patch...
21 DELETEDIRS="
22 boehm-gc
23 gcc/ada
24 gcc/fortran
25 gcc/go
26 gcc/java
27 gcc/po
28 gcc/testsuite
29 libada
30 libatomic
31 libcpp/po
32 libffi
33 libgfortran
34 libgo
35 libgomp/testsuite
36 libiberty/testsuite
37 libitm/testsuite
38 libjava
39 libmudflap/testsuite
40 libquadmath
41 libstdc++-v3/po
42 libstdc++-v3/testsuite
43 zlib
45 # Fetch sources if not available
46 if [ ! -d dist ];
47 then
48 if [ ! -f gcc-4.8.5.tar.bz2 ];
49 then
50 $FETCH $URL
51 if [ $? -ne 0 ]; then
52 $FETCH $BACKUP_URL
56 tar -oxjf gcc-4.8.5.tar.bz2
57 mv gcc-4.8.5 dist
58 cd dist
59 rm -rf $DELETEDIRS
60 #for f in gcc/doc/gccinstall.info gcc/doc/gccint.info
61 #do # This is a hack to remove NUL characters in these .info
62 # files. They make some patch(1)es fail.
63 # $SED 's/^..\[index..\]$/[index]/' <$f >k && mv k $f
64 # done
65 cat ../patches/* | patch -p1
66 cp ../files/minix.h gcc/config/
67 cp ../files/t-minix gcc/config/
68 cp ../files/minix-spec.h gcc/config/
69 cp ../files/arm-minix.h gcc/config/arm/minix.h
70 cp ../files/i386-minix.h gcc/config/i386/minix.h
71 cp ../files/gcov-minix-fs-wrapper.h gcc/