view make/copy/Copy-java.base.gmk @ 13901:b2a69d66dc65

8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: alanb, mchung, naoto, rriggs, psandoz, plevart, mullan, ascarpino, vinnie, prr, sherman, dfuchs, mhaupt Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, chris.hegarty@oracle.com, alexandr.scherbatiy@oracle.com, amy.lu@oracle.com, calvin.cheung@oracle.com, daniel.fuchs@oracle.com, erik.joelsson@oracle.com, harold.seigel@oracle.com, jaroslav.bachorik@oracle.com, jean-francois.denise@oracle.com, jan.lahoda@oracle.com, james.laskey@oracle.com, lois.foltan@oracle.com, miroslav.kos@oracle.com, huaming.li@oracle.com, sean.mullan@oracle.com, naoto.sato@oracle.com, masayoshi.okutsu@oracle.com, peter.levart@gmail.com, philip.race@oracle.com, claes.redestad@oracle.com, sergey.bylokhov@oracle.com, alexandre.iline@oracle.com, volker.simonis@gmail.com, staffan.larsen@oracle.com, stuart.marks@oracle.com, semyon.sadetsky@oracle.com, serguei.spitsyn@oracle.com, sundararajan.athijegannathan@oracle.com, valerie.peng@oracle.com, vincent.x.ryan@oracle.com, weijun.wang@oracle.com, yuri.nesterenko@oracle.com, yekaterina.kantserova@oracle.com, alexander.kulyakhtin@oracle.com, felix.yang@oracle.com, andrei.eremeev@oracle.com, frank.yuan@oracle.com, sergei.pikalev@oracle.com, sibabrata.sahoo@oracle.com, tiantian.du@oracle.com, sha.jiang@oracle.com
author alanb
date Thu, 17 Mar 2016 19:04:16 +0000
parents 31ba5abc1e41
children db3aa029c06f
line wrap: on
line source
#
# Copyright (c) 2014, 2015, 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.
#

include CopyCommon.gmk

$(eval $(call IncludeCustomExtension, jdk, copy/Copy-java.base.gmk))

################################################################################
#
# Copy exported header files to outputdir.
#
TARGETS += \
    $(INCLUDE_DST_DIR)/jni.h \
    $(INCLUDE_DST_DIR)/jvmti.h \
    $(INCLUDE_DST_DIR)/jvmticmlr.h \
    $(INCLUDE_DST_DIR)/classfile_constants.h \
    $(INCLUDE_DST_OS_DIR)/jni_md.h \
    #

$(INCLUDE_DST_DIR)/%.h: $(JDK_TOPDIR)/src/java.base/share/native/include/%.h
	$(call install-file)

$(INCLUDE_DST_OS_DIR)/%.h: \
    $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include/%.h
	$(call install-file)

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

ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),)

  TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf

  $(LIB_DST_DIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
	$(call install-file)

  TARGETS += $(LIB_DST_DIR)/tzmappings

endif

################################################################################
# Copy the microsoft runtime libraries on windows
ifeq ($(OPENJDK_TARGET_OS), windows)

  # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
  define copy-and-chmod
	$(install-file)
	$(CHMOD) a+rx $@
  endef

  # Use separate macro calls in case the source files are not in the same
  # directory.
  $(eval $(call SetupCopyFiles,COPY_MSVCR, \
      DEST := $(LIB_DST_DIR), \
      FILES := $(MSVCR_DLL), \
      MACRO := copy-and-chmod))

  $(eval $(call SetupCopyFiles,COPY_MSVCP, \
      DEST := $(LIB_DST_DIR), \
      FILES := $(MSVCP_DLL), \
      MACRO := copy-and-chmod))

  TARGETS += $(COPY_MSVCR) $(COPY_MSVCP)
endif

################################################################################
#
# How to install jvm.cfg.
#
ifeq ($(JVM_VARIANT_ZERO), true)
  JVMCFG_ARCH := zero
else
  JVMCFG_ARCH := $(OPENJDK_TARGET_CPU_LEGACY)
endif

ifeq ($(OPENJDK_TARGET_OS), macosx)
  JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg
else
  JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg
  # Allow override by ALT_JVMCFG_SRC if it exists
  JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) 
endif
JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR)
JVMCFG := $(JVMCFG_DIR)/jvm.cfg

# To do: should this also support -zeroshark?

ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  COPY_JVM_CFG_FILE := true
else
  # On 32-bit machines we have three potential VMs: client, server and minimal.
  # Historically we usually have both client and server and so that is what the
  # committed jvm.cfg expects (including platform specific ergonomics switches
  # to decide whether to use client or server by default). So when we have anything
  # other than client and server we need to define a new jvm.cfg file.
  # The main problem is deciding whether to use aliases for the VMs that are not
  # present and the current position is that we add aliases for client and server, but
  # not for minimal.
  CLIENT_AND_SERVER := $(and $(findstring true, $(JVM_VARIANT_SERVER)), $(findstring true, $(JVM_VARIANT_CLIENT)))
  ifeq ($(CLIENT_AND_SERVER), true)
    COPY_JVM_CFG_FILE := true
  else
    # For zero, the default jvm.cfg file is sufficient
    ifeq ($(JVM_VARIANT_ZERO), true)
      COPY_JVM_CFG_FILE := true
    endif
  endif
endif

ifeq ($(COPY_JVM_CFG_FILE), true)
  $(JVMCFG): $(JVMCFG_SRC)
	$(call install-file)
else
  $(JVMCFG):
	$(MKDIR) -p $(@D)
	$(RM) $(@)
        # Now check for other permutations
        ifeq ($(JVM_VARIANT_SERVER), true)
	  $(PRINTF) "-server KNOWN\n">>$(@)
	  $(PRINTF) "-client ALIASED_TO -server\n">>$(@)
          ifeq ($(JVM_VARIANT_MINIMAL1), true)
	    $(PRINTF) "-minimal KNOWN\n">>$(@)
          endif
        else
          ifeq ($(JVM_VARIANT_CLIENT), true)
	    $(PRINTF) "-client KNOWN\n">>$(@)
	    $(PRINTF) "-server ALIASED_TO -client\n">>$(@)
            ifeq ($(JVM_VARIANT_MINIMAL1), true)
	      $(PRINTF) "-minimal KNOWN\n">>$(@)
            endif
          else
            ifeq ($(JVM_VARIANT_MINIMAL1), true)
	      $(PRINTF) "-minimal KNOWN\n">>$(@)
	      $(PRINTF) "-server ALIASED_TO -minimal\n">>$(@)
	      $(PRINTF) "-client ALIASED_TO -minimal\n">>$(@)
            endif
          endif
        endif
endif

TARGETS += $(JVMCFG)

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

POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/conf/security/java.policy
POLICY_DST := $(CONF_DST_DIR)/security/java.policy

POLICY_SRC_LIST :=

ifeq ($(OPENJDK_TARGET_OS), windows)
  POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf/security/java.policy
endif

# Allow imported modules to modify the java.policy
ifneq ($(IMPORT_MODULES_CONF), )
  POLICY_SRC_LIST += $(wildcard $(IMPORT_MODULES_CONF)/java.base/security/java.policy.extra)
endif

POLICY_SRC_LIST += $(POLICY_SRC)

$(POLICY_DST): $(POLICY_SRC_LIST)
	$(MKDIR) -p $(@D)
	$(RM) $@ $@.tmp
	$(foreach f,$(POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;)
	$(MV) $@.tmp $@

TARGETS += $(POLICY_DST)

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

ifeq ($(CACERTS_FILE), )
  CACERTS_FILE := $(JDK_TOPDIR)/src/java.base/share/conf/security/cacerts
endif

CACERTS_DST := $(LIB_DST_DIR)/security/cacerts

$(CACERTS_DST): $(CACERTS_FILE)
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
	$(call install-file)

TARGETS += $(CACERTS_DST)

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

$(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \
    FILES := $(JDK_TOPDIR)/src/java.base/share/conf/net.properties, \
    DEST := $(CONF_DST_DIR), \
))

TARGETS += $(COPY_NET_PROPERTIES)

ifeq ($(OPENJDK_TARGET_OS), solaris)
  $(eval $(call SetupCopyFiles, COPY_SDP_CONF, \
      FILES := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \
      DEST := $(CONF_DST_DIR)/sdp, \
  ))

  TARGETS += $(COPY_SDP_CONF)
endif

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