#! /bin/sh # # Execution Times (for sparc-rtems${RTEMS_VERSION}) # # - building native - 45m43.697s # - building stage1 (non-multilib) - 7m26.749s # - building stage1 (multilib) - # - building Ada stack (non-multilib) - 13m25.945s # - building RTEMS - 12m27.799s # - Running ACAT (sis) - # - Running GCC Test Suite (sis) - 60m26.523s # # Computer Info # Fedora 8 on Intel Core2 Duo T7500 @ 2.20GHz w/ 2GB 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=yes # Install Binutils (from rpm or source) do_binutils=no do_binutils_method=source # Install GDB (from rpm or source) do_gdb=no do_gdb_method=source # 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 Ada language cross compiler. Multilib is NOT supported do_ada=no do_ada_multilib=yes # Build RTEMS for a particular CPU/BSP combination do_rtems=no # Which test suites do we attempt run_gcctests=no run_acats=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 <${LOGDIR}/${cpu}-binutils.log 2>&1 if [ $? -ne 0 ] ; then echo "Failed to build Binutils from source" exit 1 fi cd .. test ${do_cleanup} = "yes" && rm -rf b-binutils-${cpu} ;; *) echo "Where do I get the binutils from?" exit 1 ;; esac } if [ ${do_binutils} = yes ] ; then echo "Building binutils..." j_binutils ${cpu} fi ######### Install gdb j_gdb() { set -x test -d ${INSTALL} || mkdir -p ${INSTALL} cd ${INSTALL}/.. case ${cpu} in mips) GDBTARGET=${cpu}tx39-rtems${RTEMS_VERSION} ;; *) GDBTARGET=${TARGET} ;; esac case ${do_gdb_method} in rpm) if [ ! -r /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb ] ; then echo "Binutils RPMs not installed" exit 0 fi echo "Extracting gdb from installed RPMs" DIR=`pwd` mkdir tmp-unrpm cd tmp-unrpm cd / for cpu in $* do pkg=`rpm -qf /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb` rpm -ql $pkg | cpio -pvdum ${DIR}/tmp-unrpm done cd ${DIR}/tmp-unrpm/opt/rtems-${RTEMS_VERSION} find . | cpio -pdum ${INSTALL} cd ${DIR} rm -rf tmp-unrpm ;; source) echo "Building GDB from source" cd ${BASEDIR} rm -rf b-gdb-${cpu} mkdir b-gdb-${cpu} cd b-gdb-${cpu} (${GDBDIR}/configure --target=${GDBTARGET} \ --enable-sim --enable-sim-hardware \ --enable-timebase --enable-sim-trace --prefix=$INSTALL && \ make -j3 && 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 b-gdb-${cpu} ;; *) echo "Where do I get the gdb from?" exit 1 ;; esac } if [ ${do_gdb} = yes ] ; then echo "Building gdb..." j_gdb ${cpu} fi ######### Build a native compiler j_native() { test ${do_native_ada} = "yes" && AdaArg=",ada" ${GCCDIR}/configure \ --enable-languages=c${AdaArg} --prefix=$INSTALL && make -j3 && make install } if [ ${do_native} = "yes" ] ; then echo "Building native compiler..." (cd ${BASEDIR} && \ rm -rf b-native && \ mkdir b-native && \ cd b-native && \ time j_native >${LOGDIR}/native.log 2>&1 && cd .. ) || exit 1 test ${do_cleanup} = "yes" && rm -rf b-native else echo Skipping native fi # END of build native compiler ######### Build Cross C/C++ baseline compiler j_gcc1() { 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 [ ${do_multilib} = yes ] ; then multilib="--enable-multilib" else multilib="--disable-multilib" fi ${GCCDIR}/configure \ --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 && make -j3 && make install } if [ ${do_stage1} = "yes" ] ; then echo "Building Stage 1 compiler (C/C++)..." (cd ${BASEDIR} && \ rm -rf b-gcc1-${cpu} && \ mkdir b-gcc1-${cpu} && \ cd b-gcc1-${cpu} && \ time j_gcc1 ${cpu} >${LOGDIR}/${cpu}-stage1.log 2>&1 && cd ..) || exit 1 else echo Skipping Stage 1 for ${cpu} fi #################### RTEMS j_rtems() { cpuArg=$1 bspArg=$2 bspdir=b-${cpuArg}-${bspArg} cd ${BASEDIR} rm -rf ${bspdir} mkdir ${bspdir} || exit 1 cd ${bspdir} || exit 1 case $bspArg in multilib) ENABLE_BSP="--enable-multilib" ;; qemu|pc386) ENABLE_BSP="--enable-rtemsbsp=pc386" ENABLE_BSP="${ENABLE_BSP} USE_COM1_AS_CONSOLE=1" ENABLE_BSP="${ENABLE_BSP} BSP_PRESS_KEY_FOR_RESET=0" ;; *) ENABLE_BSP="--enable-rtemsbsp=${bspArg}" ;; esac case ${cpu} in m32c) 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 -j3 && make install cd .. } if [ ${do_rtems} = "yes" ] ; then echo "Building RTEMS for ${cpu} ${bsp} ..." #time j_rtems ${cpu} multilib >${LOGDIR}/${cpu}-rtems-multilib.log 2>&1 || \ # exit 1 time j_rtems ${cpu} ${bsp} >${LOGDIR}/${cpu}-rtems-${bsp}.log 2>&1 || \ exit 1 test ${do_cleanup} = "yes" && rm -rf b-${cpu}-${bsp} b-${cpu}-multilib else echo Skipping RTEMS for ${cpu}/${bsp} fi pwd ##### Do the gcc tests if [ ${run_gcctests} = "yes" ] ; then echo "Running GCC Tests..." cd ${BASEDIR}/b-gcc1-${cpu} || exit 1 time sh -x ${SCRIPTDIR}/rundeja ${bsp} \ >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1 if [ ${do_mail} = "yes" ] ; then echo Sending test results to GCC community.. ${GCCDIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh if [ $? -ne 0 ] ; then echo "Failed to email GCC Test Results .. bailing" exit 1 fi fi cd .. || exit 1 else echo Skipping GCC DejaGNU tests for ${cpu}/${bsp} fi test ${do_cleanup} = "yes" && rm -rf b-gcc1-${cpu} ##### Build an Ada compiler now that we have a cross installed j_gcc2() { 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_ada_multilib} = yes ] ; then ada_multilib="--enable-multilib" else ada_multilib="--disable-multilib" fi # CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${bsp}/lib/ ${GCCDIR}/configure \ --enable-threads=rtems --with-gnu-as ${ada_multilib} \ --enable-newlib-mb --enable-newlib-iconv \ --with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls \ CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${bsp}/lib/ \ --enable-version-specific-runtime-libs \ --enable-languages=c,ada --target=$TARGET --prefix=$INSTALL && make -j3 && make install } if [ ${do_ada} = "yes" ] ; then echo "Building Stage 2 cross Ada compiler for ${1} ..." (cd ${BASEDIR} && \ rm -rf b-gcc2-${cpu} && \ mkdir b-gcc2-${cpu} && \ cd b-gcc2-${cpu} && \ time j_gcc2 ${cpu} >${LOGDIR}/${cpu}-stage2.log 2>&1 && cd ..) || exit 1 else echo Skipping Stage 2 Ada for ${cpu} fi #### Run the Ada ACATS tests if [ ${run_acats} = "yes" -a -d b-gcc2-${cpu} ] ; 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 [ -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 cd ../../../../.. || exit 1 else echo Skipping ACATS for ${cpu} fi if [ ${do_ada} = "yes" ] ; then test ${do_cleanup} = "yes" && rm -rf b-gcc2-${cpu} fi exit 0