diff make/common/Defs-windows.gmk @ 2324:7bbb5f3b6eed

6931180: Migration to recent versions of MS Platform SDK 6944048: VS2010 build failure in make/com/sun/java/pack: missing unpack200.exe.manifest 6944015: VS2010 build failure in awt_TextArea.cpp: ambiguous call to abs() 6936319: JDK build fails in awt_DnDDS.cpp with Visual Studio 2008/Platform SDK 7 6944516: Windows L&F is broken in SwingSet2, when JDK is built with the recent Windows SDK Summary: Changes to enable building JDK7 with Microsoft Visual Studio 2010 Reviewed-by: ohair, art, ccheung, dcubed
author prr
date Tue, 11 May 2010 14:36:10 -0700
parents 53b27ac4f706
children 00cd9dc3c2b5
line wrap: on
line diff
--- a/make/common/Defs-windows.gmk	Thu Apr 29 14:32:53 2010 -0700
+++ b/make/common/Defs-windows.gmk	Tue May 11 14:36:10 2010 -0700
@@ -86,6 +86,11 @@
     MSVCPNN_DLL = msvcp90.dll
     MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
   endif
+  ifeq ($(COMPILER_VERSION), VS2010)
+    MSVCRNN_DLL = msvcr100.dll
+    MSVCPNN_DLL = msvcp100.dll
+    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
+  endif
 endif
 
 ifeq ($(ARCH_DATA_MODEL), 64)
@@ -94,6 +99,11 @@
     MSVCPNN_DLL = msvcp90.dll
     MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
   endif
+  ifeq ($(COMPILER_VERSION), VS2010)
+    MSVCRNN_DLL = msvcr100.dll
+    MSVCPNN_DLL = msvcp100.dll
+    MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
+  endif
 endif
 
 EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
@@ -155,6 +165,7 @@
     # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
     AUTOMATIC_PCH_OPTION =
     GX_OPTION = -GX
+    GZ_OPTION = -GZ
     ifeq ($(ARCH_DATA_MODEL), 32)
       CC_OPT/HIGHEST = -Ox -Gy -Os -GB
       CC_OPT/HIGHER  = -Ox -Gy -Os -GB
@@ -171,6 +182,7 @@
     AUTOMATIC_PCH_OPTION = -YX
     # Also known as VC7 compiler
     GX_OPTION = -GX
+    GZ_OPTION = -GZ
     ifeq ($(ARCH_DATA_MODEL), 32)
       # Lowered opt level to try and reduce footprint, dll size especially.
       #     Was: CC_OPT/HIGHEST = -O2 -G6
@@ -190,6 +202,7 @@
     AUTOMATIC_PCH_OPTION =
     # VS2005 compiler, only with Platform SDK right now?
     GX_OPTION = -EHsc
+    GZ_OPTION = -RTC1
     ifeq ($(ARCH_DATA_MODEL), 32)
       CC_OPT/HIGHEST = -O2
       CC_OPT/HIGHER  = -O1
@@ -204,6 +217,23 @@
     # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
     AUTOMATIC_PCH_OPTION =
     GX_OPTION = -EHsc
+    GZ_OPTION = -RTC1
+    ifeq ($(ARCH_DATA_MODEL), 32)
+      CC_OPT/HIGHEST = -O2
+      CC_OPT/HIGHER  = -O1
+      CC_OPT/LOWER   = -O1
+    else
+      CC_OPT/HIGHEST = -O2
+      CC_OPT/HIGHER  = -O1
+      CC_OPT/LOWER   = -O1
+    endif
+  endif
+
+  ifeq ($(COMPILER_VERSION), VS2010)
+    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
+    AUTOMATIC_PCH_OPTION =
+    GX_OPTION = -EHsc
+    GZ_OPTION = -RTC1
     ifeq ($(ARCH_DATA_MODEL), 32)
       CC_OPT/HIGHEST = -O2
       CC_OPT/HIGHER  = -O1
@@ -282,6 +312,13 @@
   CFLAGS_OPT      = $(CC_OPT)
   CFLAGS_DBG      = -Od $(MS_RUNTIME_DEBUG_OPTION)
 
+  # REMIND: I don't see where CFLAGS_VS2005 is used. I suspect its
+  # pulled in as a combined "CFLAGS_$(COMPILER_VERSION)" string
+  # but the lack of this isn't causing any apparent build problems
+  # with VS 2010 but it could be causing compiler warnings.
+  # For now, I  will add it for all cases :
+  CFLAGS_VS2010 += -Zc:wchar_t-
+  #
   # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
   # by default. However, we expect the wchar_t to be a typedef to the
   # unsigned short data type. The -Zc:wchar_t- option restores the old
@@ -317,6 +354,7 @@
 
   # VS2008 has bufferoverflow baked in:
   LFLAGS_VS2008 = 
+  LFLAGS_VS2010 = 
 
   # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
   BASELFLAGS = -nologo /opt:REF /incremental:no