aboutsummaryrefslogtreecommitdiffstats
path: root/make/scripts/setenv-jogl.sh
blob: 5e4bb57070fc4953220a9d8d63b8d991a18c0349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#! /bin/sh

function print_usage() {
    echo "Usage: $0 jogl-build-dir [JOGL_PROFILE]"
}

if [ -z "$1" ] ; then
    echo JOGL BUILD DIR missing
    print_usage
    exit
fi

if [ -e /opt-share/etc/profile.ant ] ; then
    . /opt-share/etc/profile.ant
fi

JOGL_BUILDDIR="$1"
shift

if [ -z "$1" ] ; then
    JOGL_PROFILE=JOGL_ALL
else
    JOGL_PROFILE=$1
    shift
fi

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 jogamp-env.xml`
if [ -z "$gpf" ] ; then
    gpf=`find .. -name jogamp-env.xml`
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.jar

joalpf=`find ../../joal -name joal.iml`
if [ -z "$joalpf" ] ; then
    joalpf=`find .. -name joal.iml`
fi
if [ -z "$joalpf" ] ; then
    echo JOAL_BUILDDIR not found
    print_usage
    exit
fi

JOAL_DIR=`dirname $joalpf`
JOAL_BUILDDIR="$JOAL_DIR"/"$JOGL_BUILDDIR_BASE"
if [ ! -e "$JOAL_BUILDDIR" ] ; then
    echo JOAL_BUILDDIR "$JOAL_BUILDDIR" does not exist
    print_usage
    exit
fi
JOAL_JAR="$JOAL_BUILDDIR"/joal.jar

if [ -z "$ANT_PATH" ] ; then
    ANT_PATH=$(dirname $(dirname $(which ant)))
    if [ -e $ANT_PATH/lib/ant.jar ] ; then
        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 JOAL BUILDDIR: "$JOAL_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=$(dirname $(dirname $(which java)))
JAVA_HOME=$(dirname $(dirname $(which javac)))
CP_SEP=:

. "$JOGL_DIR"/etc/profile.jogl $JOGL_PROFILE "$JOGL_BUILDDIR"

LIB=$THISDIR/lib

JOGAMP_ALL_AWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_AWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
JOGAMP_ALL_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
JOGAMP_MOBILE_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
export JOGAMP_ALL_AWT_CLASSPATH JOGAMP_ALL_NOAWT_CLASSPATH JOGAMP_MOBILE_CLASSPATH

CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
export CLASSPATH

# We use TempJarCache per default now!
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 JOGAMP_ALL_AWT_CLASSPATH: "$JOGAMP_ALL_AWT_CLASSPATH"
echo JOGAMP_ALL_NOAWT_CLASSPATH: "$JOGAMP_ALL_NOAWT_CLASSPATH"
echo JOGAMP_MOBILE_CLASSPATH: "$JOGAMP_MOBILE_CLASSPATH"
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