automake
[Top][All Lists]
Advanced

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

Re: Public header files


From: Ralf Wildenhues
Subject: Re: Public header files
Date: Mon, 1 Mar 2010 19:35:10 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

Hello Jef,

* Jef Driesen wrote on Mon, Mar 01, 2010 at 01:33:46PM CET:
> How do I get information generated by autotools into my public
> header files? For instance I want to define version numbers
> somewhere in my configure.ac file, and have the same numbers appear
> in a public header file without having to modify both files
> manually? Another example is that my library needs a 64bit integer
> type for its public api.
> 
> Since a config.h header files is not supposed to be public, that's
> not an option. But how can I do this correctly?

Use a second config header.  Its input template will not be generated by
autoheader; you write it yourself.  That way you can be sure to only put
safe stuff in there.

As much as possible, try to think of the possibility that your users may
enable or disable presence of a 64bit integer with compiler command line
options they pass to their package's configure script, or want a
multilib-like installation, where they adjust --libdir for different
ABI versions of your package; you should strive to have as few variation
in public headers as possible, ideally both versions install the same
header files (and only differ in semantics through preprocessor means).

An alternative of the above approach is the AX_PREFIX_CONFIG_H macro
from the Autoconf Macro Archive.

Cheers,
Ralf




reply via email to

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