views:

199

answers:

1

I have a python package with some C code needed to build an extension (with some non-trivial building needs). I have used SCons as my build system because it's really good and flexible.

I'm looking for a way to compile my python extensions with SCons ready to be distributed with distutils. I want that the user simply types setup.py install and get the extension compiled with SCons instead of the default distutils build engine.

An idea that comes to mind is to redefine build_ext command in distutils, but I can't find extensive documentation for it.

Any suggestion?

+1  A: 

See the page: http://www.scons.org/wiki/PythonExtensions

I'm using slightly modified version to build pyrex-c extensions for python.

bialix
My question is more about doing that (compiling python extension with) in the setup.py script in the cleanest way possible. In this way I can easily distribute my application.
pygabriel
@pygabriel To compile C extensions you don't need SCons. At all.
bialix