[Python-Dev] Re: HAVE_CONFIG_H

François Pinard pinard@iro.umontreal.ca
31 Jul 2002 08:41:02 -0400


[Akim Demaille]

> I'm not sure I completely understand the question here: if HAVE_CONFIG_H
> is specified, it means config.h is created.  So if you use a config.h,
> why does it matter not to define HAVE_CONFIG_H?

Hi, Akim.  I hope life is still good to you! :-)

In the beginnings of Autoconf, the `config.h' file did not exist.
David MacKenzie added it as a way to reduce the `make' output clutter.
Nowadays, I suspect almost all packages of at least moderate size uses it.

Our traditional `lib/' modules have to work in many packages, whether
`config.h' has been created or not, this being decided on a per package
basis, and that is why there is a conditional inclusion of `config.h' in
each of these `lib/' modules.  He took a good while before we got stabilised
on the exact stanza of this inclusion (I especially remember the massive
unilateral changes by Roland McGrath introducing the BROKEN_BROKET define,
or something like that, and all the doing it later took to clean this out.)

Python (the distribution, which is what is in question here) does not
use any of our `lib/' things, it is not going to use them, and it is not
going to provide new such modules, so the distribution includes `config.h'
everywhere, by permanent choice, without any need to use `HAVE_CONFIG_H'
to decide if that inclusion is needed or not.  So, even `-DHAVE_CONFIG_H'
is useless `make' clutter in this case, and that's why the Python packagers
wanted to get rid of it.

In fact, in practice `-DHAVE_CONFIG_H' is only needed for packages using
those common `lib/' modules, but many packages do not.  Now that Autoconf
is used with projects who have a life outside GNU, this is less necessary.
Guido found, and got me to remember, that `@DEFS@' is the culprit: people
just do not have to use it in their hand-crafted Makefiles, which is the
case for Python.  For away-from-GNU packages using Automake, some Automake
option might exist so `@DEFS@' does not get generated?  The only goal here
is to get a cleaner `make' output.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard