[Top][All Lists]

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

Re: How to install "config.h"

From: Raja R Harinath
Subject: Re: How to install "config.h"
Date: 30 Oct 2000 11:51:10 -0600
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Ossama Othman <address@hidden> writes:
> On Fri, Oct 27, 2000 at 08:44:40PM +0100, Gary V. Vaughan wrote:
> > Hmmm.  I think that installing config.h is a bad idea under any
> > circumstances.  I talk about this in some detail in the ``Project''
> > chapters of the Goat Book (linked from my homepages), and offer an
> > ugly but functional solution.  Even if you don;'t go for that solution
> > all out, there is no getting away from the fact that a certain amount
> > of rewriting is an absolute must.
> I'm not sure that I agree with you, though I confess that I probably
> haven't thought about this issue as much as you.  Please feel free to
> correct me.  :-)

But, you seem to agree ;-)
> If the macros placed in the package specific config.h are named so
> that they are specific to the given package then why is installing
> that header a problem.  For example, if my config header has the
> following:
> /* I'm assuming that "FOO" is a fairly unique package name. */
> #ifndef FOO_CONFIG_H
> #define FOO_CONFIG_H
> #endif  /* FOO_CONFIG_H */

This is one of the possible rewriting (though he doesn't talk about
that in his book).  

The other approach, used in glib (and is explained in his book), is to
use that information to precompute some of the results of those
'#define's rather than use the boring #ifdef FOO_HAS_.../#endif mess
in the other header files.  This at least pays back for installing a
config specific header by making the rest of the headers more

> I do agree that the use of macros in a config.h such as "PACKAGE,"
> "VERSION" and "HAVE_*" is a bad thing since they are named
> generically.  It would be nice if it was possible to make autoconf
> prepend a package name, for example, to such automatically defined
> macros.  That would at least help alleviate the problem.

You can do that yourself

  sed 's,^#define ,#define FOO_,' < config.h > foo-config.h

I would be loath to changing autoconf to make installing config.h more
convenient.  The whole philosophy of config.h is that it is used to
improve the portablility of the particular package it's generated
for, not as a general portability helper.  In other words, wanting to
install config.h is itself the problem ;-)

There is also the problem with installing something that depends on
the output of a configure run into $prefix.  The proper home for such
beasts is $exec_prefix.  It would be nice if there was an
$(execincludedir) [= $(exec_prefix)/include].

- Hari
Raja R Harinath ------------------------------ address@hidden
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

reply via email to

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