Index: glib-2.22.1/configure.in =================================================================== --- glib-2.22.1.orig/configure.in 2009-12-08 12:01:39.000000000 -0800 +++ glib-2.22.1/configure.in 2009-12-08 12:05:29.000000000 -0800 @@ -1004,17 +1004,22 @@ if test $glib_native_win32 = no; then AC_CHECK_FUNC(res_query, , [AC_CHECK_LIB(resolv, res_query, [ LIBASYNCNS_LIBADD="-lresolv" ], [ save_libs="$LIBS" - LIBS="-lresolv $LIBS" - AC_MSG_CHECKING([for res_query in -lresolv (alternate version)]) + AC_MSG_CHECKING([for res_query (alternate version)]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[res_query(0,0,0,0,0)]])], - [ AC_MSG_RESULT(yes) - LIBASYNCNS_LIBADD="-lresolv" ], - [ AC_MSG_RESULT(no) - AC_CHECK_LIB(bind, res_query, - [ LIBASYNCNS_LIBADD="-lbind" ], - [ AC_MSG_ERROR(res_query not found) ] ) ] ) - LIBS="$save_libs" + [ ac_cv_func_res_query=yes ], + [ AC_MSG_CHECKING([for res_query in -lresolv (alternate version)]) + LIBS="-lresolv $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[res_query(0,0,0,0,0)]])], + [ AC_MSG_RESULT(yes) + LIBASYNCNS_LIBADD="-lresolv" ], + [ AC_MSG_RESULT(no) + AC_CHECK_LIB(bind, res_query, + [ LIBASYNCNS_LIBADD="-lbind" ], + [ AC_MSG_ERROR(res_query not found) ] ) ] ) + ] ) + LIBS="$save_libs" ] ) ] )