configure: Improve the check for the resolver library.

This commit is contained in:
Alexandre Julliard 2014-07-23 15:23:07 +02:00
parent 35dd553038
commit 1b2977420e
2 changed files with 53 additions and 29 deletions

35
configure vendored
View File

@ -11687,6 +11687,11 @@ fi
if test "$ac_cv_header_resolv_h" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolver library" >&5
$as_echo_n "checking for resolver library... " >&6; }
if ${ac_cv_have_resolv+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_LIBS="$LIBS"
for lib in '' -lresolv
do
@ -11700,26 +11705,38 @@ then
int
main ()
{
res_query("foo",ns_c_in,0,0,0);
if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_RESOLV 1" >>confdefs.h
RESOLV_LIBS="$lib"
ac_cv_have_resolv=${lib:-"none required"}
else
ac_cv_have_resolv="not found"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${RESOLV_LIBS+set}" = set; then
break
fi
test "x$ac_cv_have_resolv" = "xnot found" || break
done
LIBS="$ac_save_LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_resolv" >&5
$as_echo "$ac_cv_have_resolv" >&6; }
case "$ac_cv_have_resolv" in
"not found") ;;
"none required")
$as_echo "#define HAVE_RESOLV 1" >>confdefs.h
;;
*)
$as_echo "#define HAVE_RESOLV 1" >>confdefs.h
RESOLV_LIBS=$ac_cv_have_resolv
;;
esac
fi
if test "x$with_lcms2" != "xno"
then

View File

@ -1419,21 +1419,28 @@ WINE_NOTICE_WITH(gphoto,[test "$ac_cv_lib_gphoto2_port_gp_port_info_list_new" !=
dnl **** Check for resolver library ***
if test "$ac_cv_header_resolv_h" = "yes"
then
ac_save_LIBS="$LIBS"
AC_CACHE_CHECK([for resolver library], ac_cv_have_resolv,
[ac_save_LIBS="$LIBS"
for lib in '' -lresolv
do
LIBS="$lib $ac_save_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <resolv.h>]],[[res_query("foo",ns_c_in,0,0,0);]])],
[AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header])
AC_SUBST(RESOLV_LIBS,"$lib")])
if test "${RESOLV_LIBS+set}" = set; then
break
fi
#include <resolv.h>]],[[if (!(_res.options & RES_INIT)) res_init(); res_query("foo",ns_c_in,0,0,0)]])],
[ac_cv_have_resolv=${lib:-"none required"}],[ac_cv_have_resolv="not found"])
test "x$ac_cv_have_resolv" = "xnot found" || break
done
LIBS="$ac_save_LIBS"
LIBS="$ac_save_LIBS"])
case "$ac_cv_have_resolv" in
"not found") ;;
"none required")
AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header]) ;;
*)
AC_DEFINE(HAVE_RESOLV, 1)
AC_SUBST(RESOLV_LIBS,$ac_cv_have_resolv) ;;
esac
fi
dnl **** Check for LittleCMS ***