[Python-Dev] Re: HAVE_CONFIG_H

Akim Demaille akim@epita.fr
03 Sep 2002 08:26:52 +0200

>>>>> "Fran=E7ois" =3D=3D Fran=E7ois Pinard <pinard@iro.umontreal.ca> wri=

Fran=E7ois> [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?

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

Hi Fran=E7ois!

The new (scholar) year is starting now, so life is still good, but I'm
a bit afraid of what it might be done in the near future :)

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


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

I understand.

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

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

I understand the goal, but much of the effort is devoted to having the
thing work cleanly, not being beautiful.  Another goal is to have it
being easy to maintain, i.e., not having too much to document, too
much to support, too much to test etc.  So, although I don't know what
the Automake team might think of this idea, I suspect they'll want to
focus on other features :(