This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.


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

Re: GCJ & libgcj


>AG
>It's waiting for an implementation.  I think the best plan for a win32
>port would be to go to native win32 calls as soon as possible, and try
>to avoid compatibility layers like the sourceware pthreads or cygwin
>dll.

Ok, no dll. I haven't tried building with mingw yet. I'll give that a try.
Here the current status. It compiles and a basic helloworld.exe runs fine
(requires cygwin1.dll) . Threads don't work yet. Timezone reports gmt. I
haven't tried it with mauve yet. Here are the issues I ran into while
compiling. These are not in patches because I want some input first.

1) Path and File separators. sh scripts were confused by ';' and '\' file
and path separators so i modified both egcs/gcc/java/jcf-path.c and
egcs/config/i386/xm-cygwin.h to use unix sytle separators and rebuilt. Then
I also modified libgcj/libjava/java/lang/natSystem.cc to use unix style
separators. I use bash and like unix-style but I'm not sure if this is
exceptable to everyone. This could also be handled with modifications to the
makefiles and some sed scripts if the other solution isn't accepable. Also,
an evironment variable like java's file.separator and path.separator might
be used. How do you handle the "java -D" option anyway?

2.) libgcj/libjava/java/lang/natSystem.cc
One change was just checked in. The other is just the separators I mentioned
above.

3.) libgcj/libjava/java/util/natGregorianCalendar.cc
I don't have timezone, I just have _timezone. Also, I think I might need to
call tzset(). Either way, TimeZone.getDefaut() still returns GMT.

4.) libgcj/libjava/java/net/natInetAddress.cc
I don't have AF_INET6 or in_addr_t, but I do have sockaddr_in6 and
inet_addr. HAVE_INET6 passed but the following fail:
#elif defined(HAVE_INET_ADDR)
   in_addr_t laddr = inet_addr (hostname); // in_addr_t is undefined
   if (laddr != (in_addr_t)(-1))

** and**

#ifdef HAVE_INET6
      else if (len == 16)
{
   val = (char *) &chars;
   type = AF_INET6; // AF_INET6 is undefined


This could be checked for the configure script. I defined in_addr_t as an
unsigned_long. I couldn't find AF_INET6 so I just commented it out for now.
If these are missing would could define them if that's safe or just fail
them. natPlainSocketImpl.cc also has AF_INET6.

4.) installing:
EXEEXT in libgcj_build/i686-pc-cygwin32/libjava/Makefile was blank. I'm not
sure why this didn't pass through. I haven't looked into it yet. I just set
it to .exe. I also added to sh scripts that just call the correct filename
in the correct place, but I can't remember if these were used building egcs
or libgcj. I'll revisit this and find a better solution.

That's it for now.

Sean