diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2003-10-27 21:17:15 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2003-10-27 21:17:15 +0000 |
commit | adb20140a22852c86dd8cb2eff2bc3d88381db14 (patch) | |
tree | a0702a8e66cbbd5a25250cb8d1f895faf378dba7 /lib/am/remake-hdr.am | |
parent | 0768132f844f8b420765732b5c55472ed30940e9 (diff) | |
download | automake-adb20140a22852c86dd8cb2eff2bc3d88381db14.tar.gz |
* lib/am/remake-hdr.am ($(srcdir)/%CONFIG_HIN%): Erase %STAMP%.
* tests/Makefile.am (TESTS): Add autohdr3.test
* tests/autohdr3.test: New file.
Diffstat (limited to 'lib/am/remake-hdr.am')
-rw-r--r-- | lib/am/remake-hdr.am | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index 1ae7c0f27..067c34844 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -38,7 +38,38 @@ if %?FIRST_CONFIG_HIN% $(srcdir)/%CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES% cd $(top_srcdir) && $(AUTOHEADER) -## Autoheader has the bad habit of not changing the time stamp if +## Whenever $(AUTOHEADER) has run, we must make sure that +## ./config.status will rebuild config.h. The dependency from %STAMP% +## on %CONFIG_H_DEPS% (which contains config.hin) is not enough to +## express his. +## +## There are some tricky cases where this rule will build a +## config.hin which has the same timestamp as %STAMP%, in which case +## ./config.status will not be rerun (meaning that users will use in +## out-of-date config.h without knowing it). One situation where this +## can occurs is the following: +## 1. the user updates some configure dependency (let's say foo.m4) +## and run `make' +## 2. the rebuild rules detect that a foo.m4 has changed, +## run aclocal, autoconf, automake, and then run ./config.status. +## (Note that autoheader hasn't been called yet, so ./config.status +## outputs a config.h from an obsolete config.hin.) +## 3. Once Makefile has been regenerated, make continues, and +## discover that config.h is a dependency of the `all' rule. +## Because config.h depends on stamp-h1, stamp-h1 depends on +## config.hin, and config.hin depends on aclocal.m4, make runs +## autoheader to rebuild config.hin. +## Now make ought to call ./config.status once again to rebuild +## config.h from the new config.hin, but if you have a sufficiently +## fast box, steps 2 and 3 will occur within the same second: the +## config.h/stamp-h1 generated from the outdated config.hin will have +## the same mtime as the new config.hin. Hence make will think that +## config.h is up to date. +## +## A solution is to erase %STAMP% here so that the %STAMP% rule +## is always triggered after the this one. + rm -f %STAMP% +## Autoheader has the bad habit of not changing the timestamp if ## config.hin is unchanged, which breaks Make targets. Since what ## must not changed gratuitously is config.h, which is already handled ## by config.status, there is no reason to make things complex for |