* 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.
This commit is contained in:
Paul Eggert 2005-02-11 19:12:29 +00:00
parent deae038e8f
commit 5c70aeca3f
5 changed files with 35 additions and 19 deletions

View File

@ -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,

View 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

View 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

View 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])],

View 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