68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# Copyright (C) 2000, 2001 Nominum, Inc.
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# Permission to use, copy, modify, and distribute this software for any
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# purpose with or without fee is hereby granted, provided that the above
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# copyright notice and this permission notice appear in all copies.
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas GustafssonAC_PREREQ(2.13)
1123872a47604644f6d74d7d8929472201db96f3Andreas GustafssonAC_DEFUN(AC_TYPE_SOCKLEN_T,
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson AC_TRY_COMPILE(
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson [socklen_t len = 42; return len;],
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson ac_cv_type_socklen_t=yes,
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson ac_cv_type_socklen_t=no)
1123872a47604644f6d74d7d8929472201db96f3Andreas Gustafsson if test $ac_cv_type_socklen_t != yes; then
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews AC_DEFINE(socklen_t, int, [Define to `int' if `socklen_t' does not exist.])
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉AC_DEFUN(AC_SA_LEN,
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉[AC_CACHE_CHECK([for sa_len], ac_cv_sa_len,
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉 AC_TRY_COMPILE(
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉 [struct sockaddr sa; sa.sa_len = 0;],
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉 ac_cv_sa_len=yes,
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉 ac_cv_sa_len=no)
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉 if test $ac_cv_sa_len = yes; then
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if `struct sockaddr' has element `sa_len'.])
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark AndrewsAC_CONFIG_HEADERS(config.h)
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉AC_SEARCH_LIBS(res_mkquery, resolv bind)
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark AndrewsAC_SEARCH_LIBS(__res_mkquery, resolv bind)
66f51d8678c8fcc7256354b599317f67455120fdMark AndrewsAC_SEARCH_LIBS(res_9_mkquery, resolv bind)
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas GustafssonAC_CHECK_LIB(socket, socket)
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas GustafssonAC_CHECK_LIB(nsl, inet_ntoa)
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉AC_CHECK_FUNCS(gethostbyname2)
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉AC_CHECK_FUNC(getaddrinfo,
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the `getaddrinfo' function.]),
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews [AC_LIBOBJ(getaddrinfo)])
f620c5e527746a2ec3d90a11d21abd8a114746dfTatuya JINMEI 神明達哉AC_CHECK_FUNC(getnameinfo,
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define to 1 if you have the `getnameinfo' function.]),
ab6e5af4cd644b174709f95c2702ec4c442aa755Mark Andrews [AC_LIBOBJ(getnameinfo)])
1123872a47604644f6d74d7d8929472201db96f3Andreas GustafssonAC_TYPE_SOCKLEN_T
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas GustafssonAC_OUTPUT(Makefile)