summaryrefslogtreecommitdiffstats
path: root/setenv-jogl.sh
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-07-01 07:34:59 +0000
committerSven Gothel <[email protected]>2009-07-01 07:34:59 +0000
commitdbf66ad9e297d208029d6bb5e06f8b0f0c847d57 (patch)
tree49597ff70e76440c337ce16ecce4f48cec66ffe8 /setenv-jogl.sh
parentd075bda489c425d7f1ccd45944db6a8696bb0fd2 (diff)
Sync with jogl r2009 ; Unified setenv-jogl.sh, which works from the autobuild directory as well ; Unified java*.sh scripts
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@358 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'setenv-jogl.sh')
-rw-r--r--setenv-jogl.sh94
1 files changed, 75 insertions, 19 deletions
diff --git a/setenv-jogl.sh b/setenv-jogl.sh
index a89dd40..528c193 100644
--- a/setenv-jogl.sh
+++ b/setenv-jogl.sh
@@ -1,44 +1,100 @@
#! /bin/sh
+function print_usage() {
+ echo "Usage: $0 {JOGL_ALL|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GL2_MIN|JOGL_GL2_MAX} [jogl-build-dir]"
+}
+
if [ -z "$1" ] ; then
- echo "Usage: $0 {JOGL_ALL|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GL2_MIN|JOGL_GL2_MAX}"
-else
+ echo JOGL PROFILE missing
+ print_usage
+fi
JOGL_PROFILE=$1
shift
-echo JOGL PROFILE: $JOGL_PROFILE
+JOGL_BUILDDIR=
+if [ ! -z "$1" ] ; then
+ JOGL_BUILDDIR=$1
+ shift
+fi
-CVSROOT=":pserver:[email protected]:/cvs"
THISDIR=`pwd`
-export CVSROOT THISDIR
+AUTOBUILD=0
-if [ -x /devtools/etc/profile.ant ] ; then
- . /devtools/etc/profile.ant
+if [ -e "$JOGL_BUILDDIR" ] ; then
+ JOGL_DIR=$JOGL_BUILDDIR/..
+ JOGL_BUILDDIR_BASE=`basename $JOGL_BUILDDIR`
+else
+ AUTOBUILD=1
+ jpf=`find jogl/etc -name profile.jogl`
+ if [ -z "$jpf" ] ; then
+ jpf=`find . -name profile.jogl`
+ fi
+ if [ -z "$jpf" ] ; then
+ echo JOGL_DIR not found
+ echo JOGL_BUILDDIR $JOGL_BUILDDIR not exist or not given
+ print_usage
+ fi
+ JOGL_DIR=`dirname $jpf`/..
+ JOGL_BUILDDIR=$JOGL_DIR/lib
+ JOGL_BUILDDIR_BASE="."
fi
-J2RE_HOME=$(dirname `which java`)
-JAVA_HOME=$(dirname `which javac`)
-CP_SEP=:
+if [ $AUTOBUILD -eq 0 ] ; then
+ 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
+ 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
+ fi
+ GLUEGEN_JAR=$GLUEGEN_BUILDDIR/gluegen-rt.jar
+ GLUEGEN_OS=$GLUEGEN_BUILDDIR/obj
+else
+ GLUEGEN_BUILDDIR=$JOGL_BUILDDIR
+ GLUEGEN_JAR=$JOGL_BUILDDIR/gluegen-rt.jar
+ GLUEGEN_OS=$JOGL_BUILDDIR
+fi
-export LIBXCB_ALLOW_SLOPPY_LOCK=1
+DEMOS_BUILDDIR=$THISDIR/$JOGL_BUILDDIR_BASE
-. $THISDIR/../jogl/etc/profile.jogl $THISDIR/../jogl/build $THISDIR/../jogl/build/obj $JOGL_PROFILE
+echo JOGL AUTOBUILD: $AUTOBUILD
+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
+echo DEMOS BUILDDIR: $DEMOS_BUILDDIR
-GLUEGEN_JAR=$THISDIR/../gluegen/build/gluegen-rt.jar
-GLUEGEN_OS=$THISDIR/../gluegen/build/obj
+J2RE_HOME=$(which java)
+JAVA_HOME=$(which javac)
+CP_SEP=:
+
+. $JOGL_DIR/etc/profile.jogl $JOGL_PROFILE $JOGL_BUILDDIR
LIB=$THISDIR/lib
-# CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:.:build/classes
-CLASSPATH=.:$THISDIR/build/jogl-demos.jar:$THISDIR/build/jogl-demos-util.jar:$THISDIR/build/jogl-demos-data.jar:$GLUEGEN_JAR:$JOGL_CLASSPATH
+CLASSPATH=.:$DEMOS_BUILDDIR/jogl-demos.jar:$DEMOS_BUILDDIR/jogl-demos-util.jar:$DEMOS_BUILDDIR/jogl-demos-data.jar:$GLUEGEN_JAR:$JOGL_CLASSPATH
for i in $LIB/*jar ; do
CLASSPATH=$CLASSPATH:$i
done
export CLASSPATH
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GLUEGEN_OS:$THISDIR/../jogl/build/obj
+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 JOGL_CLASSPATH: $JOGL_CLASSPATH
-fi
+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.sun.javafx.newt.util.MainThread" for running demos with NEWT
+
+PATH=$J2RE_HOME/bin:$JAVA_HOME/bin:$PATH
+export PATH