]> git.ipfire.org Git - thirdparty/autoconf.git/commit
autom4te: report subsecond timestamp support in --version
authorZack Weinberg <zack@owlfolio.org>
Mon, 4 Dec 2023 16:22:24 +0000 (11:22 -0500)
committerZack Weinberg <zack@owlfolio.org>
Wed, 6 Dec 2023 20:57:05 +0000 (15:57 -0500)
commit39d96e6fff7ceae63b823872602caf4d255a38c8
treea0ad5afb923a2ee4ee7aea69580f8df45ee95cd0
parent49ab3a4c5756d7ef40b03111f4c8a351d6bca7b8
autom4te: report subsecond timestamp support in --version

The Automake test suite wants this in order to know if it’s safe to
reduce the length of various delays for the purpose of ensuring files
in autom4te.cache are newer than the corresponding source files.  We
can also take advantage of this to speed up a couple of tests in our
own testsuite.

* lib/Autom4te/FileUtils.pm: Provide (but do not export) a flag
  $subsecond_mtime, indicating whether the ‘mtime’ function reports
  modification time with precision greater than one second.
  Reorganize commentary and import logic for clarity.  Add
  configuration for emacs’ perl-mode to the bottom of the file.
* bin/autom4te.in ($version): If $Autom4te::FileUtils::subsecond_mtime
  is true, print “Features: subsecond-mtime” as the second line
  of --version output.

* lib/autotest/general.m4: Move definitions of AS_MESSAGE_LOG_FD,
  AT_JOB_FIFO_IN_FD, and AT_JOB_FIFO_OUT_FD to top level and change
  the latter two to be defined using _AT_DEFINE_INIT.  This enables
  use of AS_MESSAGE_LOG_FD in AT_TESTS_PREPARE code.

* tests/local.at (AT_MTIME_DELAY): New utility that delays a test for
  an appropriate time to ensure all files created before its use are
  considered older than all files created afterward.  The delay will
  be as short as possible.
  (AT_TESTS_PREPARE): Calculate and log the delay used by AT_MTIME_DELAY.
  Only use a delay shorter than one second if the build filesystem,
  our autom4te, and the automake on the PATH all support this.
  (AT_CMP): En passant removal of unnecessary blank lines.

* tests/tools.at: Use AT_MTIME_DELAY, instead of sleeping for a
  hardcoded interval, everywhere the delay was to control file
  timestamps.
bin/autom4te.in
lib/Autom4te/FileUtils.pm
lib/autotest/general.m4
tests/local.at
tests/tools.at