diff -ur linc-0.5.3.orig/configure.in linc-0.5.3/configure.in
--- linc-0.5.3.orig/configure.in	2002-08-24 01:44:58.000000000 +0900
+++ linc-0.5.3/configure.in	2002-09-04 11:05:32.000000000 +0900
@@ -101,6 +101,7 @@
 AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h sys/poll.h)
 AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h sys/un.h linux/irda.h)
+AC_CHECK_HEADERS(arpa/nameser.h resolv.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff -ur linc-0.5.3.orig/src/linc-compat.h linc-0.5.3/src/linc-compat.h
--- linc-0.5.3.orig/src/linc-compat.h	2002-07-31 19:41:06.000000000 +0900
+++ linc-0.5.3/src/linc-compat.h	2002-09-04 11:04:42.000000000 +0900
@@ -36,8 +36,12 @@
 #endif
 
 #include <arpa/inet.h>
+#ifdef HAVE_ARPA_NAMESER_H
 #include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
 #include <resolv.h>
+#endif
 
 #if !defined (NI_MAXSERV) || !defined (NI_MAXHOST)
 #  include <netdb.h>
diff -ur linc-0.5.3.orig/src/linc-protocols.c linc-0.5.3/src/linc-protocols.c
--- linc-0.5.3.orig/src/linc-protocols.c	2002-07-31 19:45:22.000000000 +0900
+++ linc-0.5.3/src/linc-protocols.c	2002-09-04 11:07:06.000000000 +0900
@@ -111,7 +111,7 @@
 #define LINC_SET_SOCKADDR_LEN(saddr, len)
 #endif
 
-#if defined(AF_INET6) && defined(RES_USE_INET6)
+#if defined(HAVE_RESOLV_H) && defined(AF_INET6) && defined(RES_USE_INET6)
 #define LINC_RESOLV_SET_IPV6     _res.options |= RES_USE_INET6
 #else
 #define LINC_RESOLV_SET_IPV6
@@ -286,8 +286,10 @@
 	if ((saddr->sin_addr.s_addr = inet_addr (hostname)) == INADDR_NONE) {
 
 		LINC_RESOLV_SET_IPV6;
+#ifdef HAVE_RESOLV_H
 		if (!(_res.options & RES_INIT))
 			res_init();
+#endif
 		
 		host = gethostbyname (hostname);
 		if (!host ||
@@ -347,8 +349,10 @@
 		return (struct sockaddr *)saddr;
 #endif
 
+#ifdef HAVE_RESOLV_H
 	if (!(_res.options & RES_INIT))
 		res_init();
+#endif
 
 	LINC_RESOLV_SET_IPV6;
 	host = gethostbyname (hostname);
