setup.py
changeset 29505 2dce3f96ad7b
parent 29444 284d742e5611
child 29541 9631ff5ebbeb
equal deleted inserted replaced
29504:7503d8874617 29505:2dce3f96ad7b
   260             self.mkpath(join('mercurial', modir))
   260             self.mkpath(join('mercurial', modir))
   261             self.make_file([pofile], mobuildfile, spawn, (cmd,))
   261             self.make_file([pofile], mobuildfile, spawn, (cmd,))
   262 
   262 
   263 
   263 
   264 class hgdist(Distribution):
   264 class hgdist(Distribution):
   265     pure = ispypy
   265     pure = False
       
   266     cffi = ispypy
   266 
   267 
   267     global_options = Distribution.global_options + \
   268     global_options = Distribution.global_options + \
   268                      [('pure', None, "use pure (slow) Python "
   269                      [('pure', None, "use pure (slow) Python "
   269                         "code instead of C extensions"),
   270                         "code instead of C extensions"),
   270                      ]
   271                      ]
   314     def finalize_options(self):
   315     def finalize_options(self):
   315         build_py.finalize_options(self)
   316         build_py.finalize_options(self)
   316 
   317 
   317         if self.distribution.pure:
   318         if self.distribution.pure:
   318             self.distribution.ext_modules = []
   319             self.distribution.ext_modules = []
       
   320         elif self.distribution.cffi:
       
   321             exts = []
       
   322             # cffi modules go here
       
   323             self.distribution.ext_modules = exts
   319         else:
   324         else:
   320             h = os.path.join(get_python_inc(), 'Python.h')
   325             h = os.path.join(get_python_inc(), 'Python.h')
   321             if not os.path.exists(h):
   326             if not os.path.exists(h):
   322                 raise SystemExit('Python headers are required to build '
   327                 raise SystemExit('Python headers are required to build '
   323                                  'Mercurial but weren\'t found in %s' % h)
   328                                  'Mercurial but weren\'t found in %s' % h)