Files
MINGW-packages/mingw-w64-python3/0400-MINGW-setup-msvcrt-and-_winapi-modules.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

79 lines
2.7 KiB
Diff

diff -Naur Python-3.7.0-orig/Python/dynamic_annotations.c Python-3.7.0/Python/dynamic_annotations.c
--- Python-3.7.0-orig/Python/dynamic_annotations.c 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/Python/dynamic_annotations.c 2018-07-02 09:39:09.139582100 +0300
@@ -27,7 +27,7 @@
* Author: Kostya Serebryany
*/
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
# include <windows.h>
#endif
diff -Naur Python-3.7.0-orig/Modules/main.c Python-3.7.0/Modules/main.c
--- Python-3.7.0-orig/Modules/main.c 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/Modules/main.c 2018-07-02 09:47:09.500870400 +0300
@@ -18,7 +18,7 @@
# endif
#endif
-#ifdef _MSC_VER
+#if defined(_WIN32) && defined(Py_DEBUG)
# include <crtdbg.h>
#endif
diff -Naur Python-3.7.0-orig/Modules/_winapi.c Python-3.7.0/Modules/_winapi.c
--- Python-3.7.0-orig/Modules/_winapi.c 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/Modules/_winapi.c 2018-06-30 11:16:24.579037100 +0300
@@ -39,7 +39,9 @@
#define WINDOWS_LEAN_AND_MEAN
#include "windows.h"
+#if defined(Py_DEBUG)
#include <crtdbg.h>
+#endif
#include "winreparse.h"
#if defined(MS_WIN32) && !defined(MS_WIN64)
diff -Naur Python-3.7.0-orig/PC/msvcrtmodule.c Python-3.7.0/PC/msvcrtmodule.c
--- Python-3.7.0-orig/PC/msvcrtmodule.c 2018-06-27 06:07:35.000000000 +0300
+++ Python-3.7.0/PC/msvcrtmodule.c 2018-06-30 11:16:24.594637200 +0300
@@ -21,7 +21,9 @@
#include <io.h>
#include <conio.h>
#include <sys/locking.h>
+#ifdef _DEBUG
#include <crtdbg.h>
+#endif
#include <windows.h>
#ifdef _MSC_VER
diff -Naur Python-3.7.0-orig/setup.py Python-3.7.0/setup.py
--- Python-3.7.0-orig/setup.py 2018-06-30 11:16:24.298236600 +0300
+++ Python-3.7.0/setup.py 2018-06-30 11:16:24.594637200 +0300
@@ -962,6 +962,24 @@
min_db_ver = (3, 3)
db_setup_debug = False # verbose debug prints from this script?
+ # Modules with some Windows dependencies:
+ if host_platform.startswith(('mingw', 'win')):
+ srcdir = sysconfig.get_config_var('srcdir')
+ pc_srcdir = os.path.abspath(os.path.join(srcdir, 'PC'))
+
+ exts.append( Extension('msvcrt', [os.path.join(pc_srcdir, p)
+ for p in ['msvcrtmodule.c']]) )
+
+ exts.append( Extension('_winapi', ['_winapi.c']) )
+
+ exts.append( Extension('_msi', [os.path.join(pc_srcdir, p)
+ for p in ['_msi.c']],
+ libraries=['msi','cabinet','rpcrt4']) ) # To link with lib(msi|cabinet|rpcrt4).a
+
+ exts.append( Extension('winsound', [os.path.join(pc_srcdir, p)
+ for p in ['winsound.c']],
+ libraries=['winmm']) )
+
def allow_db_ver(db_ver):
"""Returns a boolean if the given BerkeleyDB version is acceptable.