Reputation: 140786
I am writing a Python package that, in normal operation, needs to run a helper program that's written in C. The helper program ships as part of the package, and it doesn't make sense to try to run it independently.
How do I persuade Distutils to compile, and install to an appropriate location, an independent C program rather than a C extension module?
How should the Python part of the code locate and start the helper program?
N.B. Porting the actual code (especially the C helper) to Windows would necessitate a >90% rewrite, so I only care about making installation work on Unix.
Upvotes: 1
Views: 74
Reputation: 22914
This is pretty interesting. I've never done this, but I think you can use the distutils compiler directly.
I checked out github for some possible examples that might give you inspiration. Check out this one
The filter I used was distutils ccompiler language:python filename:setup.py
in case you want to extend it/trim it down
Upvotes: 1