From ee1c1100d78103c81ac9e282c4c082f3dfe2b790 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 25 Jan 2008 03:59:59 +0000 Subject: [PATCH] Shuffled around the order of resolver library tests. --- citadel/configure.ac | 77 +++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 48 deletions(-) diff --git a/citadel/configure.ac b/citadel/configure.ac index a11eb11a8..8a3d904f7 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -381,33 +381,6 @@ dnl (Linux shadow passwords) fi fi -case "`uname -a`" in - OpenBSD*) - echo "we don't need to check for resolv on openbsd" - ;; - *) - test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib" - AC_CHECK_LIB(resolv, res_query, - RESOLV="$RESOLV -lresolv", - [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 - if test "x$with_ncurses" != "xno"; then AC_SEARCH_LIBS(tgetent, [ncurses curses termcap]) AC_SEARCH_LIBS(scrollok, [ncurses curses]) @@ -774,27 +747,35 @@ else AC_DEFINE(F_XPID_T, "%x", [whats the matching format string for xpid_t?]) fi -dnl AC_CHECK_FUNCS(res_query) -AC_CACHE_CHECK([for the resolver calls], - ac_cv_resquery_ok, -[AC_TRY_COMPILE([#include -#include -#include -#include ], - [ - char *domain="www.google.com"; - u_char *answer; - int len; - len = res_query( domain, C_IN, T_A, answer, PACKETSZ ); - ], - ac_cv_resquery_ok=yes, - ac_cv_resquery_ok=no) -]) -echo "resquery: $ac_cv_resquery_ok" - -dnl if test "$ac_cv_resquery_ok" = "no" ; then -dnl AC_DEFINE(RES_QUERY_GONE, "#error resquery not here. can't continue.") -dnl fi + +dnl Our own happy little check for the resolver library. + +case "`uname -a`" in + OpenBSD*) + echo "we don't need to check for resolv on openbsd" + ;; + *) + test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib" + AC_CHECK_LIB(resolv, res_query, + RESOLV="$RESOLV -lresolv", + [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 -- 2.39.2