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.

45 lines
2.4KB

  1. diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py
  2. --- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py 2019-10-22 10:04:07.887472100 +0300
  3. +++ Python-3.8.0/Lib/distutils/cygwinccompiler.py 2019-10-22 10:05:31.254018600 +0300
  4. @@ -165,6 +165,28 @@
  5. self.spawn(["windres", "-i", src, "-o", obj])
  6. except DistutilsExecError as msg:
  7. raise CompileError(msg)
  8. + elif ext == '.mc':
  9. + # Adapted from msvc9compiler:
  10. + #
  11. + # Compile .MC to .RC file to .RES file.
  12. + # * '-h dir' specifies the directory for the generated include file
  13. + # * '-r dir' specifies the target directory of the generated RC file and the binary message resource it includes
  14. + #
  15. + # For now (since there are no options to change this),
  16. + # we use the source-directory for the include file and
  17. + # the build directory for the RC file and message
  18. + # resources. This works at least for win32all.
  19. + h_dir = os.path.dirname(src)
  20. + rc_dir = os.path.dirname(obj)
  21. + try:
  22. + # first compile .MC to .RC and .H file
  23. + self.spawn(['windmc'] + ['-h', h_dir, '-r', rc_dir] + [src])
  24. + base, _ = os.path.splitext(os.path.basename(src))
  25. + rc_file = os.path.join(rc_dir, base + '.rc')
  26. + # then compile .RC to .RES file
  27. + self.spawn(['windres', '-i', rc_file, '-o', obj])
  28. + except DistutilsExecError as msg:
  29. + raise CompileError(msg)
  30. else: # for other files use the C-compiler
  31. try:
  32. self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
  33. @@ -259,9 +281,9 @@
  34. base, ext = os.path.splitext(src_name)
  35. # use 'normcase' only for resource suffixes
  36. ext_normcase = os.path.normcase(ext)
  37. - if ext_normcase in ['.rc','.res']:
  38. + if ext_normcase in ['.rc', '.res', '.mc']:
  39. ext = ext_normcase
  40. - if ext not in (self.src_extensions + ['.rc','.res']):
  41. + if ext not in (self.src_extensions + ['.rc', '.res', '.mc']):
  42. raise UnknownFileError("unknown file type '%s' (from '%s')" % \
  43. (ext, src_name))
  44. base = os.path.splitdrive(base)[1] # Chop off the drive