[PyQt] Python modules shouldn't link directly to Python framework on OS X

William Kyngesburye woklist at kyngchaos.com
Sat Nov 15 05:33:59 GMT 2008


Python extensions on OS X are built as bundles, and are expected to be  
loaded dynamically by Python or another program that is linked to the  
Python framework.  The extension expects to find all the Python  
symbols already loaded.

SIP gets the -bundle flag right, but also links directly to the Python  
framework.

The nice benefit of this is that we can compile an extension with one  
build of Python (say the Leopard system Python 2.5.1), then install a  
newer (point version) Python and have the extension loadable in the  
newer Python.  Or distribute the extension where others might have  
installed a newer version of Python.

This will take care of not-linking the python framework - in  
siputils.py, ModuleMakefile().finalise(), change:

self.LFLAGS.append("-F%s" % string.join(dl, os.sep))
self.LFLAGS.append("-framework Python")

to:

self.LFLAGS.append("-undefined dynamic_lookup")


-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

First Pogril: Why is life like sticking your head in a bucket filled  
with hyena offal?
Second Pogril: I don't know.  Why IS life like sticking your head in a  
bucket filled with hyena offal?
First Pogril: I don't know either.  Wretched, isn't it?

-HitchHiker's Guide to the Galaxy




More information about the PyQt mailing list