test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_CHECK_LIB(resolv, res_query,
RESOLV="$RESOLV -lresolv",
- [
- AC_MSG_ERROR(libresolv was not found. Citadel requires the resolver library.)
- ]
+ [dnl Have to include resolv.h as res_query is sometimes defined as a macro
+ AC_MSG_CHECKING([for res_query in -lresolv (with resolv.h if present)])
+ saved_libs="$LIBS"
+ LIBS="-lresolv $LIBS"
+ AC_TRY_LINK([
+ #ifdef HAVE_RESOLV_H
+ #include <resolv.h>
+ #endif],
+ [res_query(0,0,0,0,0)],
+ [AC_MSG_RESULT(yes)
+ have_res_query=yes],
+ [AC_MSG_RESULT(no)
+ AC_MSG_ERROR(libresolv was not found. Citadel requires the resolver library.)
+ ])
+ ]
)
;;
esac