#! /bin/sh

# Usage: $0 `pwd` src

# Arrange that Config is set up.

case "$2" in
/*)	dir="$2";;
*)	dir="$1/$2";;
esac

case "`cd $dir; echo Config.*`" in
Config.local.dist|"Config.local Config.local.dist")	exit 0;;
esac

echo ""
echo "Config is the file that decides a number of the tailoring options to do"
echo "with building and installing xntp3. There are a number of files which"
echo "are pre-built for 'standard' operating systems. It is easiest to choose"
echo "one of these. The list is"
set `cd $dir; echo Config.*`
echo "$@"

case "`uname -s`++`uname -r`" in
SunOS++5*)	os=solaris;;
SunOS++4*)	os=sun;;
esac

case "$os" in
'')	echo "Which do you want: "
	read os || exit 1
	case "$os" in
	'')	echo ""
		echo "No default config found -- exiting"
		echo ""
		exit 1;;
	esac
	;;
*)	echo ""
	echo "Assuming you want $os"
	echo ""
	;;
esac

if	test -r $dir/$os
then	cp $dir/$os $dir/Config
elif	test -r $dir/Config.$os
then	cp $dir/Config.$os $dir/Config
else	echo Sorry -- $os not found in $dir.
	exit 1;
fi
