AC_PREREQ(2.5)
AC_INIT(send-pr.sh)

AC_ARG_WITH(organization,
[  --with-organization=name	Sets the default organization to NAME])
AC_ARG_WITH(submitter,
[  --with-submitter=name	Sets the default submitter to NAME])

AC_PROG_INSTALL

AC_SUBST(DEFAULT_RELEASE)dnl
AC_SUBST(DEFAULT_ORGANIZATION)dnl
AC_SUBST(SUBMITTER)dnl
AC_SUBST(ECHON)dnl

AM_PATH_LISPDIR

AC_ECHON
AC_PASSWD

AC_CHECK_PROG(MKTEMP, mktemp, yes, no)

SUBMITTER=unknown
DEFAULT_ORGANIZATION=unknown

AC_MSG_CHECKING(for --with-submitter)
if test -n "$with_submitter" ; then
    AC_MSG_RESULT($with_submitter)
    SUBMITTER="$with_submitter"
else
    AC_MSG_RESULT(default to unknown)
fi

AC_MSG_CHECKING(for --with-organization)
if test -n "$with_organization" ; then
    AC_MSG_RESULT($with_organization)
    DEFAULT_ORGANIZATION="$with_organization"
else
    AC_MSG_RESULT(default to unknown)

fi


if test -f ${srcdir}/../release-info ; then
	DEFAULT_RELEASE=`. ${srcdir}/../release-info ; echo ${RELEASE_TAG}`
else
	DEFAULT_RELEASE='gnats-$(VERSION)'
fi

if test "x$prefix" != xNONE; then
  GNATS_PREFIX=$prefix
else
  GNATS_PREFIX=$ac_default_prefix
fi

# If the config file exists, it may have more recent info than send-pr

if test -n "$verbose"; then
	echo "	setting SUBMITTER to $SUBMITTER"
	echo "	setting DEFAULT_RELEASE to $DEFAULT_RELEASE"
	echo "	setting DEFAULT_ORGANIZATION to $DEFAULT_ORGANIZATION"
	echo "	setting MAIL_AGENT to $MAIL_AGENT"
fi

AC_OUTPUT(Makefile)
