~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Marius Kruger
  • Date: 2008-10-03 21:31:00 UTC
  • mfrom: (3763 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3809.
  • Revision ID: amanic@gmail.com-20081003213100-q4rv2l9pn8qto9o0
merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
    from distutils.command.build_ext import build_ext
176
176
else:
177
177
    have_pyrex = True
 
178
    from Pyrex.Compiler.Version import version as pyrex_version
178
179
 
179
180
 
180
181
class build_ext_if_possible(build_ext):
237
238
    add_pyrex_extension('bzrlib._walkdirs_win32',
238
239
                        define_macros=[('WIN32', None)])
239
240
else:
240
 
    add_pyrex_extension('bzrlib._dirstate_helpers_c')
 
241
    if have_pyrex and pyrex_version == '0.9.4.1':
 
242
        # Pyrex 0.9.4.1 fails to compile this extension correctly
 
243
        # The code it generates re-uses a "local" pointer and
 
244
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
 
245
        # which is NULL safe with PY_DECREF which is not.)
 
246
        print 'Cannot build extension "bzrlib._dirstate_helpers_c" using'
 
247
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
 
248
            pyrex_version,)
 
249
        print 'install. For now, the non-compiled (python) version will'
 
250
        print 'be used instead.'
 
251
    else:
 
252
        add_pyrex_extension('bzrlib._dirstate_helpers_c')
241
253
    add_pyrex_extension('bzrlib._readdir_pyx')
242
254
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
243
255