This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: how to help? help me!
- From: "Erik Poupaert" <erik dot poupaert at chello dot be>
- To: "Dhek Bhun Kho" <bhun at chello dot nl>
- Cc: <java at gcc dot gnu dot org>
- Date: Sat, 21 Dec 2002 17:13:26 +0100
- Subject: RE: how to help? help me!
Hi Kho,
>>>> You can emit dependecy lists by incrementally compiling
your source tree and specify -MM to gcj (there are some other options
too).
That sounds interesting. How does the -MM work then?
I currently compile sourcetrees using a different procedure.
First, I use jikes to create a corresponding cls tree:
<target name="cls-compile" depends="init">
<property name="build.compiler" value="jikes"/>
<javac srcdir="src" destdir="cls" classpath="lib" includes="
**/*.java"/>
</target>
lib contains a copy of libjava-3.2.jar.
By the way, jikes is blazingly fast; but is there a way to avoid double
compilation? At this point, without jikes, I wouldn't have anything to
supply as a classpath to GCJ. I haven't been able to instruct GCJ to produce
its own classpath information.
Then I use the jikes-produced clstree as classpath for gcj, and I compile to
*.o files:
<apply executable='gcj' dest='obj'>
<arg value='-fCLASSPATH=cls/'/>
<arg value='-c'/>
<arg value='-Os'/>
<srcfile/>
<arg value='-o'/>
<targetfile/>
<fileset dir='src/'>
</fileset>
<mapper type='glob' from='*.java' to='*.o'/>
</apply>
By the way, gcj will not create the output directory, if it doesn't exist.
Is there a way to instruct Ant to create a corresponding directory tree? I
mean, a directory structure in obj that corresponds to the directory
structure in src. Currently, I do it manually.
Then I link the *.o files produced:
<apply failonerror="true" executable="gcj" parallel="true">
<fileset dir="obj/" includes="**/*.o"/>
<arg value="--main=MyMain"/>
<arg value='-s'/>
<arg value='-Os'/>
<arg line="-o exe/myexecutable.exe"/>
<srcfile/>
</apply>
You know what would really help? If GCJ could simply take a source tree as
argument and produce a corresponding *.o tree. Then all these shellscripts,
makefiles, special Ant tasks and so on, would not be needed. It would
tremendously simplify the compilation procedure. And traditional Java
development is done in that way anyway: an src tree is just compiled to a
corresponding cls tree. For native compilation, an src tree would simply
have to be compiled to a corresponding obj tree.