#!/bin/sh -
#
# @(#)$Id: 89f4bc3aed8766f68d843a94952eca118ada97cb $
#
# Create an empty "mkconfig.tmp" file, and run ./mkconfig.
# The user must run this ./configure script manually.
#
# Exit w/ a status of 0 on success.
# Exit w/ a status of 1 on error.
# --
# Jeffrey Allen Neitzel
#

#
# usage: ./configure [-h | etsh_binary_name tsh_binary_name]
#
# In the case of `./configure', it defaults to:
#
#        etsh_binary_name == etsh
#         tsh_binary_name ==  tsh
#

shell=/bin/sh
tmp=mkconfig.tmp
touch $tmp    || exit 1
. ./config.rc || exit 1

if test \
    X"$0" != X./configure -o \
    \( $# -eq 1 -a X"$1" = X-h \) -o \
    \( $# -eq 2 -a \( X"$1" = X-h -o X"$2" = X-h \) \) -o \
    \( $# -ne 2 -a $# -ne 0 \) ; then
	echo "usage: ./configure [-h | etsh_binary_name tsh_binary_name]" >&2
	echo >&2
	echo "In the case of \`./configure', it defaults to:" >&2
	echo >&2
	echo "       etsh_binary_name == $etsh_binary_name" >&2
	echo "        tsh_binary_name ==  $tsh_binary_name" >&2
	exit 1
fi
if test $# -eq 2 -a X"$1" != X -a X"$2" != X ; then
	$shell ./mkconfig "$1" "$2" ; status=$?
else
	# Otherwise, default to the names specified in config.rc.
	$shell ./mkconfig "$etsh_binary_name" "$tsh_binary_name" ; status=$?
fi

exit $status
