Mailing List Archive

Python as a shared library on Unix
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.

I know how to get the modules built as shared libraries but cannot get
Python built as a shared library.

--
Paul Duffin
DT/6000 Development Email: pduffin@hursley.ibm.com
IBM UK Laboratories Ltd., Hursley Park nr. Winchester
Internal: 7-246880 International: +44 1962-816880
Python as a shared library on Unix [ In reply to ]
Paul Duffin <pduffin@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.

Not really. For a start look at

http://x35.deja.com/[ST_rn=ps]/getdoc.xp?AN=468116075&CONTEXT=929108272.1543635130&hitnum=0

HTH
Michael

> I know how to get the modules built as shared libraries but cannot get
> Python built as a shared library.
>
> --
> Paul Duffin
> DT/6000 Development Email: pduffin@hursley.ibm.com
> IBM UK Laboratories Ltd., Hursley Park nr. Winchester
> Internal: 7-246880 International: +44 1962-816880
Python as a shared library on Unix [ In reply to ]
--pgp-sign-Multipart_Fri_Jun_11_10:39:50_1999-1
Content-Type: text/plain; charset=US-ASCII

Then <mwh21@cam.ac.uk> spoke up and said:
> Paul Duffin <pduffin@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@cmu.edu for my public key. |
=====================================================================

--pgp-sign-Multipart_Fri_Jun_11_10:39:50_1999-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.3, an Emacs/PGP interface

iQBVAwUBN2Eft4dzVnzma+gdAQFU1gIAjkB0cAoVrajQkmkZGFssRTiSSfUdzV72
teh5+m0/hcfKjp/udobO5MZ2yQlMKIK97DH1rBeKfpYljA+S4IHuog==
=R5bK
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Fri_Jun_11_10:39:50_1999-1--