1# XIPH_NET
2# Perform tests required by the net module
3AC_DEFUN([XIPH_NET],
4[dnl
5AC_REQUIRE([XIPH_TYPE_SOCKLEN_T])
6AC_REQUIRE([XIPH_FUNC_VA_COPY])
7AC_CHECK_HEADERS([sys/select.h sys/uio.h netinet/in.h netinet/tcp.h arpa/inet.h netdb.h])
8AC_MSG_CHECKING([for winsock2.h inclusion])
9if test "x$host_os" = "xmingw32"; then
10   AC_DEFINE([HAVE_WINSOCK2_H], [1], [Define if you have winsock2.h on MINGW])
11   AC_DEFINE([_WIN32_WINNT], [0x0501], [Define for IPv6 on win32])
12   AC_DEFINE([HAVE_GETNAMEINFO])
13   AC_DEFINE([HAVE_GETADDRINFO])
14   ac_cv_search_getnameinfo='none required'
15   ac_cv_func_getaddrinfo=yes
16   XIPH_LIBS="$XIPH_LIBS -lws2_32 -lwsock32"
17   AC_MSG_RESULT([yes])
18else
19   AC_MSG_RESULT([no])
20fi
21
22# These tests are ordered based on solaris 8 tests
23AC_SEARCH_LIBS([sethostent], [nsl],
24  [AC_DEFINE([HAVE_SETHOSTENT], [1],
25    [Define if you have the sethostent function])])
26AC_SEARCH_LIBS([getnameinfo], [socket],
27  [AC_DEFINE([HAVE_GETNAMEINFO], [1],
28    [Define if you have the getnameinfo function])
29  ])
30AC_CHECK_FUNCS([endhostent getaddrinfo inet_aton writev])
31
32# Irix defines INET_PTON but not sockaddr_storage!
33AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
34  [AC_CHECK_FUNCS([inet_pton])],,
35  [#include <sys/types.h>
36#include <sys/socket.h>])
37])
38