]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ntp/flock-build
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ntp / flock-build
1 #! /bin/sh
2
3 BUILD_ARGS="$@"
4 PARSE="--enable-parse-clocks"
5 #PARSE=
6 STD="--enable-simulator"
7
8 case "$SIMUL" in
9  '') PARALLEL_BUILDS=1
10      ;;
11  *)  PARALLEL_BUILDS=$SIMUL
12 esac
13
14 case "$PARALLEL_BUILDS" in
15  1)  ;;
16  *)  echo Launching $PARALLEL_BUILDS parallel builds on each machine
17 esac
18
19 # Backroom:
20 #   barnstable     freebsd-6.1
21 #   beauregard     freebsd-6.0
22 # X churchy        alpha-dec-osf5.1
23 #   deacon         sparc-sun-solaris2.10
24 #   grundoon       freebsd-6.2
25 #   howland        freebsd-6.1
26 # o macabre        freebsd-6.1-STABLE
27 # o mort           freebsd-6.1
28 #   whimsy         sparc-sun-solaris2.10
29
30 # Campus:
31 # * baldwin        sparc-sun-solaris2.10
32 # * bridgeport     sparc-sun-solaris2.10
33 # * cowbird        freebsd-6.1
34 # * malarky        sparc-sun-solaris2.10
35 # * pogo           sparc-sun-solaris2.10
36 # * rackety        freebsd-6.1
37
38 # HMS: we need $PWD because solaris produces /deacon/backroom when
39 # we are in /backroom and in general there is no /deacon/backroom.
40 c_d=${PWD:-`pwd`}
41
42 SIG=`perl -e 'print rand'`
43
44 case "$LIST" in
45  '') LIST="baldwin bridgeport cowbird malarky pogo rackety" ;;
46 esac
47
48 for i in $LIST
49 do
50     SKIPTHIS=0
51     [ -f .buildkey-$i ] && SKIPTHIS=1
52     case "$SKIPTHIS" in
53      1)
54         echo flock-build running on $i? check LIST, skipping
55         ;;
56      0)   
57         echo $i
58         echo $SIG > .buildkey-$i
59         case "1" in
60          0)
61             ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" &
62             ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS" &
63             ssh $i "cd $c_d ; ./build $SIG        $STD --disable-all-clocks $BUILD_ARGS" &
64             ;;
65          1)
66             cat > .flockbuild-$i-$SIG <<ENDQUOT
67 #!/bin/sh
68
69 # depends on job control and expects to be invoked under ssh -tt
70
71 cd $c_d
72 COUNT=0
73
74 ./build $SIG $PARSE $STD $BUILD_ARGS &
75
76 COUNT=\`expr \$COUNT + 1\`
77 echo $i started build \$COUNT of 4
78 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
79
80 ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS &
81
82 COUNT=\`expr \$COUNT + 1\`
83 echo $i started build \$COUNT of 4
84 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
85
86 ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS &
87
88 COUNT=\`expr \$COUNT + 1\`
89 echo $i started build \$COUNT of 4
90 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
91
92 ./build $SIG        $STD --disable-all-clocks $BUILD_ARGS &
93
94 COUNT=\`expr \$COUNT + 1\`
95 echo $i started build \$COUNT of 4
96 wait
97 echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done.
98 rm .buildkey-$i
99 ENDQUOT
100            chmod +x .flockbuild-$i-$SIG
101            ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \
102                     rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null &
103         esac
104     esac
105 done
106 echo `date -u '+%H:%M:%S'` flock-build launched