]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: omit 1s test in _AM_FILESYSTEM_TIMESTAMP_RESOLUTION, for speed.
authorBruno Haible <bruno@clisp.org>
Mon, 17 Jun 2024 22:38:11 +0000 (15:38 -0700)
committerKarl Berry <karl@freefriends.org>
Mon, 17 Jun 2024 22:38:11 +0000 (15:38 -0700)
From https://lists.gnu.org/archive/html/automake/2024-06/msg00055.html
plus https://lists.gnu.org/archive/html/automake/2024-06/msg00054.html.

* m4/sanity.m4 (_AM_FILESYSTEM_TIMESTAMP_RESOLUTION): Don't test
whether 1 sec works; instead just accept the 2 sec delay in the
Automake test $sleep in exchange for not incurring the 2s delay of
running the test for all packages on 1s-resolution platforms.
Platforms that support subsecond mtimes will still use them.

m4/sanity.m4

index 68fbf36f7300f13354d90623a57f4bcaf2c3898b..7452c1aefcec7c5cf5d8e1e98d4034517fc95fc6 100644 (file)
@@ -32,8 +32,17 @@ AC_CACHE_CHECK([filesystem timestamp resolution],
 # Default to the worst case.
 am_cv_filesystem_timestamp_resolution=2
 
-# Only try to go finer than 1s if sleep can do it.
-am_try_resolutions=1
+# Only try to go finer than 1 sec if sleep can do it.
+# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
+# - 1 sec is not much of a win compared to 2 sec, and
+# - it takes 2 seconds to perform the test whether 1 sec works.
+# 
+# Instead, just use the default 2s on platforms that have 1s resolution,
+# accept the extra 1s delay when using $sleep in the Automake tests, in
+# exchange for not incurring the 2s delay for running the test for all
+# packages.
+#
+am_try_resolutions=
 if $am_cv_sleep_fractional_seconds; then
   # Even a millisecond often causes a bunch of false positives,
   # so just try a hundredth of a second. The time saved between .001 and