aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rwxr-xr-xcross-arm.sh42
-rwxr-xr-xcross-x86.sh42
3 files changed, 87 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc7ea67
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.tar.bz2
+*.tar.gz
+build-*
diff --git a/cross-arm.sh b/cross-arm.sh
new file mode 100755
index 0000000..e578105
--- /dev/null
+++ b/cross-arm.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+GCC=4.5.0
+BINUTILS=2.20
+ARCH=arm
+
+cd `dirname $0`
+
+export BASEDIR=`pwd`
+export PREFIX=$HOME/usr
+export TARGET=$ARCH-elf
+
+echo " ==> FETCHING CROSS COMPILER ARCHIVES <=="
+if [ ! -f gcc-core-$GCC.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-core-$GCC.tar.bz2; fi
+if [ ! -f gcc-g++-$GCC.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-g++-$GCC.tar.bz2; fi
+if [ ! -f binutils-$BINUTILS.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2; fi
+
+mkdir build-$ARCH
+cd build-$ARCH
+
+echo " ==> EXTRACTING ARCHIVES <=="
+tar xjf ../gcc-core-$GCC.tar.bz2
+tar xjf ../gcc-g++-$GCC.tar.bz2
+tar xjf ../binutils-$BINUTILS.tar.bz2
+
+mkdir build-binutils-$BINUTILS
+mkdir build-gcc-$GCC
+
+echo " =>> STARTING BUILD <<="
+cd build-binutils-$BINUTILS
+../binutils-$BINUTILS/configure --prefix=$PREFIX --target=$TARGET --disable-nls --disable-werror || exit
+make all || exit
+make install || exit
+
+export PATH=$PATH:$PREFIX/bin
+
+cd ../build-gcc-$GCC
+../gcc-$GCC/configure --prefix=$PREFIX --target=$TARGET --disable-nls --enable-languages=c,c++ --without-headers || exit
+make all-gcc || exit
+make install-gcc || exit
+make all-target-libgcc || exit
+make install-target-libgcc || exit
diff --git a/cross-x86.sh b/cross-x86.sh
new file mode 100755
index 0000000..5187328
--- /dev/null
+++ b/cross-x86.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+GCC=4.5.0
+BINUTILS=2.20
+ARCH=x86
+
+cd `dirname $0`
+
+export BASEDIR=`pwd`
+export PREFIX=$HOME/usr
+export TARGET=i586-elf
+
+echo " ==> FETCHING CROSS COMPILER ARCHIVES <=="
+if [ ! -f gcc-core-$GCC.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-core-$GCC.tar.bz2; fi
+if [ ! -f gcc-g++-$GCC.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-g++-$GCC.tar.bz2; fi
+if [ ! -f binutils-$BINUTILS.tar.bz2 ]; then wget http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.bz2; fi
+
+mkdir build-$ARCH
+cd build-$ARCH
+
+echo " ==> EXTRACTING ARCHIVES <=="
+tar xjf ../gcc-core-$GCC.tar.bz2
+tar xjf ../gcc-g++-$GCC.tar.bz2
+tar xjf ../binutils-$BINUTILS.tar.bz2
+
+mkdir build-binutils-$BINUTILS
+mkdir build-gcc-$GCC
+
+echo " =>> STARTING BUILD <<="
+cd build-binutils-$BINUTILS
+../binutils-$BINUTILS/configure --prefix=$PREFIX --target=$TARGET --disable-nls || exit
+make all || exit
+make install || exit
+
+export PATH=$PATH:$PREFIX/bin
+
+cd ../build-gcc-$GCC
+../gcc-$GCC/configure --prefix=$PREFIX --target=$TARGET --disable-nls --enable-languages=c,c++ --without-headers || exit
+make all-gcc || exit
+make install-gcc || exit
+make all-target-libgcc || exit
+make install-target-libgcc || exit