(_AC_INIT_SRCDIR): Reject FOO if "cd FOO" and "ls FOO" talk about

different directories; this catches problems when POSIX 1003.1-2001
"cd" fails due to symlink spaghetti.
This commit is contained in:
Paul Eggert 2002-08-31 05:47:02 +00:00
parent 07fb756c7d
commit 4148c6e1d8

View File

@ -537,6 +537,8 @@ if test ! -r $srcdir/$ac_unique_file; then
AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
fi
fi
(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work])
dnl Double slashes in pathnames in object file debugging info
dnl mess up M-x gdb in Emacs.
srcdir=`echo "$srcdir" | sed 's%\([[^\\/]]\)[[\\/]]*$%\1%'`