autoconf-patches
[Top][All Lists]
Advanced

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

Re: Spurious error from autoheader


From: Eric Blake
Subject: Re: Spurious error from autoheader
Date: Mon, 04 Aug 2008 06:57:35 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

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

According to Stepan Kasal on 6/30/2008 12:39 PM:
| Hello Andreas,
|
| On Mon, Jun 30, 2008 at 03:30:19PM +0200, Andreas Schwab wrote:
|> $ cat configure.ac
|> AC_INIT
|> AC_AIX
|> AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional
function prototypes.])
|> AC_CONFIG_HEADERS([config.h])
|> AC_OUTPUT
|> $ autoheader
|> autoheader: warning: missing template: _ALL_SOURCE
|> autoheader: Use AC_DEFINE([_ALL_SOURCE], [], [Description])
|> autoheader: warning: missing template: _GNU_SOURCE
|> autoheader: warning: missing template: _POSIX_PTHREAD_SEMANTICS
|> autoheader: warning: missing template: _TANDEM_SOURCE

Note that explicitly defining __EXTENSIONS__ in config.h is broken;
according to the implementation AC_USE_SYSTEM_EXTENSIONS, there are some
platforms (which?) where blindly defining it breaks compilation.  So this
should be reported as an upstream bug of the package where this report was
culled from.  That said, there's no reason why we shouldn't try to
accommodate the unpatched package.

|>
|> The same works when moving AC_AIX down after the AC_DEFINE.
|
| AC_AIX is an alias for AC_USE_SYSTEM_EXTENSIONS these days.
|
| The config.h.in fragment in AC_USE_SYSTEM_EXTENSIONS takes care of
| all the above cpp macros, including __EXTENSIONS__, and is "indexed"
| by the string __EXTENSIONS__.  This means that the autoheader script
| saves it into a hash under index "__EXTENSIONS__".
|
| So it clashes with the config.h.in fragment created from your
| AC_DEFINE.  Whoever comes last, wins.  That's why the order matters.

Thanks for the report and analysis.  As promised, I'm now working on
AC_USE_SYSTEM_EXTENSION issues; it looks like there have been multiple
independent issues reported.

For this particular issue, I believe that this patch solves the problem by
using a different autoheader key and thus allowing existing configure.ac
to use __EXTENSIONS__ independently of AC_USE_SYSTEM_EXTENSIONS or any of
its aliases.  Any comments before I apply it?

- --
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

iEYEARECAAYFAkiW/L8ACgkQ84KuGfSFAYBu6ACgt508QnYw8EG1nEpsJlX0khyk
hmIAoK4gx8z/1YOK3gegWwqWH/GwEDjD
=szA9
-----END PGP SIGNATURE-----
>From 0e97427e660ce386c33761bf7a968cfc71fe97c8 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 4 Aug 2008 06:56:53 -0600
Subject: [PATCH] Fix autoheader 2.62 regression on AC_DEFINE([__EXTENSIONS__]).

* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Use a
unique key for the AH_VERBATIM.
* tests/c.at (AC_USE_SYSTEM_EXTENSIONS): New test.
Reported by Andreas Schwab, analyzed by Stepan Kasal.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                |    8 ++++++++
 lib/autoconf/specific.m4 |    7 +++++--
 tests/c.at               |   27 +++++++++++++++++++++++++--
 3 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 71abf0f..8aa2d51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-04  Eric Blake  <address@hidden>
+
+       Fix autoheader 2.62 regression on AC_DEFINE([__EXTENSIONS__]).
+       * lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Use a
+       unique key for the AH_VERBATIM.
+       * tests/c.at (AC_USE_SYSTEM_EXTENSIONS): New test.
+       Reported by Andreas Schwab, analyzed by Stepan Kasal.
+
 2008-08-04  Ralf Wildenhues  <address@hidden>
 
        Fix AC_CONFIG_FILES([$var]) 2.62 regression.
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
index d183d59..5fcfe37 100644
--- a/lib/autoconf/specific.m4
+++ b/lib/autoconf/specific.m4
@@ -2,7 +2,8 @@
 # Macros that test for specific, unclassified, features.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
+# Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -398,7 +399,9 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
       [Define to 1 if on MINIX.])
   fi
 
-  AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
diff --git a/tests/c.at b/tests/c.at
index 39fcb18..bc07c6e 100644
--- a/tests/c.at
+++ b/tests/c.at
@@ -2,8 +2,8 @@
 
 AT_BANNER([C low level compiling/preprocessing macros.])
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 Free
+# Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -232,3 +232,26 @@ AT_CHECK_MACRO([AC_NO_EXECUTABLES (broken linker)],
 AC_NO_EXECUTABLES
 AC_PROG_CC
 ])
+
+
+## -------------------------- ##
+## AC_USE_SYSTEM_EXTENSIONS.  ##
+## -------------------------- ##
+
+AT_SETUP([AC_USE_SYSTEM_EXTENSIONS])
+
+# Some existing configure.ac mixed AC_AIX (now an alias for
+# AC_USE_SYSTEM_EXTENSIONS) and AC_DEFINE([__EXTENSIONS__]), which
+# broke autoheader in 2.62.  Test that this is supported.
+
+_AT_CHECK_AC_MACRO(
+[[AC_AIX
+AC_DEFINE([__EXTENSIONS__], [1], [Manually defined for Solaris])
+]])
+
+_AT_CHECK_AC_MACRO(
+[[AC_USE_SYSTEM_EXTENSIONS
+AC_DEFINE([__EXTENSIONS__], [1], [Manually defined for Solaris])
+]])
+
+AT_CLEANUP
-- 
1.5.6.4


reply via email to

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