--- src/aclocal.m4.orig 2004-12-30 08:05:58.039924632 +0000 +++ src/aclocal.m4 2004-12-30 08:07:55.232945888 +0000 @@ -1229,10 +1229,21 @@ AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) KRB5_AC_ENABLE_DNS if test "$enable_dns" = yes ; then - AC_CHECK_FUNC(res_search, , AC_CHECK_LIB(resolv, res_search, - LIBS="$LIBS -lresolv" ; RESOLV_LIB=-lresolv, - AC_MSG_ERROR(Cannot find resolver support routine res_search in -lresolv.) - )) + AC_MSG_CHECKING(for res_search) + AC_TRY_LINK_FUNC(res_search, AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + saved_LIBS="$LIBS" + LIBS="$LIBS -lresolv" + AC_MSG_CHECKING(for res_search in -lresolv) + AC_LINK_IFELSE([[ +#include +int main() +{ + res_search (0, 0, 0, 0, 0); + return 0; +}]], + LIBS="$LIBS -lresolv"; RESOLV_LIB=-lresolv; AC_MSG_RESULT(yes), + LIBS="$saved_LIBS"; AC_MSG_RESULT(no)) fi AC_SUBST(RESOLV_LIB) ])