On Wed Jul 24 02:03 2002 -0700, Paul Eggert wrote:
> OK, now I understand the problem.  I also see that the problem occurs
> even in absolute path names.  For example, with /bin/ksh on Solaris 8:
> 
> 33-sic $ ls -ld /tmp/usr/local/src/dummy-0.1/../../common
> drwxrwxr-x   3 eggert   eggert       183 Jul 24 01:54 
>/tmp/usr/local/src/dummy-0.1/../../common
> 34-sic $ cd /tmp/usr/local/src/dummy-0.1/../../common
> /bin/ksh: /tmp/usr/local/src/dummy-0.1/../../common:  not found
> 
> What a botch!

Exactly. ;/


> No, mine uses /bin/bash and not /bin/ksh.  This probably explains it.
> You don't have the SUNWbash package installed, so you don't have
> /bin/bash.

Yeah, that explains the difference.


> However, I still don't like the solution of invoking /bin/pwd first,
> for the reasons I mentioned earlier.  Why can't we fall back on
> /bin/pwd only if the current method fails?  That way, only the poor
> ksh users will be stuck with the problems of ugly names and/or
> /bin/pwd failing.

Sounds reasonable.  Please look over the attached patch and let me
know what you think.  If it looks good, I'll commit it.

Thanks!

-- 
Mark D. Roth <[EMAIL PROTECTED]>
http://www.feep.net/~roth/
cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvsroot/autoconf/autoconf/ChangeLog,v
retrieving revision 1.1972
diff -u -r1.1972 ChangeLog
--- ChangeLog   23 Jul 2002 22:16:36 -0000      1.1972
+++ ChangeLog   25 Jul 2002 00:50:50 -0000
@@ -1,3 +1,9 @@
+2002-07-24  Mark D. Roth  <[EMAIL PROTECTED]>
+
+       * lib/autoconf/status.m4 (_AC_SRCPATHS): Fall back to using
+       "`/bin/pwd`" if using "." fails because of broken ksh behavior
+       when $PWD involves a symlink.
+
 2002-07-23  Paul Eggert  <[EMAIL PROTECTED]>
 
        * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE):
cvs server: Diffing bin
cvs server: Diffing config
cvs server: Diffing doc
cvs server: Diffing lib
cvs server: Diffing lib/Autom4te
cvs server: Diffing lib/autoconf
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.29
diff -u -r1.29 status.m4
--- lib/autoconf/status.m4      18 Jul 2002 11:57:32 -0000      1.29
+++ lib/autoconf/status.m4      25 Jul 2002 00:51:11 -0000
@@ -164,8 +164,17 @@
 # absolute.
 ac_abs_builddir=`cd $1 && cd $ac_builddir && pwd`
 ac_abs_top_builddir=`cd $1 && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd $1 && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd $1 && cd $ac_top_srcdir && pwd`
+# Fall back to using "`/bin/pwd`" if "." fails because of
+# broken ksh behavior when $PWD involves a symlink.
+ac_pwd=`/bin/pwd 2>/dev/null`
+ac_abs_srcdir=`cd $1 && cd $ac_srcdir 2>/dev/null && pwd`
+if test $? -ne 0 && test $1 = . && test -n "$ac_pwd"; then
+  ac_abs_srcdir=`cd $ac_pwd && cd $ac_srcdir && pwd`
+fi
+ac_abs_top_srcdir=`cd $1 && cd $ac_top_srcdir 2>/dev/null && pwd`
+if test $? -ne 0 && test $1 = . && test -n "$ac_pwd"; then
+  ac_abs_top_srcdir=`cd $ac_pwd && cd $ac_top_srcdir && pwd`
+fi
 ])# _AC_SRCPATHS
 
 
cvs server: Diffing lib/autoscan
cvs server: Diffing lib/autotest
cvs server: Diffing lib/emacs
cvs server: Diffing lib/m4sugar
cvs server: Diffing m4
cvs server: Diffing man
cvs server: Diffing tests
cvs server: Diffing testsuite
cvs server: Diffing testsuite/autoconf.g
cvs server: Diffing testsuite/autoconf.s
cvs server: Diffing testsuite/autoconf.torture
cvs server: Diffing testsuite/config
cvs server: Diffing testsuite/lib

Reply via email to