From: Paul Eggert Date: Wed, 13 Jun 2007 16:52:24 +0000 (+0000) Subject: * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too. X-Git-Tag: v2.62~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48656aea072bae09f1534c1a53ad57fc870e2bde;p=thirdparty%2Fautoconf.git * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too. Problem reported by Fred Kreek in . * 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. --- diff --git a/ChangeLog b/ChangeLog index 3527824f..86ecdbb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-06-13 Paul Eggert + + * lib/m4sugar/m4sh.m4 (_AS_PATH_SEPARATOR_PREPARE): Set FPATH too. + Problem reported by Fred Kreek in + . + * 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 * lib/autoconf/general.m4 (AC_SUBST): Raise a fatal error if VARIABLE is diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 7268a592..1a663f6e 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 04a1f952..7ede11ae 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -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. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index c6a16850..b0a46b19 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -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=: