#! /bin/sh

quick_fwd=
for arg
do
  case "$arg" in
    -help | --help | --hel | --he)
      quick_fwd=yes
      break ;;
    -version | --version | --versio | --versi | --vers)
      quick_fwd=yes
      break ;;
    *)
      break ;;
  esac
done
if test "x$quick_fwd" = xyes
then
  support/configure $*
else
  echo "retrieving the system name, type and OS release..."
  rev=`support/config.guess`
  echo "  your system seems to be ${rev}."
  if test ! -d "${rev}"
  then
    echo "creating directory ${rev}..."
    mkdir "${rev}"
  fi
  cd "${rev}"
  echo "now working in directory ${rev}..."
  cp -p ../support/configure .
#  if test ! -f config.h
#  then
#    echo "copying config.h from config.h.dist..."
#    cp -p ../support/config.h.dist config.h
#  fi
  ./configure $*
  if test $? = 0
  then
    echo "Have you read doc/README? (I hope so)"
    echo "Next cd ${rev}, edit \"config.h\","
    echo "run \"make all\" to build and \"make install\" to install."
  fi
fi
