Fri, 29 Apr 2016 00:06:10 +0800
Added MIPS 64-bit port.
1 #!/bin/sh
2 #
3 # Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # This code is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License version 2 only, as
8 # published by the Free Software Foundation.
9 #
10 # This code is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # version 2 for more details (a copy is included in the LICENSE file that
14 # accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License version
17 # 2 along with this work; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 # or visit www.oracle.com if you need additional information or have any
22 # questions.
23 #
24 #
26 #
27 # This file has been modified by Loongson Technology in 2015. These
28 # modifications are Copyright (c) 2015 Loongson Technology, and are made
29 # available on the same license terms set forth above.
30 #
32 # This file sets common environment variables for all SA scripts
34 OS=`uname`
35 STARTDIR=`(cd \`dirname $0 \`; pwd)`
36 ARCH=`uname -m`
38 if [ "x$SA_JAVA" = "x" ]; then
39 SA_JAVA=java
40 fi
42 if [ "$OS" = "Linux" ]; then
43 if [ "$ARCH" = "ia64" ] ; then
44 SA_LIBPATH=$STARTDIR/../src/os/linux/ia64:$STARTDIR/linux/ia64
45 OPTIONS="-Dsa.library.path=$SA_LIBPATH"
46 CPU=ia64
47 elif [ "$ARCH" = "x86_64" ] ; then
48 SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64
49 OPTIONS="-Dsa.library.path=$SA_LIBPATH"
50 CPU=amd64
51 elif [ "$ARCH" = "mips64" ] ; then
52 SA_LIBPATH=$STARTDIR/../src/os/linux/mips:$STARTDIR/linux/mips
53 OPTIONS="-Dsa.library.path=$SA_LIBPATH"
54 CPU=mips
55 else
56 SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
57 OPTIONS="-Dsa.library.path=$SA_LIBPATH"
58 CPU=i386
59 fi
60 else
61 # configure audit helper library if SA_ALTROOT is set
62 if [ -n "$SA_ALTROOT" ]; then
63 LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
64 export LD_AUDIT_32
65 if [ ! -f $LD_AUDIT_32 ]; then
66 echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
67 echo "Make sure to build it with 'make natives'."
68 exit 1
69 fi
70 fi
71 SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
72 OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
73 CPU=sparc
74 fi
76 if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then
77 OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}"
78 fi
81 SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar
83 if [ ! -z "$SA_TYPEDB" ]; then
84 if [ ! -f $SA_TYPEDB ]; then
85 echo "$SA_TYPEDB is unreadable"
86 exit 1
87 fi
88 OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}"
89 fi
91 OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
93 SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS"