From ea3e1b949dcbdc09518f17eee0bcf21d41d76896 Mon Sep 17 00:00:00 2001 From: Kenny Ballou Date: Mon, 19 Nov 2018 22:59:50 -0700 Subject: OJ (aka OpenJava) modernization/mirroring Signed-off-by: Kenny Ballou --- bin/ojc.bat | 1 + bin/ojc.ksh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ bin/ojc.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 bin/ojc.bat create mode 100755 bin/ojc.ksh create mode 100755 bin/ojc.sh (limited to 'bin') diff --git a/bin/ojc.bat b/bin/ojc.bat new file mode 100644 index 0000000..712e945 --- /dev/null +++ b/bin/ojc.bat @@ -0,0 +1 @@ +java -classpath .;c:%OPENJAVA_HOME%\classes openjava.ojc.Main %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/bin/ojc.ksh b/bin/ojc.ksh new file mode 100755 index 0000000..9841c85 --- /dev/null +++ b/bin/ojc.ksh @@ -0,0 +1,47 @@ +#! /bin/ksh +# +# ojc +# +# This translates and compile the files into byte codes. +# +# Oct 25, 1997 by Michiaki Tatsubori + +# Please set up followings to be suitable for your enviroment. +JVM=java + + +# Get path to this program +PRG=`whence $0` >/dev/null 2>&1 +# Resolve symlinks. See 4152645. +while [ -h "$PRG" ]; do + ls=`/usr/bin/ls -ld "$PRG"` + link=`/usr/bin/expr "$ls" : '^.*-> \(.*\)$'` + if /usr/bin/expr "$link" : '^/' > /dev/null; then + prg="$link" + else + prg="`/usr/bin/dirname $PRG`/$link" + fi + PRG=`whence "$prg"` > /dev/null 2>&1 +done +OPENJAVA_HOME=`dirname ${PRG}`/.. + +CLASSPATH=${OPENJAVA_HOME}/classes:${CLASSPATH} +export CLASSPATH + + +# Pick out options for JVM +# i.e. -J"-classpath /home/classes" +JVMOPTS= +OJARGS= +for arg in $*; do + if [ ${arg} != ${arg#-J} ]; then + JVMOPTS="${JVMOPTS} ${arg#-J}" + else + OJARGS="${OJARGS} ${arg}" + fi +done + + +# Execute +echo ${JVM} ${JVMOPTS} openjava.ojc.Main ${OJARGS} +${JVM} ${JVMOPTS} openjava.ojc.Main ${OJARGS} diff --git a/bin/ojc.sh b/bin/ojc.sh new file mode 100755 index 0000000..a83cb73 --- /dev/null +++ b/bin/ojc.sh @@ -0,0 +1,48 @@ +#! /bin/sh +# +# ojc +# +# This translates and compile the files into byte codes. +# This is a shell script for linux or some unix-like systems, +# which do not have ksh. +# +# Sep 21, 2000 by Michiaki Tatsubori + +# Please set up followings to be suitable for your enviroment. +JVM=java + +if [ "$OPENJAVA_HOME" = "" ] ; then + PRG=$0 + progname=`basename $0` + while [ -L "$PRG" ]; do + ls=`/bin/ls -ld "$PRG"` + link=`/usr/bin/expr "$ls" : '.*-> \(.*\)$'` + if /usr/bin/expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`/usr/bin/dirname $PRG`/$link" + fi + done + OPENJAVA_HOME=`dirname ${PRG}`/.. +fi + +CLASSPATH=${OPENJAVA_HOME}/classes:${CLASSPATH} +export CLASSPATH + + +# Pick out options for JVM +# i.e. -J"-classpath /home/classes" +JVMOPTS=-classpath ${CLASSPATH} +OJARGS= +for arg in $*; do + if [ ${arg} != ${arg#-J} ]; then + JVMOPTS="${JVMOPTS} ${arg#-J}" + else + OJARGS="${OJARGS} ${arg}" + fi +done + + +# Execute +echo ${JVM} ${JVMOPTS} openjava.ojc.Main ${OJARGS} +${JVM} ${JVMOPTS} openjava.ojc.Main ${OJARGS} -- cgit v1.2.1