[kaffe] CVS kaffe (dalibor): Fixed addrinfo related build breakage on sparc-solaris

Kaffe CVS cvs-commits at kaffe.org
Tue Sep 23 14:46:02 PDT 2003


PatchSet 4057 
Date: 2003/09/23 21:44:00
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Fixed addrinfo related build breakage on sparc-solaris

getaddrinfo.h didn't always redefine addrinfo away if addrinfo was declared
so this lead to a compiler error on sparc-solaris 2.9 as addrinfo was suddendly defined twice
Fixed by adding a new check to getaddrinfo m4 macros for struct addrinfo.

Members: 
	ChangeLog:1.1652->1.1653 
	aclocal.m4:1.68->1.69 
	configure:1.258->1.259 
	configure.in:1.224->1.225 
	sockaddrin6.m4:1.2->1.3 
	config/config.h.in:1.79->1.80 
	include/getaddrinfo.h:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1652 kaffe/ChangeLog:1.1653
--- kaffe/ChangeLog:1.1652	Mon Sep 22 20:57:50 2003
+++ kaffe/ChangeLog	Tue Sep 23 21:44:00 2003
@@ -1,5 +1,21 @@
 2003-09-22  Dalibor Topic <robilad at kaffe.org>
 
+	Fix for getaddrinfo on sparc-solaris2.9 compiler breakage.
+	
+	* configure.in:
+	Check for struct addrinfo.
+
+	* sockaddrin6.m4:
+	(AC_STRUCT_ADDRINFO) New check.
+
+	* include/getaddrinfo.h:
+	Redefine addrinfo away if struct addrinfo is declared.
+	
+	* aclocal.m4, configure, config/config.h.in:
+	Regenerated.
+	
+2003-09-22  Dalibor Topic <robilad at kaffe.org>
+
 	* sockinttypes.m4:
 	Updated to getaddrinfo-1.6.1. From the getaddrinfo docs:
 
Index: kaffe/aclocal.m4
diff -u kaffe/aclocal.m4:1.68 kaffe/aclocal.m4:1.69
--- kaffe/aclocal.m4:1.68	Mon Sep 22 20:57:51 2003
+++ kaffe/aclocal.m4	Tue Sep 23 21:44:01 2003
@@ -8272,6 +8272,81 @@
 dnl *
 
 dnl * 
+dnl * Check for struct sockaddr_in6
+dnl *
+AC_DEFUN(AC_STRUCT_SOCKADDR_IN6,
+[AC_CACHE_CHECK(for struct sockaddr_in6, ac_cv_struct_sockaddr_in6,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>],[
+struct sockaddr_in6 address;
+], [ac_cv_struct_sockaddr_in6=yes], [ac_cv_struct_sockaddr_in6=no])])
+if test "$ac_cv_struct_sockaddr_in6" = yes; then
+    AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
+[Define to 1 if <netinet/in.h> defines `struct sockaddr_in6'])
+fi])
+
+dnl * 
+dnl * Check for struct sockaddr_storage
+dnl * 
+AC_DEFUN(AC_STRUCT_SOCKADDR_STORAGE,
+[AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>],[
+struct sockaddr_storage address;
+], [ac_cv_struct_sockaddr_storage=yes], [ac_cv_struct_sockaddr_storage=no])])
+if test "$ac_cv_struct_sockaddr_storage" = yes; then
+    AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
+[Define to 1 if <netinet/in.h> defines `struct sockaddr_storage'])
+fi])
+
+dnl * 
+dnl * Check for struct addrinfo
+dnl * 
+AC_DEFUN(AC_STRUCT_ADDRINFO,
+[AC_CACHE_CHECK(for struct addrinfo, ac_cv_struct_addrinfo,
+[AC_TRY_COMPILE([
+#include <netdb.h>],[
+struct addrinfo info;
+], [ac_cv_struct_addrinfo=yes], [ac_cv_struct_addrinfo=no])])
+if test "$ac_cv_struct_addrinfo" = yes; then
+    AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
+[Define to 1 if <netdb.h> defines `struct addrinfo'])
+fi])
+
+
+dnl *
+dnl * Copyright (c) 2001  Motoyuki Kasahara
+dnl *
+dnl * Redistribution and use in source and binary forms, with or without
+dnl * modification, are permitted provided that the following conditions
+dnl * are met:
+dnl * 1. Redistributions of source code must retain the above copyright
+dnl *    notice, this list of conditions and the following disclaimer.
+dnl * 2. Redistributions in binary form must reproduce the above copyright
+dnl *    notice, this list of conditions and the following disclaimer in the
+dnl *    documentation and/or other materials provided with the distribution.
+dnl * 3. Neither the name of the project nor the names of its contributors
+dnl *    may be used to endorse or promote products derived from this software
+dnl *    without specific prior written permission.
+dnl * 
+dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+dnl * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE
+dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+dnl * THE POSSIBILITY OF SUCH DAMAGE.
+dnl *
+
+dnl * 
 dnl * Check for struct in6_addr
 dnl * 
 AC_DEFUN(AC_STRUCT_IN6_ADDR,
@@ -8332,67 +8407,6 @@
 [Define to 1 if `in6addr_loopback' is declared by <netinet/in.h>])
     fi
 fi])
-
-dnl *
-dnl * Copyright (c) 2001  Motoyuki Kasahara
-dnl *
-dnl * Redistribution and use in source and binary forms, with or without
-dnl * modification, are permitted provided that the following conditions
-dnl * are met:
-dnl * 1. Redistributions of source code must retain the above copyright
-dnl *    notice, this list of conditions and the following disclaimer.
-dnl * 2. Redistributions in binary form must reproduce the above copyright
-dnl *    notice, this list of conditions and the following disclaimer in the
-dnl *    documentation and/or other materials provided with the distribution.
-dnl * 3. Neither the name of the project nor the names of its contributors
-dnl *    may be used to endorse or promote products derived from this software
-dnl *    without specific prior written permission.
-dnl * 
-dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-dnl * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE
-dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-dnl * THE POSSIBILITY OF SUCH DAMAGE.
-dnl *
-
-dnl * 
-dnl * Check for struct sockaddr_in6
-dnl *
-AC_DEFUN(AC_STRUCT_SOCKADDR_IN6,
-[AC_CACHE_CHECK(for struct sockaddr_in6, ac_cv_struct_sockaddr_in6,
-[AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],[
-struct sockaddr_in6 address;
-], [ac_cv_struct_sockaddr_in6=yes], [ac_cv_struct_sockaddr_in6=no])])
-if test "$ac_cv_struct_sockaddr_in6" = yes; then
-    AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
-[Define to 1 if <netinet/in.h> defines `struct sockaddr_in6'])
-fi])
-
-dnl * 
-dnl * Check for struct sockaddr_storage
-dnl * 
-AC_DEFUN(AC_STRUCT_SOCKADDR_STORAGE,
-[AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_struct_sockaddr_storage,
-[AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],[
-struct sockaddr_storage address;
-], [ac_cv_struct_sockaddr_storage=yes], [ac_cv_struct_sockaddr_storage=no])])
-if test "$ac_cv_struct_sockaddr_storage" = yes; then
-    AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
-[Define to 1 if <netinet/in.h> defines `struct sockaddr_storage'])
-fi])
-
 
 dnl Checks if function/macro va_copy() is available
 dnl Defines HAVE_VA_COPY on success.
Index: kaffe/configure
diff -u kaffe/configure:1.258 kaffe/configure:1.259
--- kaffe/configure:1.258	Mon Sep 22 20:57:51 2003
+++ kaffe/configure	Tue Sep 23 21:44:01 2003
@@ -38487,6 +38487,60 @@
 _ACEOF
 
 fi
+echo "$as_me:$LINENO: checking for struct addrinfo" >&5
+echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
+if test "${ac_cv_struct_addrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <netdb.h>
+int
+main ()
+{
+
+struct addrinfo info;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_struct_addrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_struct_addrinfo=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5
+echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6
+if test "$ac_cv_struct_addrinfo" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_ADDRINFO 1
+_ACEOF
+
+fi
 
 
 
Index: kaffe/configure.in
diff -u kaffe/configure.in:1.224 kaffe/configure.in:1.225
--- kaffe/configure.in:1.224	Sun Sep 21 18:18:15 2003
+++ kaffe/configure.in	Tue Sep 23 21:44:06 2003
@@ -987,6 +987,7 @@
 AC_TYPE_SOCKLEN_T
 AC_TYPE_IN_PORT_T
 AC_DECL_H_ERRNO
+AC_STRUCT_ADDRINFO
 
 AC_CHECK_FUNCS([getaddrinfo getnameinfo])
 if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then
Index: kaffe/sockaddrin6.m4
diff -u kaffe/sockaddrin6.m4:1.2 kaffe/sockaddrin6.m4:1.3
--- kaffe/sockaddrin6.m4:1.2	Tue Jun 24 08:17:58 2003
+++ kaffe/sockaddrin6.m4	Tue Sep 23 21:44:06 2003
@@ -58,3 +58,17 @@
 [Define to 1 if <netinet/in.h> defines `struct sockaddr_storage'])
 fi])
 
+dnl * 
+dnl * Check for struct addrinfo
+dnl * 
+AC_DEFUN(AC_STRUCT_ADDRINFO,
+[AC_CACHE_CHECK(for struct addrinfo, ac_cv_struct_addrinfo,
+[AC_TRY_COMPILE([
+#include <netdb.h>],[
+struct addrinfo info;
+], [ac_cv_struct_addrinfo=yes], [ac_cv_struct_addrinfo=no])])
+if test "$ac_cv_struct_addrinfo" = yes; then
+    AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
+[Define to 1 if <netdb.h> defines `struct addrinfo'])
+fi])
+
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.79 kaffe/config/config.h.in:1.80
--- kaffe/config/config.h.in:1.79	Mon Sep  1 17:16:21 2003
+++ kaffe/config/config.h.in	Tue Sep 23 21:44:08 2003
@@ -421,6 +421,9 @@
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
+/* Define to 1 if <netdb.h> defines `struct addrinfo' */
+#undef HAVE_STRUCT_ADDRINFO
+
 /* Define to 1 if <netinet/in.h> defines `struct in6_addr' */
 #undef HAVE_STRUCT_IN6_ADDR
 
Index: kaffe/include/getaddrinfo.h
diff -u kaffe/include/getaddrinfo.h:1.1 kaffe/include/getaddrinfo.h:1.2
--- kaffe/include/getaddrinfo.h:1.1	Thu Jun 12 16:26:00 2003
+++ kaffe/include/getaddrinfo.h	Tue Sep 23 21:44:08 2003
@@ -131,7 +131,7 @@
  * Fake struct and function names.
  * <netdb.h> might declares all or some of them.
  */
-#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETNAMEINFO)
+#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETNAMEINFO) || defined(HAVE_STRUCT_ADDRINFO)
 #define addrinfo my_addrinfo
 #define gai_strerror my_gai_strerror
 #define freeaddrinfo my_freeaddrinfo




More information about the kaffe mailing list