Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Written by Uwe Hermann <uwe@hermann-uwe.de>, released as public domain.
- # Edited by Travis Wiens ( http://blog.nutaksas.com/2009/05/installing-gnuarm-arm-toolchain-on.html )
- # Edited by Lionel Debroux for newer gcc/binutils/newlib/gdb versions and nspire-gcc.
- TARGET=arm-none-eabi
- PREFIX=/usr/local
- PARALLEL="-j2" # or "-j<number of build jobs>"
- BINUTILS=binutils-2.23.2 # http://www.gnu.org/software/binutils/
- GCC=gcc-4.8.1 # http://gcc.gnu.org/
- NEWLIB=newlib-2.0.0 # http://sourceware.org/newlib/
- GDB=gdb-7.6 # http://www.gnu.org/software/gdb/
- mkdir build-binutils
- mkdir build
- # IMPORTANT NOTE: in order to compile GCC 4.8, you need the GMP, MPFR and MPC development libraries.
- # For example, if you have installed them yourself in $PREFIX, you'll have to add --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX.
- # NOTE: the second rm -rf is commented, because it's not strictly necessary.
- # Section 1: GNU Binutils.
- (wget -c http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 && tar xvjf $BINUTILS.tar.bz2 && cd build-binutils && ../$BINUTILS/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-system-zlib --with-gnu-as --with-gnu-ld --disable-nls --with-float=soft --disable-werror && make $PARALLEL all && make install && cd ..) || exit 1;
- ##rm -rf $BINUTILS $BINUTILS.tar.bz2
- # Section 2: GCC, step 1.
- (wget -c ftp://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.bz2 && tar xvjf $GCC.tar.bz2 && cd build && ../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --enable-languages="c,c++" --with-system-zlib --with-newlib --without-headers --disable-shared --with-gnu-as --with-gnu-ld --with-float=soft --disable-werror && make $PARALLEL all-gcc && make install-gcc && cd .. && rm -rf build/*) || exit 1;
- ##rm -rf $GCC.tar.bz2
- # Section 3: Newlib.
- (wget -c ftp://sourceware.org/pub/newlib/$NEWLIB.tar.gz && tar xvzf $NEWLIB.tar.gz && cd build && ../$NEWLIB/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --disable-nls --with-float=soft --disable-werror && make $PARALLEL && make install && cd .. && rm -rf build/*) || exit 1;
- ##rm -rf $NEWLIB $NEWLIB.tar.gz
- # Section 4: GCC, step 2. Yes, this is necessary.
- (cd build && ../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --enable-languages="c,c++" --with-system-zlib --with-newlib --disable-shared --with-gnu-as --with-gnu-ld --with-float=soft --disable-werror && make $PARALLEL && make install && cd .. && rm -rf build/*) || exit 1
- ##rm -rf $GCC
- # Section 5: GDB.
- (wget -c ftp://ftp.gnu.org/gnu/gdb/$GDB.tar.bz2 && tar xvjf $GDB.tar.bz2 && cd build && ../$GDB/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --disable-werror && make $PARALLEL && make install && cd .. && rm -rf build/*) || exit 1;
- ##rm -rf $GDB $GDB.tar.bz2
- # Section 6: elf2flt.
- cat > Ndless-elf2flt.patch << EOF
- 91a92,97
- > #define R_ARM_CALL 28
- > #define R_ARM_JUMP24 29
- > #define R_ARM_TARGET1 38
- > #define R_ARM_V4BX 40
- > #define R_ARM_TARGET2 41
- > #define R_ARM_PREL31 42
- 647a654,660
- > case R_ARM_NONE:
- > case R_ARM_PREL31:
- > case R_ARM_TARGET1:
- > case R_ARM_TARGET2:
- > case R_ARM_CALL:
- > case R_ARM_V4BX:
- > case R_ARM_JUMP24:
- EOF
- (cvs -z3 -d:pserver:anonymous@cvs.uclinux.org:/var/cvs checkout -P elf2flt && patch elf2flt/elf2flt.c Ndless-elf2flt.patch && cd build && ../elf2flt/configure --target=$TARGET --prefix=$PREFIX -with-libbfd=../build-binutils/bfd/libbfd.a --with-libiberty=../build-binutils/libiberty/libiberty.a --with-bfd-include-dir=../build-binutils/bfd --with-binutils-include-dir=../$BINUTILS/include && make $PARALLEL && make install && cd .. && rm -rf build/*) || exit 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement