From: Bruno Haible Date: Mon, 17 Jun 2024 22:38:11 +0000 (-0700) Subject: automake: omit 1s test in _AM_FILESYSTEM_TIMESTAMP_RESOLUTION, for speed. X-Git-Tag: v1.16.92~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fad36f78a34cd20af0e0dc185a350a315e2aca0d;p=thirdparty%2Fautomake.git automake: omit 1s test in _AM_FILESYSTEM_TIMESTAMP_RESOLUTION, for speed. 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. --- diff --git a/m4/sanity.m4 b/m4/sanity.m4 index 68fbf36f7..7452c1aef 100644 --- a/m4/sanity.m4 +++ b/m4/sanity.m4 @@ -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