+AC_DEFUN(NMH_PROG_GNU_LIBTOOL, [
+if test -n "$LIBTOOL" ; then
+ tmptest=`$LIBTOOL --version 2>&1 | grep GNU`
+ if test x"$tmptest" != x ; then
+ GNU_LIBTOOL=1
+ AC_SUBST(GNU_LIBTOOL)dnl
+ fi
+fi
+] )
+
+echo "configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION"
+AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl
+
+dnl What date of nmh are we building?
+DATE=`cat ${srcdir}/DATE`
+echo "configuring for nmh dated $DATE"
+AC_SUBST(DATE)dnl
+
+dnl --------------------------
+dnl CHECK COMMAND LINE OPTIONS
+dnl --------------------------
+
+dnl Do you want client-side support for apop?
+AC_ARG_ENABLE(apop, AS_HELP_STRING([--enable-apop],
+ [enable client-side support for POP3 and APOP]))
+if test x"$enable_apop" = x"yes"; then
+ AC_DEFINE(APOP, 1,
+ [Define to compile client-side support for apop into inc and msgchk.])dnl
+ APOPLIB=md5.o
+ enable_pop=yes
+fi
+AC_SUBST(APOPLIB)dnl
+
+dnl Do you want to debug nmh?
+AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug],[enable nmh code debugging]))
+dnl The old redundant --enable-nmh-debug is deprecated and undocumented.
+if test x"$enable_nmh_debug" = x"yes"; then
+ enable_debug=yes
+fi
+
+dnl Allow users to send email from addresses other than their default?
+AC_ARG_ENABLE(masquerade,
+ AS_HELP_STRING([--enable-masquerade='draft_from mmailid username_extension'],
+ [enable up to 3 types of address masquerading]),
+ [if test x"$enable_masquerade" = x"yes"; then
+ masquerade="draft_from mmailid username_extension"
+ else
+ masquerade="$enable_masquerade"
+ fi],
+ masquerade="draft_from mmailid username_extension")
+AC_SUBST(masquerade)dnl
+
+dnl Do you want mhe support?
+AC_ARG_ENABLE(mhe,
+ AS_HELP_STRING([--disable-mhe],[disable mhe support]))
+
+dnl mhe support is on by default, so define it unless --disable-mhe or the
+dnl deprecated, undocumented --disable-nmh-mhe are specified.
+if test x"$enable_mhe" != x"no" -a x"$enable_nmh_mhe" != x"no"; then
+ AC_DEFINE(MHE, 1,
+ [Define to compile in support for the Emacs front-end mh-e.])dnl
+fi
+
+dnl Do you want client-side support for pop?
+AC_ARG_ENABLE(pop,
+ AS_HELP_STRING([--enable-pop], [enable client-side support for plain POP3]))
+dnl The old redundant --enable-nmh-pop is deprecated and undocumented.
+if test x"$enable_nmh_pop" = x"yes"; then
+ enable_pop=yes
+fi
+
+dnl Do you want to disable use of locale functions
+AH_TEMPLATE([LOCALE],
+[Undefine if you don't want locale features. By default this is defined.])
+AC_ARG_ENABLE([locale],
+AC_HELP_STRING([--disable-locale], [turn off locale features]),
+[if test x$enableval = xyes; then
+ AC_DEFINE(LOCALE)
+fi],
+AC_DEFINE(LOCALE)
+)
+
+dnl Do you want client-side support for using SASL for authentication?
+dnl Note that this code will be enabled for both POP and SMTP
+AC_ARG_WITH(cyrus-sasl, AS_HELP_STRING([--with-cyrus-sasl],
+ [Enable SASL support via the Cyrus SASL library]))
+if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then
+ AC_DEFINE(CYRUS_SASL, 1,
+ [Define to use the Cyrus SASL library for authentication of POP and SMTP.])dnl
+ if test x"$with_cyrus_sasl" != xyes; then
+ AC_MSG_WARN([Arguments to --with-cyrus-sasl now ignored])
+ AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS])
+ fi
+ sasl_support=yes