summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-10-13 13:38:17 +0000
committermichelou <michelou@epfl.ch>2005-10-13 13:38:17 +0000
commitdae93b66ed75b9cdd6bda182cbd89482e5136a1f (patch)
treebd4ba14fc67e28089b61a9f1abe20e8a3eb207d5
parent67dc2eddbce2efaa777467ad25629ee7fa3e75c6 (diff)
downloadscala-dae93b66ed75b9cdd6bda182cbd89482e5136a1f.tar.gz
scala-dae93b66ed75b9cdd6bda182cbd89482e5136a1f.tar.bz2
scala-dae93b66ed75b9cdd6bda182cbd89482e5136a1f.zip
- 1st attempt.
-rw-r--r--build.support/scalac.bat.template39
-rwxr-xr-xbuild.support/scalac.template50
2 files changed, 89 insertions, 0 deletions
diff --git a/build.support/scalac.bat.template b/build.support/scalac.bat.template
new file mode 100644
index 0000000000..e2d9540439
--- /dev/null
+++ b/build.support/scalac.bat.template
@@ -0,0 +1,39 @@
+@echo off
+
+rem ##########################################################################
+rem # Copyright (C) 2002-2005 LAMP/EPFL
+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
+rem # PARTICULAR PURPOSE.
+rem ##########################################################################
+
+if "%OS%"=="Windows_NT" @setlocal
+
+if "%SCALA_HOME%" == "" goto error1
+
+set _ARGS=
+:loop
+if '%1' == '' goto exec
+set _ARGS=%_ARGS% %1
+shift
+goto loop
+
+:exec
+set _JAVACMD=java
+set _PROPS=-Dscala.product=@PRODUCT@ -Dscala.version=@VERSION@
+set _MAIN=@MAIN@
+set _CPATH=@CPATH@
+
+rem echo %_JAVACMD% %_PROPS% -cp %_CPATH% %_MAIN% %_ARGS%
+%_JAVACMD% %_PROPS% -cp %_CPATH% %_MAIN% %_ARGS%
+
+rem ##########################################################################
+rem # errors
+
+:error1
+echo ERROR: environment variable SCALA_HOME is undefined. It should point to the directory containing the file %_VERSION%.
+goto end
+
+:end
+if "%OS%"=="Windows_NT" @endlocal
diff --git a/build.support/scalac.template b/build.support/scalac.template
new file mode 100755
index 0000000000..1b992351f6
--- /dev/null
+++ b/build.support/scalac.template
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (C) 2002-2005 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;
+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`;
+
+_JAVACMD=java
+_PROPS="-Dscala.product=@PRODUCT@ -Dscala.version=@VERSION@"
+_MAIN=@MAIN@
+_CPATH=@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
+
+#echo $_JAVACMD $_PROPS -cp "$_CPATH" $_MAIN "$@"
+$_JAVACMD $_PROPS -cp "$_CPATH" $_MAIN "$@"