make/common/shared/Platform.gmk

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

author
mikejwre
date
Thu, 17 Jun 2010 16:27:56 -0700
changeset 171
95db968660e7
parent 163
1b5234624436
child 194
0f60cf26c5b5
permissions
-rw-r--r--

Added tag jdk7-b98 for changeset 3b99409057e4

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

mercurial