Re: storage-modules libtool hackery



On Tue, Apr 17, 2001 at 09:02:03AM -0400, jacob berkman wrote:
> > which is presumably a hack to link one shared library against another
> > uninstalled shared library (which libtool does not support). This idiom
> > breaks in CVS versions of libtool, although taking out the ".libs" makes
> > it work.
> > 
> > (The reason libtool doesn't support this is that on some OSes, if you
> > link a library against a shared library in the build tree, the resulting
> > library will hardcode that path and require that the dependent shared
> > library is still there in the build tree at runtime. I don't know if
> > this includes any OSes that GNOME builds on though.)
> 
> hp-ux.

	The libtool folks often also use AIX as a platform for this
argument.  However, this argument doesn't hold (at least for AIX).
While it is true that AIX's linker encodes the -L directories as a
search path, this can be overwritten with the -blibpath linker argument.
My copy of libtool for AIX (kinda old now) properly handles that, using
.la archives to decide where every library will be *after* installation,
and links it as such:

ld -o libgtk1-2.so.0 -L ../gdk/.libs -lgdk1-2 \
	-blibpath:/usr/local/lib:/usr/lib:/lib

This properly links against the not-yet-installed libgdk in
../gdk/.libs, but encodes the path "/usr/local/lib:/usr/lib:/lib" in the
resulting libgtk1-2.so.0 object.
	The hp-ux linker would appear to support identical operation
with the +b option.  Linux, Solaris, and IRIX support this with -rpath, if I
understand their linkers correctly.  This covers most of the major
platforms, even given HP-UX and AIX's quirkiness.
	Why the libtool folks haven't gone here I don't know.  I tried
to get a patch in when I worked it out for AIX a while back, but they
made major revisions and I didn't have the time to keep in sync.  I
don't have an AIX machine anymore anyway, so that's kinda moot.  But
unless I misunderstand the +b option to the HP-UX linker, this is very
doable.

Joel


-- 

Life's Little Instruction Book #43

	"Never give up on somebody.  Miracles happen every day."

			http://www.jlbec.org/
			jlbec evilplan org




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