#! /bin/sh
echo "/* config.h, automatically generated by Configure. */" > config.h
echo -n "Enter the TCP-Port to use -- it is recommended to use the default [26741] "
read PORT
echo -n "#define PORT " >> config.h
if [ -z "$PORT" ];
then
  PORT=26741
fi
echo $PORT >> config.h
echo -n "Enter the retry-delay (option -w) in milliseconds [100] "
read RETRYTIME
echo -n "#define RETRYTIME " >> config.h
if [ -z "$RETRYTIME" ];
then
	RETRYTIME=100
fi
echo $RETRYTIME >> config.h
echo -n "Do you want run-time debug informations? [n] "
read DEBUG
if [ "$DEBUG" = "" ]
then
	DEBUG=n
fi
if [ "$DEBUG" = "n" ]
then
	echo "#undef CONF_DEBUG" >> config.h
else
	if [ "$DEBUG" = "y" ]
	then
		echo "#define CONF_DEBUG" >> config.h
	else
		echo "Configure: Error: Please answer y or n."
		rm -f config.h
		exit
	fi
fi
echo "#define C_USER \""`whoami`\" >> config.h
#echo `whoami`\" >> config.h
echo "#define C_HOST \""`uname -mnrs`\" >> config.h
echo "#define C_TIME \""`date`\" >> config.h
echo -n Configured for port $PORT with $RETRYTIME msecs -w-delay and with
if [ "$DEBUG" = "n" ]
then
	echo -n out
fi
echo " debug-information."
echo Now do a 'make' or 'make all' for just getting the executables,
echo or run 'make install' to get sping/spingd installed.
