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.

145 lines
5.0KB

  1. diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
  2. --- Python-3.8.0-orig/configure.ac 2019-10-22 10:01:27.970591200 +0300
  3. +++ Python-3.8.0/configure.ac 2019-10-22 10:01:39.327411100 +0300
  4. @@ -4291,21 +4291,36 @@
  5. ],[])
  6. AC_MSG_RESULT($was_it_defined)
  7. +AC_CHECK_HEADERS([ws2tcpip.h])
  8. AC_MSG_CHECKING(for addrinfo)
  9. AC_CACHE_VAL(ac_cv_struct_addrinfo,
  10. -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]])],
  11. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  12. +#ifdef HAVE_WS2TCPIP_H
  13. +# include <ws2tcpip.h>
  14. +#else
  15. +# include <netdb.h>
  16. +#endif]],
  17. + [[struct addrinfo a]])],
  18. [ac_cv_struct_addrinfo=yes],
  19. [ac_cv_struct_addrinfo=no]))
  20. AC_MSG_RESULT($ac_cv_struct_addrinfo)
  21. if test $ac_cv_struct_addrinfo = yes; then
  22. - AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
  23. + AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo])
  24. fi
  25. AC_MSG_CHECKING(for sockaddr_storage)
  26. AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
  27. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  28. -# include <sys/types.h>
  29. -# include <sys/socket.h>]], [[struct sockaddr_storage s]])],
  30. +#ifdef HAVE_WS2TCPIP_H
  31. +#include <ws2tcpip.h>
  32. +#endif
  33. +#ifdef HAVE_SYS_TYPES_H
  34. +#include <sys/types.h>
  35. +#endif
  36. +#ifdef HAVE_SYS_SOCKET_H
  37. +#include <sys/socket.h>
  38. +#endif]],
  39. + [[struct sockaddr_storage s]])],
  40. [ac_cv_struct_sockaddr_storage=yes],
  41. [ac_cv_struct_sockaddr_storage=no]))
  42. AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
  43. @@ -5411,7 +5426,10 @@
  44. AC_CHECK_TYPE(socklen_t,,
  45. AC_DEFINE(socklen_t,int,
  46. - [Define to `int' if <sys/socket.h> does not define.]),[
  47. + [Define to `int' if <sys/socket.h> or <ws2tcpip.h> does not define.]),[
  48. +#ifdef HAVE_WS2TCPIP_H
  49. +#include <ws2tcpip.h>
  50. +#endif
  51. #ifdef HAVE_SYS_TYPES_H
  52. #include <sys/types.h>
  53. #endif
  54. diff -Naur Python-3.8.0-orig/Misc/config_mingw Python-3.8.0/Misc/config_mingw
  55. --- Python-3.8.0-orig/Misc/config_mingw 2019-10-22 10:00:45.989917400 +0300
  56. +++ Python-3.8.0/Misc/config_mingw 2019-10-22 10:01:39.733011900 +0300
  57. @@ -10,3 +10,6 @@
  58. # files to ignore
  59. ac_cv_file__dev_ptmx=ignore #NOTE: under MSYS environment device exist
  60. ac_cv_file__dev_ptc=no
  61. +
  62. +# force detection of winsock2 functionality - require wxp or newer
  63. +ac_cv_func_getpeername=yes
  64. diff -Naur Python-3.8.0-orig/Modules/socketmodule.c Python-3.8.0/Modules/socketmodule.c
  65. --- Python-3.8.0-orig/Modules/socketmodule.c 2019-10-14 16:34:47.000000000 +0300
  66. +++ Python-3.8.0/Modules/socketmodule.c 2019-10-22 10:01:40.123012500 +0300
  67. @@ -310,7 +310,7 @@
  68. # endif
  69. /* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */
  70. -#ifdef MS_WINDOWS
  71. +#ifdef _MSC_VER
  72. #define IPPROTO_ICMP IPPROTO_ICMP
  73. #define IPPROTO_IGMP IPPROTO_IGMP
  74. #define IPPROTO_GGP IPPROTO_GGP
  75. @@ -341,7 +341,7 @@
  76. #define IPPROTO_PGM IPPROTO_PGM // WinSock2 only
  77. #define IPPROTO_L2TP IPPROTO_L2TP // WinSock2 only
  78. #define IPPROTO_SCTP IPPROTO_SCTP // WinSock2 only
  79. -#endif /* MS_WINDOWS */
  80. +#endif /* _MSC_VER */
  81. /* Provides the IsWindows7SP1OrGreater() function */
  82. #include <versionhelpers.h>
  83. @@ -434,6 +434,10 @@
  84. /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
  85. * EAI_* constants are defined in (the already included) ws2tcpip.h.
  86. */
  87. +#elif defined(__MINGW32__)
  88. + /* Do not include addrinfo.h as minimum supported version is
  89. + * _WIN32_WINNT >= WindowsXP(0x0501)
  90. + */
  91. #else
  92. # include "addrinfo.h"
  93. #endif
  94. diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in
  95. --- Python-3.8.0-orig/pyconfig.h.in 2019-10-22 10:00:35.132298300 +0300
  96. +++ Python-3.8.0/pyconfig.h.in 2019-10-22 10:01:40.513013200 +0300
  97. @@ -54,7 +54,7 @@
  98. /* Define to 1 if you have the `acosh' function. */
  99. #undef HAVE_ACOSH
  100. -/* struct addrinfo (netdb.h) */
  101. +/* struct addrinfo */
  102. #undef HAVE_ADDRINFO
  103. /* Define to 1 if you have the `alarm' function. */
  104. @@ -1335,6 +1335,9 @@
  105. /* Define if libssl has X509_VERIFY_PARAM_set1_host and related function */
  106. #undef HAVE_X509_VERIFY_PARAM_SET1_HOST
  107. +/* Define to 1 if you have the <ws2tcpip.h> header file. */
  108. +#undef HAVE_WS2TCPIP_H
  109. +
  110. /* Define if the zlib library has inflateCopy */
  111. #undef HAVE_ZLIB_COPY
  112. @@ -1644,7 +1647,7 @@
  113. /* Define to `unsigned int' if <sys/types.h> does not define. */
  114. #undef size_t
  115. -/* Define to `int' if <sys/socket.h> does not define. */
  116. +/* Define to `int' if <sys/socket.h> or <ws2tcpip.h> does not define. */
  117. #undef socklen_t
  118. /* Define to `int' if <sys/types.h> doesn't define. */
  119. diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py
  120. --- Python-3.8.0-orig/setup.py 2019-10-22 10:01:38.141809100 +0300
  121. +++ Python-3.8.0/setup.py 2019-10-22 10:01:40.934214000 +0300
  122. @@ -1050,7 +1050,11 @@
  123. def detect_socket(self):
  124. # socket(2)
  125. if not VXWORKS:
  126. + socket_libs = []
  127. + if MS_WINDOWS:
  128. + socket_libs += ['ws2_32', 'iphlpapi']
  129. self.add(Extension('_socket', ['socketmodule.c'],
  130. + libraries = socket_libs,
  131. depends=['socketmodule.h']))
  132. elif self.compiler.find_library_file(self.lib_dirs, 'net'):
  133. libs = ['net']