提交 af2deef7 编写于 作者: E erikj

8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)

Reviewed-by: tbell, ihse
上级 e8098341
......@@ -558,15 +558,23 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-DWIN32 -DIAL"
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \
-Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-DWIN32 -DIAL"
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
else
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
fi
# If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to
# avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
# studio.
if test "x$TOOLCHAIN_VERSION" = "x2010"; then
COMMON_CXXFLAGS_JDK="$COMMON_CXXFLAGS_JDK \
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
fi
fi
###############################################################################
......
......@@ -209,7 +209,10 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
fi
printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
if test "x$TOOLCHAIN_VERSION" != "x"; then
print_version=" $TOOLCHAIN_VERSION"
fi
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
......
......@@ -1124,10 +1124,9 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
[
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
TOOLCHAIN_SETUP_MSVCR_DLL
TOOLCHAIN_SETUP_VS_RUNTIME_DLLS
BASIC_DEPRECATED_ARG_WITH([dxsdk])
BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
fi
AC_SUBST(MSVCR_DLL)
])
......@@ -579,6 +579,7 @@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
MSVCR_DLL:=@MSVCR_DLL@
MSVCP_DLL:=@MSVCP_DLL@
# ADD_SRCS takes a single argument with source roots
......
......@@ -691,8 +691,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
if test "x$COMPILER_CPU_TEST" != "x80x86"; then
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".])
if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".])
fi
elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
if test "x$COMPILER_CPU_TEST" != "xx64"; then
......
......@@ -512,7 +512,6 @@ define AddFileToCopy
# 2 : Dest file
# 3 : Variable to add targets to
# 4 : Macro to call for copy operation
$2: $1
$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
$$($$(strip $4))
......@@ -523,11 +522,13 @@ endef
define SetupCopyFiles
# param 1 is for example COPY_MYFILES
# param 2,3,4,5 are named args.
# SRC : Source root dir
# DEST : Dest root dir
# FILES : List of files to copy with absolute paths, or path relative to SRC. Must be in SRC.
# SRC : Source root dir (defaults to dir of first file)
# DEST : Dest root dir
# FILES : List of files to copy with absolute paths, or path relative to SRC.
# Must be in SRC.
# FLATTEN : Set to flatten the directory structure in the DEST dir.
# MACRO : Optionally override the default macro used for making the copy. Default is 'install-file'
# MACRO : Optionally override the default macro used for making the copy.
# Default is 'install-file'
$(foreach i,2 3 4 5 6, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupCopyFiles($1),$2,$3,$4,$5,$6)
$(if $(7),$(error Internal makefile error: Too many arguments to SetupCopyFiles))
......@@ -536,6 +537,14 @@ define SetupCopyFiles
$1_MACRO := install-file
endif
# Default SRC to the dir of the first file.
ifeq ($$($1_SRC), )
$1_SRC := $$(dir $$(firstword $$($1_FILES)))
endif
# Remove any trailing slash from SRC
$1_SRC := $$(patsubst %/,%,$$($1_SRC))
$$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
$$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \
$$($1_DEST)/$$(if $$($1_FLATTEN),$$(notdir $$f),$$f), $1, $$($1_MACRO))))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册