[ dropping lots of cc, adding autoconf-patches ] Hi Eric,
* Eric Blake wrote on Sat, Feb 26, 2011 at 03:02:25PM CET: > I like the concept, although I can make it shorter. > > Autoconf's m4/m4.m4 needs a similar test. Thanks. Like this? I should note that it won't exclude a buggy m4 that the user has explicitly set by setting the M4 environment variable. It seems like a bug in AC_MSG_ERROR that I cannot use a comma in the message, with the current amount of quoting. Thanks, Ralf 2011-02-26 Ralf Wildenhues <ralf.wildenh...@gmx.de> Eric Blake <ebl...@redhat.com> Exclude M4 with buggy strstr when configuring Autoconf. * m4/m4.m4 (AC_PROG_GNU_M4): When searching PATH, do not accept an m4 that has the gnulib strstr bug. diff --git a/m4/m4.m4 b/m4/m4.m4 index a11fe0d..5aef986 100644 --- a/m4/m4.m4 +++ b/m4/m4.m4 @@ -1,4 +1,4 @@ -# m4.m4 serial 11 +# m4.m4 serial 12 # Copyright (C) 2000, 2006-2011 Free Software Foundation, Inc. @@ -25,15 +25,18 @@ AS_UNSET([POSIXLY_CORRECT]) AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4 gnum4], [dnl Creative quoting here to avoid raw dnl and ifdef in configure. # Root out GNU M4 1.4.5, as well as non-GNU m4 that ignore -t, -F. + # Root out GNU M4 1.4.13 and 1.4.14 with buggy replacement strstr. ac_snippet=change'quote(<,>)in''dir(<if''def>,mac,bug)' ac_snippet=${ac_snippet}pat'subst(a,\(b\)\|\(a\),\1)d'nl + ac_snippet=${ac_snippet}${as_nl}if'else(in''dex(..wi.d.,.d.),-1,strstr-bug)' test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \ && test -z "`AS_ECHO([$ac_snippet]) | $ac_path_M4 --trace=mac 2>&1`" \ && test -f conftest.m4f \ && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=: rm -f conftest.m4f], [AC_MSG_ERROR([no acceptable m4 could be found in \$PATH. -GNU M4 1.4.6 or later is required; 1.4.14 is recommended])])]) +GNU M4 1.4.6 or later is required; 1.4.13 or 1.4.16+ are recommended. +GNU M4 1.4.14 and 1.4.15 use a buggy strstr on some systems])])]) M4=$ac_cv_path_M4 AC_CACHE_CHECK([whether $ac_cv_path_M4 accepts --gnu], [ac_cv_prog_gnu_m4_gnu],