[libxml2] build: Remove check for broken ss_family



commit a41878bd4c4223732630b3de2f46c0a597c5a70c
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Sep 5 23:16:23 2022 +0200

    build: Remove check for broken ss_family
    
    This only seemed to affect ancient AIX systems.

 CMakeLists.txt    |  5 -----
 config.h.cmake.in |  6 ------
 configure.ac      | 56 +++++--------------------------------------------------
 nanoftp.c         |  6 ------
 4 files changed, 5 insertions(+), 68 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9eefa206..5ac71dfa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -139,11 +139,6 @@ if (NOT MSVC)
                set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
        endif()
        check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
-       check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h" HAVE_SS_FAMILY)
-       check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h" HAVE_BROKEN_SS_FAMILY)
-       if(HAVE_BROKEN_SS_FAMILY)
-               set(ss_family __ss_family)
-       endif()
        check_function_exists(class HAVE_CLASS)
        check_include_files(dlfcn.h HAVE_DLFCN_H)
        check_library_exists(dl dlopen "" HAVE_DLOPEN)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 15a7bce4..5177e45a 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -7,9 +7,6 @@
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #cmakedefine HAVE_ARPA_INET_H 1
 
-/* Whether struct sockaddr::__ss_family exists */
-#cmakedefine HAVE_BROKEN_SS_FAMILY 1
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #cmakedefine HAVE_DLFCN_H 1
 
@@ -149,9 +146,6 @@
    #define below would cause a syntax error. */
 #cmakedefine _UINT32_T @_UINT32_T@
 
-/* ss_family is not defined here, use __ss_family instead */
-#cmakedefine ss_family @ss_family@
-
 /* Define to the type of an unsigned integer type of width exactly 32 bits if
    such a type exists and the standard includes do not define it. */
 #cmakedefine uint32_t @uint32_t@
diff --git a/configure.ac b/configure.ac
index 31e64448..ec2ea515 100644
--- a/configure.ac
+++ b/configure.ac
@@ -390,14 +390,13 @@ AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length
 dnl
 dnl Checking for availability of IPv6
 dnl
-AC_MSG_CHECKING([whether to enable IPv6])
 AC_ARG_ENABLE(ipv6, [  --enable-ipv6[[=yes/no]]  enables compilation of IPv6 code [[default=yes]]],, 
enable_ipv6=yes)
 if test "$with_minimum" = "yes"
 then
     enable_ipv6=no
 fi
 if test $enable_ipv6 = yes; then
-  have_ipv6=no
+  AC_MSG_CHECKING([whether to enable IPv6])
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
     #ifdef _WIN32
       #include <winsock2.h>
@@ -411,56 +410,11 @@ if test $enable_ipv6 = yes; then
     struct sockaddr_storage ss;
     socket(AF_INET6, SOCK_STREAM, 0);
     getaddrinfo(0, 0, 0, 0);
-    ]])],
-    have_ipv6=yes,
-    have_ipv6=no
-  )
-  AC_MSG_RESULT($have_ipv6)
-
-  if test $have_ipv6 = yes; then
+    ]])], [
     AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
-    have_broken_ss_family=no
-
-    dnl *********************************************************************
-    dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
-    dnl a ss_family member, but rather __ss_family. Let's detect that
-    dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
-    dnl platforms.  However, we should only do this if ss_family is not
-    dnl present.
-    dnl ********************************************************************
-    AC_MSG_CHECKING([struct sockaddr::ss_family])
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#     include <sys/socket.h>
-      ]], [[
-      struct sockaddr_storage ss ;
-      ss.ss_family = 0 ;
-      ]])],
-      have_ss_family=yes,
-      have_ss_family=no
-    )
-    AC_MSG_RESULT($have_ss_family)
-    if test x$have_ss_family = xno ; then
-      AC_MSG_CHECKING([broken struct sockaddr::ss_family])
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#       include <sys/socket.h>
-        ]], [[
-        struct sockaddr_storage ss ;
-        ss.__ss_family = 0 ;
-        ]])],
-        have_broken_ss_family=yes,
-        have_broken_ss_family=no
-      )
-      AC_MSG_RESULT($have_broken_ss_family)
-      if test x$have_broken_ss_family = xyes ; then
-        AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
-         [Whether struct sockaddr::__ss_family exists]) 
-        AC_DEFINE(ss_family, __ss_family,
-         [ss_family is not defined here, use __ss_family instead])
-      else
-        AC_MSG_WARN(ss_family and __ss_family not found)
-      fi
-    fi
-  fi
+    AC_MSG_RESULT([yes])], [
+    AC_MSG_RESULT([no])]
+  )
 fi 
 
 dnl
diff --git a/nanoftp.c b/nanoftp.c
index 6e6e72dd..b52f9b64 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -78,12 +78,6 @@
 #define closesocket(s) close(s)
 #endif
 
-#ifdef _AIX
-#ifdef HAVE_BROKEN_SS_FAMILY
-#define ss_family __ss_family
-#endif
-#endif
-
 #ifndef XML_SOCKLEN_T
 #define XML_SOCKLEN_T unsigned int
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]