2 # Check to make sure that the build environment is sane.
5 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 AC_DEFUN([AM_SANITY_CHECK],
27 [AC_MSG_CHECKING([whether build environment is sane])
30 echo timestamp > conftest.file
31 # Do `set' in a subshell so we don't clobber the current shell's
32 # arguments. Must try -L first in case configure is actually a
33 # symlink; some systems play weird games with the mod time of symlinks
34 # (eg FreeBSD returns the mod time of the symlink's containing
37 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
38 if test "$[*]" = "X"; then
40 set X `ls -t $srcdir/configure conftest.file`
43 if test "$[*]" != "X $srcdir/configure conftest.file" \
44 && test "$[*]" != "X conftest.file $srcdir/configure"; then
46 # If neither matched, then we have a broken ls. This can happen
47 # if, for instance, CONFIG_SHELL is bash and it inherits a
48 # broken ls alias from the environment. This has actually
49 # happened. Such a system could not be considered "sane".
50 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
51 alias in your environment])
54 test "$[2]" = conftest.file
60 AC_MSG_ERROR([newly created file is older than distributed files!
61 Check your system clock])