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._btree_serializer_c')
262
add_pyrex_extension('bzrlib._bencode_pyx')
263
add_pyrex_extension('bzrlib._btree_serializer_pyx')
264
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
263
265
add_pyrex_extension('bzrlib._groupcompress_pyx',
264
266
extra_source=['bzrlib/diff-delta.c'])
265
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
266
add_pyrex_extension('bzrlib._knit_load_data_c')
267
add_pyrex_extension('bzrlib._knit_load_data_pyx')
268
add_pyrex_extension('bzrlib._known_graph_pyx')
267
269
add_pyrex_extension('bzrlib._rio_pyx')
268
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=['z'])
269
270
if sys.platform == 'win32':
270
add_pyrex_extension('bzrlib._dirstate_helpers_c',
271
add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
271
272
libraries=['Ws2_32'])
272
273
add_pyrex_extension('bzrlib._walkdirs_win32')
274
276
if have_pyrex and pyrex_version == '0.9.4.1':
275
277
# Pyrex 0.9.4.1 fails to compile this extension correctly
276
278
# The code it generates re-uses a "local" pointer and
277
279
# calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
278
280
# which is NULL safe with PY_DECREF which is not.)
279
print 'Cannot build extension "bzrlib._dirstate_helpers_c" using'
281
print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
280
282
print 'your version of pyrex "%s". Please upgrade your pyrex' % (
282
284
print 'install. For now, the non-compiled (python) version will'
283
285
print 'be used instead.'
285
add_pyrex_extension('bzrlib._dirstate_helpers_c')
287
add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
286
288
add_pyrex_extension('bzrlib._readdir_pyx')
287
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
290
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
291
ext_modules.append(Extension('bzrlib._patiencediff_c',
292
['bzrlib/_patiencediff_c.c']))
290
295
if unavailable_files:
651
656
# ad-hoc for easy_install
653
658
if not 'bdist_egg' in sys.argv:
654
# generate and install bzr.1 only with plain install, not easy_install one
659
# generate and install bzr.1 only with plain install, not the
655
661
DATA_FILES = [('man/man1', ['bzr.1'])]