old_LIBS="${LIBS}"
LIBS="${LIBS} ${SOCKETS_LIBS}"
-AC_CHECK_FUNCS([sendmsg recvmsg inet_ntop inet_pton])
+AC_CHECK_FUNCS([sendmsg recvmsg])
# Windows use stdcall for winsock so we cannot auto detect these
m4_define(
[SOCKET_FUNCS],
[setsockopt getsockopt getsockname poll]dnl
)
if test "${WIN32}" = "yes"; then
+# normal autoconf function checking does not find inet_ntop/inet_pton
+# because they need to include the actual header file and link ws2_32.dll
+ LIBS="${LIBS} -lws2_32"
+ AC_MSG_CHECKING([for MinGW inet_ntop()/inet_pton()])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <ws2tcpip.h>
+ ]],
+ [[
+int r = (int) inet_ntop (0, NULL, NULL, 0);
+ r += inet_pton(AF_INET, NULL, NULL);
+return r;
+ ]]
+ )],
+ [AC_MSG_RESULT([OK])
+ AC_DEFINE([HAVE_INET_NTOP],[1],[MinGW inet_ntop])
+ AC_DEFINE([HAVE_INET_PTON],[1],[MinGW inet_pton])
+ ],
+ [AC_MSG_RESULT([not found])]
+ )
m4_foreach(
[F],
m4_split(SOCKET_FUNCS SOCKET_OPT_FUNCS),
AC_DEFINE([UF], [1], [Win32 builtin])
)
else
+ AC_CHECK_FUNCS([inet_ntop inet_pton])
AC_CHECK_FUNCS(
SOCKET_FUNCS,
,