jdk/make/common/shared/Compiler-msvc.gmk
author herrick
Mon, 15 Jun 2009 13:08:29 -0400
changeset 3112 541955f1e5fa
parent 3111 fefdeafb7ab9
child 5381 d6d64a42ff51
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 308
diff changeset
     2
# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# MSVC Compiler settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
  CC           = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
  CPP          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
  CXX          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
  CCC          = $(COMPILER_PATH)cl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
  LIBEXE       = $(COMPILER_PATH)lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  LINK         = $(COMPILER_PATH)link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  RC           = $(MSDEVTOOLS_PATH)rc
3111
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
    38
  RSC          = $(MSDEVTOOLS_PATH)rc
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  LINK32       = $(LINK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
  # Fill in unknown values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
  COMPILER_NAME=Unknown MSVC Compiler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  COMPILER_VERSION=
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  NMAKE          = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
308
33a1639d64a5 6482134: JDK 6 build error on Windows, Visual Studio .NET on Japanese locale
ohair
parents: 2
diff changeset
    48
  # Compiler version and type (Always get word after "Version")
33a1639d64a5 6482134: JDK 6 build error on Windows, Visual Studio .NET on Japanese locale
ohair
parents: 2
diff changeset
    49
  CC_VER  := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
33a1639d64a5 6482134: JDK 6 build error on Windows, Visual Studio .NET on Japanese locale
ohair
parents: 2
diff changeset
    50
  
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  # SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure...
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
  ifeq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    ifeq ($(CC_MAJORVER), 13)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
      # This should be: CC_VER=13.10.3077 LINK_VER=7.10.3077
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
      COMPILER_NAME=Visual Studio .NET 2003 Professional C++
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
      COMPILER_VERSION=VS2003
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
      REBASE     = $(COMPILER_PATH)../../Common7/Tools/Bin/rebase
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
      MTL        = $(COMPILER_PATH)../../Common7/Tools/Bin/midl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
      ifndef COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
	COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
      endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    ifeq ($(CC_MAJORVER), 14)
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    66
      COMPILER_NAME=Visual Studio 8
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
      COMPILER_VERSION=VS2005
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
      REBASE     = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
      MTL        = $(COMPILER_PATH)../../Common8/Tools/Bin/midl
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    70
      MT         = $(MSDEVTOOLS_PATH)mt
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    71
      ifndef COMPILER_PATH
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    72
	COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    73
      endif
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    74
    endif
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    75
    ifeq ($(CC_MAJORVER), 15)
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    76
      COMPILER_NAME=Visual Studio 9
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    77
      COMPILER_VERSION=VS2008
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    78
      #rebase and midl moved out of Visual Studio into the SDK:
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    79
      REBASE     = $(MSDEVTOOLS_PATH)/rebase
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    80
      MTL        = $(MSDEVTOOLS_PATH)/midl.exe
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    81
      MT         = $(MSDEVTOOLS_PATH)mt
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
      ifndef COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
	COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
      endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
  else
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 715
diff changeset
    87
    # else ARCH_DATA_MODEL is 64
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    CC_MINORVER :=$(call MinorVersion,$(CC_VER))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    CC_MICROVER :=$(call MicroVersion,$(CC_VER))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    ifeq ($(CC_MAJORVER), 13)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
      ifeq ($(ARCH), ia64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        # This should be: CC_VER=13.00.9337.7 LINK_VER=7.00.9337.7
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        COMPILER_NAME=Microsoft Platform SDK - November 2001 Edition
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        COMPILER_VERSION=VS2003
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
      endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    ifeq ($(CC_MAJORVER), 14)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
      ifeq ($(ARCH), amd64)
3111
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
   101
        #rebase and midl moved out of Visual Studio into the SDK:
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
   102
        REBASE     = $(MSDEVTOOLS_PATH)/rebase
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
   103
        MTL        = $(MSDEVTOOLS_PATH)/midl.exe
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        ifeq ($(CC_MICROVER), 30701)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
          # This should be: CC_VER=14.00.30701 LINK_VER=8.00.30701
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
	  # WARNING: it says 14, but it is such an early build it doesn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
	  #          have all the VS2005 compiler option changes, so treat
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	  #          this like a VS2003 compiler.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
          COMPILER_NAME=Microsoft Platform SDK - February 2003 Edition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
          COMPILER_VERSION=VS2003
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
          # This should be: CC_VER=14.00.40310.41 LINK_VER=8.00.40310.39
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
	  COMPILER_NAME=Microsoft Platform SDK - April 2005 Edition (3790.1830)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
          COMPILER_VERSION=VS2005
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        endif
3111
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
   116
      else
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 2186
diff changeset
   117
        REBASE         = $(COMPILER_PATH)../rebase
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
      endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    endif
2186
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   120
    ifeq ($(CC_MAJORVER), 15)
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   121
      COMPILER_NAME=Microsoft Windows SDK with Visual Studio 9 (6001.18000.367)
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   122
      COMPILER_VERSION=VS2008
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   123
      RC = $(MSSDK61)/Bin/X64/rc.exe
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   124
      MT = $(MSSDK61)/Bin/X64/mt.exe
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
   125
    endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    # This will cause problems if ALT_COMPILER_PATH is defined to ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    # which is a directive to use the PATH.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    ifndef COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  ifndef COMPILER_VERSION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    COMPILER_VERSION := $(error COMPILER_VERSION cannot be empty here)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  # Shared library generation flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  SHARED_LIBRARY_FLAG = -LD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138