[Distutils] making Extensions more flexible

M.-A. Lemburg mal at lemburg.com
Thu Aug 28 10:34:46 EDT 2003


Stefan Seefeld wrote:
> hi there,
> 
> I'v been having problems with extension compilation and I'm
> looking for ways to enhance the situation.
> 
> Let me start with an extreme case, where I have an existing
> C/C++ library with autotools based build system, and I want
> to provide a python wrapper for that. Let's assume that my
> library doesn't exist stand-alone, i.e. I want to make it
> a python module with minimal changes, i.e. for example only
> a single additional file that provides the interface
> python <-> C/C++.
> 
> That's currently not possible, as the 'build_ext' command
> has a very specific idea of how to process source files into
> a loadable python module.
> 
> How can this be enhanced ? I can of course write my own 'build_ext'
> that is a wrapper around my existing build system, i.e. which
> calls 'configure', 'make', etc.

Right, that's how you'd do it. If you come up with a good
implementation, I'd suggest you post it as patch to SF.

I can't see why you would want build on build_ext for
this, though. Writing a new command from scratch using
the available tools would be much cleaner.

The code for mx_build_unixlib you find in the mxSetup.py
module of egenix-mx-experimental is an example of how this
can be done.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Aug 28 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2003-08-12: Released eGenix mx Extensions for Python 2.3

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::




More information about the Distutils-SIG mailing list