MINGW-packages/mingw-w64-python3.13/0027-dont-link-with-gettext.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

59 lines
1.9 KiB
Diff

From ca7e234a51d77b04183710d26638ed0088e01c78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:52:00 +0530
Subject: [PATCH 027/N] dont link with gettext
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
---
Modules/_localemodule.c | 8 ++++++++
configure.ac | 9 +++++++++
2 files changed, 17 insertions(+)
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 6015670..61fc3f2 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -13,6 +13,14 @@ This software comes with no warranty. Use at your own risk.
#include "pycore_fileutils.h" // _Py_GetLocaleconvNumeric()
#include "pycore_pymem.h" // _PyMem_Strdup()
+#ifdef __MINGW32__
+/* The header libintl.h and library libintl may exist on mingw host.
+ * To be compatible with MSVC build we has to undef some defines.
+ */
+#undef HAVE_LIBINTL_H
+#undef HAVE_BIND_TEXTDOMAIN_CODESET
+#endif
+
#include <locale.h> // setlocale()
#include <string.h> // strlen()
#ifdef HAVE_ERRNO_H
diff --git a/configure.ac b/configure.ac
index 5f190dc..8966e8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4080,10 +4080,19 @@ AC_SEARCH_LIBS([sem_init], [pthread rt posix4])
fi
# check if we need libintl for locale functions
+case $host in
+ *-*-mingw*)
+ dnl Native windows build don't use libintl (see _localemodule.c).
+ dnl Also we don't like setup.py to add "intl" library to the list
+ dnl when build _locale module.
+ ;;
+ *)
AC_CHECK_LIB([intl], [textdomain],
[AC_DEFINE([WITH_LIBINTL], [1],
[Define to 1 if libintl is needed for locale functions.])
LIBS="-lintl $LIBS"])
+ ;;
+esac
# checks for system dependent C++ extensions support
case "$ac_sys_system" in