+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
Header files.
@item LIB
C libraries.
-@item PATH
-Absolute names of files, including programs.
@item PROG
The base names of programs.
@item MEMBER
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,
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
#
# 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.
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=: