#!/bin/sh
#
# A simple configuration script for XMGR-4 beta
#

MAKEDIR=Make

usage()
{
	echo Usage:
	echo   $0 \<OS_NAME\>
	echo   "     or"
	echo   $0 
	echo   "     for the available list of configurations"

}

list_all()
{
	echo
	echo Choose one of the following...
	for i in ${MAKEDIR}/*
	do
		echo 
		echo `basename $i` :
		echo 
		cat $i | grep '^#\*' | sed 's/^#/    /g'
	done
}

if [ $# -eq 0 ]
then
	list_all
	exit 0
fi

if [ $# -ne 1 ]
then
	usage
	exit 1
fi

CONFIG=$1
CONFIGFILE=${MAKEDIR}/${CONFIG}

if [ -f ${CONFIGFILE} ]
then
	ln -sf ${CONFIGFILE} Make.arch
	exit $?
else
	echo No config for \`$CONFIG\'
	echo Run \`$0\' for the list of pre-defined configurations
	exit 1
fi
