1#! /bin/sh 2 3# Perform a simple build of GCC for a particular language, using several 4# environment variables defined by reghunt scripts and config files. 5# 6# Copyright (C) 2007 Free Software Foundation. 7# 8# This file is free software; you can redistribute it and/or modify 9# it under the terms of the GNU General Public License as published by 10# the Free Software Foundation; either version 3 of the License, or 11# (at your option) any later version. 12# 13# This program is distributed in the hope that it will be useful, 14# but WITHOUT ANY WARRANTY; without even the implied warranty of 15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16# GNU General Public License for more details. 17# 18# For a copy of the GNU General Public License, write the the 19# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20# Boston, MA 02111-1301, USA. 21 22abort() { 23 echo "`date` $1" 24 exit 1 25} 26 27ID=$1 28LOGDIR=${REG_BUILDDIR}/logs/${BUGID}/${ID} 29mkdir -p $LOGDIR 30 31echo "`date` building GCC ($REG_LANGS) for id ${ID}" 32 33cd $REG_BUILDDIR 34rm -rf obj 35mkdir obj 36cd obj 37 38echo "REG_CONFOPTS = $REG_CONFOPTS" > ${LOGDIR}/configure.log 39echo "REG_PREFIX = $REG_PREFIX" >> ${LOGDIR}/configure.log 40echo "REG_LANGS = $REG_LANGS" >> ${LOGDIR}/configure.log 41echo >> ${LOGDIR}/configure.log 42 43${REG_GCCSRC}/configure \ 44 --prefix=$REG_PREFIX \ 45 $REG_CONFOPTS \ 46 --enable-languages=$REG_LANGS \ 47 >> ${LOGDIR}/configure.log 2>&1 || abort " configure failed" 48 49make $REG_MAKE_J > ${LOGDIR}/make.log 2>&1 || abort " make failed" 50make install > ${LOGDIR}/make.install.log 2>&1 || abort " make install failed" 51 52exit 0 53