| Line | |
|---|
| 1 | #
|
|---|
| 2 | # Check to make sure that the build environment is sane.
|
|---|
| 3 | #
|
|---|
| 4 |
|
|---|
| 5 | # serial 3
|
|---|
| 6 |
|
|---|
| 7 | # AM_SANITY_CHECK
|
|---|
| 8 | # ---------------
|
|---|
| 9 | AC_DEFUN([AM_SANITY_CHECK],
|
|---|
| 10 | [AC_MSG_CHECKING([whether build environment is sane])
|
|---|
| 11 | # Just in case
|
|---|
| 12 | sleep 1
|
|---|
| 13 | echo timestamp > conftest.file
|
|---|
| 14 | # Do `set' in a subshell so we don't clobber the current shell's
|
|---|
| 15 | # arguments. Must try -L first in case configure is actually a
|
|---|
| 16 | # symlink; some systems play weird games with the mod time of symlinks
|
|---|
| 17 | # (eg FreeBSD returns the mod time of the symlink's containing
|
|---|
| 18 | # directory).
|
|---|
| 19 | if (
|
|---|
| 20 | set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
|---|
| 21 | if test "$[*]" = "X"; then
|
|---|
| 22 | # -L didn't work.
|
|---|
| 23 | set X `ls -t $srcdir/configure conftest.file`
|
|---|
| 24 | fi
|
|---|
| 25 | rm -f conftest.file
|
|---|
| 26 | if test "$[*]" != "X $srcdir/configure conftest.file" \
|
|---|
| 27 | && test "$[*]" != "X conftest.file $srcdir/configure"; then
|
|---|
| 28 |
|
|---|
| 29 | # If neither matched, then we have a broken ls. This can happen
|
|---|
| 30 | # if, for instance, CONFIG_SHELL is bash and it inherits a
|
|---|
| 31 | # broken ls alias from the environment. This has actually
|
|---|
| 32 | # happened. Such a system could not be considered "sane".
|
|---|
| 33 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|---|
| 34 | alias in your environment])
|
|---|
| 35 | fi
|
|---|
| 36 |
|
|---|
| 37 | test "$[2]" = conftest.file
|
|---|
| 38 | )
|
|---|
| 39 | then
|
|---|
| 40 | # Ok.
|
|---|
| 41 | :
|
|---|
| 42 | else
|
|---|
| 43 | AC_MSG_ERROR([newly created file is older than distributed files!
|
|---|
| 44 | Check your system clock])
|
|---|
| 45 | fi
|
|---|
| 46 | AC_MSG_RESULT(yes)])
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.