When testing for source and build tree equality, and test -ef doesn't work,
authorPeter Eisentraut
Mon, 10 Sep 2001 23:52:04 +0000 (23:52 +0000)
committerPeter Eisentraut
Mon, 10 Sep 2001 23:52:04 +0000 (23:52 +0000)
fall back to `cd $srcdir && /bin/pwd` = `/bin/pwd`.  One of these ought to
work, and if not, prep_buildtree is harmless.

configure
configure.in

index 60a07b0095db122b39330a9b10309ce0d961f60b..cfdd412655670eb820a4ae4944435b51e8577877 100755 (executable)
--- a/configure
+++ b/configure
@@ -8581,25 +8581,21 @@ done
 
 fi
 
-# check whether 'test -ef' works
-if (test "$srcdir" -ef "$srcdir") >/dev/null 2>&1 ; then
-  test_ef_works=yes
-else
-  test_ef_works=no
-fi
-
 abs_top_srcdir=
 
 
-if test "$test_ef_works" = yes ; then
 # prepare build tree if outside source tree
-  if test "$srcdir" -ef . ; then : ; else
+# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
+# Note 2: /bin/pwd might be better than shell's built-in at getting
+#         a symlink-free name.
+if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
+    :
+else
     abs_top_srcdir=`cd $srcdir && pwd`
     echo $ac_n "preparing build tree... $ac_c" 1>&6
     /bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \
       || { echo "configure: error: failed" 1>&2; exit 1; }
     echo "$ac_t""done" 1>&6
-  fi
 fi
 
 trap '' 1 2 15
index fdbd10e0a8831eb81386a9db74dfb1179f7a026c..56e6a953cfb34ac880ab25a4698423169208bd78 100644 (file)
@@ -1219,25 +1219,21 @@ if test -n "$NSGMLS"; then
   AC_CHECK_PROGS(SGMLSPL, sgmlspl)
 fi
 
-# check whether 'test -ef' works
-if (test "$srcdir" -ef "$srcdir") >/dev/null 2>&1 ; then
-  test_ef_works=yes
-else
-  test_ef_works=no
-fi
-
 abs_top_srcdir=
 AC_SUBST(abs_top_srcdir)
 
-if test "$test_ef_works" = yes ; then
 # prepare build tree if outside source tree
-  if test "$srcdir" -ef . ; then : ; else
+# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
+# Note 2: /bin/pwd might be better than shell's built-in at getting
+#         a symlink-free name.
+if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
+    :
+else
     abs_top_srcdir=`cd $srcdir && pwd`
     echo $ac_n "preparing build tree... $ac_c" 1>&6
     /bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \
       || AC_MSG_ERROR(failed)
     AC_MSG_RESULT(done)
-  fi
 fi
 
 AC_OUTPUT(