summaryrefslogtreecommitdiffstats
path: root/doc/HowToBuild.html
blob: 35038597f390b416b6e7601304a02e288e4b784e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../../style.css" rel="stylesheet" type="text/css"/>
        <title>How to build JOGL</title>
    </head>
    <body>
        <div id="container">
            <div id="header">
                <div id="slogan">How to build JOGL</div>
                <div id="logo"><a href="http://jogamp.org/">How to build JOGL</a></div>
            </div>
            <div id="menu">
                <ul>
                    <li><a href="http://jogamp.org/">Home</a></li>
                    <li><a href="../../gluegen/www/">Gluegen</a></li>
                    <li><a href="../../joal/www/">JOAL</a></li>
                    <li><a href="../../jocl/www/">JOCL</a></li>
                    <li><a href="../../jogl/www/">JOGL</a></li>
                    <li><a href="../../demos/www/">Demos</a></li>
                    <li><a href="../../wiki/">Wiki</a></li>
                    <li><a href="../../deployment/jogl-next/javadoc_public/">JavaDoc</a></li>
                    <li><a href="../../blog/">Blogs</a></li>
                    <li><a href="../../forum.html">Forums</a></li>
                </ul>
            </div>
            <div id="main">
                <div id="text" class="fill">

                    <h2>Platform and Component Requirements</h2>
                    <hr/>
                    Here is a list of platforms and components, we were able to build JOGL on,<br/>
                    if not stated otherwise.<br/>

                    <ul>
                        <li> <b>Java</b><br/>
                            One of the following desktop Java SDK's:
                            <ul>
                                <li> <a href="http://openjdk.java.net/">OpenJDK</a> </li>
                                <li> <a href="http://icedtea.classpath.org/">IcedTea</a> </li>
                                <li> <a href="http://java.sun.com/j2se/">Sun JDK 1.6.0 or later</a> </li>
                            </ul>
                            or you may try one of the following embedded Java SDK's (not yet tested):
                            <ul>
                                <li> <a href="http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-April/000455.html">OpenJDK6 for embedded ARM</a> may use <a href="http://icedtea.classpath.org/wiki/ZeroSharkFaq">Zero/Shark</a></li>
                                <li> <a href="http://java.sun.com/javase/embedded/">Sun JDK for Embedded Use</a></li>
                            </ul>
                            or even the JavaME SDK's (see notes):
                            <ul>
                                <li> <a href="https://phoneme.dev.java.net/">phoneME (tested with a proprietary VM build)</a><br/>
                                    (tested with a proprietary VM build)</li>
                                <li> <a href="http://jamvm.sourceforge.net/">JamVM (not yet tested)</a><br/>
                                    (not yet tested)</li>
                                <li> <a href="http://www.cacaovm.org/">CacaoVM (not yet tested)</a><br/>
                                    (not yet tested)</li>
                            </ul>
                        </li>
                        <li> <b><a href="http://ant.apache.org/">Ant</a></b> 1.8.0 or later</li>
                        <li> <b><a href="http://www.kernel.org/pub/software/scm/git/docs/">Git</a></b> 1.6.0 or later<br/>
                            <ul>
                                <li> Use your Unix distribution's version, if available, or</li>
                                <li> <a href="http://www.kernel.org/pub/software/scm/git/">Source Code for GNU/Linux, MacOSX, ..</a>, or</li>
                                <li> <a href="http://code.google.com/p/msysgit/">Git on Windows</a>,
                                    <a href="http://code.google.com/p/msysgit/downloads/list">download</a> version
                                    <a href="http://code.google.com/p/msysgit/downloads/detail?name=Git-1.7.0.2-preview20100309.exe&amp;can=2&amp;q=">1.7.0</a> or later.</li>
                                <li> <a href="http://code.google.com/p/git-osx-installer/">git-osx-installer</a> </li>
                            </ul>
                        </li>
                        <li> Optional <b>NVidia Cg 2.2</b> <br/>
                            <ul>
                                <li> <a href="http://developer.nvidia.com/object/cg_download.html">Cg 2.2 Toolkit Download Page</a></li>
                            </ul>
                        </li>

                        <li> <b>GNU Linux</b> x86, 32- and 64-bit<br/>
                            You may have to install a few developer packages ...
                            <ul>
                                <li> <b>Debian</b> 5.00 or later
                                    <ul>
                                        <li>git</li>
                                        <li>gcc</li>
                                        <li>libgl1-mesa-dev</li>
                                        <li>libglu1-mesa-dev</li>
                                        <li>xorg-dev</li>
                                        <li>libice-dev</li>
                                        <li>libsm-dev</li>
                                        <li>libx11-dev</li>
                                        <li>libxext-dev</li>
                                        <li>libxxf86vm-dev</li>
                                        <li>libxinerama-dev</li>
                                        <li>libxrandr-dev</li>
                                        <li>libxrender-dev</li>
                                        <li>Optional: Your card vendor's proprietary driver</li>
                                    </ul>
                                </li>
                                <li> <b>OpenSuSE</b> 10.2 or later
                                    <ul>
                                        <li>git</li>
                                        <li>gcc</li>
                                        <li>x11-devel</li>
                                        <li>mesa-devel</li>
                                    </ul>
                                </li>
                                <li> <b>CentOS / Red Hat Enterprise Linux</b> 5.4 or later<br/>
                                    <ul>
                                        <li>git</li>
                                        <li>gcc</li>
                                        <li>mesa-libGL-devel</li>
                                        <li>xorg-x11-proto-devel</li>
                                        <li>libICE-devel</li>
                                        <li>libSM-devel</li>
                                        <li>libX11-devel</li>
                                        <li>libXext-devel</li>
                                        <li>libXau-devel</li>
                                        <li>libXdmcp-devel</li>
                                        <li>libXt-devel</li>
                                        <li>libXxf86vm-devel</li>
                                        <li>libXinerama-devel</li>
                                        <li>libXrandr-devel</li>
                                        <li>libXrender-devel</li>
                                        <li>Optional: Your card vendor's proprietary driver</li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li> <b>OpenSolaris</b> SPARC and x86, 32- and 64-bit
                            <ul>
                                <li> <a href="http://opensolaris.org/">OpenSolaris 2009.06 or later</a></li>
                            </ul>
                        </li>
                        <li> <b>MacOSX</b> Intel
                            <ul>
                                <li> git, see above </li>
                                <li> <a href="http://www.apple.com/macosx/">Mac OS X</a> 10.3 (note: will not work with earlier releases) </li>
                                <li> <a href="http://developer.apple.com/technologies/xcode.html">Xcode</a> for gcc, etc (included in OSX)</li>
                            </ul>
                        </li>
                        <li> <b>Windows</b>/x86 (32 bit)
                            <ul>
                                <li>Windows XP or later </li>
                                <li>git, see above</li>
                                <li> <a href="http://mingw-w64.sourceforge.net/">MinGW64</a>
                                  <ul>
                                    <li> <a href="http://sourceforge.net/projects/mingwbuilds/files/mingw-builds-install/mingw-builds-install.exe/download">Installer</a>
                                      <ul>
                                        <li>mingw-build-install</li>
                                        <li>version: 4.8.1</li>
                                        <li>host: x32</li>
                                        <li>threading: win32</li>
                                        <li>exceptions: SJLJ</li>
                                        <li>revision: 5</li>
                                      </ul></li>
                                    <li> or <a href="http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/">manual</a> 
                                         via  <a href="http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/32-bit/threads-win32/sjlj/">7z archive file</a></li>
                                  </ul></li>
                            </ul>
                        </li>
                        <li> <b>Windows</b>/x86_64 (64-bit)
                            <ul>
                                <li>Windows XP or later </li>
                                <li>git, see above</li>
                                <li> <a href="http://mingw-w64.sourceforge.net/">MinGW64</a>
                                  <ul>
                                    <li> <a href="http://sourceforge.net/projects/mingwbuilds/files/mingw-builds-install/mingw-builds-install.exe/download">Installer</a>
                                      <ul>
                                        <li>mingw-build-install</li>
                                        <li>version: 4.8.1</li>
                                        <li>host: x64</li>
                                        <li>threading: win32</li>
                                        <li>exceptions: SJLJ</li>
                                        <li>revision: 5</li>
                                      </ul></li>
                                    <li> or <a href="http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/">manual</a> 
                                         via  <a href="http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-win32/sjlj/">7z archive file</a></li>
                                  </ul></li>
                            </ul>
                        </li>
                    </ul>

                    <p>
                        Additional platforms such as FreeBSD and HP/UX are handled by the
                        build system, but are not officially supported.
                    </p>

                    <h2>Build Steps</h2>
                    <hr/>
                    <p>
                        Here are the steps that are required in order to build JOGL.
                    </p>

                    <ol>
                        <li><b>Optain the source code</b> using git:
                            <ul>
                                <li><a href="http://jogamp.org/git/?p=gluegen.git">Gluegen Dev GIT Repo</a></li>
                                <li><a href="http://jogamp.org/git/?p=jogl.git">JOGL Dev GIT Repo</a></li>
                            </ul><br/>
                            It is crucial that you checkout the source code under a common root directory:
                            <pre>
    /home/dude/projects/jogamp> git clone git://jogamp.org/srv/scm/gluegen.git gluegen
    /home/dude/projects/jogamp> git clone git://jogamp.org/srv/scm/jogl.git jogl
                            </pre>
                            Now you should have following directory structure:
                            <pre>
    /home/dude/projects/jogamp
    /home/dude/projects/jogamp/gluegen
    /home/dude/projects/jogamp/jogl
                            </pre>
                        </li>

                        <li> <b>Unset your CLASSPATH environment variable:</b> <br/>
                            The Ant build requires that the JOGL jars not be visible on the classpath. On Unix, type
                            <code> unsetenv CLASSPATH </code> into a csh or tcsh shell, or <code> unset CLASSPATH </code>
                            into a Bourne shell. On Windows, type <code> set CLASSPATH= </code> into a command prompt.
                        </li>

                        <li> <b>Optional</b>  <i>Copy and edit <b>gluegen.properties</b>:</i> <br/>
                            To specify different basic options for components and compilers,<br/>
                            copy <b>gluegen/make/gluegen.properties</b> into your home directory (pointed to by the Java system property <b>user.home</b>). <br/></li>

                        <li> <b>Optional</b>  <i>Copy and edit <b>jogl.properties</b>:</i> <br/>
                            To specify different basic options for the build,<br/>
                            copy <b>jogl/make/jogl.properties</b> into your home directory (pointed to by the Java system property
                            <b>user.home</b>). <br/>
                            Edit the copy to change desired settings.
                        </li>

                        <li> <b>Build the source tree:</b> <br/>
                            Open a command shell in the "gluegen/make" directory of the source tree and type <code>"ant"</code>.<br/>
                            Then open a command shell in the "jogl/make" directory of the source tree and type <code>"ant"</code>.
                            <ul>
                                <li>
                                    An experimental binding to the high-level <a href="http://developer.nvidia.com/view.asp?PAGE=cg_main">Cg</a>
                                    language by NVidia corporation can be generated by specifying <code>-Djogl.cg=1</code> to ant; e.g.
                                    <code>ant -Djogl.cg=1</code>. The Cg binding has been tested on Windows, Linux, and Mac OS X.
                                </li>
                            </ul>
                        </li>

                        <li> <b>Test your build:</b> <br/> Stay in your command shell in the "jogl/make" directory of the source tree and type <code>"ant junit.run"</code>.</li>

                        <li> <b>Build Javadoc:</b> <br/> Stay in your command shell in the "jogl/make" directory of the source tree and type "<code>ant javadoc.all"</code>.
                            This will produce the end-user documentation for JOGL along with some auxiliary utility packages.
                        </li>
                    </ol>

                    Note that there are a lot of warnings produced by ANTLR about the
                    C grammar and our modifications to some of the signatures of the
                    productions; the C grammar warnings have been documented by the
                    author of the grammar as having been investigated completely and
                    harmless, and the warnings about our modifications are also
                    harmless.

                    <h2> Common build problems </h2>

                    <ol>

                        <li>
                            <b>Your CLASSPATH environment variable appears to be set (some JOGL classes are currently visible to the build.)</b>, and $CLASSPATH isn't set.
                            An older version of JOGL was installed into the extension directory of the JDK you're using to build the
                            current JOGL. On Windows and Linux, delete any ANTLR jars from jre/lib/ext, and on Mac OS X, delete them from
                            /Library/Java/Extensions. It is generally not a good idea to drop JOGL directly into the extensions directory,
                            as this can interfere with upgrades via Java Web Start.
                        </li>

                        <li>
                            <b>CharScanner; panic: ClassNotFoundException: com.sun.gluegen.cgram.CToken</b>

                            This occurs because ANTLR was dropped into the Extensions
                            directory of the JRE/JDK. On Windows and Linux, delete any ANTLR jars from jre/lib/ext,
                            and on Mac OS X, delete them from /Library/Java/Extensions. Use the antlr.jar property in the build.xml
                            to point to a JRE-external location of this jar file.
                        </li>

                    </ol>

                    <br/>
                    <p>
                        <i>- Christopher Kline and Kenneth Russell, June 2003 (revised November 2006)</i><br/>
                        <i>- Sven Gothel and Michael Bien, May 2010</i><br/>
                    </p>

                </div>
            </div>
            <div id="footer">
                <div id="footer_left">
                    <span>JogAmp.org</span>
                    by <a href="http://jogamp.org">http://jogamp.org</a>
                    is licensed under a <br/>
                    <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution 3.0 License</a>.
                </div>
            </div>
        </div>
    </body>
</html>
>destdir="${classes}" excludes="${java.excludes.all}" source="${target.sourcelevel}" fork="yes" includeAntRuntime="false" memoryMaximumSize="${javac.memorymax}" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <classpath refid="jogl_nativewindow_gluegen.classpath"/> </javac> </target> <target name="java.compile" depends="java.compile.javase" /> <!-- ================================================================== --> <!-- - Compile the native C code for JOGL (and optionally the Cg binding). --> <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler"> <!-- compiler configuration --> <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these --> <compiler id="compiler.cfg.freebsd.newt" extends="compiler.cfg.freebsd"> <includepath path="/usr/local/include" /> </compiler> <compiler id="compiler.cfg.linux.armv7.newt.x11" extends="compiler.cfg.linux.armv7"> <!-- Need to force /usr/include headers on to include path (after all others), due to crosscompiler usage --> <compilerarg value="-idirafter" /> <compilerarg value="/usr/include" /> </compiler> <!-- linker configuration --> <linker id="linker.cfg.freebsd.newt.x11" extends="linker.cfg.freebsd"> <linkerarg value="-L/usr/local/lib"/> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.freebsd.amd64.newt.x11" extends="linker.cfg.freebsd.amd64"> <linkerarg value="-L/usr/local/lib"/> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.linux.newt.broadcom_egl" extends="linker.cfg.linux"> <syslibset libs="EGL"/> <syslibset libs="GLES_CM"/> </linker> <linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux"> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.linux.x86.newt.x11" extends="linker.cfg.linux.x86"> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.linux.amd64.newt.x11" extends="linker.cfg.linux.amd64"> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.linux.armv7.newt.x11" extends="linker.cfg.linux.armv7"> <syslibset dir="${env.TARGET_PLATFORM_LIBS}" libs="X11" /> <syslibset dir="${env.TARGET_PLATFORM_LIBS}" libs="Xrandr" /> </linker> <linker id="linker.cfg.android.newt" extends="linker.cfg.android"> <syslibset dir="${env.TARGET_PLATFORM_LIBS}" libs="android" /> </linker> <linker id="linker.cfg.solaris.newt.x11" extends="linker.cfg.solaris"> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.solaris.sparcv9.newt.x11" extends="linker.cfg.solaris.sparcv9"> <linkerarg value="-L/usr/lib/sparcv9"/> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.solaris.amd64.newt.x11" extends="linker.cfg.solaris.amd64"> <linkerarg value="-L/usr/lib/amd64"/> <syslibset libs="X11"/> <syslibset libs="Xrandr"/> </linker> <linker id="linker.cfg.win32.mingw.newt" extends="linker.cfg.win32.mingw"> <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> <syslibset libs="gdi32, kernel32"/> </linker> <linker id="linker.cfg.win64.mingw.newt" extends="linker.cfg.win64.mingw"> <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> <syslibset libs="gdi32, kernel32"/> </linker> <linker id="linker.cfg.win32.msvc.newt" extends="linker.cfg.win32.msvc"> <syslibset libs="gdi32, user32, kernel32" /> </linker> <linker id="linker.cfg.macosx.newt" extends="linker.cfg.macosx"> <linkerarg value="-framework" /> <linkerarg value="Cocoa" /> </linker> <linker id="linker.cfg.hpux.newt" extends="linker.cfg.hpux"> <syslibset dir="/usr/lib" libs="X11"/> </linker> </target> <target name="c.configure.win32.vc" if="isVCFamily"> <echo message="Win32.VC" /> <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.newt" /> </target> <target name="c.configure.win32.mingw" if="isMingW32"> <echo message="Win32.MingW" /> <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.newt" /> </target> <target name="c.configure.win64.mingw" if="isMingW64"> <echo message="Win64.MingW" /> <property name="compiler.cfg.id" value="compiler.cfg.win64.mingw" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win64.mingw.newt" /> </target> <target name="c.configure.linux.x86" if="isLinuxX86"> <echo message="Linux.x86" /> <property name="compiler.cfg.id" value="compiler.cfg.linux.x86" /> <condition property="linker.cfg.id.oswin" value="linker.cfg.linux.x86.newt.x11" else="linker.cfg.linux.x86"> <isset property="isX11" /> </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> <target name="c.configure.linux.amd64" if="isLinuxAMD64"> <echo message="Linux.AMD64" /> <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" /> <condition property="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.newt.x11" else="linker.cfg.linux.amd64"> <isset property="isX11" /> </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> <target name="c.configure.linux.armv7" if="isLinuxARMv7"> <echo message="Linux.armv7" /> <property name="compiler.cfg.id" value="compiler.cfg.linux.armv7.newt.x11" /> <condition property="linker.cfg.id.oswin" value="linker.cfg.linux.armv7.newt.x11" else="linker.cfg.linux.armv7"> <isset property="isX11" /> </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> <target name="c.configure.linux.ia64" if="isLinuxIA64"> <echo message="Linux.IA64" /> <property name="compiler.cfg.id" value="compiler.cfg.linux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" /> </target> <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.armv7,c.configure.linux.ia64,c.configure.x11" if="isLinux"/> <target name="c.configure.android" if="isAndroid"> <echo message="Android" /> <property name="compiler.cfg.id" value="compiler.cfg.android" /> <property name="linker.cfg.id.oswin" value="linker.cfg.android.newt" /> </target> <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit"> <echo message="Solaris" /> <property name="compiler.cfg.id" value="compiler.cfg.solaris" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.newt.x11" /> </target> <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9"> <echo message="SolarisSparcv9" /> <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.newt.x11" /> </target> <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64"> <echo message="SolarisAMD64" /> <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.newt.x11" /> </target> <target name="c.configure.freebsd.x86" if="isFreeBSDX86"> <echo message="FreeBSD.x86" /> <property name="compiler.cfg.id" value="compiler.cfg.freebsd.newt" /> <condition property="linker.cfg.id.oswin" value="linker.cfg.freebsd.newt.x11" else="linker.cfg.freebsd"> <isset property="isX11" /> </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> <target name="c.configure.freebsd.amd64" if="isFreeBSDAMD64"> <echo message="FreeBSD.AMD64" /> <property name="compiler.cfg.id" value="compiler.cfg.freebsd.newt" /> <condition property="linker.cfg.id.oswin" value="linker.cfg.freebsd.amd64.newt.x11" else="linker.cfg.freebsd.amd64"> <isset property="isX11" /> </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> <target name="c.configure.freebsd" depends="c.configure.freebsd.x86,c.configure.freebsd.amd64,c.configure.x11" if="isFreeBSD"/> <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX"> <echo message="HP-UX" /> <property name="compiler.cfg.id" value="compiler.cfg.hpux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.newt.x11" /> </target> <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw,c.configure.win64.mingw" if="isWindows" /> <target name="c.configure.x11" if="isX11" /> <target name="c.configure.macosx" if="isOSX"> <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.newt" /> </target> <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> <target name="c.configure" depends="c.configure.1,c.configure.2" /> <target name="rename.mingw.dll" if="isMingW"> <move file="${src}" tofile="${dest}" /> </target> <target name="rename.dylib" if="isOSX"> <move file="${src}" tofile="${dest}" /> </target> <macrodef name="c.build"> <attribute name="c.compiler.src.files" /> <attribute name="compiler.cfg.id" /> <attribute name="linker.cfg.id" /> <attribute name="output.lib.name" /> <attribute name="c.compiler.use-jawt" default="false"/> <sequential> <echo message="Output lib name = @{output.lib.name}" /> <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> <property name="c.compiler.debug" value="false" /> <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> <property name="c.compiler.optimise" value="none" /> <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> <patternset id="c.src.files.newt"> <include name="${rootrel.src.c}/NewtCommon.c" /> <include name="${rootrel.src.c}/WindowsWindow.c" if="isWindows"/> <include name="${rootrel.src.c}/*.m" if="isOSX"/> <include name="${rootrel.src.c}/AndroidWindow.c" if="isAndroid"/> <include name="${rootrel.src.c}/X11Window.c" if="isX11"/> <include name="${rootrel.src.c}/KDWindow.c" if="setup.addNativeKD"/> <include name="${rootrel.src.c}/IntelGDL.c" if="setup.addNativeIntelGDL"/> <include name="${rootrel.src.c}/BroadcomEGL.c" if="setup.addNativeBroadcomEGL"/> </patternset> <echo message="Compiling @{output.lib.name}" /> <!-- have to wrap cc task with outofdate, because otherwise cc links a new library even when no files have been compiled --> <outofdate> <sourcefiles> <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> </sourcefiles> <targetfiles> <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.so"/> <fileset dir="${obj.newt}" includes="@{output.lib.name}.dll"/> <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.jnilib"/> </targetfiles> <sequential> <cc outtype="shared" objdir="${obj.newt}" outfile="${obj.newt}/@{output.lib.name}" optimize="${c.compiler.optimise}" debug="${c.compiler.debug}" multithreaded="true" exceptions="false" rtti="false"> <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> <compiler extends="@{compiler.cfg.id}" > <sysincludepath path="${java.includes.dir}"/> <sysincludepath path="${java.includes.dir.platform}"/> <sysincludepath path="${stub.includes.gluegen.cc}"/> <includepath path="stub_includes/khr"/> <includepath path="stub_includes/egl"/> <!-- This is for finding Xrandr.h on Solaris. --> <includepath path="/usr/X11/include" /> <!-- This is for the generated headers for handwritten C code --> <includepath path="${src.generated.c}" /> <includepath path="${src.generated.c}/Android" if="isAndroid"/> <includepath path="${src.generated.c}/X11" if="isX11"/> <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> <includepath path="${src.generated.c}/Windows" if="isWindows"/> <includepath path="${src.generated.c}/KD" if="setup.addNativeKD" /> <includepath path="${src.generated.c}/IntelGDL" if="setup.addNativeIntelGDL" /> <includepath path="stub_includes/embedded/IntelGDL" if="setup.addNativeIntelGDL" /> <includepath path="${src.generated.c}/BroadcomEGL" if="setup.addNativeBroadcomEGL" /> <!-- This must come last to not override real include paths --> <!-- includepath path="stub_includes/macosx" if="isOSX" / --> </compiler> <linker extends="@{linker.cfg.id}"> <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/> <syslibset dir="${java.lib.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/> </linker> </cc> <!-- FIXME: this is a hack; the cpptask should have an option to change the suffix or at least understand the override from dylib to jnilib --> <antcall target="rename.dylib" inheritRefs="true"> <param name="src" value="${obj.newt}/lib@{output.lib.name}.dylib" /> <param name="dest" value="${obj.newt}/lib@{output.lib.name}.jnilib" /> </antcall> <!-- FIXME: this is a hack; the cpptask should have an option to change the suffix or at least understand the override from dylib to jnilib --> <antcall target="rename.mingw.dll" inheritRefs="true"> <param name="src" value="${obj.newt}/lib@{output.lib.name}.so" /> <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" /> </antcall> <!-- this stripping may be called more than once on the same library dir, but that should cause no harm, and doing it here inside outofdate prevents the JARs from always being rebuilt even if no source code changes --> <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true"> <param name="libdir" value="${obj.newt}"/> </antcall> </sequential> </outofdate> </sequential> </macrodef> <target name="c.build.newt.prepare"> <javah destdir="${src.generated.c}/KD" classpath="${javah.classpath}" class="jogamp.newt.driver.kd.KDWindow" /> <javah destdir="${src.generated.c}/IntelGDL" classpath="${javah.classpath}" class="jogamp.newt.driver.intel.gdl.Display" /> <javah destdir="${src.generated.c}/IntelGDL" classpath="${javah.classpath}" class="jogamp.newt.driver.intel.gdl.Screen" /> <javah destdir="${src.generated.c}/IntelGDL" classpath="${javah.classpath}" class="jogamp.newt.driver.intel.gdl.Window" /> <javah destdir="${src.generated.c}/BroadcomEGL" classpath="${javah.classpath}" class="jogamp.newt.driver.broadcom.egl.Window" /> <javah destdir="${src.generated.c}/Windows" classpath="${javah.classpath}" class="jogamp.newt.driver.windows.WindowsWindow" /> <javah destdir="${src.generated.c}/Windows" classpath="${javah.classpath}" class="jogamp.newt.driver.windows.WindowsScreen" /> <javah destdir="${src.generated.c}/Windows" classpath="${javah.classpath}" class="jogamp.newt.driver.windows.WindowsDisplay" /> <javah destdir="${src.generated.c}/MacOSX" classpath="${javah.classpath}" class="jogamp.newt.driver.macosx.MacWindow" /> <javah destdir="${src.generated.c}/MacOSX" classpath="${javah.classpath}" class="jogamp.newt.driver.macosx.MacScreen" /> <javah destdir="${src.generated.c}/MacOSX" classpath="${javah.classpath}" class="jogamp.newt.driver.macosx.MacDisplay" /> <javah destdir="${src.generated.c}/X11" classpath="${javah.classpath}" class="jogamp.newt.driver.x11.X11Window" /> <javah destdir="${src.generated.c}/X11" classpath="${javah.classpath}" class="jogamp.newt.driver.x11.X11Screen" /> <javah destdir="${src.generated.c}/X11" classpath="${javah.classpath}" class="jogamp.newt.driver.x11.X11Display" /> <javah destdir="${src.generated.c}/Android" classpath="${javah.classpath}:${android.jar}" class="jogamp.newt.driver.android.AndroidWindow" /> </target> <target name="c.build.newt.windowlib" unless="setup.nonatives"> <c.build c.compiler.src.files="c.src.files.newt" output.lib.name="newt" compiler.cfg.id="${compiler.cfg.id}" linker.cfg.id="${linker.cfg.id.oswin}"/> </target> <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> <msvc.manifest objdir="${obj.newt}" dllname="newt" /> </target> <target name="c.build.newt.natives" depends="c.build.newt.windowlib" unless="setup.nonatives"> </target> <target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.natives"> <antcall target="c.manifest" inheritRefs="true" /> </target> <!-- ================================================================== --> <!-- - Build the newt.jar files. --> <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase" /> <target name="setup-manifestfile"> <property name="manifestfile" value="newtversion"/> <copy file="${manifestfile}" tofile="${build.newt}/manifest.mf" overwrite="true"> <filterset> <filter token="VERSION" value="${newt.version}"/> <filter token="SCM_BRANCH" value="${jogl.build.branch}"/> <filter token="SCM_COMMIT" value="${jogl.build.commit}"/> <filter token="BASEVERSION" value="${newt_base_version}"/> </filterset> </copy> </target> <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT"> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.awt.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.awt}"/> </jar> </target> <target name="build-jars-opengl" depends="setup-manifestfile" unless="setup.noOpenGL"> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.ogl.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.opengl}"/> </jar> </target> <target name="build-jars-driver" depends="setup-manifestfile"> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.x11.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.x11}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.win.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.windows}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.macosx.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.macosx}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.android.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.android}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.kd.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.kd}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.broadcomegl.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.broadcomegl}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.driver.intelgdl.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.intelgdl}"/> </jar> </target> <target name="build-jars-javase" depends="setup-manifestfile,build-jars-opengl,build-jars-awt,build-jars-driver"> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.core.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.core}"/> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt.event.jar}" filesonly="true"> <fileset dir="${classes}"> <include name="com/jogamp/newt/Display*" /> <include name="com/jogamp/newt/Screen*" /> <include name="com/jogamp/newt/Window*" /> <include name="com/jogamp/newt/ScreenMode*" /> <include name="com/jogamp/newt/event/**" /> <include name="jogamp/newt/Debug*" /> </fileset> </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${build.newt}/newt-natives-${os.and.arch}.jar" filesonly="true"> <fileset dir="${obj.newt}"> <include name="*.${native.library.suffix}" /> </fileset> </jar> </target> <!-- ================================================================== --> <!-- - Build the Javadocs for the sources. - NOTE: these are not entirely correct as the javadocs targets depend - on the platform specific build targets. To circumvent any - errors, ensure that the source is built first. --> <target name="javadoc" depends="init"> <!-- Build the general Javadoc --> <javadoc packagenames="${javadoc.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" sourcepath="${src.java};${src.generated.java}" destdir="${javadoc}" windowtitle="${javadoc.windowtitle}" overview="${javadoc.overview}" source="${target.sourcelevel}" linkoffline="${javadoc.link} 142-packages" bottom="${javadoc.bottom}" > <classpath refid="jogl_nativewindow_gluegen.classpath"/> </javadoc> </target> <target name="javadoc.spec" depends="init"> <!-- Build the general Javadoc --> <javadoc packagenames="${javadoc.spec.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" sourcepath="${src.java};${src.generated.java}" destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}" overview="${javadoc.overview}" source="${target.sourcelevel}" linkoffline="${javadoc.link} 142-packages" bottom="${javadoc.bottom}" > <classpath refid="jogl_nativewindow_gluegen.classpath"/> </javadoc> </target> <target name="javadoc.dev" depends="init"> <!-- Build the internal developer Javadoc --> <javadoc packagenames="${javadoc.dev.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" sourcepath="${src.java};${src.generated.java}" destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}" overview="${javadoc.overview}" source="${target.sourcelevel}" linkoffline="${javadoc.link} 142-packages" bottom="${javadoc.bottom}" > <classpath refid="jogl_nativewindow_gluegen.classpath"/> </javadoc> </target> <target name="all.doc" description="Build NEWT docs" depends="init,javadoc,javadoc.spec,javadoc.dev" /> <!-- ================================================================== --> <!-- - Clean up all that is built. --> <target name="clean" description="Remove all build products" depends="declare.common"> <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${build.newt}" /> <fileset dir="${javadoc}" /> <fileset dir="${javadoc.spec}" /> <fileset dir="${javadoc.dev}" /> </delete> </target> <!-- ================================================================== --> <!-- - Build everything. --> <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="init,java.compile,c.build.newt,build-jars,generate.version.txt" /> <target name="generate.version.txt" depends="init"> <!-- Create a version.txt file indicating which version we just built --> <echo message="${newt.version}" file="${build.newt}/version.txt" /> </target> </project>