2 # Copyright (C) 2000, 2001 Nominum, Inc.
4 # Permission to use, copy, modify, and distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
8 # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
9 # DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
10 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
11 # INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
13 # FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
14 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 AC_DEFUN(AC_TYPE_SOCKLEN_T,
25 [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
28 [#include <sys/types.h>
29 #include <sys/socket.h>],
30 [socklen_t len = 42; return len;],
31 ac_cv_type_socklen_t=yes,
32 ac_cv_type_socklen_t=no)
34 if test $ac_cv_type_socklen_t != yes; then
35 AC_DEFINE(socklen_t, int, [Define to `int' if `socklen_t' does not exist.])
40 [AC_CACHE_CHECK([for sa_len], ac_cv_sa_len,
43 [#include <sys/types.h>
44 #include <sys/socket.h>],
45 [struct sockaddr sa; sa.sa_len = 0;],
49 if test $ac_cv_sa_len = yes; then
50 AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if `struct sockaddr' has element `sa_len'.])
54 AC_CONFIG_HEADERS(config.h)
55 AC_SEARCH_LIBS(res_mkquery, resolv bind)
56 AC_SEARCH_LIBS(__res_mkquery, resolv bind)
57 AC_SEARCH_LIBS(res_9_mkquery, resolv bind)
58 AC_CHECK_LIB(socket, socket)
59 AC_CHECK_LIB(nsl, inet_ntoa)
60 AC_CHECK_FUNCS(gethostbyname2)
61 AC_CHECK_FUNC(getaddrinfo,
62 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the `getaddrinfo' function.]),
63 [AC_LIBOBJ(getaddrinfo)])
64 AC_CHECK_FUNC(getnameinfo,
65 AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define to 1 if you have the `getnameinfo' function.]),
66 [AC_LIBOBJ(getnameinfo)])