MINGW-packages/mingw-w64-python3.13/0105-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

45 lines
1.5 KiB
Diff

From 56ea667284a1e85b0fc778ff2e7a70a42dc7bac0 Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Mon, 1 Jan 2024 14:25:11 +0530
Subject: [PATCH 105/N] Add libraries to fix compile of ctypes on MINGW
---
configure.ac | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index da667e3..4aade3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4510,6 +4510,12 @@ AS_CASE([$MACHDEP],
[SELECTMODULE_LIBS=""]
)
+dnl On MINGW, you need to link againt ole32, oleaut32 and uuid for ctypes
+AS_CASE([$MACHDEP],
+ [win32], [CTYPES_LIBS="-lole32 -loleaut32 -luuid"],
+ [CTYPES_LIBS=""]
+)
+
dnl detect sqlite3 from Emscripten emport
PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
@@ -8313,7 +8319,7 @@ PY_STDLIB_MOD([_blake2],
PY_STDLIB_MOD([_ctypes],
[], [test "$have_libffi" = yes],
- [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS])
+ [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS $CTYPES_LIBS])
PY_STDLIB_MOD([_curses],
[], [test "$have_curses" = "yes"],
[$CURSES_CFLAGS], [$CURSES_LIBS]
@@ -8390,7 +8396,7 @@ PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes])
PY_STDLIB_MOD([_testconsole], [test "$TEST_MODULES" = yes -a "$MACHDEP" = "win32"])
PY_STDLIB_MOD([_ctypes_test],
[test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$have_dynamic_loading" = yes],
- [], [$LIBM])
+ [], [$LIBM $CTYPES_LIBS])
dnl Limited API template modules.
dnl Emscripten does not support shared libraries yet.