From: Paolo Bonzini Date: Thu, 6 Nov 2008 09:54:51 +0000 (+0100) Subject: Change `present but cannot be compiled' behavior to use compiler result. X-Git-Tag: v2.63b~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c22cc67be78dcbb7684e21d1ee31042a8596b7e8;p=thirdparty%2Fautoconf.git 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. --- diff --git a/ChangeLog b/ChangeLog index e6686fc5a..8ba86ef37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-06 Paolo Bonzini + + 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 Add m4_map_args_w. diff --git a/NEWS b/NEWS index e22559ff2..dd771241e 100644 --- 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 diff --git a/doc/autoconf.texi b/doc/autoconf.texi index e11499233..b8fbcd196 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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. diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 index ae0da8125..cb1cb9c85 100644 --- a/lib/autoconf/headers.m4 +++ b/lib/autoconf/headers.m4 @@ -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 diff --git a/tests/semantics.at b/tests/semantics.at index 1c6d70b66..9908a15c4 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -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