configure testing for sockaddr_storage on solaris

Jason Ornstein jason.ornstein at sybase.com
Fri May 27 19:19:36 CEST 2005


I noticed today that the current CVS head won't compile on Solaris and
it looks like it is due to a configure change around the end of April.
This change happened between version 1.211 and 1.212 and is the check
for sockaddr_storage.  The script seems to assume that this struct is
defined in /usr/include/netinet/in.h, but on Solaris and maybe other
OSs it isn't located there, but in /usr/include/sys/socket.h.

Google shows a few ways of doing this, but this link shows what might
be the closest to what you currently do

        http://article.gmane.org/gmane.comp.web.curl.cvs/4598

and it is doing

dnl Check for struct sockaddr_storage. Most IPv6-enabled hosts have it,
but
dnl AIX 4.3 is one known exception.

[in acinclude.m4]

        AC_DEFUN([TYPE_SOCKADDR_STORAGE],
        [
           AC_CHECK_TYPE([struct sockaddr_storage],
                AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
                          [if struct sockaddr_storage is defined]), ,
    [
        #ifdef HAVE_SYS_TYPES_H
        #include <sys/types.h>
        #endif
        #ifdef HAVE_SYS_SOCKET_H
        #include <sys/socket.h>
        #endif
        #ifdef HAVE_NETINET_IN_H
        #include <netinet/in.h>
        #endif
        #ifdef HAVE_ARPA_INET_H
        #include <arpa/inet.h>
        #endif
           ])
        ])

[in configure.ac]
        TYPE_SOCKADDR_STORAGE

If that looks about right I can give it a test and submit a patch.

Is it safe to modify acinclude.m4?

-jason

        



More information about the Freeradius-Devel mailing list