182498Sroberto#! /bin/sh 282498Sroberto 3290001SglebiusIAM=`hostname || uname -n` 4290001SglebiusMYNAME=`IFS=. ; set $IAM ; echo $1` 5290001Sglebius 6290001Sglebiuscase "$1" in 7290001Sglebius '--one'|'-1') 8290001Sglebius shift 9290001Sglebius FB_FIRSTONLY=1 10290001Sglebius LIST=$MYNAME 11290001Sglebius ;; 12290001Sglebius *) 13290001Sglebius FB_FIRSTONLY=0 14290001Sglebiusesac 15290001Sglebius 1682498SrobertoBUILD_ARGS="$@" 1782498SrobertoPARSE="--enable-parse-clocks" 1882498Sroberto#PARSE= 19182007SrobertoSTD="--enable-simulator" 2082498Sroberto 21290001Sglebiuscase "$SIMUL::$FB_FIRSTONLY" in 22290001Sglebius ::*) 23290001Sglebius PARALLEL_BUILDS=1 24290001Sglebius ;; 25290001Sglebius *::0) 26290001Sglebius PARALLEL_BUILDS=$SIMUL 27290001Sglebius ;; 28290001Sglebius *) 29290001Sglebius PARALLEL_BUILDS=1 30200576Srobertoesac 31200576Sroberto 32200576Srobertocase "$PARALLEL_BUILDS" in 33200576Sroberto 1) ;; 34200576Sroberto *) echo Launching $PARALLEL_BUILDS parallel builds on each machine 35200576Srobertoesac 36200576Sroberto 37132451Sroberto# Backroom: 38200576Sroberto# barnstable freebsd-6.1 39200576Sroberto# beauregard freebsd-6.0 40200576Sroberto# X churchy alpha-dec-osf5.1 41182007Sroberto# deacon sparc-sun-solaris2.10 42200576Sroberto# grundoon freebsd-6.2 43182007Sroberto# howland freebsd-6.1 44200576Sroberto# o macabre freebsd-6.1-STABLE 45200576Sroberto# o mort freebsd-6.1 46182007Sroberto# whimsy sparc-sun-solaris2.10 47132451Sroberto 48132451Sroberto# Campus: 49182007Sroberto# * baldwin sparc-sun-solaris2.10 50182007Sroberto# * bridgeport sparc-sun-solaris2.10 51182007Sroberto# * malarky sparc-sun-solaris2.10 52182007Sroberto# * pogo sparc-sun-solaris2.10 53182007Sroberto# * rackety freebsd-6.1 5482498Sroberto 55290001Sglebiusif [ ! -r sntp/libevent/build-aux/config.guess ] ; then 56290001Sglebius echo "Error: bootstrap required." 1>&2 && exit 1 57290001Sglebiusfi 58290001Sglebius 59200576Sroberto# HMS: we need $PWD because solaris produces /deacon/backroom when 60200576Sroberto# we are in /backroom and in general there is no /deacon/backroom. 61182007Srobertoc_d=${PWD:-`pwd`} 6282498Sroberto 6382498SrobertoSIG=`perl -e 'print rand'` 6482498Sroberto 6582498Srobertocase "$LIST" in 66290001Sglebius '') LIST="pogo" ;; 6782498Srobertoesac 6882498Sroberto 6982498Srobertofor i in $LIST 7082498Srobertodo 71200576Sroberto SKIPTHIS=0 72200576Sroberto [ -f .buildkey-$i ] && SKIPTHIS=1 73200576Sroberto case "$SKIPTHIS" in 74200576Sroberto 1) 75290001Sglebius echo flock-build running on $i? check LIST, skipping 76290001Sglebius ;; 77290001Sglebius 0) 78290001Sglebius echo $i 79290001Sglebius echo $SIG > .buildkey-$i 80290001Sglebius case "1" in 81290001Sglebius 0) 82290001Sglebius ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" & 83290001Sglebius ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS" & 84290001Sglebius ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf $BUILD_ARGS" & 85290001Sglebius ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS" & 86290001Sglebius ;; 87290001Sglebius 1) 88290001Sglebius cat > .flockbuild-$i-$SIG <<-ENDQUOT 89290001Sglebius #!/bin/sh 90200576Sroberto 91290001Sglebius # script uses job control and expects to be invoked 92290001Sglebius # in a ssh session started with the -tt option, 93290001Sglebius # which forces a pseudo-tty to be used. 94290001Sglebius 95290001Sglebius cd $c_d 96290001Sglebius COUNT=0 97200576Sroberto 98290001Sglebius ./build $SIG $PARSE $STD $BUILD_ARGS & 99200576Sroberto 100290001Sglebius COUNT=\`expr \$COUNT + 1\` 101290001Sglebius echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 102290001Sglebius [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 103200576Sroberto 104290001Sglebius case $FB_FIRSTONLY in 105290001Sglebius '0') 106290001Sglebius ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS & 107200576Sroberto 108290001Sglebius COUNT=\`expr \$COUNT + 1\` 109290001Sglebius echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 110290001Sglebius [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 111200576Sroberto 112290001Sglebius ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf $BUILD_ARGS & 113200576Sroberto 114290001Sglebius COUNT=\`expr \$COUNT + 1\` 115290001Sglebius echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 116290001Sglebius [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 117200576Sroberto 118290001Sglebius ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS & 119200576Sroberto 120290001Sglebius COUNT=\`expr \$COUNT + 1\` 121290001Sglebius echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 122290001Sglebius wait 123290001Sglebius esac 124290001Sglebius echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done. 125290001Sglebius rm .buildkey-$i 126200576SrobertoENDQUOT 127290001Sglebius chmod +x .flockbuild-$i-$SIG 128290001Sglebius ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \ 129290001Sglebius rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null & 130290001Sglebius esac 13182498Sroberto esac 13282498Srobertodone 133200576Srobertoecho `date -u '+%H:%M:%S'` flock-build launched 134