]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Change `present but cannot be compiled' behavior to use compiler result.
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 6 Nov 2008 09:54:51 +0000 (10:54 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Thu, 6 Nov 2008 09:55:31 +0000 (10:55 +0100)
* NEWS: Document it.
* doc/autoconf.texi (Present But Cannot Be Compiled): Document it.
* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Implement it
and adjust warning.
* tests/semantics.at (AC_CHECK_HEADERS): Test new semantics.

ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/headers.m4
tests/semantics.at

index e6686fc5a1593a1130bd3b9db280531ed2be9f8d..8ba86ef3758aa97f78787729ab6a2b50e153a2be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-06  Paolo Bonzini  <bonzini@gnu.org>
+
+       Change `present but cannot be compiled' behavior to use compiler result.
+       * NEWS: Document it.
+       * doc/autoconf.texi (Present But Cannot Be Compiled): Document it.
+       * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_MONGREL): Implement it
+       and adjust warning.
+       * tests/semantics.at (AC_CHECK_HEADERS): Test new semantics.
+
 2008-11-05  Eric Blake  <ebb9@byu.net>
 
        Add m4_map_args_w.
diff --git a/NEWS b/NEWS
index e22559ff288f433bac0d436a1fce0f713dc516c6..dd771241edf66224a997f0d6f3b315499bae9244 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,11 @@ GNU Autoconf NEWS - User visible changes.
 
 ** Configure scripts now use shell functions.
 
+** Present But Cannot Be Compiled: Autoconf will now proceed with
+   the compiler's result if a header is present but cannot be compiled.
+   The warning is still printed, and you should really fix it by
+   providing a fourth parameter to AC_CHECK_HEADER/AC_CHECK_HEADERS.
+
 ** The following documented m4sugar macros are new:
    m4_curry  m4_default_quoted  m4_map_args  m4_map_args_pair
    m4_set_map
index e1149923306d4267f533eeefcc7b5010cf29c97d..b8fbcd196585e18de537348ae79b72226a43c838 100644 (file)
@@ -22192,11 +22192,10 @@ result, incompatibilities between headers went unnoticed during
 configuration, and maintainers finally had to deal with this issue
 elsewhere.
 
-As of Autoconf 2.56 both checks are performed, and @command{configure}
-complains loudly if the compiler and the preprocessor do not agree.
-For the time being the result used is that of the preprocessor, to give
-maintainers time to adjust their @file{configure.ac}, but in the
-future, only the compiler will be considered.
+The transition began with Autoconf 2.56.  As of Autoconf 2.64 both
+checks are performed, and @command{configure} complains loudly if the
+compiler and the preprocessor do not agree.  However, only the compiler
+result is considered.
 
 Consider the following example:
 
@@ -22238,8 +22237,7 @@ configure: WARNING: pi.h: present but cannot be compiled
 configure: WARNING: pi.h:     check for missing prerequisite headers?
 configure: WARNING: pi.h: see the Autoconf documentation
 configure: WARNING: pi.h:     section "Present But Cannot Be Compiled"
-configure: WARNING: pi.h: proceeding with the preprocessor's result
-configure: WARNING: pi.h: in the future, the compiler will take precedence
+configure: WARNING: pi.h: proceeding with the compiler's result
 configure: WARNING:     ## -------------------------------------- ##
 configure: WARNING:     ## Report this to bug-example@@example.org ##
 configure: WARNING:     ## -------------------------------------- ##
@@ -22274,7 +22272,7 @@ checking for pi.h... yes
 @end example
 
 See @ref{Particular Headers}, for a list of headers with their
-prerequisite.
+prerequisites.
 
 @c ===================================================== History of Autoconf.
 
index ae0da812545c212b5f5e5c6803b1f1006524996a..cb1cb9c8539f5569d38b8543fa62dc3d12a6857e 100644 (file)
@@ -121,22 +121,20 @@ case $ac_header_compiler:$ac_header_preproc:$ac_[]_AC_LANG_ABBREV[]_preproc_warn
   yes:no: )
     AC_MSG_WARN([$[]2: accepted by the compiler, rejected by the preprocessor!])
     AC_MSG_WARN([$[]2: proceeding with the compiler's result])
-    ac_header_preproc=yes
     ;;
   no:yes:* )
     AC_MSG_WARN([$[]2: present but cannot be compiled])
     AC_MSG_WARN([$[]2:     check for missing prerequisite headers?])
     AC_MSG_WARN([$[]2: see the Autoconf documentation])
     AC_MSG_WARN([$[]2:     section "Present But Cannot Be Compiled"])
-    AC_MSG_WARN([$[]2: proceeding with the preprocessor's result])
-    AC_MSG_WARN([$[]2: in the future, the compiler will take precedence])
+    AC_MSG_WARN([$[]2: proceeding with the compiler's result])
 m4_ifset([AC_PACKAGE_BUGREPORT],
 [m4_n([( AS_BOX([Report this to ]AC_PACKAGE_BUGREPORT)
      ) | sed "s/^/$as_me: WARNING:     /" >&2])])dnl
     ;;
 esac
   AC_CACHE_CHECK([for $[]2], [$[]3],
-                [AS_VAR_SET([$[]3], [$ac_header_preproc])])])
+                [AS_VAR_SET([$[]3], [$ac_header_compiler])])])
   AS_LINENO_POP
 ])#_AC_CHECK_HEADER_MONGREL_BODY
 
index 1c6d70b66940bbbb2d024c06281a349f678e448d..9908a15c42b26d74d1bdd6ca9d521e8eb74b09e9 100644 (file)
@@ -170,12 +170,29 @@ AT_CLEANUP
 # ----------------
 # Check that it performs the correct actions:
 # Must define HAVE_STDIO_H, but not HAVE_AUTOCONF_IO_H.
-AT_CHECK_MACRO([AC_CHECK_HEADERS],
-[AC_CHECK_HEADERS(stdio.h autoconf_io.h)],
-[AT_CHECK_DEFINES(
+AT_SETUP([AC_CHECK_HEADERS])
+
+AT_DATA([autoconf_io.h],
+[blah blah
+])
+
+AT_CONFIGURE_AC([AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
+AT_CHECK_AUTOCONF([-W obsolete])
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE([CPPFLAGS=-I.], [0], [ignore],
+[configure: WARNING: autoconf_io.h: present but cannot be compiled
+configure: WARNING: autoconf_io.h:     check for missing prerequisite headers?
+configure: WARNING: autoconf_io.h: see the Autoconf documentation
+configure: WARNING: autoconf_io.h:     section "Present But Cannot Be Compiled"
+configure: WARNING: autoconf_io.h: proceeding with the compiler's result
+])
+AT_CHECK_ENV
+AT_CHECK_DEFINES(
 [/* #undef HAVE_AUTOCONF_IO_H */
 #define HAVE_STDIO_H 1
-])])
+])
+
+AT_CLEANUP
 
 
 # AC_CHECK_HEADERS_OLD