copied from automake-1.1l
[gnulib.git] / m4 / sanity.m4
1 #
2 # Check to make sure that the build environment is sane.
3 #
4
5 AC_DEFUN(AM_SANITY_CHECK,
6 [AC_MSG_CHECKING([whether build environment is sane])
7 echo timestamp > conftestfile
8 # Do this in a subshell so we don't clobber the current shell's
9 # arguments.  FIXME: maybe try `-L' hack like GETLOADAVG test?
10 if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
11 then
12    # Ok.
13    :
14 else
15    AC_MSG_ERROR([newly created file is older than distributed files!
16 Check your system clock])
17 fi
18 rm -f conftest*
19 AC_MSG_RESULT(yes)])