]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/drd/scripts/download-and-build-gcc
Inital import
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / drd / scripts / download-and-build-gcc
1 #!/bin/bash
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.5.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 export LC_ALL=C
18 export MAKEFLAGS="-j$(($(grep -c '^processor' /proc/cpuinfo) + 1))"
19
20 if [ ! -e /usr/include/gmp.h ]; then
21   echo "Please install the gmp library development package first."
22   exit 1
23 fi
24
25 if [ ! -e /usr/include/mpfr.h ]; then
26   echo "Please install the mpfr library development package first."
27   exit 1
28 fi
29
30 if [ ! -e /usr/include/mpc.h ]; then
31   echo "Please install the mpc library development package first."
32   exit 1
33 fi
34
35 rm -rf   ${BUILD}     || exit $?
36 rm -rf   ${PREFIX}    || exit $?
37 mkdir -p ${DOWNLOADS} || exit $?
38 mkdir -p ${BUILD}     || exit $?
39 cd       ${BUILD}     || exit $?
40
41 if [ ! -e $DOWNLOADS/$TAR ]; then
42 (
43   if cd $DOWNLOADS; then
44     wget -q $FSF_MIRROR/gcc/gcc-${GCC_VERSION}/$TAR \
45     || { wget -q -O- $FSF_MIRROR/gcc/gcc-${GCC_VERSION}/${TAR%bz2}gz \
46          | gzip -cd | bzip2 -9 >${TAR}; }
47   fi
48 )
49 fi
50
51 if [ ! -e $SRC ]; then
52   ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR )
53 fi
54
55 ${SRC}/configure            \
56   --disable-linux-futex     \
57   --disable-mudflap         \
58   --disable-nls             \
59   --enable-languages=c,c++  \
60   --enable-threads=posix    \
61   --enable-tls              \
62   --prefix=$PREFIX
63
64 time { make -s && make -s install; }