Re: Autoconf/Automake is not using version from AC_INIT

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

 



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.

Bob

--
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux