次のページ 前のページ 目次へ

5. 付録

修正されたシェルスクリプト ${JWS_HOME}/intel-S2/bin/jws は次の通りです。

---8<-----8<--- cut here ---8<-----8<----
#!/bin/sh
#
# @(#)jws       1.64 96/05/02
#
# Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for NON-COMMERCIAL purposes and without
# fee is hereby granted provided that this copyright notice
# appears in all copies. Please refer to the file "copyright.html"
# for further important copyright and licensing information.
#
# SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
# THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
# ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
# DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
#

#
# Determine JWS_HOME
#
# edit by Mike Gaertner 06.09.1996 mg@genyosha.in-chemnitz.de
# Set environment-variable "JWS_HOME" and "JAVA_HOME" !
#
_SS_JDK_BIN=${JAVA_HOME}
_SS_JWS_HOME=${JWS_HOME}
#
_SS_JDK_HOME=$_SS_JDK_BIN
#
RUNCLASSPATH="$_SS_JDK_BIN/lib/classes.zip:$_SS_JDK_BIN/lib/classes"
#
NCLASSPATH="$_SS_JDK_BIN/lib/classes"
export LD_LIBRARY_PATH
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$J_HOME/lib/`arch`"


if [ -z "$_SS_JWS_HOME" ] ; then
    _SS_JWS_HOME=`dirname $0`
    _SS_JWS_HOME=`cd $_SS_JWS_HOME/../.. ; pwd`
    echo "_SS_JWS_HOME is set to $_SS_JWS_HOME"
fi

if [ ! -d "$_SS_JWS_HOME" ] ; then
    echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME" 1>&2
    exit 1
fi

if [ ! -r "$_SS_JWS_HOME/lib/properties" ] ; then
    echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME/lib/properties" 1>&2
    exit 1
fi

# Since JDK executables are installed into JWS, _SS_JDK_BIN is set to
# JWS/${VARIANT}/bin by default.  It might also point to a build or
# archive area.
if [ ! "${_SS_JDK_BIN}" ]
then
  if [ ${_SS_JDK_HOME} ]
  then
    _SS_JDK_BIN=${_SS_JDK_HOME}
  else
    _SS_JDK_BIN=$_SS_JWS_HOME/${VARIANT}
  fi
else
  # could be either an install JWS dir or JDK bin
  if [ -d ${_SS_JDK_BIN}/build ]
  then
    _SS_JDK_BIN=${_SS_JDK_BIN}/build
  elif [ -d ${_SS_JDK_BIN}/${VARIANT} ]
  then
    _SS_JDK_BIN=${_SS_JDK_BIN}/${VARIANT}
  fi
fi

# needs to be exported, because it is referenced by JWS builder
export  _SS_JDK_BIN

# assert: _SS_JDK_BIN points to the parent of lib
if [ ! -d ${_SS_JDK_BIN}/bin ]
then
  echo " By convention, _SS_JDK_BIN must have a bin subdirectory"
  echo " _SS_JDK_BIN:  ${_SS_JDK_BIN}"
  echo " ${_SS_JDK_BIN}/bin does not exits"
  exit
fi

# Given the root of a JDK tree, set _SS_JDK_HOME to the parent directory
#       of bin,classes and lib
#
# There are three types of JDK directories.
#       * build directories are identical to the JDK directory provide
#               by JavaSoft.  No a stable area.  Iteam members are
#               discouraged from relying on this area.
#       * archive directories simply copy all content from the build
#               directory that is to be shipped to the user.  On win32,
#               redist is moved to bin.
#       * installation directory - Since the contains of the JDK bin
#               directories have been moved to JWS, there is no bin dir
#               in the JDK tree.
#   jsk, 4-15-96

if [ ! "${_SS_JDK_HOME}" ]
then
  _SS_JDK_HOME=$_SS_JWS_HOME/../JDK
else
  if [ -d ${_SS_JDK_HOME}/build  ]
  then
    export _SS_JDK_HOME=${_SS_JDK_HOME}/build
  fi
fi

# assert: _SS_JDK_HOME points to the parent of classes
if [ ! -d ${_SS_JDK_HOME}/lib/classes ]
then
  echo " By convention, _SS_JDK_HOME must have a classes subdirectory"
  echo " _SS_JDK_HOME:  ${_SS_JDK_HOME}"
  echo " ${_SS_JDK_HOME}/lib does not exits"
  exit
fi

# assert: _SS_JDK_HOME points to the parent of lib
if [ ! -d ${_SS_JDK_HOME}/lib ]
then
  echo " By convention, _SS_JDK_HOME must have a lib subdirectory"
  echo " _SS_JDK_HOME:  ${_SS_JDK_HOME}"
  echo " ${_SS_JDK_HOME}/lib does not exits"
  exit
fi

if [ `/bin/uname -m` = "i386" ] ; then
  ARCH='i386'
elif [  `/bin/uname -m` = "i486" ] ; then
  ARCH='i486'
elif [  `/bin/uname -m` = "i586" ] ; then
  ARCH='i586'
fi

#
# Set Paths
#
#
# Create .jws directory
#

# backwards compatibility
if [ -d "$HOME/.jde" ] ; then
    if [ ! -d "$HOME/.jws" ] ; then
        echo "Moving $HOME/.jde to $HOME/.jws"
        mv $HOME/.jde $HOME/.jws
    fi
fi
if [ ! -d "$HOME/.jws" ] ; then
    echo "Creating $HOME/.jws directory"
    mkdir -p $HOME/.jws
fi

#
# Parse arguments
#  the -debug option is assumed to have a value associated with it.
#  transform '-debug <file>' to '-debug -Djws.startup.props=<file>'

prog=java
debug_opts="";
opts="";
while [ $# -ne 0 ]; do
   case "$1" in
    -debug) prog=java_g; debug_opts="-debug"; debug_prop="-Ddebug.browser=yes" ;;
    -*) opts="$opts $1" ;;
    *)  args="$args $1" ;;
   esac
   shift;
done

#
# Select a java interpreter
#

if [ -x "${_SS_JDK_BIN}/bin/$prog" ] ; then
    JAVA="${_SS_JDK_BIN}/bin/$prog"
else
    JAVA=$prog
fi

#
# Add WWW_HOME option
#
if [ ! -z "$WWW_HOME" ] ; then
    opts="$opts -Dwww.home=$WWW_HOME"
fi

JWSLOG=${JWSLOG:-$HOME/.jws/weblog}
export JWSLOG

exec $JAVA $debug_opts -classpath $RUNCLASSPATH \
-Djws.home=$_SS_JWS_HOME -Dhotjava.home=$_SS_JWS_HOME \
-Djws.bin=$JWS_BIN -Djdk.bin=${_SS_JDK_BIN}/bin \
-Djws.ut.user=$USER "-Djws.ut.platform=\"`uname -srm`\"" \
-Djws.build.classes=$NCLASSPATH $debug_prop $opts sun.jws.Main $args

---8<-----8<--- cut here ---8<-----8<----


次のページ 前のページ 目次へ