bug-parted
[Top][All Lists]
Advanced

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

Re: config.h


From: K . G .
Subject: Re: config.h
Date: Fri, 24 Sep 2004 12:48:31 +0200

On 23 Sep 2004 23:00:54 -0500
address@hidden (Harley D. Eades III) wrote:

> Hello,
>         It would be most appreciated if someone could explain what config.h 
> is used for, and where it comes from{lib, db package, etc....}.  Thank you.
> 
> Happy Hacking
> Harley

config.h is generated by configure from config.h.in (which is generated by 
autoheader from configure.in) and from the option you gives to the configure 
script (generated by autoconf from the same configure.in )
For example if you write this in configure.in :

[...]
AC_ARG_ENABLE(hfs-extract-fs,
        [  --enable-hfs-extract-fs Extract special HFS files for debugging 
[default=no]], ,
        enable_hfs_extract_fs=no
)
if test "$enable_hfs_extract_fs" = yes; then
        AC_DEFINE(HFS_EXTRACT_FS, 1,
                  [Extract low level special HFS(+) files for debugging purposes
                   when using the "check" command (NOT FOR PACKAGING)])
fi
[...]

Then you run autoheader (to generate the config.h.in), then autoconf (to 
generate configure), then you run ./configure --enable-hfs-extract-fs , the 
config.h generated will contains #define HFS_EXTRACT_FS 1
So you can use the defines in the source code to selectively generate code, or 
do anything else dependant of the configure options.





reply via email to

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