Sat, 01 Dec 2007 00:00:00 +0000
Initial load
1 #
2 # Copyright 1997-2007 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 ifndef ARCH_DATA_MODEL
292 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
293 ARCH_DATA_MODEL=64
294 else
295 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
296 ARCH_DATA_MODEL=64
297 else
298 ARCH_DATA_MODEL=32
299 endif
300 endif
301 endif
302 export ARCH_DATA_MODEL
303 # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel
304 ARCH=i586
305 LIBARCH=i386
306 # Value of Java os.arch property
307 ARCHPROP=x86
308 REQUIRED_WINDOWS_NAME=Windows Professional 2000
309 REQUIRED_WINDOWS_VERSION=5 0 Service Pack 4
310 ifeq ($(ARCH_DATA_MODEL), 64)
311 # If the user wants to perform a cross compile build then they must
312 # - set ARCH_DATA_MODEL=64 and either
313 # + set ARCH to ia64 or amd64, or
314 REQUIRED_WINDOWS_NAME=Windows Server 2003
315 REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1
316 ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64)
317 ARCH=amd64
318 else
319 ARCH=ia64
320 endif
321 LIBARCH=$(ARCH)
322 # Value of Java os.arch property
323 ARCHPROP=$(LIBARCH)
324 endif
325 ARCH_FAMILY = $(ARCH)
326 # Where is unwanted output to be delivered?
327 DEV_NULL = NUL
328 export DEV_NULL
329 # Classpath separator
330 CLASSPATH_SEPARATOR = ;
331 # The suffix used for object file (.o for unix .obj for windows)
332 OBJECT_SUFFIX = obj
333 # The suffix applied to executables (.exe for windows, nothing for solaris)
334 EXE_SUFFIX = .exe
335 # The prefix applied to library files (lib for solaris, nothing for windows)
336 LIB_PREFIX=
337 LIBRARY_SUFFIX = dll
338 LIB_SUFFIX = lib
339 # User name determination (set _USER)
340 ifndef USER
341 ifdef USERNAME
342 _USER := $(USERNAME)
343 else
344 ifdef LOGNAME
345 _USER := $(LOGNAME)
346 else
347 _USER := $(shell id -un)
348 endif
349 endif
350 else
351 _USER:=$(USER)
352 endif
353 # Location of client/server directories
354 ARCH_VM_SUBDIR=jre/bin
355 # Suffix for file bundles used in previous release
356 BUNDLE_FILE_SUFFIX=.tar
357 # Minimum disk space needed as determined by running 'du -sk' on
358 # a fully built workspace.
359 REQUIRED_FREE_SPACE=500000
360 OS_VENDOR = Microsoft
361 # How much RAM does this machine have:
362 MB_OF_MEMORY := $(shell \
363 if [ -f "C:/cygwin/bin/free.exe" ] ; then \
364 ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \
365 grep Mem: | \
366 sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \
367 else \
368 echo "512"; \
369 fi)
370 endif
372 # Machines with 512Mb or less of real memory are considered low memory
373 # build machines and adjustments will be made to prevent excessing
374 # system swapping during the build.
375 # If we don't know, assume 512. Subtract 128 from MB for VM MAX.
376 # Don't set VM max over 1024-128=896.
377 ifneq ($(MB_OF_MEMORY),)
378 LOW_MEMORY_MACHINE := $(shell \
379 if [ $(MB_OF_MEMORY) -le 512 ] ; then \
380 echo "true"; \
381 else \
382 echo "false"; \
383 fi)
384 MAX_VM_MEMORY := $(shell \
385 if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
386 expr $(MB_OF_MEMORY) '-' 128 ; \
387 else \
388 echo "896"; \
389 fi)
390 MIN_VM_MEMORY := $(shell \
391 if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
392 expr $(MAX_VM_MEMORY) '-' 8 ; \
393 else \
394 echo "128"; \
395 fi)
396 else
397 MB_OF_MEMORY := unknown
398 LOW_MEMORY_MACHINE := true
399 MAX_VM_MEMORY := 384
400 MIN_VM_MEMORY := 128
401 endif
403 REQUIRED_ZIP_VER = 2.2
404 REQUIRED_UNZIP_VER = 5.12
405 REQUIRED_MAKE_VER = 3.78
407 # Unix type settings (same for all unix platforms)
408 ifneq ($(PLATFORM), windows)
409 # Temporary disk area
410 TEMP_DISK=/tmp
411 # Where is unwanted output to be delivered?
412 DEV_NULL = /dev/null
413 export DEV_NULL
414 # Character used between entries in classpath
415 CLASSPATH_SEPARATOR = :
416 # suffix used for object file (.o for unix .obj for windows)
417 OBJECT_SUFFIX = o
418 # The suffix applied to runtime libraries
419 LIBRARY_SUFFIX = so
420 # The suffix applied to link libraries
421 LIB_SUFFIX = so
422 # The suffix applied to executables (.exe for windows, nothing for solaris)
423 EXE_SUFFIX =
424 # The prefix applied to library files (lib for solaris, nothing for windows)
425 LIB_PREFIX = lib
426 # User name determination (set _USER)
427 ifndef USER
428 ifdef LOGNAME
429 _USER := $(LOGNAME)
430 else
431 _USER := $(shell logname)
432 endif
433 else
434 _USER:=$(USER)
435 endif
436 # Location of client/server directories
437 ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
438 endif
440 # If blanks in the username, use the first 4 words and pack them together
441 _USER1:=$(subst ', ,$(_USER))
442 _USER2:=$(subst ", ,$(_USER1))
443 USER:=$(word 1,$(_USER2))$(word 2,$(_USER2))$(word 3,$(_USER2))$(word 4,$(_USER2))
444 export USER
446 export PLATFORM
447 endif