bug fix
authorTom Tromey <tromey@redhat.com>
Sun, 23 Feb 1997 07:19:33 +0000 (07:19 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 23 Feb 1997 07:19:33 +0000 (07:19 +0000)
ChangeLog
m4/sanity.m4

index 0d467cc..05fc88f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Feb 23 00:10:36 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * m4/sanity.m4: Pass -L to ls if possible.
+
 Sat Feb 22 15:22:31 1997  Tom Tromey  <tromey@cygnus.com>
 
        * dist-vars.am (DISTFILES): Don't distribute MANS.
index 65ca999..df1c054 100644 (file)
@@ -5,9 +5,19 @@
 AC_DEFUN(AM_SANITY_CHECK,
 [AC_MSG_CHECKING([whether build environment is sane])
 echo timestamp > conftestfile
-# Do this in a subshell so we don't clobber the current shell's
-# arguments.  FIXME: maybe try `-L' hack like GETLOADAVG test?
-if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$@" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   test "[$]2" = conftestfile
+   )
 then
    # Ok.
    :