autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _AC_CHECK_HEADER_OLD


From: Eric Blake
Subject: Re: _AC_CHECK_HEADER_OLD
Date: Wed, 17 Jun 2009 06:33:03 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 6/16/2009 1:38 AM:
> 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  <address@hidden>
> 
>     * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_OLD,
>     _AC_CHECK_HEADER_NEW): Use low-tech backwards compatibility
>     code.

Here's what I committed instead, to at least provide a message why it is
obsolete.  This should fix the gcc infloop, but I'd appreciate some
feedback from Ralf.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAko44n8ACgkQ84KuGfSFAYD8uACg1kD4bVfmfMG4ViebXrcBoqIt
i4YAn0quEZIhr06UUoKwIYPWmua2ZRN6
=SQzF
-----END PGP SIGNATURE-----
>From 01660aaecc22ce7ca6b5ee88851916bf2f36e74c Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 17 Jun 2009 06:26:48 -0600
Subject: [PATCH] Fix AC_CHECK_HEADER infloop for gcc.

* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_NEW)
(_AC_CHECK_HEADER_OLD): Give up on AU_DEFUN, and manually warn
about obsoletion, to avoid infinite loop in gcc.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog               |    8 ++++++++
 lib/autoconf/headers.m4 |   27 ++++++++++++++++-----------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4acbea5..e568c7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-17  Eric Blake  <address@hidden>
+
+       Fix AC_CHECK_HEADER infloop for gcc.
+       * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_NEW)
+       (_AC_CHECK_HEADER_OLD): Give up on AU_DEFUN, and manually warn
+       about obsoletion, to avoid infinite loop in gcc.
+       Reported by Ralf Wildenhues.
+
 2009-06-15  Eric Blake  <address@hidden>

        Add m4_copy_force, m4_rename_force.
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 6ba0b91..21b512c 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -194,14 +194,6 @@ AC_DEFUN([_AC_CHECK_HEADER_COMPILE],
 AS_VAR_IF([ac_Header], [yes], [$2], [$3])
 AS_VAR_POPDEF([ac_Header])])# _AC_CHECK_HEADER_COMPILE

-# _AC_CHECK_HEADER_NEW(HEADER-FILE, [ACTION-IF-FOUND],
-#                      [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])])
-
-
 # _AC_CHECK_HEADER_PREPROC_BODY
 # -----------------------------
 # Shell function body for _AC_CHECK_HEADER_PREPROC.
@@ -234,10 +226,23 @@ AS_VAR_POPDEF([ac_Header])dnl

 # _AC_CHECK_HEADER_OLD(HEADER-FILE, [ACTION-IF-FOUND],
 #                      [ACTION-IF-NOT-FOUND])
+# _AC_CHECK_HEADER_NEW(HEADER-FILE, [ACTION-IF-FOUND],
+#                      [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], [-])])
+# Some packages used these undocumented macros.  Even worse, gcc
+# redefined AC_CHECK_HEADER in terms of _AC_CHECK_HEADER_OLD, so we
+# can't do the simpler:
+#   AU_DEFUN([_AC_CHECK_HEADER_OLD],
+#     [AC_CHECK_HEADER([$1], [$2], [$3], [-])])
+AC_DEFUN([_AC_CHECK_HEADER_OLD],
+[AC_DIAGNOSE([obsolete], [The macro `$0' is obsolete.
+You should use AC_CHECK_HEADER with a fourth argument.])]dnl
+[_AC_CHECK_HEADER_PREPROC($@)])
+
+AC_DEFUN([_AC_CHECK_HEADER_NEW],
+[AC_DIAGNOSE([obsolete], [The macro `$0' is obsolete.
+You should use AC_CHECK_HEADER with a fourth argument.])]dnl
+[_AC_CHECK_HEADER_COMPILE($@)])


 # _AH_CHECK_HEADER(HEADER-FILE)
-- 
1.6.3.rc3.2.g4b51


reply via email to

[Prev in Thread] Current Thread [Next in Thread]