···588588589589dnl -- socket dependencies --
590590591591+dnl getaddrinfo is used by getdomain.c, and requires libnsl and
592592+dnl libsocket on some platforms
593593+AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
594594+AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
595595+AC_CHECK_FUNCS(getaddrinfo)
596596+591597AC_ARG_ENABLE(pop, AS_HELP_STRING([--enable-pop],[Enable POP3 support]),
592598[ if test x$enableval = xyes ; then
593599 AC_DEFINE(USE_POP,1,[ Define if you want support for the POP3 protocol. ])
···631637 AC_MSG_RESULT([no])
632638 AC_DEFINE(socklen_t,int,
633639 [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
634634- AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
635635- AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
636636- AC_CHECK_FUNCS(getaddrinfo)
637640 AC_DEFINE(USE_SOCKET,1,
638641 [ Include code for socket support. Set automatically if you enable POP3 or IMAP ])
639642 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o"
+6-2
getdomain.c
···31313232int getdnsdomainname (char *d, size_t len)
3333{
3434- /* A DNS name can actually be only 253 octets, string is 256 */
3434+ int ret = -1;
3535+3636+#ifdef HAVE_GETADDRINFO
3537 char *node;
3638 long node_len;
3739 struct addrinfo hints;
3840 struct addrinfo *h;
3941 char *p;
4040- int ret;
41424243 *d = '\0';
4344 memset(&hints, 0, sizeof (struct addrinfo));
4445 hints.ai_flags = AI_CANONNAME;
4546 hints.ai_family = AF_UNSPEC;
46474848+ /* A DNS name can actually be only 253 octets, string is 256 */
4749 if ((node_len = sysconf(_SC_HOST_NAME_MAX)) == -1)
4850 node_len = STRING;
4951 node = safe_malloc(node_len + 1);
···6466 freeaddrinfo(h);
6567 }
6668 FREE (&node);
6969+#endif
7070+6771 return ret;
6872}
6973