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
ext_modules.append(Extension(module_name, [pyrex_name],
251
define_macros=define_macros, libraries=libraries))
250
source = [pyrex_name]
253
252
if not os.path.isfile(c_name):
254
253
unavailable_files.append(c_name)
256
ext_modules.append(Extension(module_name, [c_name],
257
define_macros=define_macros, libraries=libraries))
260
add_pyrex_extension('bzrlib._btree_serializer_c')
257
source.extend(extra_source)
258
ext_modules.append(Extension(module_name, source,
259
define_macros=define_macros, libraries=libraries))
262
add_pyrex_extension('bzrlib._annotator_pyx')
263
add_pyrex_extension('bzrlib._bencode_pyx')
264
add_pyrex_extension('bzrlib._btree_serializer_pyx')
261
265
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
262
add_pyrex_extension('bzrlib._knit_load_data_c')
266
add_pyrex_extension('bzrlib._groupcompress_pyx',
267
extra_source=['bzrlib/diff-delta.c'])
268
add_pyrex_extension('bzrlib._knit_load_data_pyx')
269
add_pyrex_extension('bzrlib._known_graph_pyx')
270
add_pyrex_extension('bzrlib._rio_pyx')
263
271
if sys.platform == 'win32':
264
add_pyrex_extension('bzrlib._dirstate_helpers_c',
272
add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
265
273
libraries=['Ws2_32'])
266
274
add_pyrex_extension('bzrlib._walkdirs_win32')
268
277
if have_pyrex and pyrex_version == '0.9.4.1':
269
278
# Pyrex 0.9.4.1 fails to compile this extension correctly
270
279
# The code it generates re-uses a "local" pointer and
271
280
# calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
272
281
# which is NULL safe with PY_DECREF which is not.)
273
print 'Cannot build extension "bzrlib._dirstate_helpers_c" using'
282
print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
274
283
print 'your version of pyrex "%s". Please upgrade your pyrex' % (
276
285
print 'install. For now, the non-compiled (python) version will'
277
286
print 'be used instead.'
279
add_pyrex_extension('bzrlib._dirstate_helpers_c')
288
add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
280
289
add_pyrex_extension('bzrlib._readdir_pyx')
281
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']))
284
296
if unavailable_files:
597
609
# TORTOISE_OVERLAYS_MSI_WIN32 must be set to the location of the
598
610
# TortoiseOverlays MSI installer file. It is in the TSVN svn repo and
599
611
# can be downloaded from (username=guest, blank password):
600
# http://tortoisesvn.tigris.org/svn/tortoisesvn/TortoiseOverlays/version-1.0.4/bin/TortoiseOverlays-1.0.4.11886-win32.msi
612
# http://tortoisesvn.tigris.org/svn/tortoisesvn/TortoiseOverlays
613
# look for: version-1.0.4/bin/TortoiseOverlays-1.0.4.11886-win32.msi
601
614
# Ditto for TORTOISE_OVERLAYS_MSI_X64, pointing at *-x64.msi.
602
615
for needed in ('TORTOISE_OVERLAYS_MSI_WIN32',
603
616
'TORTOISE_OVERLAYS_MSI_X64'):
617
url = ('http://guest:@tortoisesvn.tigris.org/svn/tortoisesvn'
604
619
if not os.path.isfile(os.environ.get(needed, '<nofile>')):
605
raise RuntimeError("Please set %s to the"
606
" location of the relevant TortoiseOverlays"
607
" .msi installer file" % needed)
621
"\nPlease set %s to the location of the relevant"
622
"\nTortoiseOverlays .msi installer file."
623
" The installers can be found at"
625
"\ncheck in the version-X.Y.Z/bin/ subdir" % (needed, url))
608
626
get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
609
627
gui_targets, data_files)