source: trunk/essentials/sys-devel/automake-1.10/m4/sanity.m4

Last change on this file was 3147, checked in by bird, 18 years ago

automake 1.10

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