changeset in /hg/icedtea: Enable warnings only when --enable-war...
Andrew John Hughes
ahughes at redhat.com
Wed Aug 5 06:17:34 PDT 2009
changeset 7a7436abd808 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=7a7436abd808
description:
Enable warnings only when --enable-warnings is given.
2009-08-04 Andrew John Hughes <ahughes at 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.
diffstat:
5 files changed, 43 insertions(+), 3 deletions(-)
ChangeLog | 12 ++++++++++++
Makefile.am | 2 +-
acinclude.m4 | 17 +++++++++++++++++
configure.ac | 1 +
javac.in | 14 ++++++++++++--
diffs (90 lines):
diff -r 777441157d99 -r 7a7436abd808 ChangeLog
--- 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
+2009-08-04 Andrew John Hughes <ahughes at 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 at redhat.com>
* Makefile.am:
diff -r 777441157d99 -r 7a7436abd808 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 @@ NPPLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedT
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 ; \
diff -r 777441157d99 -r 7a7436abd808 acinclude.m4
--- 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_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)
+])
diff -r 777441157d99 -r 7a7436abd808 configure.ac
--- 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_LIBRARY_CHECK
IT_SCANNER_CHECK
IT_PR40630_CHECK
+IT_CHECK_ENABLE_WARNINGS
FIND_RHINO_JAR
WITH_OPENJDK_SRC_ZIP
diff -r 777441157d99 -r 7a7436abd808 javac.in
--- 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 -
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'
More information about the distro-pkg-dev
mailing list