libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fink-devel] OS/X Libtool && -bundle


From: Ben Hines
Subject: Re: [Fink-devel] OS/X Libtool && -bundle
Date: Wed, 5 Feb 2003 23:19:30 -0800


On Wednesday, February 5, 2003, at 10:46  PM, Robert Boehne wrote:
In an older version of Libtool, a library built with -module is
linked with:
cc -flat_namespace -undefined suppress -o .libs/libdb_tcl-4.2.so *.lo
-lc -dynamiclib -install_name
/Users/rboehne/testdb/lib/libdb_tcl-4.2.so

That is wrong, that was a bug in libtool. Thats a shared library, not a bundle.



But this method doesn't seem to work:
[dsl092-075-147:~/new-db-4.2.8/build_unix] rboehne% file
..libs/libdb_tcl-4.2.so
..libs/libdb_tcl-4.2.so: Mach-O bundle ppc
[dsl092-075-147:~/new-db-4.2.8/build_unix] rboehne% ./libtool --version
ltmain.sh (GNU libtool) 1.4e (1.1182 2003/01/29 04:57:52)


Actually, that is correct. libtool works fine. modules are type bundle.



It looks to me like this should work, a module should be dlopen-able,
wheras
a Libtool library not built with -module may not.  If I take out the
-module
from the link line, I get .libs/libdb_tcl-4.2.dylib and tclsh is able to
dlopen it.  Part of what really troubles me is that "file" doesn't
return

You aren't supposed to be dlopening dylibs, though it is possible.


the same thing on the libraries. I do notice that "file" gives the same
result I'm getting on all the *.so files under /usr/lib/ though.

So am I supposed to be able to dlopen() a "bundle", and if not, what can
be done with it?  I'm confused.

Mach-O "bundles" (tyee MH_BUNDLE) are libtool -modules (shared modules) on OS X. Mach-O "shared libraries" (type MH_DYLIB) are different. On linux, they are the same.

Dyanmic libraries get the extension "dylib"
Modules get the extension ".so"

You can dlopen dylibs, but you can only dlclose() bundles. You cannot close a MH_DYLIB once it is opened.

See "man ld" for (much) more info than i can give. :)

btw, i think the bind_at_load two-step stuff is only need for C++. It shouldn't be in the C part of libtool. pogma?

If you are trying to build tcltk, you might need the fink patches to the makefile. See
/sw/fink/10.2/unstable/main/finkinfo/languages/tcltk-8.3.4-1.info and
/sw/fink/10.2/unstable/main/finkinfo/languages/tcltk-8.3.4-1.patch

-Ben





reply via email to

[Prev in Thread] Current Thread [Next in Thread]