make/common/shared/Compiler-msvc.gmk

Wed, 11 Mar 2009 17:31:56 -0700

author
ohair
date
Wed, 11 Mar 2009 17:31:56 -0700
changeset 57
9c0cc0d0eca2
parent 49
e2f388853a9d
child 114
1c130e7b7a2e
permissions
-rw-r--r--

6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
Reviewed-by: tbell

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

mercurial