##// END OF EJS Templates
setup: don't fail when Python doesn't have the cygwinccompiler package...
Ludovic Chabant -
r23677:6bc1702e default
parent child Browse files
Show More
@@ -76,7 +76,7 b' from distutils.command.build_py import b'
76 from distutils.command.install_lib import install_lib
76 from distutils.command.install_lib import install_lib
77 from distutils.command.install_scripts import install_scripts
77 from distutils.command.install_scripts import install_scripts
78 from distutils.spawn import spawn, find_executable
78 from distutils.spawn import spawn, find_executable
79 from distutils import cygwinccompiler, file_util
79 from distutils import file_util
80 from distutils.errors import CCompilerError, DistutilsExecError
80 from distutils.errors import CCompilerError, DistutilsExecError
81 from distutils.sysconfig import get_python_inc, get_config_var
81 from distutils.sysconfig import get_python_inc, get_config_var
82 from distutils.version import StrictVersion
82 from distutils.version import StrictVersion
@@ -509,12 +509,15 b' else:'
509 extra_link_args=osutil_ldflags,
509 extra_link_args=osutil_ldflags,
510 depends=common_depends))
510 depends=common_depends))
511
511
512 try:
513 from distutils import cygwinccompiler
514
512 # the -mno-cygwin option has been deprecated for years
515 # the -mno-cygwin option has been deprecated for years
513 Mingw32CCompiler = cygwinccompiler.Mingw32CCompiler
516 compiler = cygwinccompiler.Mingw32CCompiler
514
517
515 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
518 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
516 def __init__(self, *args, **kwargs):
519 def __init__(self, *args, **kwargs):
517 Mingw32CCompiler.__init__(self, *args, **kwargs)
520 compiler.__init__(self, *args, **kwargs)
518 for i in 'compiler compiler_so linker_exe linker_so'.split():
521 for i in 'compiler compiler_so linker_exe linker_so'.split():
519 try:
522 try:
520 getattr(self, i).remove('-mno-cygwin')
523 getattr(self, i).remove('-mno-cygwin')
@@ -522,6 +525,12 b' class HackedMingw32CCompiler(cygwinccomp'
522 pass
525 pass
523
526
524 cygwinccompiler.Mingw32CCompiler = HackedMingw32CCompiler
527 cygwinccompiler.Mingw32CCompiler = HackedMingw32CCompiler
528 except ImportError:
529 # the cygwinccompiler package is not available on some Python
530 # distributions like the ones from the optware project for Synology
531 # DiskStation boxes
532 class HackedMingw32CCompiler(object):
533 pass
525
534
526 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
535 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
527 'help/*.txt',
536 'help/*.txt',
General Comments 0
You need to be logged in to leave comments. Login now