annotate make/common/shared/Platform.gmk @ 233:06146786b141

Merge
author andrew
date Wed, 10 Nov 2010 18:49:04 +0000
parents 3eb18b5bf93c 0f60cf26c5b5
children eac2b25431d9
rev   line source
duke@0 1 #
ohair@182 2 # Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
ohair@182 7 # published by the Free Software Foundation. Oracle designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
ohair@182 9 # by Oracle in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
ohair@182 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@182 22 # or visit www.oracle.com if you need additional information or have any
ohair@182 23 # questions.
duke@0 24 #
duke@0 25
duke@0 26 #
duke@0 27 # Shared platform (OS/ARCH) variable settings for the JDK builds.
duke@0 28 #
duke@0 29 # Includes basic system requirements, versions of utilities required,
duke@0 30 # suffixes on files, and basic defaults attributed to the build platform.
duke@0 31 #
duke@0 32
duke@0 33 #
duke@0 34 # Assumes some basic unix system utilities (e.g. uname) are in the search path
duke@0 35 # in order to figure out the system.
duke@0 36 #
duke@0 37
duke@0 38 ifndef PLATFORM_SHARED
duke@0 39
duke@0 40 PLATFORM_SHARED=done
duke@0 41
duke@0 42 # Possible Input variables:
duke@0 43 # ARCH_DATA_MODEL 32 or 64, default to 32
duke@0 44 # USER, LOGNAME user name (runs logname, or id if not set)
duke@0 45 # PROCESSOR_IDENTIFIER windows only: needed in environment
duke@0 46 #
duke@0 47 # (Also gets input by running the utilities uname, logname, isainfo, or id.)
duke@0 48 #
duke@0 49 # Variables set by this file:
duke@0 50 # SYSTEM_UNAME what 'uname' says this system is
duke@0 51 # USER login name of user (minus blanks)
duke@0 52 # PLATFORM windows, solaris, or linux
duke@0 53 # VARIANT OPT or DBG, OPT is the default
duke@0 54 # OS_NAME solaris, linux, or nt
duke@0 55 # OS_VERSION specific version of os, 5.10, 2.4.9-e.3, etc.
duke@0 56 # TEMP_DISK /tmp or C:/temp
duke@0 57 # ARCH_DATA_MODEL 32 or 64
duke@0 58 # ARCH sparc, sparcv9, i586, amd64, or ia64
duke@0 59 # ARCH_FAMILY sparc or i586
duke@0 60 # ARCHPROP sparc or x86
duke@0 61 # DEV_NULL destination of /dev/null, NUL or /dev/NULL
duke@0 62 # CLASSPATH_SEPARATOR separator in classpath, ; or :
duke@0 63 # BUNDLE_FILE_SUFFIX suffix for bundles: .tar or .tar.gz
duke@0 64 # ISA_DIR solaris only: /sparcv9 or /amd64
duke@0 65 # REQUIRED_WINDOWS_NAME windows only: basic name of windows
duke@0 66 # REQUIRED_WINDOWS_VERSION windows only: specific version of windows
duke@0 67 # USING_CYGWIN windows only: true or false
duke@0 68 # WINDOWS_NT_VERSION_STRING windows only: long version name
duke@0 69 # REQUIRED_OS_VERSION required OS version, e.g. 5.10, 2.4
duke@0 70 # REQUIRED_FREE_SPACE minimum disk space needed for outputdir
duke@0 71 # REQUIRED_ZIP_VER required version of zip
duke@0 72 # REQUIRED_UNZIP_VER required version of unzip
duke@0 73 # LINUX_VERSION_INFO linux only: location of linux release file
duke@0 74 # REQUIRED_LINUX_VER linux only: required version of linux
duke@0 75 # REQUIRED_LINUX_FULLVER linux only: required full version of linux
duke@0 76
ohair@123 77 ifndef SYSTEM_UNAME
ohair@123 78 SYSTEM_UNAME := $(shell uname)
ohair@123 79 export SYSTEM_UNAME
ohair@123 80 endif
duke@0 81
duke@0 82 # Normal boot jdk is previous release, but a hard requirement is a 1.5 boot
duke@0 83 REQUIRED_BOOT_VER = 1.5
duke@0 84
duke@0 85 # Don't define this unless it's not defined
duke@0 86 ifndef VARIANT
duke@0 87 VARIANT=OPT
duke@0 88 endif
duke@0 89
duke@0 90 # Platform settings specific to Solaris
duke@0 91 ifeq ($(SYSTEM_UNAME), SunOS)
duke@0 92 PLATFORM = solaris
duke@0 93 OS_NAME = solaris
duke@0 94 OS_VERSION := $(shell uname -r)
duke@0 95 # Solaris sparc build can be either 32-bit or 64-bit.
duke@0 96 # Default to 32, but allow explicit setting to 32 or 64.
duke@0 97 ifndef ARCH_DATA_MODEL
duke@0 98 ARCH_DATA_MODEL=32
duke@0 99 endif
duke@0 100 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 101 processor := $(shell uname -p)
duke@0 102 archExpr = case "$(processor)" in \
duke@0 103 i[3-9]86) \
duke@0 104 echo i586 \
duke@0 105 ;; \
duke@0 106 sparc*) \
duke@0 107 echo sparc \
duke@0 108 ;; \
duke@0 109 *) \
duke@0 110 echo $(processor) \
duke@0 111 ;; \
duke@0 112 esac
duke@0 113 ARCH := $(shell $(archExpr))
duke@0 114 else
duke@0 115 ARCH := $(shell isainfo -n)
duke@0 116 # ISA_DIR is used to locate 64-bit specific libraries which are generally
duke@0 117 # in the same general place as other libraries under the ./$(ARCH) directory
duke@0 118 ISA_DIR = /$(ARCH)
duke@0 119 endif
duke@0 120 # Need to maintain the jre/lib/i386 location for 32-bit Intel
duke@0 121 ifeq ($(ARCH), i586)
duke@0 122 ARCH_FAMILY = $(ARCH)
duke@0 123 # Value of Java os.arch property
duke@0 124 ARCHPROP = x86
duke@0 125 else
duke@0 126 ifeq ($(ARCH), amd64)
duke@0 127 ARCH_FAMILY = i586
duke@0 128 else
duke@0 129 ARCH_FAMILY = sparc
duke@0 130 endif
duke@0 131 # Value of Java os.arch property
ohair@223 132 ARCHPROP = $(ARCH)
duke@0 133 endif
duke@0 134 # Suffix for file bundles used in previous release
duke@0 135 BUNDLE_FILE_SUFFIX=.tar
duke@0 136 # Required Solaris version
duke@0 137 REQUIRED_OS_VERSION = 5.10
duke@0 138 # Minimum disk space needed as determined by running 'du -sk' on
duke@0 139 # a fully built workspace.
duke@0 140 ifeq ($(ARCH_FAMILY), sparc)
duke@0 141 REQUIRED_FREE_SPACE=1300000
duke@0 142 else
duke@0 143 REQUIRED_FREE_SPACE=1040000
duke@0 144 endif
duke@0 145 # How much RAM does this machine have:
duke@0 146 MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
duke@0 147 endif
duke@0 148
duke@0 149 # Platform settings specific to Linux
duke@0 150 ifeq ($(SYSTEM_UNAME), Linux)
duke@0 151 PLATFORM = linux
duke@0 152 OS_NAME = linux
duke@0 153 OS_VERSION := $(shell uname -r)
duke@0 154 # Arch and OS name/version
duke@0 155 mach := $(shell uname -m)
duke@0 156 archExpr = case "$(mach)" in \
duke@0 157 i[3-9]86) \
duke@0 158 echo i586 \
duke@0 159 ;; \
duke@0 160 ia64) \
duke@0 161 echo ia64 \
duke@0 162 ;; \
duke@0 163 x86_64) \
duke@0 164 echo amd64 \
duke@0 165 ;; \
duke@0 166 sparc*) \
duke@0 167 echo sparc \
duke@0 168 ;; \
gbenson@145 169 arm*) \
gbenson@145 170 echo arm \
gbenson@145 171 ;; \
duke@0 172 *) \
duke@0 173 echo $(mach) \
duke@0 174 ;; \
duke@0 175 esac
duke@0 176 ARCH := $(shell $(archExpr) )
duke@0 177 ARCH_FAMILY := $(ARCH)
duke@0 178
duke@0 179 # Linux builds may be 32-bit or 64-bit data model.
duke@0 180 ifeq ($(ARCH), sparc)
duke@0 181 # Linux sparc build can be either 32-bit or 64-bit.
duke@0 182 # Default to 32, but allow explicit setting to 32 or 64.
duke@0 183 ifndef ARCH_DATA_MODEL
duke@0 184 ARCH_DATA_MODEL=32
duke@0 185 endif
duke@0 186 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 187 ARCH=sparc
duke@0 188 else
duke@0 189 ARCH=sparcv9
duke@0 190 endif
duke@0 191 else
duke@0 192 # i586 is 32-bit, amd64 is 64-bit
duke@0 193 ifndef ARCH_DATA_MODEL
duke@0 194 ifeq ($(ARCH), i586)
duke@0 195 ARCH_DATA_MODEL=32
duke@0 196 else
duke@0 197 ARCH_DATA_MODEL=64
duke@0 198 endif
duke@0 199 endif
duke@0 200 endif
duke@0 201
duke@0 202 ifeq ($(ARCH), i586)
ohair@223 203 ARCHPROP = i386
duke@0 204 else
ohair@223 205 ARCHPROP = $(ARCH)
duke@0 206 endif
duke@0 207
duke@0 208 # Suffix for file bundles used in previous release
duke@0 209 BUNDLE_FILE_SUFFIX=.tar.gz
duke@0 210 # Minimum disk space needed as determined by running 'du -sk' on
duke@0 211 # a fully built workspace.
duke@0 212 REQUIRED_FREE_SPACE=1460000
duke@0 213 LINUX_VERSION_INFO = /etc/redhat-release
duke@0 214 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 215 REQUIRED_LINUX_VER = Advanced Server
duke@0 216 REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS
duke@0 217 REQUIRED_OS_VERSION = 2.4.9-e.3
duke@0 218 else
duke@0 219 ifeq ($(ARCH), amd64)
duke@0 220 LINUX_VERSION_INFO = /etc/SuSE-release
duke@0 221 REQUIRED_LINUX_VER = 8.1
duke@0 222 REQUIRED_LINUX_FULLVER = $(REQUIRED_LINUX_VER) SLSE AMD64
duke@0 223 REQUIRED_OS_VERSION = 2.4.19-SMP
duke@0 224 else
duke@0 225 REQUIRED_LINUX_VER = Advanced Server
duke@0 226 REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS 64 bit
duke@0 227 REQUIRED_OS_VERSION = 2.4.19-SMP
duke@0 228 endif
duke@0 229 endif
duke@0 230 # How much RAM does this machine have:
duke@0 231 MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
duke@0 232 endif
duke@0 233
duke@0 234 # Windows with and without CYGWIN will be slightly different
duke@0 235 ifeq ($(SYSTEM_UNAME), Windows_NT)
duke@0 236 PLATFORM = windows
duke@0 237 OS_VERSION := $(shell uname -r)
duke@0 238 WINDOWS_NT_VERSION_STRING=Windows_NT
duke@0 239 REQUIRED_MKS_VER=6.1
duke@0 240 endif
duke@0 241 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
duke@0 242 PLATFORM = windows
duke@0 243 OS_VERSION := 5
duke@0 244 USING_CYGWIN = true
duke@0 245 export USING_CYGWIN
duke@0 246 WINDOWS_NT_VERSION_STRING=CYGWIN_NT
duke@0 247 REQUIRED_CYGWIN_VER=4.0
duke@0 248 endif
duke@0 249
duke@0 250 # Platform settings specific to Windows
duke@0 251 ifeq ($(PLATFORM), windows)
duke@0 252 OS_NAME = nt
duke@0 253 REQUIRED_OS_VERSION=5
duke@0 254 # Windows builds default to the appropriate for the underlaying
duke@0 255 # architecture.
duke@0 256 # Temporary disk area
duke@0 257 TEMP_DISK=C:/temp
duke@0 258 # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
duke@0 259 # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
ohair@75 260 PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
ohair@75 261 PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
ohair@75 262 PROC_ARCH:=$(subst x64,X64,$(PROC_ARCH))
ohair@75 263 PROC_ARCH:=$(subst intel64,X64,$(PROC_ARCH))
ohair@75 264 PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
ohair@75 265 PROC_ARCH:=$(subst INTEL64,X64,$(PROC_ARCH))
ohair@75 266 PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
ohair@75 267 PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
ohair@75 268 PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
ohair@75 269 PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
ohair@75 270 PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
duke@0 271 ifndef ARCH_DATA_MODEL
ohair@75 272 ifeq ($(PROC_ARCH),IA64)
duke@0 273 ARCH_DATA_MODEL=64
duke@0 274 else
ohair@75 275 ifeq ($(PROC_ARCH),X64)
duke@0 276 ARCH_DATA_MODEL=64
duke@0 277 else
duke@0 278 ARCH_DATA_MODEL=32
duke@0 279 endif
duke@0 280 endif
duke@0 281 endif
duke@0 282 export ARCH_DATA_MODEL
duke@0 283 ARCH=i586
duke@0 284 # Value of Java os.arch property
duke@0 285 ARCHPROP=x86
duke@0 286 REQUIRED_WINDOWS_NAME=Windows Professional 2000
duke@0 287 REQUIRED_WINDOWS_VERSION=5 0 Service Pack 4
duke@0 288 ifeq ($(ARCH_DATA_MODEL), 64)
duke@0 289 # If the user wants to perform a cross compile build then they must
duke@0 290 # - set ARCH_DATA_MODEL=64 and either
duke@0 291 # + set ARCH to ia64 or amd64, or
duke@0 292 REQUIRED_WINDOWS_NAME=Windows Server 2003
duke@0 293 REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1
ohair@75 294 ifeq ($(PROC_ARCH),X64)
duke@0 295 ARCH=amd64
duke@0 296 else
ohair@75 297 ifeq ($(PROC_ARCH),IA64)
ohair@75 298 ARCH=ia64
ohair@75 299 endif
duke@0 300 endif
duke@0 301 # Value of Java os.arch property
ohair@223 302 ARCHPROP=$(ARCH)
duke@0 303 endif
duke@0 304 ARCH_FAMILY = $(ARCH)
duke@0 305 # Where is unwanted output to be delivered?
prr@174 306 ifeq ($(USING_CYGWIN),true)
prr@174 307 DEV_NULL = /dev/null
prr@174 308 else
prr@174 309 DEV_NULL = NUL
prr@174 310 endif
duke@0 311 export DEV_NULL
duke@0 312 # Classpath separator
duke@0 313 CLASSPATH_SEPARATOR = ;
duke@0 314 # User name determination (set _USER)
duke@0 315 ifndef USER
duke@0 316 ifdef USERNAME
duke@0 317 _USER := $(USERNAME)
duke@0 318 else
duke@0 319 ifdef LOGNAME
duke@0 320 _USER := $(LOGNAME)
duke@0 321 else
duke@0 322 _USER := $(shell id -un)
duke@0 323 endif
duke@0 324 endif
duke@0 325 else
duke@0 326 _USER:=$(USER)
duke@0 327 endif
duke@0 328 # Suffix for file bundles used in previous release
duke@0 329 BUNDLE_FILE_SUFFIX=.tar
duke@0 330 # Minimum disk space needed as determined by running 'du -sk' on
duke@0 331 # a fully built workspace.
duke@0 332 REQUIRED_FREE_SPACE=500000
duke@0 333 # How much RAM does this machine have:
ohair@123 334 ifndef MB_OF_MEMORY
ohair@123 335 MB_OF_MEMORY := $(shell \
ohair@123 336 if [ -f "C:/cygwin/bin/free.exe" ] ; then \
ohair@123 337 ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
ohair@123 338 grep Mem: | \
ohair@123 339 sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
ohair@123 340 else \
ohair@123 341 echo "512"; \
ohair@123 342 fi)
ohair@123 343 export MB_OF_MEMORY
ohair@123 344 endif
duke@0 345 endif
duke@0 346
duke@0 347 # Machines with 512Mb or less of real memory are considered low memory
duke@0 348 # build machines and adjustments will be made to prevent excessing
duke@0 349 # system swapping during the build.
duke@0 350 # If we don't know, assume 512. Subtract 128 from MB for VM MAX.
duke@0 351 # Don't set VM max over 1024-128=896.
ohair@123 352 ifndef MAX_VM_MEMORY
ohair@123 353 ifneq ($(MB_OF_MEMORY),)
ohair@123 354 LOW_MEMORY_MACHINE := $(shell \
ohair@123 355 if [ $(MB_OF_MEMORY) -le 512 ] ; then \
ohair@123 356 echo "true"; \
ohair@123 357 else \
ohair@123 358 echo "false"; \
ohair@123 359 fi)
ohair@123 360 MAX_VM_MEMORY := $(shell \
ohair@123 361 if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
ohair@123 362 expr $(MB_OF_MEMORY) '-' 128 ; \
ohair@123 363 else \
ohair@123 364 echo "896"; \
ohair@123 365 fi)
ohair@123 366 MIN_VM_MEMORY := $(shell \
ohair@123 367 if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
ohair@123 368 expr $(MAX_VM_MEMORY) '-' 8 ; \
ohair@123 369 else \
ohair@123 370 echo "128"; \
ohair@123 371 fi)
ohair@123 372 else
ohair@123 373 MB_OF_MEMORY := unknown
ohair@123 374 LOW_MEMORY_MACHINE := true
ohair@123 375 MAX_VM_MEMORY := 384
ohair@123 376 MIN_VM_MEMORY := 128
ohair@123 377 endif
ohair@123 378 export MAX_VM_MEMORY
ohair@123 379 export MIN_VM_MEMORY
ohair@123 380 export LOW_MEMORY_MACHINE
ohair@123 381 export MAX_VM_MEMORY
duke@0 382 endif
duke@0 383
duke@0 384 REQUIRED_ZIP_VER = 2.2
duke@0 385 REQUIRED_UNZIP_VER = 5.12
duke@0 386 REQUIRED_MAKE_VER = 3.78
duke@0 387
duke@0 388 # Unix type settings (same for all unix platforms)
duke@0 389 ifneq ($(PLATFORM), windows)
duke@0 390 # Temporary disk area
duke@0 391 TEMP_DISK=/tmp
duke@0 392 # Where is unwanted output to be delivered?
duke@0 393 DEV_NULL = /dev/null
duke@0 394 export DEV_NULL
duke@0 395 # Character used between entries in classpath
duke@0 396 CLASSPATH_SEPARATOR = :
duke@0 397 # User name determination (set _USER)
duke@0 398 ifndef USER
duke@0 399 ifdef LOGNAME
duke@0 400 _USER := $(LOGNAME)
duke@0 401 else
duke@0 402 _USER := $(shell logname)
duke@0 403 endif
duke@0 404 else
duke@0 405 _USER:=$(USER)
duke@0 406 endif
duke@0 407 endif
duke@0 408
duke@0 409 # If blanks in the username, use the first 4 words and pack them together
duke@0 410 _USER1:=$(subst ', ,$(_USER))
duke@0 411 _USER2:=$(subst ", ,$(_USER1))
duke@0 412 USER:=$(word 1,$(_USER2))$(word 2,$(_USER2))$(word 3,$(_USER2))$(word 4,$(_USER2))
duke@0 413 export USER
duke@0 414
duke@0 415 export PLATFORM
duke@0 416 endif
duke@0 417