diff options
author | Sven Gothel <[email protected]> | 2010-05-04 02:43:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-05-04 02:43:09 +0200 |
commit | 63916148e837942c9ec996320bda805e80d7e06e (patch) | |
tree | e45c041c05cf1ba33c3cd3af9fc09fdec7eb5ec8 /make/scripts/setenv-jogl.sh | |
parent | 10c26e556006b5727b0076fc2e486459a63bdf76 (diff) |
Move all scripts to it's folder
Diffstat (limited to 'make/scripts/setenv-jogl.sh')
-rw-r--r-- | make/scripts/setenv-jogl.sh | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh new file mode 100644 index 000000000..f7d42a193 --- /dev/null +++ b/make/scripts/setenv-jogl.sh @@ -0,0 +1,98 @@ +#! /bin/sh + +function print_usage() { + echo "Usage: $0 jogl-build-dir" +} + +if [ -z "$1" ] ; then + echo JOGL BUILD DIR missing + print_usage + exit +fi + +if [ -e /devtools/etc/profile.ant ] ; then + . /devtools/etc/profile.ant +fi + +JOGL_PROFILE=JOGL_ALL + +JOGL_BUILDDIR=$1 +shift + +THISDIR=`pwd` + +if [ -e "$JOGL_BUILDDIR" ] ; then + JOGL_DIR=$JOGL_BUILDDIR/.. + JOGL_BUILDDIR_BASE=`basename $JOGL_BUILDDIR` +else + echo JOGL_BUILDDIR $JOGL_BUILDDIR not exist or not given + print_usage + exit +fi + +gpf=`find ../../gluegen/make -name dynlink-unix.cfg` +if [ -z "$gpf" ] ; then + gpf=`find .. -name dynlink-unix.cfg` +fi +if [ -z "$gpf" ] ; then + echo GLUEGEN_BUILDDIR not found + print_usage + exit +fi + +GLUEGEN_DIR=`dirname $gpf`/.. +GLUEGEN_BUILDDIR=$GLUEGEN_DIR/$JOGL_BUILDDIR_BASE +if [ ! -e "$GLUEGEN_BUILDDIR" ] ; then + echo GLUEGEN_BUILDDIR $GLUEGEN_BUILDDIR does not exist + print_usage + exit +fi +GLUEGEN_JAR=$GLUEGEN_BUILDDIR/gluegen-rt.jar +GLUEGEN_OS=$GLUEGEN_BUILDDIR/obj +JUNIT_JAR=$GLUEGEN_DIR/make/lib/junit-4.5.jar + +if [ -z "$ANT_PATH" ] ; then + if [ -e /usr/share/ant/bin/ant -a -e /usr/share/ant/lib/ant.jar ] ; then + ANT_PATH=/usr/share/ant + export ANT_PATH + echo autosetting ANT_PATH to $ANT_PATH + fi +fi +if [ -z "$ANT_PATH" ] ; then + echo ANT_PATH does not exist, set it + print_usage + exit +fi +ANT_JARS=$ANT_PATH/lib/ant.jar:$ANT_PATH/lib/ant-junit.jar + +echo GLUEGEN BUILDDIR: $GLUEGEN_BUILDDIR +echo JOGL DIR: $JOGL_DIR +echo JOGL BUILDDIR: $JOGL_BUILDDIR +echo JOGL BUILDDIR BASE: $JOGL_BUILDDIR_BASE +echo JOGL PROFILE: $JOGL_PROFILE + +J2RE_HOME=$(which java) +JAVA_HOME=$(which javac) +CP_SEP=: + +. $JOGL_DIR/etc/profile.jogl $JOGL_PROFILE $JOGL_BUILDDIR + +SWT_CLASSPATH=$HOME/.java/swt.jar +LIB=$THISDIR/lib + +CLASSPATH=.:$GLUEGEN_JAR:$JOGL_CLASSPATH:$SWT_CLASSPATH:$JUNIT_JAR:$ANT_JARS +for i in $LIB/*jar ; do + CLASSPATH=$CLASSPATH:$i +done +export CLASSPATH +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GLUEGEN_OS:$JOGL_LIB_DIR +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GLUEGEN_OS:$JOGL_LIB_DIR + +echo CLASSPATH: $CLASSPATH +echo +echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true" for running demos without AWT, e.g. NEWT +echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true com.jogamp.newt.util.MainThread" for running demos with NEWT + +PATH=$J2RE_HOME/bin:$JAVA_HOME/bin:$PATH +export PATH + |