[Pythonmac-SIG] Py2app and shared libraries under Leopard

Ronald Oussoren ronaldoussoren at mac.com
Tue Dec 18 22:20:27 CET 2007


On 18 Dec, 2007, at 20:29, Robin Dunn wrote:

> David Hughes wrote:
>> David Hughes wrote:
>>> .....Built using Distutils under Leopard, the library [/Reportlab's
>>> _Render.pm]/ is working exactly as intended/expected. However,
>>> comparing the .so file produced, it is under half the size of the  
>>> same
>>> built using Tiger [/and it generates an error when it is include  
>>> in a
>>> Py2app build/] ...
>> I posted this here about a week ago but there were no responses. Am I
>> doing something so incredibly stupid that people are too polite to  
>> point
>> it out??
>
> The difference in size can probably be attributed to different default
> compile/link options, I've seen seen similar 50% differences with wx
> libs even on the same machine and same compiler.  Another  
> possibility is
> that the smaller one is not a universal binary for some reason.
>
> If the error you are getting is "Unknown load command" then you need  
> to
> get a newer version of the macholib package or egg.

Apple's python on Leopard doesn't build universal binaries by default.  
I've filed a bugreport for this, hopefully it will be fixed in the  
future.

In the meantime you can edit os.path.join(sys.prefix, "lib/python2.5/ 
config/Makefile") and add "-arch ppc -arch x86" to the CFLAGS and  
LDFLAGS definitions.

BTW. "file myext.so" will tell you if an extension is universal and  
which architectures it supports.

Ronald
>
>
> -- 
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig



More information about the Pythonmac-SIG mailing list