RFR: JDK-8079344: Allow custom or platform specific java source to automatically override shared source

Erik Joelsson erik.joelsson at oracle.com
Tue May 5 14:03:44 UTC 2015


Hello,

Currently it's possible to do this:

src/$module/share/native/libfoo/foo.c
src/$module/linux/native/libfoo/foo.c

And the result will be that the most specific file, linux in this case, 
file will get compiled and the other one ignored. The same works for 
custom (closed) files overriding open. In addition to native code, this 
also works for files being copied by the SetupJavaCompilation macro, 
typically properties or other resources.

For java code this does not work however and in the cases where such 
overrides are used, the makefiles need explicit excludes of the 
overridden file. I have implemented a solution for this that covers java 
files and cleaned files in addition to the copied files in 
SetupJavaCompilation, so we get consistent behavior for all sorts of 
sources.

Along with the new functionality I removed all the now redundant 
excludes. I've added tests for the new functionality in 
SetupJavaCompilation as well as the new macro in MakeBase.

I've also added a debugging convenience macro in MakeBase that isn't 
currently used, but makes my life easier when needing to print 
variables. Now I can write:

$(call PrintVar, VARNAME)

and it will print:

VARNAME >$(VARNAME)<

Bug: https://bugs.openjdk.java.net/browse/JDK-8079344
Webrev: http://cr.openjdk.java.net/~erikj/8079344/webrev.01/

/Erik



More information about the build-dev mailing list