]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Redirect stdin
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 11 Feb 2005 19:12:29 +0000 (19:12 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 11 Feb 2005 19:12:29 +0000 (19:12 +0000)
from /dev/null, as "configure" shouldn't read stdin, and this
insulates us from problems (e.g., when testing for "cl").
Suggested by Alexandre Duret-Lutz.  Also, do this redirection
before invoking "hostname" or "uname".
(_AC_PREPROC_IFELSE, _AC_COMPILE_IFELSE,
_AC_LINK_IFELSE): Undo previous change, as it's no longer needed.
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX): Don't bother with
"</dev/null" since it's now done at the top of 'configure'.
* lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
* lib/autoconf/programs.m4 (_AC_PATH_PROG_FLAVOR_GNU): Likewise.
Also, replace grep with shell pattern-matching, to save a process.

ChangeLog
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/general.m4
lib/autoconf/programs.m4

index 291297fd7149e74836d094a4650170263f97d815..3240557e8c40af2514b6619ebc673afde4726bce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-02-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autoconf/general.m4 (_AC_INIT_DEFAULTS): Redirect stdin
+       from /dev/null, as "configure" shouldn't read stdin, and this
+       insulates us from problems (e.g., when testing for "cl").
+       Suggested by Alexandre Duret-Lutz.  Also, do this redirection
+       before invoking "hostname" or "uname".
+       (_AC_PREPROC_IFELSE, _AC_COMPILE_IFELSE,
+       _AC_LINK_IFELSE): Undo previous change, as it's no longer needed.
+       * lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX): Don't bother with
+       "</dev/null" since it's now done at the top of 'configure'.
+       * lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
+       * lib/autoconf/programs.m4 (_AC_PATH_PROG_FLAVOR_GNU): Likewise.
+       Also, replace grep with shell pattern-matching, to save a process.
+
 2005-02-10  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/autoconf/general.m4 (_AC_PREPROC_IFELSE, _AC_COMPILE_IFELSE,
index 47942ac7140f1988d4ce785ea864944a4fb977bc..52f31c36a31df17cece4d580f0c0a3116aee58c6 100644 (file)
@@ -476,9 +476,9 @@ test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
 echo "$as_me:$LINENO:" \
      "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
 ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
 
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
@@ -705,9 +705,9 @@ AC_CHECK_TOOLS(CXX,
 echo "$as_me:$LINENO:" \
      "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
 ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
 
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
index b758d0183bba090562f44e83517b5c4ad8b17157..d5149bbfe6d54beb5f71c647c4715790801b0fba 100644 (file)
@@ -364,9 +364,9 @@ AC_CHECK_TOOLS([]_AC_FC[],
 echo "$as_me:__oline__:" \
      "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
 ac_compiler=`set X $ac_compile; echo $[2]`
-_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
-_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
 rm -f a.out
 
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
index 7af2f2869d6969fafb5abc79bb2a030a5be10ca4..8fd337f4f9f8833a336ea6bacd2666c16cd9013d 100644 (file)
@@ -377,13 +377,13 @@ AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
 m4_define([_AC_INIT_DEFAULTS],
 [m4_divert_push([DEFAULTS])dnl
 
+exec </dev/null AS_MESSAGE_FD>&1
+
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec AS_MESSAGE_FD>&1
-
 #
 # Initializations.
 #
@@ -2133,7 +2133,7 @@ AC_DEFUN([AC_RUN_LOG],
 # to expand ac_cpp.
 AC_DEFUN([_AC_PREPROC_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-if _AC_EVAL_STDERR([$ac_cpp conftest.$ac_ext]) </dev/null >/dev/null; then
+if _AC_EVAL_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
     ac_cpp_err=$ac_cpp_err$ac_[]_AC_LANG_ABBREV[]_werror_flag
@@ -2218,7 +2218,7 @@ AC_DEFUN([AC_EGREP_HEADER],
 m4_define([_AC_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 rm -f conftest.$ac_objext
-AS_IF([_AC_EVAL_STDERR($ac_compile) </dev/null &&
+AS_IF([_AC_EVAL_STDERR($ac_compile) &&
         AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag"
                         || test ! -s conftest.err]) &&
         AC_TRY_COMMAND([test -s conftest.$ac_objext])],
@@ -2259,7 +2259,7 @@ AU_DEFUN([AC_TRY_COMPILE],
 m4_define([_AC_LINK_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 rm -f conftest.$ac_objext conftest$ac_exeext
-AS_IF([_AC_EVAL_STDERR($ac_link) </dev/null &&
+AS_IF([_AC_EVAL_STDERR($ac_link) &&
         AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag"
                         || test ! -s conftest.err]) &&
         AC_TRY_COMMAND([test -s conftest$ac_exeext])],
index 3a881baaff2e115fe420613a6e751a455590503d..e98ecc40a46b81fa6d777da822fd5408de5f58ca 100644 (file)
@@ -497,12 +497,13 @@ dnl   # for best performing tool in a list breaks down.
 # ----------------------------------------------------------------
 m4_define([_AC_PATH_PROG_FLAVOR_GNU],
 [# Check for GNU $1
-if "$1" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
-  $2
+case `"$1" --version 2>&1` in
+*GNU*)
+  $2;;
 m4_ifval([$3],
-[else
-  $3
-])fi
+[*)
+  $3;;
+])esac
 ])# _AC_PATH_PROG_FLAVOR_GNU