diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2005-12-19 17:17:19 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2005-12-19 17:17:19 +0000 |
commit | 341c62a27b84dbd00c7fa740ba9608e33c50bc74 (patch) | |
tree | c081370b93f67776e7f64c9ce561245f65b780ed /src | |
parent | d8fdc6daf9486bc9884dbd695146821b773142fd (diff) | |
download | scala-341c62a27b84dbd00c7fa740ba9608e33c50bc74.tar.gz scala-341c62a27b84dbd00c7fa740ba9608e33c50bc74.tar.bz2 scala-341c62a27b84dbd00c7fa740ba9608e33c50bc74.zip |
1.
2. Scripts no longer use the wrapper script but are self-contained.
Diffstat (limited to 'src')
-rw-r--r-- | src/exec/nscala.unix.tmpl | 81 | ||||
-rw-r--r-- | src/exec/scala-tool.unix.tmpl | 42 | ||||
-rw-r--r-- | src/exec/scala-tool.win.tmpl (renamed from src/exec/nscala-tool.win.tmpl) | 19 | ||||
-rw-r--r-- | src/exec/scala.unix.tmpl | 44 | ||||
-rw-r--r-- | src/exec/scala.win.tmpl (renamed from src/exec/nscala.win.tmpl) | 0 |
5 files changed, 93 insertions, 93 deletions
diff --git a/src/exec/nscala.unix.tmpl b/src/exec/nscala.unix.tmpl deleted file mode 100644 index 759450b7c4..0000000000 --- a/src/exec/nscala.unix.tmpl +++ /dev/null @@ -1,81 +0,0 @@ -#!/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=@fjbg.jar@:@msil.jar@:@comp.path@:@lib.path@ -_LIB_CPATH=@lib.path@ - -# 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 - _TOOLS_CPATH=`cygpath --path --$format "$_TOOLS_CPATH"` - _LIB_CPATH=`cygpath --path --$format "$_LIB_CPATH"` -fi - -main= -case "$SCRIPT" in - @scala.exec.name@ ) ;; - @scalac.exec.name@ ) main=scala.tools.nsc.Main;; - @scalai.exec.name@ ) main=scala.tools.nsc.MainInterpreter;; - @scalatok.exec.name@ ) main=scala.tools.nsc.MainTokenMetric;; - * ) 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 \ - -Xms16M -Xmx256M \ - -Dscala.product="$SCRIPT" \ - -Dscala.version="@version@" \ - -Dscala.home="$PREFIX" \ - -cp "$_TOOLS_CPATH" \ - $main -sourcepath "$_LIB_CPATH" "$@" -fi diff --git a/src/exec/scala-tool.unix.tmpl b/src/exec/scala-tool.unix.tmpl new file mode 100644 index 0000000000..1be39c4fe1 --- /dev/null +++ b/src/exec/scala-tool.unix.tmpl @@ -0,0 +1,42 @@ +#!/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 + +PREFIX=`dirname "$0"`/..; +PREFIX=`cd "$PREFIX"; pwd`; + +JAVA=java +JAVA_CLASSPATH=@fjbg.jar@:@msil.jar@:@comp.path@:@lib.path@ +TOOL=@tool.class@ +TOOL_CLASSPATH=@lib.path@ + +# 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 + JAVA_CLASSPATH=`cygpath --path --$format "$JAVA_CLASSPATH"` + TOOL_CLASSPATH=`cygpath --path --$format "$TOOL_CLASSPATH"` +fi + +$JAVA \ + -Xms16M -Xmx256M \ + -Dscala.version="20051219-1541" \ + -Dscala.home="$PREFIX" \ + -cp "$JAVA_CLASSPATH" \ + "$TOOL" -bootclasspath "$TOOL_CLASSPATH" "$@"
\ No newline at end of file diff --git a/src/exec/nscala-tool.win.tmpl b/src/exec/scala-tool.win.tmpl index ff9f7475c5..2f8cfd79ae 100644 --- a/src/exec/nscala-tool.win.tmpl +++ b/src/exec/scala-tool.win.tmpl @@ -1,7 +1,7 @@ @echo off rem ########################################################################## -rem # Copyright @COPYRIGHT@ +rem # Copyright @copyright@ rem # rem # This is free software; see the distribution for copying conditions. rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A @@ -12,7 +12,6 @@ if "%OS%"=="Windows_NT" @setlocal if "%OS%"=="Windows_NT" @set SCALA_HOME=%~dp0 if "%SCALA_HOME%" == "" goto error1 -if not exist "%SCALA_HOME%\VERSION-@VERSION@" goto error2 set _ARGS= :loop @@ -23,24 +22,20 @@ goto loop :exec set _JAVACMD=java -set _PROPS=-Dscala.product=@PRODUCT@ -Dscala.version=@VERSION@ -set _MAIN=@MAIN@ -set _TOOLS_CPATH=@TOOLS_CPATH@ -set _LIB_CPATH=@LIB_CPATH@ +set _PROPS=-Dscala.version=@version@ -Dscala.home=%SCALA_HOME% +set _MAIN=@tool.class@ +set _TOOLS_CPATH=@fjbg.jar@;@msil.jar@;@comp.path@;@lib.path@ +set _LIB_CPATH=@lib.path@ rem echo %_JAVACMD% %_PROPS% -cp %_CPATH% %_MAIN% %_ARGS% -%_JAVACMD% %_PROPS% -cp %_TOOLS_CPATH% %_MAIN% -sourcepath %_LIB_CPATH% %_ARGS% +%_JAVACMD% %_PROPS% -cp %_TOOLS_CPATH% %_MAIN% -bootclasspath %_LIB_CPATH% %_ARGS% goto end rem ########################################################################## rem # errors :error1 -echo ERROR: environment variable SCALA_HOME is undefined. It should point to the directory containing the file "VERSION-@VERSION@". -goto end - -:error2 -echo ERROR: environment variable SCALA_HOME points to the wrong directory "%SCALA_HOME%". It should point to the directory containing the file "VERSION-@VERSION@". +echo ERROR: environment variable SCALA_HOME is undefined. It should point to the directory containing the file "VERSION-@version@". goto end :end diff --git a/src/exec/scala.unix.tmpl b/src/exec/scala.unix.tmpl new file mode 100644 index 0000000000..bbc2f55e93 --- /dev/null +++ b/src/exec/scala.unix.tmpl @@ -0,0 +1,44 @@ +#!/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 + +PREFIX=`dirname "$0"`/..; +PREFIX=`cd "$PREFIX"; pwd`; + +JAVA=java +JAVA_CLASSPATH=@lib.path@ + +# 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 + JAVA_CLASSPATH=`cygpath --path --$format "$JAVA_CLASSPATH"` +fi + +for arg in "" "$@"; do + [ -z "$arg" ] && continue; + if [ "$arg" = "-version" ]; then + echo "$SCRIPT @version@ -- @copyright@"; + exit 0 + fi +done; + +$JAVA \ + -Xbootclasspath/a:"$JAVA_CLASSPATH" \ + "$@" diff --git a/src/exec/nscala.win.tmpl b/src/exec/scala.win.tmpl index feb4655e0f..feb4655e0f 100644 --- a/src/exec/nscala.win.tmpl +++ b/src/exec/scala.win.tmpl |