On 1/13/20 11:02 AM, Bruno Haible wrote: > I would suggest that > the particular 'case' and 'if'/'test' statements - or even the entire main body > of the configure.ac, from line 130 to line 5588 - gets wrapped in an AC_DEFUN > that gets invoked once. Thanks for the diagnosis. I came up with a simpler patch to Emacs, and installed it into Emacs master (attached). This patch doesn't solve the general problem, just this particular case. I doubt whether our collection of Emacs hackers can be induced to remember that the Autoconf macros you mentioned cannot be executed inside a shell condition, and I wouldn't be surprised if other configure scripts run into similar problems. I don't have any specific suggestion to work around this problem in Gnulib, though. PS. I vaguely recall a long discussion many years ago when we added this AC_REQUIRE-ish stuff to Autoconf. Although we did fix some major glitches, we replacing them with other glitches that live on to this day. For example, there's now this note in the Autoconf manual: Many Autoconf macros use a compiler, and thus call `AC_REQUIRE([AC_PROG_CC])' to ensure that the compiler has been determined before the body of the outermost `AC_DEFUN' macro. Although `AC_PROG_CC' is safe to directly expand multiple times, it performs certain checks (such as the proper value of `EXEEXT') only on the first invocation. Therefore, care must be used when invoking this macro from within another macro rather than at the top level (*note Expanded Before Required::). all of which I had forgotten until I read your email today.