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.

77 lines
2.8KB

  1. diff -Naur Python-3.8.0-orig/Lib/distutils/sysconfig.py Python-3.8.0/Lib/distutils/sysconfig.py
  2. --- Python-3.8.0-orig/Lib/distutils/sysconfig.py 2019-10-22 10:01:10.872961200 +0300
  3. +++ Python-3.8.0/Lib/distutils/sysconfig.py 2019-10-22 10:02:18.890080700 +0300
  4. @@ -65,6 +65,17 @@
  5. python_build = _python_build()
  6. +def _posix_build():
  7. + # GCC[mingw*] use posix build system
  8. + # Check for cross builds explicitly
  9. + host_platform = os.environ.get("_PYTHON_HOST_PLATFORM")
  10. + if host_platform:
  11. + if host_platform.startswith('mingw'):
  12. + return True
  13. + return os.name == 'posix' or \
  14. + (os.name == "nt" and 'GCC' in sys.version)
  15. +posix_build = _posix_build()
  16. +
  17. # Calculate the build qualifier flags if they are defined. Adding the flags
  18. # to the include and lib directories only makes sense for an installation, not
  19. # an in-source build.
  20. @@ -98,7 +109,7 @@
  21. """
  22. if prefix is None:
  23. prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
  24. - if os.name == "posix":
  25. + if posix_build:
  26. if python_build:
  27. # Assume the executable is in the build directory. The
  28. # pyconfig.h file should be in the same directory. Since
  29. @@ -145,7 +156,7 @@
  30. else:
  31. prefix = plat_specific and EXEC_PREFIX or PREFIX
  32. - if os.name == "posix":
  33. + if posix_build:
  34. libpython = os.path.join(prefix,
  35. "lib", "python" + get_python_version())
  36. if standard_lib:
  37. @@ -255,7 +266,7 @@
  38. def get_config_h_filename():
  39. """Return full pathname of installed pyconfig.h file."""
  40. if python_build:
  41. - if os.name == "nt":
  42. + if os.name == "nt" and not posix_build:
  43. inc_dir = os.path.join(_sys_home or project_base, "PC")
  44. else:
  45. inc_dir = _sys_home or project_base
  46. @@ -461,6 +472,9 @@
  47. def _init_nt():
  48. + if posix_build:
  49. + _init_posix()
  50. + return
  51. """Initialize the module as appropriate for NT"""
  52. g = {}
  53. # set basic install directories
  54. @@ -510,7 +524,7 @@
  55. # Always convert srcdir to an absolute path
  56. srcdir = _config_vars.get('srcdir', project_base)
  57. - if os.name == 'posix':
  58. + if posix_build:
  59. if python_build:
  60. # If srcdir is a relative path (typically '.' or '..')
  61. # then it should be interpreted relative to the directory
  62. @@ -529,7 +543,7 @@
  63. # Normally it is relative to the build directory. However, during
  64. # testing, for example, we might be running a non-installed python
  65. # from a different directory.
  66. - if python_build and os.name == "posix":
  67. + if python_build and posix_build:
  68. base = project_base
  69. if (not os.path.isabs(_config_vars['srcdir']) and
  70. base != os.getcwd()):