Build python interpreter as a shared library

Ray Kelm rhk at newimage.com
Tue Nov 14 01:29:39 EST 2000


I'm using python as an embedded interpreter under, and I dislike the 
idea of linking my app to the static library. I like the way it was
handled for win32 - python exists in a DLL to which your app links.
I am using the same method in Linux as well, mainly for my own 
convenience.

Unforunately, for my own use (with version 1.5.2) I've had to do quite
a bit of hacking to get it to build as a .so. So far version 2.0 seems
better, but I haven't yet built a working 'libPython-2.0.so' file.

So far my patch is only 24 lines, but I'm not yet linking in the 
builtin modules.

My question is this: Why not build python as a shared library on
Linux (and other posix or posix-like systems) and have the python
binary link to that library? With python being embedded into so many
other programs, this seems like a good idea...

Doing this might also help with commonizing the win32 build with the 
other OS's, and cross-compiling the python interpreter could be thrown 
in at the same time.

-Ray





More information about the Python-list mailing list