1 1.1 kardel #! /bin/sh 2 1.1 kardel 3 1.1 kardel IAM=`hostname || uname -n` 4 1.1 kardel MYNAME=`IFS=. ; set $IAM ; echo $1` 5 1.1 kardel 6 1.1 kardel case "$1" in 7 1.1 kardel '--one'|'-1') 8 1.1 kardel shift 9 1.1 kardel FB_FIRSTONLY=1 10 1.1 kardel LIST=$MYNAME 11 1.1 kardel ;; 12 1.1 kardel *) 13 1.1 kardel FB_FIRSTONLY=0 14 1.1 kardel esac 15 1.1 kardel 16 1.1 kardel BUILD_ARGS="$@" 17 1.1 kardel PARSE="--enable-parse-clocks" 18 1.1 kardel #PARSE= 19 1.1 kardel STD="--enable-simulator" 20 1.1 kardel 21 1.1.1.2 kardel case "$SIMUL::$FB_FIRSTONLY" in 22 1.1.1.2 kardel ::*) 23 1.1.1.2 kardel PARALLEL_BUILDS=1 24 1.1.1.2 kardel ;; 25 1.1.1.2 kardel *::0) 26 1.1.1.2 kardel PARALLEL_BUILDS=$SIMUL 27 1.1.1.2 kardel ;; 28 1.1.1.2 kardel *) 29 1.1.1.2 kardel PARALLEL_BUILDS=1 30 1.1 kardel esac 31 1.1 kardel 32 1.1 kardel case "$PARALLEL_BUILDS" in 33 1.1 kardel 1) ;; 34 1.1 kardel *) echo Launching $PARALLEL_BUILDS parallel builds on each machine 35 1.1 kardel esac 36 1.1 kardel 37 1.1 kardel # Campus: 38 1.1 kardel # * baldwin sparc-sun-solaris2.10 39 1.1 kardel # * bridgeport sparc-sun-solaris2.10 40 1.1 kardel # * pogo sparc-sun-solaris2.10 41 1.1.1.4 christos # * rackety sparc-sun-solaris2.10 42 1.1 kardel 43 1.1.1.3 christos if [ ! -r sntp/libevent/build-aux/config.guess ] ; then 44 1.1.1.3 christos echo "Error: bootstrap required." 1>&2 && exit 1 45 1.1.1.3 christos fi 46 1.1.1.3 christos 47 1.1 kardel # HMS: we need $PWD because solaris produces /deacon/backroom when 48 1.1 kardel # we are in /backroom and in general there is no /deacon/backroom. 49 1.1 kardel c_d=${PWD:-`pwd`} 50 1.1 kardel 51 1.1 kardel SIG=`perl -e 'print rand'` 52 1.1 kardel 53 1.1 kardel case "$LIST" in 54 1.1.1.3 christos '') LIST="pogo" ;; 55 1.1 kardel esac 56 1.1 kardel 57 1.1 kardel for i in $LIST 58 1.1 kardel do 59 1.1 kardel SKIPTHIS=0 60 1.1 kardel [ -f .buildkey-$i ] && SKIPTHIS=1 61 1.1 kardel case "$SKIPTHIS" in 62 1.1 kardel 1) 63 1.1.1.2 kardel echo flock-build running on $i? check LIST, skipping 64 1.1.1.2 kardel ;; 65 1.1.1.2 kardel 0) 66 1.1.1.2 kardel echo $i 67 1.1.1.2 kardel echo $SIG > .buildkey-$i 68 1.1.1.2 kardel case "1" in 69 1.1.1.2 kardel 0) 70 1.1.1.2 kardel ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" & 71 1.1.1.4 christos ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --disable-debugging --disable-saveconfig $BUILD_ARGS" & 72 1.1.1.4 christos ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf --enable-leap-smear $BUILD_ARGS" & 73 1.1.1.3 christos ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS" & 74 1.1.1.2 kardel ;; 75 1.1.1.2 kardel 1) 76 1.1.1.2 kardel cat > .flockbuild-$i-$SIG <<-ENDQUOT 77 1.1 kardel #!/bin/sh 78 1.1 kardel 79 1.1 kardel # script uses job control and expects to be invoked 80 1.1 kardel # in a ssh session started with the -tt option, 81 1.1 kardel # which forces a pseudo-tty to be used. 82 1.1 kardel 83 1.1 kardel cd $c_d 84 1.1 kardel COUNT=0 85 1.1 kardel 86 1.1 kardel ./build $SIG $PARSE $STD $BUILD_ARGS & 87 1.1 kardel 88 1.1 kardel COUNT=\`expr \$COUNT + 1\` 89 1.1 kardel echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 90 1.1 kardel [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 91 1.1 kardel 92 1.1 kardel case $FB_FIRSTONLY in 93 1.1 kardel '0') 94 1.1.1.4 christos ./build $SIG $PARSE $STD --disable-debugging --disable-saveconfig $BUILD_ARGS & 95 1.1 kardel 96 1.1 kardel COUNT=\`expr \$COUNT + 1\` 97 1.1 kardel echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 98 1.1 kardel [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 99 1.1 kardel 100 1.1.1.4 christos ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf --enable-leap-smear $BUILD_ARGS & 101 1.1 kardel 102 1.1 kardel COUNT=\`expr \$COUNT + 1\` 103 1.1 kardel echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 104 1.1 kardel [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait 105 1.1 kardel 106 1.1.1.3 christos ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS & 107 1.1 kardel 108 1.1 kardel COUNT=\`expr \$COUNT + 1\` 109 1.1 kardel echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 110 1.1 kardel wait 111 1.1 kardel esac 112 1.1 kardel echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done. 113 1.1 kardel rm .buildkey-$i 114 1.1 kardel ENDQUOT 115 1.1.1.2 kardel chmod +x .flockbuild-$i-$SIG 116 1.1.1.2 kardel ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \ 117 1.1.1.2 kardel rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null & 118 1.1.1.2 kardel esac 119 1.1 kardel esac 120 1.1 kardel done 121 1.1 kardel echo `date -u '+%H:%M:%S'` flock-build launched 122