aboutsummaryrefslogtreecommitdiffstats
path: root/make/build-jogl.xml
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2011-02-17 09:29:40 -0600
committerWade Walker <[email protected]>2011-02-18 08:52:34 -0600
commit943313af19da04044dddda57cb6bc4bd399eb76e (patch)
tree0f074ca1ac42e63a18cba1a2e7aa15ea9180af92 /make/build-jogl.xml
parent9ddcdd544e08326facbc19419452bd2745352aef (diff)
Prevent native libraries from always rebuilding and stripping
The cc task will always re-link, even if no source files are built. This commit wraps an uptodate task around cc to prevent this, so the libraries will only be rebuilt now if a source file changes. This commit also moves library symbol stripping into the same uptodate task, so it only happens if a library is built (previously the libraries were always stripped).
Diffstat (limited to 'make/build-jogl.xml')
-rw-r--r--make/build-jogl.xml131
1 files changed, 77 insertions, 54 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index 7376c469d..f7e83a489 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -62,6 +62,11 @@
<import file="build-common.xml"/>
+ <!-- needed for outofdate task -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+ </taskdef>
+
<!-- ================================================================== -->
<!--
- Base initialization and detection of operating system.
@@ -1250,56 +1255,78 @@
<echo message="Compiling @{output.lib.name}" />
- <cc outtype="shared"
- objdir="${obj.joglsub}"
- outfile="${obj.jogl}/@{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}"/>
- <includepath path="stub_includes/khr"/>
- <includepath path="stub_includes/egl"/>
- <includepath path="stub_includes/opengl"/>
- <includepath path="stub_includes/openmax" if="useOpenMAX"/>
- <includepath path="stub_includes/cg" if="jogl.cg"/>
-
- <!-- 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}/MacOSX" if="isOSX"/>
- <includepath path="${src.generated.c}/Windows" if="isWindows"/>
- <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
-
- <!-- 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="${build.jogl}/obj/lib@{output.lib.name}.dylib" />
- <param name="dest" value="${build.jogl}/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.jogl}/obj/lib@{output.lib.name}.so" />
- <param name="dest" value="${build.jogl}/obj/@{output.lib.name}.dll" />
- </antcall>
+ <!-- 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.jogl}" includes="lib@{output.lib.name}.so"/>
+ <fileset dir="${obj.jogl}" includes="@{output.lib.name}.dll"/>
+ <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.jnilib"/>
+ </targetfiles>
+ <sequential>
+ <cc outtype="shared"
+ objdir="${obj.joglsub}"
+ outfile="${obj.jogl}/@{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}"/>
+ <includepath path="stub_includes/khr"/>
+ <includepath path="stub_includes/egl"/>
+ <includepath path="stub_includes/opengl"/>
+ <includepath path="stub_includes/openmax" if="useOpenMAX"/>
+ <includepath path="stub_includes/cg" if="jogl.cg"/>
+
+ <!-- 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}/MacOSX" if="isOSX"/>
+ <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+ <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
+
+ <!-- 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.jogl}/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${obj.jogl}/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.jogl}/lib@{output.lib.name}.so" />
+ <param name="dest" value="${obj.jogl}/@{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.jogl}"/>
+ </antcall>
+
+ </sequential>
+ </outofdate>
</sequential>
</macrodef>
@@ -1354,10 +1381,6 @@
</target>
<target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.desktop,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
- <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
- <param name="libdir" value="${obj.jogl}"/>
- </antcall>
-
<antcall target="c.manifest" inheritRefs="true" />
</target>