jdk/makefiles/GensrcMisc.gmk
changeset 12892 3ef14bab6254
parent 12317 9670c1610c53
child 13164 72c5d01a857d
--- a/jdk/makefiles/GensrcMisc.gmk	Thu Jun 07 20:40:02 2012 -0700
+++ b/jdk/makefiles/GensrcMisc.gmk	Thu Jun 07 20:40:50 2012 -0700
@@ -31,7 +31,7 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java: \
 	$(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
 	$(MKDIR) -p $(@D)
-	echo Generating sun/misc/Version.java
+	$(ECHO) Generating sun/misc/Version.java
 	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
 	       -e 's/@@java_version@@/$(RELEASE)/g' \
 	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
@@ -46,7 +46,7 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java: \
                 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
 	$(MKDIR) -p $(@D)
-	echo Generating sun/tools/jconsole/Version.java
+	$(ECHO) Generating sun/tools/jconsole/Version.java
 	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java
@@ -64,7 +64,7 @@
     $(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java : \
               $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
 	$(MKDIR) -p $(@D)
-	echo Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java
+	$(ECHO) Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java
 	$(CP) $< $@
 	$(CHMOD) u+rw $@
 
@@ -72,3 +72,114 @@
 endif
 
 ##########################################################################################
+
+ifndef OPENJDK
+ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
+    # These file(s) are needed for building fake .so libs on !windows for jdbcodbc
+
+    $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c : 
+	$(MKDIR) -p $(@D)
+	$(ECHO) Creating $@
+	$(PRINTF) "void dummyOdbc(void){}\n" > $@
+	$(ECHO) Created $@
+
+    $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc2.c : 
+	$(MKDIR) -p $(@D)
+	$(ECHO) Creating $@
+	$(PRINTF) "void dummyOdbc(void){}\n" > $@
+	$(ECHO) Created $@
+
+    GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc2.c
+endif
+endif
+endif
+
+##########################################################################################
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java
+
+GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
+GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
+GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSocketOptionRegistry
+GENSRC_SOR_EXE := $(GENSRC_SOR_BIN)/genSocketOptionRegistry$(EXE_SUFFIX)
+
+SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(GENSRC_SOR_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_SOR_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
+		SRC:=$(GENSRC_SOR_SRC),\
+		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_SOR_BIN),\
+		EXE:=$(GENSRC_SOR_EXE)))
+
+##########################################################################################
+
+ifneq ($(PLATFORM),windows)
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java
+
+GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
+GENSRC_UC_SRC_FILE := genUnixConstants.c
+GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genUnixConstants
+GENSRC_UC_EXE := $(GENSRC_UC_BIN)/genUnixConstants$(EXE_SUFFIX)
+
+UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(GENSRC_UC_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_UC_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
+		SRC:=$(GENSRC_UC_SRC),\
+		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_UC_BIN),\
+		EXE:=$(GENSRC_UC_EXE)))
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM),solaris)
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java
+
+GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
+GENSRC_SOL_SRC_FILE := genSolarisConstants.c
+GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSolarisConstants
+GENSRC_SOL_EXE := $(GENSRC_SOL_BIN)/genSolarisConstants$(EXE_SUFFIX)
+
+SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(GENSRC_SOL_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_SOL_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
+		SRC:=$(GENSRC_SOL_SRC),\
+		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_SOL_BIN),\
+		EXE:=$(GENSRC_SOL_EXE)))
+
+endif