#! /bin/csh -f
############################################################################
#
# MODULE:  setup
#
############################################################################
#
# Abstract:
#    This is the main command file to configure the system. Three
#    versions of the system are available: ENCORE, VAX, and UNIPROC.
#    The command file is invoked with one argument:
#            setup <version>
#    where <version> is one of the above three. This will result in
#    the correct version dependent setup being selected to configure
#    the system.
#
############################################################################
#
# CParaOPS5
# Change Log:
#    29 Sep 89 V5.2  Anurag Acharya
#                    Created the file.
#
# Copyright (c) 1989 Carnegie-Mellon University
# All rights reserved.  The CMU software License Agreement
# specifies the terms and conditions for use and redistribution.
#
############################################################################

if ($1 == "") then
	echo "Usage: setup <version>"
	echo "Currently three values are allowed for <version>: ENCORE, VAX and UNIPROC"
	echo "Aborting.................Please execute the setup command again."
 	exit
endif

if (($1 != ENCORE) && ($1 != VAX) && ($1 != UNIPROC)) then
	echo "Usage: setup <version>"
	echo "Currently three values are allowed for <version>: ENCORE, VAX and UNIPROC"
	echo "There is no $1 version"
	echo "Aborting.................Please execute the setup command again."
	exit
endif

echo ""
echo "We will soon compile the CParaOPS5 compiler and runtime library."
echo "If you want to specify a list of any of your own C compiler"
echo "options, you should enter them now. Please enter your list of"
echo -n "options now or type a <CR> if you have none: "

set ans = ($<)

if ($ans != "") then
	echo ""
	echo "Setting environment variable CFLAGS to $ans to provide your options to the C compiler "
	echo "    setenv CFLAGS $ans"
	setenv CFLAGS $ans
endif

echo ""
echo "Change directories and invoke the command file to configure the system."
echo "    cd lib"
cd lib
echo "    chmod u+x setup.$1"
chmod u+x setup.$1
echo "    setup.$1"
setup.$1	

echo "OK, you should be ready to go."
