ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
Re: [pyxpcom] pyxpcom on mac, anyone?
by Brendan O'Connor other posts by this author
Aug 18 2005 10:47AM messages near this date
view in the new Beta List Site
Re: [pyxpcom] pyxpcom on mac, anyone? | [pyxpcom] Problems with getService
>  > I think it found the python shared libraries alright.  For the OS X
>  > native python build, which works fine, I had to edit autoconf.mk to
>  > use
>  >
>  > PYTHON_LIBS = -L/usr/lib -lpython2.3
>  
>  That worries me some, you shouldn't be using -l but rather -framework.

Funny thing is, this is the setup for the build that actually works. 
/usr/lib/libpython2.3.dylib
 is symlinked to
/System/Library/Frameworks/Python.framework/Versions/2.3/Python , so
it seems to me at least that -L/-l is doing the same thing as
-F/-framework, just with different naming conventions.


>  > for my local python, configure didn't quite find all the library paths, so I did
>  >
>  > PYTHON_INCLUDES =
>  > -I/Users/osaf/chandler-trunk/chandler/debug/Library/Frameworks/Python.framework/Versions
/2.4/include/python2.4
>  > PYTHON_LIBS = -F/Users/osaf/chandler-trunk/chandler/debug/Library/Frameworks
>  > -framework Python
>  >
>  > and, .../Frameworks/Python.framework/Python is the python shared
>  > library, which, if I understand the OS X ld correctly, gets linked in
>  > via -F and -framework  instead of -L and -l.
>  
>  We didn't do any work towards locating python in a non-standard
>  location.  I'll have to look into what we did to make this use the
>  python in our Komodo.app/Frameworks/Python.framework.  

So it looks like setting those variables at build time did the trick. 
The build log shows that when building lib_xpcom.so it's using the
right -F and -framework.  _xpcom.so is properly linked to my local
python:

~/mozilla% otool -L
od-ch3/dist/SeaMonkeyDebug.app/Contents/MacOS/python/xpcom/_xpcom.so  
                       [19]
od-ch3/dist/SeaMonkeyDebug.app/Contents/MacOS/python/xpcom/_xpcom.so:
        @executable_path/lib_xpcom.dylib (compatibility version 1.0.0,
current version 1.0.0)
        @executable_path/libxpcom.dylib (compatibility version 1.0.0,
current version 1.0.0)
        @executable_path/libxpcom_core.dylib (compatibility version
1.0.0, current version 1.0.0)
        @executable_path/libplds4.dylib (compatibility version 1.0.0,
current version 1.0.0)
        @executable_path/libplc4.dylib (compatibility version 1.0.0,
current version 1.0.0)
        @executable_path/libnspr4.dylib (compatibility version 1.0.0,
current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.0.0)
        /Users/osaf/chandler-trunk/external/debug/Library/Frameworks/Python.framework/Versio
ns/2.4/Python
(compatibility version 2.4.0, current version 2.4.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0,
current version 7.3.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 1.0.0)
        /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current
version 92.0.0)

In fact, the successful build that uses OS X
/System/Frameworks/Python.framework has the exactly same otool -L
output, except for the path to the framework library.

The differences between mine and your listings look minor?

Thanks, Brendan



>  I think we do
>  something post build to force the linkage to the executable's python
>  framework.  Our linkage for _xpcom.so looks like:
>  
>  otool -L /Applications/Komodo.app/Contents/MacOS/python/xpcom/_xpcom.so
>  /Applications/Komodo.app/Contents/MacOS/python/xpcom/_xpcom.so:
>           @executable_path/libxpcom.dylib (compatibility version 1.0.0,
>  current version 1.0.0)
>           @executable_path/libplds4.dylib (compatibility version 1.0.0,
>  current version 1.0.0)
>           @executable_path/libplc4.dylib (compatibility version 1.0.0,
>  current version 1.0.0)
>           @executable_path/libnspr4.dylib (compatibility version 1.0.0,
>  current version 1.0.0)
>           /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
>  current version 71.1.3)
>  
>  @executable_path/../Frameworks/Python.framework/Versions/2.4/Python
>  (compatibility version 2.4.0, current version 2.4.0)
>  
>  
>  Regards,
>  Shane
>  
> 

_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Brendan O'Connor
Shane Caraveo
Brendan O'Connor
Shane Caraveo
Trent Mick
Brendan O'Connor
Trent Mick
Brendan O'Connor
Brendan O'Connor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved