bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in "srcdir already configured" test


From: Thomas Fitzsimmons
Subject: bug in "srcdir already configured" test
Date: Sat, 21 Oct 2006 20:15:52 -0400
User-agent: Thunderbird 1.5.0.7 (X11/20061008)

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

[Prev in Thread] Current Thread [Next in Thread]