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.
This commit is contained in:
Paolo Bonzini 2008-11-06 10:54:51 +01:00
parent b07a2b3d74
commit c22cc67be7
5 changed files with 43 additions and 16 deletions

View File

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

5
NEWS
View File

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

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

View 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

View 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