blob: 814cf69f9df17fb897b31fc2ea0fa6014d997199 (
plain) (
tree)
|
|
#!/bin/bash
##############################################################################
# Copyright @COPYRIGHT@
#
# This is free software; see the distribution for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
##############################################################################
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true ;;
esac
SOURCE=$0;
SCRIPT=`basename "$SOURCE"`;
while [ -h "$SOURCE" ]; do
SCRIPT=`basename "$SOURCE"`;
LOOKUP=`ls -ld "$SOURCE"`;
TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`;
if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then
SOURCE=${TARGET:-.};
else
SOURCE=`dirname "$SOURCE"`/${TARGET:-.};
fi;
done;
PREFIX=`dirname "$SOURCE"`/..;
prefix=$PREFIX;
PREFIX=`cd "$PREFIX"; pwd`;
if [ -z "$SCRIPT" ]; then
abort "Illegal direct invocation; invoke me through a symbolic link.";
fi;
_JAVACMD=java
_TOOLS_CPATH=@TOOLS_CPATH@
_LIB_CPATH=@LIB_CPATH@
# For Cygwin, switch paths to appropriate format before running java
if $cygwin; then
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
format=mixed
else
format=windows
fi
_CPATH=`cygpath --path --$format "$_CPATH"`
fi
main=
case "$SCRIPT" in
scala ) ;;
scalac* ) main=scala.tools.nsc.Main;;
scaladoc* ) main=scala.tools.scaladoc.Main;;
scalap* ) main=scala.tools.scalap.Main;;
* ) abort "Don't know what to do for $SCRIPT.";;
esac;
if [ -z "$main" ]; then
for arg in "" "$@"; do
[ -z "$arg" ] && continue;
if [ "$arg" = "-version" ]; then
echo "$SCRIPT @VERSION@ -- @COPYRIGHT@";
exit 0
fi
done;
$_JAVACMD \
-Xbootclasspath/a:"$_LIB_CPATH" \
"$@"
else
$_JAVACMD \
-Dscala.product="$SCRIPT" \
-Dscala.version="@VERSION@" \
-Dscala.home="$PREFIX" \
-cp "$_TOOLS_CPATH" \
$main "$@"
fi
|