1 <!-- Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL] -->
4 Subclasses of org.xwt.plat.GCJ should include a .xml file which
5 sets the following properties, then invokes <ant antfile="src/org/xwt/plat/GCJ.xml"/>
7 gcc-target - the gcc target name to use (for example, i686-pc-mingw32)
8 linkflags - extra flags to pass to gcj during the link phase, if any
9 binaryname - the name to give to the final binary
13 <project name="GCJ" default="build">
17 <echo message='extracting .class -> .h'/>
18 <taskdef name='gcjh' classname='org.xwt.tasks.GCJHTask'>
19 <classpath path='bin/'/>
21 <gcjh out='bin-${plat}' classpath='bin'/>
23 <echo message='compiling .java -> .o'/>
24 <apply failonerror='true' executable='${gcc-path}/bin/${gcc-target}gcj' dest='bin-${plat}'>
25 <arg value='-fCLASSPATH=bin/'/>
27 <arg value='-ffast-math'/>
28 <arg value='-fomit-frame-pointer'/>
29 <arg value='-foptimize-sibling-calls'/>
30 <arg value='-finline-functions'/>
31 <arg value='-funroll-loops'/>
37 <fileset dir='src/' includes='${javafiles}'>
38 <include name='org/xwt/*.java'/>
39 <include name='org/xwt/util/*.java'/>
40 <include name='org/xwt/plat/GCJ.java'/>
41 <include name='org/bouncycastle/**/*.java'/>
42 <include name='org/mozilla/**/*.java'/>
43 <exclude name='org/xwt/Trap.java'/>
45 <mapper type='glob' from='*.java' to='*.o'/>
48 <!-- we have to turn off optimization here due to a compiler bug -->
49 <apply failonerror='true' executable='${gcc-path}/bin/${gcc-target}gcj' dest='bin-${plat}'>
50 <arg value='-fCLASSPATH=bin/'/>
52 <arg value='-ffast-math'/>
53 <arg value='-fomit-frame-pointer'/>
54 <arg value='-foptimize-sibling-calls'/>
55 <arg value='-finline-functions'/>
56 <arg value='-funroll-loops'/>
63 <include name='org/xwt/Trap.java'/>
65 <mapper type='glob' from='*.java' to='*.o'/>
68 <echo message='compiling .cc -> .o'/>
69 <apply failonerror='true' executable='${gcc-path}/bin/${gcc-target}gcj' dest='bin-${plat}/'>
71 <arg value='-Ibin-${plat}'/>
76 <fileset dir='src/' includes='${ccfiles}'/>
77 <mapper type='glob' from='*.cc' to='*-nat.o'/>
80 <echo message='wrapping .xwar -> .o'/>
81 <apply failonerror='true' executable='${gcc-path}/bin/${gcc-target}gcj' dest='bin-${plat}/'>
82 <fileset dir='bin/' includes='**/*.xwar'/>
83 <arg value='--resource'/>
84 <arg value='org/xwt/builtin.xwar'/>
89 <mapper type='glob' from='*.xwar' to='*.o'/>
92 <echo message='linking .o -> ${binaryname}'/>
93 <uptodate property="linked" targetfile="bin-${plat}/${binaryname}">
94 <srcfiles dir="bin-${plat}/" includes="**/*.o" excludes='*.o'/>
96 <antcall target="link"/>
100 <target name="link" unless="linked">
101 <apply failonerror='true' executable='${gcc-path}/bin/${gcc-target}gcj' parallel='true'>
102 <fileset dir='bin-${plat}/' includes='**/*.o' excludes='*.o'/>
103 <arg value='-fCLASSPATH=${gcc-path}/share/libgcj.jar'/>
104 <arg value='--main=org.xwt.Main'/>
105 <arg line='-o bin-${plat}/${binaryname}'/>
107 <arg line='${linkflags}'/>