#! /bin/csh
#
# (c) 1993  Sandiway Fong, NEC Research Institute, Inc.
#

# Takes one arguments: the Quintus Prolog home directory
if ( $#argv == 0 ) then
	echo 'Quintus Prolog home directory missing\!'
	exit 1
else if ( $#argv == 1 ) then
	if ( $1 == '-help' || $1 == '-h' ) then
		echo 'Usage: Configure target-directory [executable]'
		exit 1
	else
		set target='Pappi'
	endif
else if ( $#argv == 2 ) then
	set target=$2
else 	
	echo 'Too many arguments\!'
	echo 'Usage: Configure target-directory [executable]'
	exit 1
endif

#
set qhome=$1

if ( -e ${qhome}/bin3.1.4  ) then
	set qbin=${qhome}/bin3.1.4/sun4-4	
	echo 'Quintus Prolog 3.1.4'
else	
	set qbin=${qhome}/bin3.1.1/sun4-4.1	
	echo 'Quintus Prolog 3.1.1'
endif

${qbin}/qsetpath -r${qbin} -q${qhome} ${target}
${qbin}/qgetpath ${target}
${qbin}/qsetpath -r${qbin} -q${qhome} pappiSlave
# ${qbin}/qsetpath -r${qbin} -q${qhome} tokenServer

exit 0
