Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
3.0KB

  1. diff -Naur Python-3.8.0-orig/Include/pyport.h Python-3.8.0/Include/pyport.h
  2. --- Python-3.8.0-orig/Include/pyport.h 2019-10-22 10:00:37.955903300 +0300
  3. +++ Python-3.8.0/Include/pyport.h 2019-10-22 10:01:14.850968200 +0300
  4. @@ -651,12 +651,12 @@
  5. */
  6. /*
  7. - All windows ports, except cygwin, are handled in PC/pyconfig.h.
  8. + Only MSVC windows ports is handled in PC/pyconfig.h.
  9. - Cygwin is the only other autoconf platform requiring special
  10. + Cygwin and Mingw is the only other autoconf platform requiring special
  11. linkage handling and it uses __declspec().
  12. */
  13. -#if defined(__CYGWIN__)
  14. +#if defined(__CYGWIN__) || defined(__MINGW32__)
  15. # define HAVE_DECLSPEC_DLL
  16. #endif
  17. @@ -667,21 +667,23 @@
  18. # define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
  19. # define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE
  20. /* module init functions inside the core need no external linkage */
  21. - /* except for Cygwin to handle embedding */
  22. -# if defined(__CYGWIN__)
  23. + /* except for Cygwin/Mingw to handle embedding */
  24. +# if defined(__CYGWIN__) || defined(__MINGW32__)
  25. # define PyMODINIT_FUNC __declspec(dllexport) PyObject*
  26. -# else /* __CYGWIN__ */
  27. +# else /* __CYGWIN__ || __MINGW32__*/
  28. # define PyMODINIT_FUNC PyObject*
  29. -# endif /* __CYGWIN__ */
  30. +# endif /* __CYGWIN__ || __MINGW32__*/
  31. # else /* Py_BUILD_CORE */
  32. /* Building an extension module, or an embedded situation */
  33. /* public Python functions and data are imported */
  34. /* Under Cygwin, auto-import functions to prevent compilation */
  35. /* failures similar to those described at the bottom of 4.1: */
  36. /* http://docs.python.org/extending/windows.html#a-cookbook-approach */
  37. -# if !defined(__CYGWIN__)
  38. +# if defined(__CYGWIN__) || defined(__MINGW32__)
  39. +# define PyAPI_FUNC(RTYPE) RTYPE
  40. +# else
  41. # define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE
  42. -# endif /* !__CYGWIN__ */
  43. +# endif /* __CYGWIN__ || __MINGW32__*/
  44. # define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE
  45. /* module init functions outside the core must be exported */
  46. # if defined(__cplusplus)
  47. diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py
  48. --- Python-3.8.0-orig/setup.py 2019-10-22 10:00:25.787881900 +0300
  49. +++ Python-3.8.0/setup.py 2019-10-22 10:01:15.256568900 +0300
  50. @@ -316,6 +316,9 @@
  51. raise ValueError("No source directory; cannot proceed.")
  52. self.srcdir = os.path.abspath(self.srcdir)
  53. + if MS_WINDOWS:
  54. + self.compiler.define_macro("Py_BUILD_CORE_MODULE")
  55. +
  56. # Detect which modules should be compiled
  57. self.detect_modules()