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.

70 lines
3.5KB

  1. diff -Naur Python-3.8.0-orig/setup.py Python-3.8.0/setup.py
  2. --- Python-3.8.0-orig/setup.py 2019-10-22 10:03:14.129777700 +0300
  3. +++ Python-3.8.0/setup.py 2019-10-22 10:03:22.475792400 +0300
  4. @@ -703,7 +703,7 @@
  5. if HOST_PLATFORM == 'hp-ux11':
  6. self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  7. - if MACOS:
  8. + if MACOS or MS_WINDOWS:
  9. # This should work on any unixy platform ;-)
  10. # If the user has bothered specifying additional -I and -L flags
  11. # in OPT and LDFLAGS we might as well use them here.
  12. @@ -713,6 +713,8 @@
  13. # directories with whitespace in the name to store libraries.
  14. cflags, ldflags = sysconfig.get_config_vars(
  15. 'CFLAGS', 'LDFLAGS')
  16. + cflags = cflags + ' ' + ('',os.environ.get('CC'))[os.environ.get('CC') != None]
  17. + ldflags = ldflags + ' ' + ('',os.environ.get('LDSHARED'))[os.environ.get('LDSHARED') != None]
  18. for item in cflags.split():
  19. if item.startswith('-I'):
  20. self.inc_dirs.append(item[2:])
  21. @@ -1907,14 +1909,19 @@
  22. # The versions with dots are used on Unix, and the versions without
  23. # dots on Windows, for detection by cygwin.
  24. tcllib = tklib = tcl_includes = tk_includes = None
  25. - for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
  26. - '8.2', '82', '8.1', '81', '8.0', '80']:
  27. - tklib = self.compiler.find_library_file(self.lib_dirs,
  28. - 'tk' + version)
  29. - tcllib = self.compiler.find_library_file(self.lib_dirs,
  30. - 'tcl' + version)
  31. - if tklib and tcllib:
  32. - # Exit the loop when we've found the Tcl/Tk libraries
  33. + tcltk_suffix = None
  34. + for suffix in ['', 's']:
  35. + for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
  36. + '8.2', '82', '8.1', '81', '8.0', '80', '']:
  37. + tklib = self.compiler.find_library_file(self.lib_dirs,
  38. + 'tk' + version + suffix)
  39. + tcllib = self.compiler.find_library_file(self.lib_dirs,
  40. + 'tcl' + version + suffix)
  41. + if tklib and tcllib:
  42. + # Exit the loop when we've found the Tcl/Tk libraries
  43. + tcltk_suffix = suffix
  44. + break
  45. + if tcltk_suffix != None:
  46. break
  47. # Now check for the header files
  48. @@ -1985,10 +1992,18 @@
  49. # Add the Tcl/Tk libraries
  50. libs.append('tk'+ version)
  51. libs.append('tcl'+ version)
  52. + libs.append('tk'+ version + tcltk_suffix)
  53. + libs.append('tcl'+ version + tcltk_suffix)
  54. + if MS_WINDOWS:
  55. + for winlib in ['ws2_32','gdi32','comctl32','comdlg32','imm32','uuid','oleaut32','ole32']:
  56. + libs.append( winlib )
  57. # Finally, link with the X11 libraries (not appropriate on cygwin)
  58. - if not CYGWIN:
  59. + # ...on those platforms, define STATIC_BUILD if linking to static tcl/tk.
  60. + if not CYGWIN and not MS_WINDOWS:
  61. libs.append('X11')
  62. + elif tcllib.endswith('s.a'):
  63. + defs.append( ('STATIC_BUILD',1) )
  64. # XXX handle these, but how to detect?
  65. # *** Uncomment and edit for PIL (TkImaging) extension only: