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
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"
35 echo "...downloading tarball"
36 wget
ftp://ftp.gnu.org
/gnu
/gcc
/gcc-
$GCC_VERSION/gcc-
$GCC_VERSION.
tar.bz2
39 echo "...building GCC"
40 rm -rf gcc-
$GCC_VERSION
41 tar xf gcc-
$GCC_VERSION.
tar.bz2
43 .
/contrib
/download_prerequisites
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 ..