equal
deleted
inserted
replaced
53 from distutils.command.build_ext import build_ext |
53 from distutils.command.build_ext import build_ext |
54 from distutils.command.build_py import build_py |
54 from distutils.command.build_py import build_py |
55 from distutils.spawn import spawn, find_executable |
55 from distutils.spawn import spawn, find_executable |
56 from distutils.ccompiler import new_compiler |
56 from distutils.ccompiler import new_compiler |
57 from distutils.errors import CCompilerError |
57 from distutils.errors import CCompilerError |
|
58 from distutils.sysconfig import get_python_inc |
58 |
59 |
59 scripts = ['hg'] |
60 scripts = ['hg'] |
60 if os.name == 'nt': |
61 if os.name == 'nt': |
61 scripts.append('contrib/win32/hg.bat') |
62 scripts.append('contrib/win32/hg.bat') |
62 |
63 |
244 self.py_modules = [] |
245 self.py_modules = [] |
245 for ext in self.distribution.ext_modules: |
246 for ext in self.distribution.ext_modules: |
246 if ext.name.startswith("mercurial."): |
247 if ext.name.startswith("mercurial."): |
247 self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) |
248 self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) |
248 self.distribution.ext_modules = [] |
249 self.distribution.ext_modules = [] |
|
250 else: |
|
251 if not os.path.exists(os.path.join(get_python_inc(), 'Python.h')): |
|
252 raise SystemExit("Python headers are required to build Mercurial") |
249 |
253 |
250 def find_modules(self): |
254 def find_modules(self): |
251 modules = build_py.find_modules(self) |
255 modules = build_py.find_modules(self) |
252 for module in modules: |
256 for module in modules: |
253 if module[0] == "mercurial.pure": |
257 if module[0] == "mercurial.pure": |