#! /bin/sh # # PARALLEL - Test build all the tool configurations # # Requires GNU parallel to be installed # # TODO: # + command line for dry-run enable/di # + specify list of targets to build # + add ssh support for spreading builds across multiple computers # # Checks the status returned by executables and exits if it is non-zero. check_fatal() { if [ $1 -eq 0 ] ; then return fi shift echo "ERROR: $*" >&2 exit $? } 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 for d in ${AUTOCONF} ${AUTOMAKE} ${BINUTILSDIR} \ ${GDBDIR} ${NEWLIBDIR} ${GCCDIR} do if [ ! -d ${d} ] ; then check_fatal 1 "Cannot locate ${d} -- aborting" fi done toggle() { case $1 in no) echo "yes" ;; yes) echo "no" ;; *) fatal "Unknown value to toggle ($1)" ;; esac } parallel --version 2>&1 | grep "GNU Parallel" >/dev/null check_fatal $? "GNU parallel is not installed" usage() { cat <${LOGDIR}/autoconf.log 2>&1 check_fatal ${status} "*** Failed to build and install ${AUTOCONF}" cd ${BASEDIR}/${AUTOMAKE} && \ (./configure --prefix=${INSTALL} && make && make install) \ >${LOGDIR}/autoconf.log 2>&1 check_fatal ${status} "*** Failed to build and install ${AUTOMAKE}" # We can bootstrap RTEMS and build a native compiler in parallel parallel --verbose ${JOBS} ${dryrun} <${LOGDIR}/bootstrap.log 2>&1 ${SCRIPTDIR}/gcc/do_one -n EOF status=$? check_fatal ${status} "*** ${status} steps failed during preparation phase" fi start=`date` #### Tool Building if [ ${do_tools} = "yes" ] ; then test ${verbose} = "yes" && echo "*** Building Tools" args="" if [ ${do_tests} = "yes" ] ; then args="${args} -T" fi echo " Clean On OK Build: " ${do_cleanOnExit} if [ ${do_cleanOnExit} = "yes" ] ; then args="${args} -d" fi parallel --verbose ${JOBS} ${dryrun} <