--- /dev/null
+#! /bin/bash
+
+MACHINES=${MACHINES:-\
+ graal.ens-lyon.fr allo-psmn.ens-lyon.fr \
+ valnure.cs.ucsb.edu sperm.cs.ucsb.edu basalt.cs.ucsb.edu \
+ nala.cs.utk.edu AIX}
+
+# ACTIONS: What to do there
+# possible values:
+# - scp: copy a tarball over
+# - rsync: rsync the source (rsync must be installed remotely)
+#
+# - clean: erase any previously existing source tree and
+# open the new open
+# - untar: open the tarball which was just copied
+# - touch: touch every file of the source tree to deal with
+# clock brokenness. May help, may harm.
+# - config: launch configure
+# - compile: run 'make'
+# - install: run 'make install'
+# - check: run 'make check'
+#
+# default value:
+ACTIONS=${ACTIONS:-scp clean untar config compile check}
+
+REMOTE_PREFIX=${REMOTE_PREFIX:-simgrid}
+
+###
+### End of configuration. You shouldn't change anything below
+###
+
+srcdir=`echo "@srcdir@"|./config.status --file=-:-`
+PACKAGE=`echo "@PACKAGE@"|./config.status --file=-:-`
+VERSION=`echo "@VERSION@"|./config.status --file=-:-`
+
+echo;echo "----[ Recompile the package on remote hosts ]----"
+test -e $srcdir/buildlogs/${PACKAGE}-${VERSION} || mkdir -p ${srcdir}/buildlogs/${PACKAGE}-${VERSION}
+failed=0;
+ for site in ${MACHINES} ; do
+ machine=`echo $site |sed 's/^\([^%]*\)%.*$/\1/'`;
+ machine2=`echo $site |sed 's/^\([^%]*\)%\(.*\)$/\2/'`;
+ cmd="\"sh -c 'env REMOTE_PREFIX=${REMOTE_PREFIX} ${REMOTE_PREFIX}/src/graspe-slave ${ACTIONS} 2>&1'\"";
+ if echo $site | grep '%' >/dev/null ; then
+ echo "----[ Compile on $machine2 (behind $machine) ]----";
+ else
+ machine=$site;
+ echo "----[ Compile on $machine ]----";
+ fi;
+
+ ##
+ ## Source diffusion
+ ##
+
+ if echo ${ACTIONS} | grep -q scp ; then
+ echo "-- Copy the data over";
+ [ -e ${srcdir}/${PACKAGE}-${VERSION}.tar.gz ] || make -C ${srcdir} dist
+ scp ${srcdir}/${PACKAGE}-${VERSION}.tar.gz tools/graspe-slave \
+ $machine:${REMOTE_PREFIX}/src;
+ else if echo ${ACTIONS} | grep -q rsync ; then
+ echo "-- Rsync the data over";
+ [ -e ${srcdir}/${PACKAGE}-${VERSION} ] || make -C ${srcdir} distdir
+ rsync -t -r ${srcdir}/${PACKAGE}-${VERSION} tools/graspe-slave $machine:${REMOTE_PREFIX}/src/
+ fi fi
+
+ ##
+ ## Compilation
+ ##
+
+ echo "-- Compiling... (the output gets into ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)";
+ if echo $site | grep '%' >/dev/null ; then
+ if ssh $machine "env REMOTE_PREFIX=${REMOTE_PREFIX} ssh -A $machine2 $cmd" 2>&1 > ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log;
+ then echo "Sucessful"; else failed=1;echo "Failed (check ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)"; fi;echo;
+ else
+ if ssh $machine "eval $cmd" 2>&1 > ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log ;
+ then echo "Sucessful"; else failed=1;echo "Failed (check ${srcdir}/buildlogs/${PACKAGE}-${VERSION}/$site.log)"; fi;echo;
+ fi;
+done;
+${srcdir}/tools/compile-stats;
+exit $failed