agent/make/saenv.sh

changeset 0
f90c822e73f8
child 1
2d8a650513c2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/agent/make/saenv.sh	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,83 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 +#
     1.9 +# This code is free software; you can redistribute it and/or modify it
    1.10 +# under the terms of the GNU General Public License version 2 only, as
    1.11 +# published by the Free Software Foundation.
    1.12 +#
    1.13 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.15 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.16 +# version 2 for more details (a copy is included in the LICENSE file that
    1.17 +# accompanied this code).
    1.18 +#
    1.19 +# You should have received a copy of the GNU General Public License version
    1.20 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.22 +#
    1.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.24 +# or visit www.oracle.com if you need additional information or have any
    1.25 +# questions.
    1.26 +#  
    1.27 +#
    1.28 +
    1.29 +# This file sets common environment variables for all SA scripts
    1.30 +
    1.31 +OS=`uname`
    1.32 +STARTDIR=`(cd \`dirname $0 \`; pwd)`
    1.33 +ARCH=`uname -m`
    1.34 +
    1.35 +if [ "x$SA_JAVA" = "x" ]; then
    1.36 +   SA_JAVA=java
    1.37 +fi
    1.38 +
    1.39 +if [ "$OS" = "Linux" ]; then
    1.40 +   if [ "$ARCH" = "ia64" ] ; then
    1.41 +     SA_LIBPATH=$STARTDIR/../src/os/linux/ia64:$STARTDIR/linux/ia64
    1.42 +     OPTIONS="-Dsa.library.path=$SA_LIBPATH"
    1.43 +     CPU=ia64
    1.44 +   elif [ "$ARCH" = "x86_64" ] ; then 
    1.45 +     SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64
    1.46 +     OPTIONS="-Dsa.library.path=$SA_LIBPATH"
    1.47 +     CPU=amd64
    1.48 +   else
    1.49 +     SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
    1.50 +     OPTIONS="-Dsa.library.path=$SA_LIBPATH"
    1.51 +     CPU=i386
    1.52 +   fi
    1.53 +else
    1.54 +   # configure audit helper library if SA_ALTROOT is set
    1.55 +   if [ -n "$SA_ALTROOT" ]; then
    1.56 +     LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
    1.57 +     export LD_AUDIT_32
    1.58 +     if [ ! -f $LD_AUDIT_32 ]; then
    1.59 +       echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
    1.60 +       echo "Make sure to build it with 'make natives'."
    1.61 +       exit 1
    1.62 +     fi
    1.63 +   fi
    1.64 +   SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
    1.65 +   OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
    1.66 +   CPU=sparc
    1.67 +fi
    1.68 +
    1.69 +if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then
    1.70 +   OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}"
    1.71 +fi
    1.72 +
    1.73 +
    1.74 +SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar
    1.75 +
    1.76 +if [ ! -z "$SA_TYPEDB" ]; then
    1.77 +  if [ ! -f $SA_TYPEDB ]; then
    1.78 +    echo "$SA_TYPEDB is unreadable"
    1.79 +    exit 1
    1.80 +  fi
    1.81 +  OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}"
    1.82 +fi
    1.83 +
    1.84 +OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}"
    1.85 +
    1.86 +SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS"

mercurial