1*4fee23f9Smrg#! /bin/sh 2*4fee23f9Smrg 3*4fee23f9Smrg# Build a GCC compiler, using environment variables defined by several 4*4fee23f9Smrg# reghunt scripts and config files. 5*4fee23f9Smrg# 6*4fee23f9Smrg# This doesn't work for sources earlier than about 2003-02-25. 7*4fee23f9Smrg# 8*4fee23f9Smrg# Copyright (C) 2007 Free Software Foundation. 9*4fee23f9Smrg# 10*4fee23f9Smrg# This file is free software; you can redistribute it and/or modify 11*4fee23f9Smrg# it under the terms of the GNU General Public License as published by 12*4fee23f9Smrg# the Free Software Foundation; either version 3 of the License, or 13*4fee23f9Smrg# (at your option) any later version. 14*4fee23f9Smrg# 15*4fee23f9Smrg# This program is distributed in the hope that it will be useful, 16*4fee23f9Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 17*4fee23f9Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*4fee23f9Smrg# GNU General Public License for more details. 19*4fee23f9Smrg# 20*4fee23f9Smrg# For a copy of the GNU General Public License, write the the 21*4fee23f9Smrg# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22*4fee23f9Smrg# Boston, MA 02111-1301, USA. 23*4fee23f9Smrg 24*4fee23f9SmrgID="${1}" 25*4fee23f9SmrgLOGDIR=${REG_BUILDDIR}/logs/${BUGID}/${ID} 26*4fee23f9Smrgmkdir -p $LOGDIR 27*4fee23f9Smrg 28*4fee23f9Smrgmsg() { 29*4fee23f9Smrg echo "`date` ${1}" 30*4fee23f9Smrg} 31*4fee23f9Smrg 32*4fee23f9Smrgabort() { 33*4fee23f9Smrg msg "${1}" 34*4fee23f9Smrg exit 1 35*4fee23f9Smrg} 36*4fee23f9Smrg 37*4fee23f9Smrgmsg "building $REG_COMPILER for id $ID" 38*4fee23f9Smrg 39*4fee23f9Smrgrm -rf $REG_OBJDIR 40*4fee23f9Smrgmkdir $REG_OBJDIR 41*4fee23f9Smrgcd $REG_OBJDIR 42*4fee23f9Smrg 43*4fee23f9Smrg#msg "configure" 44*4fee23f9Smrg${REG_GCCSRC}/configure \ 45*4fee23f9Smrg --prefix=$REG_PREFIX \ 46*4fee23f9Smrg --enable-languages=$REG_LANGS \ 47*4fee23f9Smrg $REG_CONFOPTS \ 48*4fee23f9Smrg > configure.log 2>&1 || abort " configure failed" 49*4fee23f9Smrg 50*4fee23f9Smrg#msg "make libraries" 51*4fee23f9Smrgmake all-build-libiberty > ${LOGDIR}/make.all-build-libiberty.log 2>&1 || true 52*4fee23f9Smrgmake all-libcpp > ${LOGDIR}/make.all-libcpp.log 2>&1 || true 53*4fee23f9Smrgmake all-libdecnumber > ${LOGDIR}/make.all-libdecnumber.log 2>&1 || true 54*4fee23f9Smrgmake all-intl > ${LOGDIR}/make.all-intl.log 2>&1 || true 55*4fee23f9Smrgmake all-libbanshee > ${LOGDIR}/make.all-libbanshee.log 2>&1 || true 56*4fee23f9Smrgmake configure-gcc > ${LOGDIR}/make.configure-gcc.log 2>&1 || true 57*4fee23f9Smrg 58*4fee23f9Smrg# hack for 3.3 branch 59*4fee23f9Smrgif [ ! -f libiberty/libiberty.a ]; then 60*4fee23f9Smrg if [ -d libiberty ]; then 61*4fee23f9Smrg # another hack for 3.2! 62*4fee23f9Smrg cd libiberty 63*4fee23f9Smrg make > ${LOGDIR}/make.libiberty.log 2>&1 || true 64*4fee23f9Smrg cd .. 65*4fee23f9Smrg else 66*4fee23f9Smrg mkdir -p libiberty 67*4fee23f9Smrg cd libiberty 68*4fee23f9Smrg ln -s ../build-${REG_BLD}/libiberty/libiberty.a . 69*4fee23f9Smrg cd .. 70*4fee23f9Smrg fi 71*4fee23f9Smrgfi 72*4fee23f9Smrg 73*4fee23f9Smrgcd gcc 74*4fee23f9Smrg# REG_COMPILER is cc1, cc1plus, or f951 75*4fee23f9Smrg#msg "make $REG_COMPILER" 76*4fee23f9Smrgmake $REG_MAKE_J $REG_COMPILER > ${LOGDIR}/make.${REG_COMPILER}.log 2>&1 \ 77*4fee23f9Smrg || abort " make failed" 78*4fee23f9Smrgmsg "build completed" 79*4fee23f9Smrgexit 0 80