Proposal: Make custom extension point additions

Andrew Leonard andrew_m_leonard at uk.ibm.com
Thu Feb 1 16:52:08 UTC 2018


Thanks Erik,
I have moved the "post" hooks after the ###'s as you mentioned and 
similarly to the end for GensrcVarHandles.gmk. Here is the new hg diff -g 
patch, I have built it with the latest jdk head and run the jtreg tests 
successfully.
Cheers
Andrew

diff --git a/make/common/SetupJavaCompilers.gmk 
b/make/common/SetupJavaCompilers.gmk
--- a/make/common/SetupJavaCompilers.gmk
+++ b/make/common/SetupJavaCompilers.gmk
@@ -26,13 +26,16 @@
 ifndef _SETUP_GMK
 _SETUP_GMK := 1
 
+# Include custom extension hook
+$(eval $(call IncludeCustomExtension, common/SetupJavaCompilers.gmk))
+
 include JavaCompilation.gmk
 
-DISABLE_WARNINGS := 
-Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
+DISABLE_WARNINGS ?= 
-Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
 
 # If warnings needs to be non-fatal for testing purposes use a command 
like:
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:all -Werror
+JAVAC_WARNINGS ?= -Xlint:all -Werror
 
 # The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
 # and the interim javac, to be run by the boot jdk.
diff --git a/make/gensrc/GensrcVarHandles.gmk 
b/make/gensrc/GensrcVarHandles.gmk
--- a/make/gensrc/GensrcVarHandles.gmk
+++ b/make/gensrc/GensrcVarHandles.gmk
@@ -168,3 +168,7 @@
   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
 
 GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
+
+# Include custom extension post hook
+$(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk))
+
diff --git a/make/lib/Lib-java.management.gmk 
b/make/lib/Lib-java.management.gmk
--- a/make/lib/Lib-java.management.gmk
+++ b/make/lib/Lib-java.management.gmk
@@ -70,3 +70,7 @@
 TARGETS += $(BUILD_LIBMANAGEMENT)
 
 
################################################################################
+
+# Include custom extension post hook
+$(eval $(call IncludeCustomExtension, lib/Lib-java.management-post.gmk))
+
diff --git a/make/lib/Lib-jdk.management.gmk 
b/make/lib/Lib-jdk.management.gmk
--- a/make/lib/Lib-jdk.management.gmk
+++ b/make/lib/Lib-jdk.management.gmk
@@ -80,3 +80,7 @@
 TARGETS += $(BUILD_LIBMANAGEMENT_EXT)
 
 
################################################################################
+
+# Include custom extension post hook
+$(eval $(call IncludeCustomExtension, lib/Lib-jdk.management-post.gmk))
+





Andrew Leonard
Java Runtimes Development
IBM Hursley
IBM United Kingdom Ltd
Phone internal: 245913, external: 01962 815913
internet email: andrew_m_leonard at uk.ibm.com 




From:   Erik Joelsson <erik.joelsson at oracle.com>
To:     Andrew Leonard <andrew_m_leonard at uk.ibm.com>, 
build-dev at openjdk.java.net
Date:   31/01/2018 17:40
Subject:        Re: Proposal: Make custom extension point additions



Hello Andrew,

This suggestion looks reasonable to me. Just a minor note on the 
placement of the post hooks. Especially in the Lib-* files, each 
individual library, or link entity, is put within ### separator lines. 
In the two files you modified, since there is only one library declared, 
this isn't as apparent. I would prefer if the post hook came after all 
the declared library sections instead of inside one of them. The Gensrc 
file is more of a snowflake so the placement is reasonable there.

/Erik


On 2018-01-31 03:21, Andrew Leonard wrote:
> Hi,
> I would like to find a sponsor for this change please?
> To support certain extension capabilities I would like to propose the
> following patch to the following make files, summary of changes:
>      M make/common/SetupJavaCompilers.gmk
>          ==> Add IncludeCustomExtension hook and allow custom override 
of
> DISABLE_WARNINGS and JAVAC_WARNINGS
>      M make/gensrc/GensrcVarHandles.gmk
>          ==> Add IncludeCustomExtension "post" hook
>      M make/lib/Lib-java.management.gmk
>          ==> Add IncludeCustomExtension "post" hook
>      M make/lib/Lib-jdk.management.gmk
>          ==> Add IncludeCustomExtension "post" hook
>
> Many thanks,
> Andrew
>
> hg diff -g output:
> diff --git a/make/common/SetupJavaCompilers.gmk
> b/make/common/SetupJavaCompilers.gmk
> --- a/make/common/SetupJavaCompilers.gmk
> +++ b/make/common/SetupJavaCompilers.gmk
> @@ -26,13 +26,16 @@
>   ifndef _SETUP_GMK
>   _SETUP_GMK := 1
> 
> +# Include custom extension hook
> +$(eval $(call IncludeCustomExtension, common/SetupJavaCompilers.gmk))
> +
>   include JavaCompilation.gmk
> 
> -DISABLE_WARNINGS :=
> 
-Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
> +DISABLE_WARNINGS ?=
> 
-Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
> 
>   # If warnings needs to be non-fatal for testing purposes use a command
> like:
>   # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
> -JAVAC_WARNINGS := -Xlint:all -Werror
> +JAVAC_WARNINGS ?= -Xlint:all -Werror
> 
>   # The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
>   # and the interim javac, to be run by the boot jdk.
> diff --git a/make/gensrc/GensrcVarHandles.gmk
> b/make/gensrc/GensrcVarHandles.gmk
> --- a/make/gensrc/GensrcVarHandles.gmk
> +++ b/make/gensrc/GensrcVarHandles.gmk
> @@ -167,4 +167,7 @@
>   $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
>     $(eval $(call 
GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
> 
> +# Include custom extension post hook
> +$(eval $(call IncludeCustomExtension, 
gensrc/GensrcVarHandles-post.gmk))
> +
>   GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
> diff --git a/make/lib/Lib-java.management.gmk
> b/make/lib/Lib-java.management.gmk
> --- a/make/lib/Lib-java.management.gmk
> +++ b/make/lib/Lib-java.management.gmk
> @@ -67,6 +67,9 @@
> 
>   $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)
> 
> +# Include custom extension post hook
> +$(eval $(call IncludeCustomExtension, 
lib/Lib-java.management-post.gmk))
> +
>   TARGETS += $(BUILD_LIBMANAGEMENT)
> 
> 
> 
################################################################################
> diff --git a/make/lib/Lib-jdk.management.gmk
> b/make/lib/Lib-jdk.management.gmk
> --- a/make/lib/Lib-jdk.management.gmk
> +++ b/make/lib/Lib-jdk.management.gmk
> @@ -77,6 +77,9 @@
> 
>   $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java)
> 
> +# Include custom extension post hook
> +$(eval $(call IncludeCustomExtension, lib/Lib-jdk.management-post.gmk))
> +
>   TARGETS += $(BUILD_LIBMANAGEMENT_EXT)
> 
> 
> 
################################################################################
>
>
>
>
>
>
> Andrew Leonard
> Java Runtimes Development
> IBM Hursley
> IBM United Kingdom Ltd
> Phone internal: 245913, external: 01962 815913
> internet email: andrew_m_leonard at uk.ibm.com
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 
3AU





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



More information about the build-dev mailing list