configure: fix win32 build
authorDan Winship <danw@gnome.org>
Sun, 4 Sep 2011 12:42:03 +0000 (08:42 -0400)
committerDan Winship <danw@gnome.org>
Sun, 4 Sep 2011 12:42:03 +0000 (08:42 -0400)
Only require -lresolv on unix, like before

https://bugzilla.gnome.org/show_bug.cgi?id=645336

configure.ac

index 307e606..af61d5d 100644 (file)
@@ -1072,39 +1072,41 @@ AC_CHECK_FUNCS(getprotobyname_r endservent)
 AC_CHECK_HEADERS([netdb.h wspiapi.h arpa/nameser_compat.h])
 
 # For gio/libasyncns
 AC_CHECK_HEADERS([netdb.h wspiapi.h arpa/nameser_compat.h])
 
 # For gio/libasyncns
-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
-NETWORK_LIBS=""
-AC_MSG_CHECKING([for res_query])
-AC_TRY_LINK([#include <sys/types.h>
-            #include <netinet/in.h>
-            #include <arpa/nameser.h>
-            #include <resolv.h>
-            ],[
-            res_query("test", 0, 0, (void *)0, 0);
-            ],[AC_MSG_RESULT([yes])],
-            [save_libs="$LIBS"
-             LIBS="-lresolv $LIBS"
-             AC_TRY_LINK([#include <sys/types.h>
-                         #include <netinet/in.h>
-                         #include <arpa/nameser.h>
-                         #include <resolv.h>
-                        ],[
-                         res_query("test", 0, 0, (void *)0, 0);
-                        ],[AC_MSG_RESULT([in -lresolv])
-                            NETWORK_LIBS="-lresolv $NETWORK_LIBS"],
-                         [LIBS="-lbind $save_libs"
-                          AC_TRY_LINK([#include <resolv.h>],
-                                      [res_query("test", 0, 0, (void *)0, 0);],
-                                      [AC_MSG_RESULT([in -lbind])
-                                       NETWORK_LIBS="-lbind $NETWORK_LIBS"],
-                                      [AC_MSG_ERROR(not found)])])
-             LIBS="$save_libs"])
-AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket,
-                                     [NETWORK_LIBS="-lsocket $NETWORK_LIBS"],
-                                     [AC_MSG_ERROR(Could not find socket())]))
+if test $glib_native_win32 = no; then
+  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
+  NETWORK_LIBS=""
+  AC_MSG_CHECKING([for res_query])
+  AC_TRY_LINK([#include <sys/types.h>
+              #include <netinet/in.h>
+              #include <arpa/nameser.h>
+              #include <resolv.h>
+              ],[
+              res_query("test", 0, 0, (void *)0, 0);
+              ],[AC_MSG_RESULT([yes])],
+              [save_libs="$LIBS"
+               LIBS="-lresolv $LIBS"
+               AC_TRY_LINK([#include <sys/types.h>
+                           #include <netinet/in.h>
+                           #include <arpa/nameser.h>
+                           #include <resolv.h>
+                          ],[
+                           res_query("test", 0, 0, (void *)0, 0);
+                          ],[AC_MSG_RESULT([in -lresolv])
+                              NETWORK_LIBS="-lresolv $NETWORK_LIBS"],
+                           [LIBS="-lbind $save_libs"
+                            AC_TRY_LINK([#include <resolv.h>],
+                                        [res_query("test", 0, 0, (void *)0, 0);],
+                                        [AC_MSG_RESULT([in -lbind])
+                                         NETWORK_LIBS="-lbind $NETWORK_LIBS"],
+                                        [AC_MSG_ERROR(not found)])])
+               LIBS="$save_libs"])
+  AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket,
+                                       [NETWORK_LIBS="-lsocket $NETWORK_LIBS"],
+                                       [AC_MSG_ERROR(Could not find socket())]))
+fi
 AC_SUBST(NETWORK_LIBS)
 
 case $host in
 AC_SUBST(NETWORK_LIBS)
 
 case $host in