#!/bin/sh # # Shell script that starts up the Java Pxgraph plotter # Author: Christopher Hylands # Version: $Id: ptplot.in,v 1.1 1998/11/19 16:52:57 cxh Exp $ # # Copyright (c) 1998 The Regents of the University of California. # All Rights Reserved. # # Permission is hereby granted, without written agreement and without # license or royalty fees, to use, copy, modify, and distribute this # software and its documentation for any purpose, provided that the # above copyright notice and the following two paragraphs appear in all # copies of this software. # # IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY # FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES # ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF # THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE # PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF # CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, # ENHANCEMENTS, OR MODIFICATIONS. # # PT_COPYRIGHT_VERSION_2 # COPYRIGHTENDKEY # If this script is named 'ptplot' or 'pxgraph' don't edit it! # instead, edit ptplot.in and run configure # # configure substitutes in variables that are surrounded with @, # # Location of the Ptolemy II tree. The plot directory should be found # at $PTIIDEFAULT/ptolemy/plot PTII_DEFAULT=/users/cxh/ptII PTJAVA_DIR=/usr/java1.1 ################ # You probably don't want to edit below here if [ -z "$PTII" ]; then if [ -d "$PTII_DEFAULT" ]; then PTII="$PTII_DEFAULT" export PTII fi fi if [ ! -f $PTII/ptolemy/plot/ptolemy.plot.jar ]; then echo "$0: Warning, $PTII/java/ptolemy/plot/ptolemy.plot.jar does not exist" echo " Perhaps you need to install ptplot or edit the variables in $0?" fi # We can start up either Pxgraph or PlotApplication here if [ "`basename $0`" = "pxgraph" ]; then javastartupclass=ptolemy.plot.Pxgraph else javastartupclass=ptolemy.plot.PlotApplication fi windows=no case "${OSTYPE-no}" in [Ll]inux) if [ "${JAVA_HOME-no}" != "no" ]; then JAVAHOME="$JAVA_HOME" export JAVAHOME fi;; cygwin32*) windows=yes;; esac if [ -z "$JAVAHOME" ]; then if [ -d "$PTJAVA_DIR" ]; then JAVAHOME="$PTJAVA_DIR" export JAVAHOME else if [ "$windows" = "yes" ]; then searchfile=javac.exe else searchfile=javac fi oldifs="$IFS"; IFS=":" for i in $PATH do if [ -x "$i/$searchfile" -a ! -d "$i/$searchfile" ]; then JAVAHOME=`dirname $i` export JAVAHOME break fi done IFS="$oldifs" fi if [ -z "$JAVAHOME" ]; then if [ -d "/usr/eesww/lang/jdk1.1latest" ]; then # Locally, Java can sometimes be found here. JAVAHOME=/usr/eesww/lang/jdk1.1latest fi fi if [ -z "$JAVAHOME" ]; then echo "$0: Could not find $searchfile in your \$PATH" echo " Please set \$JAVAHOME to the directory that contains your" echo " Java distribution" exit 3 fi if [ ! -r "$JAVAHOME/lib/classes.zip" \ -a ! -d "$JAVAHOME/classes" \ -a ! -f "$JAVAHOME/lib/tools.jar" ]; then # DEC alpha has the classes in $JAVAHOME/classes echo "$0: \$JAVAHOME == $JAVAHOME, but $JAVAHOME/lib/classes.zip" echo " and $JAVAHOME/classes do not exist or are not readable." echo " Please set \$JAVAHOME to the directory that contains your" echo " Java distribution" exit 3 fi fi if [ "$windows" = "yes" ]; then # Windows via Cygwin32 # chdir prints the current directory in DOS format. # The tr command deletes the \r at the end WINPTII=`(cd $PTII; cmd /c chdir) | tr -d '\r'` $JAVAHOME/bin/java -classpath $WINPTII\;$JAVAHOME\\lib\\classes.zip $javastartupclass ${1+"$@"} elif [ "$PTARCH" = "alpha4" ]; then CLASSPATH=$PTII export CLASSPATH java $javastartupclass ${1+"$@"} else $JAVAHOME/bin/java -classpath $PTII:$JAVAHOME/lib/classes.zip $javastartupclass ${1+"$@"} fi