RFR: JDK-8034179: Clean up nio genConstants
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Tue Feb 11 13:44:40 UTC 2014
On 2014-02-11 12:31, Erik Joelsson wrote:
> Here is a second patch for cleaning up gensrc tools source. This time
> it's nio related.
>
> * Move genUnixConstants.c, genSolarisConstants.c and
> genSocketOptionRegistry.c to make/src/native/...
> * Rename pregenerated versions of these generated files to
> *.java.template to avoid having to exclude them when compiling java code.
> * Move the output of the executable binaries to
> $(JDK_OUTPUTDIR)/btnative away from the gensrc dir where we expect to
> find java sources.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8034179
> Webrev: http://cr.openjdk.java.net/~erikj/8034179/webrev.jdk.01/
Yay! More cleanup! It feels so good!
While it does look okay, I'm wondering if it wouldn't look better to do
something like:
ifeq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template), )
# Copy pre-generated file if it exists
$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: \
$(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java.template
$(call install-file)
else
# Generate new on on build platform -- it must match target platform to work properly!
$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
$(MKDIR) -p $(@D)
$(RM) $@ $@.tmp
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/make/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
$(MV) $@.tmp $@
endif
Or are we using HAS_SOCKET_OPTION_REGISTRY elsewhere?
/Magnus
More information about the build-dev
mailing list