+2006-10-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * lib/autoconf/c.m4 (_AC_PROG_PREPROC_WORKS_IFELSE): Remove
+ comment about ac_cpp_err; it was incorrect, and anyway
+ ac_cpp_err is being removed below.
+ * lib/autoconf/general.m4 (_AC_PREPROC_IFELSE): Don't
+ set ac_cpp_err to 'yesyes' if preproc_warn_flag and werror_flag
+ are both 'yes'. In fact, don't bother setting ac_cpp_err at all;
+ nobody uses it.
+ (_AC_COMPILE_IFELSE, _AC_LINK_IFELSE): Don't log our funky tests
+ with werror_flag and conftest.err and so forth. This is more
+ compatible with how _AC_PROG_PREPROC_WORKS_IFELSE behaves,
+ and anyway the user shouldn't normally want to see this gorp logged.
+ Problem reported by Ralf Wildenhues.
+ * lib/autoconf/lang.m4 (AC_LANG_WERROR): werror_flag's default is
+ empty, not 'no', since the rest of the code uses 'test -z'.
+
2006-10-04 Paul Eggert <eggert@cs.ucla.edu>
* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE, _AC_LINK_IFELSE):
# Try to preprocess PROGRAM.
#
# This macro can be used during the selection of a preprocessor.
-# Run cpp and set ac_cpp_err to "yes" for an error, to
-# "$ac_(c,cxx)_preproc_warn_flag" if there are warnings or to "" if
-# neither warnings nor errors have been detected. eval is necessary
-# to expand ac_cpp.
+# eval is necessary to expand ac_cpp.
AC_DEFUN([_AC_PREPROC_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
-if _AC_DO_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
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-AS_IF([test -z "$ac_cpp_err"], [$2], [_AC_MSG_LOG_CONFTEST
+AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ }],
+ [$2],
+ [_AC_MSG_LOG_CONFTEST
$3])
rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_PREPROC_IFELSE
m4_define([_AC_COMPILE_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext
-AS_IF([_AC_DO_STDERR($ac_compile) &&
- _AC_DO_TOKENS([{
- test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext])],
+AS_IF([_AC_DO_STDERR($ac_compile) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext],
[$2],
[_AC_MSG_LOG_CONFTEST
$3])
m4_define([_AC_LINK_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext conftest$ac_exeext
-AS_IF([_AC_DO_STDERR($ac_link) &&
- _AC_DO_TOKENS([{
- test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
- test ! -s conftest.err
- } &&
- test -s conftest$ac_exeext &&
- AS_EXECUTABLE_P([conftest$ac_exeext])])],
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ AS_EXECUTABLE_P([conftest$ac_exeext])],
[$2],
[_AC_MSG_LOG_CONFTEST
$3])
# Treat warnings from the current language's preprocessor, compiler, and
# linker as fatal errors.
AC_DEFUN([AC_LANG_WERROR],
-[m4_divert_text([DEFAULTS], [ac_[]_AC_LANG_ABBREV[]_werror_flag=no])
+[m4_divert_text([DEFAULTS], [ac_[]_AC_LANG_ABBREV[]_werror_flag=])
ac_[]_AC_LANG_ABBREV[]_werror_flag=yes])# AC_LANG_WERROR