blob: 3e22fa6e1e2f9ed35190fde1f14eac8b60931542 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/bin/sh
##############################################################################
# Copyright 2002-2009, LAMP/EPFL
#
# 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;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
# Finding the root folder for this Scala distribution
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;
# see #2092
SCALA_HOME=`dirname "$SOURCE"`
SCALA_HOME=`cd "$SCALA_HOME"; pwd -P`
SCALA_HOME=`cd "$SCALA_HOME"/..; pwd`
# Remove spaces from SCALA_HOME on windows
if $cygwin; then
SCALA_HOME=`cygpath --windows --short-name "$SCALA_HOME"`
SCALA_HOME=`cygpath --unix "$SCALA_HOME"`
fi
# Constructing the extension classpath
TOOL_CLASSPATH="@classpath@"
if [ -z "$TOOL_CLASSPATH" ] ; then
for ext in "$SCALA_HOME"/lib/* ; do
if [ -z "$TOOL_CLASSPATH" ] ; then
TOOL_CLASSPATH="$ext"
else
TOOL_CLASSPATH="$TOOL_CLASSPATH:$ext"
fi
done
fi
if $cygwin; then
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
format=mixed
else
format=windows
fi
SCALA_HOME=`cygpath --$format "$SCALA_HOME"`
TOOL_CLASSPATH=`cygpath --path --$format "$TOOL_CLASSPATH"`
fi
# Reminder: substitution ${JAVA_OPTS:=-Xmx256M -Xms16M} DO NOT work on Solaris
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="@javaflags@"
if [ -z "$JAVACMD" -a -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
fi
exec "${JAVACMD:=java}" $JAVA_OPTS -cp "$TOOL_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.emacs="$EMACS" @properties@ @class@ @toolflags@ "$@@"
|