
:	TNIX/UNIX Version
:	Keyshell Version Number 4	*/

: kshoptions

: This shell comand script isthe main controller for building a custom
: ColorKey+ script.  It determines whether, and in which order the 
: different "get" subroutines will be called.

: External variables 
:	$idir	-	The include directory where the subroutines reside.
:	$kppdefs - the file that holds "#defines" for the kpp build
: 	$kshconfig - the file that holds the configuration description
:	$setTEK - the file that holds the initialization commands
:	$shelltype -	set to _sh for Bourne, _csh for cshell

: Here are some variables that are used by this procedure.
	iunit=;			: flag set if Integration Unit used
	micro=;			: contains the uP variable set by getuP
	microname=;		: also contains uP variable set by getuP
	uPNAME=;		: Temporary variable to special case the
				: Z8000 pdb on TNIX.  The problem is that
				: the file name is different from uP variable.

: Define some system dependent variables.  UNIX is the default.
if test "$TNIX" = "yes" ; then
	ACELOC=/usr/bin/ace
	ASMLOC=/bin/\$micro/asm
	COMLOC=/bin/\$micro/\$I
	COMLOC="-f /tek/\$I/\$micro/\$I -o -f /bin/\$micro/\$I"
	HLLLOC=/usr/lib/\$uPNAME\$I
	LDELOC=/usr/bin/lde
	ROFFLOC=/bin/nroff
	SALOC=$TEKPATH/tek/bin/editsa
	landslist="pas"
	HLLlist="pdb"
else
	ASMLOC=$TEKPATH/tek/asm/\$micro/asm
	COMLOC="-f $TEKPATH/tek/\$I/\$micro/\$I"
	HLLLOC=$TEKPATH/tek/\$I/\$micro/\$I
	ICOMLOC=$TEKPATH/tek/icom40
	LDELOC=$TEKPATH/tek/\$I/lde/lde
	SALOC=$TEKPATH/tek/bin/editsa
	landslist="c pas"
	HLLlist="cdb pdb"
fi

: Determine whether to select a uP. This must be done to get the variable
: "$micro" which will be needed to determine if several TEK products
: will be used.
echo "...Please wait..."
. $idir/getuP
echo "...Please wait..."

: Determine whether user will be using an integration unit

GETIU=no
if test "$TNIX" = "yes" ; then
	GETIU=yes
else
	if test -d `eval echo $ICOMLOC` ; then
		GETIU=yes
	fi
fi

if test $GETIU = yes ; then
	. $idir/getiunit
	echo "...Please wait..."
else
	echo " o  The debug-related functions are not included." >>$kshconfig
fi

: Determine whether the user will be using a uP assembler
if test -n "$micro" -a -f `eval echo $ASMLOC` ; then
	. $idir/getasm
	echo "...Please wait..."
else
	echo " o  The assembler functions are not included." >>$kshconfig
fi

: Determine whether the user will be using a compiler
validcomp=
if test -n "$micro"
then
: Get validcomp, the set of compilers that exist on this system for $micro uP.
	for I in $landslist ; do
		if test `eval echo $COMLOC` ; then
			validcomp="$validcomp $I"
		fi
	done
fi
if test -n "$validcomp" ; then
	. $idir/getcompile
	echo "...Please wait..."
else
	echo " o  The compiler functions are not included." >>$kshconfig
fi

: determine whether the user will be using a High Level Language Debugger.
validHLL=
if test -n "$micro" -a -n "$iunit"
then
: Get validHLL, the set of HLL debugs that exist on this system for $micro uP.
	: Take care of TNIX Z8000 pdb
	if test "$TNIX" = yes ; then
		case $micro in
		[zZ]800[012])	uPNAME=z8000;;
		*)		uPNAME=$micro;;
		esac
	fi
	for I in $HLLlist ; do
		if test -f `eval echo $HLLLOC` ; then
			validHLL="$validHLL $I"
		fi
	done
fi
if test -n "$validHLL" ; then
	. $idir/getHLL
	echo "...Please wait..."
else
	echo " o  The HLL debug functions are not included." >>$kshconfig
fi

: Determine whether the user will be using LDE
validlde=
for I in $landslist ; do
		if test -f `eval echo $LDELOC` ; then
			validlde="$validlde $I"
		fi
done
if test -n "$validlde" ; then
	. $idir/getlde
	echo "...Please wait..."
else
	echo " o  The Language Directed Editors are not included." >>$kshconfig
fi
	

if test "$TNIX" = "yes" ; then
	if test -f $ACELOC ; then
		. $idir/getACE
		echo "...Please wait..."
	fi
	
	if test -f $ROFFLOC ; then
		. $idir/getnroff
		echo "...Please wait..."
	fi

	if test -f $SALOC ; then
		. $idir/getSA
		echo "...Please wait..."
	fi
	
fi
