aboutsummaryrefslogtreecommitdiffstats
path: root/make/build.xml
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-07-03 20:33:46 +0000
committerKenneth Russel <[email protected]>2008-07-03 20:33:46 +0000
commitac240e183c70dae6264a6c47cd35c44fdb6bd6b1 (patch)
tree2eb6712d7f58546a684370551f7cc794fe2674c7 /make/build.xml
parentde138fbe0772fc95ffa0c79c260b8bdc295f543e (diff)
Further refactorings of C build to reduce dependencies on
gluegen-cpptasks. Fixed bug related to ant class loaders, definition of cpptasks types, subclassing of compilers and linkers, and use of antcall by defining c.build using macrodef instead of target and invoking it directly instead of via antcall. This fixes the root cause of the build breakage on Windows caused by the recent gluegen-cpptasks refactoring. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1705 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/build.xml')
-rw-r--r--make/build.xml584
1 files changed, 277 insertions, 307 deletions
diff --git a/make/build.xml b/make/build.xml
index 5dce7d8ae..d6d47d617 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - Ant build for JOGL. This build has been tested with ANT 1.5.3. The
+ - Ant build for JOGL. This build has been tested with ANT 1.7.0. The
- optional.jar that contains the optional ANT tasks must be in the ANT
- classpath (typically the ant/lib directory).
-
@@ -90,11 +90,7 @@
<!--
- Base initialization and detection of operating system.
-->
- <target name="base.init" depends="gluegen.cpptasks.detect.os">
-
- <echo message="isX11: ${isX11}" />
- <echo message="isWindows: ${isWindows}" />
- <echo message="isOSX: ${isOSX}" />
+ <target name="base.init">
<condition property="jogl.noes">
<and>
@@ -486,105 +482,6 @@
</target>
<!-- ================================================================== -->
- <!--
- - Platform specific declares - COMPILER
- -->
- <target name="declare.win32.vc" if="isVCFamily">
- <echo message="Win32.VC" />
- <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
- <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" />
- </target>
-
- <target name="declare.win32.mingw" if="isMingW">
- <echo message="Win32.MingW" />
- <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
- <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" />
- </target>
-
- <target name="declare.linux.x86" if="isLinuxX86">
- <echo message="Linux.x86" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <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" />
- </target>
-
- <target name="declare.linux.amd64" if="isLinuxAMD64">
- <echo message="Linux.AMD64" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
- <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" />
- </target>
-
- <target name="declare.linux.ia64" if="isLinuxIA64">
- <echo message="Linux.IA64" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux" />
- <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" />
- </target>
-
- <target name="declare.linux" depends="declare.linux.x86,declare.linux.amd64,declare.linux.ia64,declare.x11" if="isLinux" />
-
- <target name="declare.solaris32" depends="declare.x11" if="isSolaris32Bit">
- <echo message="Solaris" />
- <property name="compiler.cfg.id" value="compiler.cfg.solaris" />
- <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" />
- </target>
-
-
- <target name="declare.solaris.sparcv9" depends="declare.x11" if="isSolarisSparcv9">
- <echo message="SolarisSparcv9" />
- <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
- <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" />
- </target>
-
-
- <target name="declare.solaris.amd64" depends="declare.x11" if="isSolarisAMD64">
- <echo message="SolarisAMD64" />
- <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
- <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" />
- </target>
-
- <target name="declare.freebsd" depends="declare.x11" if="isFreeBSD">
- <echo message="FreeBSD" />
- <property name="compiler.cfg.id" value="compiler.cfg.freebsd.jogl" />
- <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" />
- </target>
-
- <target name="declare.hpux" depends="declare.x11" if="isHPUX">
- <echo message="HP-UX" />
- <property name="compiler.cfg.id" value="compiler.cfg.hpux" />
- <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" />
- </target>
-
- <target name="declare.win32" depends="declare.win32.vc,declare.win32.mingw" if="isWindows" />
-
- <target name="declare.x11" depends="init" if="isX11" />
-
- <target name="declare.macosx" depends="init" if="isOSX">
- <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
- <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" />
- </target>
-
- <!-- ================================================================== -->
<!--
- Initialize all parameters required for the build and create any
- required directories.
@@ -609,8 +506,6 @@
<mkdir dir="${obj.cg}" />
</target>
- <target name="declare" depends="init,declare.win32,declare.linux,declare.solaris32,declare.solaris.sparcv9,declare.solaris.amd64,declare.macosx,declare.freebsd,declare.hpux" />
-
<!-- ================================================================== -->
<!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation -->
<!--
@@ -1106,7 +1001,7 @@
- Compile the native C code for JOGL (and optionally the Cg binding).
-->
- <target name="c.configure" depends="gluegen.cpptasks.setup.compiler" unless="jogl.compiler.present">
+ <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="jogl.compiler.present">
<!-- compiler configuration -->
<!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
@@ -1187,173 +1082,266 @@
</linker>
</target>
- <target name="rename.mingw.dll" if="isMingW">
- <move file="${src}" tofile="${dest}" />
+ <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.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" />
+ </target>
+
+ <target name="c.configure.win32.mingw" if="isMingW">
+ <echo message="Win32.MingW" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
+ <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" />
</target>
- <target name="rename.dylib" if="isOSX">
- <move file="${src}" tofile="${dest}" />
+ <target name="c.configure.linux.x86" if="isLinuxX86">
+ <echo message="Linux.x86" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <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" />
+ </target>
+
+ <target name="c.configure.linux.amd64" if="isLinuxAMD64">
+ <echo message="Linux.AMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
+ <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" />
+ </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.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" />
</target>
- <target name="c.build" depends="c.configure">
- <fail message="Requires '${c.compiler.src.files}'" unless="c.compiler.src.files"/>
- <fail message="Requires '${compiler.cfg.id}'" unless="compiler.cfg.id"/>
- <fail message="Requires '${linker.cfg.id}'" unless="linker.cfg.id"/>
- <fail message="Requires '${output.lib.name}'" unless="output.lib.name"/>
+ <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
- <echo message="Output lib name = ${output.lib.name}" />
+ <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.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" />
+ </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.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" />
+ </target>
+
- <!-- 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" />
+ <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.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" />
+ </target>
+
+ <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
+ <echo message="FreeBSD" />
+ <property name="compiler.cfg.id" value="compiler.cfg.freebsd.jogl" />
+ <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" />
+ </target>
- <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
+ <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.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" />
+ </target>
- <condition property="c.compiler.needs-libjvm">
- <and>
- <isset property="isHPUX"/>
- <isset property="c.compiler.use-jawt"/>
- </and>
- </condition>
+ <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
- <patternset id="c.src.files.jogl.awt">
- <include name="${rootrel.src.c.jogl}/JAWT*.c"/>
+ <target name="c.configure.x11" if="isX11" />
- <include name="${rootrel.generated.c.jogl}/X11/JAWT*.c" if="isX11"/>
+ <target name="c.configure.macosx" if="isOSX">
+ <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
+ <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" />
+ </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" />
- <include name="${rootrel.generated.c.jogl}/OSX/JAWT*.c" if="isOSX"/>
+ <target name="c.configure" depends="c.configure.1,c.configure.2" />
- <include name="${rootrel.generated.c.jogl}/Windows/JAWT*.c" if="isWindows"/>
- </patternset>
+ <target name="rename.mingw.dll" if="isMingW">
+ <move file="${src}" tofile="${dest}" />
+ </target>
- <patternset id="c.src.files.newt">
- <!-- FIXME: NEWT should be moved to another library -->
- <include name="${rootrel.src.c.newt}/WindowsWindow.c" if="isWindows"/>
- <include name="${rootrel.src.c.newt}/X11Window.c" if="isX11"/>
- <include name="${rootrel.src.c.newt}/OSXWindow.c" if="isOSX"/>
- </patternset>
+ <target name="rename.dylib" if="isOSX">
+ <move file="${src}" tofile="${dest}" />
+ </target>
- <patternset id="c.src.files.jogl.gl2">
- <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
- <!-- Xinerama supporting functions for Linux only (for now) -->
- <!-- Also supported on Solaris, but works differently -->
- <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
-
- <include name="${rootrel.src.c.jogl}/MacOSXWindowSystemInterface.m" if="isOSX"/>
-
- <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
-
- <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
-
- <include name="${rootrel.src.c.jogl}/ContextUpdater.m" if="isOSX"/>
-
- <include name="${rootrel.generated.c.jogl}/gl2/GL2Impl_JNI.c"/>
- <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
- <include name="${rootrel.generated.c.jogl}/gl2/GLUgl2_JNI.c"/>
-
- <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
- <include name="${rootrel.generated.c.jogl}/OSX/CGL*.c" if="isOSX"/>
- <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
-
- <!-- FIXME: the Mixer should be moved to another library -->
- <!--include name="${rootrel.src.c.jogl}/Mixer.cpp" if="isWindows"/-->
- </patternset>
-
- <patternset id="c.src.files.jogl.es2">
- <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
- <!-- Xinerama supporting functions for Linux only (for now) -->
- <!-- Also supported on Solaris, but works differently -->
- <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
-
- <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
-
- <include name="${rootrel.generated.c.jogl}/es2/GLES2Impl_JNI.c"/>
-
- <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
- <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
- </patternset>
-
- <patternset id="c.src.files.jogl.es1">
- <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
- <!-- Xinerama supporting functions for Linux only (for now) -->
- <!-- Also supported on Solaris, but works differently -->
- <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
-
- <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
-
- <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
- <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
-
- <include name="${rootrel.generated.c.jogl}/es1/GLES1Impl_JNI.c"/>
- <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
- <!--include name="${rootrel.generated.c.jogl}/es1/GLUes1_JNI.c" EMPTY /-->
- </patternset>
-
- <patternset id="c.src.files.cg">
- <include name="${rootrel.generated.c.cg}/*.c"/>
- </patternset>
-
- <cc outtype="shared"
- objdir="${obj.jogl}"
- outfile="${obj}/${output.lib.name}"
- optimize="${c.compiler.optimise}"
- debug="${c.compiler.debug}"
- multithreaded="true"
- exceptions="false"
- rtti="false">
-
- <!-- TODO: versioninfo companyname="java.net"
- legalcopyright="Copyright"
- productname="JOGL"
- productversion="x.y.z"
- description="Description"
- fileversion="x.y.z"
- filecomments="File Comment" /-->
-
- <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}"/>
- <includepath path="stub_includes/opengl"/>
- <includepath path="stub_includes/egl"/>
- <includepath path="stub_includes/cg" if="c.compiler.use-cglib"/>
-
- <!-- This is for the generated headers for handwritten C code -->
- <includepath path="${src.generated.c}" />
- <includepath path="${src.generated.c}/X11" if="isX11"/>
- <includepath path="${src.generated.c}/OSX" if="isOSX"/>
- <includepath path="${src.generated.c}/Windows" if="isWindows"/>
- <includepath path="${src.generated.c.newt}" />
- <includepath path="${src.generated.c.newt}/X11" if="isX11"/>
- <includepath path="${src.generated.c.newt}/OSX" if="isOSX"/>
- <includepath path="${src.generated.c.newt}/Windows" if="isWindows"/>
-
- <!-- 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.dir.platform}" libs="jawt" if="c.compiler.use-jawt"/>
- <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="c.compiler.needs-libjvm"/>
- </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="${build}/obj/lib${output.lib.name}.dylib" />
- <param name="dest" value="${build}/obj/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="${build}/lib${output.lib.name}.so" />
- <param name="dest" value="${build}/${output.lib.name}.dll" />
- </antcall>
- </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>
+
+ <condition property="useJAWT">
+ <and>
+ <istrue value="@{c.compiler.use-jawt}" />
+ </and>
+ </condition>
+
+ <condition property="c.compiler.needs-libjvm">
+ <and>
+ <isset property="isHPUX"/>
+ <isset property="useJAWT"/>
+ </and>
+ </condition>
+
+ <patternset id="c.src.files.jogl.awt">
+ <include name="${rootrel.src.c.jogl}/JAWT*.c"/>
+ <include name="${rootrel.generated.c.jogl}/X11/JAWT*.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/OSX/JAWT*.c" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/Windows/JAWT*.c" if="isWindows"/>
+ </patternset>
+
+ <patternset id="c.src.files.newt">
+ <!-- FIXME: NEWT should be moved to another library -->
+ <include name="${rootrel.src.c.newt}/WindowsWindow.c" if="isWindows"/>
+ <include name="${rootrel.src.c.newt}/X11Window.c" if="isX11"/>
+ <include name="${rootrel.src.c.newt}/OSXWindow.c" if="isOSX"/>
+ </patternset>
+
+ <patternset id="c.src.files.jogl.gl2">
+ <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
+ <!-- Xinerama supporting functions for Linux only (for now) -->
+ <!-- Also supported on Solaris, but works differently -->
+ <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
+ <include name="${rootrel.src.c.jogl}/MacOSXWindowSystemInterface.m" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
+ <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
+ <include name="${rootrel.src.c.jogl}/ContextUpdater.m" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/gl2/GL2Impl_JNI.c"/>
+ <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
+ <include name="${rootrel.generated.c.jogl}/gl2/GLUgl2_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/OSX/CGL*.c" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
+ <!-- FIXME: the Mixer should be moved to another library -->
+ <!--include name="${rootrel.src.c.jogl}/Mixer.cpp" if="isWindows"/-->
+ </patternset>
+
+ <patternset id="c.src.files.jogl.es2">
+ <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
+ <!-- Xinerama supporting functions for Linux only (for now) -->
+ <!-- Also supported on Solaris, but works differently -->
+ <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
+ <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/es2/GLES2Impl_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
+ <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
+ </patternset>
+
+ <patternset id="c.src.files.jogl.es1">
+ <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/>
+ <!-- Xinerama supporting functions for Linux only (for now) -->
+ <!-- Also supported on Solaris, but works differently -->
+ <include name="${rootrel.src.c.jogl}/Xinerama.c" if="isLinux"/>
+ <include name="${rootrel.generated.c.jogl}/X11/X11Lib_JNI.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
+ <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/>
+ <include name="${rootrel.generated.c.jogl}/es1/GLES1Impl_JNI.c"/>
+ <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
+ <!--include name="${rootrel.generated.c.jogl}/es1/GLUes1_JNI.c" EMPTY /-->
+ </patternset>
+
+ <patternset id="c.src.files.cg">
+ <include name="${rootrel.generated.c.cg}/*.c"/>
+ </patternset>
+
+ <echo message="Compiling ${output.lib.name}" />
+
+ <cc outtype="shared"
+ objdir="${obj.jogl}"
+ outfile="${obj}/@{output.lib.name}"
+ optimize="${c.compiler.optimise}"
+ debug="${c.compiler.debug}"
+ multithreaded="true"
+ exceptions="false"
+ rtti="false">
+
+ <!-- TODO: versioninfo companyname="java.net"
+ legalcopyright="Copyright"
+ productname="JOGL"
+ productversion="x.y.z"
+ description="Description"
+ fileversion="x.y.z"
+ filecomments="File Comment" /-->
+
+ <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}"/>
+ <includepath path="stub_includes/opengl"/>
+ <includepath path="stub_includes/egl"/>
+ <includepath path="stub_includes/cg" if="c.compiler.use-cglib"/>
+
+ <!-- This is for the generated headers for handwritten C code -->
+ <includepath path="${src.generated.c}" />
+ <includepath path="${src.generated.c}/X11" if="isX11"/>
+ <includepath path="${src.generated.c}/OSX" if="isOSX"/>
+ <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+ <includepath path="${src.generated.c.newt}" />
+ <includepath path="${src.generated.c.newt}/X11" if="isX11"/>
+ <includepath path="${src.generated.c.newt}/OSX" if="isOSX"/>
+ <includepath path="${src.generated.c.newt}/Windows" if="isWindows"/>
+
+ <!-- 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.dir.platform}" libs="jawt" if="useJAWT"/>
+ <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="c.compiler.needs-libjvm"/>
+ </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="${build}/obj/lib${output.lib.name}.dylib" />
+ <param name="dest" value="${build}/obj/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="${build}/lib${output.lib.name}.so" />
+ <param name="dest" value="${build}/${output.lib.name}.dll" />
+ </antcall>
+ </sequential>
+ </macrodef>
<target name="c.fixup.jawt.version.macosx" if="isOSX">
<!-- Edit the link to the JAWT version in the resulting jnilib
@@ -1385,58 +1373,47 @@
</target>
<target name="c.build.jogl.awt">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.jogl.awt"/>
- <param name="c.compiler.use-jawt" value="true"/>
- <param name="output.lib.name" value="jogl_awt"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.oswin}"/>
- </antcall>
+ <c.build c.compiler.src.files="c.src.files.jogl.awt"
+ c.compiler.use-jawt="true"
+ output.lib.name="jogl_awt"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.oswin}"/>
</target>
<!-- There is no native newt library on OS X -->
<target name="c.build.newt" unless="isOSX">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.newt"/>
- <param name="c.compiler.use-newt" value="true"/>
- <param name="output.lib.name" value="newt"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.oswin}"/>
- </antcall>
+ <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.build.jogl.gl2" unless="jogl.nogl2">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.jogl.gl2"/>
- <param name="c.compiler.use-gl2" value="true"/>
- <param name="output.lib.name" value="jogl_gl2"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.gl2}"/>
- </antcall>
+ <c.build c.compiler.src.files="c.src.files.jogl.gl2"
+ output.lib.name="jogl_gl2"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.gl2}"/>
</target>
<target name="c.build.jogl.es2" unless="jogl.noes1">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.jogl.es2"/>
- <param name="c.compiler.use-es2" value="true"/>
- <param name="output.lib.name" value="jogl_es2"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.core}"/>
- </antcall>
+ <c.build c.compiler.src.files="c.src.files.jogl.es2"
+ output.lib.name="jogl_es2"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.base}"/>
</target>
<target name="c.build.jogl.es1" unless="jogl.noes2">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.jogl.es1"/>
- <param name="c.compiler.use-es1" value="true"/>
- <param name="output.lib.name" value="jogl_es1"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.core}"/>
- </antcall>
+ <c.build c.compiler.src.files="c.src.files.jogl.es1"
+ output.lib.name="jogl_es1"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.base}"/>
</target>
<target name="c.build.jogl.cg" if="jogl.cg">
- <antcall target="c.build" inheritRefs="true">
- <param name="c.compiler.src.files" value="c.src.files.cg"/>
- <param name="c.compiler.use-cglib" value="true"/>
- <param name="output.lib.name" value="jogl_cg"/>
- <param name="linker.cfg.id" value="${linker.cfg.id.gl2}"/>
- </antcall>
+ <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}"/>
</target>
<target name="c.manifest.cg" if="jogl.cg">
@@ -1462,7 +1439,7 @@
<antcall target="c.manifest.cg" inheritRefs="true" />
</target>
- <target name="c.build.jogl" depends="c.build.jogl.prepare,c.build.jogl.awt,c.build.newt,c.build.jogl.gl2,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
+ <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.awt,c.build.newt,c.build.jogl.gl2,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
<antcall target="c.fixup.jawt.version.macosx" inheritrefs="true" />
<antcall target="c.manifest" inheritRefs="true" />
</target>
@@ -1698,7 +1675,7 @@
</javadoc>
</target>
- <target name="javadoc.dev.all" depends="load.user.properties,init,declare,javadoc.dev.nocg,javadoc.dev.cg" />
+ <target name="javadoc.dev.all" depends="load.user.properties,init,javadoc.dev.nocg,javadoc.dev.cg" />
<!-- ================================================================== -->
<!--
@@ -2158,14 +2135,7 @@
<!--
- Build everything.
-->
- <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,declare">
- <!-- Generate, compile, and build the jar for the Java sources. -->
- <antcall target="jar" inheritRefs="true" />
-
- <!-- Compile the native C sources . -->
- <antcall target="c.build.jogl" inheritRefs="true" />
- </target>
-
+ <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl" />
<!-- ================================================================== -->
<!--