8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
Reviewed-by: tbell, ihse
This commit is contained in:
parent
1b65f85514
commit
1310f9142f
@ -60,16 +60,28 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Copy msvcrXX.dll on windows
|
# Copy the microsoft runtime libraries on windows
|
||||||
|
|
||||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
MSVCR_TARGET := $(LIB_DST_DIR)/$(notdir $(MSVCR_DLL))
|
|
||||||
# Chmod to avoid permission issues if bundles are unpacked on unix platforms.
|
|
||||||
$(MSVCR_TARGET): $(MSVCR_DLL)
|
|
||||||
$(call install-file)
|
|
||||||
$(CHMOD) a+rx $@
|
|
||||||
|
|
||||||
TARGETS += $(MSVCR_TARGET)
|
# 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
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -283,6 +283,11 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
|||||||
cmdtoargs.c
|
cmdtoargs.c
|
||||||
# Staticically link with c runtime on windows.
|
# Staticically link with c runtime on windows.
|
||||||
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
|
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
|
||||||
|
# Supply the name of the C runtime lib.
|
||||||
|
LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
|
||||||
|
ifneq ($(MSVCP_DLL), )
|
||||||
|
LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
|
||||||
|
endif
|
||||||
else ifneq ($(OPENJDK_TARGET_OS), macosx)
|
else ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||||
|
|
||||||
BUILD_LIBJLI_FILES += java_md_common.c
|
BUILD_LIBJLI_FILES += java_md_common.c
|
||||||
|
@ -265,26 +265,17 @@ LoadMSVCRT()
|
|||||||
* assumed to be present in the "JRE path" directory. If it is not found
|
* assumed to be present in the "JRE path" directory. If it is not found
|
||||||
* there (or "JRE path" fails to resolve), skip the explicit load and let
|
* there (or "JRE path" fails to resolve), skip the explicit load and let
|
||||||
* nature take its course, which is likely to be a failure to execute.
|
* nature take its course, which is likely to be a failure to execute.
|
||||||
* This is clearly completely specific to the exact compiler version
|
* The makefiles will provide the correct lib contained in quotes in the
|
||||||
* which isn't very nice, but its hardly the only place.
|
* macro MSVCR_DLL_NAME.
|
||||||
* No attempt to look for compiler versions in between 2003 and 2010
|
|
||||||
* as we aren't supporting building with those.
|
|
||||||
*/
|
*/
|
||||||
#ifdef _MSC_VER
|
#ifdef MSVCR_DLL_NAME
|
||||||
#if _MSC_VER < 1400
|
|
||||||
#define CRT_DLL "msvcr71.dll"
|
|
||||||
#endif
|
|
||||||
#if _MSC_VER >= 1600
|
|
||||||
#define CRT_DLL "msvcr100.dll"
|
|
||||||
#endif
|
|
||||||
#ifdef CRT_DLL
|
|
||||||
if (GetJREPath(crtpath, MAXPATHLEN)) {
|
if (GetJREPath(crtpath, MAXPATHLEN)) {
|
||||||
if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
|
if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
|
||||||
JLI_StrLen(CRT_DLL) >= MAXPATHLEN) {
|
JLI_StrLen(MSVCR_DLL_NAME) >= MAXPATHLEN) {
|
||||||
JLI_ReportErrorMessage(JRE_ERROR11);
|
JLI_ReportErrorMessage(JRE_ERROR11);
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
(void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */
|
(void)JLI_StrCat(crtpath, "\\bin\\" MSVCR_DLL_NAME); /* Add crt dll */
|
||||||
JLI_TraceLauncher("CRT path is %s\n", crtpath);
|
JLI_TraceLauncher("CRT path is %s\n", crtpath);
|
||||||
if (_access(crtpath, 0) == 0) {
|
if (_access(crtpath, 0) == 0) {
|
||||||
if (LoadLibrary(crtpath) == 0) {
|
if (LoadLibrary(crtpath) == 0) {
|
||||||
@ -293,8 +284,24 @@ LoadMSVCRT()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CRT_DLL */
|
#endif /* MSVCR_DLL_NAME */
|
||||||
#endif /* _MSC_VER */
|
#ifdef MSVCP_DLL_NAME
|
||||||
|
if (GetJREPath(crtpath, MAXPATHLEN)) {
|
||||||
|
if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
|
||||||
|
JLI_StrLen(MSVCP_DLL_NAME) >= MAXPATHLEN) {
|
||||||
|
JLI_ReportErrorMessage(JRE_ERROR11);
|
||||||
|
return JNI_FALSE;
|
||||||
|
}
|
||||||
|
(void)JLI_StrCat(crtpath, "\\bin\\" MSVCP_DLL_NAME); /* Add prt dll */
|
||||||
|
JLI_TraceLauncher("PRT path is %s\n", crtpath);
|
||||||
|
if (_access(crtpath, 0) == 0) {
|
||||||
|
if (LoadLibrary(crtpath) == 0) {
|
||||||
|
JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
|
||||||
|
return JNI_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* MSVCP_DLL_NAME */
|
||||||
loaded = 1;
|
loaded = 1;
|
||||||
}
|
}
|
||||||
return JNI_TRUE;
|
return JNI_TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user