Bug 487993 - Alignment error when using Eigen with Valgrind and -m32
[valgrind.git] / auxprogs / build-gcc
blob1f0332ae68d6c67e44b8e440e4a0d9310bd4857a
1 #!/bin/sh -e
3 # Simple script to build GCC natively including its prerequisites.
5 # Depending on your needs you maybe able to speed up the GCC build:
7 # (a) Do not build a c++ compiler
8 # c++ is only needed for "make check" and running regression tests
9 # --> choose LANGUEGES=c below
10 # (b) Do not build a compiler that can produce 32-bit executables
11 # on a 64-bit platform
12 # --> choose MULTILIB=--disable-multilib below
14 # Define the following 5 variables:
16 BUILD_DIR=/tmp/build-gcc
17 INSTALL_DIR=/tmp/install
19 GCC_VERSION=5.1.0
20 LANGUAGES=c,c++
21 MULTILIB=
22 #LANGUAGES=c
23 #MULTILIB=--disable-multilib
25 #-----------------------------------------------------------
26 # No changes should be needed below this line
27 #-----------------------------------------------------------
29 # Create build directory
30 echo "...creating build directory $BUILD_DIR"
31 mkdir -p $BUILD_DIR
32 cd $BUILD_DIR
34 # Download tarballs
35 echo "...downloading tarball"
36 wget ftp://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2
38 # Build GCC
39 echo "...building GCC"
40 rm -rf gcc-$GCC_VERSION
41 tar xf gcc-$GCC_VERSION.tar.bz2
42 cd gcc-$GCC_VERSION
43 ./contrib/download_prerequisites
44 cd ..
45 rm -rf objdir
46 mkdir objdir
47 cd objdir
48 ../gcc-$GCC_VERSION/configure --prefix=$INSTALL_DIR --disable-bootstrap \
49 $MULTILIB --enable-languages=$LANGUAGES 2>&1 > gcc-config.log
50 make -s 2>&1 > gcc-make.log
51 make -s install 2>&1 > gcc-install.log
52 mv gcc-config.log gcc-make.log gcc-install.log ..
54 # done
55 echo "...done"