]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Jun 2007 16:52:24 +0000 (16:52 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Jun 2007 16:52:24 +0000 (16:52 +0000)
Problem reported by Fred Kreek in
<http://lists.gnu.org/archive/html/bug-autoconf/2007-06/msg00009.html>.
* doc/autoconf.texi (Special Shell Variables): Warn about FPATH.
(Macro Names, Defining Directories): Don't mention PATH as a name
for a fully qualified file name, as this usage violates the GNU
coding standards and we shouldn't recommend it.

* lib/autotest/general.m4 (AT_INIT): Don't set PATH to the empty
string and then assume shell builtins like "test" will work.

ChangeLog
doc/autoconf.texi
lib/autotest/general.m4
lib/m4sugar/m4sh.m4

index 3527824f826a7577df1576b1988b3eaac87e1c81..86ecdbb094482802fb384a89095f35f78abd3269 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-06-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too.
+       Problem reported by Fred Kreek in
+       <http://lists.gnu.org/archive/html/bug-autoconf/2007-06/msg00009.html>.
+       * doc/autoconf.texi (Special Shell Variables): Warn about FPATH.
+       (Macro Names, Defining Directories): Don't mention PATH as a name
+       for a fully qualified file name, as this usage violates the GNU
+       coding standards and we shouldn't recommend it.
+
+       * lib/autotest/general.m4 (AT_INIT): Don't set PATH to the empty
+       string and then assume shell builtins like "test" will work.
+
 2007-06-12  Noah Misch  <noah@cs.caltech.edu>
 
        * lib/autoconf/general.m4 (AC_SUBST): Raise a fatal error if VARIABLE is
index 7268a59263e9d6511fdc8a8833e67d5d5b1ada60..1a663f6e59e9cb484de704fc2ba4d5401759a071 100644 (file)
@@ -10479,8 +10479,6 @@ Posix group owners of files.
 Header files.
 @item LIB
 C libraries.
-@item PATH
-Absolute names of files, including programs.
 @item PROG
 The base names of programs.
 @item MEMBER
@@ -12148,6 +12146,13 @@ PS2='> '
 PS4='+ '
 @end example
 
+@item FPATH
+The Korn shell uses @env{FPATH} to find shell functions, so avoid
+@env{FPATH} in portable scripts.  @env{FPATH} is consulted after
+@env{PATH}, but you still need to be wary of tests that use @env{PATH}
+to find whether a command exists, since they might report the wrong
+result if @env{FPATH} is also set.
+
 @item IFS
 @evindex IFS
 Long ago, shell scripts inherited @env{IFS} from the environment,
@@ -19181,11 +19186,6 @@ Note that all the previous solutions hard wire the absolute name of
 these directories in the executables, which is not a good property.  You
 may try to compute the names relative to @code{prefix}, and try to
 find @code{prefix} at runtime, this way your package is relocatable.
-Some macros are already available to address this issue: see
-@code{adl_COMPUTE_RELATIVE_PATHS} and
-@code{adl_COMPUTE_STANDARD_RELATIVE_PATHS} on the
-@uref{http://autoconf-archive.cryp.to/,
-Autoconf Macro Archive}.
 @end itemize
 
 
index 04a1f9524437bd3057e2b26d2ae3f577b16c16b3..7ede11aeb04a43b18e5ef8ed65e741369c6384db 100644 (file)
@@ -581,19 +581,20 @@ esac])
 #
 # There might be directories that don't exist, but don't redirect
 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
-PATH=
+at_new_path=
 _AS_PATH_WALK([$at_path],
 [as_dir=`(cd "$as_dir" && pwd) 2>/dev/null`
 test -d "$as_dir" || continue
-case $PATH in
+case $at_new_path in
                  $as_dir                 | \
                  $as_dir$PATH_SEPARATOR* | \
   *$PATH_SEPARATOR$as_dir                 | \
   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;;
 
-  '') PATH=$as_dir ;;
-   *) PATH=$PATH$PATH_SEPARATOR$as_dir ;;
+  '') at_new_path=$as_dir ;;
+   *) at_new_path=$at_new_path$PATH_SEPARATOR$as_dir ;;
 esac])
+PATH=$at_new_path
 export PATH
 
 # Setting up the FDs.
index c6a16850ef7d6532452ef729385d2021c8b9e0e8..b0a46b19eb7e1e4e7544143f68a65f4199ff75e9 100644 (file)
@@ -1027,7 +1027,7 @@ if test "${PATH_SEPARATOR+set}" != set; then
   echo "#! /bin/sh" >conf$$.sh
   echo  "exit 0"   >>conf$$.sh
   chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+  if (PATH="/nonexistent;."; FPATH=$PATH; conf$$.sh) >/dev/null 2>&1; then
     PATH_SEPARATOR=';'
   else
     PATH_SEPARATOR=: