#! /usr/bin/env bash
#
# Execution Times (for sparc-rtems${RTEMS_VERSION})
#
# - building native - ?
# - building binutils - 1m31.310s
# - building GDB - 1m39.318s
# - building stage1 (multilib) - 10m22.371s
# - building RTEMS (multilib + BSP) - 22m47.048s
# - building Objective-C (multilib) - 6m45.532s
# - building Ada (multilib) - ?
# - building Go (multilib) - ?
# - building GCJ (multilib) - ?
# - Running GCC Test Suite (sis) - 122m47.289s
# - Running Objective-C Test Suite (sis) - ?
# - Running ACAT (sis) - ?
# - Running Go Test Suite (sis) - ?
# - Running GCJ Test Suite (sis) - ?
#
# Computer Info
# Fedora 14 on Intel Core2 Duo Q6600 (4 core) @ 2.40GHz w/ 4GB RAM
vfile=`dirname $0`/../VERSIONS
if [ ! -r ${vfile} ] ; then
echo VERSIONS file not found
exit 1
fi
source ${vfile}
######################## Set defaults #############################
# Remove Build Directories
do_cleanup=no
# Install Binutils
do_binutils=no
# Install GDB
do_gdb=no
# Build the native compiler?
do_native=no
do_native_ada=yes
# Build the base level cross compiler. C++ and multilib are optional.
do_stage1=no
do_cxx=yes
do_multilib=yes
# Build the Objective-C language cross compiler.
do_objc=no
do_native_objc=yes
# Build the Ada language cross compiler.
do_ada=no
do_ada_multilib=yes
# Build the GCC Go language cross compiler.
do_gccgo=no
do_gccgo_multilib=yes
# Build the GCC Java language cross compiler.
do_gcj=no
do_gcj_multilib=yes
# Build the GCC FORTRAN language cross compiler.
do_fortran=no
do_fortran_multilib=yes
# Build RTEMS for a particular CPU/BSP combination
do_rtems=no
# Which test suites do we attempt
run_gcctests=no
run_objctests=no
run_acats=no
run_gccgotests=no
run_libgotests=no
run_libjavatests=no
run_fortrantests=no
# Do we send email to gcc-testresults with the test results?
do_mail=yes
# Are we noisy when running?
verbose=no
######################## Parse arguments ###########################
usage()
{
cat <<EOF
do_one [options] CPU BSP
-A - binutils, stage 1, C++, C/C++ multilib, RTEMS
-S - enable secondary languages of Ada, GCC Go, ObjC, FORTRAN
-T - run GCC tests for languages enabled
-B n - build jobs in parallel (e.g. make -j N)
-n - native compiler
-d - do not clean up (delete build directories) (default=no)
-M - do NOT email test results to gcc-testresults
-v - verbose (default=no)
Cross Compilation Options (Base and Primary Languages)
======================================================
-b - install binutils
-D - install gdb
-1 - stage 1 C/C++ compiler
-c - do not include C++
-m - do not build multilib
-r - build RTEMS
-g - run GCC C/C++ tests
Cross Compilation Options (Secondary Languages)
===============================================
-a - enable stage 2 Ada compiler
-G - enable stage 2 GCC Go compiler
-J - enable stage 2 GCC Java compiler
-f - enable stage 2 GCC FORTRAN compiler
-F - run FORTRAN tests
-C - run ACATS
-O - Build Objective-C
-P - Run Objective-C Tests
-o - run GCC Go tests
-t - run libgo tests
-j - run libjava tests
EOF
}
fatal()
{
usage
exit 1
}
toggle()
{
case $1 in
no) echo "yes" ;;
yes) echo "no" ;;
*) fatal "Unknown value to toggle ($1)" ;;
esac
}
while getopts bdDnv1cmargiotB:CfFAJTMGOPS OPT
do
case "$OPT" in
A) do_binutils="yes"
do_gdb="yes"
do_stage1="yes"
do_cxx="yes"
do_multilib="yes"
do_rtems="yes"
;;
S) # Secondary languages need to be explicitly turned on
do_ada="yes"
do_gccgo="yes"
do_gcj="yes"
do_objc="yes"
do_fortran="yes"
;;
B) MAKEJOBS="-j$OPTARG" ;;
d) do_cleanup=`toggle ${do_cleanup}` ;;
D) do_gdb=`toggle ${do_gdb}` ;;
T) run_gcctests="yes"
run_objctests="yes"
run_acats="yes"
run_gccgotests="yes"
run_fortrantests="yes"
;;
b) do_binutils=`toggle ${do_binutils}` ;;
# Build the native
n) do_native=`toggle ${do_native}` ;;
# Stage 1 arguments
1) do_stage1=`toggle ${do_stage1}` ;;
c) do_cxx=`toggle ${do_cxx}` ;;
m) do_multilib=`toggle ${do_multilib}` ;;
# Stage 2 arguments
a) do_ada=`toggle ${do_ada}` ;;
G) do_gccgo=`toggle ${do_gccgo}` ;;
J) do_gcj=`toggle ${do_gcj}` ;;
f) do_fortran=`toggle ${do_fortran}` ;;
# Build RTEMS
r) do_rtems=`toggle ${do_rtems}` ;;
# Testsuites to run
g) run_gcctests=`toggle ${run_gcctests}` ;;
C) run_acats=`toggle ${run_acats}` ;;
v) verbose=`toggle ${verbose}` ;;
M) do_mail=`toggle ${do_mail}` ;;
O) do_objc=`toggle ${do_objc}` ;;
P) run_objctests=`toggle ${run_objctests}` ;;
o) run_gccgotests=`toggle ${run_gccgotests}` ;;
t) run_libgotests=`toggle ${run_libgotests}` ;;
j) run_libjavatests=`toggle ${run_libjavatests}` ;;
F) run_fortrantests=`toggle ${run_fortrantests}` ;;
*) fatal ;;
esac
done
run_libgotests=$run_gccgotests
########################### Grab CPU/BSP ###########################
shiftcount=`expr $OPTIND - 1`
shift $shiftcount
cpu=${1}
bsp=${2}
needBSP=no
needCPU=no
# If native or cross, check things differently
if [ ${do_native} = yes ] ; then
if [ ${do_gccgo} = yes ] ; then
echo "Warning! Go requires native C++ to build."
do_cxx=yes
fi
if [ ${do_gcj} = yes ] ; then
echo "Warning! GCJ requires native C++ to build."
do_cxx=yes
fi
else # NOT NATIVE - build for RTEMS
# Should the user have specified a CPU and/or BSP?
if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
${do_stage1} = yes -o ${do_ada} = yes -o \
${do_gccgo} = yes -o ${do_gcj} = yes -o \
${do_fortran} = yes ] ; then
needCPU=yes
fi
if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
${run_acats} = yes -o ${run_gccgotests} = yes -o \
${run_libjavatests} = yes ] ; then
needBSP=yes
needCPU=yes
if [ x${bsp} = x ] ; then
echo "BSP NOT SET"
fatal
fi
fi
if [ ${needCPU} = yes -a x${cpu} = x ] ; then
echo "CPU NOT SET"
fatal
fi
if [ ${needBSP} = yes -a x${bsp} = x ] ; then
echo "BSP NOT SET"
fatal
fi
TARGET=${cpu}-rtems${RTEMS_VERSION}
# Which CPUs do not support C++
if [ ${do_cxx} = "yes" ] ; then
case ${cpu} in
avr|h8300|m32c)
do_cxx=no
echo ${cpu} does not support C++
;;
*);;
esac
fi
# Which CPUs do not support Ada
if [ ${do_ada} = "yes" ] ; then
case ${cpu} in
avr|h8300|m32c|sh)
do_ada=no
run_acats=no
echo ${cpu} does not support Ada
;;
*);;
esac
fi
# Which CPUs do not support Go
if [ ${do_gccgo} = "yes" ] ; then
case ${cpu} in
avr|h8300|m32c)
do_gccgo=no
echo ${cpu} does not support Go
;;
*);;
esac
fi
# Which CPUs do not support GCJ
if [ ${do_gcj} = "yes" ] ; then
case ${cpu} in
avr|h8300|m32c)
do_gcj=no
echo ${cpu} does not support GCJ
;;
*);;
esac
fi
# Which CPUs do not support FORTRAN
if [ ${do_fortran} = "yes" ] ; then
case ${cpu} in
arm|i386|m68k|mips|powerpc|sparc) ;;
*)
do_fortran=no
echo ${cpu} does not support Ada
;;
esac
fi
fi
# When verbose, print settings
if [ ${verbose} = yes ] ; then
echo "Target : " ${cpu}
echo "BSP : " ${bsp}
echo "Binutils : " ${do_binutils}
echo "GDB : " ${do_gdb}
echo "Make Jobs : " ${MAKEJOBS}
echo "Build Native : " ${do_native}
echo "Build C Stage 1 : " ${do_stage1} "(multilib=${do_multilib} test=${run_gcctests})"
echo " C++ : " ${do_cxx}
echo "Build RTEMS : " ${do_rtems}
echo "Email Tests : " ${do_mail}
echo "Native GCC : " `type gcc`
echo "PATH : " ${PATH}
echo "Clean up : " ${do_cleanup}
echo
echo "==================== Secondary Languages ======================"
echo " Ada : " ${do_ada} "(multilib=${do_ada_multilib} test=${run_acats})"
echo " FORTRAN : " ${do_fortran} "(multilib=${do_gccgo_multilib} test=${run_fortrantests})"
echo " GCC Go : " ${do_gccgo} \
"(multilib=${do_gccgo_multilib} test=${run_gccgotests} libgotests=${run_libgotests})"
echo " GCJ : " ${do_gcj} \
"(multilib=${do_gcj_multilib} test=${run_gcjtests} libtests=${run_libjavatests})"
echo " Objective-C : " ${do_objc} "(multilib=${do_ada_multilib} test=${run_objctests})"
fi
# Do we accept an alternate name for the BSP?
if [ x${bsp} = xqemu ] ; then
BSP_BUILT=pc386
else
BSP_BUILT=${bsp}
fi
######### Consistency check installation of source
if [ ! -d ${GCCDIR}/newlib ] ; then
echo "${GCCDIR}/newlib not present"
exit 1
fi
ADASCRIPTDIR=${SCRIPTDIR}/gcc/testsuite/ada/acats
for i in Makefile.rtems rtems_acats_reasons rtems_acats_status \
rtems_generate_acats_email rtems_init.c run_all_rtems.sh
do
if [ ! -r ${ADASCRIPTDIR}/${i} ] ; then
echo "${ADASCRIPTDIR}/gcc/testsuite/ada/acats/${i} not present"
echo "RTEMS ACATS support files not present"
exit 1
fi
done
if [ ${needCPU} = yes -a ${needBSP} = yes -a \
${run_gcctests} = yes -a ${run_acats} = yes ] ; then
DEJADIR=${SCRIPTDIR}/dejagnu/boards
if [ ! -d ${DEJADIR} ] ; then
echo "Missing DejaGNU configuration directory (${DEJADIR})"
exit 1
fi
case ${cpu}-${bsp} in
arm-edb7312) dejacfg=rtems-arm-edb7312 ;;
avr-avrtest) dejacfg=rtems-avr-avrtest ;;
bfin-eZKit533) dejacfg=rtems-bfin-nosim ;;
h8300-h8sim) dejacfg=rtems-h8300-h8sim ;;
i386-pc386|i386-qemu) dejacfg=rtems-i386-qemu ;;
lm32-lm32_evr) dejacfg=rtems-lm32-lm32_evr ;;
m32c-m32csim) dejacfg=rtems-m32c-m32csim ;;
m32r-m32rsim) dejacfg=rtems-m32r-m32rsim ;;
m68k-uC5282) dejacfg=rtems-m68k-uC5282 ;;
microblaze-nosim) dejacfg=rtems-microblaze-nosim ;;
mips-jmr3904) dejacfg=rtems-mips-jmr3904 ;;
powerpc-psim) dejacfg=rtems-powerpc-psim ;;
sh-simsh1) dejacfg=rtems-sh-simsh1 ;;
sparc-sis) dejacfg=rtems-sparc-sis ;;
sparc64-niagara) dejacfg=rtems-sparc64-nosim ;;
v850-*v850*sim*) dejacfg=rtems-v850-v850sim ;;
*)
echo "ERROR ${bsp} is not known to DegaGNU"
exit 1
;;
esac
if [ ! -r ${DEJADIR}/${dejacfg}.exp ] ; then
echo "Missing DejaGNU file for ${cpu}/${bsp}"
exit 1
fi
fi
######### END OF Consistency check installation of source
######### Log Directory
if [ ! -d ${LOGDIR} ] ; then
mkdir ${LOGDIR}
fi
#########
######### Install binutils
j_binutils()
{
test -d ${INSTALL} || mkdir -p ${INSTALL}
cd ${INSTALL}/..
echo "Building Binutils from source"
rm -rf ${BUILDDIR}/b-${cpu}-binutils
mkdir ${BUILDDIR}/b-${cpu}-binutils
cd ${BUILDDIR}/b-${cpu}-binutils
(${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \
--disable-werror && \
make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1
if [ $? -ne 0 ] ; then
echo "Failed to build Binutils from source"
exit 1
fi
echo "Checking Binutils "
make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1
grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log
cd ..
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-binutils
}
if [ ${do_binutils} = yes ] ; then
echo "Building binutils..."
time j_binutils ${cpu}
fi
######### Install gdb
j_gdb()
{
test -d ${INSTALL} || mkdir -p ${INSTALL}
cd ${INSTALL}/..
case ${cpu} in
mips) GDBTARGET=${cpu}tx39-rtems${RTEMS_VERSION} ;;
*) GDBTARGET=${TARGET} ;;
esac
echo "Building GDB from source"
cd ${BASEDIR}
rm -rf ${BUILDDIR}/b-${cpu}-gdb
mkdir ${BUILDDIR}/b-${cpu}-gdb
cd ${BUILDDIR}/b-${cpu}-gdb
(${GDBDIR}/configure --target=${GDBTARGET} \
--enable-sim --enable-sim-hardware \
--disable-werror \
--enable-timebase --enable-sim-trace --prefix=$INSTALL && \
make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-gdb.log 2>&1
if [ $? -ne 0 ] ; then
echo "Failed to build gdb from source"
exit 1
fi
cd ..
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gdb
}
if [ ${do_gdb} = yes ] ; then
echo "Building gdb..."
time j_gdb ${cpu}
fi
######### Build a native compiler
j_native()
{
test ${do_native_ada} = "yes" && AdaArg=",ada"
test ${do_native_objc} = "yes" && ObjCArg=",objc"
${GCCDIR}/configure \
${NATIVE_GCC_EXTRA_ARGS} \
--disable-werror \
--enable-languages=c,c++${AdaArg}${ObjCArg} --prefix=$INSTALL &&
make ${MAKEJOBS} && make install
}
if [ ${do_native} = "yes" ] ; then
echo "Building native compiler..."
cd ${BASEDIR} && \
rm -rf ${BUILDDIR}/b-native && \
mkdir ${BUILDDIR}/b-native && \
cd ${BUILDDIR}/b-native
time j_native >${LOGDIR}/native.log 2>&1
if [ $? -ne 0 ] ; then
echo "Failed to build native gcc"
exit 1
fi
cd ..
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-native
else
echo Skipping native
fi
# END of build native compiler
######### Build Cross C/C++ baseline compiler
j_gcc()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
if [ ${verbose} = yes ] ; then
echo "Cross Assembler ==>" `type ${TARGET}-as`
fi
if [ ${do_cxx} = yes ] ; then
cxx=",c++"
fi
if [ ${cpu} = avr ] ; then
cxx=""
fi
if [ ${do_multilib} = yes ] ; then
multilib="--enable-multilib"
else
multilib="--disable-multilib"
fi
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
--disable-werror \
--enable-threads=rtems --with-gnu-as ${multilib} \
--enable-newlib-mb --enable-newlib-iconv \
--with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-languages=c${cxx} --target=$TARGET --prefix=$INSTALL
if [ $? -ne 0 ] ; then
echo "Failed to configure GCC C/C++ .. bailing"
exit 1
fi
make ${MAKEJOBS}
if [ $? -ne 0 ] ; then
echo "Failed to build GCC C/C++ .. bailing"
exit 1
fi
make install
if [ $? -ne 0 ] ; then
echo "Failed to install GCC C/C++ .. bailing"
exit 1
fi
}
if [ ${do_stage1} = "yes" ] ; then
echo "Building Stage 1 compiler (C/C++)..."
(cd ${BASEDIR} && \
rm -rf ${BUILDDIR}/b-${cpu}-gcc && \
mkdir ${BUILDDIR}/b-${cpu}-gcc && \
cd ${BUILDDIR}/b-${cpu}-gcc && \
time j_gcc ${cpu} >${LOGDIR}/${cpu}-gcc.log 2>&1 && cd ..) || exit 1
else
echo Skipping Stage 1 for ${cpu}
fi
#################### RTEMS
j_rtems()
{
cpuArg=$1
bspArg=$2
bspdir=${BUILDDIR}/b-${cpuArg}-${bspArg}
cd ${BASEDIR}
rm -rf ${bspdir}
mkdir ${bspdir} || exit 1
cd ${bspdir} || exit 1
ENABLE_BSP="--enable-rtemsbsp=${bspArg}"
case $bspArg in
multilib)
ENABLE_BSP="--enable-multilib"
MAKE_ARG="-k"
;;
edb7312) ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
gumstix) ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
qemu|pc386)
ENABLE_BSP="${ENABLE_BSP} USE_COM1_AS_CONSOLE=1"
ENABLE_BSP="${ENABLE_BSP} BSP_PRESS_KEY_FOR_RESET=0"
ENABLE_BSP="${ENABLE_BSP} BSP_RESET_BOARD_AT_EXIT=1"
;;
*) ;;
esac
case ${cpu} in
m32c|h8300)
RTEMS_ARGS="--disable-ada --disable-posix --disable-networking" ;;
*)
RTEMS_ARGS="--enable-ada --enable-posix --enable-networking" ;;
esac
${RTEMSDIR}/configure --target=${TARGET} ${ENABLE_BSP} \
${RTEMS_ARGS} --enable-maintainer-mode --disable-tests \
--prefix=${BSP_INSTALL} && make ${MAKEJOBS} ${MAKE_ARG} && make install
status=$?
cd ..
if [ $status -ne 0 ] ; then
echo "Failed building RTEMS for ${cpuArg}/${bspArg}"
if [ ${bspArg} != "multilib" ] ; then
exit $status
fi
fi
}
if [ ${do_rtems} = "yes" ] ; then
echo "Building RTEMS for ${cpu} ${bsp} ..."
time j_rtems ${cpu} multilib ${bsp} >${LOGDIR}/${cpu}-rtems-multilib.log 2>&1
if [ $? -ne 0 ] ; then
echo "Failed to build RTEMS multilib for ${cpu}"
exit 1
fi
time j_rtems ${cpu} ${bsp} >${LOGDIR}/${cpu}-rtems-${bsp}.log 2>&1
if [ $? -ne 0 ] ; then
echo "Failed to build RTEMS for ${cpu}/${bsp}"
exit 1
fi
test ${do_cleanup} = "yes" && \
rm -rf ${BUILDDIR}/b-${cpu}-${bsp} ${BUILDDIR}/b-${cpu}-multilib
else
echo Skipping RTEMS for ${cpu}/${bsp}
fi
pwd
j_process_results()
{
language=$1
shift
RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
for results in `ls -1 gcc/testsuite/*/${*}.log gcc/testsuite/*/${*}.sum 2>/dev/null`
do
test -d ${RDIR} || mkdir -p ${RDIR}
cp ${results} ${RDIR}
done
if [ ${do_mail} = "yes" ] ; then
echo "Sending ${language} test results to GCC community.."
${GCCDIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
if [ $? -ne 0 ] ; then
echo "Failed to email ${language} Test Results to GCC Community .. bailing"
exit 1
fi
echo "Sending ${language} test results to RTEMS community.."
${GCCDIR}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
if [ $? -ne 0 ] ; then
echo "Failed to email ${language} Test Results to RTEMS Community .. bailing"
exit 1
fi
fi
}
##### Do the gcc tests
if [ ${run_gcctests} = "yes" ] ; then
echo "Running GCC Tests..."
cd ${BUILDDIR}/b-${cpu}-gcc || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc \
>${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "C/C++" gcc/testsuite/gcc/gcc gcc/testsuite/g++/g++
fi
cd .. || exit 1
else
echo Skipping GCC DejaGNU tests for ${cpu}/${bsp}
fi
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gcc
##### Build an Objective-C compiler now that we have a cross installed
j_gccobjc()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
TARGET=${1}-rtems${RTEMS_VERSION}
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
if [ ${verbose} = yes ] ; then
echo "Cross GCC for Objective-C ==>" `type ${TARGET}-gcc`
fi
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
--enable-threads=rtems --with-gnu-as --enable-multilib \
--with-gnu-ld --disable-newlib --verbose --with-system-zlib --disable-nls \
CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ \
--enable-version-specific-runtime-libs \
--enable-languages=c,objc --target=$TARGET --prefix=$INSTALL &&
make ${MAKEJOBS} &&
make install
status=$?
if [ $status -ne 0 ] ; then
echo "Failed building Objective-C"
fi
}
objc_fail="no"
if [ ${do_objc} = "yes" ] ; then
echo "Building Stage 2 cross Objective-C compiler for ${1} ..."
(cd ${BASEDIR} && \
rm -rf ${BUILDDIR}/b-${cpu}-objc && \
mkdir ${BUILDDIR}/b-${cpu}-objc && \
cd ${BUILDDIR}/b-${cpu}-objc && \
time j_gccobjc ${cpu} >${LOGDIR}/${cpu}-objc.log 2>&1 && cd ..) || \
objc_fail="yes"
else
echo Skipping Stage 2 Objective-C for ${cpu}
fi
#### Run the Objective-C tests
if [ ${run_objctests} = "yes" -a \
-d ${BUILDDIR}/b-${cpu}-objc -a ${objc_fail} = "no" ] ; then
echo "Running Objective-C Tests..."
cd ${BUILDDIR}/b-${cpu}-objc || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} objc \
>${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "Objective-C" gcc/testsuite/objc/objc
fi
cd .. || exit 1
else
echo Skipping Objective-C Tests for ${cpu}
fi
if [ ${do_ada} = "yes" ] ; then
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada
fi
##### Build an Ada compiler now that we have a cross installed
j_gccada()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
TARGET=${1}-rtems${RTEMS_VERSION}
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
if [ ${verbose} = yes ] ; then
echo "Cross GCC for Ada ==>" `type ${TARGET}-gcc`
fi
if [ ${do_ada_multilib} = yes ] ; then
ada_multilib="--enable-multilib"
else
ada_multilib="--disable-multilib"
fi
# CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
--enable-threads=rtems --with-gnu-as ${ada_multilib} \
--with-gnu-ld --disable-newlib --verbose --with-system-zlib --disable-nls \
CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ \
--enable-version-specific-runtime-libs \
--enable-languages=c,ada --target=$TARGET --prefix=$INSTALL &&
make ${MAKEJOBS} &&
make install
status=$?
if [ $status -ne 0 ] ; then
echo "Failed building Ada - continuing to next secondary language"
fi
return $status
}
ada_fail="no"
if [ ${do_ada} = "yes" ] ; then
echo "Building Stage 2 cross Ada compiler for ${1} ..."
(cd ${BASEDIR} && \
rm -rf ${BUILDDIR}/b-${cpu}-ada && \
mkdir ${BUILDDIR}/b-${cpu}-ada && \
cd ${BUILDDIR}/b-${cpu}-ada && \
time j_gccada ${cpu} >${LOGDIR}/${cpu}-ada.log 2>&1 && cd ..) || \
ada_fail="yes"
else
echo Skipping Stage 2 Ada for ${cpu}
fi
#### Run the Ada ACATS tests
if [ ${run_acats} = "yes" -a \
-d ${BUILDDIR}/b-${cpu}-ada -a ${ada_fail} = "no" ] ; then
echo "Running ACATS..."
cd ${GCCDIR}/gcc/testsuite/ada/acats/ || exit 1
time ${ADASCRIPTDIR}/run_all_rtems.sh ${INSTALL} ${BSP_INSTALL} \
${TARGET} ${bsp} >${LOGDIR}/${cpu}-acats-${bsp}-build.log 2>&1
if [ $? -eq 0 ] ; then
if [ -r work-${bsp}/acats.log ] ; then
cp work-${bsp}/acats.log ${LOGDIR}/${cpu}-acats-${bsp}.log
fi
if [ ${do_mail} = "yes" ] ; then
echo Sending ACATS test results to GCC community..
${ADASCRIPTDIR}/rtems_generate_acats_email ${cpu} ${bsp} yes
fi
fi
cd ../../../../.. || exit 1
else
echo Skipping ACATS for ${cpu}
fi
if [ ${do_ada} = "yes" ] ; then
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada
fi
##### Build a GCC Go compiler now that we have a cross installed
j_gccgo()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
TARGET=${1}-rtems${RTEMS_VERSION}
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
if [ ${verbose} = yes ] ; then
echo "Cross GCC ==>" `type ${TARGET}-gcc`
fi
if [ ${do_gccgo_multilib} = yes ] ; then
gccgo_multilib="--enable-multilib"
else
gccgo_multilib="--disable-multilib"
fi
case ${TARGET} in
i386*) GOFLAGS="-march=i486" ;;
*) GOFLAGS="" ;;
esac
# CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
--enable-threads=rtems --with-gnu-as ${gccgo_multilib} \
--with-gnu-ld --disable-newlib --verbose \
--with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--with-host-libstdcxx=-static-libstdc++ \
--enable-languages=c,go --target=$TARGET --prefix=$INSTALL &&
make ${MAKEJOBS} &&
make install
status=$?
if [ $status -ne 0 ] ; then
echo "Failed building Go - continuing to next secondary language"
fi
return $status
}
go_fail="no"
if [ ${do_gccgo} = "yes" ] ; then
echo "Building Stage 2 cross GCC Go compiler for ${1} ..."
(cd ${BASEDIR} && \
rm -rf ${BUILDDIR}/b-${cpu}-go && \
mkdir ${BUILDDIR}/b-${cpu}-go && \
cd ${BUILDDIR}/b-${cpu}-go && \
time j_gccgo ${cpu} >${LOGDIR}/${cpu}-go.log 2>&1 && cd ..) || \
go_fail="yes"
else
echo Skipping GCC Go for ${cpu}
fi
##### Do the gccgo tests
if [ $a ${run_gccgotests} = "yes" -a \
-d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then
echo "Running GCC Go Tests..."
cd ${BUILDDIR}/b-${cpu}-go/gcc || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gccgo \
>${LOGDIR}/${cpu}-gccgotests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "Go" testsuite/go/go
fi
cd .. || exit 1
else
echo Skipping GCC Go DejaGNU tests for ${cpu}/${bsp}
fi
##### Do the libgo tests
if [ $a ${run_libgotests} = "yes" -a \
-d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then
echo "Running libgo DejaGNU tests..."
cd ${BUILDDIR}/b-${cpu}-go || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} libgo \
>${LOGDIR}/${cpu}-libgotests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "Go Library" ${TARGET}/libgo/testsuite/libgo-all
fi
else
echo Skipping libgo DejaGNU tests for ${cpu}/${bsp}
fi
if [ ${do_gccgo} = "yes" ] ; then
test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-go
fi
##### Build a GCJ compiler now that we have a cross installed
j_gcj()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
TARGET=${1}-rtems${RTEMS_VERSION}
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
if [ ${verbose} = yes ] ; then
echo "Cross GCC ==>" `type ${TARGET}-gcc`
fi
if [ ${do_gcj_multilib} = yes ] ; then
gcj_multilib="--enable-multilib"
else
gcj_multilib="--disable-multilib"
fi
case ${TARGET} in
i386*) GOFLAGS="-march=i486" ;;
*) GOFLAGS="" ;;
esac
# CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
--enable-threads=rtems --with-gnu-as ${gcj_multilib} \
--with-gnu-ld --disable-newlib --verbose \
--with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--with-host-libstdcxx=-static-libstdc++ \
--enable-languages=c,c++,java --target=$TARGET --prefix=$INSTALL &&
make ${MAKEJOBS} &&
make install
status=$?
if [ $status -ne 0 ] ; then
echo "Failed building GCJ - continuing to next secondary language"
fi
return $status
}
gcj_fail="no"
if [ ${do_gcj} = "yes" ] ; then
echo "Building Stage 2 cross GCC Java compiler for ${1} ..."
(cd ${BASEDIR} && \
rm -rf b-${cpu}-gcj && \
mkdir b-${cpu}-gcj && \
cd b-${cpu}-gcj && \
time j_gcj ${cpu} >${LOGDIR}/${cpu}-gcj.log 2>&1 && cd ..) || \
gcj_fail="yes"
else
echo Skipping GCC Java compiler for ${cpu}
fi
##### Do the libjava tests
if [ $a ${run_libjavatests} = "yes" -a \
-d ${BASEDIR}/b-${cpu}-gcj -a ${gcj_fail} = "no" ] ; then
echo "Running libjava DejaGNU tests..."
cd ${BASEDIR}/b-${cpu}-gcj || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} java \
>${LOGDIR}/${cpu}-libjavatests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "GCJ" ${TARGET}-${bsp}/libjava/testsuite/libjava-all
fi
else
echo Skipping libjava DejaGNU tests for ${cpu}/${bsp}
fi
if [ ${do_gcj} = "yes" ] ; then
test ${do_cleanup} = "yes" && rm -rf b-${cpu}-gcj
fi
##### Build a FORTRAN compiler now that we have a cross installed
j_fortran()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
exit 1
fi
TARGET=${1}-rtems${RTEMS_VERSION}
if [ ! -d ${INSTALL} ] ; then
echo ${INSTALL} does not exist
exit 1
fi
${GCCDIR}/configure \
${GCC_EXTRA_ARGS} \
CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${F_FLAGS}" \
--with-ppl=/users/joel/test-gcc/install-svn/ \
--enable-threads=rtems --with-gnu-as \
--with-gnu-ld --disable-newlib --verbose \
--with-system-zlib --disable-nls \
--enable-version-specific-runtime-libs \
--enable-languages=c,fortran --target=$TARGET --prefix=$INSTALL && \
make ${MAKEJOBS} &&
make install
status=$?
if [ $status -ne 0 ] ; then
echo "Failed building FORTRAN - continuing to next secondary language"
fi
return $status
}
fortran_fail="no"
if [ ${do_fortran} = "yes" ] ; then
echo "Building Stage 2 cross GCC FORTRAN compiler for ${1} ..."
(cd ${BASEDIR} && \
rm -rf b-${cpu}-fortran && \
mkdir b-${cpu}-fortran && \
cd b-${cpu}-fortran && \
time j_fortran ${cpu} >${LOGDIR}/${cpu}-fortran.log 2>&1 && cd ..) || \
fortran_fail="yes"
else
echo Skipping GCC FORTRAN compiler for ${cpu}
fi
##### Do the FORTRAN tests
if [ $a ${run_fortrantests} = "yes" -a \
-d ${BASEDIR}/b-${cpu}-fortran -a ${fortran_fail} = "no" ] ; then
echo "Running FORTRAN DejaGNU tests..."
cd ${BASEDIR}/b-${cpu}-fortran || exit 1
time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} fortran \
>${LOGDIR}/${cpu}-fortrantests-${bsp}.log 2>&1
if [ $? -eq 0 ] ; then
j_process_results "FORTRAN" gcc/testsuite/gfortran/gfortran
fi
else
echo Skipping FORTRAN DejaGNU tests for ${cpu}/${bsp}
fi
if [ ${do_fortran} = "yes" ] ; then
test ${do_cleanup} = "yes" && rm -rf b-${cpu}-fortran
fi
exit 0