I\'m trying to build a Python extension on MacOSX 10.6 and to link it against several frameworks (i386 only). I made a setup.py file, using distutils and the Extension object.>
This has nothing to do with the undefined dynamic_lookup but all with distutils. It appends the extra_link_flags to the link flags it chooses for python building. Instead it should prepend it because the -framework listings must come before the objects that use them on the cmdline (AFAIK this is due how gcc gathers symbols for linking). A quick fix that I personally use is building with
LDFLAGS="-framework Carbon" python setup.py build_ext --inplace
or whatever frameworks you need. LDFLAGS is prepended to distutils own flags. Note that your package will not be pip install
able. A proper fix can only come from distutils - imho they should support frameworks
like they support libraries
.
Alternatively, you can also add
import os
os.environ['LDFLAGS'] = '-framework Carbon'
in your setup.py. Your package should then be pip install
able.