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-2024 Free Software Foundation, Inc. 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 22 abort() { 23 echo "`date` $1" 24 exit 1 25 } 26 27 ID=$1 28 LOGDIR=${REG_BUILDDIR}/logs/${BUGID}/${ID} 29 mkdir -p $LOGDIR 30 31 echo "`date` building GCC ($REG_LANGS) for id ${ID}" 32 33 cd $REG_BUILDDIR 34 rm -rf obj 35 mkdir obj 36 cd obj 37 38 echo "REG_CONFOPTS = $REG_CONFOPTS" > ${LOGDIR}/configure.log 39 echo "REG_PREFIX = $REG_PREFIX" >> ${LOGDIR}/configure.log 40 echo "REG_LANGS = $REG_LANGS" >> ${LOGDIR}/configure.log 41 echo >> ${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 49 make $REG_MAKE_J > ${LOGDIR}/make.log 2>&1 || abort " make failed" 50 make install > ${LOGDIR}/make.install.log 2>&1 || abort " make install failed" 51 52 exit 0 53