diff --git a/configure.in b/configure.in index 0f26f47..9ca98ad 100644 --- a/configure.in +++ b/configure.in @@ -165,7 +165,25 @@ if test x"$bx_cv_lib_resolver" != x"not found"; then LIBS="$bx_cv_lib_resolver $LIBS" fi dnl This is for getting the DNS servers on Windows - AC_CHECK_HEADER([iphlpapi.h], [AC_CHECK_LIB(iphlpapi, GetNetworkParams, [], [])], [], [#include ]) + AC_MSG_CHECKING([for the iphlpapi library]) + OLDLIBS="$LIBS" + LIBS="-liphlpapi $LIBS" + AC_LINK_IFELSE([[ + #include + #include + + int main() + { + ULONG buflen; + GetNetworkParams(0, &buflen); + return buflen; + }]], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LIBIPHLPAPI, 1, [Define to 1 if you have the Windows iphlpapi library]) + ],[ + AC_MSG_RESULT(no) + LIBS="$OLDLIBS" + ]) else AC_MSG_WARN([No resolver library found, /nslookup will be disabled.]) fi diff --git a/include/defs.h.in b/include/defs.h.in index 68efe91..fee95a3 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -129,7 +129,7 @@ /* Define to 1 if you have the `killpg' function. */ #undef HAVE_KILLPG -/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ +/* Define to 1 if you have the Windows iphlpapi library */ #undef HAVE_LIBIPHLPAPI /* Define to 1 if you have the `ssl' library (-lssl). */