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: Paul Eggert
Subject: Re: Problem with symlinks and VPATH Builds
Date: Mon, 2 Sep 2002 00:50:53 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 25 Jul 2002 13:04:11 +0200
> 
> Wow.  Paul, would you install this in autoconf.texi?

OK, I installed this patch.  I hope it covers everything.

2002-09-02  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Limitations of Builtins): Explain why logical
        directory names are generally preferable to physical names.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.659
retrieving revision 1.660
diff -p -u -r1.659 -r1.660
--- doc/autoconf.texi   1 Sep 2002 10:26:58 -0000       1.659
+++ doc/autoconf.texi   2 Sep 2002 07:46:31 -0000       1.660
@@ -9218,25 +9218,26 @@ You can't use @command{!}, you'll have t
 The use of @samp{break 2}, etcetera, is safe.
 
 
address@hidden @command{cd} and @command{pwd}
address@hidden @command{cd}
 @c ---------------------------------
 @prindex @command{cd}
address@hidden @command{pwd}
address@hidden 1003.1-2001 requires that @command{cd} and
address@hidden must support the @option{-L} and @option{-P} options,
address@hidden 1003.1-2001 requires that @command{cd} must support
+the @option{-L} (``logical'') and @option{-P} (``physical'') options,
 with @option{-L} being the default.  However, traditional shells do
-not support these options, and their @command{cd} and @command{pwd}
-commands have the @option{-P} behavior.
+not support these options, and their @command{cd} command has the
address@hidden behavior.
 
 Portable scripts should assume neither option is supported, and should
 assume neither behavior is the default.  This can be a bit tricky,
 since the @acronym{POSIX} default behavior means that, for example,
address@hidden ..} and @samp{cd ..} may refer to different directories.  It
-is safe to use @command{cd @var{dir}} if @var{dir} contains no
address@hidden components.  Also, Autoconf-generated scripts check for this
-problem when computing variables like @code{ac_top_srcdir}
-(@pxref{Configuration Actions}), so it is safe to @command{cd} to
-these variables.
address@hidden ..} and @samp{cd ..} may refer to different directories if
+the current logical directory is a symbolic link.  It is safe to use
address@hidden @var{dir}} if @var{dir} contains no @file{..} components.
+Also, Autoconf-generated scripts check for this problem when computing
+variables like @code{ac_top_srcdir} (@pxref{Configuration Actions}),
+so it is safe to @command{cd} to these variables.
+
+Also please see the discussion of the @command{pwd} command.
 
 
 @item @command{case}
@@ -9466,7 +9467,41 @@ fi
 
 @item @command{pwd}
 @c ----------------
-See @command{cd} above.
address@hidden @command{pwd}
+With modern shells, plain @command{pwd} outputs a ``logical''
+directory name, some of whose components may be symbolic links.  These
+directory names are in contrast to ``physical'' directory names, whose
+components are all directories.
+
address@hidden 1003.1-2001 requires that @command{pwd} must support
+the @option{-L} (``logical'') and @option{-P} (``physical'') options,
+with @option{-L} being the default.  However, traditional shells do
+not support these options, and their @command{pwd} command has the
address@hidden behavior.
+
+Portable scripts should assume neither option is supported, and should
+assume neither behavior is the default.  Also, on many hosts
address@hidden/bin/pwd} is equivalent to @samp{pwd -P}, but @acronym{POSIX}
+does not require this behavior and portable scripts should not rely on
+it.
+
+Typically it's best to use plain @command{pwd}.  On modern hosts this
+outputs logical directory names, which have the following advantages:
+
address@hidden @bullet
address@hidden
+Logical names are what the user specified.
address@hidden
+Physical names may not be portable from one installation
+host to another due to network filesystem gymnastics.
address@hidden
+On modern hosts @samp{pwd -P} may fail due to lack of permissions to
+some parent directory, but plain @command{pwd} cannot fail for this
+reason.
address@hidden itemize
+
+Also please see the discussion of the @command{cd} command.
+
 
 @item @command{set}
 @c ----------------




reply via email to

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