summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-02-12 02:12:42 -0500
committerMike Frysinger <vapier@gentoo.org>2022-02-12 03:38:32 -0500
commitbe55eaaa0bae0d6def92d5720b0e81f1d21a9db2 (patch)
tree0351ac886bb997ee2fb6c73adc4cf4df96fd1c3f
parent5c9e117c5f1366a301a62ff70c33405a9aa23921 (diff)
downloadautomake-be55eaaa0bae0d6def92d5720b0e81f1d21a9db2.tar.gz
m4: cache build env sanity checks
When rerunning configure in an existing build dir, cache the previous results about environment settings. There should be no need to retest these in a dir that has already been configured. * m4/sanity.m4: Cache sanity results.
-rw-r--r--m4/sanity.m411
1 files changed, 6 insertions, 5 deletions
diff --git a/m4/sanity.m4 b/m4/sanity.m4
index 11b0bde5c..4e44dd9c4 100644
--- a/m4/sanity.m4
+++ b/m4/sanity.m4
@@ -9,7 +9,9 @@
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
+[dnl
+rm -f conftest.file
+AC_CACHE_CHECK([whether build environment is sane], am_cv_build_env_is_sane, [dnl
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -57,17 +59,16 @@ if (
test "$[2]" = conftest.file
)
then
- # Ok.
- :
+ am_cv_build_env_is_sane=yes
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT([yes])
+])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+if ! test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi