[Pythonmac-SIG] Python shared libraries

Bob Ippolito bob at redivi.com
Wed Sep 10 05:04:54 EDT 2003


On Wednesday, Sep 10, 2003, at 03:35 America/New_York, Mark Easton  
wrote:

> Guys,
>
> Following for a brief email conversation with Jack Jansen, I would like
> to pose some questions to this list, although first of all let me
> mention the background to my questions is as follows:
>
> I'm in the middle of writing some material on getting .NET working on
> Mac OS X and am trying to get PythonNET to run on Mac OS X, which
> requires a shared version of the libpython2.3.a library.  I know
> Python 2.3 allows --enable-shared to be used with ./configure, but when
> I try this on Mac OSX it doesn't do squat.

You want the framework.

>
> I then installed the binary MacPython, expecting a framework to be
> installed but can't for the life of me see where the framework was
> installed to.  My first question is therefore where is the MacProlog
> Framework stored?

The binary installer for MacPython puts the framework at  
/Library/Frameworks/Python.framework
(or maybe ~/Library/Frameworks/Python.framework, if it has a user-local  
installation option)

> Now, I know that to get PythonNET working with Portable .NET I need
> access to the Python library through NSCreateObjectFileImageFromFile  
> (or
> possibly NSAddImage) so my second question is, can the MacProlog
> framework be called using either of these mechanisms?  It's my
> understanding that a framework is just a well packaged slew of files,  
> so
> assuming the MP framework contains a shared library I would guess this
> might be possible.
>
> Finally, assuming the framework is out of the picture, then can anyone
> tell me how to go about building a naked shared library for Prolog?

What and where is MacProlog?  What does it have to do with Python?   
What exactly are you doing?

NSCreateObjectFileImageFromFile should work fine to lookup symbols from  
bundles.. if you look at Python/dynload_next.c you'll see that's the  
same mechanism it uses.
If you're trying to talk to Python itself (by way of framework)  
dynamically, you probably want to use CFBundle:   
http://developer.apple.com/documentation/CoreFoundation/Reference/ 
CFBundleRef/

-bob




More information about the Pythonmac-SIG mailing list