Jogamp
moved com.jogamp.javafx.* to com.jogamp.*.
[jogl.git] / make / build-jogl.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    - Ant build for JOGL.  This build has been tested with ANT 1.7.0.  The
4    - optional.jar that contains the optional ANT tasks must be in the ANT
5    - classpath (typically the ant/lib directory).
6    -
7    - A clean download of JOGL is required for this build.
8    -
9    - This build has no dependence on environment variables; the needed
10    - ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell
11    - script, by the virtual machine, or elsewhere. However, on all platforms,
12    - the C compiler and linker should be in the path. All other paths that
13    - need to be set are in host.properties.
14    -
15    - NOTE:  because the GlueGen config files have their own relative paths
16    -        which cannot be overridden by GlueGen, GlueGen MUST be run from
17    -        the "make" directory. This also means that this build-jogl.xml MUST
18    -        be run from the "make" directory.
19    -
20    - Public targets:
21    -   all: (default; autodetects OS and chooses C compiler from jogl.properties)
22    -   clean:        clean all built
23    -   javadoc:      create the standard developer Javadoc (recommended)
24    -                 (Note: should build all first - may be dependence in the future)
25    -   javadoc.spec:   create the standard developer Javadoc but exclude com.sun.* classes
26    -   javadoc.dev.all: create the internal developer Javadoc.  This includes the
27    -                       Java and C file generators. Note that it is only supported
28    -                       to create the Javadoc for the platform on which you are
29    -                       currently running.
30    - 
31    - Note: on Windows the "win32.c.compiler" property in jogl.properties
32    - is required to select the appropriate C compiler. See the example
33    - jogl.properties in this directory for valid values. On Mac OS X
34    - universal binaries may also be built by setting the "macosxfat"
35    - property in jogl.properties; again see the example file in this
36    - directory.
37    -   
38    - Optional properties:
39    -   -Djogl.cg=1 when combined with the build or javadoc targets will cause
40    -               the experimental binding to NVidia's Cg language to be built.
41    -               Then you need to define the location of your CG libraries:
42    -               -Dwindows.cg.lib=<PATH> for Windows and
43    -               -Dx11.cg.lib=<PATH> for X11/Unix
44    -
45    - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the
46    - ANT build, including the GlueGen and StaticGLInfo tasks, the building of
47    - the Java generated sources, the first and second phase Java compiles, and
48    - the building of the jar file. Thanks to Alex Radeski for the bulk of the
49    - port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for
50    - the original OS detection code.
51    -
52    - Some environment defs affecting compilation
53
54    - setup.nodesktop is set iff:
55         !isWindows && !isOSX && !isX11
56
57    - Internal settings, may not be necessary to set them manually,
58      since all JAR archives are orthogonal.
59        setup.noAWT
60        setup.noCDC
61
62    - Skip gluegen: java.generate.skip
63    -->
64 <project name="JOGL" basedir="." default="all">
65
66   <import file="versions.xml" />
67
68   <!-- Pull in GlueGen cpptasks build file -->
69   <property name="gluegen.root" value="../../gluegen" />
70   <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
71
72     <!-- ================================================================== -->
73     <!-- 
74        - Base initialization and detection of operating system.
75       -->
76     <target name="base.init" depends="gluegen.cpptasks.detect.os">
77
78         <condition property="setup.nodesktop">
79             <and>
80                 <isfalse value="${isWindows}" />
81                 <isfalse value="${isOSX}" />
82                 <isfalse value="${isX11}" />
83             </and>
84         </condition>
85
86         <condition property="setup.noall">
87             <isset property="setup.noAWT"/> 
88         </condition>
89
90         <echo message="setup.nodesktop: ${setup.nodesktop}" />
91         <echo message="setup.noall: ${setup.noall}" />
92         <echo message="setup.noAWT: ${setup.noAWT}" />
93         <echo message="setup.noCDC: ${setup.noCDC}" />
94
95         <!-- partitioning -->
96
97         <property name="java.part.core" 
98                   value="javax/media/opengl/* javax/media/opengl/fixedfunc/* javax/media/opengl/glu/* javax/media/opengl/glu/gl2es1/* com/jogamp/opengl/impl/* com/jogamp/opengl/impl/glu/* com/jogamp/opengl/impl/glu/error/*"/>
99         <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace*"/>
100
101         <property name="java.part.nv-cg"
102                   value="com/jogamp/opengl/cg com/jogamp/opengl/cg/*"/>
103
104         <property name="java.part.egl"
105                   value="com/jogamp/opengl/impl/egl/*"/>
106
107         <property name="java.part.glutess"
108                   value="com/jogamp/opengl/impl/glu/tessellator/**"/>
109
110         <property name="java.part.glumipmap"
111                   value="com/jogamp/opengl/impl/glu/mipmap/**"/>
112
113         <property name="java.part.glugl2"
114                   value="com/jogamp/opengl/impl/glu/gl2/** com/jogamp/opengl/impl/glu/nurbs/** com/jogamp/opengl/impl/glu/registry/** javax/media/opengl/glu/gl2/**"/>
115
116         <property name="java.part.openmax"
117                   value="com/jogamp/openmax/**"/>
118
119         <property name="java.part.sdk"
120                   value="com/jogamp/opengl/util/glsl/sdk/**"/>
121
122         <property name="java.part.glx"
123                   value="com/jogamp/opengl/impl/x11/glx/*"/>
124
125         <property name="java.part.wgl"
126                   value="com/jogamp/opengl/impl/windows/wgl/*"/>
127
128         <property name="java.part.cgl"
129                   value="com/jogamp/opengl/impl/macosx/cgl/*"/>
130
131         <property name="java.part.gl2es12"
132                   value="com/jogamp/opengl/impl/gl2es12/**"/>
133
134         <property name="java.part.gl3"
135                   value="com/jogamp/opengl/impl/**/gl3/**"/>
136
137         <property name="java.part.gl3.dbg"
138                   value="javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.*"/>
139
140         <property name="java.part.gl2"
141                   value="com/jogamp/opengl/impl/**/gl2/**"/>
142
143         <property name="java.part.gl2.dbg"
144                   value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.*"/>
145
146         <property name="java.part.es1"
147                   value="javax/media/opengl/**/es1/** com/jogamp/opengl/**/es1/**"/>
148
149         <property name="java.part.es1.dbg"
150                   value="javax/media/opengl/TraceGLES1.* javax/media/opengl/DebugGLES1.* javax/media/opengl/TraceGL2ES1.* javax/media/opengl/DebugGL2ES1.*"/>
151
152         <property name="java.part.es2"
153                   value="javax/media/opengl/**/es2/** com/jogamp/opengl/**/es2/**"/>
154
155         <property name="java.part.es2.dbg"
156                   value="javax/media/opengl/TraceGLES2.* javax/media/opengl/DebugGLES2.* javax/media/opengl/TraceGL2ES2.* javax/media/opengl/DebugGL2ES2.*"/>
157
158         <property name="java.part.awt"
159                   value="javax/media/opengl/awt/** com/jogamp/opengl/impl/**/awt/**"/>
160
161         <property name="java.part.util"
162                   value="com/jogamp/opengl/util/* com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/packrect/**"/>
163
164         <property name="java.part.util.awt"
165                   value="com/jogamp/opengl/util/**/awt/** com/jogamp/opengl/util/AWTAnimatorImpl*"/>
166
167         <property name="java.part.util.gl2"
168                   value="com/jogamp/opengl/util/**/gl2/**"/>
169
170         <property name="java.part.util.glsl"
171                   value="com/jogamp/opengl/util/glsl/* com/jogamp/opengl/util/glsl/fixedfunc/*"/>
172
173         <property name="java.part.util.fixedfuncemu"
174                   value="com/jogamp/opengl/util/glsl/fixedfunc/impl/**"/>
175
176         <property name="java.part.util.fixedfuncemu.shadercode"
177                   value="com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/* com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/>
178
179         <!-- condition excludes -->
180
181         <condition property="java.excludes.nv-cg"
182                    value="${java.part.nv-cg}">
183           <not>
184            <isset property="jogl.cg"/> 
185           </not>
186         </condition>
187
188         <condition property="java.excludes.awt"
189                    value="${java.part.awt} ${java.part.util.awt}">
190            <isset property="setup.noAWT"/> 
191         </condition>
192
193         <property name="java.excludes.javadoc.packagenames"
194                   value="com.jogamp.opengl.impl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/>
195
196         <property name="java.excludes.fixme" 
197                   value="com/jogamp/opengl/impl/gl2/fixme/** com/jogamp/audio/windows/waveout/TestSpatialization.java" />
198
199         <property name="java.excludes.cdcfp"
200                   value="${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gl2} ${java.part.gl2.dbg} ${java.part.gl3} ${java.part.gl3.dbg} ${java.part.awt} ${java.part.glugl2} ${java.part.util.awt} ${java.part.util.gl2} com/jogamp/opengl/util/TGAWriter.java"/>
201
202         <condition property="java.excludes.desktop"
203                    value="${java.part.glx} ${java.excludes.cdcfp}">
204            <isset property="setup.nodesktop"/> 
205         </condition>
206
207         <property name="java.excludes.all" value="${java.excludes.fixme} ${java.excludes.nv-cg} ${java.excludes.awt} ${java.excludes.desktop}" />
208         <echo message="java.excludes.all: ${java.excludes.all}" />
209
210         <!-- Set the project root directory to be up one directory. -->
211         <property name="project.root" value=".." />
212     
213         <!-- Set the configuration and build files to this directory. -->
214         <property name="make" value="." />
215     </target>
216
217     <target name="base.init.sourcelevel.1">
218         <property name="jogl.sourcelevel" value="1.4" />
219         <property name="junit.sourcelevel" value="1.5" />
220     </target>
221
222     <!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
223         <property name="jogl.sourcelevel" value="1.5" />
224     </target-->
225
226     <!-- ================================================================== -->
227     <!-- 
228        - Load user properties which override build defaults.
229       -->
230     <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file">
231         <!-- Load the user specified properties file that defines various host
232            - specific paths.  The user will be notified if this is does not
233            - exist. -->
234         <property name="user.properties.file" value="${user.home}/jogl.properties" />
235         <property file="${user.properties.file}" />
236         <echo message="Loaded ${user.properties.file}." />
237         <property file="${user.home}/gluegen.properties" />
238         <echo message="Loaded ${user.home}/gluegen.properties." />
239         <fail message="antlr.jar was not specified in jogl.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/>
240         <echo message="antlr.jar=${antlr.jar}" />
241     </target>
242
243     <!-- ================================================================== -->
244     <!-- 
245        - Declare all paths and user defined variables.
246       -->
247     <target name="declare.common" description="Declare properties" depends="load.user.properties">
248         <!-- The location and name of the configuration ANT file that will 
249            - validate to ensure that all user-define variables are set. -->
250         <property name="validate.user.properties" value="${make}/validate-properties.xml" />
251            
252         <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
253         <property name="javacdebug"       value="true" /> 
254         <property name="javacdebuglevel"  value="source,lines" /> 
255         <!-- property name="javac.memorymax"  value="128m" /-->  <!-- I ran out of memory with these .. linux x86_64 6u14 -->
256         <property name="javac.memorymax"  value="512m" /> 
257
258         <!-- Names of directories relative to the project root.
259              Some of these are used in FileMappers later for dependence information
260              and need exact string matching, which is why they use file.separator
261              instead of "/". -->
262         <condition property="rootrel.build" value="build">
263           <not>
264               <isset property="rootrel.build"/>
265           </not>
266         </condition>
267         <property name="rootrel.build.jogl" value="${rootrel.build}/jogl" />
268         <property name="rootrel.src.java" value="src/jogl/classes" />
269         <property name="rootrel.src.junit" value="src/jogl/junit" />
270         <property name="rootrel.src.c" value="src/jogl/native" />
271         <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" />
272
273         <property name="rootrel.src.generated" value="${rootrel.build.jogl}/gensrc" />
274         <property name="rootrel.generated.c.jogl" value="${rootrel.src.generated}/native/jogl" />
275         <property name="rootrel.generated.c.cg" value="${rootrel.src.generated}/native/jogl_cg" />
276         <property name="rootrel.obj" value="${rootrel.build.jogl}/obj" />
277         <property name="rootrel.obj.jogl" value="${rootrel.obj}/jogl" />
278         <property name="rootrel.obj.cg" value="${rootrel.obj}/jogl_cg" />
279
280         <property name="javac.bootclasspath-cdc.jar" value="${gluegen.root}/make/lib/cdc_fp.jar"/>
281
282         <!-- GlueGen properties. -->
283         <!-- NOTE that these require a checked-out GlueGen workspace as a -->
284         <!-- sibling of the JOGL workspace. -->
285         <property name="gluegen.make.dir" value="${gluegen.root}/make" />
286         <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" />
287         <property name="gluegen.jar" value="${gluegen.root}/${rootrel.build}/gluegen.jar" />
288         <property name="gluegen-rt.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt.jar" />
289         <property name="gluegen.so.dir" value="${gluegen.root}/${rootrel.build}/obj" />
290         <property name="junit.jar" value="${gluegen.make.dir}/lib/junit-4.5.jar" />
291         <property name="nativewindow.core.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.jar" />
292         <property name="nativewindow.x11.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.jar" />
293         <property name="nativewindow.awt.jar" value="../${rootrel.build}/nativewindow/nativewindow.awt.jar" />
294         <property name="nativewindow.so.dir" value="../${rootrel.build}/nativewindow/obj" />
295
296         <property name="gluegen-rt-cdc.jar" value="${gluegen.root}/${rootrel.build}/gluegen-rt-cdc.jar" />
297         <property name="nativewindow.core.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.cdc.jar" />
298         <property name="nativewindow.x11.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.cdc.jar" />
299                                                 
300         <property name="newt.so.dir" value="../${rootrel.build}/newt/obj" />
301
302         <!-- The source directories. -->
303         <property name="src.java" value="${project.root}/${rootrel.src.java}" />
304         <property name="src.junit" value="${project.root}/${rootrel.src.junit}" />
305         <property name="src.c"    value="${project.root}/${rootrel.src.c}" />
306         <property name="build"    value="${project.root}/${rootrel.build.jogl}" />
307         <property name="tempdir"  value="${project.root}/build-temp" />
308         
309         <!-- The generated source directories. -->
310         <property name="src.generated" value="${build}/gensrc" />
311         <property name="src.generated.java" value="${src.generated}/classes" />
312         <property name="src.generated.java-cdc" value="${src.generated}/classes-cdc" />
313         <property name="src.generated.java.cg" value="${src.generated.java}/com/jogamp/opengl/cg" />
314         <property name="src.generated.c" value="${src.generated}/native/jogl" />
315         <property name="src.generated.c.openmax" value="${src.generated}/native/openmax" />
316         <property name="src.generated.c.cg" value="${src.generated}/native/jogl_cg" />
317         
318         <!-- The compiler output directories. -->
319         <property name="classes" value="${build}/classes" />
320         <property name="classes-cdc" value="${build}/classes-cdc" />
321         <property name="obj"      value="${project.root}/${rootrel.obj}" />
322         <property name="obj.jogl" value="${project.root}/${rootrel.obj.jogl}" />
323         <property name="obj.cg"   value="${project.root}/${rootrel.obj.cg}" />
324
325         <property name="all.so.dir" value="${gluegen.so.dir}:${nativewindow.so.dir}:${obj}:${newt.so.dir}" />
326
327         <!-- The GL headers from which Java files are generated -->
328         <property name="config" value="${make}/config/jogl" />
329         <property name="stub.includes" value="${make}/stub_includes" />
330         <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE:  this MUST be relative for FileSet -->
331         <property name="stub.includes.opengl" value="${stub.includes}/opengl" />
332         <property name="stub.includes.common" value="${stub.includes}/common" />
333         <dirset id="stub.includes.fileset.all.gl2" dir=".">
334             <include name="${stub.includes.dir}/opengl/**" />
335             <include name="${stub.includes.dir}/macosx/**" />
336             <include name="${stub.includes.dir}/win32/**" />
337             <include name="${stub.includes.dir}/x11/**" />
338             <include name="${stub.includes.dir}/common/**" />
339             <include name="${stub.includes.dir}/jni/**" />
340         </dirset>
341         <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}">
342             <include name="opengl/**" />
343             <include name="macosx/**" />
344             <include name="win32/**" />
345             <include name="x11/**" />
346             <include name="common/**" />
347             <include name="jni/**" />
348         </fileset>
349         <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" />
350         <fileset id="stub.includes.dependencies.fileset.3" dir="${config}">
351             <include name="*.cfg" />
352             <include name="gl*.java" />
353             <include name="*.c" />
354             <exclude name="cg-common.cfg" />
355         </fileset>
356         <dirset id="stub.includes.cg.fileset.all" dir=".">
357             <include name="${stub.includes.dir}/opengl/**" />
358             <include name="${stub.includes.dir}/cg/**" />
359             <include name="${stub.includes.dir}/macosx/**" />
360             <include name="${stub.includes.dir}/win32/**" />
361             <include name="${stub.includes.dir}/x11/**" />
362             <include name="${stub.includes.dir}/common/**" />
363         </dirset>
364         <fileset id="stub.includes.cg.dependencies.fileset" dir=".">
365             <include name="${stub.includes.dir}/cg/**" />
366             <include name="${config}/cg-common.cfg" />
367             <include name="${config}/cg-common-CustomJavaCode.java" />
368         </fileset>
369
370         <!-- Create the classpath that includes GlueGen and
371            - ANTLR. This requires the user-defined "antlr.jar"
372            - property. -->
373         <path id="gluegen.classpath">
374           <pathelement location="${gluegen.jar}" />
375           <pathelement location="${antlr.jar}" />
376         </path>
377
378         <path id="nativewindow_gluegen.classpath">
379             <pathelement location="${gluegen-rt.jar}" />
380             <pathelement location="${nativewindow.core.jar}" />
381             <pathelement location="${nativewindow.x11.jar}" />
382             <pathelement location="${nativewindow.awt.jar}" />
383         </path>
384
385         <path id="nativewindow_gluegen.classpath-cdc">
386             <pathelement location="${gluegen-rt-cdc.jar}" />
387             <pathelement location="${nativewindow.core.cdc.jar}" />
388             <pathelement location="${nativewindow.x11.cdc.jar}" />
389         </path>
390
391         <!-- Create the classpath that includes GlueGen and
392            - the current classes for building the composable pipelines.
393            -->
394         <path id="pipeline.classpath">
395           <pathelement location="${gluegen.jar}" />
396           <pathelement location="${classes}" />
397         </path>
398
399         <!-- The resulting J2SE jogl.jar. -->
400         <property name="jogl.core.jar" value="${build}/jogl.core.jar" />
401         <property name="jogl.cg.jar" value="${build}/jogl.cg.jar" />
402         <property name="jogl.gles1.jar" value="${build}/jogl.gles1.jar" />
403         <property name="jogl.gles1.dbg.jar" value="${build}/jogl.gles1.dbg.jar" />
404         <property name="jogl.gles2.jar" value="${build}/jogl.gles2.jar" />
405         <property name="jogl.gles2.dbg.jar" value="${build}/jogl.gles2.dbg.jar" />
406         <property name="jogl.egl.jar" value="${build}/jogl.egl.jar" />
407         <property name="jogl.glutess.jar" value="${build}/jogl.glu.tess.jar" />
408         <property name="jogl.glumipmap.jar" value="${build}/jogl.glu.mipmap.jar" />
409         <property name="jogl.glugl2.jar"    value="${build}/jogl.glu.gl2.jar" />
410         <property name="jogl.gl2es12.x11.jar" value="${build}/jogl.gl2es12.x11.jar" />
411         <property name="jogl.gl2es12.win.jar" value="${build}/jogl.gl2es12.win.jar" />
412         <property name="jogl.gl2es12.osx.jar" value="${build}/jogl.gl2es12.osx.jar" />
413         <property name="jogl.gl2.x11.jar" value="${build}/jogl.gl2.x11.jar" />
414         <property name="jogl.gl2.win.jar" value="${build}/jogl.gl2.win.jar" />
415         <property name="jogl.gl2.osx.jar" value="${build}/jogl.gl2.osx.jar" />
416         <property name="jogl.gl2.dbg.jar" value="${build}/jogl.gl2.dbg.jar" />
417         <property name="jogl.awt.jar" value="${build}/jogl.awt.jar" />
418         <property name="jogl.util.jar" value="${build}/jogl.util.jar" />
419         <property name="jogl.util.gl2.jar" value="${build}/jogl.util.gl2.jar" />
420         <property name="jogl.util.awt.jar" value="${build}/jogl.util.awt.jar" />
421         <property name="jogl.util.fixedfuncemu.jar" value="${build}/jogl.util.fixedfuncemu.jar" />
422         <property name="jogl.sdk.jar" value="${build}/jogl.sdk.jar" />
423         <property name="jogl.all.jar" value="${build}/jogl.all.jar"/>
424         <property name="jogl.all-noawt.jar" value="${build}/jogl.all-noawt.jar"/>
425         <property name="jogl.test.jar" value="${build}/jogl.test.jar"/>
426
427         <!-- The resulting CDC jogl.jar. -->
428         <property name="jogl.core.cdc.jar" value="${build}/jogl.core.cdc.jar" />
429         <property name="jogl.gles1.cdc.jar" value="${build}/jogl.gles1.cdc.jar" />
430         <property name="jogl.gles1.dbg.cdc.jar" value="${build}/jogl.gles1.dbg.cdc.jar" />
431         <property name="jogl.gles2.cdc.jar" value="${build}/jogl.gles2.cdc.jar" />
432         <property name="jogl.gles2.dbg.cdc.jar" value="${build}/jogl.gles2.dbg.cdc.jar" />
433         <property name="jogl.egl.cdc.jar" value="${build}/jogl.egl.cdc.jar" />
434         <property name="jogl.glutess.cdc.jar" value="${build}/jogl.glu.tess.cdc.jar" />
435         <property name="jogl.glumipmap.cdc.jar" value="${build}/jogl.glu.mipmap.cdc.jar" />
436         <property name="jogl.gl2es12.x11.cdc.jar" value="${build}/jogl.gl2es12.x11.cdc.jar" />
437         <property name="jogl.gl2es12.win.cdc.jar" value="${build}/jogl.gl2es12.win.cdc.jar" />
438         <property name="jogl.gl2es12.osx.cdc.jar" value="${build}/jogl.gl2es12.osx.cdc.jar" />
439         <property name="jogl.util.cdc.jar" value="${build}/jogl.util.cdc.jar" />
440         <property name="jogl.util.fixedfuncemu.cdc.jar" value="${build}/jogl.util.fixedfuncemu.cdc.jar" />
441         <property name="jogl.all.cdc.jar" value="${build}/jogl.all.cdc.jar"/>
442
443         <path id="jogl_junit.compile.classpath">
444             <pathelement location="${junit.jar}" />
445             <pathelement location="${gluegen-rt.jar}" />
446             <pathelement location="${nativewindow.core.jar}" />
447             <pathelement location="${nativewindow.x11.jar}" />
448             <pathelement location="${nativewindow.awt.jar}" />
449             <pathelement location="${jogl.all.jar}" />
450         </path>
451
452         <path id="jogl_junit.run.classpath">
453             <pathelement location="${junit.jar}" />
454             <pathelement location="${gluegen-rt.jar}" />
455             <pathelement location="${nativewindow.core.jar}" />
456             <pathelement location="${nativewindow.x11.jar}" />
457             <pathelement location="${nativewindow.awt.jar}" />
458             <pathelement location="${jogl.all.jar}" />
459             <pathelement location="${jogl.test.jar}" />
460         </path>
461
462         <!-- The javadoc dirs. -->
463         <property name="javadoc" value="${project.root}/javadoc_jogl_public" />
464         <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" />
465         <property name="javadoc.dev" value="${project.root}/javadoc_jogl_dev" />
466         <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
467         <property name="javadoc.windowtitle" value="JOGL API -- JSR-231 ${jogl_base_version} Specification" />
468         <property name="javadoc.overview" value="doc/jogl/spec-overview.html" />
469         <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
470
471         <property name="javadoc.packagenames" value="${javadoc.spec.packagenames},com.jogamp.opengl.util.*" />
472
473         <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.opengl.impl.*,com.sun.gluegen,com.jogamp.gluegen.runtime" />
474     <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=231&quot;&gt;license terms&lt;/a&gt;." />
475     </target>
476     
477     <target name="declare.gl.gles1">
478         <property name="gles1.headers" value="${stub.includes.dir}/opengl/GLES/*.h" /> <!-- NOTE:  this MUST be relative for FileSet --> <!-- CHECK:  this may need to be pruned for each platform -->
479     </target>
480
481     <target name="declare.gl.gles2">
482         <property name="gles2.headers" value="${stub.includes.dir}/opengl/GLES2/*.h" /> <!-- NOTE:  this MUST be relative for FileSet --> <!-- CHECK:  this may need to be pruned for each platform -->
483     </target>
484
485     <target name="declare.gl.gles" depends="declare.gl.gles1, declare.gl.gles2">
486         <!-- Prepare to build the EGL interface -->
487         <property name="window.es.cfg"                             value="${config}/egl.cfg" />
488         <property name="window.es.ext.cfg"                         value="${config}/eglext.cfg" />
489         <property name="window.es.system"                          value="egl"/>
490     </target>
491
492     <target name="declare.gl.gl2">
493         <property name="gl2.headers" value="${stub.includes.dir}/opengl/GL/*.h" /> <!-- NOTE:  this MUST be relative for FileSet --> <!-- CHECK:  this may need to be pruned for each platform -->
494     </target>
495
496     <!-- Declarations that have to come after both the common setup and the GLES tests -->
497     <target name="declare.common.2">
498     </target>
499
500     <target name="setup.javacdc">
501         <copy file="../src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/impl/SystemUtil.java" />
502         <copy file="../src/jogl/classes/com/jogamp/opengl/util/BufferUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/BufferUtil.java" />
503         <copy file="../src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/impl/InternalBufferUtil.java" />
504         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/TextureIO.java" />
505         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/spi/DDSImage.java" />
506         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/spi/TGAImage.java" />
507     </target>
508
509     <target name="setup.javase">
510         <copy file="../src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/impl/SystemUtil.java" />
511         <copy file="../src/jogl/classes/com/jogamp/opengl/util/BufferUtil.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/BufferUtil.java" />
512         <copy file="../src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/impl/InternalBufferUtil.java" />
513         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/TextureIO.java" />
514         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/spi/DDSImage.java" />
515         <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/spi/TGAImage.java" />
516     </target>
517
518     <!-- ================================================================== -->
519     <!-- 
520        - Initialize all parameters required for the build and create any
521        - required directories.
522       -->
523     <target name="init" depends="declare.common, declare.gl.gles, declare.gl.gl2, declare.common.2">
524         <!-- Call the external config validator script to make sure the config is ok and consistent -->
525         <ant antfile="${validate.user.properties}" inheritall="true"/>
526         
527         <!-- Create the required output directories. -->
528         <mkdir dir="${src.generated.java}" />
529         <mkdir dir="${src.generated.java-cdc}" />
530         <mkdir dir="${src.generated.c}" />
531         <mkdir dir="${src.generated.c}/MacOSX" />
532         <mkdir dir="${src.generated.c}/Windows" />
533         <mkdir dir="${src.generated.c}/X11" />
534         <mkdir dir="${src.generated.c.openmax}" />
535         <mkdir dir="${classes}" />
536         <mkdir dir="${classes-cdc}" />
537         <mkdir dir="${obj}" />
538         <mkdir dir="${obj.jogl}" />
539         <mkdir dir="${obj.cg}" />
540
541         <!-- Set up Java SE and Java CDC files -->
542         <antcall target="setup.javase"  inheritRefs="true" />
543         <antcall target="setup.javacdc" inheritRefs="true" />
544     </target>
545
546     <!-- ================================================================== -->
547     <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation -->
548     <!--
549        - Build GlueGen
550       -->
551     <target name="build.gluegen" depends="init">
552         <!-- Run the GlueGen build to ensure that the GlueGen ANT task
553            - has been built. -->
554         <!-- FIXME: remove passing down of antlr.jar when gluegen.properties is on all
555              nightly build machines -->
556         <ant antfile="${gluegen.build.xml}" dir="${gluegen.make.dir}" target="all" inheritAll="false">
557           <propertyset>
558             <propertyref name="antlr.jar" />
559             <!--propertyref name="gluegen.nsig" /-->
560           </propertyset>
561         </ant>
562     </target>
563
564     <!--
565        - Check to see whether we need to rebuild the generated sources.
566       -->
567     <target name="java.generate.check">
568         <!-- Blow away all target files if any dependencies are violated
569              (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
570              <!--
571         <dependset>
572             <srcfileset refid="stub.includes.dependencies.fileset.1" />
573             <srcfileset refid="stub.includes.dependencies.fileset.2" />
574             <srcfileset refid="stub.includes.dependencies.fileset.3" />
575             <targetfileset dir="${src.generated}">
576                 <include name="**/*.java" />
577                 <include name="**/*.c" />
578             </targetfileset>
579         </dependset>
580         -->
581
582         <!-- Now check for the presence of one well-known file -->
583         <uptodate property="java.generate.skip.es1"
584                   targetfile="${src.generated.java}/javax/media/opengl/GLES1.java">
585             <srcfiles refid="stub.includes.dependencies.fileset.1" />
586             <srcfiles refid="stub.includes.dependencies.fileset.2" />
587             <srcfiles refid="stub.includes.dependencies.fileset.3" />
588         </uptodate>
589         <uptodate property="java.generate.skip.es2"
590                   targetfile="${src.generated.java}/javax/media/opengl/GLES2.java">
591             <srcfiles refid="stub.includes.dependencies.fileset.1" />
592             <srcfiles refid="stub.includes.dependencies.fileset.2" />
593             <srcfiles refid="stub.includes.dependencies.fileset.3" />
594         </uptodate>
595         <uptodate property="java.generate.skip.gl2"
596                   targetfile="${src.generated.java}/javax/media/opengl/GL2.java">
597             <srcfiles refid="stub.includes.dependencies.fileset.1" />
598             <srcfiles refid="stub.includes.dependencies.fileset.2" />
599             <srcfiles refid="stub.includes.dependencies.fileset.3" />
600         </uptodate>
601         <uptodate property="java.generate.skip.glu"
602                   targetfile="${src.generated.java}/javax/media/opengl/glu/GLU.java">
603             <srcfiles refid="stub.includes.dependencies.fileset.1" />
604             <srcfiles refid="stub.includes.dependencies.fileset.2" />
605             <srcfiles refid="stub.includes.dependencies.fileset.3" />
606         </uptodate>
607
608         <condition property="java.generate.skip">
609           <and>
610               <isset property="java.generate.skip.es1"/>
611               <isset property="java.generate.skip.es2"/>
612               <!--isset property="java.generate.skip.gl2"/-->
613               <isset property="java.generate.skip.glu"/>
614           </and>
615         </condition>
616
617         <!--property name="java.generate.skip" value="true"/-->
618     </target>
619
620     <target name="java.generate.cleantemp">
621         <delete includeEmptyDirs="true" quiet="true">
622             <fileset dir="${tempdir}/gensrc" />
623         </delete>
624     </target>
625
626     <target name="java.generate.copy2temp">
627         <copy todir="${tempdir}">
628             <fileset dir="${build}"
629                      includes="gensrc/classes/**" />
630         </copy>
631     </target>
632
633     <target name="java.generate.gl_if">
634         <echo message="Generating GL interface" />
635         <antcall target="java.generate.copy2temp" inheritRefs="true" />
636         <gluegen src="${stub.includes.opengl}/gles2.c"
637                  outputRootDir="${build}"
638                  config="${config}/gl-if-gl.cfg"
639                  includeRefid="stub.includes.fileset.all.gl2"
640                  emitter="com.sun.gluegen.opengl.GLEmitter">
641             <classpath refid="gluegen.classpath" />
642         </gluegen>
643     </target>
644
645     <target name="java.generate.gl2_es1_if">
646         <echo message="Generating GL2_ES1 interface" />
647         <antcall target="java.generate.copy2temp" inheritRefs="true" />
648         <gluegen src="${stub.includes.opengl}/gles1.c"
649                  outputRootDir="${build}"
650                  config="${config}/gl-if-gl2_es1.cfg" 
651                  includeRefid="stub.includes.fileset.all.gl2"
652                  emitter="com.sun.gluegen.opengl.GLEmitter">
653             <classpath refid="gluegen.classpath" />
654         </gluegen>
655     </target>
656
657     <target name="java.generate.gl2_es2_if">
658         <echo message="Generating GL2_ES2 interface" />
659         <antcall target="java.generate.copy2temp" inheritRefs="true" />
660         <gluegen src="${stub.includes.opengl}/gles2.c"
661                  outputRootDir="${build}"
662                  config="${config}/gl-if-gl2_es2.cfg" 
663                  includeRefid="stub.includes.fileset.all.gl2"
664                  emitter="com.sun.gluegen.opengl.GLEmitter">
665             <classpath refid="gluegen.classpath" />
666         </gluegen>
667     </target>
668
669     <target name="java.generate.gl2_gl3_if">
670         <echo message="Generating GL2_GL3 interface" />
671         <antcall target="java.generate.copy2temp" inheritRefs="true" />
672         <gluegen src="${stub.includes.opengl}/gl3.c" 
673                  outputRootDir="${build}"
674                  config="${config}/gl-gl3-set.cfg"
675                  includeRefid="stub.includes.fileset.all.gl2"
676                  emitter="com.sun.gluegen.opengl.GLEmitter">
677             <classpath refid="gluegen.classpath" />
678         </gluegen>
679         <gluegen src="${stub.includes.opengl}/gl2.c" 
680                  outputRootDir="${build}"
681                  config="${config}/gl-if-gl2_gl3.cfg"
682                  includeRefid="stub.includes.fileset.all.gl2"
683                  emitter="com.sun.gluegen.opengl.GLEmitter">
684             <classpath refid="gluegen.classpath" />
685         </gluegen>
686     </target>
687
688     <target name="java.generate.gl2">
689         <echo message="Generating GL2 interface and implementation" />
690         <antcall target="java.generate.copy2temp" inheritRefs="true" />
691         <gluegen src="${stub.includes.opengl}/gl2.c" 
692                  outputRootDir="${build}"
693                  config="${config}/gl-gl2.cfg"
694                  includeRefid="stub.includes.fileset.all.gl2"
695                  emitter="com.sun.gluegen.opengl.GLEmitter">
696             <classpath refid="gluegen.classpath" />
697         </gluegen>
698     </target>
699
700     <target name="java.generate.gl3">
701         <echo message="Generating GL3 interface and implementation" />
702         <antcall target="java.generate.copy2temp" inheritRefs="true" />
703         <gluegen src="${stub.includes.opengl}/gl3.c" 
704                  outputRootDir="${build}"
705                  config="${config}/gl-gl3.cfg"
706                  includeRefid="stub.includes.fileset.all.gl2"
707                  emitter="com.sun.gluegen.opengl.GLEmitter">
708             <classpath refid="gluegen.classpath" />
709         </gluegen>
710     </target>
711
712     <target name="java.generate.gl3bc">
713         <echo message="Generating GL3bc implementation" />
714         <antcall target="java.generate.copy2temp" inheritRefs="true" />
715         <gluegen src="${stub.includes.opengl}/gl3bc.c" 
716                  outputRootDir="${build}"
717                  config="${config}/gl-gl3bc.cfg"
718                  includeRefid="stub.includes.fileset.all.gl2"
719                  emitter="com.sun.gluegen.opengl.GLEmitter">
720             <classpath refid="gluegen.classpath" />
721         </gluegen>
722     </target>
723
724     <target name="java.generate.gl2es12">
725         <echo message="Generating GL2ES12 implementation" />
726         <antcall target="java.generate.copy2temp" inheritRefs="true" />
727         <gluegen src="${stub.includes.opengl}/gl2es12.c" 
728                  outputRootDir="${build}"
729                  config="${config}/gl-gl2es12.cfg"
730                  includeRefid="stub.includes.fileset.all.gl2"
731                  emitter="com.sun.gluegen.opengl.GLEmitter">
732             <classpath refid="gluegen.classpath" />
733         </gluegen>
734     </target>
735
736     <target name="java.generate.gles1">
737         <echo message="Generating GLES1 interface and implementation" />
738         <antcall target="java.generate.copy2temp" inheritRefs="true" />
739         <gluegen src="${stub.includes.opengl}/gles1.c" 
740                  outputRootDir="${build}"
741                  config="${config}/gl-es1.cfg"
742                  includeRefid="stub.includes.fileset.all.gl2"
743                  emitter="com.sun.gluegen.opengl.GLEmitter">
744             <classpath refid="gluegen.classpath" />
745         </gluegen>
746     </target>
747
748     <target name="java.generate.gles2">
749         <echo message="Generating GLES2 interface and implementation" />
750         <antcall target="java.generate.copy2temp" inheritRefs="true" />
751         <gluegen src="${stub.includes.opengl}/gles2.c" 
752                  outputRootDir="${build}"
753                  config="${config}/gl-es2.cfg"
754                  includeRefid="stub.includes.fileset.all.gl2"
755                  emitter="com.sun.gluegen.opengl.GLEmitter">
756             <classpath refid="gluegen.classpath" />
757         </gluegen>
758     </target>
759
760     <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/>
761
762     <!-- target name="java.generate.gl.nsig" if="gluegen.nsig">
763         <echo message="Generating GL interface and implementation" />
764         <gluegen src="${gl.c}" 
765                  config="${gl.cfg.nsig}"
766                  includeRefid="stub.includes.fileset.all.gl2"
767                  emitter="com.sun.gluegen.nativesig.NativeSignatureEmitter">
768             <classpath refid="gluegen.classpath" />
769         </gluegen>
770     </target> -->
771
772     <target name="java.generate.glu.base">
773         <echo message="Generating GLU class" />
774         <antcall target="java.generate.copy2temp" inheritRefs="true" />
775         <gluegen src="${stub.includes.opengl}/glu.c" 
776                  outputRootDir="${build}"
777                  config="${config}/glu-base.cfg"
778                  includeRefid="stub.includes.fileset.all.gl2"
779                  emitter="com.sun.gluegen.opengl.GLEmitter">
780             <classpath refid="gluegen.classpath" />
781         </gluegen>
782     </target>
783
784     <target name="java.generate.glu.GL2ES1">
785         <echo message="Generating GLU class" />
786         <antcall target="java.generate.copy2temp" inheritRefs="true" />
787         <gluegen src="${stub.includes.opengl}/glu.c" 
788                  outputRootDir="${build}"
789                  config="${config}/glu-gl2es1.cfg"
790                  includeRefid="stub.includes.fileset.all.gl2"
791                  emitter="com.sun.gluegen.opengl.GLEmitter">
792             <classpath refid="gluegen.classpath" />
793         </gluegen>
794     </target>
795
796     <target name="java.generate.glu.GL2">
797         <echo message="Generating GLU class" />
798         <antcall target="java.generate.copy2temp" inheritRefs="true" />
799         <gluegen src="${stub.includes.opengl}/glu.c" 
800                  outputRootDir="${build}"
801                  config="${config}/glu-gl2.cfg"
802                  includeRefid="stub.includes.fileset.all.gl2"
803                  emitter="com.sun.gluegen.opengl.GLEmitter">
804             <classpath refid="gluegen.classpath" />
805         </gluegen>
806     </target>
807
808     <target name="java.generate.platform.glext">
809         <echo message="Generating platform-specific OpenGL extension class: ${window.os.system}" />
810         <antcall target="java.generate.copy2temp" inheritRefs="true" />
811         <gluegen src="${glext.platform.header}" 
812                  outputRootDir="${build}"
813                  config="${glext.platform.cfg}"
814                  includeRefid="stub.includes.fileset.all.gl2"
815                  emitter="com.sun.gluegen.opengl.GLEmitter">
816             <classpath refid="gluegen.classpath" />
817         </gluegen>
818     </target>
819
820     <target name="java.generate.window.system.es" if="window.es.cfg">
821         <echo message="Generating EGL implementation class" />
822         <antcall target="java.generate.copy2temp" inheritRefs="true" />
823         <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" />
824         <gluegen src="${stub.includes.dir}/${window.es.system}/window-system.c"
825                  outputRootDir="${build}"
826                  config="${window.es.cfg}"
827                  includeRefid="stub.includes.fileset.platform"
828                  emitter="com.sun.gluegen.opengl.GLEmitter">
829             <classpath refid="gluegen.classpath" />
830         </gluegen>
831     </target>
832
833     <target name="java.generate.window.system.es.ext" if="window.es.ext.cfg">
834         <echo message="Generating EGLExt implementation class" />
835         <antcall target="java.generate.copy2temp" inheritRefs="true" />
836         <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" />
837         <gluegen src="${stub.includes.dir}/${window.es.system}/window-system-ext.c"
838                  outputRootDir="${build}"
839                  config="${window.es.ext.cfg}"
840                  includeRefid="stub.includes.fileset.platform"
841                  emitter="com.sun.gluegen.opengl.GLEmitter">
842             <classpath refid="gluegen.classpath" />
843         </gluegen>
844     </target>
845
846     <target name="java.generate.window.system.os" if="window.os.cfg">
847         <echo message="Generating window system glue impl: ${window.os.system}" />
848         <antcall target="java.generate.copy2temp" inheritRefs="true" />
849         <gluegen src="${stub.includes.dir}/${window.os.system}/window-system.c"
850                  outputRootDir="${build}"
851                  config="${window.os.cfg}"
852                  includeRefid="stub.includes.fileset.platform"
853                  emitter="com.sun.gluegen.opengl.GLEmitter">
854             <classpath refid="gluegen.classpath" />
855         </gluegen>
856     </target>
857
858     <target name="java.generate.gl.platforms" >
859         <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/** ${stub.includes.dir}/opengl/**" />
860
861         <antcall target="java.generate.window.system.os" inheritRefs="true" />
862         <antcall target="java.generate.platform.glext" inheritRefs="true" />
863     </target>
864
865     <!--
866        - Setup the generating ANT tasks and use it to generate the Java files 
867        - from the C GL headers.  This involves setting the taskdef and creating
868        - the classpath reference id then running the task on each header.
869       -->
870     <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip">
871
872         <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
873         <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
874                  classpathref="gluegen.classpath" />
875         <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask"
876                  classpathref="gluegen.classpath" />
877                  
878         <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the 
879            - Java files -->
880
881         <echo message="Generating GL interface and implementation" />
882         <antcall target="java.generate.gl.all"      inheritRefs="true" />
883         <!--antcall target="java.generate.gl.nsig" inheritRefs="true" /-->
884
885         <antcall target="java.generate.window.system.es"     inheritRefs="true" />
886         <antcall target="java.generate.window.system.es.ext" inheritRefs="true" />
887
888         <antcall target="java.generate.gl.platforms" inheritRefs="true">
889             <param name="window.os.system"                       value="x11"/>
890             <param name="window.os.cfg"                          value="${config}/glx-x11.cfg" />
891             <param name="glext.platform.cfg"                     value="${config}/glxext.cfg" />
892             <param name="glext.platform.header"                  value="${stub.includes.dir}/x11/glxext.c" />
893         </antcall>
894
895         <antcall target="java.generate.gl.platforms" inheritRefs="true">
896             <param name="window.os.system"                       value="win32"/>
897             <param name="window.os.cfg"                          value="${config}/wgl-win32.cfg" />
898             <param name="glext.platform.cfg"                     value="${config}/wglext.cfg" />
899             <param name="glext.platform.header"                  value="${stub.includes.dir}/win32/wglext.c" />
900         </antcall>          
901
902         <antcall target="java.generate.gl.platforms" inheritRefs="true">
903           <param name="window.os.system"                     value="macosx"/>
904           <param name="window.os.cfg"                        value="${config}/cgl-macosx.cfg" />
905           <param name="glext.platform.cfg"                   value="${config}/cglext.cfg" />
906           <param name="glext.platform.header"                value="${stub.includes.dir}/macosx/cglext.c" />
907         </antcall>
908     
909         <!-- Generate GLU class -->
910         <antcall target="java.generate.glu.base"   inheritrefs="true" />
911         <antcall target="java.generate.glu.GL2ES1" inheritrefs="true" />
912         <antcall target="java.generate.glu.GL2"    inheritrefs="true" />
913
914         <!-- Inform the user that the generators have successfully created 
915            - the necessary Java files -->
916         <echo message="" />
917         <echo message="GlueGen and BuildStaticGLInfo have successfully generated files." />
918     
919     </target>      
920
921     <target name="java.generate.cg.check">
922         <!-- Blow away all target files if any dependencies are violated
923              (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
924         <dependset>
925             <srcfileset refid="stub.includes.cg.dependencies.fileset" />
926             <targetfileset dir=".">
927                 <include name="${src.generated.java.cg}/**/*.java" />
928                 <include name="${src.generated.c.cg}/**/*.c" />
929             </targetfileset>
930         </dependset>
931
932         <!-- Now check for the presence of one well-known file -->
933         <uptodate property="java.generate.cg.skip">
934             <srcfiles refid="stub.includes.cg.dependencies.fileset" />
935             <mapper type="merge" to="${src.generated.java}/com/jogamp/opengl/cg/CgGL.java" />
936         </uptodate>
937     </target>
938
939     <!--
940        - Setup the generating ANT tasks and use it to generate the Java files 
941        - from the C GL headers.  This involves setting the taskdef and creating
942        - the classpath reference id then running the task on each header.
943       -->
944     <target name="java.generate.cg" depends="java.generate.cg.check" if="jogl.cg" unless="java.generate.cg.skip">
945         <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
946         <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
947                  classpathref="gluegen.classpath" />
948         <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask"
949                  classpathref="gluegen.classpath" />
950
951         <!-- Generate CgGL interface class -->
952         <gluegen src="${stub.includes.opengl}/cg.c" 
953                  outputRootDir="${build}"
954                  config="${config}/cg-common.cfg"
955                  includeRefid="stub.includes.cg.fileset.all"
956                  emitter="com.sun.gluegen.JavaEmitter">
957             <classpath refid="gluegen.classpath" />
958         </gluegen>
959     </target>
960
961     <!-- ================================================================== -->
962     <!-- 
963        - Build and dependency rules for the composable pipeline
964       -->
965     <target name="java.generate.composable.pipeline.check.es1">
966         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
967              (the uptodate element doesn't support arbitrary source and destination files) -->
968         <dependset>
969             <srcfilelist dir="${classes}/javax/media/opengl" files="GLES1.class" />
970             <targetfileset dir="${src.generated.java}/javax/media/opengl"
971                            includes="DebugGLES1.java,TraceGLES1.java" />
972         </dependset>
973                            
974         <!-- Now choose one of the two to test to see if we have to regenerate -->
975         <uptodate property="java.generate.composable.pipeline.skip.es1"
976                   srcfile="${classes}/javax/media/opengl/GLES1.class"
977                   targetfile="${src.generated.java}/javax/media/opengl/DebugGLES1.java" />
978
979     </target>        
980
981     <target name="java.generate.composable.pipeline.check.es2">
982         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
983              (the uptodate element doesn't support arbitrary source and destination files) -->
984         <dependset>
985             <srcfilelist dir="${classes}/javax/media/opengl" files="GLES2.class" />
986             <targetfileset dir="${src.generated.java}/javax/media/opengl"
987                            includes="DebugGLES2.java,TraceGLES2.java" />
988         </dependset>
989                            
990         <!-- Now choose one of the two to test to see if we have to regenerate -->
991         <uptodate property="java.generate.composable.pipeline.skip.es2"
992                   srcfile="${classes}/javax/media/opengl/GLES2.class"
993                   targetfile="${src.generated.java}/javax/media/opengl/DebugGLES2.java" />
994
995     </target>        
996
997     <target name="java.generate.composable.pipeline.check.gl2es12">
998         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
999              (the uptodate element doesn't support arbitrary source and destination files) -->
1000         <dependset>
1001             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES12.class" />
1002             <targetfileset dir="${src.generated.java}/javax/media/opengl"
1003                            includes="DebugGL2ES12.java,TraceGL2ES12.java" />
1004         </dependset>
1005                            
1006         <!-- Now choose one of the two to test to see if we have to regenerate -->
1007         <uptodate property="java.generate.composable.pipeline.skip.gl2es12"
1008                   srcfile="${classes}/javax/media/opengl/GL2ES12.class"
1009                   targetfile="${src.generated.java}/javax/media/opengl/DebugGL2ES12.java" />
1010     </target>        
1011
1012     <target name="java.generate.composable.pipeline.check.gl2">
1013         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
1014              (the uptodate element doesn't support arbitrary source and destination files) -->
1015         <dependset>
1016             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2.class" />
1017             <targetfileset dir="${src.generated.java}/javax/media/opengl"
1018                            includes="DebugGL2.java,TraceGL2.java" />
1019         </dependset>
1020
1021         <!-- Now choose one of the two to test to see if we have to regenerate -->
1022         <uptodate property="java.generate.composable.pipeline.skip.gl2"
1023                   srcfile="${classes}/javax/media/opengl/GL2.class"
1024                   targetfile="${src.generated.java}/javax/media/opengl/DebugGL2.java" />
1025     </target>        
1026
1027     <target name="java.generate.composable.pipeline.check.gl3">
1028         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
1029              (the uptodate element doesn't support arbitrary source and destination files) -->
1030         <dependset>
1031             <srcfilelist dir="${classes}/javax/media/opengl" files="GL3.class" />
1032             <targetfileset dir="${src.generated.java}/javax/media/opengl"
1033                            includes="DebugGL3.java,TraceGL3.java,DebugGL3bc.java,TraceGL3bc.java" />
1034         </dependset>
1035                            
1036         <!-- Now choose one of the two to test to see if we have to regenerate -->
1037         <uptodate property="java.generate.composable.pipeline.skip.gl3"
1038                   srcfile="${classes}/javax/media/opengl/GL3.class"
1039                   targetfile="${src.generated.java}/javax/media/opengl/DebugGL3.java" />
1040     </target>        
1041
1042     <target name="java.generate.composable.pipeline.es1" depends="java.generate.composable.pipeline.check.es1" unless="java.generate.composable.pipeline.skip.es1">
1043         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1044             <arg value="javax.media.opengl.GLES1" />
1045             <arg value="${src.generated.java}/javax/media/opengl" />
1046             <classpath refid="pipeline.classpath" />
1047         </java>
1048         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1049             <arg value="javax.media.opengl.GL2ES1" />
1050             <arg value="${src.generated.java}/javax/media/opengl" />
1051             <classpath refid="pipeline.classpath" />
1052         </java>
1053         <copy todir="${src.generated.java-cdc}">
1054             <fileset dir="${src.generated.java}"
1055                      includes="javax/media/opengl/DebugGLES1.java javax/media/opengl/TraceGLES1.java javax/media/opengl/DebugGL2ES1.java javax/media/opengl/TraceGL2ES1.java" />
1056         </copy>
1057     </target>          
1058
1059     <target name="java.generate.composable.pipeline.es2" depends="java.generate.composable.pipeline.check.es2" unless="java.generate.composable.pipeline.skip.es2">
1060         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1061             <arg value="javax.media.opengl.GLES2" />
1062             <arg value="${src.generated.java}/javax/media/opengl" />
1063             <classpath refid="pipeline.classpath" />
1064         </java>
1065         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1066             <arg value="javax.media.opengl.GL2ES2" />
1067             <arg value="${src.generated.java}/javax/media/opengl" />
1068             <classpath refid="pipeline.classpath" />
1069         </java>
1070         <copy todir="${src.generated.java-cdc}">
1071             <fileset dir="${src.generated.java}"
1072                      includes="javax/media/opengl/DebugGLES2.java javax/media/opengl/TraceGLES2.java javax/media/opengl/DebugGL2ES2.java javax/media/opengl/TraceGL2ES2.java" />
1073         </copy>
1074     </target>          
1075
1076     <target name="java.generate.composable.pipeline.gl2" depends="java.generate.composable.pipeline.check.gl2" unless="java.generate.composable.pipeline.skip.gl2">
1077         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1078             <arg value="javax.media.opengl.GL2" />
1079             <arg value="${src.generated.java}/javax/media/opengl" />
1080             <classpath refid="pipeline.classpath" />
1081         </java>
1082         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1083             <arg value="javax.media.opengl.GL2GL3" />
1084             <arg value="${src.generated.java}/javax/media/opengl" />
1085             <classpath refid="pipeline.classpath" />
1086         </java>
1087         <copy todir="${src.generated.java-cdc}">
1088             <fileset dir="${src.generated.java}"
1089                      includes="javax/media/opengl/DebugGL2.java javax/media/opengl/TraceGL2.java javax/media/opengl/DebugGL2GL3.java javax/media/opengl/TraceGL2GL3.java" />
1090         </copy>
1091     </target>          
1092
1093     <target name="java.generate.composable.pipeline.gl3" depends="java.generate.composable.pipeline.check.gl3" unless="java.generate.composable.pipeline.skip.gl3">
1094         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1095             <arg value="javax.media.opengl.GL3" />
1096             <arg value="${src.generated.java}/javax/media/opengl" />
1097             <classpath refid="pipeline.classpath" />
1098         </java>
1099         <copy todir="${src.generated.java-cdc}">
1100             <fileset dir="${src.generated.java}"
1101                      includes="javax/media/opengl/DebugGL3.java javax/media/opengl/TraceGL3.java" />
1102         </copy>
1103
1104         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1105             <arg value="javax.media.opengl.GL3bc" />
1106             <arg value="${src.generated.java}/javax/media/opengl" />
1107             <classpath refid="pipeline.classpath" />
1108         </java>
1109         <copy todir="${src.generated.java-cdc}">
1110             <fileset dir="${src.generated.java}"
1111                      includes="javax/media/opengl/DebugGL3bc.java javax/media/opengl/TraceGL3bc.java" />
1112         </copy>
1113     </target>          
1114
1115     <target name="java.generate.composable.pipeline" depends="java.generate.composable.pipeline.es1, java.generate.composable.pipeline.es2, java.generate.composable.pipeline.gl2, java.generate.composable.pipeline.gl3">
1116     </target>
1117
1118     <target name="java.generate.composable.pipeline.custom.check.glfixfunc">
1119         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
1120              (the uptodate element doesn't support arbitrary source and destination files) -->
1121         <dependset>
1122             <srcfilelist dir="${classes}/com/jogamp/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" />
1123             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES1.class" />
1124             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES2.class" />
1125             <targetfileset dir="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl"
1126                            includes="FixedFuncImpl.java" />
1127         </dependset>
1128                            
1129         <!-- Now choose one of the two to test to see if we have to regenerate -->
1130         <uptodate property="java.generate.composable.pipeline.custom.skip.glfixfunc"
1131                   srcfile="${classes}/javax/media/opengl/GL2ES1.class"
1132                   targetfile="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" />
1133     </target>        
1134     <target name="java.generate.composable.pipeline.custom.glfixfunc" depends="java.generate.composable.pipeline.custom.check.glfixfunc" unless="java.generate.composable.pipeline.custom.skip.glfixfunc">
1135         <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
1136             <arg value="javax.media.opengl.GL2ES1" />
1137             <arg value="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl" />
1138             <arg value="com.jogamp.opengl.util.glsl.fixedfunc.impl.FixedFuncImpl" />
1139             <arg value="com.jogamp.opengl.util.glsl.fixedfunc.impl.FixedFuncHook" />
1140             <arg value="javax.media.opengl.GL2ES2" />
1141             <arg value="prolog_xor_downstream" />
1142             <classpath refid="pipeline.classpath" />
1143         </java>
1144         <copy todir="${src.generated.java-cdc}">
1145             <fileset dir="${src.generated.java}"
1146                      includes="com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" />
1147         </copy>
1148     </target>          
1149     <target name="java.generate.composable.pipeline.custom" depends="init, build.gluegen, java.generate.composable.pipeline.custom.glfixfunc">
1150     </target>
1151
1152     <!-- ================================================================== -->
1153     <!-- 
1154        - Compile the original and generated source.  The composable pipelines
1155        - will be generated.
1156       -->
1157     <target name="java.compile.firstpass" depends="java.generate,java.generate.cg">
1158         <antcall target="java.generate.cleantemp" inheritRefs="true" />
1159
1160         <!-- Perform the first pass Java compile. -->
1161         <javac destdir="${classes}"
1162                includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2GL3.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java javax/media/opengl/GL3bc.java"
1163                fork="yes"
1164                memoryMaximumSize="${javac.memorymax}"
1165                source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
1166             <classpath refid="nativewindow_gluegen.classpath"/>
1167             <src path="${src.java}" />
1168             <src path="${src.generated.java}" />
1169         </javac>
1170
1171         <copy todir="${src.generated.java-cdc}">
1172             <fileset dir="${src.generated.java}"
1173                      includes="**" 
1174                      excludes="com/jogamp/opengl/cg/** com/jogamp/opengl/impl/gl2/** com/jogamp/opengl/impl/gl3/** com/jogamp/opengl/impl/glu/gl2/** javax/media/opengl/glu/gl2/**"/>
1175         </copy>
1176         <copy todir="${classes-cdc}">
1177             <fileset dir="${classes}"
1178                      includes="**" />
1179         </copy>
1180     </target>
1181
1182     <target name="java.compile.secondpass.javase">
1183         <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. -->
1184         <javac destdir="${classes}"
1185                excludes="com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}"
1186                source="${jogl.sourcelevel}"
1187                fork="yes"
1188                memoryMaximumSize="${javac.memorymax}"
1189                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
1190             <classpath refid="nativewindow_gluegen.classpath"/>
1191             <src path="${src.java}" />
1192             <src path="${src.generated.java}" />
1193         </javac>
1194     </target>
1195
1196     <target name="java.compile.secondpass.javacdc" unless="setup.noCDC">
1197         <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. -->
1198         <javac destdir="${classes-cdc}"
1199                excludes="com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all},${java.excludes.cdcfp}"
1200                source="${jogl.sourcelevel}"
1201                bootclasspath="${javac.bootclasspath-cdc.jar}"
1202                fork="yes"
1203                memoryMaximumSize="${javac.memorymax}"
1204                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
1205             <classpath refid="nativewindow_gluegen.classpath-cdc"/>
1206             <src path="${src.java}" />
1207             <src path="${src.generated.java-cdc}" />
1208         </javac>
1209     </target>
1210
1211     <target name="java.compile.secondpass" depends="java.generate.composable.pipeline, java.compile.secondpass.javase, java.compile.secondpass.javacdc" />
1212
1213     <target name="java.compile.thirdpass.javase">
1214         <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
1215         <javac destdir="${classes}"
1216                excludes="${java.excludes.all}"
1217                source="${jogl.sourcelevel}"
1218                fork="yes"
1219                memoryMaximumSize="${javac.memorymax}"
1220                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
1221             <classpath refid="nativewindow_gluegen.classpath"/>
1222             <src path="${src.java}" />
1223             <src path="${src.generated.java}" />
1224         </javac>
1225     </target>
1226
1227     <target name="java.compile.thirdpass.javacdc" unless="setup.noCDC">
1228         <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
1229         <javac destdir="${classes-cdc}"
1230                excludes="${java.excludes.all},${java.excludes.cdcfp}"
1231                source="${jogl.sourcelevel}"
1232                bootclasspath="${javac.bootclasspath-cdc.jar}"
1233                fork="yes"
1234                memoryMaximumSize="${javac.memorymax}"
1235                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
1236             <classpath refid="nativewindow_gluegen.classpath-cdc"/>
1237             <src path="${src.java}" />
1238             <src path="${src.generated.java-cdc}" />
1239         </javac>
1240     </target>
1241
1242     <target name="java.compile.thirdpass" depends="java.generate.composable.pipeline.custom, java.compile.thirdpass.javase, java.compile.thirdpass.javacdc" />
1243
1244     <target name="java.compile" depends="java.compile.firstpass,java.compile.secondpass,java.compile.thirdpass" />
1245
1246     <!-- ================================================================== -->
1247     <!-- 
1248        - Compile the native C code for JOGL (and optionally the Cg binding).
1249       -->
1250
1251     <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler">
1252       <!-- compiler configuration -->
1253       <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
1254
1255       <compiler id="compiler.cfg.freebsd.jogl" extends="compiler.cfg.freebsd">
1256         <!-- Need to force X11R6 headers on to include path after stub_includes -->
1257         <includepath path="stub_includes/opengl"/>
1258         <includepath path="/usr/X11R6/include" />
1259       </compiler>
1260
1261       <!-- linker configuration -->
1262  
1263       <linker id="linker.cfg.linux.jogl.gl2" extends="linker.cfg.linux">
1264         <syslibset dir="/usr/X11R6/lib" libs="X11"/>
1265         <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
1266         <syslibset dir="/usr/X11R6/lib" libs="GL"/>
1267       </linker>
1268
1269       <linker id="linker.cfg.linux.jogl.cg" extends="linker.cfg.linux.jogl.gl2">
1270         <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/>
1271       </linker>
1272
1273       <linker id="linker.cfg.linux.amd64.jogl.x11" extends="linker.cfg.linux.amd64">
1274         <syslibset dir="/usr/X11R6/lib64" libs="X11"/>
1275         <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" />
1276       </linker>
1277
1278       <linker id="linker.cfg.linux.amd64.jogl.gl2" extends="linker.cfg.linux.amd64.jogl.x11">
1279         <syslibset dir="/usr/X11R6/lib64" libs="GL"/>
1280       </linker>
1281
1282       <linker id="linker.cfg.linux.amd64.jogl.cg" extends="linker.cfg.linux.amd64.jogl.gl2">
1283         <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/>
1284       </linker>
1285
1286       <linker id="linker.cfg.solaris.jogl.x11" extends="linker.cfg.solaris">
1287         <syslibset libs="X11"/>
1288       </linker>
1289
1290       <linker id="linker.cfg.solaris.jogl.gl2" extends="linker.cfg.solaris.jogl.x11">
1291         <syslibset libs="GL"/>
1292       </linker>
1293
1294       <linker id="linker.cfg.solaris.jogl.cg" extends="linker.cfg.solaris.jogl.gl2">
1295         <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/>
1296       </linker>
1297
1298       <linker id="linker.cfg.solaris.sparcv9.jogl.gl2" extends="linker.cfg.solaris.sparcv9">
1299         <linkerarg value="-xarch=v9a" />
1300         <syslibset dir="/usr/openwin/lib/sparcv9" libs="GL"/>
1301         <syslibset dir="/usr/lib/sparcv9" libs="X11"/>
1302       </linker>
1303
1304       <linker id="linker.cfg.solaris.amd64.jogl.gl2" extends="linker.cfg.solaris.amd64">
1305         <linkerarg value="-xarch=amd64" />
1306         <syslibset dir="/usr/lib/amd64" libs="GL"/>
1307         <syslibset dir="/usr/lib/amd64" libs="X11"/>
1308       </linker>
1309
1310       <linker id="linker.cfg.win32.mingw.jogl" extends="linker.cfg.win32.mingw">
1311         <linkerarg value="-Wl,--kill-at" />        <!-- remove @ from function names -->
1312         <syslibset libs="opengl32, glu32, gdi32, kernel32"/>
1313       </linker>
1314
1315       <linker id="linker.cfg.win32.mingw.jogl.cg" extends="linker.cfg.win32.mingw.jogl">
1316         <syslibset dir="${windows.cg.lib}" libs="cg, cgGL"/>
1317       </linker>
1318
1319       <linker id="linker.cfg.win32.msvc.jogl" extends="linker.cfg.win32.msvc">
1320         <syslibset libs="opengl32, gdi32, user32, kernel32" />
1321     <!-- This is temporary -->
1322         <syslibset libs="winmm" />
1323       </linker>
1324
1325       <linker id="linker.cfg.win32.msvc.jogl.cg" extends="linker.cfg.win32.msvc.jogl">
1326         <syslibset dir="${windows.cg.lib}" libs="cg, cgGL"/>
1327       </linker>
1328
1329       <linker id="linker.cfg.macosx.jogl" extends="linker.cfg.macosx">
1330         <linkerarg value="-framework" />
1331         <linkerarg value="Cocoa" />
1332         <linkerarg value="-framework" />
1333         <linkerarg value="OpenGL" />
1334       </linker>
1335
1336       <linker id="linker.cfg.macosx.jogl.cg" extends="linker.cfg.macosx.jogl">
1337         <linkerarg value="-framework"/>
1338         <linkerarg value="Cg"/>
1339       </linker>
1340
1341       <linker id="linker.cfg.hpux.jogl" extends="linker.cfg.hpux">
1342         <syslibset dir="/opt/graphics/OpenGL/lib" libs="GL, GLU"/>
1343         <syslibset dir="/usr/lib" libs="X11"/>
1344       </linker>
1345     </target>
1346
1347     <target name="c.configure.win32.vc" if="isVCFamily">
1348       <echo message="Win32.VC" />
1349       <property name="compiler.cfg.id"                      value="compiler.cfg.win32.msvc" />
1350       <property name="linker.cfg.id.gl2"                    value="linker.cfg.win32.msvc.jogl" />
1351       <property name="linker.cfg.id.cg"                     value="linker.cfg.win32.msvc.jogl.cg" />
1352     </target>
1353     
1354     <target name="c.configure.win32.mingw" if="isMingW">
1355       <echo message="Win32.MingW" />
1356       <property name="compiler.cfg.id"                      value="compiler.cfg.win32.mingw" />
1357       <property name="linker.cfg.id.gl2"                    value="linker.cfg.win32.mingw.jogl" />
1358       <property name="linker.cfg.id.cg"                     value="linker.cfg.win32.mingw.jogl.cg" />
1359     </target>
1360
1361     <target name="c.configure.linux.x86" if="isLinuxX86">
1362       <echo message="Linux.x86" />
1363       <property name="compiler.cfg.id"                      value="compiler.cfg.linux" />
1364       <property name="linker.cfg.id.gl2"                    value="linker.cfg.linux.jogl.gl2" />
1365       <property name="linker.cfg.id.cg"                     value="linker.cfg.linux.jogl.cg" />
1366     </target>
1367     
1368     <target name="c.configure.linux.amd64" if="isLinuxAMD64">
1369       <echo message="Linux.AMD64" />
1370       <property name="compiler.cfg.id"                      value="compiler.cfg.linux.amd64" />
1371       <property name="linker.cfg.id.gl2"                    value="linker.cfg.linux.amd64.jogl.gl2" />
1372       <property name="linker.cfg.id.cg"                     value="linker.cfg.linux.amd64.jogl.cg" />
1373     </target>
1374     
1375     <target name="c.configure.linux.ia64" if="isLinuxIA64">
1376       <echo message="Linux.IA64" />
1377       <property name="compiler.cfg.id"                      value="compiler.cfg.linux" />
1378       <property name="linker.cfg.id.gl2"                    value="linker.cfg.linux.jogl.gl2" />
1379       <property name="linker.cfg.id.cg"                     value="linker.cfg.linux.jogl.cg" />
1380     </target>
1381
1382     <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
1383
1384     <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
1385       <echo message="Solaris" />
1386       <property name="compiler.cfg.id"                      value="compiler.cfg.solaris" />
1387       <property name="linker.cfg.id.gl2"                    value="linker.cfg.solaris.jogl.gl2" />
1388       <property name="linker.cfg.id.cg"                     value="linker.cfg.solaris.jogl.cg" />
1389     </target>
1390   
1391  
1392     <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
1393       <echo message="SolarisSparcv9" />
1394       <property name="compiler.cfg.id"                      value="compiler.cfg.solaris.sparcv9" />
1395       <property name="linker.cfg.id.gl2"                    value="linker.cfg.solaris.sparcv9.jogl.gl2" />
1396       <property name="linker.cfg.id.cg"                     value="linker.cfg.solaris.sparcv9.jogl.cg" />
1397     </target>
1398    
1399
1400     <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
1401       <echo message="SolarisAMD64" />
1402       <property name="compiler.cfg.id"                      value="compiler.cfg.solaris.amd64" />
1403       <property name="linker.cfg.id.gl2"                    value="linker.cfg.solaris.amd64.jogl.gl2" />
1404       <property name="linker.cfg.id.cg"                     value="linker.cfg.solaris.amd64.jogl.cg" />
1405     </target>
1406    
1407     <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
1408       <echo message="FreeBSD" />
1409       <property name="compiler.cfg.id"                      value="compiler.cfg.freebsd.jogl" />
1410       <property name="linker.cfg.id.gl2"                    value="linker.cfg.linux.jogl.gl2" />
1411       <property name="linker.cfg.id.cg"                     value="linker.cfg.linux.jogl.cg" />
1412     </target>
1413
1414     <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
1415       <echo message="HP-UX" />
1416       <property name="compiler.cfg.id"                      value="compiler.cfg.hpux" />
1417       <property name="linker.cfg.id.gl2"                    value="linker.cfg.hpux.jogl.gl2" />
1418       <property name="linker.cfg.id.cg"                     value="linker.cfg.hpux.jogl.cg" />
1419     </target>
1420
1421     <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
1422
1423     <target name="c.configure.x11" if="isX11" />
1424
1425     <target name="c.configure.macosx" if="isOSX">
1426       <property name="compiler.cfg.id"                      value="compiler.cfg.macosx" />
1427       <property name="linker.cfg.id.gl2"                    value="linker.cfg.macosx.jogl" />
1428       <property name="linker.cfg.id.cg"                     value="linker.cfg.macosx.jogl.cg" />
1429     </target>
1430     
1431     <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
1432
1433     <target name="c.configure" depends="c.configure.1,c.configure.2" />
1434
1435     <target name="rename.mingw.dll" if="isMingW">
1436         <move file="${src}" tofile="${dest}" />
1437     </target>
1438
1439     <target name="rename.dylib" if="isOSX">
1440         <move file="${src}" tofile="${dest}" />
1441         <copy file="${dest}" tofile="${dest-cdc}" />
1442     </target>
1443
1444     <macrodef name="c.build">
1445       <attribute name="c.compiler.src.files" />
1446       <attribute name="compiler.cfg.id" />
1447       <attribute name="linker.cfg.id" />
1448       <attribute name="output.lib.name" />
1449       <attribute name="c.compiler.use-jawt" default="false"/>
1450       <sequential>
1451         <echo message="Output lib name = @{output.lib.name}" />
1452
1453         <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
1454         <property name="c.compiler.debug"     value="false" /> 
1455         <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> 
1456         <property name="c.compiler.optimise"  value="none" /> 
1457
1458         <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
1459
1460         <patternset id="c.src.files.jogl.gl2">
1461           <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c" if="isOSX"/>
1462           <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
1463           <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/>
1464           <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
1465           <!-- FIXME: the Mixer should be moved to another library -->
1466           <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/-->
1467           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="useOpenMAX"/>
1468           <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c"  if="useOpenMAX"/>
1469
1470           <include name="${rootrel.generated.c.jogl}/gl2/GL2Impl_JNI.c"/>
1471           <include name="${rootrel.generated.c.jogl}/gl3/GL3Impl_JNI.c"/>
1472           <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
1473           <include name="${rootrel.generated.c.jogl}/gl2/GLUgl2_JNI.c"/>
1474           <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
1475           <include name="${rootrel.generated.c.jogl}/MacOSX/CGL*.c" if="isOSX"/>
1476           <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
1477         </patternset>
1478
1479         <patternset id="c.src.files.jogl.gl2es12">
1480           <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c" if="isOSX"/>
1481           <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
1482           <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/>
1483           <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
1484           <!-- FIXME: the Mixer should be moved to another library -->
1485           <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/-->
1486           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="useOpenMAX"/>
1487           <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c"  if="useOpenMAX"/>
1488
1489           <include name="${rootrel.generated.c.jogl}/gl2es12/GL2ES12Impl_JNI.c"/>
1490           <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
1491           <!--include name="${rootrel.generated.c.jogl}/gl2es12/GLUgl2es12_JNI.c"/ SKIPPED -->
1492           <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
1493           <include name="${rootrel.generated.c.jogl}/MacOSX/CGL*.c" if="isOSX"/>
1494           <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
1495         </patternset>
1496
1497         <patternset id="c.src.files.jogl.es2">
1498           <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
1499           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="useOpenMAX"/>
1500           <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c"  if="useOpenMAX"/>
1501
1502           <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
1503           <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/>
1504           <include name="${rootrel.generated.c.jogl}/es2/GLES2Impl_JNI.c"/>
1505         </patternset>
1506
1507         <patternset id="c.src.files.jogl.es1">
1508           <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
1509           <include name="${rootrel.src.c.openmax}/omx_tool.c"  if="useOpenMAX"/>
1510           <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c"  if="useOpenMAX"/>
1511
1512           <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
1513           <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/>
1514           <include name="${rootrel.generated.c.jogl}/es1/GLES1Impl_JNI.c"/>
1515           <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
1516           <!--include name="${rootrel.generated.c.jogl}/es1/GLUes1_JNI.c" EMPTY /-->
1517         </patternset>
1518
1519         <patternset id="c.src.files.cg">
1520           <include name="${rootrel.generated.c.cg}/*.c"/>
1521         </patternset>
1522
1523         <echo message="Compiling @{output.lib.name}" />
1524
1525         <cc outtype="shared" 
1526             objdir="${obj.jogl}" 
1527             outfile="${obj}/@{output.lib.name}"
1528             optimize="${c.compiler.optimise}" 
1529             debug="${c.compiler.debug}"
1530             multithreaded="true" 
1531             exceptions="false" 
1532             rtti="false">   
1533   
1534           <!-- TODO: versioninfo  companyname="java.net"
1535                         legalcopyright="Copyright"
1536                         productname="JOGL" 
1537                         productversion="x.y.z"
1538                         description="Description"
1539                         fileversion="x.y.z" 
1540                         filecomments="File Comment" /-->      
1541   
1542           <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
1543   
1544           <compiler extends="@{compiler.cfg.id}" >
1545             <sysincludepath path="${java.includes.dir}"/>
1546             <sysincludepath path="${java.includes.dir.platform}"/>
1547             <includepath path="stub_includes/opengl"/>
1548             <includepath path="stub_includes/egl"/>
1549             <includepath path="stub_includes/openmax" if="useOpenMAX"/>
1550             <includepath path="stub_includes/cg" if="jogl.cg"/>        
1551   
1552             <!-- This is for the generated headers for handwritten C code -->
1553             <includepath path="${src.generated.c}" />
1554             <includepath path="${src.generated.c}/X11" if="isX11"/>
1555             <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
1556             <includepath path="${src.generated.c}/Windows" if="isWindows"/>
1557             <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
1558   
1559             <!-- This must come last to not override real include paths -->
1560             <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
1561           </compiler>
1562
1563           <linker extends="@{linker.cfg.id}">
1564             <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
1565             <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
1566           </linker>
1567         </cc>
1568
1569         <!-- FIXME: this is a hack; the cpptask should have an option to change the
1570              suffix or at least understand the override from dylib to jnilib -->
1571         <antcall target="rename.dylib" inheritRefs="true">
1572             <param name="src"  value="${build}/obj/lib@{output.lib.name}.dylib" />
1573             <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" />
1574             <param name="dest-cdc" value="${build}/obj/lib@{output.lib.name}.so" />
1575         </antcall>
1576
1577         <!-- FIXME: this is a hack; the cpptask should have an option to change the
1578              suffix or at least understand the override from dylib to jnilib -->
1579         <antcall target="rename.mingw.dll" inheritRefs="true">
1580             <param name="src"  value="${build}/obj/lib@{output.lib.name}.so" />
1581             <param name="dest" value="${build}/obj/@{output.lib.name}.dll" />
1582         </antcall>
1583       </sequential>
1584     </macrodef>  
1585
1586     <target name="c.build.jogl.prepare.openMAX" if="useOpenMAX">
1587       <javah destdir="${src.generated.c.openmax}" classpath="${classes-cdc}" class="com.jogamp.openmax.OMXInstance" />
1588     </target>
1589
1590     <target name="c.build.jogl.prepare" depends="c.build.jogl.prepare.openMAX">
1591       <!-- Generate the waveout Mixer header -->
1592       <!-- FIXME: this is temporary until we move this to another workspace -->
1593       <!--javah destdir="${build}/gensrc/native/jogl" classpath="${classes}" class="com.jogamp.audio.windows.waveout.Mixer" /-->
1594     </target>
1595
1596     <target name="c.build.jogl.gl2" unless="setup.nodesktop">
1597       <c.build c.compiler.src.files="c.src.files.jogl.gl2"
1598                output.lib.name="jogl_gl2"
1599                compiler.cfg.id="${compiler.cfg.id}"
1600                linker.cfg.id="${linker.cfg.id.gl2}"/>
1601     </target>
1602
1603     <target name="c.build.jogl.gl2es12" unless="setup.nodesktop">
1604       <c.build c.compiler.src.files="c.src.files.jogl.gl2es12"
1605                output.lib.name="jogl_gl2es12"
1606                compiler.cfg.id="${compiler.cfg.id}"
1607                linker.cfg.id="${linker.cfg.id.gl2}"/>
1608     </target>
1609
1610     <target name="c.build.jogl.es2">
1611       <c.build c.compiler.src.files="c.src.files.jogl.es2"
1612                output.lib.name="jogl_es2"
1613                compiler.cfg.id="${compiler.cfg.id}"
1614                linker.cfg.id="${linker.cfg.id.base}"/>
1615     </target>
1616
1617     <target name="c.build.jogl.es1">
1618       <c.build c.compiler.src.files="c.src.files.jogl.es1"
1619                output.lib.name="jogl_es1"
1620                compiler.cfg.id="${compiler.cfg.id}"
1621                linker.cfg.id="${linker.cfg.id.base}"/>
1622     </target>
1623
1624     <target name="c.build.jogl.cg" if="jogl.cg">
1625       <c.build c.compiler.src.files="c.src.files.cg"
1626                output.lib.name="jogl_cg"
1627                compiler.cfg.id="${compiler.cfg.id}"
1628                linker.cfg.id="${linker.cfg.id.cg}"/>
1629     </target>
1630     
1631     <target name="c.manifest.cg" if="jogl.cg">
1632       <msvc.manifest objdir="${obj}" dllname="jogl_cg" />
1633     </target>
1634
1635     <target name="c.manifest" if="isVC8Family">
1636       <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll -->
1637       <msvc.manifest objdir="${obj}" dllname="jogl_es1" />
1638       <msvc.manifest objdir="${obj}" dllname="jogl_es2" />
1639       <msvc.manifest objdir="${obj}" dllname="jogl_gl2" />
1640       <msvc.manifest objdir="${obj}" dllname="jogl_gl2es12" />
1641       <antcall target="c.manifest.cg" inheritRefs="true" />
1642     </target>
1643
1644     <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.gl2es12,c.build.jogl.gl2,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
1645       <antcall target="c.manifest" inheritRefs="true" />
1646       <!-- Create the Java Web Start jar file for the built native code -->
1647       <jar destfile="${build}/jogl-natives-${os.and.arch}.jar" filesonly="true">
1648         <fileset dir="${obj}">
1649           <include name="*.${native.library.suffix}" />
1650         </fileset>
1651       </jar>
1652       <jar destfile="${build}/jogl-natives-${os.and.arch}-cdc.jar" filesonly="true">
1653         <fileset dir="${obj}">
1654           <include name="*_es1.${native.library.suffix-cdc}" />
1655           <include name="*_es2.${native.library.suffix-cdc}" />
1656           <include name="*_gl2es12.${native.library.suffix-cdc}" />
1657         </fileset>
1658       </jar>
1659     </target>
1660
1661     <!-- ================================================================== -->
1662     <!--
1663        - Build the jogl.jar files.
1664       -->
1665     <target name="jar" depends="java.compile,build-jars-javase,build-jars-cdc"/>
1666
1667     <target name="setup-manifestfile">
1668         <condition property="manifestfile" value="joglRIversion">
1669             <isset property="jogl.ri" />
1670         </condition>
1671         <condition property="manifestfile" value="joglversion">
1672             <not>
1673                 <isset property="jogl.ri" />
1674             </not>
1675         </condition>
1676         <tstamp>
1677              <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
1678         </tstamp>
1679         <copy file="${manifestfile}"
1680             tofile="${build}/tempversion"
1681             overwrite="true">
1682             <filterset>
1683                 <!-- This token only exists in the non-RI version of the manifest -->
1684                 <filter token="VERSION" value="${jogl_base_version}-pre-${timestamp}"/>
1685                 <!-- This token exists in both the RI and non-RI versions of the manifest -->
1686                 <filter token="BASEVERSION" value="${jogl_base_version}"/>
1687             </filterset>
1688         </copy>
1689     </target>
1690
1691     <target name="setup-manifestfile-cdc" unless="setup.noCDC">
1692         <condition property="manifestfile" value="joglRIversion-cdc">
1693             <isset property="jogl.ri" />
1694         </condition>
1695         <condition property="manifestfile" value="joglversion-cdc">
1696             <not>
1697                 <isset property="jogl.ri" />
1698             </not>
1699         </condition>
1700         <tstamp>
1701              <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
1702         </tstamp>
1703         <copy file="${manifestfile}"
1704             tofile="${build}/tempversion-cdc"
1705             overwrite="true">
1706             <filterset>
1707                 <!-- This token only exists in the non-RI version of the manifest -->
1708                 <filter token="VERSION" value="${jogl_base_version}-pre-${timestamp}"/>
1709                 <!-- This token exists in both the RI and non-RI versions of the manifest -->
1710                 <filter token="BASEVERSION" value="${jogl_base_version}"/>
1711             </filterset>
1712         </copy>
1713     </target>
1714
1715     <target name="build-cg-jar" depends="setup-manifestfile" if="jogl.cg">
1716         <jar manifest="${build}/tempversion" destfile="${jogl.cg.jar}" filesonly="true">
1717             <fileset dir="${classes}"
1718                      includes="${java.part.nv-cg}"/>
1719         </jar>
1720     </target>
1721
1722     <target name="build-jars-es-desktop" depends="setup-manifestfile" unless="setup.nodesktop">
1723         <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.x11.jar}" filesonly="true">
1724             <fileset dir="${classes}"
1725                      includes="${java.part.glx}, ${java.part.gl2es12}, ${java.part.openmax}"
1726                      excludes="${java.part.glugl2}"/>
1727         </jar>
1728         <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.win.jar}" filesonly="true">
1729             <fileset dir="${classes}"
1730                      includes="${java.part.wgl}, ${java.part.gl2es12}, ${java.part.openmax}"
1731                      excludes="${java.part.glugl2}"/>
1732         </jar>
1733         <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.osx.jar}" filesonly="true">
1734             <fileset dir="${classes}"
1735                      includes="${java.part.cgl}, ${java.part.gl2es12}, ${java.part.openmax}"
1736                      excludes="${java.part.glugl2}"/>
1737         </jar>
1738     </target>
1739
1740     <target name="build-jars-es" depends="setup-manifestfile,build-jars-es-desktop">
1741         <jar manifest="${build}/tempversion" destfile="${jogl.egl.jar}" filesonly="true">
1742             <fileset dir="${classes}"
1743                      includes="${java.part.egl}"
1744                      excludes="${java.part.awt}"/>
1745         </jar>
1746         <jar manifest="${build}/tempversion" destfile="${jogl.gles1.jar}" filesonly="true">
1747             <fileset dir="${classes}"
1748                      includes="${java.part.es1}"
1749                      excludes="${java.part.es1.dbg}"/>
1750         </jar>
1751         <jar manifest="${build}/tempversion" destfile="${jogl.gles1.dbg.jar}" filesonly="true">
1752             <fileset dir="${classes}"
1753                      includes="${java.part.es1.dbg}"/>
1754         </jar>
1755         <jar manifest="${build}/tempversion" destfile="${jogl.gles2.jar}" filesonly="true">
1756             <fileset dir="${classes}"
1757                      includes="${java.part.es2}, ${java.part.openmax}"
1758                      excludes="${java.part.es2.dbg}"/>
1759         </jar>
1760         <jar manifest="${build}/tempversion" destfile="${jogl.gles2.dbg.jar}" filesonly="true">
1761             <fileset dir="${classes}"
1762                      includes="${java.part.es2.dbg}"/>
1763         </jar>
1764     </target>
1765
1766     <target name="build-jars-es-desktop-cdc" depends="setup-manifestfile-cdc" unless="setup.nodesktop">
1767         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gl2es12.x11.cdc.jar}" filesonly="true">
1768             <fileset dir="${classes-cdc}"
1769                      includes="${java.part.glx}, ${java.part.gl2es12}, ${java.part.openmax}"
1770                      excludes="${java.part.glugl2}"/>
1771         </jar>
1772         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gl2es12.win.cdc.jar}" filesonly="true">
1773             <fileset dir="${classes-cdc}"
1774                      includes="${java.part.wgl}, ${java.part.gl2es12}, ${java.part.openmax}"
1775                      excludes="${java.part.glugl2}"/>
1776         </jar>
1777         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gl2es12.osx.cdc.jar}" filesonly="true">
1778             <fileset dir="${classes-cdc}"
1779                      includes="${java.part.cgl}, ${java.part.gl2es12}, ${java.part.openmax}"
1780                      excludes="${java.part.glugl2}"/>
1781         </jar>
1782     </target>
1783
1784     <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc,build-jars-es-desktop-cdc" unless="setup.noCDC">
1785         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.egl.cdc.jar}" filesonly="true">
1786             <fileset dir="${classes-cdc}"
1787                      includes="${java.part.egl}"
1788                      excludes="${java.part.awt}"/>
1789         </jar>
1790         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gles1.cdc.jar}" filesonly="true">
1791             <fileset dir="${classes-cdc}"
1792                      includes="${java.part.es1}"
1793                      excludes="${java.part.es1.dbg}"/>
1794         </jar>
1795         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gles1.dbg.cdc.jar}" filesonly="true">
1796             <fileset dir="${classes-cdc}"
1797                      includes="${java.part.es1.dbg}"/>
1798         </jar>
1799         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gles2.cdc.jar}" filesonly="true">
1800             <fileset dir="${classes-cdc}"
1801                      includes="${java.part.es2}, ${java.part.openmax}"
1802                      excludes="${java.part.es2.dbg}"/>
1803         </jar>
1804         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gles2.dbg.cdc.jar}" filesonly="true">
1805             <fileset dir="${classes-cdc}"
1806                      includes="${java.part.es2.dbg}"/>
1807         </jar>
1808     </target>
1809
1810     <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT">
1811         <jar manifest="${build}/tempversion" destfile="${jogl.awt.jar}" filesonly="true">
1812             <fileset dir="${classes}"
1813                      includes="${java.part.awt}" />
1814         </jar>
1815         <jar manifest="${build}/tempversion" destfile="${jogl.util.awt.jar}" filesonly="true">
1816             <fileset dir="${classes}"
1817                      includes="${java.part.util.awt}"/>
1818         </jar>
1819     </target>
1820
1821     <target name="build-jars-all-awt" depends="setup-manifestfile" unless="setup.noall">
1822         <jar manifest="${build}/tempversion" destfile="${jogl.all.jar}" filesonly="true">
1823             <fileset dir="${classes}">
1824                 <include name="javax/media/opengl/**" />
1825                 <include name="com/jogamp/gluegen/runtime/**" />
1826                 <include name="com/jogamp/opengl/**" />
1827                 <include name="${java.part.openmax}" />
1828                 <!-- FIXME: this is temporary until we move these classes to another workspace -->
1829                 <include name="com/jogamp/**" />
1830             </fileset>
1831             <fileset dir="${src.java}"
1832                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
1833         </jar>
1834     </target>
1835     <target name="build-jars-all-noawt" depends="setup-manifestfile">
1836         <jar manifest="${build}/tempversion" destfile="${jogl.all-noawt.jar}" filesonly="true">
1837             <fileset dir="${classes}"
1838                 includes="javax/media/opengl/** com/jogamp/gluegen/runtime/** com/jogamp/opengl/** ${java.part.openmax} com/jogamp/**"
1839                 excludes="${java.part.awt} ${java.part.util.awt}">
1840             </fileset>
1841             <fileset dir="${src.java}"
1842                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
1843         </jar>
1844     </target>
1845     <target name="build-jars-all-cdc" depends="setup-manifestfile">
1846         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.all.cdc.jar}" filesonly="true">
1847             <fileset dir="${classes-cdc}"
1848                      includes="${java.part.core} ${java.part.egl} ${java.part.glutess} ${java.part.glumipmap} ${java.part.openmax} ${java.part.sdk} ${java.part.glx} ${java.part.cgl} ${java.part.gl2es12} ${java.part.wgl} ${java.part.es1} ${java.part.es1.dbg} ${java.part.es2} ${java.part.es2.dbg} ${java.part.util} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}"
1849                      excludes="${java.excludes.cdcfp}"/>
1850             <fileset dir="${src.java}"
1851                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
1852         </jar>
1853     </target>
1854
1855
1856     <target name="build-jars-cdc" depends="setup-manifestfile-cdc, build-jars-es-cdc, build-jars-all-cdc" unless="setup.noCDC">
1857         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.core.cdc.jar}" filesonly="true">
1858             <fileset dir="${classes-cdc}"
1859                      includes="${java.part.core}"
1860                      excludes="${java.part.core.exclude}"/>
1861         </jar>
1862         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.glutess.cdc.jar}" filesonly="true">
1863             <fileset dir="${classes-cdc}"
1864                      includes="${java.part.glutess}"/>
1865         </jar>
1866         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.glumipmap.cdc.jar}" filesonly="true">
1867             <fileset dir="${classes-cdc}"
1868                      includes="${java.part.glumipmap}"/>
1869         </jar>
1870         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.util.cdc.jar}" filesonly="true">
1871             <fileset dir="${classes-cdc}"
1872                      includes="${java.part.util} ${java.part.util.glsl}"
1873                      excludes="${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.fixedfuncemu}"/>
1874         </jar>
1875         <jar manifest="${build}/tempversion-cdc" destfile="${jogl.util.fixedfuncemu.cdc.jar}" filesonly="true">
1876             <fileset dir="${classes-cdc}"
1877                      includes="${java.part.util.fixedfuncemu}"/>
1878             <fileset dir="${src.java}"
1879                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
1880         </jar>
1881     </target>
1882
1883     <target name="build-jars-desktop-javase" depends="setup-manifestfile" unless="setup.nodesktop">
1884         <jar manifest="${build}/tempversion" destfile="${jogl.gl2.x11.jar}" filesonly="true">
1885             <fileset dir="${classes}"
1886                      includes="${java.part.glx}, ${java.part.gl2}, ${java.part.gl3}, ${java.part.openmax}"
1887                      excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/>
1888         </jar>
1889         <jar manifest="${build}/tempversion" destfile="${jogl.gl2.win.jar}" filesonly="true">
1890             <fileset dir="${classes}"
1891                      includes="${java.part.wgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}"
1892                      excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/>
1893         </jar>
1894         <jar manifest="${build}/tempversion" destfile="${jogl.gl2.osx.jar}" filesonly="true">
1895             <fileset dir="${classes}"
1896                      includes="${java.part.cgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}"
1897                      excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/>
1898         </jar>
1899         <jar manifest="${build}/tempversion" destfile="${jogl.gl2.dbg.jar}" filesonly="true">
1900             <fileset dir="${classes}"
1901                      includes="${java.part.gl2.dbg} ${java.part.gl3.dbg}"/>
1902         </jar>
1903         <jar manifest="${build}/tempversion" destfile="${jogl.glugl2.jar}" filesonly="true">
1904             <fileset dir="${classes}"
1905                      includes="${java.part.glugl2}"/>
1906         </jar>
1907         <jar manifest="${build}/tempversion" destfile="${jogl.util.gl2.jar}" filesonly="true">
1908             <fileset dir="${classes}"
1909                      includes="${java.part.util.gl2}"
1910                      excludes="com/jogamp/opengl/**/awt/**"/>
1911         </jar>
1912     </target>
1913
1914     <target name="build-jars-javase" depends="setup-manifestfile, build-jars-es, build-jars-awt, build-cg-jar, build-jars-all-awt, build-jars-all-noawt, build-jars-desktop-javase">
1915         <jar manifest="${build}/tempversion" destfile="${jogl.core.jar}" filesonly="true">
1916             <fileset dir="${classes}"
1917                      includes="${java.part.core}"
1918                      excludes="${java.part.core.exclude}"/>
1919         </jar>
1920         <jar manifest="${build}/tempversion" destfile="${jogl.sdk.jar}" filesonly="true">
1921             <fileset dir="${classes}"
1922                      includes="${java.part.sdk}"/>
1923         </jar>
1924         <jar manifest="${build}/tempversion" destfile="${jogl.glutess.jar}" filesonly="true">
1925             <fileset dir="${classes}"
1926                      includes="${java.part.glutess}"/>
1927         </jar>
1928         <jar manifest="${build}/tempversion" destfile="${jogl.glumipmap.jar}" filesonly="true">
1929             <fileset dir="${classes}"
1930                      includes="${java.part.glumipmap}"/>
1931         </jar>
1932         <jar manifest="${build}/tempversion" destfile="${jogl.util.jar}" filesonly="true">
1933             <fileset dir="${classes}"
1934                      includes="${java.part.util} ${java.part.util.glsl}"
1935                      excludes="${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.fixedfuncemu}"/>
1936         </jar>
1937         <jar manifest="${build}/tempversion" destfile="${jogl.util.fixedfuncemu.jar}" filesonly="true">
1938             <fileset dir="${classes}"
1939                      includes="${java.part.util.fixedfuncemu}"/>
1940             <fileset dir="${src.java}"
1941                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
1942         </jar>
1943     </target>
1944
1945     <!-- ================================================================== -->
1946     <!--
1947        - Build the Javadocs for the sources.
1948        - NOTE:  these are not entirely correct as the javadocs targets depend 
1949        -        on the platform specific build targets.  To circumvent any 
1950        -        errors, ensure that the source is built first.
1951       -->
1952     <target name="javadoc.nocg" depends="load.user.properties,init" unless="jogl.cg">
1953         <!-- Build the general public Javadoc -->
1954         <javadoc packagenames="${javadoc.packagenames}"
1955                  excludepackagenames="${java.excludes.javadoc.packagenames}"
1956                  sourcepath="${src.java};${src.generated.java}"        
1957                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
1958                  overview="${javadoc.overview}" 
1959                  source="1.4"
1960                  maxmemory="512m"
1961                  linkoffline="${javadoc.link} 142-packages"
1962          bottom="${javadoc.bottom}" >
1963           <classpath refid="nativewindow_gluegen.classpath"/>
1964           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
1965         </javadoc>
1966     </target>
1967
1968     <!-- Same as above but with Cg directories added -->
1969     <target name="javadoc.cg" depends="load.user.properties,init" if="jogl.cg">
1970         <!-- Build the general public Javadoc with CG -->
1971         <javadoc packagenames="${javadoc.packagenames},com.jogamp.opengl.cg"
1972                  excludepackagenames="${java.excludes.javadoc.packagenames}"
1973                  sourcepath="${src.java};${src.generated.java}"        
1974                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
1975                  overview="${javadoc.overview}" 
1976                  source="1.4"
1977                  maxmemory="512m"
1978                  linkoffline="${javadoc.link} 142-packages"
1979          bottom="${javadoc.bottom}" >
1980           <classpath refid="nativewindow_gluegen.classpath"/>
1981           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
1982         </javadoc>
1983     </target>
1984
1985     <target name="javadoc" depends="javadoc.nocg,javadoc.cg" />
1986
1987     <target name="javadoc.spec.nocg" depends="load.user.properties,init" unless="jogl.cg">
1988         <!-- Build the specification Javadoc -->
1989         <javadoc packagenames="${javadoc.spec.packagenames}"
1990                  excludepackagenames="${java.excludes.javadoc.packagenames}"
1991                  sourcepath="${src.java};${src.generated.java}"
1992                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
1993                  overview="${javadoc.overview}"
1994                  source="1.4"
1995                  maxmemory="512m"
1996                  linkoffline="${javadoc.link} 142-packages"
1997                  bottom="${javadoc.bottom}" >
1998           <classpath refid="nativewindow_gluegen.classpath"/>
1999           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
2000         </javadoc>
2001     </target>
2002                                                                                                                                    
2003     <!-- Same as above since Cg directories are not part of spec -->
2004     <target name="javadoc.spec.cg" depends="load.user.properties,init" if="jogl.cg">
2005         <!-- Build the specification Javadoc with CG -->
2006         <javadoc packagenames="${javadoc.spec.packagenames}"
2007                  excludepackagenames="${java.excludes.javadoc.packagenames}"
2008                  sourcepath="${src.java};${src.generated.java}"
2009                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
2010                  overview="${javadoc.overview}"
2011                  source="1.4"
2012                  maxmemory="512m"
2013                  linkoffline="${javadoc.link} 142-packages"
2014                  bottom="${javadoc.bottom}" >
2015           <classpath refid="nativewindow_gluegen.classpath"/>
2016           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
2017         </javadoc>
2018     </target>
2019
2020     <target name="javadoc.spec" depends="javadoc.spec.nocg,javadoc.spec.cg" />
2021
2022     <target name="javadoc.dev.nocg" unless="jogl.cg">
2023         <!-- Build the internal developer Javadoc -->
2024         <javadoc packagenames="${javadoc.dev.packagenames}"
2025                  excludepackagenames="${java.excludes.javadoc.packagenames}"
2026                  sourcepath="${src.java};${src.generated.java}"        
2027                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
2028                  overview="${javadoc.overview}" 
2029                  source="1.4"
2030                  maxmemory="512m"
2031                  linkoffline="${javadoc.link} 142-packages"
2032          bottom="${javadoc.bottom}" >
2033           <classpath refid="nativewindow_gluegen.classpath"/>
2034           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
2035         </javadoc>
2036     </target>
2037
2038     <!-- Same as above but with Cg directories added -->
2039     <target name="javadoc.dev.cg" if="jogl.cg">
2040         <!-- Build the internal developer Javadoc -->
2041         <javadoc packagenames="${javadoc.dev.packagenames},com.jogamp.opengl.cg"
2042                  excludepackagenames="${java.excludes.javadoc.packagenames}"
2043                  sourcepath="${src.java};${src.generated.java}"        
2044                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
2045                  overview="${javadoc.overview}" 
2046                  source="1.4"
2047                  maxmemory="512m"
2048                  linkoffline="${javadoc.link} 142-packages"
2049          bottom="${javadoc.bottom}" >
2050           <classpath refid="nativewindow_gluegen.classpath"/>
2051           <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
2052         </javadoc>
2053     </target>
2054
2055     <target name="javadoc.dev.all"  depends="load.user.properties,init,javadoc.dev.nocg,javadoc.dev.cg" />
2056
2057     <target name="all.doc" description="Build JOGL docs" depends="init,javadoc,javadoc.spec,javadoc.dev.all" />
2058
2059     <!-- ================================================================== -->
2060     <!--
2061        - Clean up all that is built.
2062       -->
2063     <target name="clean" description="Remove all build products" depends="declare.common">
2064         <delete includeEmptyDirs="true" quiet="true">
2065             <fileset dir="${tempdir}" />
2066             <fileset dir="${build}" />
2067             <fileset dir="${javadoc}" />
2068             <fileset dir="${javadoc.spec}" />
2069             <fileset dir="${javadoc.dev}" />
2070         </delete>
2071     </target>
2072
2073     <!-- ================================================================== -->
2074     <!--
2075        - Build/run junit.
2076       -->
2077     <target name="junit.compile" depends="init">
2078         <!-- Perform the junit pass Java compile -->
2079         <javac destdir="${classes}"
2080                source="${junit.sourcelevel}"
2081                fork="yes"
2082                memoryMaximumSize="${javac.memorymax}"
2083                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
2084             <classpath refid="jogl_junit.compile.classpath"/>
2085             <src path="${src.junit}" />
2086         </javac>
2087         <jar destfile="${jogl.test.jar}" filesonly="true">
2088             <fileset dir="${classes}">
2089                 <include name="com/jogamp/opengl/test/**" />
2090             </fileset>
2091         </jar>
2092     </target>
2093
2094     <target name="junit.run" depends="declare.common">
2095         <condition property="system.env.library.path"
2096                    value="LD_LIBRARY_PATH">
2097           <not>
2098            <isset property="isWindows"/> 
2099           </not>
2100         </condition>
2101         <condition property="system.env.library.path"
2102                    value="PATH">
2103           <isset property="isWindows"/> 
2104         </condition>
2105
2106         <!-- Perform the junit tests-->
2107         <mkdir dir="${build}/results"/>
2108         <junit forkmode="once" showoutput="true" fork="true" haltonerror="true">
2109             <env key="${system.env.library.path}" path="${all.so.dir}"/>
2110             <formatter usefile="false" type="plain"/>
2111             <formatter usefile="true" type="xml"/>
2112             <classpath refid="jogl_junit.run.classpath"/>
2113
2114             <test name="com.jogamp.opengl.test.junit.texture.awt.Texture1" todir="${build}/results"/>
2115
2116         </junit>
2117     </target>
2118
2119     <!-- ================================================================== -->
2120     <!--
2121        - Build everything.
2122       -->
2123     <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl,generate.version.txt,junit.compile" />
2124
2125     <target name="setup-version-RI" if="jogl.ri">
2126         <property name="tmp.version" value="${jogl_base_version}" />
2127     </target>
2128
2129     <target name="setup-version-non-RI" unless="jogl.ri">
2130         <tstamp>
2131              <format property="version.timestamp" pattern="yyyyMMdd"/>
2132         </tstamp>
2133         <property name="tmp.version" value="${jogl_base_version}-pre-${version.timestamp}" />
2134     </target>
2135
2136     <target name="generate.version.txt" depends="setup-version-RI,setup-version-non-RI">
2137         <!-- Create a version.txt file indicating which version we just built -->
2138         <echo message="${tmp.version}" file="${build}/version.txt" />
2139     </target>
2140
2141     <!-- ================================================================== -->
2142     <!--
2143        - Build everything and use Sun's Implementation tag in the manifest to
2144        - indicate this is the Reference Implementation.
2145       -->
2146     <target name="RI">
2147         <!-- Set property for using the RI manifest file so jogl.jar is versioned
2148            - properly
2149           -->
2150           <property name="jogl.ri" value="true" />
2151           <antcall target="all" inheritRefs="true" />
2152     </target>
2153 </project>
http://JogAmp.org git info: FAQ, tutorial and man pages.