Subject: bug#65190: 30.0.50; Emacs doesn't build with `--with-mailutils` by default when mailutils is installed on macOS

From: Po Lu <[email-masked]>
Date: Thu, 10 Aug 2023 12:47:08 +0800

Mou Tong <[email-masked]> writes:

> Thx for the quick response, here is the modification:
>
> ```diff
> --- a/configure.ac
> +++ b/configure.ac
> @@ -347,8 +347,10 @@ AC_DEFUN
>    [],
>    [with_mailutils=$with_features
>     AS_IF([test "$with_mailutils" = yes],
> -     [AS_IF([test "x$XCONFIGURE" != "xandroid" \
> -             && test "$with_android" = "no"],
> +     dnl [AS_IF([test "x$XCONFIGURE" != "xandroid" \
> +     dnl         && test "$with_android" = "no"],
> +     dnl   [(movemail --version) >/dev/null 2>&1 || with_mailutils=no],
> +     [AS_IF([test "x$XCONFIGURE" != "xandroid"],
>         [(movemail --version) >/dev/null 2>&1 || with_mailutils=no],
>         [dnl Don't check for movemail if cross-compiling.
>          dnl instead, default to false.
> ```
>
> But the problem still exists.

What if you try moving:

AC_ARG_WITH([mailutils],
  [AS_HELP_STRING([--with-mailutils],
     [rely on GNU Mailutils, so that the --without-pop through --with-mailhost
      options are irrelevant; this is the default if GNU Mailutils is
      installed])],
  [],
  [with_mailutils=$with_features
   AS_IF([test "$with_mailutils" = yes],
     [AS_IF([test "x$XCONFIGURE" != "xandroid" \
             && test "$with_android" = "no"],
       [(movemail --version) >/dev/null 2>&1 || with_mailutils=no],
       [dnl Don't check for movemail if cross-compiling.
        dnl instead, default to false.
        with_mailutils=no])])])
AS_IF([test "$with_mailutils" = no],
  [with_mailutils=])

AS_IF([test x"$with_mailutils" = xyes],
  [AC_DEFINE([HAVE_MAILUTILS], [1],
     [Define to 1 if Emacs was configured with mailutils])])

AC_SUBST([with_mailutils])

AC_ARG_WITH([pop],
  [AS_HELP_STRING([--with-pop],
     [Support POP mail retrieval if Emacs movemail is used (not recommended,
      as Emacs movemail POP is insecure).  This is the default only on
      native MS-Windows and Android.])],
  [],
  dnl Enable movemail POP support on Android as GNU Mailutils is
  dnl normally unavailable on that platform.
  [AS_CASE([$host],
     [*-mingw*|*android*], [with_pop=yes],
     [with_pop=no-by-default])])
if test "$with_pop" = yes; then
   AC_DEFINE([MAIL_USE_POP])
fi
AH_TEMPLATE([MAIL_USE_POP], [Define to support POP mail retrieval.])dnl

to below:

OPTION_DEFAULT_OFF([android],[cross-compile Android application package])
OPTION_DEFAULT_ON([android-debug],[don't build Emacs as a debug package on Android])

?  Does that resolve the problem?

Thanks.