From dae93b66ed75b9cdd6bda182cbd89482e5136a1f Mon Sep 17 00:00:00 2001 From: michelou Date: Thu, 13 Oct 2005 13:38:17 +0000 Subject: - 1st attempt. --- build.support/scalac.bat.template | 39 ++++++++++++++++++++++++++++++ build.support/scalac.template | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 build.support/scalac.bat.template create mode 100755 build.support/scalac.template 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 "$@" -- cgit v1.2.3