From 23c180a7c8baa6c73a50f9f3366705cfb84e397b Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Mon, 1 Jan 2024 13:42:01 +0530
Subject: [PATCH 104/N] Add missing library for multiprocessing module

`ws2_32` is required when building that module
---
 configure.ac | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 9671d72..0a82add 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4282,6 +4282,13 @@ AS_CASE([$MACHDEP],
   [SOCKET_LIBS=""]
 )
 
+dnl On MINGW, you need to link againt ws2_32 for _multiprocessing
+AS_CASE([$MACHDEP],
+  [win32], [MULTIPROCESSING_LIBS="-lws2_32"],
+  [MULTIPROCESSING_LIBS=""]
+)
+
+
 dnl detect sqlite3 from Emscripten emport
 PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
 
@@ -7899,7 +7906,7 @@ PY_STDLIB_MOD_SIMPLE([_zoneinfo])
 dnl multiprocessing modules
 PY_STDLIB_MOD([_multiprocessing],
   [], [test "$ac_cv_func_sem_unlink" = "yes" -o "$MACHDEP" = "win32"],
-  [-I\$(srcdir)/Modules/_multiprocessing])
+  [-I\$(srcdir)/Modules/_multiprocessing], [$MULTIPROCESSING_LIBS])
 PY_STDLIB_MOD([_posixshmem],
   [], [test "$have_posix_shmem" = "yes"],
   [$POSIXSHMEM_CFLAGS], [$POSIXSHMEM_LIBS])
