m4 quoting fixlet
[automake.git] / m4 / sanity.m4
blob5e3b26ddea0266c824ef901361bb96c7c758e551
2 # Check to make sure that the build environment is sane.
5 AC_DEFUN(AM_SANITY_CHECK,
6 [AC_MSG_CHECKING([whether build environment is sane])
7 # Just in case
8 sleep 1
9 echo timestamp > conftestfile
10 # Do `set' in a subshell so we don't clobber the current shell's
11 # arguments.  Must try -L first in case configure is actually a
12 # symlink; some systems play weird games with the mod time of symlinks
13 # (eg FreeBSD returns the mod time of the symlink's containing
14 # directory).
15 if (
16    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
17    if test "[$]@" = "X"; then
18       # -L didn't work.
19       set X `ls -t $srcdir/configure conftestfile`
20    fi
21    test "[$]2" = conftestfile
22    )
23 then
24    # Ok.
25    :
26 else
27    AC_MSG_ERROR([newly created file is older than distributed files!
28 Check your system clock])
30 rm -f conftest*
31 AC_MSG_RESULT(yes)])