changeset 3134:9ace699eb46a

PR1712: Allow -Werror to be turned off in the HotSpot build 2012-08-16 Andrew John Hughes <gnu_andrew@member.fsf.org> PR1712: Allow -Werror to be turned off in the HotSpot build * Makefile.am: (WERROR_STATUS): Set to true or false depending on if ENABLE_WERROR is set or not. (ICEDTEA_ENV): Use WERROR_STATUS to set COMPILER_WARNINGS_FATAL. * acinclude.m4: (IT_ENABLE_WERROR): New macro to enable -Werror. This is disabled by default. * configure.ac: Call IT_ENABLE_WERROR. * javac.in: Handle stripping of arguments which take parameters, specifically -Xmaxwarns. * NEWS: Updated.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Thu, 20 Mar 2014 02:06:20 +0000
parents 975cb4907b2e
children 0ef5e61b1b00
files ChangeLog Makefile.am NEWS acinclude.m4 configure.ac javac.in
diffstat 6 files changed, 58 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 19 17:33:09 2014 +0000
+++ b/ChangeLog	Thu Mar 20 02:06:20 2014 +0000
@@ -1,3 +1,20 @@
+2012-08-16  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	PR1712: Allow -Werror to be turned off in the
+	HotSpot build
+	* Makefile.am:
+	(WERROR_STATUS): Set to true or false
+	depending on if ENABLE_WERROR is set or not.
+	(ICEDTEA_ENV): Use WERROR_STATUS to set
+	COMPILER_WARNINGS_FATAL.
+	* acinclude.m4:
+	(IT_ENABLE_WERROR): New macro to enable -Werror.
+	This is disabled by default.
+	* configure.ac: Call IT_ENABLE_WERROR.
+	* javac.in: Handle stripping of arguments which
+	take parameters, specifically -Xmaxwarns.
+	* NEWS: Updated.
+
 2014-02-19  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	PR1714: Update PaX support to detect running PaX
--- a/Makefile.am	Wed Mar 19 17:33:09 2014 +0000
+++ b/Makefile.am	Thu Mar 20 02:06:20 2014 +0000
@@ -778,6 +778,12 @@
 ICEDTEA_PKG = $(EMPTY) (${PKGVERSION})
 endif
 
+if ENABLE_WERROR
+WERROR_STATUS=true
+else
+WERROR_STATUS=false
+endif
+
 ICEDTEA_ENV = \
 	ALT_JDK_IMPORT_PATH="$(BOOT_DIR)" \
 	ANT="$(ANT)" \
@@ -820,7 +826,8 @@
 	ALT_OUTPUTDIR="$(BUILD_OUTPUT_DIR)" \
 	STATIC_CXX="false" \
 	BUILD_GCC=gcc$(GCC_SUFFIX) \
-	BUILD_CXX=g++$(GCC_SUFFIX)
+	BUILD_CXX=g++$(GCC_SUFFIX) \
+	COMPILER_WARNINGS_FATAL="$(WERROR_STATUS)"
 
 if ENABLE_CACAO
 ICEDTEA_ENV += \
--- a/NEWS	Wed Mar 19 17:33:09 2014 +0000
+++ b/NEWS	Thu Mar 20 02:06:20 2014 +0000
@@ -20,6 +20,7 @@
   - S8026887: Make issues due to failed large pages allocations easier to debug
 * Bug fixes
   - PR1714: Update PaX support to detect running PaX kernel and use newer tools
+  - PR1712, G455426: Allow -Werror to be turned off in the HotSpot build
 
 New in release 1.11.15 (2014-01-21):
 
--- a/acinclude.m4	Wed Mar 19 17:33:09 2014 +0000
+++ b/acinclude.m4	Thu Mar 20 02:06:20 2014 +0000
@@ -2295,3 +2295,25 @@
   AC_MSG_RESULT([$enable_jar_compression])
   AM_CONDITIONAL([ENABLE_JAR_COMPRESSION], test x"${enable_jar_compression}" = "xyes")
 ])
+
+AC_DEFUN([IT_ENABLE_WERROR],
+[
+  AC_MSG_CHECKING([whether to enable -Werror])
+  AC_ARG_ENABLE([Werror],
+                [AS_HELP_STRING(--enable-Werror,build with -Werror [[default=no]])],
+  [
+    case "${enableval}" in
+      yes)
+        enable_werror=yes
+        ;;
+      *)
+        enable_werror=no
+        ;;
+    esac
+  ],
+  [
+    enable_werror=no
+  ])
+  AC_MSG_RESULT([$enable_werror])
+  AM_CONDITIONAL([ENABLE_WERROR], test x"${enable_werror}" = "xyes")
+])
--- a/configure.ac	Wed Mar 19 17:33:09 2014 +0000
+++ b/configure.ac	Thu Mar 20 02:06:20 2014 +0000
@@ -283,6 +283,7 @@
 IT_WITH_JAMVM_SRC_ZIP
 
 IT_DISABLE_OPTIMIZATIONS
+IT_ENABLE_WERROR
 IT_ENABLE_JAR_COMPRESSION
 IT_SET_SHARK_BUILD
 IT_ENABLE_ZERO_BUILD
--- a/javac.in	Wed Mar 19 17:33:09 2014 +0000
+++ b/javac.in	Thu Mar 20 02:06:20 2014 +0000
@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 use strict;
 use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
-use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+use constant STRIP_ARGS_1 => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+use constant STRIP_ARGS_2 => qw(-Xmaxwarns);
 
 my $ECJ_WARNINGS="-nowarn";
 my $JAVAC_WARNINGS="-nowarn";
@@ -49,12 +50,18 @@
 	}
     }
 
-    for my $opt (STRIP_ARGS) 
+    for my $opt (STRIP_ARGS_1)
     {
 	my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
 	splice @new_args, $_, 1 for @indices;
     }
 
+    for my $opt (STRIP_ARGS_2) 
+    {
+	my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+	splice @new_args, $_, 2 for @indices;
+    }
+
     return \@new_args;
 }