This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: how to help? help me!


On Sat, 2002-12-21 at 11:13, Erik Poupaert wrote:
> Hi Kho,
Hi Erik (please call me bhun or abhun okay???)

> your source tree and specify -MM to gcj (there are some other options
> too).
Well suppose you have tree classes A, B, C:

public class A { public static void main(String args[]) { new B();}}
public class B { B() { new C(); } }
public class C { C() { new A(); } }

The -MM option only works (it seems) when compiling to native code:

gcj -MM A.java B.java C.java -c

the -c switch tells gcc to compile only and not link everything
together. you'll get output like this:

A.o: A.java ./B.java
B.o: B.java ./C.java
C.o: C.java ./A.java

So to compile A.o we need A.java and B.java, to get B.o B.java and
C.java. Usually when you watch the output files of make, you'll notice
that linking is usually done at the very end.

> 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.
I am compiling it every possible way to see where gcj could foul up. I
am having a real hard time with my system. Like I was trying rebuild my
whole os from the ground up (don't ask my why I am a nutter sometimes, I
even had to turn my Windows partition for the first time in months).

> By the way, jikes is blazingly fast; but is there a way to avoid double
I know. Only once in a while I get some report about jikes not produces
correct bytecode. Doesn't really actually matter, gcj is quite fast too.
(Same translator?)

> supply as a classpath to GCJ. I haven't been able to instruct GCJ to produce
> its own classpath information.
What do you mean? I do about the same thing with bash scripting (very
silly bash scripting but hey it works :D). Do you mean the -MM output?

>         <apply executable='gcj' dest='obj'>
...
>         </apply>

LOL. You have the same problem with ant? It's really strange that it's
not possible to specify arg line="...." Haven't had time for it yet, I
really messed up my installation (actually  happens when I spend too
much time behind the pc, which is like every day).

> 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

<condition property="dir.exists"><available file=".."/></condition>
this sets the property if the dir exists. there are some other ways too.
you can also just
<mkdir dir="somedir""/>
and always create the directory, just to be sure.

> 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.
Hey good idea!!! (off-topic) I can't find a real option do that that yet
in ant at the moment. Do you have any good ideas on this? Like mapping
the .java tree to an object tree is  easy:
<mapper type="global" from="*.java" to="*.o"/>
But if the directories aren't there then that's a problem as you
indicated. Maybe we ought to extend the mkdir task to take a "from"
parameter that specifies the root of a java tree and a "to" parameter
that specifies the target and replicate the whole structure. It's quite
easy, could fix that in like a few minutes. Useful, or is it already
implemented?

I did encounter some bugs though when I recompiled Ant the last time
using the 3.3 release on my now deceased mandrake system. I am now
rebuilding a downgraded (I hate big version numbers anyways let's call
the new gcj GCJ 3000+ Super Forte) gcj with the new StringTokenizer and
see if everything is working with ant, haven't used a real vm yet (I
hope to trace bugs easier like this, and get used to gdb, wonderful
thing).

greets Abhun.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]