diff -rupN --no-dereference Python-3.10.0rc1/configure.ac Python-3.10.0rc1-new/configure.ac
--- Python-3.10.0rc1/configure.ac 2021-08-04 16:36:56.708384587 +0200
+++ Python-3.10.0rc1-new/configure.ac 2021-08-04 16:36:56.941382232 +0200
@@ -2953,10 +2953,19 @@ void *x = uuid_enc_be
AC_SEARCH_LIBS(sem_init, pthread rt posix4)
# 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
diff -rupN --no-dereference Python-3.10.0rc1/Modules/_localemodule.c Python-3.10.0rc1-new/Modules/_localemodule.c
--- Python-3.10.0rc1/Modules/_localemodule.c 2021-08-02 21:53:59.000000000 +0200
+++ Python-3.10.0rc1-new/Modules/_localemodule.c 2021-08-04 16:36:56.941382232 +0200
@@ -11,6 +11,13 @@ This software comes with no warranty. Us
#define PY_SSIZE_T_CLEAN
#include "Python.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 "pycore_fileutils.h"
#include <stdio.h>