bug-autoconf
[Top][All Lists]
Advanced

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

Re: configure: error: no acceptable C compiler found in $PATH (+possible


From: Paul Eggert
Subject: Re: configure: error: no acceptable C compiler found in $PATH (+possible solution)
Date: Wed, 13 Jun 2007 09:53:15 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Thanks for the bug report.  I audited Autoconf looking for PATH
glitches and installed this patch:

2007-06-13  Paul Eggert  <address@hidden>

        * 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.

Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.206
diff -u -p -r1.206 m4sh.m4
--- lib/m4sugar/m4sh.m4 30 Apr 2007 17:11:50 -0000      1.206
+++ lib/m4sugar/m4sh.m4 13 Jun 2007 16:52:19 -0000
@@ -1027,7 +1027,7 @@ if test "${PATH_SEPARATOR+set}" != set; 
   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=:
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1160
diff -u -p -r1.1160 autoconf.texi
--- doc/autoconf.texi   4 Jun 2007 22:49:42 -0000       1.1160
+++ doc/autoconf.texi   13 Jun 2007 16:52:20 -0000
@@ -10479,8 +10479,6 @@ Posix group owners of files.
 Header files.
 @item LIB
 C libraries.
address@hidden PATH
-Absolute names of files, including programs.
 @item PROG
 The base names of programs.
 @item MEMBER
@@ -12148,6 +12146,13 @@ PS2='> '
 PS4='+ '
 @end example

address@hidden FPATH
+The Korn shell uses @env{FPATH} to find shell functions, so avoid
address@hidden in portable scripts.  @env{FPATH} is consulted after
address@hidden, 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 har
 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
address@hidden and
address@hidden on the
address@hidden://autoconf-archive.cryp.to/,
-Autoconf Macro Archive}.
 @end itemize


Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.221
diff -u -p -r1.221 general.m4
--- lib/autotest/general.m4     7 May 2007 19:56:57 -0000       1.221
+++ lib/autotest/general.m4     13 Jun 2007 16:52:20 -0000
@@ -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.




reply via email to

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