(autoconf.info)Header Templates


Next: Invoking autoheader Prev: Configuration Headers Up: Configuration Headers
Enter node , (file) or (file)node

3.4.1 Configuration Header Templates
------------------------------------

Your distribution should contain a template file that looks as you want
the final header file to look, including comments, with default values
in the '#define' statements.  For example, suppose your 'configure.in'
makes these calls:

     AC_CONFIG_HEADER(conf.h)
     AC_CHECK_HEADERS(unistd.h)

Then you could have code like the following in 'conf.h.in'.  On systems
that have 'unistd.h', 'configure' will change the 0 to a 1.  On other
systems, it will leave the line unchanged.

     /* Define as 1 if you have unistd.h.  */
     #define HAVE_UNISTD_H 0

   Alternately, if your code tests for configuration options using
'#ifdef' instead of '#if', a default value can be to '#undef' the
variable instead of to define it to a value.  On systems that have
'unistd.h', 'configure' will change the second line to read '#define
HAVE_UNISTD_H 1'.  On other systems, it will comment that line out (in
case the system predefines that symbol).

     /* Define if you have unistd.h.  */
     #undef HAVE_UNISTD_H


automatically generated by info2www version 1.2.2.9