view j2se/make/java/redist/Makefile @ 2:16f2b6c91171 trunk

[svn] Load openjdk/jdk7/b14 into jdk/trunk.
author xiomara
date Fri, 22 Jun 2007 00:46:43 +0000
parents a4ed3fb96592
children bf1d8af0651f
line wrap: on
line source

#
# Copyright 1997-2007 Sun Microsystems, Inc.  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.  Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#

#
# Imports files exported by a hotspot build or provided from an external
#   location into the OUTPUTDIR, and also primes the OUTPUTDIR with files
#   that are provided inside this workspace.
#
# IMPORT_LIST contains the list of destination files that are copied 
#     from external places (outside this workspace).
#
# INTERNAL_IMPORT_LIST is the list of destination files from BUILDDIR.
# 

BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
PRODUCT  = java

SERVER_LOCATION = server
CLIENT_LOCATION = client

DB_SUFFIX = _db

ifeq ($(PLATFORM), windows)
  LIB_LOCATION = $(BINDIR)
else
  LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
endif

JVM_NAME               = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX)
JVMLIB_NAME            = $(LIB_PREFIX)jvm.$(LIB_SUFFIX)
JVMMAP_NAME            = $(LIB_PREFIX)jvm.map
JVMPDB_NAME            = $(LIB_PREFIX)jvm.pdb
LIBJSIG_NAME           = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX)
JVMDB_NAME             = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)

SHARINGDIR             = $(BUILDDIR)/tools/sharing

include $(BUILDDIR)/common/Defs.gmk

default_rule: all

# Needed to do file copy
ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))

# Temporary directory for AddJsum classes.
JSUM_CLASSDIR = $(TEMPDIR)/jsum

# List of files created here or coming from BUILDDIR area (this workspace)
INTERNAL_IMPORT_LIST = \
            $(LIBDIR)/security/US_export_policy.jar \
            $(LIBDIR)/security/local_policy.jar \
            $(LIBDIR)/jce.jar \
            $(EXTDIR)/sunjce_provider.jar \
	    $(LIBDIR)/classlist

# List of files coming from outside this workspace
IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
              $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt

# INCLUDE_SA is false on platforms where SA is not supported.
# On platforms where it is supported, we want to allow it to
# not be present, at least temporarily.  So,
# if the SA files (well, just sa-jdi.jar) do not exist 
# in the HOTSPOT_IMPORT_PATH, then we won't build SA.
SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ]; then \
                          $(ECHO) true; \
                        else \
                          $(ECHO) false; \
                        fi)

ifeq ($(SA_EXISTS), false)
  INCLUDE_SA := false
endif

ifeq ($(INCLUDE_SA), true)
  IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
                 $(LIB_LOCATION)/$(SALIB_NAME)
  ifeq ($(PLATFORM), windows)
    IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
                   $(LIB_LOCATION)/$(SAPDB_NAME)
  endif
endif # INCLUDE_SA

# Hotspot client is only available on 32-bit builds
ifeq ($(ARCH_DATA_MODEL), 32)
  IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
                 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
endif

ifeq ($(PLATFORM), windows)
#  Windows     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Windows

IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%)

# NOTE: These might actually come from BUILDDIR, depends on the settings.
$(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll
	$(install-import-file)
	$(CHMOD) a+x $@
$(BINDIR)/unicows.dll: $(UNICOWS_DLL_PATH)/unicows.dll
	$(install-import-file)
	$(CHMOD) a+x $@
$(BINDIR)/msvcr71.dll: $(MSVCR71_DLL_PATH)/msvcr71.dll
	$(install-import-file)
	$(CHMOD) a+x $@

# Get the hotspot .map and .pdb files for client and server
IMPORT_LIST += \
	$(LIBDIR)/$(JVMLIB_NAME) \
	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)

# Hotspot client is only available on 32-bit builds
ifeq ($(ARCH_DATA_MODEL), 32)
  IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
                 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
endif

$(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
	$(install-import-file)

# it is OK for the .map and .pdb files to not exist, so do not force a 
# dependency on them from the bootstrap location, and allow the copy to fail.
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
	@$(prep-target)
	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@

#  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
else # PLATFORM
#  NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  NOT Windows

IMPORT_LIST += \
        $(LIB_LOCATION)/$(LIBJSIG_NAME) \
	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)

ifeq ($(PLATFORM), solaris)
  IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
endif 

ifeq ($(ARCH_DATA_MODEL), 32)

IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)

ifeq ($(PLATFORM), solaris)
#  solaris   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  solaris

ifeq ($(ARCH), sparc)
  IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
endif

IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)

ifeq ($(ARCH), sparc)
  IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
endif

# For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
IMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME)

# create a link from lib/libjvm.so to client/libjvm.so
$(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
	@$(prep-target)
	$(LN) -s $(CLIENT_LOCATION)/$(JVM_NAME) $@

#  solaris   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris
endif # 32bit solaris

endif # 32bit

#  NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows

endif # PLATFORM

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
	@$(prep-target)
	$(LN) -s ../$(LIBJSIG_NAME) $@

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
	$(install-import-file)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
	$(install-import-file)

ifeq ($(INCLUDE_SA), true)
# The Serviceability Agent is built in the Hotspot workspace.
# It contains two files:
#  - sa-jdi.jar:  This goes into the same dir as tools.jar.
#  - a shared library:  sawindbg.dll on windows / libproc.sa on unix
#		        This goes into the same dir as the other
#			shared libs, eg. libjdwp.so.
$(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
	$(install-import-file)

$(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
	$(install-import-file)

ifeq ($(PLATFORM), windows)
$(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
	$(install-import-file)
endif # windows
endif # INCLUDE_SA

# Internal import files
ifdef OPENJDK

$(LIBDIR)/jce.jar: \
	    $(CLOSED_JDK_IMPORT_PATH)/jre/lib/jce.jar
	$(install-closed-file)
$(EXTDIR)/sunjce_provider.jar: \
	    $(CLOSED_JDK_IMPORT_PATH)/jre/lib/ext/sunjce_provider.jar
	$(install-closed-file)
$(LIBDIR)/security/US_export_policy.jar: \
	    $(CLOSED_JDK_IMPORT_PATH)/jre/lib/security/US_export_policy.jar
	$(install-closed-file)
$(LIBDIR)/security/local_policy.jar: \
	    $(CLOSED_JDK_IMPORT_PATH)/jre/lib/security/local_policy.jar
	$(install-closed-file)

else

$(LIBDIR)/jce.jar: \
	    $(BUILDDIR)/closed/tools/crypto/jce/jce.jar
	$(install-file)
$(EXTDIR)/sunjce_provider.jar: \
	    $(BUILDDIR)/closed/tools/crypto/jce/sunjce_provider.jar
	$(install-file)
$(LIBDIR)/security/US_export_policy.jar: \
	    $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
	$(install-file)
$(LIBDIR)/security/local_policy.jar: \
	    $(BUILDDIR)/closed/tools/crypto/jce/local_policy.jar
	$(install-file)

endif #OPENJDK

$(JSUM_CLASSDIR)/AddJsum.class:  $(SHARINGDIR)/AddJsum.java
	@$(prep-target)
	$(JAVAC_BOOT) -d $(@D) $<

# Construct classlist file
$(LIBDIR)/classlist: $(SHARINGDIR)/classlist.$(PLATFORM) $(JSUM_CLASSDIR)/AddJsum.class
	@$(prep-target)
	@$(RM) -f $@.temp
	$(JAVA_BOOT) -cp $(JSUM_CLASSDIR) AddJsum $(SHARINGDIR)/classlist.$(PLATFORM) $@.temp
	$(MV) $@.temp $@

ifdef OPENJDK
# Copy closed source pre-built class files
# We need to do this here because these classes may be referenced by
# other classes which must find them to compile before the make files
# for these packages are invoked
# They are still copied in their actual build directories too, so
# that a local clobber and remake works.
CLOSED_CLASSES =  \
sun/dc \
java/awt/color/CMMException.class \
java/awt/color/ColorSpace.class \
java/awt/color/ICC_ColorSpace.class \
java/awt/color/ICC_Profile\$$1.class \
java/awt/color/ICC_Profile\$$2.class \
java/awt/color/ICC_Profile\$$3.class \
java/awt/color/ICC_Profile.class \
java/awt/color/ICC_ProfileGray.class \
java/awt/color/ICC_ProfileRGB.class \
java/awt/image/BandedSampleModel.class \
java/awt/image/ColorConvertOp.class \
java/awt/image/ComponentSampleModel.class \
java/awt/image/DataBuffer\$$1.class \
java/awt/image/DataBuffer.class \
java/awt/image/DataBufferByte.class \
java/awt/image/DataBufferInt.class \
java/awt/image/DataBufferShort.class \
java/awt/image/DataBufferUShort.class \
java/awt/image/MultiPixelPackedSampleModel.class \
java/awt/image/Raster.class \
java/awt/image/RenderedImage.class \
java/awt/image/SampleModel.class \
java/awt/image/SinglePixelPackedSampleModel.class \
java/awt/image/WritableRaster.class \
java/awt/image/WritableRenderedImage.class \
java/awt/image/renderable/ContextualRenderedImageFactory.class \
java/awt/image/renderable/ParameterBlock.class \
java/awt/image/renderable/RenderableImage.class \
java/awt/image/renderable/RenderableImageOp.class \
java/awt/image/renderable/RenderableImageProducer.class \
java/awt/image/renderable/RenderContext.class \
java/awt/image/renderable/RenderedImageFactory.class \
com/sun/jmx/snmp/SnmpDataTypeEnums.class \
com/sun/jmx/snmp/SnmpDefinitions.class \
com/sun/jmx/snmp/SnmpOid.class \
com/sun/jmx/snmp/SnmpOidDatabase.class \
com/sun/jmx/snmp/SnmpOidDatabaseSupport.class \
com/sun/jmx/snmp/SnmpOidRecord.class \
com/sun/jmx/snmp/SnmpOidTable.class \
com/sun/jmx/snmp/SnmpOidTableSupport.class \
com/sun/jmx/snmp/SnmpParameters.class \
com/sun/jmx/snmp/SnmpPduPacket.class \
com/sun/jmx/snmp/SnmpPeer.class \
com/sun/jmx/snmp/SnmpTimeticks.class \
com/sun/jmx/snmp/SnmpVarBind.class \
com/sun/jmx/snmp/SnmpVarBindList.class \
com/sun/jmx/snmp/Timestamp.class \
com/sun/jmx/snmp/daemon/SendQ.class \
com/sun/jmx/snmp/daemon/SnmpInformRequest.class \
com/sun/jmx/snmp/daemon/SnmpQManager.class \
com/sun/jmx/snmp/daemon/SnmpRequestCounter.class \
com/sun/jmx/snmp/daemon/SnmpResponseHandler.class \
com/sun/jmx/snmp/daemon/SnmpSendServer.class \
com/sun/jmx/snmp/daemon/SnmpSession.class \
com/sun/jmx/snmp/daemon/SnmpSocket.class \
com/sun/jmx/snmp/daemon/SnmpTimerServer.class \
com/sun/jmx/snmp/daemon/WaitQ.class \
com/sun/media/sound

build: openjdkredist
openjdkredist:
	$(call install-closed-classes,$(CLOSED_CLASSES))

else  # (!OPENJDK)
# Lucida font files are not included in the OpenJDK distribution.
# Get names of font files
include FILES.gmk

# Copy font files into OUTPUTDIR area

FONTFILES = $(SHARED_FONTFILES)
FONTSDIR  = $(LIBDIR)/fonts
FONTSDIRFILE  = $(FONTSDIR)/fonts.dir
INTERNAL_IMPORT_LIST += $(FONTFILES) 

ifneq ($(PLATFORM), windows)
  INTERNAL_IMPORT_LIST += $(FONTSDIRFILE)
endif

$(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/%.ttf
	$(install-file)

$(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir
	$(install-file)

ifeq ($(PLATFORM), linux)

# The oblique fonts are only needed/wanted on Linux.

OBLFONTSDIR  = $(LIBDIR)/oblique-fonts
OBLFONTSDIRFILE	 = $(OBLFONTSDIR)/fonts.dir
INTERNAL_IMPORT_LIST += $(OBLIQUE_FONTFILES) $(OBLFONTSDIRFILE)

$(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/oblique/%.ttf
	$(install-file)

$(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir
	$(install-file)

endif # linux
endif # OPENJDK

PARTIAL_SECURITY_CLASSFILE_LIST = \
    $(CLASSBINDIR)/javax/net/ssl/SSLException.class \
    $(CLASSBINDIR)/sun/security/ssl/SSLSocketImpl.class \
    $(CLASSBINDIR)/sun/security/krb5

# if sec-bin exists, unpack it into the build directory
# Also, the library recompile build indirectly depends on two SSL classes,
# so copy those as well
SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip
$(PARTIAL_SECURITY_CLASSFILE_LIST):
	@if [ -f $(SEC_FILES_ZIP) ] ; then \
	    $(CD) $(ABS_OUTPUTDIR) && \
		$(UNZIP) -o $(SEC_FILES_ZIP); \
	    $(MKDIR) -p $(ABS_OUTPUTDIR)/tmp/java/java.lang/library/newclasses/javax/net/ssl; \
	    $(CD) $(ABS_OUTPUTDIR)/tmp/java/java.lang/library/newclasses/javax/net/ssl && \
		$(UNZIP) -oj $(SEC_FILES_ZIP) \
			classes/javax/net/ssl/SSLException.class \
			classes/javax/net/ssl/SSLPeerUnverifiedException.class ; \
	fi

# if sec-windows-bin exists, unpack it into the build directory
PARTIAL_SECURITY_WIN_CLASSFILE_LIST = \
    $(CLASSBINDIR)/sun/security/krb5/internal/tools

SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip
$(PARTIAL_SECURITY_WIN_CLASSFILE_LIST):
ifeq ($(PLATFORM), windows)
	@if [ -f $(SEC_FILES_WIN_ZIP) ] ; then \
	    $(CD) $(ABS_OUTPUTDIR) && \
		$(UNZIP) -o $(SEC_FILES_WIN_ZIP) ; \
	fi
endif

PARTIAL_JGSS_LIST = \
	$(BINDIR)/w2k_lsa_auth.dll \
	$(BINDIR)/w2k_lsa_auth.map \
	$(BINDIR)/w2k_lsa_auth.pdb

# if JGSS files exists, unpack it into the build directory
JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip
JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip
$(PARTIAL_JGSS_LIST):
ifeq ($(PLATFORM), windows)
    ifeq ($(ARCH_DATA_MODEL), 32)
	@if [ -f $(JGSS_WIN32_FILES_ZIP) ] ; then \
	    $(CD) $(ABS_OUTPUTDIR) && \
		$(UNZIP) -o $(JGSS_WIN32_FILES_ZIP); \
	fi
    else
	@if [ -f $(JGSS_WIN64_FILES_ZIP) ] ; then \
	    $(CD) $(ABS_OUTPUTDIR) && \
		$(UNZIP) -o $(JGSS_WIN64_FILES_ZIP); \
	fi
    endif
endif

import_classes : $(PARTIAL_SECURITY_CLASSFILE_LIST) \
		$(PARTIAL_SECURITY_WIN_CLASSFILE_LIST) \
		$(PARTIAL_JGSS_LIST)

all : build

import_internal_files : $(INTERNAL_IMPORT_LIST)

import_files : $(IMPORT_LIST)

build : import_files import_internal_files import_classes

clean clobber ::
	$(RM) -r $(JSUM_CLASSDIR)
	$(RM) $(IMPORT_LIST)
	$(RM) $(INTERNAL_IMPORT_LIST)

.PHONY: import_files import_internal_files import_classes openjdkredist