configure: fix win32 build

Only require -lresolv on unix, like before

https://bugzilla.gnome.org/show_bug.cgi?id=645336
This commit is contained in:
Dan Winship 2011-09-04 08:42:03 -04:00
parent 2d7051e3a3
commit e943366de5

View File

@ -1072,13 +1072,14 @@ AC_CHECK_FUNCS(getprotobyname_r endservent)
AC_CHECK_HEADERS([netdb.h wspiapi.h arpa/nameser_compat.h]) AC_CHECK_HEADERS([netdb.h wspiapi.h arpa/nameser_compat.h])
# For gio/libasyncns # For gio/libasyncns
AC_CHECK_FUNCS(strndup setresuid setreuid) if test $glib_native_win32 = no; then
AC_CHECK_HEADERS(sys/prctl.h) AC_CHECK_FUNCS(strndup setresuid setreuid)
AC_CHECK_HEADERS(sys/prctl.h)
# We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150 # We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150
NETWORK_LIBS="" NETWORK_LIBS=""
AC_MSG_CHECKING([for res_query]) AC_MSG_CHECKING([for res_query])
AC_TRY_LINK([#include <sys/types.h> AC_TRY_LINK([#include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/nameser.h> #include <arpa/nameser.h>
#include <resolv.h> #include <resolv.h>
@ -1102,9 +1103,10 @@ AC_TRY_LINK([#include <sys/types.h>
NETWORK_LIBS="-lbind $NETWORK_LIBS"], NETWORK_LIBS="-lbind $NETWORK_LIBS"],
[AC_MSG_ERROR(not found)])]) [AC_MSG_ERROR(not found)])])
LIBS="$save_libs"]) LIBS="$save_libs"])
AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket, AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket,
[NETWORK_LIBS="-lsocket $NETWORK_LIBS"], [NETWORK_LIBS="-lsocket $NETWORK_LIBS"],
[AC_MSG_ERROR(Could not find socket())])) [AC_MSG_ERROR(Could not find socket())]))
fi
AC_SUBST(NETWORK_LIBS) AC_SUBST(NETWORK_LIBS)
case $host in case $host in