[Distutils] distutils questions
Joachim Dahl
joachim at ee.ucla.edu
Thu Sep 8 20:07:04 CEST 2005
Hi,
I have a regular setup script for an extension module using
core.setup. Currently I have to manually run a make script to build
the C object files, and then link them using the Python setup script.
I would like to include the make file into the setup script, and I have
been looking at how to tweak distutils, but I am quite in over my head
here...
My problem is that the C source files are compiled several times into
different object depending on the preprocessor options, and thus
I cannot simply include the source files into the "sources" list in the
Extension module, e.g., as
glpk = Extension('glpk', libraries = ['glpk'],
include_dirs = [ GLPK_INC_DIR ],
library_dirs = [ GLPK_LIB_DIR ],
sources = ['C/glpk.c'] )
extmods += [glpk];
I need the setup script to build the module like this:
gcc -Ddef1 -c foo.c -o foo_def1.o
gcc -Ddef2 -c foo.c -o foo_def2.o
gcc foo_def1.o foo_def2.o -o myext_module.o
Is there currently a (relatively simple) way to include something like
that into a distutils setup script, or is it easier to keep running a
separate
make file to build the different object files before linking?
- Joachim
More information about the Distutils-SIG
mailing list