Replace the old IRQ dispatcher and IPC notifier with new implementation.
[helenos.git] / contrib / toolchain / toolchain.ppc64.sh
blobc4677ca7e3093952d43a0278fa87e8e6c1b2a6a4
1 #!/bin/bash
3 # Cross-Compiler Toolchain for ${PLATFORM}
4 # by Martin Decky <martin@decky.cz>
6 # GPL'ed, copyleft
10 check_error() {
11 if [ "$1" -ne "0" ]; then
12 echo
13 echo "Script failed: $2"
14 exit
18 BINUTILS_VERSION="2.16.1"
19 GCC_VERSION="4.1.1"
21 BINUTILS="binutils-${BINUTILS_VERSION}.tar.gz"
22 GCC="gcc-core-${GCC_VERSION}.tar.bz2"
24 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
25 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
27 PLATFORM="ppc64"
28 WORKDIR=`pwd`
29 TARGET="${PLATFORM}-linux-gnu"
30 HOST="i686-pc-linux-gnu"
31 PREFIX="/usr/local/${PLATFORM}"
32 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}"
33 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}"
34 OBJDIR="${WORKDIR}/gcc-obj"
36 echo ">>> Downloading tarballs"
38 if [ ! -f "${BINUTILS}" ]; then
39 wget -c "${BINUTILS_SOURCE}${BINUTILS}"
40 check_error $? "Error downloading binutils."
42 if [ ! -f "${GCC}" ]; then
43 wget -c "${GCC_SOURCE}${GCC}"
44 check_error $? "Error downloading GCC."
47 echo ">>> Creating destionation directory"
48 if [ ! -d "${PREFIX}" ]; then
49 mkdir -p "${PREFIX}"
50 test -d "${PREFIX}"
51 check_error $? "Unable to create ${PREFIX}."
54 echo ">>> Creating GCC work directory"
55 if [ ! -d "${OBJDIR}" ]; then
56 mkdir -p "${OBJDIR}"
57 test -d "${OBJDIR}"
58 check_error $? "Unable to create ${OBJDIR}."
61 echo ">>> Unpacking tarballs"
62 tar -xvzf "${BINUTILS}"
63 check_error $? "Error unpacking binutils."
64 tar -xvjf "${GCC}"
65 check_error $? "Error unpacking GCC."
67 echo ">>> Compiling and installing binutils"
68 cd "${BINUTILSDIR}"
69 check_error $? "Change directory failed."
70 ./configure "--host=${HOST}" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" "--disable-nls"
71 check_error $? "Error configuring binutils."
72 make all install
73 check_error $? "Error compiling/installing binutils."
75 echo ">>> Compiling and installing GCC"
76 cd "${OBJDIR}"
77 check_error $? "Change directory failed."
78 "${GCCDIR}/configure" "--host=${HOST}" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c --disable-multilib --disable-libgcj --without-headers --disable-shared
79 check_error $? "Error configuring GCC."
80 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc
81 check_error $? "Error compiling/installing GCC."
83 echo
84 echo ">>> Cross-compiler for ${TARGET} installed."