| 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 |
# Just in case |
| 8 |
sleep 1 |
| 9 |
echo timestamp > conftest.file |
| 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 conftest.file 2> /dev/null` |
| 17 |
if test "[$]*" = "X"; then |
| 18 |
# -L didn't work. |
| 19 |
set X `ls -t $srcdir/configure conftest.file` |
| 20 |
fi |
| 21 |
if test "[$]*" != "X $srcdir/configure conftest.file" \ |
| 22 |
&& test "[$]*" != "X conftest.file $srcdir/configure"; then |
| 23 |
|
| 24 |
# If neither matched, then we have a broken ls. This can happen |
| 25 |
# if, for instance, CONFIG_SHELL is bash and it inherits a |
| 26 |
# broken ls alias from the environment. This has actually |
| 27 |
# happened. Such a system could not be considered "sane". |
| 28 |
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
| 29 |
alias in your environment]) |
| 30 |
fi |
| 31 |
|
| 32 |
test "[$]2" = conftest.file |
| 33 |
) |
| 34 |
then |
| 35 |
# Ok. |
| 36 |
: |
| 37 |
else |
| 38 |
AC_MSG_ERROR([newly created file is older than distributed files! |
| 39 |
Check your system clock]) |
| 40 |
fi |
| 41 |
rm -f conftest* |
| 42 |
AC_MSG_RESULT([yes])]) |