autoconf
[Top][All Lists]
Advanced

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

Re: Problem with symlinks and VPATH Builds


From: Eric Siegerman
Subject: Re: Problem with symlinks and VPATH Builds
Date: Fri, 19 Jul 2002 12:08:33 -0400
User-agent: Mutt/1.2.5i

On Fri, Jul 19, 2002 at 07:31:24AM -0500, Mark D. Roth wrote:
> configure: creating ./config.status
> ./config.status[551]: ../../common/dummy-0.1:  not found
> ./config.status[552]: ../../common/dummy-0.1:  not found
> config.status: creating Makefile
> config.status: creating config.h
>
> [when one cd'ed to the build directory via a symlink, using ksh]
> 
> The fact that "cd ." doesn't work as expected is probably broken
> behavior on ksh's part

Yup, a ksh misfeature.  Bash too (and probably other ksh'ish
shells).  Actually, they're trying to make it work "as expected"
for interactive users.  If there were no symlinks involved,
        cd /usr/local/src
        cd ..
should take you back to /usr/local.  They're trying to replicate
that behaviour in the presence of symlinks.  *Sometimes* that's
what one wants...

> The only thing I can think of is
> to use "`/bin/pwd`" instead of "." for $ac_dir, but I'm not sure if
> that would break anything else.

That's probably best -- as long as one can depend on there to be
a /bin/pwd (as opposed to the builtin)...

The only other thing I can think of depends on knowing how to
keep the bogus info from propagating from the user's shell into
the process that's running the script.  In ksh and bash, it's via
the magic environment variable PWD, but how dependable is that?

Indeed, it's worse (though in a way that *probably* wouldn't
affect autoconf in practice).  If a new ksh process doesn't find
PWD in its environment, it initializes it to the (actual) current
directory.  I've edited the subshell's prompts to "$$$ " for
readability:
        $ cd $HOME/s
        $ env
        HOME=/home/erics        # symlink to /space1/export.home/erics
        PWD=/home/erics/s
        $ pwd
        /home/erics/s
        $ /bin/pwd
        /space1/export.home/erics/s
        $ ksh
        $$$ pwd
        /home/erics/s
        $$$ exit
        $ unset PWD
        $ ksh
        $$$ pwd
        /space1/export.home/erics/s
        $$$ /bin/pwd
        /space1/export.home/erics/s
        $$$ exit

Ok so far.  But, if you happen to be in your home directory at
the time, ksh initializes PWD to the value of $HOME (which may
refer to a symlink):
        $ cd $HOME/s
        $ cd ..
        $ pwd
        /home/erics
        $ /bin/pwd
        /space1/export.home/erics
        $ unset PWD
        $ ksh
        $$$ pwd
        /home/erics
        $$$ /bin/pwd
        /space1/export.home/erics
        $$$ exit

Too much weirdness (and probably variability) IMO.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
        - Paul Schneider-Esleben



reply via email to

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