JRE-718 Support VS2013 in JBRE build

Updated build scripts to support VS2013
diff --git a/make/windows/makefiles/compile.make b/make/windows/makefiles/compile.make
index 6f82606..a936f2e 100644
--- a/make/windows/makefiles/compile.make
+++ b/make/windows/makefiles/compile.make
@@ -63,28 +63,20 @@
 # Based on BUILDARCH we add some flags and select the default compiler name
 !if "$(BUILDARCH)" == "ia64"
 MACHINE=IA64
-DEFAULT_COMPILER_NAME=VS2003
 CXX_FLAGS=$(CXX_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64"
 !endif
 
 !if "$(BUILDARCH)" == "amd64"
 MACHINE=AMD64
-DEFAULT_COMPILER_NAME=VS2005
 CXX_FLAGS=$(CXX_FLAGS) /D "_LP64" /D "AMD64"
 LP64=1
 !endif
 
 !if "$(BUILDARCH)" == "i486"
 MACHINE=I386
-DEFAULT_COMPILER_NAME=VS2003
 CXX_FLAGS=$(CXX_FLAGS) /D "IA32"
 !endif
 
-# Sanity check, this is the default if not amd64, ia64, or i486
-!ifndef DEFAULT_COMPILER_NAME
-CXX=ARCH_ERROR
-!endif
-
 CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS"
 # Must specify this for sharedRuntimeTrig.cpp
 CXX_FLAGS=$(CXX_FLAGS) /D "VM_LITTLE_ENDIAN"
@@ -112,6 +104,7 @@
 #      1500 is for VS2008
 #      1600 is for VS2010
 #      1700 is for VS2012
+#      1800 is for VS2013
 #    Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
 #    compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
 #    Normally they are the same, but a pre-release of the VS2005 compilers
@@ -119,35 +112,6 @@
 #    closer to VS2003 in terms of option spellings, so we use 1399 for that
 #    1400 version that really isn't 1400.
 #    See the file get_msc_ver.sh for more info.
-!if "x$(MSC_VER)" == "x"
-COMPILER_NAME=$(DEFAULT_COMPILER_NAME)
-!else
-!if "$(MSC_VER)" == "1200"
-COMPILER_NAME=VC6
-!endif
-!if "$(MSC_VER)" == "1300"
-COMPILER_NAME=VS2003
-!endif
-!if "$(MSC_VER)" == "1310"
-COMPILER_NAME=VS2003
-!endif
-!if "$(MSC_VER)" == "1399"
-# Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
-COMPILER_NAME=VS2003
-!endif
-!if "$(MSC_VER)" == "1400"
-COMPILER_NAME=VS2005
-!endif
-!if "$(MSC_VER)" == "1500"
-COMPILER_NAME=VS2008
-!endif
-!if "$(MSC_VER)" == "1600"
-COMPILER_NAME=VS2010
-!endif
-!if "$(MSC_VER)" == "1700"
-COMPILER_NAME=VS2012
-!endif
-!endif
 
 # By default, we do not want to use the debug version of the msvcrt.dll file
 #   but if MFC_DEBUG is defined in the environment it will be used.
@@ -165,60 +129,6 @@
 !endif
 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
 
-# How /GX option is spelled
-GX_OPTION = /GX
-
-# Optimization settings for various versions of the compilers and types of
-#    builds. Three basic sets of settings: product, fastdebug, and debug.
-#    These get added into CXX_FLAGS as needed by other makefiles.
-!if "$(COMPILER_NAME)" == "VC6"
-PRODUCT_OPT_OPTION   = /Ox /Os /Gy /GF
-FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
-DEBUG_OPT_OPTION     = /Od
-!endif
-
-!if "$(COMPILER_NAME)" == "VS2003"
-PRODUCT_OPT_OPTION   = /O2 /Oy-
-FASTDEBUG_OPT_OPTION = /O2 /Oy-
-DEBUG_OPT_OPTION     = /Od
-SAFESEH_FLAG = /SAFESEH
-!endif
-
-!if "$(COMPILER_NAME)" == "VS2005"
-PRODUCT_OPT_OPTION   = /O2 /Oy-
-FASTDEBUG_OPT_OPTION = /O2 /Oy-
-DEBUG_OPT_OPTION     = /Od
-GX_OPTION = /EHsc
-# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib 
-#    on the link command line, otherwise we get missing __security_check_cookie
-#    externals at link time. Even with /GS-, you need bufferoverflowU.lib.
-#    NOTE: Currently we decided to not use /GS-
-BUFFEROVERFLOWLIB = bufferoverflowU.lib
-LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
-# Manifest Tool - used in VS2005 and later to adjust manifests stored
-# as resources inside build artifacts.
-!if "x$(MT)" == "x"
-MT=mt.exe
-!endif
-SAFESEH_FLAG = /SAFESEH
-!endif
-
-!if "$(COMPILER_NAME)" == "VS2008"
-PRODUCT_OPT_OPTION   = /O2 /Oy-
-FASTDEBUG_OPT_OPTION = /O2 /Oy-
-DEBUG_OPT_OPTION     = /Od
-GX_OPTION = /EHsc
-LD_FLAGS = /manifest $(LD_FLAGS)
-MP_FLAG = /MP
-# Manifest Tool - used in VS2005 and later to adjust manifests stored
-# as resources inside build artifacts.
-!if "x$(MT)" == "x"
-MT=mt.exe
-!endif
-SAFESEH_FLAG = /SAFESEH
-!endif
-
-!if "$(COMPILER_NAME)" == "VS2010"
 PRODUCT_OPT_OPTION   = /O2 /Oy-
 FASTDEBUG_OPT_OPTION = /O2 /Oy-
 DEBUG_OPT_OPTION     = /Od
@@ -233,26 +143,6 @@
 !if "$(BUILDARCH)" == "i486"
 LD_FLAGS = /SAFESEH $(LD_FLAGS)
 !endif
-!endif
-
-!if "$(COMPILER_NAME)" == "VS2012"
-PRODUCT_OPT_OPTION   = /O2 /Oy-
-FASTDEBUG_OPT_OPTION = /O2 /Oy-
-DEBUG_OPT_OPTION     = /Od
-GX_OPTION = /EHsc
-LD_FLAGS = /manifest $(LD_FLAGS)
-MP_FLAG = /MP
-# Manifest Tool - used in VS2005 and later to adjust manifests stored
-# as resources inside build artifacts.
-!if "x$(MT)" == "x"
-MT=mt.exe
-!endif
-SAFESEH_FLAG = /SAFESEH
-!endif
-
-!if "$(BUILDARCH)" == "i486"
-LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS)
-!endif
 
 CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)
 
diff --git a/make/windows/makefiles/sa.make b/make/windows/makefiles/sa.make
index 84a34a7..5242b33 100644
--- a/make/windows/makefiles/sa.make
+++ b/make/windows/makefiles/sa.make
@@ -38,24 +38,6 @@
 
 GENERATED = ../generated
 
-HS_COMMON_SRC_REL = src
-
-!if "$(OPENJDK)" != "true"
-HS_ALT_SRC_REL=src/closed
-HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)
-!ifndef HS_ALT_MAKE
-!if exist($(WorkSpace)/make/closed)
-HS_ALT_MAKE=$(WorkSpace)/make/closed
-!endif
-!endif
-!endif
-
-HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)
-
-!ifdef HS_ALT_MAKE
-!include $(HS_ALT_MAKE)/windows/makefiles/sa.make
-!endif
-
 # tools.jar is needed by the JDI - SA binding
 SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
 
@@ -103,16 +85,11 @@
 # will be useful to have the assertion checks in place
 
 !if "$(BUILDARCH)" == "ia64"
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
 !elseif "$(BUILDARCH)" == "amd64"
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
-!if "$(COMPILER_NAME)" == "VS2005"
-# On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line, 
-# otherwise we get missing __security_check_cookie externals at link time. 
-SA_LD_FLAGS = bufferoverflowU.lib
-!endif
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
 !else
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
 SA_CFLAGS = $(SA_CFLAGS) -ZI
 !endif
@@ -129,7 +106,7 @@
 SA_LFLAGS = $(SA_LFLAGS) -map -debug
 !endif
 !if "$(BUILDARCH)" == "i486"
-SA_LFLAGS = /SAFESEH $(SA_LFLAGS)
+SA_LFLAGS = $(SAFESEH_FLAG) $(SA_LFLAGS)
 !endif
 
 SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG)
diff --git a/make/windows/makefiles/vm.make b/make/windows/makefiles/vm.make
index 229be68..f082846 100644
--- a/make/windows/makefiles/vm.make
+++ b/make/windows/makefiles/vm.make
@@ -56,6 +56,10 @@
 
 # The following variables are defined in the generated local.make file.
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_RELEASE_VERSION=\"$(HS_BUILD_VER)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_MICRO_VERSION=\"$(JDK_MICRO_VERSION)\""
+CXX_FLAGS=$(CXX_FLAGS) /D "JDK_BUILD_NUMBER=\"$(JDK_BUILD_NUMBER)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "JRE_RELEASE_VERSION=\"$(JRE_RELEASE_VER)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(HOTSPOT_LIB_ARCH)\""
 CXX_FLAGS=$(CXX_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
@@ -128,7 +132,7 @@
 
 !if "$(USE_PRECOMPILED_HEADER)" != "0"
 CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
-!if "$(COMPILER_NAME)" == "VS2012"
+!if "$(MSC_VER)" > "1600"
 # VS2012 requires this object file to be listed:
 LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj
 !endif