$NetBSD: patch-aa,v 1.4 2012/09/25 11:45:11 ryoon Exp $

Avoid dependence on "liblwres". Based on this patch for "pupnp":

http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commitdiff;h=5151d4520308f59c71764423c3853a35cf23e279#patch9

--- configure.ac.orig	2010-04-07 22:38:51.000000000 +0000
+++ configure.ac
@@ -696,20 +696,23 @@ fi
 
 AC_CHECK_FUNCS([gethostbyname_r],[],
         [
-            AC_CHECK_HEADERS([lwres/netdb.h],
-                [
-                    AC_CHECK_LIB(lwres, lwres_gethostbyname_r,
-                                 [
-                                    LWRES_LIBS="-llwres"
-                                    AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence])
-                                    AC_SUBST(LWRES_LIBS)
-                                 ],
-                                 [AC_MSG_ERROR(required library function not found)])
-                ],
-                [
-                    if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then
-                        AC_MSG_ERROR([required header not found])
-                    fi
+            AC_CHECK_FUNCS([getaddrinfo],[],
+                    [
+                        AC_CHECK_HEADERS([lwres/netdb.h],
+                            [
+                                AC_CHECK_LIB(lwres, lwres_gethostbyname_r,
+                                             [
+                                                LWRES_LIBS="-llwres"
+                                                AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence])
+                                                AC_SUBST(LWRES_LIBS)
+                                             ],
+                                             [AC_MSG_ERROR(required library function not found)])
+                            ],
+                            [
+                                if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then
+                                    AC_MSG_ERROR([required header not found])
+                                fi
+                            ])
                 ])
         ])
 
