[Top][All Lists]

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


From: Paul Eggert
Subject: Re: AC_CHECK_HEADERS with CC only
Date: Fri, 11 Oct 2002 16:56:42 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 11 Oct 2002 11:42:37 +0200
> This is my current proposal.

That looks good to me.  I checked in your code, but I tweaked the
documentation a bit so I installed the following doc change instead.
Among other things, I thought it best not to mention AC_HEADER_TIME
here since it's not strictly equivalent to AC_CHECK_HEADER.  I also
added a suggested workaround for any incompatibility.

Index: NEWS
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.263
diff -p -u -r1.263 NEWS
--- NEWS        11 Oct 2002 12:17:51 -0000      1.263
+++ NEWS        11 Oct 2002 23:49:08 -0000
@@ -3,6 +3,10 @@
 ** Macros
+  These macros now check whether the headers are compilable, i.e., they
+  compile headers rather than merely preprocess them.
 - New macros
Index: doc/autoconf.texi
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.687
diff -p -u -r1.687 autoconf.texi
--- doc/autoconf.texi   11 Oct 2002 12:17:52 -0000      1.687
+++ doc/autoconf.texi   11 Oct 2002 23:49:13 -0000
@@ -4459,42 +4459,19 @@ test for it (@pxref{Writing Tests}).
 @defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, 
@ovar{action-if-not-found}, @dvar{includes, default-includes})
 @acindex CHECK_HEADER
-If the system header file @var{header-file} is usable, execute shell
+If the system header file @var{header-file} is compilable, execute shell
 commands @var{action-if-found}, otherwise execute
 @var{action-if-not-found}.  If you just want to define a symbol if the
 header file is available, consider using @code{AC_CHECK_HEADERS}
-The meaning of ``usable'' depends upon the content of @var{includes}:
address@hidden @asis
address@hidden if @var{includes} is empty
-check whether
address@hidden example
-can be @emph{preprocessed} without error.
address@hidden if @var{include} is set
-Check whether
-#include <@var{header-file}>
address@hidden example
-can be @emph{compiled} without error.  You may use
address@hidden (and @code{AC_CHECK_HEADERS}) to check whether
-two headers are compatible.
address@hidden table
-You may pass any kind of dummy content for @var{includes}, such as a
-single space or a comment, to check whether @var{header-file} compiles
-with success.
+Previous versions of Autoconf merely checked whether the header was
+accepted by the preprocessor.  This was changed because the old test
+was inappropriate for typical uses.  Headers are typically used to
+compile, not merely to preprocess, and the old behavior sometimes
+accepted headers that clashed at compile-time.  If you need to check
+whether a header is preprocessable, you can use @code{AC_TRY_CPP} or
+one of its variants (@pxref{Examining Declarations}).
 @end defmac
 @defmac AC_CHECK_HEADERS (@address@hidden, @ovar{action-if-found}, 
@ovar{action-if-not-found}, @dvar{includes, default-includes})
@@ -4507,9 +4484,6 @@ is given, it is additional shell code to
 files is found.  You can give it a value of @samp{break} to break out of
 the loop on the first match.  If @var{action-if-not-found} is given, it
 is executed when one of the header files is not found.
-Be sure to read the documentation of @code{AC_CHECK_HEADER} to
-understand the influence of @var{includes}.
 @end defmac
 @node Declarations

reply via email to

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