configure: Detect resolver functionality on FreeBSD.

On FreeBSD this is part of libc.
This commit is contained in:
Tijl Coosemans 2010-09-23 18:20:31 +02:00 committed by Alexandre Julliard
parent 07898fe2fd
commit e7ec164563
2 changed files with 21 additions and 11 deletions

17
configure vendored
View File

@ -9977,13 +9977,13 @@ esac
fi
RESOLVLIBS=""
if test "$ac_cv_header_resolv_h" = "yes"
then
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lresolv"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
for lib in '' -lresolv
do
LIBS="$lib $ac_save_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
@ -9992,7 +9992,7 @@ then
int
main ()
{
res_init();
res_query("foo",ns_c_in,0,0,0);
;
return 0;
}
@ -10001,10 +10001,15 @@ if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_RESOLV 1" >>confdefs.h
RESOLVLIBS="-lresolv"
RESOLVLIBS="$lib"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "${RESOLVLIBS+set}" = set; then
break
fi
done
LIBS="$ac_save_LIBS"
fi

View File

@ -1266,17 +1266,22 @@ WINE_NOTICE_WITH(gphoto,[test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes"],
dnl **** Check for resolver library ***
AC_SUBST(RESOLVLIBS,"")
if test "$ac_cv_header_resolv_h" = "yes"
then
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lresolv"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_NETINET_IN_H
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_init();]])],
#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])
RESOLVLIBS="-lresolv"])
AC_SUBST(RESOLVLIBS,"$lib")])
if test "${RESOLVLIBS+set}" = set; then
break
fi
done
LIBS="$ac_save_LIBS"
fi