author | andrew |
Thu, 03 Jun 2010 19:37:48 +0100 | |
changeset 5639 | 730861c04a99 |
parent 5506 | 202f599c92aa |
child 5633 | d20431ead333 |
permissions | -rw-r--r-- |
2 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
5506 | 4 |
# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. |
2 | 5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 |
# |
|
7 |
# This code is free software; you can redistribute it and/or modify it |
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
|
5506 | 9 |
# published by the Free Software Foundation. Oracle designates this |
2 | 10 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 11 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 12 |
# |
13 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
14 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
17 |
# accompanied this code). |
|
18 |
# |
|
19 |
# You should have received a copy of the GNU General Public License version |
|
20 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
21 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
22 |
# |
|
5506 | 23 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
24 |
# or visit www.oracle.com if you need additional information or have any |
|
25 |
# questions. |
|
2 | 26 |
# |
27 |
||
28 |
||
29 |
############################################################################# |
|
30 |
# |
|
31 |
# Generic build profile.sh for all platforms, works in bash, sh, and ksh. |
|
32 |
# |
|
33 |
# Copy this file to your own area, and edit it to suit your needs. |
|
34 |
# |
|
35 |
# Ideally you either won't need to set the ALT_* variables because the |
|
36 |
# build system will find what it needs through system provided paths |
|
37 |
# or environment variables, or you have installed the component in the |
|
38 |
# recommended default path. |
|
39 |
# |
|
40 |
# If you find yourself forced to set an ALT_* environment variable and |
|
41 |
# suspect we could have figured it out automatically, please let us know. |
|
42 |
# |
|
43 |
# Most ALT_* directory defaults are based on being in the parent directory in |
|
44 |
# ALT_SLASH_JAVA, so it's possible to create for example a "C:/jdk6" |
|
45 |
# directory, assign that to ALT_SLASH_JAVA, and place all the components |
|
46 |
# in that directory. This could also minimize the ALT_* environment |
|
47 |
# variables you need to set. |
|
48 |
# |
|
49 |
######## |
|
50 |
# |
|
51 |
# Assumes basic unix utilities are in the PATH already (uname, hostname, etc.). |
|
52 |
# |
|
53 |
# On Windows, assumes PROCESSOR_IDENTIFIER, VS71COMNTOOLS, |
|
54 |
# SYSTEMROOT (or SystemRoot), COMPUTERNAME (or hostname works), and |
|
55 |
# USERNAME is defined in the environment. |
|
56 |
# This profile does not rely on using vcvars32.bat and 64bit Setup.bat. |
|
57 |
# Uses CYGWIN cygpath to make sure paths are space-free. |
|
58 |
# |
|
59 |
# The JDK Makefiles may change in the future, making some of these |
|
60 |
# settings unnecessary or redundant. |
|
61 |
# |
|
62 |
# This is a working example, but may or may not work on all systems. |
|
63 |
# |
|
64 |
############################################################################# |
|
65 |
# |
|
66 |
# WARNING: This file will clobber the value of some environment variables. |
|
67 |
# |
|
68 |
# Sets up these environment variables for doing JDK builds: |
|
69 |
# USERNAME |
|
70 |
# COMPUTERNAME |
|
71 |
# PATH |
|
72 |
# Windows Only: |
|
73 |
# LIB |
|
74 |
# INCLUDE |
|
75 |
# PS1 |
|
76 |
# SHELL |
|
77 |
# |
|
78 |
# Attempts to set these variables for the JDK builds: |
|
79 |
# ALT_COMPILER_PATH |
|
80 |
# ALT_BOOTDIR |
|
81 |
# ALT_BINARY_PLUGS_PATH |
|
82 |
# ALT_CLOSED_JDK_IMPORT_PATH |
|
83 |
# Windows Only: |
|
84 |
# ALT_UNIXCOMMAND_PATH |
|
85 |
# ALT_MSDEVTOOLS_PATH |
|
86 |
# ALT_DXSDK_PATH |
|
87 |
# ALT_MSVCRT_DLL_PATH |
|
88 |
# ALT_MSVCR71_DLL_PATH |
|
89 |
# |
|
90 |
############################################################################# |
|
91 |
# |
|
92 |
# Keep in mind that at this point, we are running in some kind of shell |
|
93 |
# (sh, ksh, or bash). We don't know if it's solaris, linux, or windows |
|
94 |
# CYGWIN. We need to figure that out. |
|
95 |
||
96 |
# Find user name |
|
97 |
if [ "${USERNAME}" = "" ] ; then |
|
98 |
USERNAME="${LOGNAME}" |
|
99 |
fi |
|
100 |
if [ "${USERNAME}" = "" ] ; then |
|
101 |
USERNAME="${USER}" |
|
102 |
fi |
|
103 |
export USERNAME |
|
104 |
||
105 |
# Find machine name |
|
106 |
if [ "${COMPUTERNAME}" = "" ] ; then |
|
107 |
COMPUTERNAME="$(hostname)" |
|
108 |
fi |
|
109 |
export COMPUTERNAME |
|
110 |
||
111 |
# Boot jdk |
|
112 |
bootjdk=jdk1.6.0 |
|
113 |
importjdk=jdk1.7.0 |
|
114 |
||
115 |
# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. |
|
116 |
osname=$(uname -s) |
|
117 |
if [ "${osname}" = SunOS ] ; then |
|
118 |
||
119 |
# System place where JDK installed images are stored? |
|
120 |
jdk_instances=/usr/jdk/instances |
|
121 |
||
642
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
2
diff
changeset
|
122 |
# Get the Sun Studio compilers (and latest patches for them too) |
2 | 123 |
if [ "${ALT_COMPILER_PATH}" = "" ] ; then |
124 |
ALT_COMPILER_PATH=/opt/SUNWspro/bin |
|
125 |
export ALT_COMPILER_PATH |
|
126 |
fi |
|
127 |
if [ ! -d ${ALT_COMPILER_PATH} ] ; then |
|
128 |
echo "WARNING: Cannot access ALT_COMPILER_PATH=${ALT_COMPILER_PATH}" |
|
129 |
fi |
|
130 |
||
131 |
# Place compiler path early in PATH to avoid 'cc' conflicts. |
|
132 |
path4sdk=${ALT_COMPILER_PATH}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin |
|
133 |
||
134 |
# Make sure these are unset |
|
135 |
unset JAVA_HOME |
|
136 |
unset LD_LIBRARY_PATH |
|
137 |
||
138 |
# Build in C locale |
|
139 |
LANG=C |
|
140 |
export LANG |
|
141 |
LC_ALL=C |
|
142 |
export LC_ALL |
|
143 |
||
144 |
umask 002 |
|
145 |
||
146 |
elif [ "${osname}" = Linux ] ; then |
|
147 |
||
148 |
# System place where JDK installed images are stored? |
|
149 |
jdk_instances=/opt/java |
|
150 |
||
151 |
# Use compilers from /usr/bin |
|
152 |
path4sdk=/usr/bin:/bin:/usr/sbin:/sbin |
|
153 |
||
154 |
# Make sure these are unset |
|
155 |
unset JAVA_HOME |
|
156 |
unset LD_LIBRARY_PATH |
|
157 |
||
158 |
# Build in C locale |
|
159 |
LANG=C |
|
160 |
export LANG |
|
161 |
LC_ALL=C |
|
162 |
export LC_ALL |
|
163 |
||
164 |
umask 002 |
|
165 |
||
166 |
else |
|
167 |
||
168 |
# System place where JDK installed images are stored? |
|
169 |
jdk_instances="C:" |
|
170 |
||
171 |
# Windows: Differs on CYGWIN and the compiler available. |
|
172 |
# Also, blanks in pathnames gives make headaches, so anything placed |
|
173 |
# in any ALT_* variable should be the short windows DOS names. |
|
174 |
||
175 |
# Check CYGWIN (should have already been done) |
|
176 |
# Assumption here is that you are in a shell window via cygwin. |
|
2300
103e268e2d16
6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
ohair
parents:
715
diff
changeset
|
177 |
proc_arch=`echo "$(PROCESSOR_IDENTIFIER)" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'` |
103e268e2d16
6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
ohair
parents:
715
diff
changeset
|
178 |
if [ "${proc_arch}" = "X64" ] ; then |
2 | 179 |
windows_arch=amd64 |
180 |
else |
|
181 |
windows_arch=i586 |
|
182 |
fi |
|
183 |
# We need to check if we are running a CYGWIN shell |
|
184 |
if [ "$(uname -a | fgrep Cygwin)" != "" -a -f /bin/cygpath ] ; then |
|
185 |
# For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist |
|
186 |
# Utility to convert to short pathnames without spaces |
|
187 |
cygpath="/usr/bin/cygpath -a -m -s" |
|
188 |
# Most unix utilities are in the /usr/bin |
|
189 |
unixcommand_path="/usr/bin" |
|
190 |
# Make the prompt tell you CYGWIN |
|
191 |
export PS1="CYGWIN:${COMPUTERNAME}:${USERNAME}[\!] " |
|
192 |
else |
|
193 |
echo "ERROR: Cannot find CYGWIN on this machine" |
|
194 |
exit 1 |
|
195 |
fi |
|
196 |
if [ "${ALT_UNIXCOMMAND_PATH}" != "" ] ; then |
|
197 |
unixcommand_path=${ALT_UNIXCOMMAND_PATH} |
|
198 |
fi |
|
199 |
||
200 |
# Default shell |
|
201 |
export SHELL="${unixcommand_path}/sh" |
|
202 |
||
203 |
# Setup path system (verify this is right) |
|
204 |
if [ "${SystemRoot}" != "" ] ; then |
|
205 |
sys_root=$(${cygpath} "${SystemRoot}") |
|
206 |
elif [ "${SYSTEMROOT}" != "" ] ; then |
|
207 |
sys_root=$(${cygpath} "${SYSTEMROOT}") |
|
208 |
else |
|
209 |
sys_root=$(${cygpath} "C:/WINNT") |
|
210 |
fi |
|
211 |
path4sdk="${unixcommand_path};${sys_root}/system32;${sys_root};${sys_root}/System32/Wbem" |
|
212 |
if [ ! -d "${sys_root}" ] ; then |
|
213 |
echo "WARNING: No system root found at: ${sys_root}" |
|
214 |
fi |
|
215 |
||
216 |
# Compiler setup (nasty part) |
|
217 |
# NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE. |
|
218 |
# NOTE: CYGWIN has a link.exe too, make sure the compilers are first |
|
219 |
if [ "${windows_arch}" = i586 ] ; then |
|
220 |
# 32bit Windows compiler settings |
|
221 |
# VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined) |
|
222 |
vs_root=$(${cygpath} "${VS71COMNTOOLS}/../..") |
|
223 |
# Fill in PATH, LIB, and INCLUDE (unset all others to make sure) |
|
224 |
msdev_root="${vs_root}/Common7/Tools" |
|
225 |
msdevtools_path="${msdev_root}/bin" |
|
226 |
vc7_root="${vs_root}/Vc7" |
|
227 |
compiler_path="${vc7_root}/bin" |
|
228 |
platform_sdk="${vc7_root}/PlatformSDK" |
|
229 |
||
230 |
# LIB and INCLUDE must use ; as a separator |
|
231 |
include4sdk="${vc7_root}/atlmfc/include" |
|
232 |
include4sdk="${include4sdk};${vc7_root}/include" |
|
233 |
include4sdk="${include4sdk};${platform_sdk}/include/prerelease" |
|
234 |
include4sdk="${include4sdk};${platform_sdk}/include" |
|
235 |
include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include" |
|
236 |
lib4sdk="${lib4sdk};${vc7_root}/lib" |
|
237 |
lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease" |
|
238 |
lib4sdk="${lib4sdk};${platform_sdk}/lib" |
|
239 |
lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib" |
|
240 |
# Search path and DLL locating path |
|
241 |
# WARNING: CYGWIN has a link.exe too, make sure compilers are first |
|
242 |
path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}" |
|
243 |
path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}" |
|
244 |
path4sdk="${vs_root}/Common7/Tools;${path4sdk}" |
|
245 |
path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}" |
|
246 |
path4sdk="${vs_root}/Common7/IDE;${path4sdk}" |
|
247 |
path4sdk="${compiler_path};${path4sdk}" |
|
248 |
elif [ "${windows_arch}" = amd64 ] ; then |
|
249 |
# AMD64 64bit Windows compiler settings |
|
250 |
if [ "${ALT_DEPLOY_MSSDK}" != "" ] ; then |
|
251 |
platform_sdk=${ALT_DEPLOY_MSSDK} |
|
252 |
else |
|
253 |
platform_sdk=$(${cygpath} "C:/Program Files/Microsoft Platform SDK/") |
|
254 |
fi |
|
255 |
if [ "${ALT_COMPILER_PATH}" != "" ] ; then |
|
256 |
compiler_path=${ALT_COMPILER_PATH} |
|
257 |
if [ "${ALT_DEPLOY_MSSDK}" = "" ] ; then |
|
258 |
platform_sdk=${ALT_COMPILER_PATH}/../../../.. |
|
259 |
fi |
|
260 |
else |
|
261 |
compiler_path="${platform_sdk}/Bin/win64/x86/AMD64" |
|
262 |
fi |
|
263 |
if [ "${ALT_MSDEVTOOLS_PATH}" != "" ] ; then |
|
264 |
msdevtools_path=${ALT_MSDEVTOOLS_PATH} |
|
265 |
else |
|
266 |
msdevtools_path="${platform_sdk}/Bin/win64/x86/AMD64" |
|
267 |
fi |
|
268 |
msdevtools_path="${compiler_path}" |
|
269 |
# LIB and INCLUDE must use ; as a separator |
|
270 |
include4sdk="${platform_sdk}/Include" |
|
271 |
include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys" |
|
272 |
include4sdk="${include4sdk};${platform_sdk}/Include/mfc" |
|
273 |
include4sdk="${include4sdk};${platform_sdk}/Include/atl" |
|
274 |
include4sdk="${include4sdk};${platform_sdk}/Include/crt" |
|
275 |
lib4sdk="${platform_sdk}/Lib/AMD64" |
|
276 |
lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc" |
|
277 |
# Search path and DLL locating path |
|
278 |
# WARNING: CYGWIN has a link.exe too, make sure compilers are first |
|
279 |
path4sdk="${platform_sdk}/bin;${path4sdk}" |
|
280 |
path4sdk="${compiler_path};${path4sdk}" |
|
281 |
fi |
|
282 |
# Export LIB and INCLUDE |
|
283 |
unset lib |
|
284 |
unset Lib |
|
285 |
LIB="${lib4sdk}" |
|
286 |
export LIB |
|
287 |
unset include |
|
288 |
unset Include |
|
289 |
INCLUDE="${include4sdk}" |
|
290 |
export INCLUDE |
|
291 |
||
292 |
# Turn all \\ into /, remove duplicates and trailing / |
|
293 |
slash_path="$(echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g')" |
|
294 |
path4sdk="${slash_path}" |
|
295 |
||
296 |
# Convert path4sdk to cygwin style |
|
297 |
path4sdk="$(/usr/bin/cygpath -p ${path4sdk})" |
|
298 |
||
299 |
fi |
|
300 |
||
301 |
# Get the previous JDK to be used to bootstrap the build |
|
302 |
if [ "${ALT_BOOTDIR}" = "" ] ; then |
|
303 |
ALT_BOOTDIR=${jdk_instances}/${bootjdk} |
|
304 |
export ALT_BOOTDIR |
|
305 |
fi |
|
306 |
if [ ! -d ${ALT_BOOTDIR} ] ; then |
|
307 |
echo "WARNING: Cannot access ALT_BOOTDIR=${ALT_BOOTDIR}" |
|
308 |
fi |
|
309 |
||
310 |
# Get the import JDK to be used to get hotspot VM if not built |
|
311 |
if [ "${ALT_JDK_IMPORT_PATH}" = "" -a -d ${jdk_instances}/${importjdk} ] ; then |
|
312 |
ALT_JDK_IMPORT_PATH=${jdk_instances}/${importjdk} |
|
313 |
export ALT_JDK_IMPORT_PATH |
|
314 |
fi |
|
315 |
||
316 |
# Get the latest JDK binary plugs or build to import pre-built binaries |
|
317 |
if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then |
|
318 |
binplugs=${jdk_instances}/openjdk-binary-plugs |
|
319 |
jdkplugs=${jdk_instances}/${importjdk} |
|
320 |
if [ -d ${binplugs} ] ; then |
|
321 |
ALT_BINARY_PLUGS_PATH=${binplugs} |
|
322 |
export ALT_BINARY_PLUGS_PATH |
|
323 |
elif [ "${ALT_CLOSED_JDK_IMPORT_PATH}" = "" -a -d ${jdkplugs} ] ; then |
|
324 |
ALT_CLOSED_JDK_IMPORT_PATH=${jdkplugs} |
|
325 |
export ALT_CLOSED_JDK_IMPORT_PATH |
|
326 |
fi |
|
327 |
if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then |
|
328 |
echo "WARNING: Missing ALT_BINARY_PLUGS_PATH: ${binplugs}" |
|
329 |
fi |
|
330 |
fi |
|
331 |
if [ "${ALT_BINARY_PLUGS_PATH}" != "" -a ! -d "${ALT_BINARY_PLUGS_PATH}" ] ; then |
|
332 |
echo "WARNING: Cannot access ALT_BINARY_PLUGS_PATH=${ALT_BINARY_PLUGS_PATH}" |
|
333 |
fi |
|
334 |
if [ "${ALT_CLOSED_JDK_IMPORT_PATH}" != "" -a ! -d "${ALT_CLOSED_JDK_IMPORT_PATH}" ] ; then |
|
335 |
echo "WARNING: Cannot access ALT_CLOSED_JDK_IMPORT_PATH=${ALT_CLOSED_JDK_IMPORT_PATH}" |
|
336 |
fi |
|
337 |
||
338 |
# Export PATH setting |
|
339 |
PATH="${path4sdk}" |
|
340 |
export PATH |
|
341 |
||
4111
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
342 |
# Export variables required for Zero |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
343 |
if [ "${ZERO_BUILD}" = true ] ; then |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
344 |
# ZERO_LIBARCH is the name of the architecture-specific |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
345 |
# subdirectory under $JAVA_HOME/jre/lib |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
346 |
arch=$(uname -m) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
347 |
case "${arch}" in |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
348 |
x86_64) ZERO_LIBARCH=amd64 ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
349 |
i?86) ZERO_LIBARCH=i386 ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
350 |
sparc64) ZERO_LIBARCH=sparcv9 ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
351 |
arm*) ZERO_LIBARCH=arm ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
352 |
*) ZERO_LIBARCH="$(arch)" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
353 |
esac |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
354 |
export ZERO_LIBARCH |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
355 |
|
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
356 |
# ARCH_DATA_MODEL is the number of bits in a pointer |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
357 |
case "${ZERO_LIBARCH}" in |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
358 |
i386|ppc|s390|sparc|arm) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
359 |
ARCH_DATA_MODEL=32 |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
360 |
;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
361 |
amd64|ppc64|s390x|sparcv9|ia64|alpha) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
362 |
ARCH_DATA_MODEL=64 |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
363 |
;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
364 |
*) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
365 |
echo "ERROR: Unable to determine ARCH_DATA_MODEL for ${ZERO_LIBARCH}" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
366 |
exit 1 |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
367 |
esac |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
368 |
export ARCH_DATA_MODEL |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
369 |
|
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
370 |
# ZERO_ENDIANNESS is the endianness of the processor |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
371 |
case "${ZERO_LIBARCH}" in |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
372 |
i386|amd64|ia64) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
373 |
ZERO_ENDIANNESS=little |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
374 |
;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
375 |
ppc*|s390*|sparc*|alpha) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
376 |
ZERO_ENDIANNESS=big |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
377 |
;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
378 |
*) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
379 |
echo "ERROR: Unable to determine ZERO_ENDIANNESS for ${ZERO_LIBARCH}" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
380 |
exit 1 |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
381 |
esac |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
382 |
export ZERO_ENDIANNESS |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
383 |
|
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
384 |
# ZERO_ARCHDEF is used to enable architecture-specific code |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
385 |
case "${ZERO_LIBARCH}" in |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
386 |
i386) ZERO_ARCHDEF=IA32 ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
387 |
ppc*) ZERO_ARCHDEF=PPC ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
388 |
s390*) ZERO_ARCHDEF=S390 ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
389 |
sparc*) ZERO_ARCHDEF=SPARC ;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
390 |
*) ZERO_ARCHDEF=$(echo "${ZERO_LIBARCH}" | tr a-z A-Z) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
391 |
esac |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
392 |
export ZERO_ARCHDEF |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
393 |
|
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
394 |
# ZERO_ARCHFLAG tells the compiler which mode to build for |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
395 |
case "${ZERO_LIBARCH}" in |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
396 |
s390) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
397 |
ZERO_ARCHFLAG="-m31" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
398 |
;; |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
399 |
*) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
400 |
ZERO_ARCHFLAG="-m${ARCH_DATA_MODEL}" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
401 |
esac |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
402 |
export ZERO_ARCHFLAG |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
403 |
|
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
404 |
# LIBFFI_CFLAGS and LIBFFI_LIBS tell the compiler how to compile and |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
405 |
# link against libffi |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
406 |
pkgconfig=$(which pkg-config 2>/dev/null) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
407 |
if [ -x "${pkgconfig}" ] ; then |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
408 |
if [ "${LIBFFI_CFLAGS}" = "" ] ; then |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
409 |
LIBFFI_CFLAGS=$("${pkgconfig}" --cflags libffi) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
410 |
fi |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
411 |
if [ "${LIBFFI_LIBS}" = "" ] ; then |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
412 |
LIBFFI_LIBS=$("${pkgconfig}" --libs libffi) |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
413 |
fi |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
414 |
fi |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
415 |
if [ "${LIBFFI_LIBS}" = "" ] ; then |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
416 |
LIBFFI_LIBS="-lffi" |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
417 |
fi |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
418 |
export LIBFFI_CFLAGS |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
419 |
export LIBFFI_LIBS |
ffc9c33335f4
6891677: java/build integrate zero assembler JDK changes
gbenson
parents:
2300
diff
changeset
|
420 |
fi |