summaryrefslogtreecommitdiffstats
path: root/make/build-newt.xml
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-25 04:58:06 +0100
committerSven Gothel <[email protected]>2011-02-25 04:58:06 +0100
commit6ed203e605cd08af14f4649bd91c3e2a35e68634 (patch)
treefd58b6da6e37c4b9bd77dacc41421d25e9b29728 /make/build-newt.xml
parent6188d6a385056adade49fcb6d8247f94f96d402e (diff)
parente5777ec9e6ea79e0aface29fa679ccea4035f0e2 (diff)
Merge remote-tracking branch 'wwalker/2010_02_18_Eclipse_build_improvements'
Diffstat (limited to 'make/build-newt.xml')
-rw-r--r--make/build-newt.xml133
1 files changed, 78 insertions, 55 deletions
diff --git a/make/build-newt.xml b/make/build-newt.xml
index c91a2fda1..e135d2700 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -58,6 +58,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.
@@ -438,57 +443,79 @@
<echo message="Compiling @{output.lib.name}" />
- <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}"/>
- <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}/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="useKD" />
- <includepath path="${src.generated.c}/IntelGDL" if="useIntelGDL" />
- <includepath path="stub_includes/embedded/IntelGDL" if="useIntelGDL" />
- <includepath path="${src.generated.c}/BroadcomEGL" if="useBroadcomEGL" />
-
- <!-- 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>
+ <!-- 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}"/>
+ <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}/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="useKD" />
+ <includepath path="${src.generated.c}/IntelGDL" if="useIntelGDL" />
+ <includepath path="stub_includes/embedded/IntelGDL" if="useIntelGDL" />
+ <includepath path="${src.generated.c}/BroadcomEGL" if="useBroadcomEGL" />
+
+ <!-- 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>
@@ -536,10 +563,6 @@
</target>
<target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.natives">
- <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
- <param name="libdir" value="${obj.newt}"/>
- </antcall>
-
<antcall target="c.manifest" inheritRefs="true" />
</target>