|
From: | Bob Friesenhahn |
Subject: | Re: Autoconf/Automake is not using version from AC_INIT |
Date: | Tue, 12 Jan 2021 08:35:05 -0600 (CST) |
User-agent: | Alpine 2.20 (GSO 67 2015-01-07) |
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 addingCONFIGURE_DEPENDENCIES = ChangeLogwould 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: ChangeLogcd $(srcdir) && ./version packageversion > .version-tmp && move-if-change .version-tmp .versionEXTRA_DIST = $(srcdir)/.versionI 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@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
[Prev in Thread] | Current Thread | [Next in Thread] |