autoconf
[Top][All Lists]
Advanced

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

Re: Autoconf/Automake is not using version from AC_INIT


From: Peter Johansson
Subject: Re: Autoconf/Automake is not using version from AC_INIT
Date: Wed, 13 Jan 2021 07:52:24 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Bob,

On 13/1/21 12:35 am, Bob Friesenhahn wrote:
On Tue, 12 Jan 2021, Peter Johansson wrote:

The problem is that there is no dependency in the Makefile telling that autoconf need to be rerun when the version has changed. Automake has the variable 'CONFIGURE_DEPENDENCIES' for this purpose, so adding

CONFIGURE_DEPENDENCIES = ChangeLog

would solve the issue but will cause a rerun of autoconf every time you touch ChangeLog. Rather you want a stamp file, whose timestamp only changes when the output of 'version.sh packageversion' changes. Something along the lines:

$(srcdir)/.version: ChangeLog
    cd $(srcdir) && ./version packageversion > .version-tmp && move-if-change .version-tmp .version

EXTRA_DIST = $(srcdir)/.version

I don't see any way without a specific file holding the timestamp on when the version was last updated.

This is very helpful advice (and adds to valuable advice offered in private emails by others).  I don't really like hidden files but I do have a version.h header file which could already be used for this purpose.  The version.h header file is currently produced from version.h.in using config.status and it gets copied to the source directory (if necessary) if the file has changed.

I think that will have the unwanted effect that autoconf is triggered when building from a tarball. Since version.h is not included in the tarball, it will be built by the user and have a newer timestamp than configure, and hence the rule is triggered. I think the advice one of the automake maintainers (probably Ralf) gave many years ago is that files listed in CONFIGURE_DEPENDENCIES should be distributed.

Peter




reply via email to

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