~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

Bring the groupcompress code into brisbane-core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
unavailable_files = []
225
225
 
226
226
 
227
 
def add_pyrex_extension(module_name, libraries=None):
 
227
def add_pyrex_extension(module_name, libraries=None, extra_source=[]):
228
228
    """Add a pyrex module to build.
229
229
 
230
230
    This will use Pyrex to auto-generate the .c file if it is available.
247
247
        # right value.
248
248
        define_macros.append(('WIN32', None))
249
249
    if have_pyrex:
250
 
        ext_modules.append(Extension(module_name, [pyrex_name],
251
 
            define_macros=define_macros, libraries=libraries))
 
250
        source = [pyrex_name]
252
251
    else:
253
252
        if not os.path.isfile(c_name):
254
253
            unavailable_files.append(c_name)
 
254
            return
255
255
        else:
256
 
            ext_modules.append(Extension(module_name, [c_name],
257
 
                define_macros=define_macros, libraries=libraries))
 
256
            source = [c_name]
 
257
    source.extend(extra_source)
 
258
    ext_modules.append(Extension(module_name, source,
 
259
        define_macros=define_macros, libraries=libraries))
258
260
 
259
261
 
260
262
add_pyrex_extension('bzrlib._btree_serializer_c')
 
263
add_pyrex_extension('bzrlib._groupcompress_pyx',
 
264
                    extra_source=['bzrlib/diff-delta.c'])
261
265
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
262
266
add_pyrex_extension('bzrlib._knit_load_data_c')
263
267
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=['z'])