Files
MINGW-packages/mingw-w64-python3/0980-mingw-readline-module.patch
Алексей edc01d04d6 Update python to 3.7.0 (#4047)
* Initial python-3.7 port

* python3: Add setup.config.in to remove before patching

* python3: Implement setenv for mingw. Fix building with NT threads. Build
with unicode

* Fix typos

* Fix linking core modules

* Mingw build have exec_prefix

* Remove deprecated patch

* Fix building python and modules. Failing to build readline module and
install not working yet

* More getpath changes and more aggressive path separator conversion

* Fix readline module compilation and linking errors

* python3: By default building with posix threads, NT threads are broken.
Some patches optimization. First buildable commit

* Py_DecodeLocale handle char, not wchar

* Fix building multiprocessing module with posix threads
2018-07-06 09:57:52 +03:00

44 lines
1.5 KiB
Diff

diff -Naur Python-3.7.0-orig/configure.ac Python-3.7.0/configure.ac
--- Python-3.7.0-orig/configure.ac 2018-06-30 11:17:44.107976800 +0300
+++ Python-3.7.0/configure.ac 2018-06-30 11:18:09.692021800 +0300
@@ -5116,9 +5116,16 @@
[Define if you have readline 4.0]), ,$READLINE_LIBS)
# also in 4.0, but not in editline
+case $host in
+ *-*-mingw*)
+ dnl Windows don't have resize terminal signal.
+ ;;
+ *)
AC_CHECK_LIB(readline, rl_resize_terminal,
AC_DEFINE(HAVE_RL_RESIZE_TERMINAL, 1,
[Define if you have readline 4.0]), ,$READLINE_LIBS)
+ ;;
+esac
# check for readline 4.2
AC_CHECK_LIB(readline, rl_completion_matches,
--- Python-3.7.0/setup.py.orig 2018-07-05 02:42:31.000000000 -0500
+++ Python-3.7.0/setup.py 2018-07-05 02:42:56.000000000 -0500
@@ -874,6 +874,8 @@
readline_extra_link_args = ()
readline_libs = ['readline']
+ if host_platform.startswith(('mingw', 'win')):
+ readline_libs.append('ws2_32')
if readline_termcap_library:
pass # Issue 7384: Already linked against curses or tinfo.
elif curses_library:
--- Python-3.7.0/Modules/readline.c.orig 2018-07-05 02:43:06.000000000 -0500
+++ Python-3.7.0/Modules/readline.c 2018-07-05 02:43:46.000000000 -0500
@@ -11,6 +11,9 @@
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
#if defined(HAVE_SETLOCALE)
/* GNU readline() mistakenly sets the LC_CTYPE locale.