1 1.1 mrg #! /bin/sh 2 1.1 mrg 3 1.1 mrg # Download some prerequisites needed by gcc. 4 1.1 mrg # Run this from the top level of the gcc source tree and the gcc 5 1.1 mrg # build will do the right thing. 6 1.1 mrg # 7 1.1 mrg # (C) 2010 Free Software Foundation 8 1.1 mrg # 9 1.1 mrg # This program is free software: you can redistribute it and/or modify 10 1.1 mrg # it under the terms of the GNU General Public License as published by 11 1.1 mrg # the Free Software Foundation, either version 3 of the License, or 12 1.1 mrg # (at your option) any later version. 13 1.1 mrg # 14 1.1 mrg # This program is distributed in the hope that it will be useful, but 15 1.1 mrg # WITHOUT ANY WARRANTY; without even the implied warranty of 16 1.1 mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 1.1 mrg # General Public License for more details. 18 1.1 mrg # 19 1.1 mrg # You should have received a copy of the GNU General Public License 20 1.1 mrg # along with this program. If not, see http://www.gnu.org/licenses/. 21 1.1 mrg 22 1.1.1.2 mrg # If you want to disable Graphite loop optimizations while building GCC, 23 1.1.1.3 mrg # DO NOT set GRAPHITE_LOOP_OPT as yes so that the isl package will not 24 1.1.1.2 mrg # be downloaded. 25 1.1.1.2 mrg GRAPHITE_LOOP_OPT=yes 26 1.1.1.2 mrg 27 1.1.1.2 mrg if [ ! -e gcc/BASE-VER ] ; then 28 1.1.1.2 mrg echo "You must run this script in the top level GCC source directory." 29 1.1.1.2 mrg exit 1 30 1.1.1.2 mrg fi 31 1.1.1.2 mrg 32 1.1.1.2 mrg # Necessary to build GCC. 33 1.1 mrg MPFR=mpfr-2.4.2 34 1.1 mrg GMP=gmp-4.3.2 35 1.1 mrg MPC=mpc-0.8.1 36 1.1 mrg 37 1.1 mrg wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPFR.tar.bz2 || exit 1 38 1.1 mrg tar xjf $MPFR.tar.bz2 || exit 1 39 1.1 mrg ln -sf $MPFR mpfr || exit 1 40 1.1 mrg 41 1.1 mrg wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$GMP.tar.bz2 || exit 1 42 1.1 mrg tar xjf $GMP.tar.bz2 || exit 1 43 1.1 mrg ln -sf $GMP gmp || exit 1 44 1.1 mrg 45 1.1 mrg wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPC.tar.gz || exit 1 46 1.1 mrg tar xzf $MPC.tar.gz || exit 1 47 1.1 mrg ln -sf $MPC mpc || exit 1 48 1.1 mrg 49 1.1.1.2 mrg # Necessary to build GCC with the Graphite loop optimizations. 50 1.1.1.2 mrg if [ "$GRAPHITE_LOOP_OPT" = "yes" ] ; then 51 1.1.1.3 mrg ISL=isl-0.15 52 1.1.1.2 mrg 53 1.1.1.2 mrg wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$ISL.tar.bz2 || exit 1 54 1.1.1.2 mrg tar xjf $ISL.tar.bz2 || exit 1 55 1.1.1.3 mrg # Fix trailing comma which errors with -pedantic for host GCC <= 4.3 56 1.1.1.3 mrg sed -e 's/isl_stat_ok = 0,/isl_stat_ok = 0/' isl-0.15/include/isl/ctx.h > isl-0.15/include/isl/ctx.h.tem && mv isl-0.15/include/isl/ctx.h.tem isl-0.15/include/isl/ctx.h 57 1.1.1.2 mrg ln -sf $ISL isl || exit 1 58 1.1.1.2 mrg fi 59