#!/bin/sh

while :
do
	echo "The libraries will end up in the machine-independent part of the
ACK binary tree. You may already have them from a previous ACK installation
on a different machine, in particular if you have an NFS file system.
Therefore, it may not be neccessary to install them again. As this part
of the ACK installation takes the most time, you are given the opportunity
to disable installation of the machine-independent part"
	echo $E_FLAG \
	"Do you want to install the machine-independent part? (y/n) [$DO_MACHINE_INDEP] $E_SFX"
	. $FDIR/get_answer
	case $ANS in
	'')	ANS="$DO_MACHINE_INDEP" ;;
	esac
	case X$ANS in
	Xj*|Xy*|X)	DO_MACHINE_INDEP=y
		echo "machine-independent part will be installed"
		echo
		break
		;;
	Xn*)	DO_MACHINE_INDEP=n
		echo "machine-independent part will not be installed"
		echo
		break
		;;
	*)	echo "I do not understand your answer ($ANS). Try again."
		;;
	esac
done
OLD_DIS_LANG="$DISABLE_LANG"
DISABLE_LANG=
case X$OLD_DIS_LANG in
X)	;;
*)	set $OLD_DIS_LANG
	;;
esac
for i in Modula-2 Pascal Occam Basic ANSI-C C Fortran
do
    DEF=y
    if [ $# != 0 -a X$i = X$1 ]
    then
	DEF=n
	shift
    fi
    while :
    do
	echo $E_FLAG "Do you want to install $i? (y/n) [$DEF] $E_SFX"
	. $FDIR/get_answer
	case $ANS in
	'')	ANS="$DEF";;
	esac
	case X$ANS in
	Xj*|Xy*)
		echo "$i will be installed"
		echo
		break
		;;
	Xn*)	DISABLE_LANG=$DISABLE_LANG" $i"
		echo "$i will not be installed"
		echo
		break
		;;
	*)	echo "I do not understand your answer ($ANS). Try again."
		;;
	esac
    done
done
OLD_DIS_SUP="$DISABLE_SUP"
DISABLE_SUP=
set $MACH_LIST
while test $# != 0
do
    DEF=y
    for i in $OLD_DIS_SUP
    do
	if [ X$i = X$1 ]
	then
		DEF=n
		break
	fi
    done
    while :
    do
	case $1 in
	i86)	echo "not installing i86 will disable installation of xenix3 and minix."
		;;
	m68k2)	echo "not installing m68k2 will disable installation of pmds, minixST,
m68k4, pmds4, sun2, and mantra."
		;;
	m68k4)	echo "not installing m68k4 will disable installation of pmds4, sun2, and mantra."
		;;
	m68020)	echo "not installing m68020 will disable installation of sun3."
		;;
	esac
	echo $E_FLAG "Do you want to install the $1 support? (y/n) [$DEF] $E_SFX"
	. $FDIR/get_answer
	case $ANS in
	'')	ANS="$DEF";;
	esac
	case X$ANS in
	Xj*|Xy*)
		echo "The $1 support will be installed"
		echo
		case $1 in
		vax4)	case $SYSNAME in
			vax_bsd4_1a)	SYSVAX=libbsd4_1a
					;;
			vax_bsd4_2)	SYSVAX=libbsd4_2
					;;
			vax_sysV_2)	SYSVAX=libsysV_2
					;;
			*)		if [ $DO_MACHINE_INDEP = y ]
					then
						. $FDIR/get_sysvax
					fi
					;;
			esac
			;;
		sparc)	shift
			;;
		esac
		break
		;;
	Xn*)	DISABLE_SUP=$DISABLE_SUP" $1"
		echo "The $1 support will not be installed"
		echo
		case $1 in
		i86)
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			;;
		m68k2)
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			;;
		m68k4)
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			;;
		sparc)
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			;;
		m68020)
			shift
			DISABLE_SUP=$DISABLE_SUP" $1"
			;;
		esac
		break
		;;
	*)	echo "I do not understand your answer ($ANS). Try again."
		;;
	esac
    done
    shift
done

if [ $TARGET_HOME = $UTIL_HOME ] 
then
	case $ACM in
	sun3|m68020|i386|vax*)
		while :
		do
			echo $E_FLAG "Do you want to install the fast compilers? (y/n) [$DO_FAST] $E_SFX"
        		. $FDIR/get_answer
        		case $ANS in
        		'')     ANS="$DO_FAST" ;;
        		esac
        		case X$ANS in
        		Xj*|Xy*)
				DO_FAST=y
				echo "The fast compilers will be installed"
				break
				;;
			Xn*)
				DO_FAST=n
				echo "The fast compilers will not be installed"
				break
				;;
			*)	echo "I do not understand your answer ($ANS). Try again."
				;;
			esac
		done
		;;
	*)
		DO_FAST=n
		;;
	esac
else
	DO_FAST=n
fi