automake
[Top][All Lists]
Advanced

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

Re: Public header files


From: Jef Driesen
Subject: Re: Public header files
Date: Tue, 16 Mar 2010 13:29:45 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3

On 15/03/2010 22:18, Ralf Wildenhues wrote:
* Jef Driesen wrote on Sat, Mar 13, 2010 at 11:21:45PM CET:
For instance, I prefer to have:

typedef foobar ticks_t;

instead of:

#define ticks_t foobar

It might be possible to achieve the same with AC_CONFIG_HEADERS, but
I don't know how. I had a look at a number of projects to see how
they did this, and they used AC_CONFIG_FILES.

Well, you can usually emulate such things with a helper #define and
conditional #if/#ifdef code in the manually written header.

That looks more complicated, and adds extra #ifdef's to the public header file that shouldn't be there in the first place.

The next thing I want to add is a MYLIB_VERSION_REVISION, that
contains some info from the SCM system (e.g. a svn revision number,
a git sha1 hash). When building a (not yet released) development
version of my code, it would be useful to know the exact revision.

There's been quite some prior discussion and examples of this in the
list archives, but a perfect solution still would require some changes
to Automake.

I suppose you are referring to solutions like this:

m4_define([mylib_version_revision],m4_esyscmd([my_revision_script]))

where the revision script fetches the revision from the SCM system,
or from a version file when using tarballs.

Well, that solution has the disadvantage that a revision change causes a
full autotools and configure rerun, but yes, that is one suboptimal
solution.

Is there a better method?





reply via email to

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