#!/bin/sh
#
# Usage: build-all path-to-source path-to-top-of-build
#
# On each target system, you need the compiler and lex to be in your path.
#
install=
nice=
while case "$1" in --*) true ;; *) false ;; esac; do
  case "$1" in
  --install) install=--install ;;
  --vault) install=--vault ;;
  --nice) nice=nice ;;
  *) echo 1>&2 Unrecognized option $1; exit 1 ;;
  esac
  shift
done

if [ $# = 0 ]; then
	progname=$0
	pts="`echo ${progname} | sed 's=/[^/]*$=='`"
	ptt=${PWD:-`pwd`}
else
	pts=$1
	ptt=$2
fi

buildkrb="cd ${ptt}; $nice ${pts}/build-krb"

#echo ==== RTL is a SPARC running SunOS 4.1.3 ====
rsh mexican -n "${buildkrb} --native --clean"
rsh mexican -n "${buildkrb} --progressive $install"
#echo ==== SETHRA is an HP snake running HP/UX 8.07 ====
#rsh sethra -n "${buildkrb} --progressive host=hppa1.1-hp-hpux8 --clean"
rsh sethra -n "${buildkrb} --native host=hppa1.1-hp-hpux8 $install"
#echo ==== ADDER is an HP snake running HP/UX 9.01 ====
#rsh adder -n "${buildkrb} --progressive host=hppa1.1-hp-hpux9 --clean"
rsh adder -n "${buildkrb} --native host=hppa1.1-hp-hpux9 $install"
#echo ==== LISA is a SPARCstation running Solaris 2.3 ====
rsh lisa -n "${buildkrb} cc=/opt/SUNWspro/bin/cc --clean"
rsh lisa -n "${buildkrb} --progressive $install"
#echo ==== URTH is a Sun 3 running SunOS 4.1.1 ====
rsh urth -n "${buildkrb} --native --clean"
rsh urth -n "${buildkrb} --progressive $install"
#echo ==== X1 is an SGI running IRIX 4.0.5H ====
rsh x1 -n "${buildkrb} --native --clean"
rsh x1 -n "${buildkrb} --progressive $install"
#echo ==== CHESTNUT is an SGI running IRIX 5.3 ====
rsh chestnut -n "${buildkrb} --native --clean"
rsh chestnut -n "${buildkrb} --progressive $install"
#echo ==== OK is a DECstation running Ultrix 4.2a ====
rsh ok -n "${buildkrb} --native --clean"
rsh ok -n "${buildkrb} --progressive $install"
#echo ==== KALESSIN is an RS/6000 running AIX 3.2.??? ====
rsh kalessin -n "${buildkrb} --native --clean"
rsh kalessin -n "${buildkrb} --progressive $install"
#echo ==== CANTH is an i386 running SCO sysv3.2 ====
rsh canth -n "${buildkrb} --native --clean"
rsh canth -n "${buildkrb} --progressive $install"
#echo ==== PHISHHEAD is an AXP alpha running OSF/1 V1.3 ====
rsh phishhead -n "${buildkrb} --native --clean"
rsh phishhead -n "${buildkrb} --latest $install"
#echo ==== SIRIUS is an i386 running Unixware 1.1.1 - SVR4.2 ====
#echo ==== run /usr/bin/cc explicitly to avoid getting the UCB version
rsh sirius -n "${buildkrb} cc=/usr/bin/cc host=i386-sysv4.2 --clean"
rsh sirius -n "${buildkrb} --latest host=i386-sysv4.2 $install"
#echo ==== TARKAS is an HP m68k running HP/UX 9.00 ====
# We prefer the native build on this platform because the native
# linker can not use the libraries generated by our tools.
#rsh tarkas -n "${buildkrb} --progressive --clean"
rsh tarkas -n "${buildkrb} --native --path=/bin $install"
# prochaine is no longer on the net
#echo ==== PROCHAINE is a NeXT cube, with no Cygnus tools. ====
#rsh prochaine -n "${buildkrb} --native host=m68k-next-bsd"
