summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-06-29 16:51:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-06-29 17:08:26 -0700
commit5e650129bcee2a97fd1ce2262b0ac2f5bc209fe7 (patch)
tree7aaff4853fe5f3574b6ec97faf8e8be4f6b16711 /bin
parentc92f7606d6b73d4911b57f714c0cc5c64f0912bf (diff)
downloadautoconf-5e650129bcee2a97fd1ce2262b0ac2f5bc209fe7.tar.gz
Stop using up_to_date_p
* bin/autom4te.in (up_to_date): Rewrite to stop using up_to_date_p, which has been removed from Automake.
Diffstat (limited to 'bin')
-rw-r--r--bin/autom4te.in31
1 files changed, 22 insertions, 9 deletions
diff --git a/bin/autom4te.in b/bin/autom4te.in
index 4e2af77e..3a80d4b7 100644
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -888,18 +888,27 @@ sub up_to_date ($)
# The youngest of the cache files must be older than the oldest of
# the dependencies.
+ # FIXME: These timestamps have only 1-second resolution.
+ # Time::HiRes fixes this, but assumes Perl 5.8 or later.
my $tmtime = mtime ($tfile);
my $omtime = mtime ($ofile);
my ($file, $mtime) = ($tmtime < $omtime
? ($ofile, $omtime) : ($tfile, $tmtime));
- # We depend at least upon the arguments.
- my @dep = @ARGV;
-
# stdin is always out of date.
- if (grep { $_ eq '-' } @dep)
+ if (grep { $_ eq '-' } @ARGV)
{ return 0 }
+ # We depend at least upon the arguments.
+ foreach my $dep (@ARGV)
+ {
+ if ($mtime < mtime ($dep))
+ {
+ verb "up_to_date ($file): outdated: $dep";
+ return 0;
+ }
+ }
+
# Files may include others. We can use traces since we just checked
# if they are available.
handle_traces ($req, "$tmp/dependencies",
@@ -909,18 +918,22 @@ sub up_to_date ($)
while ($_ = $deps->getline)
{
chomp;
- my $file = find_file ("$_?", @include);
+ my $dep = find_file ("$_?", @include);
# If a file which used to be included is no longer there, then
# don't say it's missing (it might no longer be included). But
# of course, that causes the output to be outdated (as if the
# timestamp of that missing file was newer).
return 0
- if ! $file;
- push @dep, $file;
+ if ! $dep;
+ if ($mtime < mtime ($dep))
+ {
+ verb "up_to_date ($file): outdated: $dep";
+ return 0;
+ }
}
- # If $FILE is younger than one of its dependencies, it is outdated.
- return up_to_date_p ($file, @dep);
+ verb "up_to_date ($file): up to date";
+ return 1;
}