make/common/shared/Compiler-msvc.gmk

Thu, 17 Jun 2010 16:27:56 -0700

author
mikejwre
date
Thu, 17 Jun 2010 16:27:56 -0700
changeset 171
95db968660e7
parent 158
91006f157c46
permissions
-rw-r--r--

Added tag jdk7-b98 for changeset 3b99409057e4

duke@1 1 #
ohair@158 2 # Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
duke@1 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 #
duke@1 5 # This code is free software; you can redistribute it and/or modify it
duke@1 6 # under the terms of the GNU General Public License version 2 only, as
ohair@158 7 # published by the Free Software Foundation. Oracle designates this
duke@1 8 # particular file as subject to the "Classpath" exception as provided
ohair@158 9 # by Oracle in the LICENSE file that accompanied this code.
duke@1 10 #
duke@1 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 # accompanied this code).
duke@1 16 #
duke@1 17 # You should have received a copy of the GNU General Public License version
duke@1 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 #
ohair@158 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@158 22 # or visit www.oracle.com if you need additional information or have any
ohair@158 23 # questions.
duke@1 24 #
duke@1 25
duke@1 26 #
duke@1 27 # MSVC Compiler settings
duke@1 28 #
duke@1 29
duke@1 30 ifeq ($(PLATFORM), windows)
duke@1 31 CC = $(COMPILER_PATH)cl
duke@1 32 CPP = $(COMPILER_PATH)cl
duke@1 33 CXX = $(COMPILER_PATH)cl
duke@1 34 CCC = $(COMPILER_PATH)cl
duke@1 35 LIBEXE = $(COMPILER_PATH)lib
duke@1 36 LINK = $(COMPILER_PATH)link
duke@1 37 RC = $(MSDEVTOOLS_PATH)rc
duke@1 38 LINK32 = $(LINK)
duke@1 39 RSC = $(RC)
duke@1 40
duke@1 41 # Fill in unknown values
duke@1 42 COMPILER_NAME=Unknown MSVC Compiler
duke@1 43 COMPILER_VERSION=
duke@1 44 REQUIRED_CC_VER=
duke@1 45 REQUIRED_LINK_VER=
duke@1 46
duke@1 47 # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
duke@1 48 NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
duke@1 49
tbell@33 50 # Compiler version and type (Always get word after "Version")
ohair@114 51 ifndef CC_VER
ohair@114 52 CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
ohair@114 53 export CC_VER
ohair@114 54 endif
ohair@114 55
duke@1 56 # SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure...
duke@1 57 ifeq ($(ARCH_DATA_MODEL), 32)
ohair@114 58 ifndef LINK_VER
ohair@114 59 LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
ohair@114 60 export LINK_VER
ohair@114 61 endif
duke@1 62 CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
duke@1 63 ifeq ($(CC_MAJORVER), 13)
duke@1 64 # This should be: CC_VER=13.10.3077 LINK_VER=7.10.3077
tbell@33 65 REQUIRED_CC_VER = 13.10.3077
tbell@33 66 REQUIRED_LINK_VER = 7.10.3077
duke@1 67 COMPILER_NAME=Visual Studio .NET 2003 Professional C++
duke@1 68 COMPILER_VERSION=VS2003
duke@1 69 REBASE = $(COMPILER_PATH)../../Common7/Tools/Bin/rebase
duke@1 70 MTL = $(COMPILER_PATH)../../Common7/Tools/Bin/midl
duke@1 71 ifndef COMPILER_PATH
duke@1 72 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
duke@1 73 endif
duke@1 74 endif
duke@1 75 ifeq ($(CC_MAJORVER), 14)
tbell@33 76 # This should be: CC_VER=14.00.50727.42 LINK_VER=8.00.50727.42
tbell@33 77 REQUIRED_CC_VER = 14.00.50727.42
tbell@33 78 REQUIRED_LINK_VER = 8.00.50727.42
tbell@33 79 COMPILER_NAME=Visual Studio 8
duke@1 80 COMPILER_VERSION=VS2005
duke@1 81 REBASE = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase
duke@1 82 MTL = $(COMPILER_PATH)../../Common8/Tools/Bin/midl
duke@1 83 ifndef COMPILER_PATH
duke@1 84 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
duke@1 85 endif
duke@1 86 endif
tbell@33 87 ifeq ($(CC_MAJORVER), 15)
tbell@33 88 # This should be: CC_VER=15.00.21022.08 LINK_VER=9.00.21022.08
tbell@33 89 REQUIRED_CC_VER = 15.00.21022.08
tbell@33 90 REQUIRED_LINK_VER = 9.00.21022.08
tbell@33 91 COMPILER_NAME=Visual Studio 9
tbell@33 92 COMPILER_VERSION=VS2008
tbell@33 93 #rebase and midl moved out of Visual Studio into the SDK:
tbell@33 94 REBASE = $(MSDEVTOOLS_PATH)/rebase
tbell@33 95 MTL = $(MSDEVTOOLS_PATH)/midl.exe
tbell@33 96 ifndef COMPILER_PATH
tbell@33 97 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
tbell@33 98 endif
tbell@33 99 endif
prr@150 100 ifeq ($(CC_MAJORVER), 16)
prr@150 101 # This should be: CC_VER=16.00.30319.01 LINK_VER=10.00.30319.01
prr@150 102 REQUIRED_CC_VER = 16.00.30319.01
prr@150 103 REQUIRED_LINK_VER = 10.00.30319.01
prr@150 104 COMPILER_NAME=Visual Studio 10
prr@150 105 COMPILER_VERSION=VS2010
prr@150 106 #rebase and midl moved out of Visual Studio into the SDK:
prr@150 107 REBASE = $(MSDEVTOOLS_PATH)/rebase
prr@150 108 MTL = $(MSDEVTOOLS_PATH)/midl.exe
prr@150 109 ifndef COMPILER_PATH
prr@150 110 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
prr@150 111 endif
prr@150 112 endif
duke@1 113 else
tbell@33 114 # else ARCH_DATA_MODEL is 64
ohair@114 115 ifndef LINK_VER
ohair@114 116 LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
ohair@114 117 export LINK_VER
ohair@114 118 endif
duke@1 119 CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
duke@1 120 CC_MINORVER :=$(call MinorVersion,$(CC_VER))
duke@1 121 CC_MICROVER :=$(call MicroVersion,$(CC_VER))
duke@1 122 ifeq ($(ARCH), ia64)
duke@1 123 REQUIRED_CC_VER = 13.00.9337.7
duke@1 124 REQUIRED_LINK_VER = 7.00.9337.7
duke@1 125 endif
duke@1 126 ifeq ($(ARCH), amd64)
duke@1 127 REQUIRED_CC_VER = 14.00.40310.41
duke@1 128 REQUIRED_LINK_VER = 8.00.40310.39
duke@1 129 endif
duke@1 130 ifeq ($(CC_MAJORVER), 13)
duke@1 131 ifeq ($(ARCH), ia64)
duke@1 132 # This should be: CC_VER=13.00.9337.7 LINK_VER=7.00.9337.7
duke@1 133 COMPILER_NAME=Microsoft Platform SDK - November 2001 Edition
duke@1 134 COMPILER_VERSION=VS2003
duke@1 135 endif
duke@1 136 endif
duke@1 137 ifeq ($(CC_MAJORVER), 14)
duke@1 138 ifeq ($(ARCH), amd64)
duke@1 139 ifeq ($(CC_MICROVER), 30701)
duke@1 140 # This should be: CC_VER=14.00.30701 LINK_VER=8.00.30701
duke@1 141 # WARNING: it says 14, but it is such an early build it doesn't
duke@1 142 # have all the VS2005 compiler option changes, so treat
duke@1 143 # this like a VS2003 compiler.
duke@1 144 COMPILER_NAME=Microsoft Platform SDK - February 2003 Edition
duke@1 145 COMPILER_VERSION=VS2003
duke@1 146 else
duke@1 147 # This should be: CC_VER=14.00.40310.41 LINK_VER=8.00.40310.39
duke@1 148 COMPILER_NAME=Microsoft Platform SDK - April 2005 Edition (3790.1830)
duke@1 149 COMPILER_VERSION=VS2005
duke@1 150 endif
duke@1 151 endif
duke@1 152 endif
ohair@57 153 ifeq ($(CC_MAJORVER), 15)
ohair@57 154 # This should be: CC_VER=15.00.21022.8 LINK_VER=9.00.21022.8
ohair@57 155 REQUIRED_CC_VER = 15.00.21022.8
ohair@57 156 REQUIRED_LINK_VER = 9.00.21022.8
ohair@57 157 COMPILER_NAME=Windows SDK 6.1 Visual Studio 9
ohair@57 158 COMPILER_VERSION=VS2008
ohair@57 159 RC = $(MSSDK61)/bin/x64/rc
prr@150 160 REBASE = $(MSSDK61)/bin/x64/rebase
ohair@57 161 else
prr@150 162 ifeq ($(CC_MAJORVER), 16)
prr@150 163 # This should be: CC_VER=16.00.30319.01 LINK_VER=9.00.30319.01
prr@150 164 REQUIRED_CC_VER = 16.00.30319.01
prr@150 165 REQUIRED_LINK_VER = 10.00.30319.01
prr@150 166 COMPILER_NAME=Microsoft Visual Studio 10
prr@150 167 COMPILER_VERSION=VS2010
prr@150 168 RC = $(MSSDK7)/bin/x64/rc
prr@150 169 REBASE = $(MSSDK7)/bin/x64/rebase
prr@150 170 else
prr@150 171 # This will cause problems if ALT_COMPILER_PATH is defined to ""
prr@150 172 # which is a directive to use the PATH.
prr@150 173 REBASE = $(COMPILER_PATH)../REBASE
prr@150 174 endif
ohair@57 175 endif
duke@1 176 ifndef COMPILER_PATH
duke@1 177 COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
duke@1 178 endif
duke@1 179 endif
duke@1 180 ifndef COMPILER_VERSION
duke@1 181 COMPILER_VERSION := $(error COMPILER_VERSION cannot be empty here)
duke@1 182 endif
duke@1 183 # Shared library generation flag
duke@1 184 SHARED_LIBRARY_FLAG = -LD
duke@1 185 endif
duke@1 186

mercurial