]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/gdbserver/configure
Consolidate definition of USE_WIN32API
[thirdparty/binutils-gdb.git] / gdb / gdbserver / configure
index 9d262bf58c6ad4f9303aff8e0b183e8dfc2518c1..154eeac7f0c67249c0bd89535961162841693976 100755 (executable)
@@ -6959,6 +6959,16 @@ _ACEOF
 fi
 
 
+  WIN32APILIBS=
+  case ${host} in
+    *mingw32*)
+
+$as_echo "#define USE_WIN32API 1" >>confdefs.h
+
+      WIN32APILIBS="-lws2_32"
+      ;;
+  esac
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
@@ -8705,19 +8715,14 @@ esac
 if test "${srv_mingwce}" = "yes"; then
   LIBS="$LIBS -lws2"
 elif test "${srv_mingw}" = "yes"; then
-  LIBS="$LIBS -lws2_32"
+  # WIN32APILIBS is set by GDB_AC_COMMON.
+  LIBS="$LIBS $WIN32APILIBS"
 elif test "${srv_qnx}" = "yes"; then
   LIBS="$LIBS -lsocket"
 elif test "${srv_lynxos}" = "yes"; then
   LIBS="$LIBS -lnetinet"
 fi
 
-if test "${srv_mingw}" = "yes"; then
-
-$as_echo "#define USE_WIN32API 1" >>confdefs.h
-
-fi
-
 if test "${srv_linux_usrregs}" = "yes"; then
 
 $as_echo "#define HAVE_LINUX_USRREGS 1" >>confdefs.h