diff options
Diffstat (limited to 'cpan/dist/Socket6/aclocal.m4')
| -rw-r--r-- | cpan/dist/Socket6/aclocal.m4 | 104 |
1 files changed, 61 insertions, 43 deletions
diff --git a/cpan/dist/Socket6/aclocal.m4 b/cpan/dist/Socket6/aclocal.m4 index 49bbc793..d4c0d315 100644 --- a/cpan/dist/Socket6/aclocal.m4 +++ b/cpan/dist/Socket6/aclocal.m4 @@ -1,6 +1,6 @@ -dnl Copyright (C) 2000 Hajimu UMEMOTO <ume@mahoroba.org>. +dnl Copyright (C) 2000-2005 Hajimu UMEMOTO <ume@mahoroba.org>. dnl All rights reserved. -dnl +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: @@ -25,11 +25,11 @@ dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF dnl SUCH DAMAGE. -dnl $Id: aclocal.m4,v 1.3 2000/04/15 07:25:36 ume Exp $ +dnl $Id: aclocal.m4,v 1.11 2005/08/27 16:37:32 ume Exp $ dnl SOCKET6_CHECK_PL_SV_UNDEF(VALUE-IF-FOUND , VALUE-IF-NOT-FOUND dnl [, PERL-PATH]) -AC_DEFUN(SOCKET6_CHECK_PL_SV_UNDEF, [ +AC_DEFUN([SOCKET6_CHECK_PL_SV_UNDEF], [ AC_MSG_CHECKING([whether your Perl5 have PL_sv_undef]) AC_CACHE_VAL(socket6_cv_pl_sv_undef,[ rm -rf conftest @@ -77,7 +77,7 @@ fi ]) dnl IPv6_CHECK_SIN6_SCOPE_ID(VALUE-IF-FOUND , VALUE-IF-NOT-FOUND) -AC_DEFUN(IPv6_CHECK_SIN6_SCOPE_ID, [ +AC_DEFUN([IPv6_CHECK_SIN6_SCOPE_ID], [ AC_MSG_CHECKING([whether you have sin6_scope_id in struct sockaddr_in6]) AC_CACHE_VAL(ipv6_cv_sin6_scope_id, [dnl AC_TRY_COMPILE([#include <sys/types.h> @@ -86,14 +86,14 @@ AC_TRY_COMPILE([#include <sys/types.h> [struct sockaddr_in6 sin6; int i = sin6.sin6_scope_id;], [ipv6_cv_sin6_scope_id=yes], [ipv6_cv_sin6_scope_id=no])])dnl if test $ipv6_cv_sin6_scope_id = yes; then - ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID), [$1]) + ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,[1],[Do we have a sin6_scope_id in struct sockaddr_in6?]), [$1]) else ifelse([$2], , :, [$2]) fi AC_MSG_RESULT($ipv6_cv_sin6_scope_id)]) dnl dnl whether you have sa_len in struct sockaddr -AC_DEFUN(IPv6_CHECK_SA_LEN, [ +AC_DEFUN([IPv6_CHECK_SA_LEN], [ AC_MSG_CHECKING([whether you have sa_len in struct sockaddr]) AC_CACHE_VAL(ipv6_cv_sa_len, [dnl AC_TRY_COMPILE([#include <sys/types.h> @@ -101,58 +101,76 @@ AC_TRY_COMPILE([#include <sys/types.h> [struct sockaddr sa; int i = sa.sa_len;], [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl if test $ipv6_cv_sa_len = yes; then - ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN), [$1]) + ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[1],[Does sockaddr have an sa_len?]), [$1]) else ifelse([$2], , :, [$2]) fi AC_MSG_RESULT($ipv6_cv_sa_len)]) dnl dnl See whether we can use IPv6 related functions -AC_DEFUN(IPv6_CHECK_FUNC, [ -changequote(, )dnl -ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` -changequote([, ])dnl +AC_DEFUN([IPv6_CHECK_FUNC], [ +AH_TEMPLATE(AS_TR_CPP(HAVE_$1), [Define to 1 if you have the `]$1[' function.]) AC_CHECK_FUNC($1, [dnl - AC_DEFINE_UNQUOTED($ac_tr_lib) - ac_cv_lib_inet6_$1=no], [dnl - AC_MSG_CHECKING([whether your system has IPv6 directory]) - AC_CACHE_VAL(ipv6_cv_dir, [dnl - for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do - if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then - break - fi - done])dnl - AC_MSG_RESULT($ipv6_cv_dir) - if test $ipv6_cv_dir = no; then + ac_cv_lib_socket_$1=no + ac_cv_lib_inet6_$1=no +], [dnl + AC_CHECK_LIB(socket, $1, [dnl + LIBS="$LIBS -lsocket -lnsl" ac_cv_lib_inet6_$1=no - else - if test x$ipv6_libinet6 = x; then - ipv6_libinet6=no - SAVELDFLAGS="$LDFLAGS" - LDFLAGS="-L$ipv6_cv_dir/lib" - fi - AC_CHECK_LIB(inet6, $1, [dnl - AC_DEFINE_UNQUOTED($ac_tr_lib) + ], [dnl + AC_MSG_CHECKING([whether your system has IPv6 directory]) + AC_CACHE_VAL(ipv6_cv_dir, [dnl + for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do + if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then + break + fi + done])dnl + AC_MSG_RESULT($ipv6_cv_dir) + if test $ipv6_cv_dir = no; then + ac_cv_lib_inet6_$1=no + else + if test x$ipv6_libinet6 = x; then + ipv6_libinet6=no + SAVELDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib" + fi + AC_CHECK_LIB(inet6, $1, [dnl + if test $ipv6_libinet6 = no; then + ipv6_libinet6=yes + LIBS="$LIBS -linet6" + fi],)dnl if test $ipv6_libinet6 = no; then - ipv6_libinet6=yes - LIBS="$LIBS -linet6" - fi],)dnl - if test $ipv6_libinet6 = no; then - LDFLAGS="$SAVELDFLAGS" - fi - fi])dnl -if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes + LDFLAGS="$SAVELDFLAGS" + fi + fi])dnl +])dnl +ipv6_cv_$1=no +if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \ + -o $ac_cv_lib_inet6_$1 = yes then ipv6_cv_$1=yes +fi +if test $ipv6_cv_$1 = no; then + if test $1 = getaddrinfo; then + for ipv6_cv_pfx in o n; do + AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h, + [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)]) + if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then + ipv6_cv_$1=yes + break + fi + done + fi +fi +if test $ipv6_cv_$1 = yes; then + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1)) ifelse([$2], , :, [$2]) else - ipv6_cv_$1=no ifelse([$3], , :, [$3]) fi]) dnl dnl See whether sys/socket.h has socklen_t -AC_DEFUN(IPv6_CHECK_SOCKLEN_T, [ +AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [ AC_MSG_CHECKING(for socklen_t) AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl AC_TRY_LINK([#include <sys/types.h> @@ -160,7 +178,7 @@ AC_TRY_LINK([#include <sys/types.h> [socklen_t len = 0;], [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl if test $ipv6_cv_socklen_t = yes; then - ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T), [$1]) + ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[1],[Do we have a socklen_t?]), [$1]) else ifelse([$2], , :, [$2]) fi |
