Index: autoconf.in =================================================================== RCS file: /cvs/autoconf/autoconf.in,v retrieving revision 1.124 diff -u -u -r1.124 autoconf.in --- autoconf.in 2001/06/23 22:58:54 1.124 +++ autoconf.in 2001/07/06 12:11:28 @@ -115,11 +115,20 @@ ;; esac + +# Find a good AWK. +: address@hidden@} +if echo foo | $AWK '/foo|^bar$/ { print }' | grep foo >/dev/null; then :; else + echo "$me: the regex engine of $AWK is too broken to be used" >&2 + echo "$me: you might want to install GNU AWK" >&2 + exit 1 +fi + + # Variables. : address@hidden@}} test -z "$AC_ACLOCALDIR" && AC_ACLOCALDIR=`(aclocal --print-ac-dir) 2>/dev/null` -: address@hidden@} debug=false # Trace Autoconf's initialization? initialization=false Index: configure.in =================================================================== RCS file: /cvs/autoconf/configure.in,v retrieving revision 1.52 diff -u -u -r1.52 configure.in --- configure.in 2001/06/28 15:53:38 1.52 +++ configure.in 2001/07/06 12:11:29 @@ -21,8 +21,13 @@ # a AC-SUBST inside AC-PROG-GNU-M4. Grmph! AC_SUBST(M4) -# `autoconf' and `ifnames' use AWK. +# `autoconf' and `ifnames' use AWK. And we need decent RE support. AC_PROG_AWK +# Some AWK fail +if echo foo | $AWK '/foo|^bar$/ { print }' | grep foo >/dev/null; then :; else + AC_MSG_ERROR([the regex engine of $AWK is too broken to be used + you might want to install GNU AWK]) +fi # Generating man pages. AM_MISSING_PROG(HELP2MAN, help2man) Index: doc/autoconf.texi =================================================================== RCS file: /cvs/autoconf/doc/autoconf.texi,v retrieving revision 1.483 diff -u -u -r1.483 autoconf.texi --- doc/autoconf.texi 2001/07/05 01:23:20 1.483 +++ doc/autoconf.texi 2001/07/06 12:11:34 @@ -8303,6 +8303,23 @@ foo @end example +Some AWK, such as HPUX 11.0's native one, have regex engines fragile to +inner anchors: + address@hidden +$ echo foo | $AWK '/foo|^bar/ { print }' +$ echo bar | $AWK '/foo|^bar/ { print }' +bar +$ echo foo | $AWK '/^bar|foo/ { print }' +foo +$ echo bar | $AWK '/^bar|foo/ { print }' +bar address@hidden example + address@hidden +Either do not depend on such patterns (i.e., use @samp{/^(.*foo|bar)/}, +or use a simple test to reject such AWK. + @item @command{cat} @c ----------------