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.
10 FSF_MIRROR
=ftp://ftp.easynet.be
/gnu
12 DOWNLOADS
=$SRCDIR/downloads
13 SRC
=$HOME/software
/gcc-
${GCC_VERSION}
15 TAR
=gcc-
${GCC_VERSION}.
tar.bz2
16 PREFIX
=$HOME/gcc-
${GCC_VERSION}
18 #GMP_PREFIX=$HOME/gmp-5.0.1
20 #MPFR_PREFIX=$HOME/mpfr-2.4.2
22 #MPC_PREFIX=$HOME/mpc-0.8.1
24 export MAKEFLAGS
="-j$(($(grep -c '^processor' /proc/cpuinfo) + 1))"
26 if [ ! -e $GMP_PREFIX/include
/gmp.h
]; then
27 echo "Please install the gmp library development package first."
31 if [ ! -e $MPFR_PREFIX/include
/mpfr.h
]; then
32 echo "Please install the mpfr library development package first."
36 if [ ! -e $MPC_PREFIX/include
/mpc.h
]; then
37 echo "Please install the mpc library development package first."
41 rm -rf ${BUILD} ||
exit $?
42 rm -rf ${PREFIX} ||
exit $?
43 mkdir
-p ${DOWNLOADS} ||
exit $?
44 mkdir
-p ${BUILD} ||
exit $?
45 cd ${BUILD} ||
exit $?
47 if [ ! -e $DOWNLOADS/$TAR ]; then
49 if cd $DOWNLOADS; then
50 wget
-q $FSF_MIRROR/gcc
/gcc-
${GCC_VERSION}/$TAR \
51 ||
{ wget
-q -O- $FSF_MIRROR/gcc
/gcc-
${GCC_VERSION}/${TAR%bz2}gz \
52 |
gzip -cd |
bzip2 -9 >${TAR}; }
57 if [ ! -e $SRC ]; then
58 ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR )
62 --disable-linux-futex \
65 --enable-languages=c
,c
++ \
66 --enable-threads=posix \
69 --with-gmp=$GMP_PREFIX \
70 --with-mpfr=$MPFR_PREFIX \
71 --with-mpc=$MPC_PREFIX
73 time { make -s && make -s install; }