##// 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 76 from distutils.command.install_lib import install_lib
77 77 from distutils.command.install_scripts import install_scripts
78 78 from distutils.spawn import spawn, find_executable
79 from distutils import cygwinccompiler, file_util
79 from distutils import file_util
80 80 from distutils.errors import CCompilerError, DistutilsExecError
81 81 from distutils.sysconfig import get_python_inc, get_config_var
82 82 from distutils.version import StrictVersion
@@ -509,19 +509,28 b' else:'
509 509 extra_link_args=osutil_ldflags,
510 510 depends=common_depends))
511 511
512 # the -mno-cygwin option has been deprecated for years
513 Mingw32CCompiler = cygwinccompiler.Mingw32CCompiler
512 try:
513 from distutils import cygwinccompiler
514
515 # the -mno-cygwin option has been deprecated for years
516 compiler = cygwinccompiler.Mingw32CCompiler
514 517
515 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
516 def __init__(self, *args, **kwargs):
517 Mingw32CCompiler.__init__(self, *args, **kwargs)
518 for i in 'compiler compiler_so linker_exe linker_so'.split():
519 try:
520 getattr(self, i).remove('-mno-cygwin')
521 except ValueError:
522 pass
518 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
519 def __init__(self, *args, **kwargs):
520 compiler.__init__(self, *args, **kwargs)
521 for i in 'compiler compiler_so linker_exe linker_so'.split():
522 try:
523 getattr(self, i).remove('-mno-cygwin')
524 except ValueError:
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 535 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
527 536 'help/*.txt',
General Comments 0
You need to be logged in to leave comments. Login now