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

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

automake 1.7.9

File size: 2.1 KB
Line 
1#
2# Check to make sure that the build environment is sane.
3#
4
5# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
6
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)
10# any later version.
11
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.
16
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
20# 02111-1307, USA.
21
22# serial 3
23
24# AM_SANITY_CHECK
25# ---------------
26AC_DEFUN([AM_SANITY_CHECK],
27[AC_MSG_CHECKING([whether build environment is sane])
28# Just in case
29sleep 1
30echo 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
35# directory).
36if (
37 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
38 if test "$[*]" = "X"; then
39 # -L didn't work.
40 set X `ls -t $srcdir/configure conftest.file`
41 fi
42 rm -f conftest.file
43 if test "$[*]" != "X $srcdir/configure conftest.file" \
44 && test "$[*]" != "X conftest.file $srcdir/configure"; then
45
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
51alias in your environment])
52 fi
53
54 test "$[2]" = conftest.file
55 )
56then
57 # Ok.
58 :
59else
60 AC_MSG_ERROR([newly created file is older than distributed files!
61Check your system clock])
62fi
63AC_MSG_RESULT(yes)])
Note: See TracBrowser for help on using the repository browser.