7039182: PPC: NIO: java.io.IOException: Invalid argument in sun.nio.ch.FileDispatcherImpl.read0
Summary: Allow platform specific files to be located at build time instead of generating them
Reviewed-by: alanb, ohair
--- a/jdk/make/common/Defs-embedded.gmk Mon Jun 27 12:21:44 2011 -0700
+++ b/jdk/make/common/Defs-embedded.gmk Mon Jun 27 20:13:48 2011 -0400
@@ -60,5 +60,10 @@
endif
endif
+# NIO Platform specific source file location
+ifdef CROSS_COMPILE_ARCH
+ NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
+endif
+
endif # JAVASE_EMBEDDED
--- a/jdk/make/java/nio/Makefile Mon Jun 27 12:21:44 2011 -0700
+++ b/jdk/make/java/nio/Makefile Mon Jun 27 20:13:48 2011 -0400
@@ -255,7 +255,7 @@
sun/nio/fs/LinuxWatchService.java \
sun/nio/fs/UnixCopyFile.java \
sun/nio/fs/UnixNativeDispatcher.java
-
+
FILES_gen += \
sun/nio/fs/UnixConstants.java
endif # PLATFORM = linux
@@ -771,7 +771,7 @@
#
GEN_EX_SH = genExceptions.sh
-
+
GEN_EX_CMD = NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_EX_SH)
$(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
@@ -820,14 +820,19 @@
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
$(prep-target)
- ($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
+ ($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
-o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
+ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
+$(SCH_GEN)/SocketOptionRegistry.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/ch/SocketOptionRegistry-$(PLATFORM)-$(ARCH).java
+ $(prep-target)
+ $(CP) $< $@
+else
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
$(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@
$(GENSOR_EXE) >> $@
-
+endif
#
# Generated sun.nio.cs SingleByte classes
#
@@ -851,12 +856,18 @@
$(GENUC_EXE) : $(GENUC_SRC)
$(prep-target)
- $(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+ $(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
+$(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
+ $(prep-target)
+ $(CP) $< $@
+else
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
$(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENUC_COPYRIGHT_YEARS)" > $@
$(GENUC_EXE) >> $@
+endif
GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
@@ -867,11 +878,17 @@
$(GENSC_EXE) : $(GENSC_SRC)
$(prep-target)
- $(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+ $(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
+$(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
+ $(prep-target)
+ $(CP) $< $@
+else
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
$(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENSC_COPYRIGHT_YEARS)" > $@
$(GENSC_EXE) >> $@
+endif
.PHONY: sources