Use of -Werror in langtools/make and ${warnings.fatal}
Andrew Hughes
gnu.andrew at redhat.com
Wed Apr 17 05:49:17 PDT 2013
----- Original Message -----
> ant can no longer be invoked directly (i.e. not via makefile) in
> langtools/make because ${warnings.fatal} is undefined.
>
> cd langtools/make
> ant -Djavac.warnings.fatal= -Dboot.java.home=$jdk6 -Dtarget.java.home=$jdk7
> build
> ...
> [javac] Compiling 295 source files to
> /usr/local/google/home/martinrb/ws/icedtea7-forest/langtools/build/bootstrap/classes
> [javac] javac: invalid flag: ${warnings.fatal}
>
> Caused by this icedtea-only patch:
>
> # HG changeset patch
> # User andrew
> # Date 1345649970 -3600
> # Node ID 26f5c80eb792e8536e15c82670dc38a140bb1ec3
> # Parent b19919b8e86d7f17317d7cf6ca440ee4d3d4e14d
> PR1095: Allow -Werror to be turned off.
>
> diff --git a/make/Makefile b/make/Makefile
> --- a/make/Makefile
> +++ b/make/Makefile
> @@ -111,6 +111,12 @@
> ANT_OPTIONS += -Ddebug.classfiles=true
> endif
>
> +ifeq ($(JAVAC_WARNINGS_FATAL), true)
> + ANT_OPTIONS += -Dwarnings.fatal=-Werror
> +else
> + ANT_OPTIONS += -Dwarnings.fatal=
> +endif
> +
> # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
> # and the somewhat misnamed CLASS_VERSION (-target NN)
> ifdef TARGET_CLASS_VERSION
> diff --git a/make/build.properties b/make/build.properties
> --- a/make/build.properties
> +++ b/make/build.properties
> @@ -68,7 +68,7 @@
> # set the following to -version to verify the versions of javac being used
> javac.version.opt =
> # in time, there should be no exceptions to -Xlint:all
> -javac.lint.opts = -Xlint:all,-deprecation -Werror
> +javac.lint.opts = -Xlint:all,-deprecation ${warnings.fatal}
>
> # options for the <javadoc> task for javac
> #javadoc.jls3.url=http://java.sun.com/docs/books/jls/
>
>
> Here's a possible fix, that preserves the openjdk default of -Werror,
> renames warnings.fatal to javac.warnings.fatal, and allows escape via
> JAVAC_WARNINGS_FATAL=false
>
>
> diff --git a/make/Makefile b/make/Makefile
> --- a/make/Makefile
> +++ b/make/Makefile
> @@ -111,10 +111,8 @@
> ANT_OPTIONS += -Ddebug.classfiles=true
> endif
>
> -ifeq ($(JAVAC_WARNINGS_FATAL), true)
> - ANT_OPTIONS += -Dwarnings.fatal=-Werror
> -else
> - ANT_OPTIONS += -Dwarnings.fatal=
> +ifeq ($(JAVAC_WARNINGS_FATAL), false)
> + ANT_OPTIONS += -Djavac.warnings.fatal=
> endif
>
> # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
> diff --git a/make/build.properties b/make/build.properties
> --- a/make/build.properties
> +++ b/make/build.properties
> @@ -68,7 +68,8 @@
> # set the following to -version to verify the versions of javac being used
> javac.version.opt =
> # in time, there should be no exceptions to -Xlint:all
> -javac.lint.opts = -Xlint:all,-deprecation ${warnings.fatal}
> +javac.warnings.fatal = -Werror
> +javac.lint.opts = -Xlint:all,-deprecation ${javac.warnings.fatal}
>
> # options for the <javadoc> task for javac
> #javadoc.jls3.url=http://java.sun.com/docs/books/jls/
>
Finally done:
http://icedtea.classpath.org/hg/icedtea7-forest/langtools/rev/24ac4090a6e4
http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/langtools/rev/fd956199cb82
http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4/langtools/rev/1b9aeaa2344b
2.3.9 should be out later today.
Thanks again,
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07
More information about the distro-pkg-dev
mailing list