diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac --- Python-3.8.0-orig/configure.ac 2019-10-22 10:02:59.122551400 +0300 +++ Python-3.8.0/configure.ac 2019-10-22 10:03:46.312634200 +0300 @@ -3071,10 +3071,19 @@ fi # check if we need libintl for locale functions +case $host in + *) + 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 -Naur Python-3.8.0-orig/Modules/_localemodule.c Python-3.8.0/Modules/_localemodule.c --- Python-3.8.0-orig/Modules/_localemodule.c 2019-10-14 16:34:47.000000000 +0300 +++ Python-3.8.0/Modules/_localemodule.c 2019-10-22 10:03:46.718235000 +0300 @@ -12,6 +12,13 @@ #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 #include