automake
[Top][All Lists]
Advanced

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

Re: a general question about config.h files


From: Ronald Landheer-Cieslak
Subject: Re: a general question about config.h files
Date: Fri, 4 Apr 2003 12:28:37 +0200 (CEST)

On Wed, 2 Apr 2003, Dale E Martin wrote:
> > > "make install" clutils is installing it's generated config.h, which has
> >                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Don't do that.
> Meaning that none of my headers can #inlude "config.h"?  That seems
> ludicrous to me.
OK.. if you really want to do that, you'll have to make sure that 
conflicting config.h files don't both get included in some fashion.. (or 
worse: make sure that conflicting defines get #undef'ed when you don't 
need them anymore)

Neither scheme is a good idea, IMHO..

> > You shouldn't install config.h: they are not meant to be installed,
> > but should be used only during the compilation of the project itself.
> > They shouldn't contain anything of importance to any other application
> > anyway.
> In my current example, I have a header that does this:
[snipped header contents that uses HAVE_STDINT_H]
> > If they do, try making a clutils-config.h.in file with the stuff you
> > *really* need to have in there as variables for use in AC_SUBST, like
> > so:
> > #define something_I_really_need @SOMETHING_I_REALLY_NEED@
> So you're saying that I need to not use the "stock-generated" config.h,
> I need to filter only the things that really really need to be in there
> into a separate file, and then AC_SUBST them into this newly generated
> file.  Is that a correct summary?
That's pretty much what I'm saying, yes. (mostly because it's usually the 
easiest way to handle this).

Either that, or make your own config.h.in file that has the proper stuff
to be included in the installation (and does not have any of the
conflicting defines you find in the config.h file) - whichever is the
least work usually works best (but keep in mind that if you add stuff to
configure.{ac|in}, you may need to add stuff to your hand-made config.h.in
or it will break).

A "smart" sed script can also help strip the conflicting defines our of 
the autoheader-generated config.h.in - e.g. strip out the PACKAGE_* 
defines.

> > it will be replaced with the value of ${SOMETHING_I_REALLY_NEED} when you 
> > call AC_SUBST(SOMETHING_I_REALLY_NEED) somewhere at an appropriate place 
> > in your configure.{in|ac} file.
>  
> > Of course, you need to make sure the thing only gets preprocessed once 
> > with the proper 
> > #ifndef _MY_H
> > #define _MY_H
> > 
> > ...
> > 
> > #endif
> > 
> > which config.h lacks - because it's not supposed to be installed anyway :)
> OK, that was one of those things I had wondered about as well :-)

HTH

rlc






reply via email to

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