This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: problem with AC_CONFIG_HEADERS and automake
> Installing config.h (with its non-prefixed defines) can lead to problems
> later on, of course.
Right, this is exactly the problem I was facing and so I'm no longer doing
this.
> Putting in guards does sometimes not do the right thing either, as
> prepackaged software might be build on different hosts with different
> configurations leading to different configure`d defines.
I've only defined things in my custom files that should be OK. My
application is implemented C++, and I've got members whose type can depend
on the results of configure tests. For instance, if I need a 64 bit type,
I need to figure out on the platform I'm how to define that. (Is it long,
long long, or uint64, or something else?) So I don't think I have a choice
but to define a header with this info in there.
> That is in one installed config.h the define is ON will in the other it
> is OFF, the guard define will make that unconditionally ON.
I'm NOT installing config.h, that was the point of using AC_CONFIG_HEADERS
with my own input files. I'm ONLY guarding multiple inclusion of the
files, too, so multiply defined symbols would actually get flagged as a
problem.
> Better put a prefix in there, so that symbols are easily classified to be
> the configuration of your lib and not from anyone's else library header.
> The macro AX_PREFIX_CONFIG_H might help you here, and it does not even
> require you to write your own header.h.in, plus all defines are guarded
> as an extra benefit for you. The only problem might be that your
> installed header files (and only these) need to be corrected to be
> dependent in its ifdef#d on the prefixed symbols. That's been discussed
> multiple times on the automake and autoconf mailinglists.
Interestingly, last time I asked about this (a few weeks back) noone
mentioned AX_PREFIX_CONFIG_H. I'll look into that.
Thanks,
Dale
--
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin@cliftonlabs.com
http://www.cliftonlabs.com
pgp key available