]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
configure.in: Check for in_addr_t in netinet/in.h too.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 21 Aug 1999 14:26:15 +0000 (14:26 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 21 Aug 1999 14:26:15 +0000 (14:26 +0000)
* configure.in: Check for in_addr_t in netinet/in.h too.  Check
for ip_mreq too.
* acconfig.h: Define HAVE_IN_ADDR_T instead of in_addr_t.
(HAVE_STRUCT_IP_MREQ): Added.
* configure, include/config.h.in: Rebuilt.
* java/net/natInetAddress.cc (aton): Typedef in_addr_t to jint
if needed.
* java/net/natPlainDatagramSocketImpl.cc (McastReq, mcastGrp):
Disable if ip_mreq is not available.

From-SVN: r28797

libjava/ChangeLog
libjava/acconfig.h
libjava/configure
libjava/configure.in
libjava/include/config.h.in
libjava/java/net/natInetAddress.cc
libjava/java/net/natPlainDatagramSocketImpl.cc

index f2e32faad5012c3c484c9e01e88fa606430f023d..ae7921e8b14c4e59c48eab3e53ec7d1f3469f5e8 100644 (file)
@@ -1,5 +1,15 @@
 1999-08-21  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * configure.in: Check for in_addr_t in netinet/in.h too.  Check
+       for ip_mreq too.
+       * acconfig.h: Define HAVE_IN_ADDR_T instead of in_addr_t.
+       (HAVE_STRUCT_IP_MREQ): Added.
+       * configure, include/config.h.in: Rebuilt.
+       * java/net/natInetAddress.cc (aton): Typedef in_addr_t to jint
+       if needed.
+       * java/net/natPlainDatagramSocketImpl.cc (McastReq, mcastGrp):
+       Disable if ip_mreq is not available.
+       
        * configure.in: Check types ssize_t and in_addr_t.
        * acconfig.h: Undefine them.
        * configure, include/config.h.in: Rebuilt.
index 26b34cbb9e593d3838972adf00874b3f098f23dc..5fb6265f43d444f210d8ab04dd423d03179e3cbd 100644 (file)
 /* Define to `int' if `ssize_t' is not defined.  */
 #undef ssize_t
 
-/* Define to `jint' if `in_addr_t' is not defined.  */
-#undef in_addr_t
+/* Define to 1 if `in_addr_t' is defined in sys/types.h or
+   netinet/in.h.  */
+#undef HAVE_IN_ADDR_T
 
 /* Define if inet6 structures are defined in netinet/in.h.  */
 #undef HAVE_INET6
 
+/* Define if struct ip_mreq is defined in netinet/in.h.  */
+#undef HAVE_STRUCT_IP_MREQ
+
 /* Define it socklen_t typedef is in sys/socket.h.  */
 #undef HAVE_SOCKLEN_T
 
index ef86b46f2e105c554bc0cc0a92ef2237ef5e0dbe..2e5ae8c5c3abe2231629523c71a2209e94610197 100755 (executable)
@@ -4434,51 +4434,75 @@ EOF
 
 fi
 
+
 echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:4439: checking for in_addr_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_in_addr_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4444 "configure"
+echo "configure:4440: checking for in_addr_t" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+int main() {
+in_addr_t foo;
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])in_addr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+if { (eval echo configure:4456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ac_cv_type_in_addr_t=yes
+  cat >> confdefs.h <<\EOF
+#define HAVE_IN_ADDR_T 1
+EOF
+
+   echo "$ac_t""yes" 1>&6
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_type_in_addr_t=no
+  echo "$ac_t""no" 1>&6
 fi
 rm -f conftest*
 
-fi
-echo "$ac_t""$ac_cv_type_in_addr_t" 1>&6
-if test $ac_cv_type_in_addr_t = no; then
+echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
+echo "configure:4472: checking whether struct ip_mreq is in netinet/in.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4474 "configure"
+#include "confdefs.h"
+#include <netinet/in.h>
+int main() {
+struct ip_mreq mreq;
+; return 0; }
+EOF
+if { (eval echo configure:4481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
   cat >> confdefs.h <<\EOF
-#define in_addr_t jint
+#define HAVE_STRUCT_IP_MREQ 1
 EOF
 
+   echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
 fi
-
+rm -f conftest*
 
 echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:4473: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:4497: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4475 "configure"
+#line 4499 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 int main() {
 struct sockaddr_in6 addr6;
 ; return 0; }
 EOF
-if { (eval echo configure:4482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_INET6 1
@@ -4494,16 +4518,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:4498: checking for socklen_t in sys/socket.h" >&5
+echo "configure:4522: checking for socklen_t in sys/socket.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4500 "configure"
+#line 4524 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int main() {
 socklen_t x = 5;
 ; return 0; }
 EOF
-if { (eval echo configure:4507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
@@ -4519,16 +4543,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:4523: checking for tm_gmtoff in struct tm" >&5
+echo "configure:4547: checking for tm_gmtoff in struct tm" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4525 "configure"
+#line 4549 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 struct tm tim; tim.tm_gmtoff = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define STRUCT_TM_HAS_GMTOFF 1
@@ -4541,16 +4565,16 @@ else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
    echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6
-echo "configure:4545: checking for global timezone variable" >&5
+echo "configure:4569: checking for global timezone variable" >&5
             cat > conftest.$ac_ext <<EOF
-#line 4547 "configure"
+#line 4571 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 long z2 = timezone;
 ; return 0; }
 EOF
-if { (eval echo configure:4554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_TIMEZONE 1
@@ -4570,19 +4594,19 @@ rm -f conftest*
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4574: checking for working alloca.h" >&5
+echo "configure:4598: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4579 "configure"
+#line 4603 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:4586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -4603,12 +4627,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4607: checking for alloca" >&5
+echo "configure:4631: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4612 "configure"
+#line 4636 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4636,7 +4660,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4668,12 +4692,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4672: checking whether alloca needs Cray hooks" >&5
+echo "configure:4696: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4677 "configure"
+#line 4701 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4698,12 +4722,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4702: checking for $ac_func" >&5
+echo "configure:4726: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4707 "configure"
+#line 4731 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4726,7 +4750,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4753,7 +4777,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4757: checking stack direction for C alloca" >&5
+echo "configure:4781: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4761,7 +4785,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4765 "configure"
+#line 4789 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4780,7 +4804,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4803,7 +4827,7 @@ fi
 
 
 echo $ac_n "checking for g++ -g jboolean bug""... $ac_c" 1>&6
-echo "configure:4807: checking for g++ -g jboolean bug" >&5
+echo "configure:4831: checking for g++ -g jboolean bug" >&5
 if eval "test \"`echo '$''{'libjava_cv_gxx_debug_jboolean_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4816,14 +4840,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
 cross_compiling=$ac_cv_prog_cxx_cross
 
   cat > conftest.$ac_ext <<EOF
-#line 4820 "configure"
+#line 4844 "configure"
 #include "confdefs.h"
 typedef __java_boolean jboolean;
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libjava_cv_gxx_debug_jboolean_bug=no
 else
@@ -4857,7 +4881,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4861: checking for $ac_word" >&5
+echo "configure:4885: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
index d4aa67e0a06918a4dd1e9ded02041f7853c27bb8..557cf4ec7d5b875032eeb5eada4f53a50954d141 100644 (file)
@@ -518,7 +518,25 @@ dnl for now.  If you change this, you also must update natFile.cc.
 AC_CHECK_HEADERS(dirent.h)
 
 AC_CHECK_TYPE([ssize_t], [int])
-AC_CHECK_TYPE([in_addr_t], [jint])
+
+AC_MSG_CHECKING([for in_addr_t])
+AC_TRY_COMPILE([#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif], [in_addr_t foo;],
+  [AC_DEFINE([HAVE_IN_ADDR_T])
+   AC_MSG_RESULT(yes)],
+  [AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([whether struct ip_mreq is in netinet/in.h])
+AC_TRY_COMPILE([#include <netinet/in.h>], [struct ip_mreq mreq;],
+  [AC_DEFINE(HAVE_STRUCT_IP_MREQ)
+   AC_MSG_RESULT(yes)],
+  [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
 AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
index 0c7ba29c4c0375821aa899b41880c182cb82e7a2..3923d3e5fed6fd6e0fdf2f094fd7727918093c8a 100644 (file)
 /* Define to `int' if `ssize_t' is not defined.  */
 #undef ssize_t
 
-/* Define to `jint' if `in_addr_t' is not defined.  */
-#undef in_addr_t
+/* Define to 1 if `in_addr_t' is defined in sys/types.h or
+   netinet/in.h.  */
+#undef HAVE_IN_ADDR_T
 
 /* Define if inet6 structures are defined in netinet/in.h.  */
 #undef HAVE_INET6
 
+/* Define if struct ip_mreq is defined in netinet/in.h.  */
+#undef HAVE_STRUCT_IP_MREQ
+
 /* Define it socklen_t typedef is in sys/socket.h.  */
 #undef HAVE_SOCKLEN_T
 
index b15590a0ebc70cb6d8908efd3f8f2b99a56ddbc5..6e014ab6f862f0f2804c0a34bbaa7de2d8633e03 100644 (file)
@@ -71,6 +71,9 @@ java::net::InetAddress::aton (jstring host)
       blen = 4;
     }
 #elif defined(HAVE_INET_ADDR)
+#if ! HAVE_IN_ADDR_T
+  typedef jint in_addr_t;
+#endif
   in_addr_t laddr = inet_addr (hostname);
   if (laddr != (in_addr_t)(-1))
     {
index 574c8da903ed6ed4a1f7f60fc4fff1cc95e7ce6f..714205440b1b3c6495babe43918bf374dbd49fdc 100644 (file)
@@ -52,7 +52,9 @@ union SockAddr
 
 union McastReq
 {
+#if HAVE_STRUCT_IP_MREQ
   struct ip_mreq mreq;
+#endif
 #ifdef HAVE_INET6
   struct ipv6_mreq mreq6;
 #endif
@@ -298,7 +300,10 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
   int len = haddress->length;
   int level, opname;
   const char *ptr;
-  if (len == 4)
+  if (0)
+    ;
+#if HAVE_STRUCT_IP_MREQ
+  else if (len == 4)
     {
       level = IPPROTO_IP;
       opname = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP;
@@ -308,6 +313,7 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
       len = sizeof (struct ip_mreq);
       ptr = (const char *) &u.mreq;
     }
+#endif
 #ifdef HAVE_INET6
   else if (len == 16)
     {