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.

105 lines
3.6KB

  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:02:29.123698700 +0300
  3. +++ Python-3.8.0/configure.ac 2019-10-22 10:02:56.595346900 +0300
  4. @@ -598,6 +598,65 @@
  5. AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc)
  6. fi
  7. +# On 'semi-native' build systems (MSYS*/Cygwin targeting MinGW-w64)
  8. +# _sysconfigdata.py will contain paths that are correct only in the
  9. +# build environment. This means external modules will fail to build
  10. +# without setting up the same env and also that the build of Python
  11. +# itself will fail as the paths are not correct for the host tools.
  12. +#
  13. +# Also, getpath.c uses GetModuleFileNameW (replacing \ with /) and
  14. +# compares that with the define VPATH (passed in via command-line)
  15. +# to determine whether it's the build- or the installed-Python.
  16. +#
  17. +# To work around these issues a set of _b2h variables are created:
  18. +# VPATH_b2h, prefix_b2h, srcdir_b2h, abs_srcdir_b2h
  19. +# and abs_builddir_b2h
  20. +# .. where b2h stands for build to host. sysconfig.py replaces path
  21. +# prefixes matching the non-b2h versions with the b2h equivalents.
  22. +#
  23. +# (note this assumes the host compilers are native and *not* cross
  24. +# - in the 'semi-native' scenario only that is.)
  25. +
  26. +AC_DEFUN([ABS_PATH_HOST],
  27. +[$1=$(cd $$2 && pwd)
  28. + case $build_os in
  29. + mingw*)
  30. + case $host_os in
  31. + mingw*) $1=$(cd $$2 && pwd -W) ;;
  32. + *) ;;
  33. + esac
  34. + ;;
  35. + cygwin*)
  36. + case $host_os in
  37. + mingw*) $1=$(cygpath -w -m $$2) ;;
  38. + *) ;;
  39. + esac
  40. + ;;
  41. + esac
  42. +AC_SUBST([$1])
  43. +])
  44. +
  45. +AC_MSG_CHECKING(absolute host location of VPATH)
  46. +ABS_PATH_HOST([VPATH_b2h],[srcdir])
  47. +AC_MSG_RESULT([$VPATH_b2h])
  48. +
  49. +AC_MSG_CHECKING(absolute host location of prefix)
  50. +ABS_PATH_HOST([prefix_b2h],[prefix])
  51. +AC_MSG_RESULT([$prefix_b2h])
  52. +
  53. +AC_MSG_CHECKING(absolute host location of srcdir)
  54. +ABS_PATH_HOST([srcdir_b2h],[srcdir])
  55. +AC_MSG_RESULT([$srcdir_b2h])
  56. +
  57. +AC_MSG_CHECKING(absolute host location of abs_srcdir)
  58. +ABS_PATH_HOST([abs_srcdir_b2h],[srcdir])
  59. +AC_MSG_RESULT([$abs_srcdir_b2h])
  60. +
  61. +my_builddir=.
  62. +AC_MSG_CHECKING(Absolute host location of abs_builddir)
  63. +ABS_PATH_HOST([abs_builddir_b2h],[my_builddir])
  64. +AC_MSG_RESULT([$abs_builddir_b2h])
  65. +
  66. AC_MSG_CHECKING([for init system calls])
  67. AC_SUBST(INITSYS)
  68. case $host in
  69. diff -Naur Python-3.8.0-orig/Lib/sysconfig.py Python-3.8.0/Lib/sysconfig.py
  70. --- Python-3.8.0-orig/Lib/sysconfig.py 2019-10-22 10:02:09.342863900 +0300
  71. +++ Python-3.8.0/Lib/sysconfig.py 2019-10-22 10:02:57.000947600 +0300
  72. @@ -329,6 +329,14 @@
  73. if isinstance(v, str):
  74. done[k] = v.strip()
  75. + # any keys that have one with the same name suffixed with _b2h
  76. + # need to be replaced with the value of the _b2h key.
  77. + # This converts from MSYS*/Cygwin paths to Windows paths.
  78. + for k, v in dict(done).items():
  79. + if isinstance(k, str):
  80. + if k.endswith("_b2h"):
  81. + done[k[:-4]]=v
  82. +
  83. # save the results in the global dictionary
  84. vars.update(done)
  85. return vars
  86. diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in
  87. --- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:01:28.376191900 +0300
  88. +++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:02:57.390948300 +0300
  89. @@ -137,6 +137,13 @@
  90. # Install prefix for data files
  91. datarootdir= @datarootdir@
  92. +# Locations needed for semi-native fixup of sysconfig.
  93. +srcdir_b2h= @srcdir_b2h@
  94. +VPATH_b2h= @VPATH_b2h@
  95. +abs_srcdir_b2h= @abs_srcdir_b2h@
  96. +abs_builddir_b2h= @abs_builddir_b2h@
  97. +prefix_b2h= @prefix_b2h@
  98. +
  99. # Expanded directories
  100. BINDIR= @bindir@
  101. LIBDIR= @libdir@