242
242
c_name = path + '.c'
243
243
define_macros = []
244
244
if sys.platform == 'win32':
245
# pyrex uses the macro WIN32 to detect the platform, even though it should
246
# be using something like _WIN32 or MS_WINDOWS, oh well, we can give it the
245
# pyrex uses the macro WIN32 to detect the platform, even though it
246
# should be using something like _WIN32 or MS_WINDOWS, oh well, we can
247
# give it the right value.
248
248
define_macros.append(('WIN32', None))
250
250
source = [pyrex_name]
259
259
define_macros=define_macros, libraries=libraries))
262
add_pyrex_extension('bzrlib._annotator_pyx')
262
263
add_pyrex_extension('bzrlib._bencode_pyx')
263
add_pyrex_extension('bzrlib._btree_serializer_c')
264
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=['z'])
264
add_pyrex_extension('bzrlib._btree_serializer_pyx')
265
265
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
266
266
add_pyrex_extension('bzrlib._groupcompress_pyx',
267
267
extra_source=['bzrlib/diff-delta.c'])
268
add_pyrex_extension('bzrlib._knit_load_data_c')
268
add_pyrex_extension('bzrlib._knit_load_data_pyx')
269
add_pyrex_extension('bzrlib._known_graph_pyx')
269
270
add_pyrex_extension('bzrlib._rio_pyx')
270
271
if sys.platform == 'win32':
271
add_pyrex_extension('bzrlib._dirstate_helpers_c',
272
add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
272
273
libraries=['Ws2_32'])
273
274
add_pyrex_extension('bzrlib._walkdirs_win32')
275
277
if have_pyrex and pyrex_version == '0.9.4.1':
276
278
# Pyrex 0.9.4.1 fails to compile this extension correctly
277
279
# The code it generates re-uses a "local" pointer and
278
280
# calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
279
281
# which is NULL safe with PY_DECREF which is not.)
280
print 'Cannot build extension "bzrlib._dirstate_helpers_c" using'
282
print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
281
283
print 'your version of pyrex "%s". Please upgrade your pyrex' % (
283
285
print 'install. For now, the non-compiled (python) version will'
284
286
print 'be used instead.'
286
add_pyrex_extension('bzrlib._dirstate_helpers_c')
288
add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
287
289
add_pyrex_extension('bzrlib._readdir_pyx')
288
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
291
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
292
ext_modules.append(Extension('bzrlib._patiencediff_c',
293
['bzrlib/_patiencediff_c.c']))
291
296
if unavailable_files:
652
657
# ad-hoc for easy_install
654
659
if not 'bdist_egg' in sys.argv:
655
# generate and install bzr.1 only with plain install, not easy_install one
660
# generate and install bzr.1 only with plain install, not the
656
662
DATA_FILES = [('man/man1', ['bzr.1'])]