Python as a shared library on Unix

Brian E Gallew geek+ at cmu.edu
Fri Jun 11 10:39:51 EDT 1999


Then <mwh21 at cam.ac.uk> spoke up and said:
> Paul Duffin <pduffin at mailserver.hursley.ibm.com> writes:
> 
> > Is it possible to build Python itself as a small executable and a
> > shared library, rather than an archive library which of
> > course results in a monolithic executable. 

Sure it is.  I've done it.  The problem is, doing this is even more
platform dependent than just building shared libraries.  When I did
it, it was a "by-hand" process, where I manually modified some files,
forced all object files to be relocatable code, manually converted
libpython.a to libpython.so.1.5.2, and so on.  What makes this
difficult is that some Modules want to reference things in libpython,
and sometimes it means linking the modules against -lpython, and
sometimes not.  It's ugly, and not for the faint of heart.  Further,
the utility of such a hack quickly became questionable for me,
considering that I'm never embedding python itself.

-- 
=====================================================================
| JAVA must have been developed in the wilds of West Virginia.      |
| After all, why else would it support only single inheritance??    |
=====================================================================
| Finger geek at cmu.edu for my public key.                            |
=====================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 266 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/19990611/1c1095d3/attachment.sig>


More information about the Python-list mailing list