summarylogtreecommitdiffstats
path: root/0048-dont-link-with-gettext.patch
diff options
context:
space:
mode:
Diffstat (limited to '0048-dont-link-with-gettext.patch')
-rw-r--r--0048-dont-link-with-gettext.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/0048-dont-link-with-gettext.patch b/0048-dont-link-with-gettext.patch
new file mode 100644
index 000000000000..b70260cc2ed0
--- /dev/null
+++ b/0048-dont-link-with-gettext.patch
@@ -0,0 +1,60 @@
+From 9b3cfc647bdeedc9caa6d89cdbcb4dfcdb3490f8 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 048/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 | 7 +++++++
+ configure.ac | 9 +++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
+index 2e353bb..ea222af 100644
+--- a/Modules/_localemodule.c
++++ b/Modules/_localemodule.c
+@@ -12,6 +12,13 @@ This software comes with no warranty. Use at your own risk.
+ #define PY_SSIZE_T_CLEAN
+ #include "Python.h"
+ #include "pycore_fileutils.h"
++#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 <stdio.h>
+ #include <locale.h>
+diff --git a/configure.ac b/configure.ac
+index a9640e9..0e1e9e4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3154,10 +3154,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
+--
+2.33.0
+