compiling extension modules with 'make'
hi there, I'v repeatedly tried to convert build systems of my python projects to distutils. As they contain C++ extensions with non-trivial build commands, I failed to get these modules to compile using the default 'Extension(...)' mechanism. I'm now wondering what ways exist to extend distutils such that I can hook up to the old autoconf/make based builds for individual extension modules without the need for manual intervention. I'v seen some packages derive from distutils classes such as distutils.core.Distribution (for example the 4Suite tool) but that looks quite complex so I'm looking for either a simpler way, or some reference manual explaining how to get started. Any hints / links are highly appreciated ! Stefan
Stefan Seefeld wrote:
hi there,
I'v repeatedly tried to convert build systems of my python projects to distutils. As they contain C++ extensions with non-trivial build commands, I failed to get these modules to compile using the default 'Extension(...)' mechanism.
I'm now wondering what ways exist to extend distutils such that I can hook up to the old autoconf/make based builds for individual extension modules without the need for manual intervention.
I'v seen some packages derive from distutils classes such as distutils.core.Distribution (for example the 4Suite tool) but that looks quite complex so I'm looking for either a simpler way, or some reference manual explaining how to get started.
Any hints / links are highly appreciated !
If you're looking for examples on how this can be done, have a look at mxSetup.py in the egenix-mx-experimental package -- that package builds C libraries which are then used by Python wrappers in C. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Aug 24 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 ! ::::
M.-A. Lemburg wrote:
If you're looking for examples on how this can be done, have a look at mxSetup.py in the egenix-mx-experimental package -- that package builds C libraries which are then used by Python wrappers in C.
thanks ! That's certainly a good start. I didn't even know there is a 'config' command (skeleton). That looks as it could serve. What's the best way to generate files (headers, python scripts, etc.) by means of a 'config' command such that these generated files contain settings that can later be used by C code as well as python modules (paths, for example) ? Regards, Stefan PS: the distutils documentation is really sparse...:-(
participants (2)
-
M.-A. Lemburg
-
Stefan Seefeld