4 if [ "$1" = "--fetch-only" ]; then
10 if [ -z "$PREFIX" ]; then
11 PREFIX
="/opt/m68k-elf"
26 mkdir
-p download ||
exit 1
27 if [ ! -f download
/`basename "$1"` ]; then
28 wget
-c -O download
/`basename "$1"` "$1" ||
exit 1
33 mkdir
-p src ||
exit 1
39 if [ -n "$STERILIZE" -o ! -f "src/$unpackDST/configure" ]; then
40 rm -rf "src/${unpackDST}"
44 tar -C src
-jxvf `pwd`/download
/"${unpackSRC}".
tar.bz2 ||
exit 1
46 for d
in `pwd`/download
/"${unpackDST}"-*.
patch; do
49 patch -p1 <$d ||
exit 1
54 [ -f "src/$unpackDST/configure" ] ||
exit 1
58 [ -n "${STERILIZE}" ] && rm -rf "build/${configBASE}"
59 [ -e build
/.
$1.config
-a build
/.
$1.config
-nt src
/$1-$2/configure
] && return 0
65 mkdir
-p build
/${configBASE}
66 (cd build
/${configBASE}
67 ..
/..
/src
/${configBASE}-${configVERSION}/configure \
75 --with-gmp="${PREFIX}" \
76 --with-mpfr="${PREFIX}" \
77 --with-mpc="${PREFIX}" \
78 --prefix="${PREFIX}" \
81 touch build
/.
${configBASE}.config
85 [ -e build
/.
$1.build
-a build
/.
$1.build
-nt build
/.
$1.config
] && return 0
86 make -C build
/$1 ||
exit 1
91 [ -e build
/.
$1.deploy
-a build
/.
$1.deploy
-nt build
/.
$1.build
] && return 0
92 make -C build
/$1 install ||
exit 1
93 touch build
/.
$1.deploy
96 fetch
ftp://ftp.gnu.org
/pub
/gnu
/binutils
/binutils-
${BINUTILS_VERSION}.
tar.bz2
97 fetch
ftp://ftp.gnu.org
/pub
/gnu
/gcc
/gcc-
${GCC_VERSION}/gcc-core-
${GCC_VERSION}.
tar.bz2
98 fetch
ftp://ftp.gnu.org
/pub
/gnu
/gcc
/gcc-
${GCC_VERSION}/gcc-g
++-${GCC_VERSION}.
tar.bz2
99 fetch
ftp://ftp.gnu.org
/pub
/gnu
/gcc
/gcc-
${GCC_VERSION}/gcc-objc-
${GCC_VERSION}.
tar.bz2
100 fetch
ftp://ftp.gnu.org
/pub
/gnu
/gmp
/gmp-
${GMP_VERSION}.
tar.bz2
101 fetch
ftp://ftp.gnu.org
/pub
/gnu
/mpfr
/mpfr-
${MPFR_VERSION}.
tar.bz2
102 fetch
ftp://ftp.gnu.org
/pub
/gnu
/gdb
/gdb-
${GDB_VERSION}.
tar.bz2
103 fetch http
://www.evillabs.net
/AROS
/gcc-4.6
.2-aros.
patch
104 fetch http
://www.multiprecision.org
/mpc
/download
/mpc-
${MPC_VERSION}.
tar.gz
105 if [ download
/mpc-
${MPC_VERSION}.
tar.gz
-nt download
/mpc-
${MPC_VERSION}.
tar.bz2
]; then
106 (gzip -dc download
/mpc-
${MPC_VERSION}.
tar.gz |
bzip2 -c >download
/mpc-
${MPC_VERSION}.
tar.bz2
) ||
exit 1
108 fetch
ftp://sources.redhat.com
/pub
/newlib
/newlib-
${NEWLIB_VERSION}.
tar.gz
109 if [ download
/newlib-
${NEWLIB_VERSION}.
tar.gz
-nt download
/newlib-
${NEWLIB_VERSION}.
tar.bz2
]; then
110 (gzip -dc download
/newlib-
${NEWLIB_VERSION}.
tar.gz |
bzip2 -c >download
/newlib-
${NEWLIB_VERSION}.
tar.bz2
) ||
exit 1
113 if [ "${FETCH_ONLY}" = "yes" ]; then
117 unpack binutils-
${BINUTILS_VERSION}
118 unpack gcc-
${GCC_VERSION} \
119 gcc-core-
${GCC_VERSION} \
120 gcc-objc-
${GCC_VERSION} \
121 gcc-g
++-${GCC_VERSION}
122 unpack gmp-
${GMP_VERSION}
123 unpack mpfr-
${MPFR_VERSION}
124 unpack mpc-
${MPC_VERSION}
125 unpack gdb-
${GDB_VERSION}
126 unpack newlib-
${NEWLIB_VERSION}
128 config binutils
${BINUTILS_VERSION} \
130 --program-prefix=m68k-elf- \
135 config gmp
${GMP_VERSION}
139 config mpfr
${MPFR_VERSION}
143 config mpc
${MPC_VERSION}
147 config gcc
${GCC_VERSION} \
149 --program-prefix=m68k-elf- \
150 --without-target-libiberty \
151 --without-target-zlib \
152 --disable-bootstrap \
153 --enable-languages="c"
157 config gdb
${GDB_VERSION} \
159 --program-prefix=m68k-elf-
164 config newlib
${NEWLIB_VERSION} \
166 --program-prefix=m68k-elf- \
167 --enable-languages="c"
172 config gcc
${GCC_VERSION} \
175 --program-prefix=m68k-elf- \
176 --disable-bootstrap \
177 --enable-languages="c c++ objc"