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]

The GCC 3.3 / MingW Cross Compiler Seems to Work! Woo hoo!


Ranjit>  Thank you, but in all fairness, I must point out that it has got
Ranjit> nothing to do with that patch - see libjava/configure.in:
Ranjit> ------------------------------- 8< -----------------------------------
Ranjit> # Only use libltdl for native builds.
Ranjit> if test -z "${with_cross_host}"; then
Ranjit>    AC_LIBLTDL_CONVENIENCE
Ranjit>    AC_LIBTOOL_DLOPEN
Ranjit> ...
Ranjit> ------------------------------- 8< -----------------------------------
Ranjit> 
Ranjit> For a crossed-native build, host==target and with_cross_host is
Ranjit> therefore not defined.
Ranjit> 
Ranjit> However, I do not understand why libltdl should not be built
Ranjit> while building a cross-compiler - the compiled binaries are
Ranjit> ultimately anyway going to run on the target...

Following this line of reasoning (Frank had pointed this out too), I commented
out these lines in libjava/configure:

# Only use libltdl for native builds.
if test -z "${with_cross_host}"; then
fi

reconfigured and rebuilt gcc, and... JNI worked in the cross-compiler!
My cross-compiled SWT HelloWorld samples worked too! Woo hoo!

(I know I was supposed to fix configure.in and regenerate configure.
Haven't a clue as to how to do this yet. At this point, I only have an
inkling as to what automake and autoconf are. I'll have to read up
on all this.)

To summarize, I followed Lars' build tips plus the above configure hack

http://gcc.gnu.org/ml/java/2003-02/msg00134.html

modified the SWT build script from:

http://gcc.gnu.org/ml/java/2002-12/msg00105.html

and built a GCC/GCJ cross compiler for MingW. For those of you who just
joined us, I am only dealing with the cross compiler (Linux to Win32/MingW)
at this point, not the crossed-native compiler (Win32/MingW to Win32/MingW).

What's more, all of the examples worked!, including my faulty
Hello2.java which sucked me into this fun, complex, scary maelstrom
in the first place:

http://gcc.gnu.org/ml/java/2003-02/msg00044.html

I'll do a more thorough writeup on this later.

Next steps:
- take Ranjit's new Win32 Process implementation out for a spin.
  I need this too for what I'm trying to do.
- attempt to build the crossed-native compiler

Thanks again to everyone for all your guidance and encouragement.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/





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