Re: Cross-compiling into windows

Matt Mullens <[email protected]> Mon, 7 Apr 2003 16:46:33 -0700 (PDT)
Newsgroups gmane.comp.java.xwt.general
Message-ID <[email protected]>
--- Andrew Kohlsmith <[email protected]>
wrote:
> > I'm having a problem cross-compiling into Windows.
> > I've tried both my own build (made from gcc
> > 20030313), as well as the Makefile in xwt/gcc (the
> > xwt cvs).  The former works great for little test
> > programs - they run flawlessly on Windows, and
> will
> > compile xwt without complaint.  The latter won't
> > create the cross-compiler.  First it complains
> about
> > libiberty files missing, a missing Makefile.in,
> 
> Are you able to get mingw to compile?  I can't even
> get that far with CVS.
> 
>
../../../../../src/libjava/java/net/natPlainDatagramSocketImpl.cc:
> In member
>    function `virtual jint
>   
>
java::net::PlainDatagramSocketImpl::peek(java::net::InetAddress*)':
>
../../../../../src/libjava/java/net/natPlainDatagramSocketImpl.cc:313:
> 
> error: `   ECONNREFUSED' undeclared (first use this
> function)

Yeah I did actually, I had to mess with the
gcj sources a little bit.  Here's what I did, I
think the last of these fixes your problem.  Sorry
not in diff format, I've lost the originals
momentarily. Sorry, not 20030313 but 20030331
snapshot.


FILE:
libjava/gnu/java/nio/natSocketChannelImpl.cc

jint 
gnu::java::nio::SocketChannelImpl::SocketRead (jint
fd, jbyteArray data,jint offset, jint length)
{
   //MLM: hack, cast data to a char*
  int result = ::recv (fd, (char *)data, offset,
length);
  //int result = ::recv (fd, data, offset, length);

...

jint
gnu::java::nio::SocketChannelImpl::SocketWrite (jint
fd, jbyteArray data,jint offset, jint length)
{
   //MLM: hack, another cast
  int result = ::send (fd, (char *)data, offset,
length);
  //int result = ::send (fd, data, offset, length);

FILE:
libjava/java/net/natPlainDatagramSocketImpl.cc

add this to the top somewhere:
   #define ECONNREFUSED WSAECONNREFUSED

FILE:
libjava/gnu/java/nio/natSelectorImpl.cc

In this file, I actually had to copy _Jv_select out
of libjava/include/posix.h and paste it statically
in.  Yuck, but whatever, it gets the job done and I
didn't want to fool around with the linking.



__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

_______________________________________________
http://lists.xwt.org/listinfo/dev