[Pythonmac-SIG] Python shared libraries

Mark Easton mark.easton at blinksoftware.co.uk
Wed Sep 10 17:14:04 EDT 2003


Bob,

Thanks for the thorough response.  Firstly, sorry for slipping and
mentioning MacProlog.  It has nothing to do with what I'm doing, but
crept out of the recesses of my mind - possibly as I learnt Prolog on a
Mac nigh on 10 years ago.

Having previously looked long and hard in /System/Library/Frameworks to
no avail, your response has lead me to exactly the right location for
the MacPython framework, and now I've looked through these frameworks
I've seen that they're a great idea.  However, I've looked at the
Python.framework and seen that it does not contain a shared library
which is what I really need.

Some background:

PythonNET enables Python scripts to call .NET assemblies by wrapping a
Python console within a .NET program, which it does by referencing
python as a shared library.  Now Python running on Windows comes with a
shared library/DLL and Python on GNU/Linux allows one to be built
(libPython2.x.so) if you install it with:
./configure --enable-shared
make 
make install

So I need some means to create a shared version of the Python library on
MacOSX which I would expect would be called something like
libpython.2.x.dylib.  When I build Python manually using the same
commands as for Linux everything is fine, apart from the fact that I
don't get a shared library.  When I install MacProlog from binary I get
a framework, but it doesn't contain a shared library so I'm still none
the wiser.

Now if I knew enough about Mac OS X development I'd try and build my own
shared library by ar'ing the libpython2.3.a file and then compiling the
object files into a shared library - in actual fact I started with this
approach - but as the dev tools are a little unfamiliar I cannot get gcc
to anything more than groan at me!

So if anyone can give me a helping hand with how to build a Mac OS X
version of the Python shared library then I will be over the moon.  If
not it looks like its time to bury my head and get down to some good old
tinkering with gcc

Cheers

Mark






More information about the Pythonmac-SIG mailing list