From 4f80cc6a086950ed64bfdcdeb3c7b2c6c5ca93d5 Mon Sep 17 00:00:00 2001 From: Pontus Lidman Date: Mon, 17 Apr 2000 19:27:08 +0000 Subject: [PATCH] Added some BSD-related and several IPv6-related configure checks --- acconfig.h | 9 ++++++++ configure.in | 60 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/acconfig.h b/acconfig.h index 3b3a881..62d8160 100644 --- a/acconfig.h +++ b/acconfig.h @@ -56,3 +56,12 @@ /* Define this if your system has size_t */ #undef HAVE_SIZE_T + +/* Define this if you have ss_len member in struct sockaddr_storage (BSD) */ +#undef HAVE_SS_LEN + +/* Define this if you have sin6_len member in struct sockaddr_in6 (BSD) */ +#undef HAVE_SIN6_LEN + +/* Define this if you have sa_len member in struct sockaddr (BSD) */ +#undef HAVE_SA_LEN diff --git a/configure.in b/configure.in index 37e4a85..4c0d4b0 100644 --- a/configure.in +++ b/configure.in @@ -42,22 +42,46 @@ AC_C_INLINE AC_HEADER_TIME AC_STRUCT_TM AC_C_BIGENDIAN -AC_MSG_CHECKING(for socklen_t in sys/socket.h) -AC_TRY_COMPILE([#include ], - [ socklen_t x = 0;], - AC_DEFINE(HAVE_SOCKLEN_T) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) AC_MSG_CHECKING(for socklen_t in sys/types.h) AC_TRY_COMPILE([#include ], [ socklen_t x = 0;], AC_DEFINE(HAVE_SOCKLEN_T) AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(no) + dnl FreeBSD 4.0 has it in sys/socket.h + AC_MSG_CHECKING(for socklen_t in sys/socket.h) + AC_TRY_COMPILE([#include + #include ], + [ socklen_t x = 0;], + AC_DEFINE(HAVE_SOCKLEN_T) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + ) AC_MSG_CHECKING(for size_t in sys/types.h) AC_TRY_COMPILE([#include ], [ size_t x = 0;], AC_DEFINE(HAVE_SIZE_T) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) +AC_MSG_CHECKING(for ss_len in struct sockaddr_storage) +dnl maybe these two (at least the 2nd) should only be checked if ipv6 +dnl is enabled? +AC_TRY_COMPILE([#include +#include ], + [ void f(void) { struct sockaddr_storage ss; ss.ss_len=0; }], + AC_DEFINE(HAVE_SS_LEN) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +AC_MSG_CHECKING(for sin6_len in struct sockaddr_in6) +AC_TRY_COMPILE([#include +#include ], + [ void f(void) { struct sockaddr_in6 s6; s6.sin6_len=0; }], + AC_DEFINE(HAVE_SIN6_LEN) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +AC_MSG_CHECKING(for sa_len in struct sockaddr) +AC_TRY_COMPILE([#include +#include ], + [ void f(void) { struct sockaddr sa; sa.sa_len=0; }], + AC_DEFINE(HAVE_SA_LEN) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + dnl Check for symbol underscore prefix dnl !!! FIXME !!! Do some real check here... @@ -109,12 +133,25 @@ AC_ARG_ENABLE(release, RELEASE=$enable_release ) -AC_ARG_ENABLE(ipv6, -[ --enable-ipv6 enable IPv6 support], +AC_ARG_WITH(ipv6, +[ --with-ipv6 enable IPv6 support. Optional argument specifies + location of inet6 libraries.], AC_DEFINE(HAVE_IPV6) - NET_SOURCE=net_udp6.c + if test "x$witharg" = xno ; then + NET_SOURCE=net_udp.c + IPV6_LIBS="" + else + NET_SOURCE=net_udp6.c + if test "x$witharg" = xyes ; then + IPV6_LIBS="" + else + IPV6_LIBS="-L${witharg}" + fi + fi , +dnl Default is no IPv6 NET_SOURCE=net_udp.c + IPV6_LIBS="" ) AC_ARG_ENABLE(alsa, @@ -145,6 +182,11 @@ else have_dynload=yes fi +dnl Checks for getaddrinfo in separate IPv6 lib, if not available by default +if test "x$ac_cv_func_getaddrinfo" = xno ; then + AC_CHECK_LIB(inet6,getaddrinfo,LIBS="${LIBS} -L${IPV6_LIBS} -linet6") +fi + dnl Checks for working -lm AC_CHECK_LIB(m, pow,, AC_MSG_ERROR([math library (-lm) appears broken]))