#! /usr/bin/eval bash # # Test Driver # # test_driver CPUs|all # vfile=`dirname $0`/../VERSIONS if [ ! -r ${vfile} ] ; then echo VERSIONS file not found exit 1 fi source ${vfile} if [ ! -d ${BASEDIR} ] ; then echo Have you set the BASEDIR in VERSIONS correctly? exit 1 fi BASEDIR=`pwd` for d in ${AUTOCONF} ${AUTOMAKE} ${BINUTILSDIR} \ ${GDBDIR} ${NEWLIBDIR} ${GCCDIR} do if [ ! -d ${d} ] ; then echo "Cannot locate ${d} -- aborting" exit 1 fi done toggle() { case $1 in no) echo "yes" ;; yes) echo "no" ;; *) fatal "Unknown value to toggle ($1)" ;; esac } usage() { cat <&1 | grep -v ^cvs ./bootstrap -c ./bootstrap fi } # HELPER - Update GCC update_gcc() { cd ${GCCDIR} if [ -d .svn ] ; then grep "svn+ssh" .svn/entries >/dev/null if [ $? -eq 0 ] ; then echo "Skipping gcc update -- ssh keyed check out" else echo "Updating gcc -- anonymous check out" ./contrib/gcc_update if [ $? -ne 0 ] ; then echo "Update of GCC Failed." exit 1 fi fi fi return 0 } # HELPER - Remove all the installed previous builds clean_up() { rm -rf ${INSTALL}/* ${BSP_INSTALL}/* } install_auto() { for auto in ${AUTOCONF} ${AUTOMAKE} do cd ${auto} make distclean ./configure --prefix=${INSTALL} make all install done } install_ppl() { if [ x${PPL} != x ] ; then if [ ! -r ${INSTALL}/lib/libppl.a ] ; then echo "*** Building PPL ***" cd ${PPL} make distclean ./configure --enable-watchdog --prefix=${INSTALL} make ${MAKEJOBS} all install fi fi } # This handles GNU tools from CVS update_others() { for d in ${BINUTILSDIR} ${GDBDIR} ${NEWLIBDIR} do cd ${d} if [ -d .svn ] ; then echo "I do not update SVN for ${d}" exit 1 fi if [ -d CVS ] ; then cvs up -P 2>&1 | grep -v ^cvs fi done } build_cpu() { bsp= exitStatus=0 for cpu in $* do case $cpu in arm) bsp=edb7312 ;; avr) bsp=avrtest ;; bfin) bsp=eZKit533 ;; h8300) bsp=h8sim ;; i386) bsp=pc386 ;; lm32) bsp=lm32_evr ;; m32c) bsp=m32csim ;; m32r) bsp=m32rsim ;; m68k) bsp=uC5282 ;; mips) bsp=jmr3904 ;; powerpc) bsp=psim ;; sh) bsp=simsh1 ;; sparc) bsp=sis ;; sparc64) bsp=niagara ;; *) echo "Unknown CPU ${cpu}" exit 1 ;; esac doOne=${SCRIPTDIR}/gcc/do_one echo "Building ${cpu}/${bsp}..." echo "time sh -x ${doOne} -v -d ${basicArgs} \ ${gccgoArg} ${gcjArg} ${adaArg} ${objcArg} ${fortranArg} \ ${mailArg} ${testArg} \ ${cpu} ${bsp} >${BASEDIR}/${bsp}.log 2>&1" time sh -x ${doOne} -v -d ${basicArgs} \ ${gccgoArg} ${gcjArg} ${adaArg} ${objcArg} ${fortranArg} \ ${mailArg} ${testArg} \ ${cpu} ${bsp} >${BASEDIR}/${bsp}.log 2>&1 echo $? done stopped=`date` echo Started at: ${start} echo Stopped at: ${stopped} } if [ ${doCleanInstallPoint} = "yes" ] ; then # Clean the install point clean_up fi # Update gcc and install autotools in parallel if [ ! -r ${INSTALL}/bin/autoconf ] ; then install_auto fi if [ ${doUpdateTools} = "yes" ] ; then update_gcc update_others fi if [ ! -r ${INSTALL}/lib/libppl.a ] ; then install_ppl fi wait # Do any remaining prep work in parallel if [ ${doUpdateRTEMS} = "yes" ] ; then update_rtems fi wait do_cpus=yes if [ ${doNative} = "yes" ]; then # Build the native compiler as a baseline to build the others time sh -x ${SCRIPTDIR}/gcc/do_one -n >${BASEDIR}/native.log 2>&1 if [ $? -ne 0 ] ; then do_cpus=no fi fi # Now cycle over all these CPUs if [ ${do_cpus} = yes ] ; then for cpu in ${CPUs} do build_cpu ${cpu} done fi stopped=`date` echo Started at: ${start} echo Stopped at: ${stopped}