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