From: Art Cancro Date: Thu, 24 Jan 2008 04:51:44 +0000 (+0000) Subject: Added a second test for libresolv that takes into X-Git-Tag: v7.86~2557 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=c0b1e3dd4990911c34472741bdbd9707f0d63b8c;p=citadel.git Added a second test for libresolv that takes into consideration the fact that res_query() is a macro on some hosts. --- diff --git a/citadel/configure.ac b/citadel/configure.ac index 8f7f4495a..a11eb11a8 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -389,9 +389,21 @@ case "`uname -a`" in 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 + #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