summaryrefslogtreecommitdiffstats
path: root/make/build-nativewindow.xml
diff options
context:
space:
mode:
Diffstat (limited to 'make/build-nativewindow.xml')
-rw-r--r--make/build-nativewindow.xml123
1 files changed, 73 insertions, 50 deletions
diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
index 1e38a43f0..475904b06 100644
--- a/make/build-nativewindow.xml
+++ b/make/build-nativewindow.xml
@@ -53,9 +53,14 @@
-->
<project name="NativeWindow" basedir="." default="all">
- <import file="build-common.xml"/>
+ <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.
-->
@@ -547,50 +552,72 @@
<echo message="Compiling @{output.lib.name}" />
- <cc outtype="shared"
- objdir="${obj.nativewindow}"
- outfile="${obj.nativewindow}/@{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}"/>
- <!-- 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.c}"/>
-
- <!-- 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="@{output.lib.name}.useLibJAWT"/>
- <syslibset dir="${java.lib.dir.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.nativewindow}/obj/lib@{output.lib.name}.dylib" />
- <param name="dest" value="${build.nativewindow}/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.nativewindow}/obj/lib@{output.lib.name}.so" />
- <param name="dest" value="${build.nativewindow}/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.nativewindow}" includes="lib@{output.lib.name}.so"/>
+ <fileset dir="${obj.nativewindow}" includes="@{output.lib.name}.dll"/>
+ <fileset dir="${obj.nativewindow}" includes="lib@{output.lib.name}.jnilib"/>
+ </targetfiles>
+ <sequential>
+ <cc outtype="shared"
+ objdir="${obj.nativewindow}"
+ outfile="${obj.nativewindow}/@{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}"/>
+ <!-- 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.c}"/>
+
+ <!-- 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="@{output.lib.name}.useLibJAWT"/>
+ <syslibset dir="${java.lib.dir.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.nativewindow}/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${obj.nativewindow}/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.nativewindow}/lib@{output.lib.name}.so" />
+ <param name="dest" value="${obj.nativewindow}/@{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.nativewindow}"/>
+ </antcall>
+
+ </sequential>
+ </outofdate>
</sequential>
</macrodef>
@@ -642,10 +669,6 @@
</target>
<target name="c.build.nativewindow" depends="c.configure,c.build.nativewindow.windowlib,c.build.nativewindow.awt">
- <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
- <param name="libdir" value="${obj.nativewindow}"/>
- </antcall>
-
<antcall target="c.fixup.jawt.version.macosx" inheritrefs="true" />
<antcall target="c.manifest" inheritRefs="true" />
</target>