Wed, 15 Oct 2008 21:24:26 -0700
6759959: VS2008 errors compiling corba sources
Summary: Update Makefiles to deal with newer Visual Studio releases
Reviewed-by: ohair
make/common/Defs-windows.gmk | file | annotate | diff | comparison | revisions | |
make/common/shared/Compiler-msvc.gmk | file | annotate | diff | comparison | revisions |
1.1 --- a/make/common/Defs-windows.gmk Thu Oct 02 19:58:15 2008 -0700 1.2 +++ b/make/common/Defs-windows.gmk Wed Oct 15 21:24:26 2008 -0700 1.3 @@ -58,11 +58,24 @@ 1.4 1.5 # The following DLL's are considered MS runtime libraries and should 1.6 # not to be REBASEd, see deploy/make/common/Release.gmk. 1.7 -# msvcrt.dll, msvcr71.dll: Microsoft runtimes 1.8 +# msvcrt.dll, msvcrnn.dll [msvcr71 or msvcr80 or msvcr90] : Microsoft runtimes 1.9 MS_RUNTIME_LIBRARIES = msvcrt.dll 1.10 +MSVCRNN_DLL = 1.11 ifeq ($(ARCH_DATA_MODEL), 32) 1.12 ifeq ($(COMPILER_VERSION), VS2003) 1.13 - MS_RUNTIME_LIBRARIES += msvcr71.dll 1.14 + MSVCRNN_DLL = msvcr71.dll 1.15 + MSVCPNN_DLL = msvcp71.dll 1.16 + MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL) 1.17 + endif 1.18 + ifeq ($(COMPILER_VERSION), VS2005) 1.19 + MSVCRNN_DLL = msvcr80.dll 1.20 + MSVCPNN_DLL = msvcp80.dll 1.21 + MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL) 1.22 + endif 1.23 + ifeq ($(COMPILER_VERSION), VS2008) 1.24 + MSVCRNN_DLL = msvcr90.dll 1.25 + MSVCPNN_DLL = msvcp90.dll 1.26 + MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL) 1.27 endif 1.28 endif 1.29 1.30 @@ -148,6 +161,20 @@ 1.31 CC_LOWER_OPT = -O1 1.32 endif 1.33 endif 1.34 + ifeq ($(COMPILER_VERSION), VS2008) 1.35 + # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) 1.36 + AUTOMATIC_PCH_OPTION = 1.37 + GX_OPTION = -EHsc 1.38 + ifeq ($(ARCH_DATA_MODEL), 32) 1.39 + CC_HIGHEST_OPT = -O2 1.40 + CC_HIGHER_OPT = -O1 1.41 + CC_LOWER_OPT = -O1 1.42 + else 1.43 + CC_HIGHEST_OPT = -O2 1.44 + CC_HIGHER_OPT = -O1 1.45 + CC_LOWER_OPT = -O1 1.46 + endif 1.47 + endif 1.48 CC_NO_OPT = -Od 1.49 else # CC_VERSION 1.50 # GCC not supported, but left for historical reference... 1.51 @@ -179,7 +206,7 @@ 1.52 # -MTd Use static debug version (better than -MDd, no runtime issues) 1.53 # -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd) 1.54 # 1.55 -# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcp71.dll 1.56 +# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll 1.57 # 1.58 ifeq ($(MS_RUNTIME_STATIC),true) 1.59 MS_RUNTIME_OPTION=-MT 1.60 @@ -217,7 +244,7 @@ 1.61 # -YX -Fp/.../foobar.pch Use precompiled headers (try someday?) 1.62 # -nologo Don't print out startup message 1.63 # /D _STATIC_CPPLIB 1.64 - # Use static link for the C++ runtime (so msvcp71.dll not needed) 1.65 + # Use static link for the C++ runtime (so msvcpnn.dll not needed) 1.66 # 1.67 CFLAGS_COMMON += -Zi -nologo 1.68 CFLAGS_OPT = $(POPT)
2.1 --- a/make/common/shared/Compiler-msvc.gmk Thu Oct 02 19:58:15 2008 -0700 2.2 +++ b/make/common/shared/Compiler-msvc.gmk Wed Oct 15 21:24:26 2008 -0700 2.3 @@ -47,24 +47,17 @@ 2.4 # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake 2.5 NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo 2.6 2.7 + # Compiler version and type (Always get word after "Version") 2.8 + CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}') 2.9 + 2.10 # SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure... 2.11 ifeq ($(ARCH_DATA_MODEL), 32) 2.12 - CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$8}') 2.13 LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}') 2.14 - CC_TYPE := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$5}') 2.15 CC_MAJORVER :=$(call MajorVersion,$(CC_VER)) 2.16 - REQUIRED_CCTYPE = Optimizing 2.17 - REQUIRED_CC_VER = 13.10.3077 2.18 - REQUIRED_LINK_VER = 7.10.3077 2.19 - ifeq ($(CC_MAJORVER), 12) 2.20 - # This should be: CC_VER=12.00.8168 LINK_VER=6.00.8447 2.21 - COMPILER_NAME=Visual C++ 6.0 Professional + VC6-SP 3 2.22 - COMPILER_VERSION=VC6 2.23 - REBASE = $(COMPILER_PATH)rebase 2.24 - MTL = $(COMPILER_PATH)midl 2.25 - endif 2.26 ifeq ($(CC_MAJORVER), 13) 2.27 # This should be: CC_VER=13.10.3077 LINK_VER=7.10.3077 2.28 + REQUIRED_CC_VER = 13.10.3077 2.29 + REQUIRED_LINK_VER = 7.10.3077 2.30 COMPILER_NAME=Visual Studio .NET 2003 Professional C++ 2.31 COMPILER_VERSION=VS2003 2.32 REBASE = $(COMPILER_PATH)../../Common7/Tools/Bin/rebase 2.33 @@ -74,9 +67,10 @@ 2.34 endif 2.35 endif 2.36 ifeq ($(CC_MAJORVER), 14) 2.37 - # This should be: CC_VER=14.00.0000 LINK_VER=8.00.0000 2.38 - # NOTE: This compiler has not been tried yet on 32bit systems 2.39 - COMPILER_NAME=Visual Studio .NET 2005 2.40 + # This should be: CC_VER=14.00.50727.42 LINK_VER=8.00.50727.42 2.41 + REQUIRED_CC_VER = 14.00.50727.42 2.42 + REQUIRED_LINK_VER = 8.00.50727.42 2.43 + COMPILER_NAME=Visual Studio 8 2.44 COMPILER_VERSION=VS2005 2.45 REBASE = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase 2.46 MTL = $(COMPILER_PATH)../../Common8/Tools/Bin/midl 2.47 @@ -84,10 +78,22 @@ 2.48 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here) 2.49 endif 2.50 endif 2.51 + ifeq ($(CC_MAJORVER), 15) 2.52 + # This should be: CC_VER=15.00.21022.08 LINK_VER=9.00.21022.08 2.53 + REQUIRED_CC_VER = 15.00.21022.08 2.54 + REQUIRED_LINK_VER = 9.00.21022.08 2.55 + COMPILER_NAME=Visual Studio 9 2.56 + COMPILER_VERSION=VS2008 2.57 + #rebase and midl moved out of Visual Studio into the SDK: 2.58 + REBASE = $(MSDEVTOOLS_PATH)/rebase 2.59 + MTL = $(MSDEVTOOLS_PATH)/midl.exe 2.60 + ifndef COMPILER_PATH 2.61 + COMPILER_PATH := $(error COMPILER_PATH cannot be empty here) 2.62 + endif 2.63 + endif 2.64 else 2.65 - CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$7}') 2.66 + # else ARCH_DATA_MODEL is 64 2.67 LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}') 2.68 - CC_TYPE := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$4}') 2.69 CC_MAJORVER :=$(call MajorVersion,$(CC_VER)) 2.70 CC_MINORVER :=$(call MinorVersion,$(CC_VER)) 2.71 CC_MICROVER :=$(call MicroVersion,$(CC_VER))