diff --git a/configure b/configure index 98115bea145..6fd413f6ed2 100755 --- a/configure +++ b/configure @@ -14285,6 +14285,9 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#ifdef HAVE_NETINET_IN_H +#include +#endif #include int main () diff --git a/configure.ac b/configure.ac index 784107e34e8..8d45409f4af 100644 --- a/configure.ac +++ b/configure.ac @@ -1011,7 +1011,10 @@ if test "$ac_cv_header_resolv_h" = "yes" then ac_save_LIBS="$LIBS" LIBS="$LIBS -lresolv" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[res_init();]])], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H +#include +#endif +#include ]],[[res_init();]])], [AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header]) RESOLVLIBS="-lresolv"]) LIBS="$ac_save_LIBS"