jdk/makefiles/GensrcMisc.gmk
author amurillo
Wed, 15 Aug 2012 16:49:38 -0700
changeset 13465 d3fc5d192448
parent 13164 72c5d01a857d
child 13702 efd6a05935b2
permissions -rw-r--r--
7191765: make jdk8 the default jprt release for hs24 Reviewed-by: jcoomes

#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

##########################################################################################
# Install the launcher name, release version string, full version
# string and the runtime name into the Version.java file.
# To be printed by java -version

$(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
	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
	       -e 's/@@java_version@@/$(RELEASE)/g' \
	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
	       -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
            $< > $@

GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java

##########################################################################################
# Version file for jconsole

$(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
	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@

GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS_API),posix)
    UPSUFFIX:=$(OPENJDK_TARGET_OS)
    ifeq ($(OPENJDK_TARGET_OS),macosx)
        UPSUFFIX:=bsd
    endif
    # UNIXProcess.java is different for solaris and linux. We need to copy
    # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/.

    $(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.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
	$(CP) $< $@
	$(CHMOD) u+rw $@

    GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java
endif

##########################################################################################

ifndef OPENJDK
ifneq ($(OPENJDK_TARGET_OS), windows)
ifneq ($(OPENJDK_TARGET_OS), 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)/gensrc_misc/genSocketOptionRegistry

SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
		SRC:=$(GENSRC_SOR_SRC),\
		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
		LANG:=C,\
		CC:=$(HOST_CC),\
		LDEXE:=$(HOST_LD),\
		OBJECT_DIR:=$(GENSRC_SOR_BIN),\
		OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
                PROGRAM:=genSocketOptionRegistry))

ifneq ($(JAVASE_EMBEDDED), true)
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
	$(MKDIR) -p $(@D)
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
	$(MV) $@.tmp $@
else
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
	$(MKDIR) -p $(@D)
	$(CP) $< $@
endif

##########################################################################################

ifneq ($(OPENJDK_TARGET_OS),windows)

GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java

GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
GENSRC_UC_SRC_FILE := genUnixConstants.c
GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genUnixConstants

UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
		SRC:=$(GENSRC_UC_SRC),\
		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
		LANG:=C,\
		CC:=$(HOST_CC),\
		LDEXE:=$(HOST_CC),\
		OBJECT_DIR:=$(GENSRC_UC_BIN),\
                OUTPUT_DIR:=$(GENSRC_UC_BIN),\
		PROGRAM:=genUnixConstants))

ifneq ($(JAVASE_EMBEDDED), true)
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
	$(MKDIR) -p $(@D)
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
	$(MV) $@.tmp $@
else
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
	$(MKDIR) -p $(@D)
	$(CP) $< $@
endif

endif

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS),solaris)

GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java

GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
GENSRC_SOL_SRC_FILE := genSolarisConstants.c
GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSolarisConstants

SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 

$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
		SRC:=$(GENSRC_SOL_SRC),\
		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
		LANG:=C,\
		CC:=$(HOST_CC),\
		LDEXE:=$(HOST_CC),\
		OBJECT_DIR:=$(GENSRC_SOL_BIN),\
		OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
		PROGRAM:=genSolarisConstants))

$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
	$(MKDIR) -p $(@D)
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
	$(MV) $@.tmp $@


endif