This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
GCJ, Ant and packages?
- From: Martin Egholm Nielsen <martin at egholm-nielsen dot dk>
- To: java at gcc dot gnu dot org
- Date: Mon, 24 May 2004 16:16:11 +0200
- Subject: GCJ, Ant and packages?
Hi there,
I'm trying to create an Ant-script for compiling my .java-files to
.o-files using gcj. I've been inspired by Adam Megacz' build-script
(http://gcc.gnu.org/ml/java/2002-11/msg00025.html), but it keeps failing.
In short, I have the single working source-file
"src/some/pkg/TestClass.java" which I want to compile into the
destination directory "out".
My build.xml file is given below.
The error is understandable:
=== SNIP ===
[apply] Assembler messages:
[apply] FATAL: can't create C:\DATA\1\out\some\pkg\TestClass.o: No
such file or directory
=== SNIP ===
It's "bound" to fail since the package-directory does not exist.
However, I don't quite see how in the world Adam's script could ever work?!
Does any of you have a working Ant/GCJ environment - e.g. with a
homecooked gcj-anttask for compiling native objects.
Best regards,
Martin Egholm
=== BUILD.XML ===
<?xml version="1.0"?>
<project name="gcj" default="build" basedir=".">
<property name="OUTPUT" value="${basedir}/out" />
<target name="build" depends="">
<property name="INPUT" value="${basedir}/src" />
<mkdir dir="${OUTPUT}"/>
<!-- If I include the following it'll work -->
<!-- mkdir dir="${OUTPUT}/some/pkg" /-->
<apply failonerror='true' executable='gcj' dest="${OUTPUT}">
<arg value='-O'/>
<arg value='-g'/>
<arg value='-c'/>
<srcfile/>
<arg value='-o'/>
<targetfile/>
<fileset dir='${INPUT}'>
<include name="some/pkg/TestClass.java"/>
</fileset>
<mapper type='glob' from='*.java' to='*.o'/>
</apply>
</target>
</project>