bart | e3f4071 | 2008-06-04 18:08:10 +0000 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Make sure that libgmp and libmpfr are installed before you run this script. |
| 4 | # On Debian systems, e.g. Ubuntu, you can install these libraries as follows: |
| 5 | # sudo apt-get install libgmp3-dev libmpfr-dev. In openSUSE these packages |
| 6 | # are called gmp-devel and mpfr-devel. |
| 7 | |
| 8 | |
| 9 | GCC_VERSION=4.3.0 |
| 10 | FSF_MIRROR=ftp://ftp.easynet.be/gnu |
| 11 | SRCDIR=$HOME/software |
| 12 | DOWNLOADS=$SRCDIR/downloads |
| 13 | SRC=$HOME/software/gcc-${GCC_VERSION} |
| 14 | BUILD=${SRC}-build |
| 15 | TAR=gcc-${GCC_VERSION}.tar.bz2 |
| 16 | PREFIX=$HOME/gcc-${GCC_VERSION} |
| 17 | |
| 18 | if [ ! -e /usr/include/gmp.h ]; then |
| 19 | echo "Please install the gmp library development package first." |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | if [ ! -e /usr/include/mpfr.h ]; then |
| 24 | echo "Please install the mpfr library development package first." |
| 25 | exit 1 |
| 26 | fi |
| 27 | |
| 28 | rm -rf ${BUILD} || exit $? |
| 29 | rm -rf ${PREFIX} || exit $? |
| 30 | mkdir -p ${BUILD} || exit $? |
| 31 | mkdir -p ${DOWNLOADS} || exit $? |
| 32 | cd ${BUILD} || exit $? |
| 33 | |
| 34 | if [ ! -e $DOWNLOADS/$TAR ]; then |
| 35 | ( cd $DOWNLOADS && wget -q $FSF_MIRROR/gcc/gcc-${GCC_VERSION}/$TAR ) |
| 36 | fi |
| 37 | |
| 38 | if [ ! -e $SRC ]; then |
| 39 | ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR ) |
| 40 | fi |
| 41 | |
| 42 | ${SRC}/configure \ |
| 43 | --disable-linux-futex \ |
| 44 | --disable-mudflap \ |
| 45 | --disable-nls \ |
| 46 | --enable-languages=c,c++ \ |
| 47 | --enable-threads=posix \ |
| 48 | --enable-tls \ |
| 49 | --prefix=$PREFIX |
| 50 | |
| 51 | make -s || exit $? |
| 52 | make -s install || exit $? |