Thus, for this case, we could use this to break the infloop:
AU_DEFUN([_AC_CHECK_HEADER_OLD],
[AC_CHECK_HEADER([$1], [$2], [$3], [-])], [], [_AC_CHECK_HEADER_PREPROC($@)])
because autoconf would not be picking up the gcc replacement for
AC_CHECK_HEADER, but the user that runs autoupdate will still pick up on
the now-documented usage of the public API.
I tried it quickly but couldn't even with
AU_DEFUN([_AC_CHECK_HEADER_OLD],
[AC_CHECK_HEADER([$1], [$2], [$3], [-])], [], [_AC_CHECK_HEADER_PREPROC])
I couldn't get the INTERNAL-CODE to appear in the m4_defn rather than
the USER-CODE. Even using AU_DEFUN's third argument led to
configure.in:2: error: m4_defn: undefined macro:
AC_DIAGNOSE([obsolete],[_AC_CHECK_HEADER_OLD replacement is not optimal,
please consider
using AC_CHECK_HEADER instead])dnl
_AC_CHECK_HEADER_PREPROC
configure.in:2: the top level
I guess we have to resort to just m4_defun-ing _AC_CHECK_HEADER_OLD. Is
the attached patch okay?
Paolo
2009-06-16 Paolo Bonzini <[email protected]>
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_OLD,
_AC_CHECK_HEADER_NEW): Use low-tech backwards compatibility
code.
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 6ba0b91..6c0e748 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -198,8 +198,9 @@ AS_VAR_POPDEF([ac_Header])])# _AC_CHECK_HEADER_COMPILE
# [ACTION-IF-NOT-FOUND])
# ----------------------------------------------------
# Some packages used this macro, even though it is undocumented.
-AU_DEFUN([_AC_CHECK_HEADER_NEW],
-[AC_CHECK_HEADER([$1], [$2], [$3], [AC_INCLUDES_DEFAULT])])
+# And they used it in a way that breaks autoupdate, like this:
+# m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_NEW]))
+m4_defun([_AC_CHECK_HEADER_NEW], [_AC_CHECK_HEADER_COMPILE])
# _AC_CHECK_HEADER_PREPROC_BODY
@@ -236,8 +237,9 @@ AS_VAR_POPDEF([ac_Header])dnl
# [ACTION-IF-NOT-FOUND])
# ----------------------------------------------------
# Some packages used this macro, even though it is undocumented.
-AU_DEFUN([_AC_CHECK_HEADER_OLD],
-[AC_CHECK_HEADER([$1], [$2], [$3], [-])])
+# And they used it in a way that breaks autoupdate, like this:
+# m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_NEW]))
+m4_defun([_AC_CHECK_HEADER_NEW], [_AC_CHECK_HEADER_PREPROC])
# _AH_CHECK_HEADER(HEADER-FILE)