From b2eab751414b439d440d3d29ea4c4fd2dc29984a Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Mon, 1 Jan 2024 15:04:43 +0530
Subject: [PATCH 109/N] Enable `_uuid` on MINGW

---
 configure.ac | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 159d4fe..2575149 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4300,6 +4300,12 @@ AS_CASE([$MACHDEP],
   [CTYPES_LIBS=""]
 )
 
+dnl On MINGW, you need to link againt rpcrt4 for _uuid
+AS_CASE([$MACHDEP],
+  [win32], [UUID_LIBS="-lrpcrt4"],
+  [UUID_LIBS=""]
+)
+
 dnl detect sqlite3 from Emscripten emport
 PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
 
@@ -8027,8 +8033,8 @@ PY_STDLIB_MOD([_tkinter],
   [], [test "$have_tcltk" = "yes"],
   [$TCLTK_CFLAGS], [$TCLTK_LIBS])
 PY_STDLIB_MOD([_uuid],
-  [], [test "$have_uuid" = "yes"],
-  [$LIBUUID_CFLAGS], [$LIBUUID_LIBS])
+  [], [test "$have_uuid" = "yes" -o "$MACHDEP" = "win32"],
+  [$LIBUUID_CFLAGS], [$LIBUUID_LIBS $UUID_LIBS])
 
 dnl compression libs
 PY_STDLIB_MOD([zlib], [], [test "$have_zlib" = yes],
