User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030902 Thunderbird/0.2
Patrick Chkoreff wrote:
> On Tuesday, November 4, 2003, at 04:39 PM, Scott Lamb wrote:
>
>> On Nov 4, 2003, at 12:27 PM, Scott Lamb wrote:
>>
>>> 3) dynamically loading libraries. libgaim builds its prpls (protocol
>>> plugins) to load dynamically via gmodule (which does a dlopen() and
>>> similar, I assume). I can't get them to load; it always says it can't
>>> find the protocol plugin.
>
Depending on the version of gmodule, it either uses NSLinkModule (gnome
2) or dlopen (gnome 1.4).
>
> My programming language Fexl also relies on dlopen-style dynamic
> libraries, and I've recently been porting it to Mac OSX and going
> through the trial by fire.
>
> Forgive me if my comments here seem to be "random observations," I
> suppose that's what they are.
To build a loadable library on Mac OS X using gnu libtool, first you
should make sure that you have a working libtool. The one shipping with
panther is gnu libtool 1.5 with some apple patches. Run libtoolize
--force --copy as well as the other auto tools to regenerate configure
and all the Makefile.in's. That done, you may need to edit a couple of
Makefile.am's. If you want your library to be loadable, you will need to
add "-module" to the libfoo_la_LDFLAGS. This is normally used in
conjunction with "-avoid-version". When building a libfoo.la with the
-module flag, libtool will set the extension to .so and build a Mach-O
bundle. Without the -module flag, it will build a "Shared Library". Only
bundles may be opened with NSObjectFileImage/NSLinkModule, however
Shared libraries may be added at runtime using NSAddImage and/or
NSAddLibrary. The dlopen available on panther can open both types, but
works best with "bundles".
Hope this helps,
Peter
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.