checking whether sleep supports fractional seconds... true is inconsistent with the rest of the GNU Build System. Namely, in configure output, results are "yes"/"no", not "true"/"false". The attached patch makes automake consistent with the rest.
Thanks Bruno. I applied, plus "quoting" some of the $am_cv values that I happened to see around there. (No doubt more could be done in that regard, but anyway.) -k ----------------------------------------------------------------------------- automake: display whether sleep supports fractional seconds as yes/no. https://lists.gnu.org/archive/html/automake/2024-07/msg00003.html * m4/sanity.m4 (_AM_SLEEP_FRACTIONAL_SECONDS): Set am_cv_sleep_fractional_seconds to yes/no, not true/false, for consistency with other results. Also "quote" this and other $am_cv values. (_AM_FILESYSTEM_TIMESTAMP_RESOLUTION): Test for yes/no. * t/ax/test-defs.in: Set am_cv_sleep_fractional_seconds to 'no', not 'false'. diff --git a/m4/sanity.m4 b/m4/sanity.m4 index 9e556b33a..c7f32daf8 100644 --- a/m4/sanity.m4 +++ b/m4/sanity.m4 @@ -11,8 +11,8 @@ AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl -AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=true], - [am_cv_sleep_fractional_seconds=false]) +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION @@ -43,7 +43,7 @@ am_cv_filesystem_timestamp_resolution=2 # packages. # am_try_resolutions= -if $am_cv_sleep_fractional_seconds; then +if test "$am_cv_sleep_fractional_seconds" = yes; 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 # .01 is not terribly consequential. @@ -198,12 +198,12 @@ for am_try in 1 2; do break fi # Just in case. - sleep $am_cv_filesystem_timestamp_resolution + sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) -if test $am_build_env_is_sane = no; then +if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi @@ -212,7 +212,7 @@ fi # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl - ( sleep $am_cv_filesystem_timestamp_resolution ) & + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) AC_CONFIG_COMMANDS_PRE( diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in index aac5d60e3..542305788 100644 --- a/t/ax/test-defs.in +++ b/t/ax/test-defs.in @@ -211,7 +211,7 @@ case $MTIME_RESOLUTION in MTIME_RESOLUTION=1 # we must not sleep for fractional seconds when autom4te does not # support subsecond-mtimes, even when sleep supports it. See bug#67670. - am_cv_sleep_fractional_seconds=false + am_cv_sleep_fractional_seconds=no export am_cv_sleep_fractional_seconds fi ;; @@ -232,7 +232,7 @@ esac # scripts in other packages, too. # # At any rate, with this set to "sleep 1", there were still random -# parallelization failures; setting am_cv_sleep_fractional_seconds=false +# parallelization failures; setting am_cv_sleep_fractional_seconds=no # as above was still needed. # sleep="sleep $MTIME_RESOLUTION"