fix build on OpenSolaris

View: New views
3 Messages — Rating Filter:   Alert me  

fix build on OpenSolaris

by Christian Thalinger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

This small changes fix the build on OpenSolaris.  It additionally checks
for sys/sockio.h and libsocket.so.  Andrew, can you try them on your
Solaris system?

- twisti

---

Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.237
diff -u -3 -p -r1.237 configure.ac
--- configure.ac        26 Jun 2008 09:58:29 -0000      1.237
+++ configure.ac        7 Jul 2008 08:03:58 -0000
@@ -398,6 +398,7 @@ if test "x${COMPILE_JNI}" = xyes; then
   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.
   dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
+  dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
   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 \
@@ -410,14 +411,15 @@ if test "x${COMPILE_JNI}" = xyes; then
                     sys/event.h sys/epoll.h \
                    ifaddrs.h \
                    netinet/in_systm.h netinet/ip.h net/if.h \
-                   sys/loadavg.h])
+                   sys/loadavg.h sys/sockio.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]))
   AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
   AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
 
-  AC_SEARCH_LIBS([inet_pton],[nsl])
+  AC_SEARCH_LIBS([inet_pton],[nsl])
+  AC_CHECK_LIB([socket], [gethostname])
   AC_CHECK_FUNCS([ftruncate fsync select \
                  gethostname socket strerror fork pipe execve open close \
                  lseek fstat read readv write writev htonl memset htons connect \
Index: native/jni/java-net/java_net_VMNetworkInterface.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,v
retrieving revision 1.7
diff -u -3 -p -r1.7 java_net_VMNetworkInterface.c
--- native/jni/java-net/java_net_VMNetworkInterface.c   15 May 2008 18:44:36 -0000      1.7
+++ native/jni/java-net/java_net_VMNetworkInterface.c   7 Jul 2008 08:04:00 -0000
@@ -52,6 +52,12 @@ exception statement from your version. *
 
 #include <net/if.h>
 #include <sys/ioctl.h>
+/* Required on Solaris. */
+#include <unistd.h>
+
+#ifdef HAVE_SYS_SOCKIO_H
+# include <sys/sockio.h>
+#endif
 
 #include <jni.h>
 #include <jcl.h>




Re: fix build on OpenSolaris

by gnu_andrew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2008/7/7 Christian Thalinger <twisti@...>:
> Hi!
>
> This small changes fix the build on OpenSolaris.  It additionally checks
> for sys/sockio.h and libsocket.so.  Andrew, can you try them on your
> Solaris system?
>
> - twisti
>

Thanks, this gets my build past VMNetworkInterface.  Can you please commit?

> ---
>
> Index: configure.ac
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/configure.ac,v
> retrieving revision 1.237
> diff -u -3 -p -r1.237 configure.ac
> --- configure.ac        26 Jun 2008 09:58:29 -0000      1.237
> +++ configure.ac        7 Jul 2008 08:03:58 -0000
> @@ -398,6 +398,7 @@ if test "x${COMPILE_JNI}" = xyes; then
>   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.
>   dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
> +  dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
>   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 \
> @@ -410,14 +411,15 @@ if test "x${COMPILE_JNI}" = xyes; then
>                     sys/event.h sys/epoll.h \
>                    ifaddrs.h \
>                    netinet/in_systm.h netinet/ip.h net/if.h \
> -                   sys/loadavg.h])
> +                   sys/loadavg.h sys/sockio.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]))
>   AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
>   AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
>
> -  AC_SEARCH_LIBS([inet_pton],[nsl])
> +  AC_SEARCH_LIBS([inet_pton],[nsl])
> +  AC_CHECK_LIB([socket], [gethostname])
>   AC_CHECK_FUNCS([ftruncate fsync select \
>                  gethostname socket strerror fork pipe execve open close \
>                  lseek fstat read readv write writev htonl memset htons connect \
> Index: native/jni/java-net/java_net_VMNetworkInterface.c
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,v
> retrieving revision 1.7
> diff -u -3 -p -r1.7 java_net_VMNetworkInterface.c
> --- native/jni/java-net/java_net_VMNetworkInterface.c   15 May 2008 18:44:36 -0000      1.7
> +++ native/jni/java-net/java_net_VMNetworkInterface.c   7 Jul 2008 08:04:00 -0000
> @@ -52,6 +52,12 @@ exception statement from your version. *
>
>  #include <net/if.h>
>  #include <sys/ioctl.h>
> +/* Required on Solaris. */
> +#include <unistd.h>
> +
> +#ifdef HAVE_SYS_SOCKIO_H
> +# include <sys/sockio.h>
> +#endif
>
>  #include <jni.h>
>  #include <jcl.h>
>
>
>
>



--
Andrew :-)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8


Re: fix build on OpenSolaris

by Christian Thalinger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 2008-07-07 at 09:40 +0100, Andrew John Hughes wrote:

> 2008/7/7 Christian Thalinger <twisti@...>:
> > Hi!
> >
> > This small changes fix the build on OpenSolaris.  It additionally checks
> > for sys/sockio.h and libsocket.so.  Andrew, can you try them on your
> > Solaris system?
> >
> > - twisti
> >
>
> Thanks, this gets my build past VMNetworkInterface.  Can you please commit?

Commited as:

2008-07-07  Christian Thalinger  <twisti@...>

        * configure.ac (AC_CHECK_HEADERS): Added sys/sockio.h, required
        for Solaris.
        (AC_CHECK_LIB): Check for socket.
        * native/jni/java-net/java_net_VMNetworkInterface.c (unistd.h):
        Added.
        [HAVE_SYS_SOCKIO_H] (sys/sockio.h): Likewise.

- twisti


LightInTheBox - Buy quality products at wholesale price