# Fetch, build and install RTEMS 4.10.2, GNU Tools and SSRL extensions
#
# This may look like a C-shell-script, but it isn't intended to be used
# as one. This is a record of the commands I used to build the RTEMS
# 4.10.2 installation. Some of the configure arguments may be unnecessary
# for Linux-hosted compilers; I was following Eric Norum's tutorial, but
# that documented the process for RTEMS 4.9.2 and some things have changed
# since then.
# The mpfr code is only needed because I'm building this using an older
# RHEL 5.8 system which doesn't have a new enough version of the libmpfr
# needed for building gcc 4.4.7.
# - Andrew Johnson, 2012/12/13
cd ~/rtems
mkdir -p archive/4.10.2
# GNU Tools and Newlib
mkdir tools
cd tools
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/binutils-2.20.1.tar.bz2
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.4.7.tar.bz2
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gcc-g++-4.4.7.tar.bz2
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gdb-7.3.1.tar.bz2
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/mpfr-2.4.2.tar.bz2
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0.tar.gz
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/binutils-2.20.1-rtems4.10-20100826.diff
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.4.7-rtems4.10-20120314.diff
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gcc-g++-4.4.7-rtems4.10-20120314.diff
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/gdb-7.3.1-rtems4.10-20120918.diff
wget ftp://www.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.10-20110518.diff
tar xfj binutils-2.20.1.tar.bz2
tar xfj gcc-core-4.4.7.tar.bz2
tar xfj gcc-g++-4.4.7.tar.bz2
tar xfj gdb-7.3.1.tar.bz2
tar xfj mpfr-2.4.2.tar.bz2
tar xfz newlib-1.18.0.tar.gz
(cd binutils-2.20.1 && patch -p1