diff options
Diffstat (limited to 'make/build-jogl.xml')
-rw-r--r-- | make/build-jogl.xml | 171 |
1 files changed, 108 insertions, 63 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 8f7a4ac5d..e23b9d594 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -37,7 +37,10 @@ - - Optional properties: - -Djogl.cg=1 when combined with the build or javadoc targets will cause - - the experimental binding to NVidia's Cg language to be built. + - the experimental binding to NVidia's Cg language to be built. + - Then you need to define the location of your CG libraries: + - -Dwindows.cg.lib=<PATH> for Windows and + - -Dx11.cg.lib=<PATH> for X11/Unix - - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the - ANT build, including the GlueGen and StaticGLInfo tasks, the building of @@ -146,6 +149,11 @@ <!-- partitioning --> + <condition property="java.part.cg" + value="com/sun/opengl/cg/*"> + <isset property="jogl.cg"/> + </condition> + <property name="java.part.egl" value="com/sun/opengl/impl/egl/*"/> @@ -225,6 +233,13 @@ <!-- condition excludes --> + <condition property="java.excludes.cg" + value="${java.part.cg}"> + <not> + <isset property="jogl.cg"/> + </not> + </condition> + <condition property="java.excludes.egl" value="${java.part.egl}"> <and> @@ -289,14 +304,9 @@ <property name="java.excludes.fixme" value="com/sun/opengl/impl/gl2/fixme/** com/sun/javafx/audio/windows/waveout/TestSpatialization.java" /> - <property name="java.excludes.all" value="${java.excludes.fixme} ${java.excludes.egl}, ${java.excludes.gl2}, ${java.excludes.gl3}, ${java.excludes.es1}, ${java.excludes.es2}, ${java.excludes.awt}, ${java.excludes.glugl2}, ${java.excludes.util}, ${java.excludes.x11}, ${java.excludes.win}, ${java.excludes.macosx}, ${java.excludes.cdcfp}" /> + <property name="java.excludes.all" value="${java.excludes.fixme} ${java.excludes.cg}, ${java.excludes.egl}, ${java.excludes.gl2}, ${java.excludes.gl3}, ${java.excludes.es1}, ${java.excludes.es2}, ${java.excludes.awt}, ${java.excludes.glugl2}, ${java.excludes.util}, ${java.excludes.x11}, ${java.excludes.win}, ${java.excludes.macosx}, ${java.excludes.cdcfp}" /> <echo message="java.excludes.all: ${java.excludes.all}" /> - <!-- Cg determination --> - <condition property="c.compiler.use-cglib"> - <isset property="jogl.cg" /> - </condition> - <!-- Set the project root directory to be up one directory. --> <property name="project.root" value=".." /> @@ -460,6 +470,7 @@ <!-- The resulting jogl.jar. --> <property name="jogl.core.jar" value="${build}/jogl.core.jar" /> + <property name="jogl.cg.jar" value="${build}/jogl.cg.jar" /> <property name="jogl.gles1.jar" value="${build}/jogl.gles1.jar" /> <property name="jogl.gles1.dbg.jar" value="${build}/jogl.gles1.dbg.jar" /> <property name="jogl.gles2.jar" value="${build}/jogl.gles2.jar" /> @@ -1255,7 +1266,10 @@ <linker id="linker.cfg.linux.jogl.gl2" extends="linker.cfg.linux.jogl.x11"> <syslibset dir="/usr/X11R6/lib" libs="GL"/> - <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/> + </linker> + + <linker id="linker.cfg.linux.jogl.cg" extends="linker.cfg.linux.jogl.gl2"> + <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/> </linker> <linker id="linker.cfg.linux.amd64.jogl.x11" extends="linker.cfg.linux.amd64"> @@ -1265,16 +1279,22 @@ <linker id="linker.cfg.linux.amd64.jogl.gl2" extends="linker.cfg.linux.amd64.jogl.x11"> <syslibset dir="/usr/X11R6/lib64" libs="GL"/> - <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/> + </linker> + + <linker id="linker.cfg.linux.amd64.jogl.cg" extends="linker.cfg.linux.amd64.jogl.gl2"> + <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/> </linker> <linker id="linker.cfg.solaris.jogl.x11" extends="linker.cfg.solaris"> <syslibset libs="X11"/> </linker> - <linker id="linker.cfg.solaris.jogl.gl2" extends="linker.cfg.solaris"> + <linker id="linker.cfg.solaris.jogl.gl2" extends="linker.cfg.solaris.jogl.x11"> <syslibset libs="GL"/> - <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/> + </linker> + + <linker id="linker.cfg.solaris.jogl.cg" extends="linker.cfg.solaris.jogl.gl2"> + <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL"/> </linker> <linker id="linker.cfg.solaris.sparcv9.jogl.gl2" extends="linker.cfg.solaris.sparcv9"> @@ -1292,23 +1312,32 @@ <linker id="linker.cfg.win32.mingw.jogl" extends="linker.cfg.win32.mingw"> <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> <syslibset libs="opengl32, glu32, gdi32, kernel32"/> - <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/> + </linker> + + <linker id="linker.cfg.win32.mingw.jogl.cg" extends="linker.cfg.win32.mingw.jogl"> + <syslibset dir="${windows.cg.lib}" libs="cg, cgGL"/> </linker> <linker id="linker.cfg.win32.msvc.jogl" extends="linker.cfg.win32.msvc"> <syslibset libs="opengl32, gdi32, user32, kernel32" /> - <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/> <!-- This is temporary --> <syslibset libs="winmm" /> </linker> + <linker id="linker.cfg.win32.msvc.jogl.cg" extends="linker.cfg.win32.msvc.jogl"> + <syslibset dir="${windows.cg.lib}" libs="cg, cgGL"/> + </linker> + <linker id="linker.cfg.macosx.jogl" extends="linker.cfg.macosx"> <linkerarg value="-framework" /> <linkerarg value="Cocoa" /> <linkerarg value="-framework" /> <linkerarg value="OpenGL" /> - <linkerarg value="-framework" if="c.compiler.use-cglib" /> - <linkerarg value="Cg" if="c.compiler.use-cglib" /> + </linker> + + <linker id="linker.cfg.macosx.jogl.cg" extends="linker.cfg.macosx.jogl"> + <linkerarg value="-framework"/> + <linkerarg value="Cg"/> </linker> <linker id="linker.cfg.hpux.jogl" extends="linker.cfg.hpux"> @@ -1323,6 +1352,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.jogl" /> <property name="linker.cfg.id.gl2" value="linker.cfg.win32.msvc.jogl" /> + <property name="linker.cfg.id.cg" value="linker.cfg.win32.msvc.jogl.cg" /> </target> <target name="c.configure.win32.mingw" if="isMingW"> @@ -1331,6 +1361,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.jogl" /> <property name="linker.cfg.id.gl2" value="linker.cfg.win32.mingw.jogl" /> + <property name="linker.cfg.id.cg" value="linker.cfg.win32.mingw.jogl.cg" /> </target> <target name="c.configure.linux.x86" if="isLinuxX86"> @@ -1339,6 +1370,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.linux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.linux.jogl.cg" /> </target> <target name="c.configure.linux.amd64" if="isLinuxAMD64"> @@ -1347,6 +1379,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" /> <property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.linux.amd64.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.linux.amd64.jogl.cg" /> </target> <target name="c.configure.linux.ia64" if="isLinuxIA64"> @@ -1355,6 +1388,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.linux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.linux.jogl.cg" /> </target> <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" /> @@ -1365,6 +1399,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.solaris" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.solaris.jogl.cg" /> </target> @@ -1374,6 +1409,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.sparcv9.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.solaris.sparcv9.jogl.cg" /> </target> @@ -1383,6 +1419,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.amd64.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.solaris.amd64.jogl.cg" /> </target> <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD"> @@ -1391,6 +1428,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.linux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.linux.jogl.cg" /> </target> <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX"> @@ -1399,6 +1437,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.hpux" /> <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.jogl.x11" /> <property name="linker.cfg.id.gl2" value="linker.cfg.hpux.jogl.gl2" /> + <property name="linker.cfg.id.cg" value="linker.cfg.hpux.jogl.cg" /> </target> <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" /> @@ -1410,6 +1449,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.macosx" /> <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.jogl" /> <property name="linker.cfg.id.gl2" value="linker.cfg.macosx.jogl" /> + <property name="linker.cfg.id.cg" value="linker.cfg.macosx.jogl.cg" /> </target> <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" /> @@ -1528,7 +1568,7 @@ <includepath path="stub_includes/opengl"/> <includepath path="stub_includes/egl"/> <includepath path="stub_includes/openmax" if="useOpenMAX"/> - <includepath path="stub_includes/cg" if="c.compiler.use-cglib"/> + <includepath path="stub_includes/cg" if="jogl.cg"/> <!-- This is for the generated headers for handwritten C code --> <includepath path="${src.generated.c}" /> @@ -1602,7 +1642,7 @@ <c.build c.compiler.src.files="c.src.files.cg" output.lib.name="jogl_cg" compiler.cfg.id="${compiler.cfg.id}" - linker.cfg.id="${linker.cfg.id.gl2}"/> + linker.cfg.id="${linker.cfg.id.cg}"/> </target> <target name="c.manifest.cg" if="jogl.cg"> @@ -1632,141 +1672,147 @@ <!-- - Build the jogl.jar files. --> - <target name="jar" depends="java.compile,build-jars"/> + <target name="jar" depends="java.compile,build-jars,build-cg-jar"/> <target name="setup-manifestfile"> - <condition property="manifestfile" value="joglRIversion"> - <isset property="jogl.ri" /> - </condition> - <condition property="manifestfile" value="joglversion"> - <not> - <isset property="jogl.ri" /> - </not> - </condition> - </target> - - <target name="build-jars" depends="setup-manifestfile"> + <condition property="manifestfile" value="joglRIversion"> + <isset property="jogl.ri" /> + </condition> + <condition property="manifestfile" value="joglversion"> + <not> + <isset property="jogl.ri" /> + </not> + </condition> <tstamp> <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> </tstamp> <copy file="${manifestfile}" - tofile="tempversion" - overwrite="true"> - <filterset> - <!-- This token only exists in the non-RI version of the manifest --> - <filter token="VERSION" value="${jogl_base_version}-pre-${timestamp}"/> - <!-- This token exists in both the RI and non-RI versions of the manifest --> - <filter token="BASEVERSION" value="${jogl_base_version}"/> - </filterset> + tofile="${build}/tempversion" + overwrite="true"> + <filterset> + <!-- This token only exists in the non-RI version of the manifest --> + <filter token="VERSION" value="${jogl_base_version}-pre-${timestamp}"/> + <!-- This token exists in both the RI and non-RI versions of the manifest --> + <filter token="BASEVERSION" value="${jogl_base_version}"/> + </filterset> </copy> + </target> + + <target name="build-cg-jar" depends="setup-manifestfile" if="jogl.cg"> + <jar manifest="${build}/tempversion" destfile="${jogl.cg.jar}"> + <fileset dir="${classes}" + includes="${java.part.cg}"/> + </jar> + </target> - <jar manifest="tempversion" destfile="${jogl.core.jar}"> + <target name="build-jars" depends="setup-manifestfile"> + <jar manifest="${build}/tempversion" destfile="${jogl.core.jar}"> <fileset dir="${classes}" includes="javax/media/opengl/**, com/sun/gluegen/runtime/**, com/sun/opengl/**" - excludes="${java.excludes.fixme} ${java.part.egl}, ${java.part.sdk}, ${java.part.openmax}, ${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.es1}, ${java.part.es1.dbg}, ${java.part.es2}, ${java.part.es2.dbg}, ${java.part.awt}, ${java.part.glutess}, ${java.part.glumipmap}, ${java.part.glugl2}, ${java.part.util} ${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}"/> + excludes="${java.excludes.fixme}, ${java.part.cg}, ${java.part.egl}, ${java.part.sdk}, ${java.part.openmax}, ${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.es1}, ${java.part.es1.dbg}, ${java.part.es2}, ${java.part.es2.dbg}, ${java.part.awt}, ${java.part.glutess}, ${java.part.glumipmap}, ${java.part.glugl2}, ${java.part.util} ${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gles1.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gles1.jar}"> <fileset dir="${classes}" includes="${java.part.es1}" excludes="${java.part.es1.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gles1.dbg.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gles1.dbg.jar}"> <fileset dir="${classes}" includes="${java.part.es1.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gles2.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gles2.jar}"> <fileset dir="${classes}" includes="${java.part.es2}, ${java.part.openmax}" excludes="${java.part.es2.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gles2.dbg.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gles2.dbg.jar}"> <fileset dir="${classes}" includes="${java.part.es2.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.egl.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.egl.jar}"> <fileset dir="${classes}" includes="${java.part.egl}" excludes="${java.part.awt}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2es12.x11.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.x11.jar}"> <fileset dir="${classes}" includes="${java.part.gl2es12.x11}, ${java.part.openmax}" excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2es12.win.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.win.jar}"> <fileset dir="${classes}" includes="${java.part.gl2es12.win}, ${java.part.openmax}" excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2es12.osx.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.osx.jar}"> <fileset dir="${classes}" includes="${java.part.gl2es12.osx}, ${java.part.openmax}" excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2es12.dbg.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.dbg.jar}"> <fileset dir="${classes}" includes="${java.part.gl2es12.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2.x11.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2.x11.jar}"> <fileset dir="${classes}" includes="${java.part.gl2.x11}, ${java.part.gl3}, ${java.part.openmax}" excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2.win.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2.win.jar}"> <fileset dir="${classes}" includes="${java.part.gl2.win}, $${java.part.gl3}, {java.part.openmax}" excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2.osx.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2.osx.jar}"> <fileset dir="${classes}" includes="${java.part.gl2.osx}, $${java.part.gl3}, {java.part.openmax}" excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.gl2.dbg.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.gl2.dbg.jar}"> <fileset dir="${classes}" includes="${java.part.gl2.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.sdk.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.sdk.jar}"> <fileset dir="${classes}" includes="${java.part.sdk}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.glutess.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.glutess.jar}"> <fileset dir="${classes}" includes="${java.part.glutess}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.glumipmap.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.glumipmap.jar}"> <fileset dir="${classes}" includes="${java.part.glumipmap}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.glugl2.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.glugl2.jar}"> <fileset dir="${classes}" includes="${java.part.glugl2}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.awt.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.awt.jar}"> <fileset dir="${classes}" includes="${java.part.awt}" /> </jar> - <jar manifest="tempversion" destfile="${jogl.util.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.util.jar}"> <fileset dir="${classes}" includes="${java.part.util}, ${java.part.util.glsl}" excludes="${java.part.util.awt}, ${java.part.util.gl2}, ${java.part.gl3}, ${java.part.util.fixedfuncemu}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.util.gl2.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.util.gl2.jar}"> <fileset dir="${classes}" includes="${java.part.util.gl2}" excludes="com/sun/opengl/**/awt/**"/> </jar> - <jar manifest="tempversion" destfile="${jogl.util.awt.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.util.awt.jar}"> <fileset dir="${classes}" includes="${java.part.util.awt}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.util.fixedfuncemu.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.util.fixedfuncemu.jar}"> <fileset dir="${classes}" includes="${java.part.util.fixedfuncemu}"/> <fileset dir="${src.java}" includes="${java.part.util.fixedfuncemu.shadercode}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.all.jar}"> + <jar manifest="${build}/tempversion" destfile="${jogl.all.jar}"> <fileset dir="${classes}"> <include name="javax/media/opengl/**" /> <include name="com/sun/gluegen/runtime/**" /> @@ -1778,7 +1824,6 @@ <fileset dir="${src.java}" includes="${java.part.util.fixedfunc.shaders}"/> </jar> - <delete file="tempversion"/> </target> <!-- ================================================================== --> |