Пример #1
0
    def __init__(self, *args, **kwargs):
        """ Initialization """
        if kwargs.has_key('depends'):
            self.depends = kwargs['depends'] or []
        else:
            self.depends = []
        _core.Extension.__init__(self, *args, **kwargs)

        # add include path
        included = _posixpath.join('_setup', 'include')
        if included not in self.include_dirs:
            self.include_dirs.append(included)

        # add cext.h to the dependencies
        cext_h = _posixpath.join(included, 'cext.h')
        if cext_h not in self.depends:
            self.depends.append(cext_h)

        _commands.add_option(
            'install_lib',
            'without-c-extensions',
            help_text='Don\'t install C extensions',
            inherit='install',
        )
        _commands.add_finalizer('install_lib', 'c-extensions',
                                _install_finalizer)
        _commands.add_option(
            'build_ext',
            'without-c-extensions',
            help_text='Don\'t build C extensions',
            inherit=('build', 'install_lib'),
        )
        _commands.add_finalizer('build_ext', 'c-extensions', _build_finalizer)
Пример #2
0
Файл: ext.py Проект: AvdN/tdi
    def __init__(self, *args, **kwargs):
        """ Initialization """
        if 'depends' in kwargs:
            self.depends = kwargs['depends'] or []
        else:
            self.depends = []
        _core.Extension.__init__(self, *args, **kwargs)

        # add include path
        included = _posixpath.join('_setup', 'include')
        if included not in self.include_dirs:
            self.include_dirs.append(included)

        # add cext.h to the dependencies
        cext_h = _posixpath.join(included, 'cext.h')
        if cext_h not in self.depends:
            self.depends.append(cext_h)

        _commands.add_option('install_lib', 'without-c-extensions',
            help_text='Don\'t install C extensions',
            inherit='install',
        )
        _commands.add_finalizer('install_lib', 'c-extensions',
            _install_finalizer
        )
        _commands.add_option('build_ext', 'without-c-extensions',
            help_text='Don\'t build C extensions',
            inherit=('build', 'install_lib'),
        )
        _commands.add_finalizer('build_ext', 'c-extensions', _build_finalizer)
Пример #3
0
 def fixup_commands(self):
     _commands.add_option(
         'install_data',
         'without-docs',
         help_text='Do not install documentation files',
         inherit='install',
     )
     _commands.add_finalizer('install_data', 'documentation', finalizer)
Пример #4
0
        def __init__(self, *args, **kwargs):
            Extension.__init__(self, *args, **kwargs)

            macro = ('TDI_AVOID_GC', None)
            self.define_macros.append(macro)
            def finalizer(d, s=self, m=macro):
                if d.with_full_gc:
                    if m in s.define_macros:
                        s.define_macros.remove(m)

            _commands.add_option('install_lib', 'with-full-gc',
                help_text='Enable full garbage collection',
                inherit='install',
            )
            _commands.add_finalizer('install_lib', 'full-gc', finalizer)
            _commands.add_option('build_ext', 'with-full-gc',
                help_text='Enable full garbage collection',
                inherit=('build', 'install_lib'),
            )
            _commands.add_finalizer('build_ext', 'full-gc', finalizer)
Пример #5
0
 def fixup_commands(self):
     _commands.add_option('install_data', 'without-docs',
         help_text='Do not install documentation files',
         inherit='install',
     )
     _commands.add_finalizer('install_data', 'documentation', finalizer)