Hi all,

I've patched Classpath up so that it can be compiled with the arm-wince cegcc toolchain.

cheers,
dalibor topic

2007-12-28  Dalibor Topic  <[EMAIL PROTECTED]>

   * configure.ac (AC_CHECK_HEADERS): Check for
   netinet/in_systm.h, netinet/ip.h and net/if.h
   for Windows CE.

   * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c:
   Guard net/if.h include statement. Use unsigned int
   instead of u_int.

   * native/jni/java-nio/gnu_java_nio_VMChannel.c:
   Guard sys/mman.h include statement.

   * native/jni/java-nio/gnu_java_nio_VMSelector.c:
   Guard sys/select.h include statement.

   * native/jni/java-nio/javanio.c:
   Guard sys/select.h include statement.

   * native/jni/java-nio/javanio.h:
   Include sys/time.h.

   * native/jni/native-lib/cpio.c:
   Guard chmod call by S_IWRITE, since it's not
   defined in the arm-wince toolchain.

   * native/jni/native-lib/cpnet.h:
   Guard netinet/in_systm.h and netinet/ip.h
   include statements.


? doc/cp-install.texinfo
Index: configure.ac
===================================================================
RCS file: /sources/classpath/classpath/configure.ac,v
retrieving revision 1.219
diff -u -r1.219 configure.ac
--- configure.ac	6 Nov 2007 13:38:40 -0000	1.219
+++ configure.ac	15 Nov 2007 11:02:48 -0000
@@ -368,6 +368,7 @@
   dnl On that system, sys/ioctl.h will not include sys/filio.h unless
   dnl BSD_COMP is defined; just including sys/filio.h is simpler.
   dnl Check for crt_externs.h on Darwin.
+  dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
   AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
 		    asm/ioctls.h \
 		    inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
@@ -378,7 +379,8 @@
 		    sys/mman.h \
 		    magic.h \
                     sys/event.h sys/epoll.h \
-		    ifaddrs.h])
+		    ifaddrs.h \
+		    netinet/in_systm.h netinet/ip.h net/if.h])
 
   AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
   AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
Index: native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c,v
retrieving revision 1.15
diff -u -r1.15 gnu_java_net_VMPlainSocketImpl.c
--- native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c	25 Jun 2007 00:05:33 -0000	1.15
+++ native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c	15 Nov 2007 11:02:53 -0000
@@ -51,7 +51,9 @@
 #endif
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#ifdef HAVE_NET_IF_H
 #include <net/if.h>
+#endif
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -416,7 +418,7 @@
 #ifdef HAVE_INET6	
   int result;
   const char *str_ifname = JCL_jstring_to_cstring (env, ifname);
-  u_int if_index;
+  unsigned int if_index;
 
   if ((*env)->ExceptionOccurred (env))
     {
@@ -433,7 +435,7 @@
     }
 
   result = setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
-                      (u_int *) &if_index, sizeof(if_index));
+                      (unsigned int *) &if_index, sizeof(if_index));
 
   JCL_free_cstring(env, ifname, str_ifname);
   
Index: native/jni/java-nio/gnu_java_nio_VMChannel.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,v
retrieving revision 1.21
diff -u -r1.21 gnu_java_nio_VMChannel.c
--- native/jni/java-nio/gnu_java_nio_VMChannel.c	24 Jun 2007 23:45:40 -0000	1.21
+++ native/jni/java-nio/gnu_java_nio_VMChannel.c	15 Nov 2007 11:02:53 -0000
@@ -43,7 +43,9 @@
 #include <config-int.h>
 
 #include <sys/types.h>
+#ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
+#endif
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
Index: native/jni/java-nio/gnu_java_nio_VMSelector.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c,v
retrieving revision 1.12
diff -u -r1.12 gnu_java_nio_VMSelector.c
--- native/jni/java-nio/gnu_java_nio_VMSelector.c	26 Nov 2006 20:51:57 -0000	1.12
+++ native/jni/java-nio/gnu_java_nio_VMSelector.c	15 Nov 2007 11:02:53 -0000
@@ -41,8 +41,9 @@
 #if defined(HAVE_SYS_TYPES_H)
 #include <sys/types.h>
 #endif
-
+#if defined(HAVE_SYS_SELECT_H)
 #include <sys/select.h>
+#endif
 #include <sys/time.h>
 
 #include <string.h>
Index: native/jni/java-nio/javanio.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-nio/javanio.c,v
retrieving revision 1.5
diff -u -r1.5 javanio.c
--- native/jni/java-nio/javanio.c	11 Apr 2007 21:37:35 -0000	1.5
+++ native/jni/java-nio/javanio.c	15 Nov 2007 11:02:53 -0000
@@ -45,7 +45,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#endif
 #include <sys/uio.h>
 
 CPNIO_EXPORT ssize_t
Index: native/jni/java-nio/javanio.h
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-nio/javanio.h,v
retrieving revision 1.3
diff -u -r1.3 javanio.h
--- native/jni/java-nio/javanio.h	4 Oct 2006 10:28:36 -0000	1.3
+++ native/jni/java-nio/javanio.h	15 Nov 2007 11:02:58 -0000
@@ -39,6 +39,8 @@
 #ifndef __JAVANIO_H__
 #define __JAVANIO_H__
 
+#include <sys/time.h>
+
 /**
  * This header defines functions that are called by our JNI reference
  * implementation of java.nio.*. In our reference implementation, these
Index: native/jni/native-lib/cpio.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/native-lib/cpio.c,v
retrieving revision 1.9
diff -u -r1.9 cpio.c
--- native/jni/native-lib/cpio.c	6 Nov 2007 13:38:39 -0000	1.9
+++ native/jni/native-lib/cpio.c	15 Nov 2007 11:02:58 -0000
@@ -349,9 +349,11 @@
 
   if (stat(filename, &statbuf) < 0)
     return errno;
- 
+
+#ifdef S_IWRITE 
   if (chmod(filename, statbuf.st_mode & ~(S_IWRITE | S_IWGRP | S_IWOTH)) < 0)
     return errno;
+#endif
 
   return 0;
 }
Index: native/jni/native-lib/cpnet.h
===================================================================
RCS file: /sources/classpath/classpath/native/jni/native-lib/cpnet.h,v
retrieving revision 1.5
diff -u -r1.5 cpnet.h
--- native/jni/native-lib/cpnet.h	25 Jun 2007 00:05:33 -0000	1.5
+++ native/jni/native-lib/cpnet.h	15 Nov 2007 11:02:58 -0000
@@ -44,9 +44,13 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
 #include <netinet/in_systm.h>
+#endif /* HAVE_NETINET_IN_SYSTM_H */
 #include <netinet/in.h>
+#ifdef HAVE_NETINET_IP_H
 #include <netinet/ip.h>
+#endif /* HAVE_NETINET_IP_H */
 
 typedef struct {
   jint len;

Reply via email to