cygwinccompiler.py patch - Pastebin.com (original) (raw)

kirbyfan64sos

Aug 25th, 2013

194

0

Never

Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

  1. 113c113
  2. < self.gcc_version, self.ld_version, self.dllwrap_version = \
  3. ---
  4. > self.gcc_version, self.ld_version, self.dllwrap_version, self.clang_gcc_version = \
  5. 314a315,355
  6. > class ClangCCompiler(CygwinCCompiler):
  7. > """ Handles the Clang C compiler.
  8. > """
  9. > compiler_type = 'clang'
  10. >
  11. > def __init__(self, verbose=0, dry_run=0, force=0):
  12. >
  13. > CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  14. >
  15. > # ld_version >= "2.13" support -shared so use it instead of
  16. > # -mdll -static
  17. > if self.ld_version >= "2.13":
  18. > shared_option = "-shared"
  19. > else:
  20. > shared_option = "-mdll -static"
  21. >
  22. > # A real mingw32 doesn't need to specify a different entry point,
  23. > # but cygwin 2.91.57 in no-cygwin-mode needs it.
  24. > if self.clang_gcc_version <= "2.91.57":
  25. > entry_point = '--entry _DllMain@12'
  26. > else:
  27. > entry_point = ''
  28. >
  29. > self.set_executables(compiler='clang -mno-cygwin -O -Wall',
  30. > compiler_so='clang -mno-cygwin -mdll -O -Wall',
  31. > compiler_cxx='clang++ -mno-cygwin -O -Wall',
  32. > linker_exe='clang -mno-cygwin',
  33. > linker_so='%s -mno-cygwin %s %s'
  34. > % (self.linker_dll, shared_option,
  35. > entry_point))
  36. > # Maybe we should also append -mthreads, but then the finished
  37. > # dlls need another dll (mingwm10.dll see Mingw32 docs)
  38. > # (-mthreads: Support thread-safe exception handling on `Mingw32')
  39. >
  40. > # no additional libraries needed
  41. > self.dll_libraries=[]
  42. >
  43. > # Include the appropriate MSVC runtime library if Python was built
  44. > # with MSVC 7.0 or later.
  45. > self.dll_libraries = get_msvcr()
  46. >
  47. 394c435
  48. < commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
  49. ---
  50. > commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version', 'clang -dumpversion']