fi])
EGREP="$ac_cv_path_EGREP"
AC_SUBST([EGREP])
+ dnl
+ dnl Also set EGREP_TRADITIONAL even though unnecessary here,
+ dnl for wrong but too-common code with the following pattern:
+ dnl AC_PROG_EGREP
+ dnl if false; then
+ dnl AC_EGREP_HEADER([printf], [stdio.h], [has_printf=yes])
+ dnl fi
+ dnl AC_EGREP_HEADER([malloc], [stdlib.h], [has_malloc=yes])
+ EGREP_TRADITIONAL=$EGREP
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP
])# AC_PROG_EGREP
# _AC_PROG_EGREP_TRADITIONAL
AT_CLEANUP
+## ----------------------------------- ##
+## AC_PROG_EGREP and AC_EGREP_HEADER. ##
+## ----------------------------------- ##
+
+AT_SETUP([AC_PROG_EGREP and AC_EGREP_HEADER])
+
+_AT_CHECK_AC_MACRO(
+[[AC_PROG_CPP
+ AC_PROG_EGREP
+
+ # Although this code is incorrect (it should use AS_IF),
+ # it follows a too-common real world pattern.
+ # For now, test for it; we may remove this test later.
+ if false; then
+ AC_EGREP_HEADER([^], [limits.h])
+ fi
+
+ AC_EGREP_HEADER([$], [limits.h], [],
+ [AC_MSG_ERROR([[egrep-related macros do not tolerate misuse of 'if']])])
+]])
+
+AT_CLEANUP
+
+
## ------------------------------------ ##
## AC_NO_EXECUTABLES (working linker). ##
## ------------------------------------ ##