[Pythonmac-SIG] Newbie Mac Question

Bob Ippolito bob at redivi.com
Fri Oct 8 22:50:26 CEST 2004


On Oct 8, 2004, at 4:42 PM, Karl Merkley wrote:

> I have an application that I am porting to the Mac.  On Linux it 
> requires that I link against libpython.so.  It  appears that Mac OS X 
> 10.3 does not include a libpython.dylib.   I _think_ I would like to 
> stay compatible with the native python on the Mac.  What is the 
> correct method for getting the shared library?  Assuming that I have 
> to build it myself, what set of source do I download and build?  Are 
> there any gotchas that I need to be aware of?

Python on the Mac is built as a framework, which is linked to with 
-framework Python rather than -lpython.  You should be asking distutils 
how to link against Python.  Take a look at:

 >>> import distutils.sysconfig
 >>> distutils.sysconfig.get_config_vars()

I believe the keys used for embedding python are LINKFORSHARED and 
CFLAGSFORSHARED.

-bob


More information about the Pythonmac-SIG mailing list