Mercurial > hg > icedtea8
changeset 1960:7a7436abd808
Enable warnings only when --enable-warnings is given.
2009-08-04 Andrew John Hughes <ahughes@redhat.com>
* Makefile.am:
Remove unnecessary whitespace.
* acinclude.m4:
(IT_CHECK_ENABLE_WARNINGS): Add --enable-warnings
option to turn javac warnings on and off.
* configure.ac:
Enable IT_CHECK_ENABLE_WARNINGS macro.
* javac.in:
Turn on warnings only when specified.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Wed, 05 Aug 2009 14:19:58 +0100 |
parents | 777441157d99 |
children | adadd58eff31 |
files | ChangeLog Makefile.am acinclude.m4 configure.ac javac.in |
diffstat | 5 files changed, 43 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Aug 05 11:48:16 2009 +0100 +++ b/ChangeLog Wed Aug 05 14:19:58 2009 +0100 @@ -1,3 +1,15 @@ +2009-08-04 Andrew John Hughes <ahughes@redhat.com> + + * Makefile.am: + Remove unnecessary whitespace. + * acinclude.m4: + (IT_CHECK_ENABLE_WARNINGS): Add --enable-warnings + option to turn javac warnings on and off. + * configure.ac: + Enable IT_CHECK_ENABLE_WARNINGS macro. + * javac.in: + Turn on warnings only when specified. + 2009-08-04 Andrew John Hughes <ahughes@redhat.com> * Makefile.am:
--- a/Makefile.am Wed Aug 05 11:48:16 2009 +0100 +++ b/Makefile.am Wed Aug 05 14:19:58 2009 +0100 @@ -3232,7 +3232,7 @@ IcedTeaPluginUtils.o IcedTeaNPPlugin_objects: - cd $(NPPLUGIN_DIR); \ + cd $(NPPLUGIN_DIR); \ if [ -e $(abs_top_srcdir)/.hg ] && which $(HG) >/dev/null; then \ revision="-r`(cd $(abs_top_srcdir); $(HG) tip --template '{rev}')`" ; \ fi ; \
--- a/acinclude.m4 Wed Aug 05 11:48:16 2009 +0100 +++ b/acinclude.m4 Wed Aug 05 14:19:58 2009 +0100 @@ -1630,3 +1630,20 @@ AC_SUBST(USING_ECJ) AC_PROVIDE([$0])dnl ]) + +AC_DEFUN([IT_CHECK_ENABLE_WARNINGS], +[ + AC_MSG_CHECKING(whether to enable Java compiler warnings) + AC_ARG_ENABLE([warnings], + [AS_HELP_STRING(--enable-warnings,produce warnings from javac/ecj [[default=no]])], + [ + ENABLE_WARNINGS="${enableval}" + ], + [ + ENABLE_WARNINGS=no + ]) + + AC_MSG_RESULT(${ENABLE_WARNINGS}) + AM_CONDITIONAL(ENABLE_WARNINGS, test x"${ENABLE_WARNINGS}" = "xyes") + AC_SUBST(ENABLE_WARNINGS) +])
--- a/configure.ac Wed Aug 05 11:48:16 2009 +0100 +++ b/configure.ac Wed Aug 05 14:19:58 2009 +0100 @@ -231,6 +231,7 @@ IT_LIBRARY_CHECK IT_SCANNER_CHECK IT_PR40630_CHECK +IT_CHECK_ENABLE_WARNINGS FIND_RHINO_JAR WITH_OPENJDK_SRC_ZIP
--- a/javac.in Wed Aug 05 11:48:16 2009 +0100 +++ b/javac.in Wed Aug 05 14:19:58 2009 +0100 @@ -3,8 +3,18 @@ use constant NO_DUP_ARGS => qw(-source -target -d -encoding); use constant STRIP_ARGS => qw(-Werror); -my $ECJ_WARNINGS="-warn:-deprecation,serial,unused,warningToken"; -my $JAVAC_WARNINGS="-Xlint:unchecked,cast,divzero,empty,finally,overrides"; +my ($ECJ_WARNINGS, $JAVAC_WARNINGS); + +if ("@ENABLE_WARNINGS@" eq "yes") +{ + $ECJ_WARNINGS="-warn:-deprecation,serial,unused,warningToken"; + $JAVAC_WARNINGS="-Xlint:unchecked,cast,divzero,empty,finally,overrides"; +} +else +{ + $ECJ_WARNINGS="-nowarn"; + $JAVAC_WARNINGS="-nowarn"; +} my @bcoption; push @bcoption, '-bootclasspath', glob '@SYSTEM_JDK_DIR@/jre/lib/rt.jar'