[Pythonmac-SIG] Python C extensions that depend on dynamic libraries

Chris Barker Chris.Barker at noaa.gov
Mon Jan 12 13:20:58 EST 2004


FWIW, here is a quotation from:

Mac OS- X for Unix Geeks (O'Reilly)

Shared Libraries Versus Loadable Modules

"""
... shared libraries and loadable modules are not the same on OS-X.... 
Mack-O shared libraries have the file type MH_DYLIB and .dylib suffix 
and can be linked with static linker flags. So, of you have a shared 
library named libcool.dylib, you can link to this library by specifying 
the -lcool flag. Although shared libraries cannot be loaded dynamically 
as modules, they can be loaded through the dyld API (see the manpage for 
dyld, the dynamic link editor). It is important to point out that shared 
libraries cannot be unloaded.

Loadable modules, called bundles in OS-X, have the file type MH_BUNDLE. 
Most Unix-based software ports usually produce bundles with a .so 
extension, for the sake of consistancy across platforms. Although Apple 
recommends giving bundles a .bundle extension, it isn't mandatory.

"""

Frankly, I'm still confused, but I think that means that what we are 
making is a bundle, and if we want it native-ish, we call it *.bundle, 
and if we want it unix-ish we call it *.so, and if we want it Python-ish 
we call it *.pyd or something like that. Personally, I vote *.so, like 
linux, so I can use the same scripts to move them around. Why make up 
another extension?

Mostly, I don't care however, I'll be using distutils anyway, and I 
assume it will do "the right thing"-- whatever that ends up being.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Pythonmac-SIG mailing list