make/common/shared/Platform.gmk

Tue, 28 Jul 2009 12:12:36 -0700

author
xdono
date
Tue, 28 Jul 2009 12:12:36 -0700
changeset 98
a12ea7c7b497
parent 76
7b47536c234e
child 114
1c130e7b7a2e
permissions
-rw-r--r--

6862919: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 07/09
Reviewed-by: tbell, ohair

     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 SYSTEM_UNAME := $(shell uname)
    89 # Normal boot jdk is previous release, but a hard requirement is a 1.5 boot
    90 REQUIRED_BOOT_VER = 1.5
    92 #
    93 # Prune out all known SCM (Source Code Management) directories
    94 # so they will not be included when copying directory trees
    95 # or packaging up .jar files, etc.  This applies to all workspaces.
    96 #
    97 SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
    98 # When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune:
    99 SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files"
   100 SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files \) -prune
   102 # Don't define this unless it's not defined
   103 ifndef VARIANT
   104   VARIANT=OPT
   105 endif
   107 # Platform settings specific to Solaris
   108 ifeq ($(SYSTEM_UNAME), SunOS)
   109   PLATFORM = solaris
   110   OS_NAME = solaris
   111   OS_VERSION := $(shell uname -r)
   112   # Solaris sparc build can be either 32-bit or 64-bit.
   113   #   Default to 32, but allow explicit setting to 32 or 64.
   114   ifndef ARCH_DATA_MODEL
   115     ARCH_DATA_MODEL=32
   116   endif
   117   ifeq ($(ARCH_DATA_MODEL), 32)
   118     processor := $(shell uname -p)
   119     archExpr = case "$(processor)" in  \
   120                 i[3-9]86) \
   121                     echo i586 \
   122                     ;; \
   123                 sparc*)  \
   124                     echo sparc \
   125                     ;; \
   126                 *) \
   127                     echo $(processor)  \
   128                     ;; \
   129         esac
   130     ARCH        := $(shell $(archExpr))
   131   else
   132     ARCH := $(shell isainfo -n)
   133     # ISA_DIR is used to locate 64-bit specific libraries which are generally
   134     # in the same general place as other libraries under the ./$(ARCH) directory
   135     ISA_DIR = /$(ARCH)
   136   endif
   137   # Need to maintain the jre/lib/i386 location for 32-bit Intel
   138   ifeq ($(ARCH), i586)
   139      ARCH_FAMILY = $(ARCH)
   140      LIBARCH     = i386
   141      # Value of Java os.arch property
   142      ARCHPROP    = x86
   143   else
   144      ifeq ($(ARCH), amd64)
   145         ARCH_FAMILY = i586
   146      else
   147         ARCH_FAMILY = sparc
   148      endif
   149      LIBARCH  = $(ARCH)
   150      # Value of Java os.arch property
   151      ARCHPROP = $(LIBARCH)
   152   endif
   153   # The two LIBARCH names
   154   ifeq ($(ARCH_FAMILY), sparc)
   155     LIBARCH32 = sparc
   156     LIBARCH64 = sparcv9
   157   else
   158     LIBARCH32 = i386
   159     LIBARCH64 = amd64
   160   endif
   161   # Suffix for file bundles used in previous release
   162   BUNDLE_FILE_SUFFIX=.tar
   163   OS_VENDOR = Sun Microsystems
   164   # Required Solaris version
   165   REQUIRED_OS_VERSION = 5.10
   166   # Minimum disk space needed as determined by running 'du -sk' on 
   167   #    a fully built workspace.
   168   ifeq ($(ARCH_FAMILY), sparc)
   169     REQUIRED_FREE_SPACE=1300000
   170   else
   171     REQUIRED_FREE_SPACE=1040000
   172   endif
   173   # How much RAM does this machine have:
   174   MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
   175 endif
   177 # Platform settings specific to Linux
   178 ifeq ($(SYSTEM_UNAME), Linux)
   179   PLATFORM = linux
   180   OS_NAME = linux
   181   OS_VERSION := $(shell uname -r)
   182   # Arch and OS name/version
   183   mach := $(shell uname -m)
   184   archExpr = case "$(mach)" in \
   185                 i[3-9]86) \
   186                     echo i586 \
   187                     ;; \
   188                 ia64) \
   189                     echo ia64 \
   190                     ;; \
   191                 x86_64) \
   192                     echo amd64 \
   193                     ;; \
   194                 sparc*) \
   195                     echo sparc \
   196                     ;; \
   197                 *) \
   198                     echo $(mach) \
   199                     ;; \
   200       esac
   201   ARCH        := $(shell $(archExpr) )
   202   ARCH_FAMILY := $(ARCH)
   204   # Linux builds may be 32-bit or 64-bit data model.
   205   ifeq ($(ARCH), sparc)
   206     # Linux sparc build can be either 32-bit or 64-bit.
   207     #   Default to 32, but allow explicit setting to 32 or 64.
   208     ifndef ARCH_DATA_MODEL
   209       ARCH_DATA_MODEL=32
   210     endif
   211     ifeq ($(ARCH_DATA_MODEL), 32)
   212       ARCH=sparc
   213     else
   214       ARCH=sparcv9
   215     endif
   216   else
   217     # i586 is 32-bit, amd64 is 64-bit
   218     ifndef ARCH_DATA_MODEL
   219       ifeq ($(ARCH), i586)
   220         ARCH_DATA_MODEL=32
   221       else
   222         ARCH_DATA_MODEL=64
   223       endif
   224     endif
   225   endif
   227   # Need to maintain the jre/lib/i386 location for 32-bit Intel
   228   ifeq ($(ARCH), i586)
   229     LIBARCH = i386
   230   else
   231     LIBARCH = $(ARCH)
   232   endif
   234   # Value of Java os.arch property
   235   ARCHPROP  = $(LIBARCH)
   237   # Suffix for file bundles used in previous release
   238   BUNDLE_FILE_SUFFIX=.tar.gz
   239   # Minimum disk space needed as determined by running 'du -sk' on 
   240   #    a fully built workspace.
   241   REQUIRED_FREE_SPACE=1460000
   242   LINUX_VERSION_INFO = /etc/redhat-release
   243   OS_VENDOR = Red Hat
   244   ifeq ($(ARCH_DATA_MODEL), 32)
   245     REQUIRED_LINUX_VER = Advanced Server
   246     REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS
   247     REQUIRED_OS_VERSION = 2.4.9-e.3
   248   else
   249     ifeq ($(ARCH), amd64)
   250       LINUX_VERSION_INFO = /etc/SuSE-release
   251       OS_VENDOR = SuSE Enterprise
   252       REQUIRED_LINUX_VER = 8.1
   253       REQUIRED_LINUX_FULLVER = $(REQUIRED_LINUX_VER) SLSE AMD64
   254       REQUIRED_OS_VERSION = 2.4.19-SMP
   255     else
   256       REQUIRED_LINUX_VER = Advanced Server
   257       REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS 64 bit
   258       REQUIRED_OS_VERSION = 2.4.19-SMP
   259     endif
   260   endif
   261   # How much RAM does this machine have:
   262   MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
   263 endif
   265 # Windows with and without CYGWIN will be slightly different
   266 ifeq ($(SYSTEM_UNAME), Windows_NT)
   267   PLATFORM = windows
   268   OS_VERSION := $(shell uname -r)
   269   WINDOWS_NT_VERSION_STRING=Windows_NT
   270   REQUIRED_MKS_VER=6.1
   271 endif
   272 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
   273   PLATFORM = windows
   274   OS_VERSION := 5
   275   USING_CYGWIN = true
   276   export USING_CYGWIN
   277   WINDOWS_NT_VERSION_STRING=CYGWIN_NT
   278   REQUIRED_CYGWIN_VER=4.0
   279 endif
   281 # Platform settings specific to Windows
   282 ifeq ($(PLATFORM), windows)
   283   OS_NAME = nt
   284   REQUIRED_OS_VERSION=5
   285   # Windows builds default to the appropriate for the underlaying
   286   # architecture.
   287   # Temporary disk area
   288   TEMP_DISK=C:/temp
   289   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
   290   # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
   291   PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
   292   PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
   293   PROC_ARCH:=$(subst x64,X64,$(PROC_ARCH))
   294   PROC_ARCH:=$(subst intel64,X64,$(PROC_ARCH))
   295   PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
   296   PROC_ARCH:=$(subst INTEL64,X64,$(PROC_ARCH))
   297   PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
   298   PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
   299   PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
   300   PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
   301   PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
   302   ifndef ARCH_DATA_MODEL
   303     ifeq ($(PROC_ARCH),IA64)
   304       ARCH_DATA_MODEL=64
   305     else
   306       ifeq ($(PROC_ARCH),X64)
   307         ARCH_DATA_MODEL=64
   308       else
   309         ARCH_DATA_MODEL=32
   310       endif
   311     endif
   312   endif
   313   export ARCH_DATA_MODEL
   314   # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel
   315   ARCH=i586
   316   LIBARCH=i386
   317   # Value of Java os.arch property
   318   ARCHPROP=x86
   319   REQUIRED_WINDOWS_NAME=Windows Professional 2000
   320   REQUIRED_WINDOWS_VERSION=5 0 Service Pack 4
   321   ifeq ($(ARCH_DATA_MODEL), 64)
   322     # If the user wants to perform a cross compile build then they must
   323     # - set ARCH_DATA_MODEL=64 and either
   324     #      + set ARCH to ia64 or amd64, or
   325     REQUIRED_WINDOWS_NAME=Windows Server 2003
   326     REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1
   327     ifeq ($(PROC_ARCH),X64)
   328       ARCH=amd64
   329     else
   330       ifeq ($(PROC_ARCH),IA64)
   331         ARCH=ia64
   332       endif
   333     endif
   334     LIBARCH=$(ARCH)
   335     # Value of Java os.arch property
   336     ARCHPROP=$(LIBARCH)
   337   endif
   338   ARCH_FAMILY = $(ARCH)
   339   # Where is unwanted output to be delivered?
   340   DEV_NULL = NUL
   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   MB_OF_MEMORY := $(shell \
   376     if [ -f "C:/cygwin/bin/free.exe" ] ; then \
   377       ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
   378 	grep Mem: | \
   379 	sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
   380     else \
   381       echo "512"; \
   382     fi)
   383 endif
   385 # Machines with 512Mb or less of real memory are considered low memory
   386 #    build machines and adjustments will be made to prevent excessing
   387 #    system swapping during the build.
   388 #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
   389 #    Don't set VM max over 1024-128=896.
   390 ifneq ($(MB_OF_MEMORY),)
   391   LOW_MEMORY_MACHINE := $(shell \
   392     if [ $(MB_OF_MEMORY) -le 512 ] ; then \
   393       echo "true"; \
   394     else \
   395       echo "false"; \
   396     fi)
   397   MAX_VM_MEMORY := $(shell \
   398     if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
   399       expr $(MB_OF_MEMORY) '-' 128 ; \
   400     else \
   401       echo "896"; \
   402     fi)
   403   MIN_VM_MEMORY := $(shell \
   404     if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
   405       expr $(MAX_VM_MEMORY) '-' 8 ; \
   406     else \
   407       echo "128"; \
   408     fi)
   409 else
   410   MB_OF_MEMORY       := unknown
   411   LOW_MEMORY_MACHINE := true
   412   MAX_VM_MEMORY      := 384
   413   MIN_VM_MEMORY      := 128
   414 endif
   416 REQUIRED_ZIP_VER = 2.2
   417 REQUIRED_UNZIP_VER = 5.12
   418 REQUIRED_MAKE_VER = 3.78
   420 # Unix type settings (same for all unix platforms)
   421 ifneq ($(PLATFORM), windows)
   422   # Temporary disk area
   423   TEMP_DISK=/tmp
   424   # Where is unwanted output to be delivered?
   425   DEV_NULL = /dev/null
   426   export DEV_NULL
   427   # Character used between entries in classpath 
   428   CLASSPATH_SEPARATOR = :
   429   # suffix used for object file (.o for unix .obj for windows)
   430   OBJECT_SUFFIX = o
   431   # The suffix applied to runtime libraries
   432   LIBRARY_SUFFIX = so
   433   # The suffix applied to link libraries
   434   LIB_SUFFIX = so
   435   # The suffix applied to executables (.exe for windows, nothing for solaris)
   436   EXE_SUFFIX =
   437   # The prefix applied to library files (lib for solaris, nothing for windows)
   438   LIB_PREFIX = lib
   439   # User name determination (set _USER)
   440   ifndef USER
   441     ifdef LOGNAME
   442       _USER := $(LOGNAME)
   443     else
   444       _USER := $(shell logname)
   445     endif
   446   else
   447     _USER:=$(USER)
   448   endif
   449   # Location of client/server directories
   450   ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
   451 endif
   453 # If blanks in the username, use the first 4 words and pack them together
   454 _USER1:=$(subst ', ,$(_USER))
   455 _USER2:=$(subst ", ,$(_USER1))
   456 USER:=$(word 1,$(_USER2))$(word 2,$(_USER2))$(word 3,$(_USER2))$(word 4,$(_USER2))
   457 export USER
   459 export PLATFORM
   460 endif

mercurial