[Distutils] Installing built C extensions

David Cournapeau david at ar.media.kyoto-u.ac.jp
Thu Mar 26 07:22:04 CET 2009


Hi,

    Following one discussion on the python-dev ML, here is one of my
recent frustration with distutils. I have a pure C library (pure meaning
it does not use the python C API in any way) which I want to install so
that other python packages can use it:

from distutils.core import setup

# How to install libfoo.a/foo.lib in say pkg_dir/lib ?
setup(name='yo', libraries=[('foo', {'sources': ['foo.c']})])

I install headers in pkg_dir/include (for example
site-packages/foo/include/foo.h), and I want to install foo lib in
site-packages/foo/lib. I can't easily retrieve the library file in the
build dir from setup.py, so I can't use install_data (and libraries are
not data anyway),

cheers,

David


More information about the Distutils-SIG mailing list