duke@435: #! /bin/sh duke@435: # trims@1907: # Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. duke@435: # duke@435: # duke@435: duke@435: # Make sure the variable JAVA_HOME is set before running this script. duke@435: duke@435: set -u duke@435: duke@435: duke@435: usage() { duke@435: ( duke@435: echo "Usage : $0 [-sb | -sbfast] config ws_path" duke@435: echo "" duke@435: echo "Where:" duke@435: echo " -sb ::= enable source browser info generation for" duke@435: echo " all configs during compilation" duke@435: echo "" duke@435: echo " -sbfast ::= enable source browser info generation for" duke@435: echo " all configs without compilation" duke@435: echo "" duke@435: echo " config ::= debug | debug1 | debugcore" duke@435: echo " fastdebug | fastdebug1 | fastdebugcore" duke@435: echo " jvmg | jvmg1 | jvmgcore" duke@435: echo " optimized | optimized1 | optimizedcore" duke@435: echo " profiled | profiled1 | profiledcore" duke@435: echo " product | product1 | productcore" duke@435: echo "" duke@435: echo " ws_path ::= path to HotSpot workspace" duke@435: ) >&2 duke@435: exit 1 duke@435: } duke@435: duke@435: # extract possible options duke@435: options="" duke@435: if [ $# -gt 2 ]; then duke@435: case "$1" in duke@435: -sb) duke@435: options="CFLAGS_BROWSE=-xsb" duke@435: shift duke@435: ;; duke@435: -sbfast) duke@435: options="CFLAGS_BROWSE=-xsbfast" duke@435: shift duke@435: ;; duke@435: *) duke@435: echo "Unknown option: '$1'" >&2 duke@435: usage duke@435: ;; duke@435: esac duke@435: fi duke@435: duke@435: # should be just two args left at this point duke@435: if [ $# != 2 ]; then duke@435: usage duke@435: fi duke@435: duke@435: # Just in case: duke@435: case ${JAVA_HOME} in duke@435: /*) true;; duke@435: ?*) JAVA_HOME=`( cd $JAVA_HOME; pwd )`;; duke@435: esac duke@435: duke@435: if [ "${JAVA_HOME}" = "" -o ! -d "${JAVA_HOME}" -o ! -d ${JAVA_HOME}/jre/lib/`uname -p` ]; then duke@435: echo "JAVA_HOME needs to be set to a valid JDK path" duke@435: echo "ksh : export JAVA_HOME=/net/tetrasparc/export/gobi/JDK1.2_fcs_V/solaris" duke@435: echo "csh : setenv JAVA_HOME /net/tetrasparc/export/gobi/JDK1.2_fcs_V/solaris" duke@435: exit 1 duke@435: fi duke@435: duke@435: duke@435: LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/`uname -p`:\ duke@435: ${JAVA_HOME}/jre/lib/`uname -p`/native_threads:${LD_LIBRARY_PATH-.} duke@435: duke@435: # This is necessary as long as we are using the old launcher duke@435: # with the new distribution format: duke@435: CLASSPATH=${JAVA_HOME}/jre/lib/rt.jar:${CLASSPATH-.} duke@435: duke@435: duke@435: for gm in gmake gnumake duke@435: do duke@435: if [ "${GNUMAKE-}" != "" ]; then break; fi duke@435: ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm duke@435: done duke@435: : ${GNUMAKE:?'Cannot locate the gnumake program. Stop.'} duke@435: duke@435: duke@435: echo "### ENVIRONMENT SETTINGS:" duke@435: export JAVA_HOME ; echo "JAVA_HOME=$JAVA_HOME" duke@435: export LD_LIBRARY_PATH ; echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" duke@435: export CLASSPATH ; echo "CLASSPATH=$CLASSPATH" duke@435: export GNUMAKE ; echo "GNUMAKE=$GNUMAKE" duke@435: echo "###" duke@435: duke@435: config=$1 duke@435: ws_path=$2 duke@435: duke@435: case ${ws_path} in duke@435: /*) true;; duke@435: ?*) ws_path=`(cd ${ws_path}; pwd)`;; duke@435: esac duke@435: duke@435: echo \ kamg@526: ${GNUMAKE} -f ${ws_path}/make/solaris/Makefile \ duke@435: $config GAMMADIR=${ws_path} $options kamg@526: ${GNUMAKE} -f ${ws_path}/make/solaris/Makefile \ duke@435: $config GAMMADIR=${ws_path} $options