#!/bin/sh

# If changing jarFile or java definitions: there must not be any space
# characters either before or after the equals sign.  Important note: you must
# use *forward* slashes in the pathnames below (for jarFile and java) -- even
# if you are using win95.

# The full path of the jar file.
jarFile=/usr/pkg/share/jdeps/jdeps.jar

# Check if java is in the user's PATH.
if type java 1>/dev/null 2>&1; then
    java=java
else
    java=/usr/pkg/java/openjdk17/bin/java
fi

# For win95, all kinds of weird things happen with make & bash if
# the directory separator is *not* a double-backslash.
if [ "$OSTYPE" = win32 ]; then
    args=`echo "$@" | sed 's,/,\\\\\\\\,g'`
else
    args="$@"
fi

if [ -z ${CLASSPATH:=""} ] ; then
    CLASSPATH=${jarFile}
else
    CLASSPATH=${jarFile}:${CLASSPATH}
fi
export CLASSPATH

exec $java smr.JavaDeps.JavaDeps $args


