libtool
[Top][All Lists]
Advanced

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

Re: linking modules into programs problem


From: Christoph Pfisterer
Subject: Re: linking modules into programs problem
Date: Mon, 19 Mar 2001 17:40:01 +0100

Michael Matz wrote:

On Mon, 19 Mar 2001, Nick Hudson wrote:

 > Having need_lib_prefix to yes does allow modules to be linked into
 libraries and binaries, but again this is counter intuitive as
 libraries are linked in not modules.

I agree in some way.  But libtool's purpose is to behave everywhere the
same way (as circumstances permit), and as on some platforms modules can
be linked...

As you mention, some platforms allow this, others don't. The purpose of libtool in my eyes is to provide a common denominator for as much platforms as possible.

 > I would agree with Alexandre and say that libtool should issue a warning or
 error if something attempt's to link in a module.

But on many systems this is allowed, so an error would seem strange.

Well, there _are_ systems where linking in modules as if they were shared libraries is not only not allowed, but impossible. One example is Darwin (a.k.a. the open-sourced, BSD- and Mach-based kernel of Mac OS X). It uses the Mach-O file format, which differentiates between shared libraries (file type MH_DYLIB) and modules (file type MH_BUNDLE). Only the libraries can be linked against and only the modules can be dlopen()'ed.

And
given, that libtool can mimic this behaviour also on platforms needing lib
prefix, why should it barf?  OK, I also have another reason ;) : If
libtool would prevent modules from being linked into executables, we would
link many of our (KDE-) modules two time (as modules and as lib), thereby
doubling the binary size, for no good reason (and all the Makefile.am
would need fixing, doh ;) )

Hmmm, and I had hoped porting KDE to Darwin would be easy...

-chrisp

--
chrisp a.k.a. Christoph Pfisterer   "Any sufficiently advanced
address@hidden - http://chrisp.de      bug is indistinguishable
PGP key & geek code available        from a feature."



reply via email to

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