Mon, 23 Nov 2009 10:04:41 +0000
6903453: Zero build on ARM and IA-64
Summary: Correctly set uname on ARM, and correctly build fdlibm on IA-64
Reviewed-by: 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 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 DEV_NULL = NUL
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 OS_VENDOR = Microsoft
370 # How much RAM does this machine have:
371 ifndef MB_OF_MEMORY
372 MB_OF_MEMORY := $(shell \
373 if [ -f "C:/cygwin/bin/free.exe" ] ; then \
374 ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
375 grep Mem: | \
376 sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
377 else \
378 echo "512"; \
379 fi)
380 export MB_OF_MEMORY
381 endif
382 endif
384 # Machines with 512Mb or less of real memory are considered low memory
385 # build machines and adjustments will be made to prevent excessing
386 # system swapping during the build.
387 # If we don't know, assume 512. Subtract 128 from MB for VM MAX.
388 # Don't set VM max over 1024-128=896.
389 ifndef MAX_VM_MEMORY
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
415 export MAX_VM_MEMORY
416 export MIN_VM_MEMORY
417 export LOW_MEMORY_MACHINE
418 export MAX_VM_MEMORY
419 endif
421 REQUIRED_ZIP_VER = 2.2
422 REQUIRED_UNZIP_VER = 5.12
423 REQUIRED_MAKE_VER = 3.78
425 # Unix type settings (same for all unix platforms)
426 ifneq ($(PLATFORM), windows)
427 # Temporary disk area
428 TEMP_DISK=/tmp
429 # Where is unwanted output to be delivered?
430 DEV_NULL = /dev/null
431 export DEV_NULL
432 # Character used between entries in classpath
433 CLASSPATH_SEPARATOR = :
434 # suffix used for object file (.o for unix .obj for windows)
435 OBJECT_SUFFIX = o
436 # The suffix applied to runtime libraries
437 LIBRARY_SUFFIX = so
438 # The suffix applied to link libraries
439 LIB_SUFFIX = so
440 # The suffix applied to executables (.exe for windows, nothing for solaris)
441 EXE_SUFFIX =
442 # The prefix applied to library files (lib for solaris, nothing for windows)
443 LIB_PREFIX = lib
444 # User name determination (set _USER)
445 ifndef USER
446 ifdef LOGNAME
447 _USER := $(LOGNAME)
448 else
449 _USER := $(shell logname)
450 endif
451 else
452 _USER:=$(USER)
453 endif
454 # Location of client/server directories
455 ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
456 endif
458 # If blanks in the username, use the first 4 words and pack them together
459 _USER1:=$(subst ', ,$(_USER))
460 _USER2:=$(subst ", ,$(_USER1))
461 USER:=$(word 1,$(_USER2))$(word 2,$(_USER2))$(word 3,$(_USER2))$(word 4,$(_USER2))
462 export USER
464 export PLATFORM
465 endif