Hello,
  the autoconf manual explains that one has to use #include <config.h>,
because the source dir could contain a stale config.h.

I don't think this assumption is reasonable.  Normally, the source directory
may not be configured.  (Yes, there are exceptions, for example when cross
building texinfo, but they are rare.)

I suggest to change that paragraph; see the patch attached to this mail.

OK to commit?

Have a nice day,
        Stepan
2005-06-30  Stepan Kasal  <[EMAIL PROTECTED]>

        * doc/autoconf.texi (Configuration Headers): Change the explanation
        about #include <config.h>.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.923
diff -u -r1.923 autoconf.texi
--- doc/autoconf.texi   30 Jun 2005 12:55:46 -0000      1.923
+++ doc/autoconf.texi   30 Jun 2005 14:48:05 -0000
@@ -2653,13 +2653,19 @@
 
 The package should @samp{#include} the configuration header file before
 any other header files, to prevent inconsistencies in declarations (for
-example, if it redefines @code{const}).  Use @samp{#include <config.h>}
-instead of @samp{#include "config.h"}, and pass the C compiler a
[EMAIL PROTECTED] option (or @option{-I..}; whichever directory contains
[EMAIL PROTECTED]).  That way, even if the source directory is configured
-itself (perhaps to make a distribution), other build directories can
-also be configured without finding the @file{config.h} from the source
-directory.
+example, if it redefines @code{const}).
+
+To provide for VPATH buils, remember to pass the C compiler a @option{-I.}
+option (or @option{-I..}; whichever directory contains @file{config.h}).
+Even if you use @samp{#include "config.h"}, the preprocessor searches only
+the directory of the currently read file, [EMAIL PROTECTED] the source 
directory, not
+the build directory.
+
+With the appropriate @option{-I} option, you can use
[EMAIL PROTECTED] <config.h>}.  Actually, it's a good habit to use it,
+because in the rare case when the source directory contains another
[EMAIL PROTECTED], the build directory should be searched first.
+
 
 @defmac AC_CONFIG_HEADERS (@var{header} @dots{}, @ovar{cmds}, @ovar{init-cmds})
 @acindex{CONFIG_HEADERS}

Reply via email to