Hi,

I discovered a bug in configure because my home directory path contains a symbolic link. The directory layout is like this:

/home/symlink -> /home
/home/fitzsim
/home/fitzsim/project

I hit the bug when Eclipse does this:

$ cd /home/fitzsim/project
$ /home/symlink/fitzsim/classpath/configure

The first run completes successfully. Subsequent runs of the same command produce this error:

configure: error: source directory already configured; run "make distclean" there first

Here is the relevant configure fragment:

# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
   test -f $srcdir/config.status; then
{ { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
   { (exit 1); exit 1; }; }
fi

The problem in general is that because sh's builtin pwd returns the logical path by default, this test:

test "`cd $srcdir && pwd`" != "`pwd`"

may return the unintended result if $0 or the logical working directory contains one or more symbolic links.

A possible solution is to use for this test the system pwd, which always returns a physical path, instead of the builtin pwd.

Tom


Reply via email to