The documentation in autoconf says:

 — Macro: AC_ARG_WITH(PACKAGE, HELP-STRING, [ACTION-IF-GIVEN],
          [ACTION-IF-NOT-GIVEN])
     If the user gave ‘configure’ the option ‘--with-PACKAGE’ or
     ‘--without-PACKAGE’, run shell commands ACTION-IF-GIVEN.  If
     neither option was given, run shell commands ACTION-IF-NOT-GIVEN.

This means the third parameter is evaluatated in both cases:
--with-bundled-regex and --without-bundled-regex.
And thus the code was incorrectly turning mutt_cv_regex on for both
cases, skipping the broken regex test further below.

Fix it to properly set mutt_cv_regex.  Further below, configure will
check the built-in system regex works if the value is 'no'.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 78a58963..1b864dcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -463,7 +463,7 @@ AC_CHECK_FUNCS(fchdir, , [mutt_cv_fchdir=no])
 
 AC_ARG_WITH(bundled-regex,
         AS_HELP_STRING([--with-bundled-regex],[Use the bundled GNU regex 
library]),
-        [mutt_cv_regex=yes],
+        [mutt_cv_regex=${withval}],
         [AC_CHECK_FUNCS(regcomp, mutt_cv_regex=no, mutt_cv_regex=yes)])
 
 if test $mutt_cv_regex = no ; then
-- 
2.54.0

Reply via email to