configure oddity

Message ID
State New
Headers show

Commit Message

Ralf Wildenhues Feb. 28, 2011, 6:38 a.m.
* Mike Stump wrote on Sun, Feb 27, 2011 at 11:40:42PM CET:
> On Feb 26, 2011, at 4:07 AM, Ralf Wildenhues wrote:
> > How about this patch to diagnose such issues early (test case taken from
> > gnulib)?
> For mere users and developers, they don't ever need to run autoconf,
> and so, no requirement?

Correct.  The patch doesn't change anything for users that do not run

> I only had to as I was editing a
> file, and wanted to regenerate.  Maybe we don't want to bother most
> uses and developers...  though, that said, I don't have the maintainer
> mode enable to re-generate, but instead was just running my hand, so
> if we conditionalize the check on the type of user, we might miss
> some.

This patch doesn't change at all the semantics of whether you need to
run autoconf or not.  Only when you run it, no matter whether triggered
by make or run manually, it diagnoses buggy m4 versions.

More compact patch based on Eric's feedback below.


Guard against M4 versions with a buggy strstr.

2011-02-26  Ralf Wildenhues  <...>
	    Eric Blake  <...>

	* override.m4: Error out if a buggy M4 was detected, to
	avoid spurious diffs in generated files.


diff --git a/config/override.m4 b/config/override.m4
index fc2d527..4f3b9ae 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -48,6 +48,12 @@  _GCC_AUTOCONF_VERSION_CHECK
+dnl Ensure we do not use a buggy M4.
+m4_if(m4_index([..wi.d.], [.d.]), [-1],
+  [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
+GNU M4 < 1.4.14 or > 1.4.15 and set the M4 environment variable]))])
 dnl Fix 2.64 cross compile detection for AVR and RTEMS
 dnl by not trying to compile fopen.
 m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64],