6950375: Remove msvcrt.dll from the Windows JRE bundles
Reviewed-by: prr
## Copyright (c) 1995, 2010, 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.### Common variables used by all the Java makefiles. This file should# not contain rules.## WARNING: This file is shared with other workspaces.# So when it includes other files, it must use JDK_TOPDIR.## Check for strange explicit settings (change to empty or true)ifdef OPENJDK ifneq ($(OPENJDK),true) x:=$(error "OPENJDK (if defined) can only be set to true") endifendif## On Solaris, the 'make' utility from Sun will not work with these makefiles.# This little rule is only understood by Sun's make, and is harmless# when seen by the GNU make tool. If using Sun's make, this causes the# make command to fail.#SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33ifndef JDK_TOPDIR ifdef BUILDDIR JDK_TOPDIR=$(BUILDDIR)/.. else JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository") endifendififndef BUILDDIR # Hack, due to deploy repository using this file. BUILDDIR=$(JDK_TOPDIR)/makeendififndef JDK_MAKE_SHARED_DIR JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/sharedendifinclude $(JDK_MAKE_SHARED_DIR)/Platform.gmkTOPDIR=$(BUILDDIR)/..include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to# src/solaris so if you want to build on Linux you didn't need a src/linux# directory. In an ideal world it would be called src/genunix but we are not# there yet.#ifndef SHARE_SRC SHARE_SRC = $(BUILDDIR)/../src/shareendif# Files that cannot be included in the OpenJDK distribution are# collected under a parent directory which contains just those files.ifndef CLOSED_SRC CLOSED_SRC = $(BUILDDIR)/../src/closedendif# If CLOSE_SRC_INCLUDED isn't set to true, check if there's any# closed directory.ifneq ($(CLOSED_SRC_INCLUDED), true) CLOSED_SRC_INCLUDED := $(shell \ if [ -d $(CLOSED_SRC) ] ; then \ echo true; \ else \ echo false; \ fi)endif# Set OPENJDK based on CLOSED_SRC_INCLUDEDifeq ($(CLOSED_SRC_INCLUDED), false) OPENJDK = trueendif# Define where closed directories areifdef OPENJDK CLOSED_SRC = CLOSED_SHARE_SRC =else ifndef CLOSED_SHARE_SRC CLOSED_SHARE_SRC = $(CLOSED_SRC)/share endifendif## Get platform definitions#include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk## Freetype logic is applicable to OpenJDK only#ifdef OPENJDK#if we use system lib we do not need to copy it to build treeUSING_SYSTEM_FT_LIB=falseifeq ($(PLATFORM), windows) DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)endififeq ($(PLATFORM), linux) DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)endififeq ($(PLATFORM), solaris) # historically for Solaris we have slightly different devtools # naming conventions DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)endifDEVTOOLS_FT_DIR_EXISTS = $(shell \ if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \ echo true; \ else \ echo false; \ fi) ifdef ALT_FREETYPE_LIB_PATH FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH) else ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib else FREETYPE_LIB_PATH = /usr/lib USING_SYSTEM_FT_LIB=true endif endif ifdef ALT_FREETYPE_HEADERS_PATH FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH) else ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include else FREETYPE_HEADERS_PATH = /usr/include endif endifendif## zlib version#ZLIB_VERSION = 1.2.3## Localizations for the different parts of the product beyond English#JRE_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HKPLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HKJDK_LOCALES = ja zh_CN## A list of locales we support but don't have resource files.# This is defined to optimize the search of resource bundles.#JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh## All libraries except libjava and libjvm itself link against libjvm and# libjava, the latter for its exported common utilities. libjava only links# against libjvm. Programs' makefiles take their own responsibility for# adding other libs.#ifdef PACKAGE# put JAVALIB first, but do not lose any platform specific values.... LDLIBS_COMMON = $(JAVALIB)endif # PACKAGE## Libraries that must appear ahead of libc.so on the link command line#ifdef PROGRAM ifeq ($(PLATFORM), solaris) LDLIBS_COMMON = -lthread -ldl endif ifeq ($(PLATFORM), linux) LDLIBS_COMMON = -ldl endifendif # PROGRAMLDLIBS_COMMON += $(EXTRA_LIBS)# for generated librariesLIBDIR = $(OUTPUTDIR)/libABS_LIBDIR = $(ABS_OUTPUTDIR)/lib# Optional place to save the windows .lib filesLIBFILES_DIR = $(OUTPUTDIR)/libfiles# for ext jre filesEXTDIR = $(LIBDIR)/ext# for generated include filesINCLUDEDIR = $(OUTPUTDIR)/include# for generated class filesCLASSBINDIR = $(OUTPUTDIR)/classesDEMOCLASSDIR = $(OUTPUTDIR)/democlasses# for modulesMODULES_DIR = $(OUTPUTDIR)/modulesABS_MODULES_DIR = $(ABS_OUTPUTDIR)/modules# for generated tool class filesBUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses# for build tool jar filesBUILDTOOLJARDIR = $(OUTPUTDIR)/btjarsABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars# for generated tool class filesBUILDTOOLBINDIR = $(OUTPUTDIR)/btbins# for generated java source filesGENSRCDIR = $(OUTPUTDIR)/gensrc# for generated C source files (not javah)GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc# for imported source filesIMPORTSRCDIR = $(OUTPUTDIR)/impsrc# for imported documentsIMPORTDOCDIR = $(OUTPUTDIR)/impdoc# for generated demoDEMODIR = $(OUTPUTDIR)/demo# for sample codeSAMPLEDIR = $(OUTPUTDIR)/sample# for generated documentationDOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)DOCSDIRSUFFIX =# The MESSAGE, WARNING and ERROR files are used to store sanityck and # warnings and errors. ifndef ERROR_FILE ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txtendififndef WARNING_FILE WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txtendififndef MESSAGE_FILE MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txtendifJDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-imageJRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image#where the demo source can be foundDEMOSRCDIR = $(SHARE_SRC)/demo# An attempt is made to generate unique enough directories for the# generated files to not have name collisisons. Most build units# defines PRODUCT (except Release.gmk), but then they may or may # not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and # LIBRARY. This code chunk attempts to generate a unique # OBJDIR/CLASSHDRDIR for each build unit based on which of those # values are set within each build unit.UNIQUE_LOCATION_STRING = tmpifneq ($(PRODUCT),) UNIQUE_LOCATION_STRING += /$(PRODUCT)endififneq ($(PACKAGE),) UNIQUE_LOCATION_STRING += /$(PACKAGE)endififneq ($(PROGRAM),) UNIQUE_LOCATION_STRING += /$(PROGRAM)endififneq ($(LIBRARY),) ifneq ($(LIBRARY_OUTPUT),) UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT) else UNIQUE_LOCATION_STRING += /$(LIBRARY) endifendififneq ($(THREADDIR),) UNIQUE_LOCATION_STRING += /$(THREADDIR)endif## Build units may or may not define MODULE. Default to "other".## MODULE variable defines the lowest-level module name that# might or might not be the name of the modules created in# the modules build (see make/modules/modules.config and# modules.group).#MODULES_TEMPDIR = $(OUTPUTDIR)/tmp/modulesABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modulesifndef MODULE MODULE = otherendifoverride MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE)# the use of += above makes a space separated list which we need to # remove for filespecs.#NULLSTRING :=ONESPACE := $(NULLSTRING) # space before this comment is required.UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))# TEMPDIR is a unique general purpose directory# need to use 'override' because GNU Make on Linux exports the wrong# value.override TEMPDIR = $(OUTPUTDIR)/$(UNIQUE_PATH)override ABS_TEMPDIR = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)# This must be created right away for pattern rules in Sanity.gmk to work.dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))# OBJDIRNAME is the name of the directory where the object code is to# be placed. It's name depends on whether the data model architecture # is 32-bit or not.ifneq ($(ARCH_DATA_MODEL), 32) OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)else OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX)endifOBJDIR = $(TEMPDIR)/$(OBJDIRNAME)# CLASSHDRDIR is where the generated C Class Header files go.CLASSHDRDIR = $(TEMPDIR)/CClassHeaders## CLASSDESTDIR can be used to specify the directory where generated classes# are to be placed. The default is CLASSBINDIR.#ifndef CLASSDESTDIRCLASSDESTDIR = $(CLASSBINDIR)endifINCLUDES = -I. -I$(CLASSHDRDIR) \ $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)OTHER_CPPFLAGS = $(INCLUDES)## vpaths. These are the default locations searched for source files.# GNUmakefiles of individual areas often override the default settings.# There are no longer default vpath entries for C and assembler files# so we can ensure that libraries don't get their hands on JVM files.## We define an intermediate variable for Java files because# we use its value later to help define $SOURCEPATHVPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classesifdef OPENJDK VPATH.java = $(VPATH0.java)else # # If filenames are duplicated between open/closed workspaces, prefer # the closed files. # # Source ordering is important: some targets depend on closed files # replacing open ones, and thus the closed file sources must be found # before the open ones. # # Don't reorder without consulting the teams that depend on this behavior. # VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)endifvpath %.java $(VPATH.java)vpath %.class $(CLASSBINDIR)vpath %.$(OBJECT_SUFFIX) $(OBJDIR)## VPATH.h is used elsewhere to generate include flags. By default, # anyone has access to the include files that the JVM area exports,# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific# relatives.#VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/exportvpath %.h $(VPATH.h)## Used in two ways: helps link against libjava.so. Also if overridden# determines where your shared library is installed.#ifndef LIB_LOCATION LIB_LOCATION = $(LIBDIR)/$(LIBARCH)endif## Java header and stub variables#CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h## Classpath seen by javac (different from the one seen by the VM# running javac), and useful variables.#SOURCEPATH = $(VPATH.java)PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')PKGDIR = $(subst .,/,$(PACKAGE))## The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)#include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk## Macros to find the module that $@ belongs to#UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \ -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \ -e 's%.*\/lib\/%lib\/%' \ -e 's%.*\/bin\/%bin\/%' \ -e 's%.*\/include\/%include\/%' \ -e 's%.*\/demo\/%demo\/%' \ -e 's%.*\/sample\/%sample\/%'# Install a file to its moduledefine install-module-filedest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \$(CP) -f $@ $(MODULE_DEST_DIR)/$$destendef# Install all files from the directory to its moduledefine install-module-dirdest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$destendef# chmod the file in its moduledefine chmod-module-filedest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \$(CHMOD) $1 $(MODULE_DEST_DIR)/$$destendef# install a sym link in its moduledefine install-module-sym-linkdest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \$(LN) -sf $1 $(MODULE_DEST_DIR)/$$destendef# Run MAKE $@ for a launcher:# $(call make-launcher, name, mainclass, java-args, main-args)define make-launcher$(CD) $(BUILDDIR)/launchers && \$(MAKE) -f Makefile.launcher \ MODULE=$(MODULE) \ PROGRAM=$(strip $1) \ MAIN_CLASS=$(strip $2) \ MAIN_JAVA_ARGS="$(strip $3)" \ MAIN_ARGS="$(strip $4)"endef## Convenient macros## Prepare $@ target, remove old one and making sure directory existsdefine prep-target$(MKDIR) -p $(@D)$(RM) $@endef# Simple install of $< file to $@define install-file$(prep-target)$(CP) $< $@@$(install-module-file)endefdefine chmod-file$(CHMOD) $1 $@@$(call chmod-module-file, $1)endefdefine install-sym-link$(LN) -s $1 $@@$(call install-module-sym-link, $1)endef## Marcos for files not belonging to any module define install-non-module-file$(prep-target)$(CP) $< $@endefdefine install-manifest-file$(install-non-module-file)endef# Cleanup rule for after debug java run (hotspot.log file is left around)# (This could be an old leftover file in a read-only area, use the @- prefix)HOTSPOT_LOG_NAME = hotspot.logdefine java-vm-cleanupif [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fiendef# Current directoryCURRENT_DIRECTORY := $(shell $(PWD))## Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is# used for this file, otherwise the default settings are used.#CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \ $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \ $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))## Tool flags#ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS)CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \ $(DEFINES) $(OPTIONS:%=-D%)LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \ $(OTHER_LINTFLAGS)VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'ifdef INSANE export INSANEendififdef ALT_COPYRIGHT_YEAR COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)else COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')endif# Install of imported file (JDK_IMPORT_PATH, or some other external location)define install-importonly-file@$(ECHO) "ASSEMBLY_IMPORT: $@"$(prep-target)$(CP) $< $@@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then \ if [ -x /usr/sbin/selinuxenabled ] ; then \ /usr/sbin/selinuxenabled; \ if [ $$? = 0 ] ; then \ $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@"; \ /usr/bin/chcon -t textrel_shlib_t $@; \ if [ $$? != 0 ]; then \ echo "ERROR: Cannot chcon $@"; \ fi; \ fi; \ fi; \fiendefdefine install-import-file$(install-importonly-file)@$(install-module-file)endef.PHONY: all build clean clobber