summaryrefslogtreecommitdiffstats
path: root/src/scripts/jcpp
diff options
context:
space:
mode:
authorShevek <[email protected]>2008-05-07 22:58:16 +0000
committerShevek <[email protected]>2008-05-07 22:58:16 +0000
commitca99dd29fad24a8b928439e08b10a58dc2c691d1 (patch)
treeb054bab4f6f42e11c6bfadedcb71ae9f187f99a0 /src/scripts/jcpp
parent4f32369bf3db4c2b62507a3473bf4c012b2b6871 (diff)
more to date for 2.0
Diffstat (limited to 'src/scripts/jcpp')
-rwxr-xr-xsrc/scripts/jcpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/scripts/jcpp b/src/scripts/jcpp
new file mode 100755
index 0000000..ed167c5
--- /dev/null
+++ b/src/scripts/jcpp
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+CPP_JAR=anarres-cpp.jar
+
+if [ -n "$CPP_ROOT" ] ; then
+ CPP_ROOT="$CPP_ROOT"
+elif [ -f lib/$CPP_JAR ] ; then
+ CPP_ROOT="."
+elif [ -f ../lib/$CPP_JAR ] ; then
+ CPP_ROOT=".."
+elif [ -f $(dirname $0)/lib/$CPP_JAR ] ; then
+ CPP_ROOT=$(dirname $0)
+else
+ echo "Could not find $CPP_JAR. Please set CPP_ROOT."
+ exit 1
+fi
+
+if [ -z "$CPP_LIB" ] ; then
+ CPP_LIB=$CPP_ROOT/lib
+fi
+
+if [ -z "$CPP_CLASSPATH" ] ; then
+ CPP_CLASSPATH="$(ls $CPP_LIB/*.jar | tr '\n' ':')"
+fi
+
+if [ -z "$CPP_MAINCLASS" ] ; then
+ CPP_MAINCLASS=org.anarres.cpp.Main
+fi
+
+CPP_JFLAGS="-Xmx128M"
+
+exec java $CPP_JFLAGS -cp "$CPP_CLASSPATH" $CPP_MAINCLASS "$@"