make/common/shared/Platform.gmk

Tue, 11 May 2010 14:35:21 -0700

author
prr
date
Tue, 11 May 2010 14:35:21 -0700
changeset 150
ee2d8f1bef5b
parent 129
28b983e5bb5f
child 158
91006f157c46
permissions
-rw-r--r--

6931180: Migration to recent versions of MS Platform SDK
Summary: Changes to enable building JDK7 with Microsoft Visual Studio 2010
Reviewed-by: ohair, art, ccheung, dcubed

     1 #
     2 # Copyright 1997-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 # Shared platform (OS/ARCH) variable settings for the JDK builds.
    28 #
    29 # Includes basic system requirements, versions of utilities required,
    30 #   suffixes on files, and basic defaults attributed to the build platform.
    31 #
    33 #
    34 # Assumes some basic unix system utilities (e.g. uname) are in the search path
    35 #   in order to figure out the system.
    36 #
    38 ifndef PLATFORM_SHARED
    40 PLATFORM_SHARED=done
    42 # Possible Input variables:
    43 #     ARCH_DATA_MODEL             32 or 64, default to 32
    44 #     USER, LOGNAME               user name (runs logname, or id if not set)
    45 #     PROCESSOR_IDENTIFIER        windows only: needed in environment
    46 #
    47 # (Also gets input by running the utilities uname, logname, isainfo, or id.)
    48 #
    49 # Variables set by this file:
    50 #     SYSTEM_UNAME                what 'uname' says this system is
    51 #     USER                        login name of user (minus blanks)
    52 #     PLATFORM                    windows, solaris, or linux
    53 #     VARIANT                     OPT or DBG, OPT is the default
    54 #     OS_NAME                     solaris, linux, or nt
    55 #     OS_VERSION                  specific version of os, 5.10, 2.4.9-e.3, etc.
    56 #     OS_VENDOR                   company name
    57 #     TEMP_DISK                   /tmp or C:/temp
    58 #     ARCH_DATA_MODEL             32 or 64
    59 #     ARCH                        sparc, sparcv9, i586, amd64, or ia64
    60 #     ARCH_FAMILY                 sparc or i586
    61 #     ARCHPROP                    sparc or x86
    62 #     ARCH_VM_SUBDIR              jre/bin, jre/lib/sparc, etc.
    63 #     LIBARCH                     sparc, sparcv9, i386, amd64, or ia64
    64 #     DEV_NULL                    destination of /dev/null, NUL or /dev/NULL
    65 #     CLASSPATH_SEPARATOR         separator in classpath, ; or :
    66 #     LIB_PREFIX                  dynamic or static library prefix, lib or empty
    67 #     LIB_SUFFIX                  static library file suffix, .lib or .a?
    68 #     LIBRARY_SUFFIX              dynamic library file suffix, .dll or .so
    69 #     OBJECT_SUFFIX               object file suffix, .o or .obj
    70 #     EXE_SUFFIX                  executable file suffix, .exe or empty
    71 #     BUNDLE_FILE_SUFFIX          suffix for bundles: .tar or .tar.gz
    72 #     ISA_DIR                     solaris only: /sparcv9 or /amd64
    73 #     LIBARCH32                   solaris only: sparc or i386
    74 #     LIBARCH64                   solaris only: sparcv9 or amd64
    75 #     REQUIRED_WINDOWS_NAME       windows only: basic name of windows 
    76 #     REQUIRED_WINDOWS_VERSION    windows only: specific version of windows 
    77 #     USING_CYGWIN                windows only: true or false
    78 #     WINDOWS_NT_VERSION_STRING   windows only: long version name
    79 #     REQUIRED_OS_VERSION         required OS version, e.g. 5.10, 2.4
    80 #     REQUIRED_FREE_SPACE         minimum disk space needed for outputdir
    81 #     REQUIRED_ZIP_VER            required version of zip
    82 #     REQUIRED_UNZIP_VER          required version of unzip
    83 #     LINUX_VERSION_INFO          linux only: location of linux release file
    84 #     REQUIRED_LINUX_VER          linux only: required version of linux
    85 #     REQUIRED_LINUX_FULLVER      linux only: required full version of linux
    87 ifndef SYSTEM_UNAME
    88   SYSTEM_UNAME := $(shell uname)
    89   export SYSTEM_UNAME
    90 endif
    92 # Normal boot jdk is previous release, but a hard requirement is a 1.5 boot
    93 REQUIRED_BOOT_VER = 1.5
    95 # Don't define this unless it's not defined
    96 ifndef VARIANT
    97   VARIANT=OPT
    98 endif
   100 # Platform settings specific to Solaris
   101 ifeq ($(SYSTEM_UNAME), SunOS)
   102   PLATFORM = solaris
   103   OS_NAME = solaris
   104   OS_VERSION := $(shell uname -r)
   105   # Solaris sparc build can be either 32-bit or 64-bit.
   106   #   Default to 32, but allow explicit setting to 32 or 64.
   107   ifndef ARCH_DATA_MODEL
   108     ARCH_DATA_MODEL=32
   109   endif
   110   ifeq ($(ARCH_DATA_MODEL), 32)
   111     processor := $(shell uname -p)
   112     archExpr = case "$(processor)" in  \
   113                 i[3-9]86) \
   114                     echo i586 \
   115                     ;; \
   116                 sparc*)  \
   117                     echo sparc \
   118                     ;; \
   119                 *) \
   120                     echo $(processor)  \
   121                     ;; \
   122         esac
   123     ARCH        := $(shell $(archExpr))
   124   else
   125     ARCH := $(shell isainfo -n)
   126     # ISA_DIR is used to locate 64-bit specific libraries which are generally
   127     # in the same general place as other libraries under the ./$(ARCH) directory
   128     ISA_DIR = /$(ARCH)
   129   endif
   130   # Need to maintain the jre/lib/i386 location for 32-bit Intel
   131   ifeq ($(ARCH), i586)
   132      ARCH_FAMILY = $(ARCH)
   133      LIBARCH     = i386
   134      # Value of Java os.arch property
   135      ARCHPROP    = x86
   136   else
   137      ifeq ($(ARCH), amd64)
   138         ARCH_FAMILY = i586
   139      else
   140         ARCH_FAMILY = sparc
   141      endif
   142      LIBARCH  = $(ARCH)
   143      # Value of Java os.arch property
   144      ARCHPROP = $(LIBARCH)
   145   endif
   146   # The two LIBARCH names
   147   ifeq ($(ARCH_FAMILY), sparc)
   148     LIBARCH32 = sparc
   149     LIBARCH64 = sparcv9
   150   else
   151     LIBARCH32 = i386
   152     LIBARCH64 = amd64
   153   endif
   154   # Suffix for file bundles used in previous release
   155   BUNDLE_FILE_SUFFIX=.tar
   156   OS_VENDOR = Sun Microsystems
   157   # Required Solaris version
   158   REQUIRED_OS_VERSION = 5.10
   159   # Minimum disk space needed as determined by running 'du -sk' on 
   160   #    a fully built workspace.
   161   ifeq ($(ARCH_FAMILY), sparc)
   162     REQUIRED_FREE_SPACE=1300000
   163   else
   164     REQUIRED_FREE_SPACE=1040000
   165   endif
   166   # How much RAM does this machine have:
   167   MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
   168 endif
   170 # Platform settings specific to Linux
   171 ifeq ($(SYSTEM_UNAME), Linux)
   172   PLATFORM = linux
   173   OS_NAME = linux
   174   OS_VERSION := $(shell uname -r)
   175   # Arch and OS name/version
   176   mach := $(shell uname -m)
   177   archExpr = case "$(mach)" in \
   178                 i[3-9]86) \
   179                     echo i586 \
   180                     ;; \
   181                 ia64) \
   182                     echo ia64 \
   183                     ;; \
   184                 x86_64) \
   185                     echo amd64 \
   186                     ;; \
   187                 sparc*) \
   188                     echo sparc \
   189                     ;; \
   190                 arm*) \
   191                     echo arm \
   192                     ;; \
   193                 *) \
   194                     echo $(mach) \
   195                     ;; \
   196       esac
   197   ARCH        := $(shell $(archExpr) )
   198   ARCH_FAMILY := $(ARCH)
   200   # Linux builds may be 32-bit or 64-bit data model.
   201   ifeq ($(ARCH), sparc)
   202     # Linux sparc build can be either 32-bit or 64-bit.
   203     #   Default to 32, but allow explicit setting to 32 or 64.
   204     ifndef ARCH_DATA_MODEL
   205       ARCH_DATA_MODEL=32
   206     endif
   207     ifeq ($(ARCH_DATA_MODEL), 32)
   208       ARCH=sparc
   209     else
   210       ARCH=sparcv9
   211     endif
   212   else
   213     # i586 is 32-bit, amd64 is 64-bit
   214     ifndef ARCH_DATA_MODEL
   215       ifeq ($(ARCH), i586)
   216         ARCH_DATA_MODEL=32
   217       else
   218         ARCH_DATA_MODEL=64
   219       endif
   220     endif
   221   endif
   223   # Need to maintain the jre/lib/i386 location for 32-bit Intel
   224   ifeq ($(ARCH), i586)
   225     LIBARCH = i386
   226   else
   227     LIBARCH = $(ARCH)
   228   endif
   230   # Value of Java os.arch property
   231   ARCHPROP  = $(LIBARCH)
   233   # Suffix for file bundles used in previous release
   234   BUNDLE_FILE_SUFFIX=.tar.gz
   235   # Minimum disk space needed as determined by running 'du -sk' on 
   236   #    a fully built workspace.
   237   REQUIRED_FREE_SPACE=1460000
   238   LINUX_VERSION_INFO = /etc/redhat-release
   239   OS_VENDOR = Red Hat
   240   ifeq ($(ARCH_DATA_MODEL), 32)
   241     REQUIRED_LINUX_VER = Advanced Server
   242     REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS
   243     REQUIRED_OS_VERSION = 2.4.9-e.3
   244   else
   245     ifeq ($(ARCH), amd64)
   246       LINUX_VERSION_INFO = /etc/SuSE-release
   247       OS_VENDOR = SuSE Enterprise
   248       REQUIRED_LINUX_VER = 8.1
   249       REQUIRED_LINUX_FULLVER = $(REQUIRED_LINUX_VER) SLSE AMD64
   250       REQUIRED_OS_VERSION = 2.4.19-SMP
   251     else
   252       REQUIRED_LINUX_VER = Advanced Server
   253       REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS 64 bit
   254       REQUIRED_OS_VERSION = 2.4.19-SMP
   255     endif
   256   endif
   257   # How much RAM does this machine have:
   258   MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
   259 endif
   261 # Windows with and without CYGWIN will be slightly different
   262 ifeq ($(SYSTEM_UNAME), Windows_NT)
   263   PLATFORM = windows
   264   OS_VERSION := $(shell uname -r)
   265   WINDOWS_NT_VERSION_STRING=Windows_NT
   266   REQUIRED_MKS_VER=6.1
   267 endif
   268 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
   269   PLATFORM = windows
   270   OS_VERSION := 5
   271   USING_CYGWIN = true
   272   export USING_CYGWIN
   273   WINDOWS_NT_VERSION_STRING=CYGWIN_NT
   274   REQUIRED_CYGWIN_VER=4.0
   275 endif
   277 # Platform settings specific to Windows
   278 ifeq ($(PLATFORM), windows)
   279   OS_NAME = nt
   280   REQUIRED_OS_VERSION=5
   281   # Windows builds default to the appropriate for the underlaying
   282   # architecture.
   283   # Temporary disk area
   284   TEMP_DISK=C:/temp
   285   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
   286   # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
   287   PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
   288   PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
   289   PROC_ARCH:=$(subst x64,X64,$(PROC_ARCH))
   290   PROC_ARCH:=$(subst intel64,X64,$(PROC_ARCH))
   291   PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
   292   PROC_ARCH:=$(subst INTEL64,X64,$(PROC_ARCH))
   293   PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
   294   PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
   295   PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
   296   PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
   297   PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
   298   ifndef ARCH_DATA_MODEL
   299     ifeq ($(PROC_ARCH),IA64)
   300       ARCH_DATA_MODEL=64
   301     else
   302       ifeq ($(PROC_ARCH),X64)
   303         ARCH_DATA_MODEL=64
   304       else
   305         ARCH_DATA_MODEL=32
   306       endif
   307     endif
   308   endif
   309   export ARCH_DATA_MODEL
   310   # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel
   311   ARCH=i586
   312   LIBARCH=i386
   313   # Value of Java os.arch property
   314   ARCHPROP=x86
   315   REQUIRED_WINDOWS_NAME=Windows Professional 2000
   316   REQUIRED_WINDOWS_VERSION=5 0 Service Pack 4
   317   ifeq ($(ARCH_DATA_MODEL), 64)
   318     # If the user wants to perform a cross compile build then they must
   319     # - set ARCH_DATA_MODEL=64 and either
   320     #      + set ARCH to ia64 or amd64, or
   321     REQUIRED_WINDOWS_NAME=Windows Server 2003
   322     REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1
   323     ifeq ($(PROC_ARCH),X64)
   324       ARCH=amd64
   325     else
   326       ifeq ($(PROC_ARCH),IA64)
   327         ARCH=ia64
   328       endif
   329     endif
   330     LIBARCH=$(ARCH)
   331     # Value of Java os.arch property
   332     ARCHPROP=$(LIBARCH)
   333   endif
   334   ARCH_FAMILY = $(ARCH)
   335   # Where is unwanted output to be delivered?
   336   ifeq ($(USING_CYGWIN),true)
   337     DEV_NULL = /dev/null
   338   else
   339     DEV_NULL = NUL
   340   endif
   341   export DEV_NULL
   342   # Classpath separator
   343   CLASSPATH_SEPARATOR = ;
   344   # The suffix used for object file (.o for unix .obj for windows)
   345   OBJECT_SUFFIX = obj
   346   # The suffix applied to executables (.exe for windows, nothing for solaris)
   347   EXE_SUFFIX = .exe
   348   # The prefix applied to library files (lib for solaris, nothing for windows)
   349   LIB_PREFIX=
   350   LIBRARY_SUFFIX = dll
   351   LIB_SUFFIX     = lib
   352   # User name determination (set _USER)
   353   ifndef USER
   354     ifdef USERNAME
   355       _USER := $(USERNAME)
   356     else
   357       ifdef LOGNAME
   358         _USER := $(LOGNAME)
   359       else
   360         _USER := $(shell id -un)
   361       endif
   362     endif
   363   else
   364     _USER:=$(USER)
   365   endif
   366   # Location of client/server directories
   367   ARCH_VM_SUBDIR=jre/bin
   368   # Suffix for file bundles used in previous release
   369   BUNDLE_FILE_SUFFIX=.tar
   370   # Minimum disk space needed as determined by running 'du -sk' on 
   371   #    a fully built workspace.
   372   REQUIRED_FREE_SPACE=500000
   373   OS_VENDOR = Microsoft
   374   # How much RAM does this machine have:
   375   ifndef MB_OF_MEMORY
   376     MB_OF_MEMORY := $(shell \
   377       if [ -f "C:/cygwin/bin/free.exe" ] ; then \
   378         ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
   379 	  grep Mem: | \
   380 	  sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
   381       else \
   382         echo "512"; \
   383       fi)
   384     export MB_OF_MEMORY
   385   endif
   386 endif
   388 # Machines with 512Mb or less of real memory are considered low memory
   389 #    build machines and adjustments will be made to prevent excessing
   390 #    system swapping during the build.
   391 #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
   392 #    Don't set VM max over 1024-128=896.
   393 ifndef MAX_VM_MEMORY
   394   ifneq ($(MB_OF_MEMORY),)
   395     LOW_MEMORY_MACHINE := $(shell \
   396       if [ $(MB_OF_MEMORY) -le 512 ] ; then \
   397         echo "true"; \
   398       else \
   399         echo "false"; \
   400       fi)
   401     MAX_VM_MEMORY := $(shell \
   402       if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
   403         expr $(MB_OF_MEMORY) '-' 128 ; \
   404       else \
   405         echo "896"; \
   406       fi)
   407     MIN_VM_MEMORY := $(shell \
   408       if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
   409         expr $(MAX_VM_MEMORY) '-' 8 ; \
   410       else \
   411         echo "128"; \
   412       fi)
   413   else
   414     MB_OF_MEMORY       := unknown
   415     LOW_MEMORY_MACHINE := true
   416     MAX_VM_MEMORY      := 384
   417     MIN_VM_MEMORY      := 128
   418   endif
   419   export MAX_VM_MEMORY
   420   export MIN_VM_MEMORY
   421   export LOW_MEMORY_MACHINE
   422   export MAX_VM_MEMORY
   423 endif
   425 REQUIRED_ZIP_VER = 2.2
   426 REQUIRED_UNZIP_VER = 5.12
   427 REQUIRED_MAKE_VER = 3.78
   429 # Unix type settings (same for all unix platforms)
   430 ifneq ($(PLATFORM), windows)
   431   # Temporary disk area
   432   TEMP_DISK=/tmp
   433   # Where is unwanted output to be delivered?
   434   DEV_NULL = /dev/null
   435   export DEV_NULL
   436   # Character used between entries in classpath 
   437   CLASSPATH_SEPARATOR = :
   438   # suffix used for object file (.o for unix .obj for windows)
   439   OBJECT_SUFFIX = o
   440   # The suffix applied to runtime libraries
   441   LIBRARY_SUFFIX = so
   442   # The suffix applied to link libraries
   443   LIB_SUFFIX = so
   444   # The suffix applied to executables (.exe for windows, nothing for solaris)
   445   EXE_SUFFIX =
   446   # The prefix applied to library files (lib for solaris, nothing for windows)
   447   LIB_PREFIX = lib
   448   # User name determination (set _USER)
   449   ifndef USER
   450     ifdef LOGNAME
   451       _USER := $(LOGNAME)
   452     else
   453       _USER := $(shell logname)
   454     endif
   455   else
   456     _USER:=$(USER)
   457   endif
   458   # Location of client/server directories
   459   ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
   460 endif
   462 # If blanks in the username, use the first 4 words and pack them together
   463 _USER1:=$(subst ', ,$(_USER))
   464 _USER2:=$(subst ", ,$(_USER1))
   465 USER:=$(word 1,$(_USER2))$(word 2,$(_USER2))$(word 3,$(_USER2))$(word 4,$(_USER2))
   466 export USER
   468 export PLATFORM
   469 endif

mercurial