diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-05 08:07:17 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-05 08:07:17 -0800 |
commit | 3b65ef1c8777509c46c241bdb4ef5764d1194b0c (patch) | |
tree | 1780218e860c5fe0919dc205e18ad2cd675862ee /src/compiler | |
parent | b77b85eef2079ffc10c94d5cb8c62276455fc3d1 (diff) | |
parent | 2393d7439903720e9ba5427d1351a3c158ef53e1 (diff) | |
download | scala-3b65ef1c8777509c46c241bdb4ef5764d1194b0c.tar.gz scala-3b65ef1c8777509c46c241bdb4ef5764d1194b0c.tar.bz2 scala-3b65ef1c8777509c46c241bdb4ef5764d1194b0c.zip |
Merge remote-tracking branch 'szeiger/fix/scala-script-on-mingw'
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 4275ef7ba1..7e51930fa4 100644 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -58,12 +58,17 @@ if uname | grep -q ^CYGWIN; then cygwin="$(uname)" fi +unset mingw +if uname | grep -q ^MINGW; then + mingw="$(uname)" +fi + # Finding the root folder for this Scala distribution SCALA_HOME="$(findScalaHome)" SEP=":" # Possible additional command line options -CYGWIN_OPT="" +WINDOWS_OPT="" EMACS_OPT="" [[ -n "$EMACS" ]] && EMACS_OPT="-Denv.emacs=$EMACS" @@ -94,10 +99,16 @@ if [[ -n "$cygwin" ]]; then fi SCALA_HOME="$(cygpath --$format "$SCALA_HOME")" TOOL_CLASSPATH="$(cygpath --path --$format "$TOOL_CLASSPATH")" +elif [[ -n "$mingw" ]]; then + SCALA_HOME="$(cmd //c echo "$SCALA_HOME")" + TOOL_CLASSPATH="$(cmd //c echo "$TOOL_CLASSPATH")" +fi + +if [[ -n "$cygwin$mingw" ]]; then case "$TERM" in rxvt* | xterm*) stty -icanon min 1 -echo - CYGWIN_OPT="-Djline.terminal=scala.tools.jline.UnixTerminal" + WINDOWS_OPT="-Djline.terminal=scala.tools.jline.UnixTerminal" ;; esac fi @@ -110,9 +121,10 @@ fi declare -a java_args declare -a scala_args -# default to the boot classpath for speed, except on cygwin/mingw. +# default to the boot classpath for speed, except on cygwin/mingw because +# JLine on Windows requires a custom DLL to be loaded. unset usebootcp -if [[ -z $cygwin ]]; then +if [[ -z "$cygwin$mingw" ]]; then usebootcp="true" fi @@ -181,7 +193,7 @@ execCommand \ -Dscala.home="$SCALA_HOME" \ -Dscala.usejavacp=true \ $EMACS_OPT \ - $CYGWIN_OPT \ + $WINDOWS_OPT \ @properties@ @class@ @toolflags@ "$@@" # record the exit status lest it be overwritten: |