[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PROG_WERROR
From: |
Daniel Jacobowitz |
Subject: |
Re: AC_PROG_WERROR |
Date: |
Thu, 2 Oct 2003 12:36:45 -0400 |
User-agent: |
Mutt/1.5.1i |
On Thu, Oct 02, 2003 at 09:18:32AM +0200, Akim Demaille wrote:
> Issues:
>
> 1. I think the name is wrong indeed, and I'm not sure we want this
> to be independent of the current language
>
> 2. The documentation should make it clear when and why using this
> macro
>
> 3. NEWS it please :)
How's this? Any better?
2003-10-01 Daniel Jacobowitz <address@hidden>
* lib/autoconf/lang.m4 (AC_LANG_WERROR): New macro.
* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE, _AC_PREPROC_IFELSE)
(_AC_LINK_IFELSE): Check the werror flag.
* doc/autoconf.texi (Generic Compiler Characteristics): Document
AC_LANG_WERROR.
* NEWS: Mention it.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.761
diff -u -p -r1.761 autoconf.texi
--- doc/autoconf.texi 26 Sep 2003 13:55:04 -0000 1.761
+++ doc/autoconf.texi 2 Oct 2003 15:32:08 -0000
@@ -384,7 +384,7 @@ Types
Compilers and Preprocessors
* Specific Compiler Characteristics:: Some portability issues
-* Generic Compiler Characteristics:: Language independent tests
+* Generic Compiler Characteristics:: Language independent tests and features
* C Compiler:: Checking its characteristics
* C++ Compiler:: Likewise
* Fortran 77 Compiler:: Likewise
@@ -5110,7 +5110,7 @@ compiling.
@menu
* Specific Compiler Characteristics:: Some portability issues
-* Generic Compiler Characteristics:: Language independent tests
+* Generic Compiler Characteristics:: Language independent tests and features
* C Compiler:: Checking its characteristics
* C++ Compiler:: Likewise
* Fortran 77 Compiler:: Likewise
@@ -5177,6 +5177,17 @@ AC_CHECK_SIZEOF(int *)
defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
@end defmac
address@hidden AC_LANG_WERROR
address@hidden
+Normally Autoconf ignores warnings generated by the compiler, linker, and
+preprocessor. If this macro is used, warnings will be treated as fatal
+errors instead for the current language. This macro is useful when the
+results of configuration will be used where warnings are unacceptable; for
+instance, if parts of a program are built with the GCC @samp{-Werror}
+option. If the whole program will be built using @samp{-Werror} it is
+often simpler to put @samp{-Werror} in @code{CFLAGS}, @code{CXXFLAGS}, et
+cetera.
address@hidden defmac
@node C Compiler
@subsection C Compiler Characteristics
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.818
diff -u -p -r1.818 general.m4
--- lib/autoconf/general.m4 26 Sep 2003 09:11:23 -0000 1.818
+++ lib/autoconf/general.m4 2 Oct 2003 15:32:10 -0000
@@ -2046,6 +2046,7 @@ AC_DEFUN([_AC_PREPROC_IFELSE],
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
else
ac_cpp_err=
fi
@@ -2127,7 +2128,9 @@ 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_TRY_EVAL(ac_compile) &&
+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])],
[$2],
[_AC_MSG_LOG_CONFTEST
@@ -2166,7 +2169,9 @@ 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_TRY_EVAL(ac_link) &&
+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])],
[$2],
[_AC_MSG_LOG_CONFTEST
Index: lib/autoconf/lang.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v
retrieving revision 1.165
diff -u -p -r1.165 lang.m4
--- lib/autoconf/lang.m4 3 Sep 2003 00:35:53 -0000 1.165
+++ lib/autoconf/lang.m4 2 Oct 2003 15:32:10 -0000
@@ -617,3 +617,11 @@ ac_objext=$OBJEXT
## ------------------------------- ##
## 4. Compilers' characteristics. ##
## ------------------------------- ##
+
+# AC_LANG_WERROR
+# ------------------
+# 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])
+ac_[]_AC_LANG_ABBREV[]_werror_flag=yes])# AC_LANG_WERROR
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.311
diff -u -p -r1.311 NEWS
--- NEWS 1 Oct 2003 10:29:39 -0000 1.311
+++ NEWS 2 Oct 2003 15:34:25 -0000
@@ -1,4 +1,9 @@
-* Major changes in Autoconf 2.57f -*- outline -*-
+* Major changes in Autoconf 2.57g -*- outline -*-
+
+** New macros
+ AC_LANG_WERROR
+
+* Major changes in Autoconf 2.57f
Released 2003-10-01, by Akim Demaille.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
- AC_PROG_WERROR, Daniel Jacobowitz, 2003/10/01
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/02
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/02
- Re: AC_PROG_WERROR,
Daniel Jacobowitz <=
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/03
- Re: AC_PROG_WERROR, Daniel Jacobowitz, 2003/10/16
- Re: AC_PROG_WERROR, Daniel Jacobowitz, 2003/10/16
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/17
- Re: AC_PROG_WERROR, Daniel Jacobowitz, 2003/10/20
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/23
- Re: AC_PROG_WERROR, Daniel Jacobowitz, 2003/10/23
- Re: AC_PROG_WERROR, Akim Demaille, 2003/10/23