From: Akim Demaille Date: Wed, 9 Jan 2002 15:06:25 +0000 (+0000) Subject: * configure.in (WERROR_CFLAGS): Compute it. X-Git-Tag: BISON-1_30j~1 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/a99566be67a4079567e22df333fe7f121dc9285b?ds=inline * configure.in (WERROR_CFLAGS): Compute it. * src/Makefile.am (CFLAGS): Pass it. * tests/atlocal.in (CFLAGS): Idem. --- diff --git a/ChangeLog b/ChangeLog index a34a6aea..4db7c7e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-01-09 Akim Demaille + + * configure.in (WERROR_CFLAGS): Compute it. + * src/Makefile.am (CFLAGS): Pass it. + * tests/atlocal.in (CFLAGS): Idem. + 2002-01-08 Akim Demaille * lib/Makefile.am (libbison_a_SOURCES): Add xstrndup.c. diff --git a/Makefile.in b/Makefile.in index 948fcddb..a6827e2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ diff --git a/config/Makefile.in b/config/Makefile.in index 7c36eb6b..48e4a621 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ diff --git a/configure b/configure index d714936b..537f22a7 100755 --- a/configure +++ b/configure @@ -3209,6 +3209,55 @@ else enableval=no fi; if test "${enableval}" = yes; then + echo "$as_me:$LINENO: checking whether compiler accepts -Werror" >&5 +echo $ECHO_N "checking whether compiler accepts -Werror... $ECHO_C" >&6 + +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +int x; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + WARNING_CFLAGS="$WARNING_CFLAGS -Werror" +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +CFLAGS="$ac_save_CFLAGS" + WERROR_CFLAGS=$WARNING_CFLAGS + + WARNING_CFLAGS= echo "$as_me:$LINENO: checking whether compiler accepts -Wall" >&5 echo $ECHO_N "checking whether compiler accepts -Wall... $ECHO_C" >&6 @@ -3760,52 +3809,6 @@ echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext -CFLAGS="$ac_save_CFLAGS" - echo "$as_me:$LINENO: checking whether compiler accepts -Werror" >&5 -echo $ECHO_N "checking whether compiler accepts -Werror... $ECHO_C" >&6 - -ac_save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Werror" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -int x; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - WARNING_CFLAGS="$WARNING_CFLAGS -Werror" -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" fi @@ -9597,6 +9600,7 @@ s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@AUTOM4TE@,$AUTOM4TE,;t t s,@WARNING_CFLAGS@,$WARNING_CFLAGS,;t t +s,@WERROR_CFLAGS@,$WERROR_CFLAGS,;t t s,@U@,$U,;t t s,@ANSI2KNR@,$ANSI2KNR,;t t s,@ALLOCA@,$ALLOCA,;t t diff --git a/configure.in b/configure.in index 509d935c..6e407d41 100644 --- a/configure.in +++ b/configure.in @@ -49,6 +49,9 @@ AC_ARG_ENABLE(gcc-warnings, esac], [enableval=no]) if test "${enableval}" = yes; then + BISON_WARNING(-Werror) + AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS]) + WARNING_CFLAGS= BISON_WARNING(-Wall) BISON_WARNING(-W) BISON_WARNING(-Wbad-function-cast) @@ -61,7 +64,6 @@ if test "${enableval}" = yes; then BISON_WARNING(-Wshadow) BISON_WARNING(-Wstrict-prototypes) BISON_WARNING(-Wwrite-strings) - BISON_WARNING(-Werror) fi # Checks for libraries. diff --git a/lib/Makefile.in b/lib/Makefile.in index 5a7d5fd0..61180ffa 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ diff --git a/m4/Makefile.in b/m4/Makefile.in index c60adfd3..dec187df 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ diff --git a/src/Makefile.am b/src/Makefile.am index e9bf9ae2..6d0b6c94 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -## Copyright 2001 Free Software Foundation, Inc. +## Copyright 2001, 2002 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ DEFS = @DEFS@ \ -DBISON_HAIRY=\"$(pkgdatadir)/bison.hairy\" \ -DLOCALEDIR=\"$(datadir)/locale\" -CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) +CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) $(WERROR_CFLAGS) # libintl.h in is build/intl, intl/libgettext.h in src/, # config.h in build/. diff --git a/src/Makefile.in b/src/Makefile.in index f6f5b17c..eaa44126 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ @@ -109,7 +110,7 @@ DEFS = @DEFS@ \ -DLOCALEDIR=\"$(datadir)/locale\" -CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) +CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) $(WERROR_CFLAGS) # libintl.h in is build/intl, intl/libgettext.h in src/, # config.h in build/. diff --git a/tests/Makefile.in b/tests/Makefile.in index 7b06bdee..86a79f3e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -97,6 +97,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ diff --git a/tests/atlocal.in b/tests/atlocal.in index 19c09262..a189b2d6 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,10 +1,10 @@ # @configure_input@ -*- shell-script -*- # Configurable variable values for Bison test suite. -# Copyright 2000, 2001 Free Software Foundation, Inc. +# Copyright 2000, 2001, 2002 Free Software Foundation, Inc. # We need a C compiler. CC='@CC@' -CFLAGS='@CFLAGS@ @WARNING_CFLAGS@' +CFLAGS='@CFLAGS@ @WARNING_CFLAGS@ @WERROR_CFLAGS@' # We need `config.h'. CPPFLAGS="-I$abs_top_builddir @CPPFLAGS@"