public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-java/icedtea/files: icedtea-7.2.2.1-warnings_are_errors.patch
@ 2012-06-27 19:08 Ralph Sennhauser (sera)
  0 siblings, 0 replies; only message in thread
From: Ralph Sennhauser (sera) @ 2012-06-27 19:08 UTC (permalink / raw
  To: gentoo-commits

sera        12/06/27 19:08:58

  Added:                icedtea-7.2.2.1-warnings_are_errors.patch
  Log:
  Make werror a configure option and disable it so icedtea 7 can be built using gcc 4.7. #310503 #418359
  Many thanks to the various people providing support in #418359
  
  (Portage version: 2.1.10.65/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-java/icedtea/files/icedtea-7.2.2.1-warnings_are_errors.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/icedtea/files/icedtea-7.2.2.1-warnings_are_errors.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/icedtea/files/icedtea-7.2.2.1-warnings_are_errors.patch?rev=1.1&content-type=text/plain

Index: icedtea-7.2.2.1-warnings_are_errors.patch
===================================================================
diff --git a/Makefile.am b/Makefile.am
index 49d8bc4..b20ee99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -235,7 +235,8 @@ REWRITER_SRCS = $(top_srcdir)/rewriter/com/redhat/rewriter/ClassRewriter.java
 
 # Patch list
 
-ICEDTEA_PATCHES =
+ICEDTEA_PATCHES = \
+	patches/warnings-are-errors.patch
 
 # Conditional patches
 
@@ -437,7 +438,9 @@ ICEDTEA_ENV = \
 	USE_SYSTEM_CUPS="true" \
 	CUPS_LIBS="${CUPS_LIBS}" \
 	CUPS_CFLAGS="${CUPS_CFLAGS}" \
-	ALT_STRIP_POLICY=no_strip
+	ALT_STRIP_POLICY=no_strip \
+	COMPILER_WARNINGS_FATAL="@WARNINGS_ARE_ERRORS@" \
+	JAVAC_WARNINGS_FATAL="@WARNINGS_ARE_ERRORS@"
 
 if ENABLE_CACAO
 ICEDTEA_ENV += \
diff --git a/acinclude.m4 b/acinclude.m4
index f0a336f..3dc4aa0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2244,3 +2244,23 @@ AC_DEFUN_ONCE([IT_WITH_PAX],
   AC_SUBST(PAX_COMMAND)
   AC_SUBST(PAX_COMMAND_ARGS)
 ])
+
+AC_DEFUN_ONCE([IT_WARNINGS_ARE_ERRORS],
+[
+  AC_MSG_CHECKING([whether to treat warnings as errors.])
+  AC_ARG_ENABLE([warnings-are-errors],
+                [AS_HELP_STRING(--enable-warnings-are-errors,treat warnings as errors [[default=yes]])],
+  [
+    if test x"${enableval}" = "xyes"; then
+      WARNINGS_ARE_ERRORS="true"
+    else
+      WARNINGS_ARE_ERRORS="false"
+    fi
+  ],
+  [
+    dnl use local defaults
+    WARNINGS_ARE_ERRORS=
+  ])
+  AC_MSG_RESULT([${WARNINGS_ARE_ERRORS}])
+  AC_SUBST([WARNINGS_ARE_ERRORS])
+])
diff --git a/configure.ac b/configure.ac
index 36c9d77..af52bf1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@ IT_DISABLE_TESTS
 IT_DISABLE_HOTSPOT_TESTS
 IT_DISABLE_LANGTOOLS_TESTS
 IT_DISABLE_JDK_TESTS
+IT_WARNINGS_ARE_ERRORS
 
 # Use xvfb-run if found to run gui tests (check-jdk).
 AC_CHECK_PROG(XVFB_RUN_CMD, xvfb-run, [xvfb-run -a -e xvfb-errors], [])
diff --git a/patches/boot/ecj-opts.patch b/patches/boot/ecj-opts.patch
index 99ed532..284bd37 100644
--- a/patches/boot/ecj-opts.patch
+++ b/patches/boot/ecj-opts.patch
@@ -5,8 +5,8 @@ diff -Nru openjdk-boot.orig/jdk/make/java/nio/Makefile openjdk-boot/jdk/make/jav
  PACKAGE = java.nio
  LIBRARY = nio
  PRODUCT = java
--OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial -Werror
+-OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial
 +OTHER_JAVACFLAGS += -Xlint:serial -Werror
- include $(BUILDDIR)/common/Defs.gmk
- 
- NIO_SRC = $(SHARE_SRC)/classes/java/nio
+ ifneq ($(JAVAC_WARNINGS_FATAL),false)
+   OTHER_JAVACFLAGS += -Werror
+ endif
diff --git a/patches/warnings-are-errors.patch b/patches/warnings-are-errors.patch
new file mode 100644
index 0000000..7fe1e08
--- /dev/null
+++ b/patches/warnings-are-errors.patch
@@ -0,0 +1,129 @@
+--- openjdk/hotspot/make/linux/makefiles/adlc.make
++++ openjdk/hotspot/make/linux/makefiles/adlc.make
+@@ -67,8 +67,10 @@
+ CXXFLAGS += -DASSERT
+ 
+ # CFLAGS_WARN holds compiler options to suppress/enable warnings.
+-# Compiler warnings are treated as errors
+-CFLAGS_WARN = -Werror
++# Treat compiler warnings as errors, unless warnings are allowed
++ifneq ($(COMPILER_WARNINGS_FATAL),false)
++  CFLAGS_WARN = -Werror
++endif
+ CFLAGS += $(CFLAGS_WARN)
+ 
+ OBJECTNAMES = \
+--- openjdk/hotspot/make/linux/makefiles/gcc.make
++++ openjdk/hotspot/make/linux/makefiles/gcc.make
+@@ -149,8 +149,10 @@
+   CFLAGS += -pipe
+ endif
+ 
+-# Compiler warnings are treated as errors
+-WARNINGS_ARE_ERRORS = -Werror
++# Treat compiler warnings as errors, unless warnings are allowed
++ifneq ($(COMPILER_WARNINGS_FATAL),false)
++  WARNINGS_ARE_ERRORS = -Werror
++endif
+ 
+ # Except for a few acceptable ones
+ # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+--- openjdk/hotspot/make/solaris/makefiles/gcc.make
++++ openjdk/hotspot/make/solaris/makefiles/gcc.make
+@@ -111,8 +111,10 @@
+ endif
+ 
+ 
+-# Compiler warnings are treated as errors 
+-WARNINGS_ARE_ERRORS = -Werror 
++# Treat compiler warnings as errors, unless warnings are allowed
++ifneq ($(COMPILER_WARNINGS_FATAL),false)
++  WARNINGS_ARE_ERRORS = -Werror
++endif
+ # Enable these warnings. See 'info gcc' about details on these options
+ ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare 
+ CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS) 
+--- openjdk/jdk/make/java/nio/Makefile
++++ openjdk/jdk/make/java/nio/Makefile
+@@ -31,7 +31,10 @@
+ PACKAGE = java.nio
+ LIBRARY = nio
+ PRODUCT = java
+-OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial -Werror
++OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint:serial
++ifneq ($(JAVAC_WARNINGS_FATAL),false)
++  OTHER_JAVACFLAGS += -Werror
++endif
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ NIO_SRC = $(SHARE_SRC)/classes/java/nio
+--- openjdk/jdk/make/java/sun_nio/Makefile
++++ openjdk/jdk/make/java/sun_nio/Makefile
+@@ -31,7 +31,11 @@
+ PACKAGE = sun.nio
+ PRODUCT = sun
+ 
+-OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Werror
++OTHER_JAVACFLAGS += -Xlint:serial,-deprecation
++ifneq ($(JAVAC_WARNINGS_FATAL),false)
++  OTHER_JAVACFLAGS += -Werror
++endif
++
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ #
+--- openjdk/jdk/make/sun/native2ascii/Makefile
++++ openjdk/jdk/make/sun/native2ascii/Makefile
+@@ -30,7 +30,10 @@
+ BUILDDIR = ../..
+ PACKAGE = sun.tools.native2ascii
+ PRODUCT = sun
+-OTHER_JAVACFLAGS += -Xlint:serial -Werror
++OTHER_JAVACFLAGS += -Xlint:serial
++ifneq ($(JAVAC_WARNINGS_FATAL),false)
++  OTHER_JAVACFLAGS += -Werror
++endif
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ # This program must contain a manifest that defines the execution level
+--- openjdk/jdk/make/sun/nio/cs/Makefile
++++ openjdk/jdk/make/sun/nio/cs/Makefile
+@@ -36,7 +36,10 @@
+ # This re-directs all the class files to a separate location
+ CLASSDESTDIR = $(TEMPDIR)/classes
+ 
+-OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Werror
++OTHER_JAVACFLAGS += -Xlint:serial,-deprecation
++ifneq ($(JAVAC_WARNINGS_FATAL),false)
++  OTHER_JAVACFLAGS += -Werror
++endif
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ #
+--- openjdk/jdk/make/tools/Makefile
++++ openjdk/jdk/make/tools/Makefile
+@@ -29,7 +29,10 @@
+ 
+ BUILDDIR = ..
+ 
+-SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true JAVAC_WARNINGS_FATAL=true
++SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
++ifneq ($(JAVAC_WARNINGS_FATAL),false)
++  SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
++endif
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+ # Note: freetypecheck is built by Sanity.gmk if needed
+--- openjdk/langtools/make/Makefile
++++ openjdk/langtools/make/Makefile
+@@ -111,6 +111,10 @@
+   ANT_OPTIONS += -Ddebug.classfiles=true
+ endif
+ 
++ifeq ($(JAVAC_WARNINGS_FATAL),false)
++  ANT_OPTIONS += -Djavac.lint.opts=-Xlint:all,-deprecation
++endif
++
+ # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
+ # and the somewhat misnamed CLASS_VERSION (-target NN)
+ ifdef TARGET_CLASS_VERSION






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-27 19:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27 19:08 [gentoo-commits] gentoo-x86 commit in dev-java/icedtea/files: icedtea-7.2.2.1-warnings_are_errors.patch Ralph Sennhauser (sera)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox