[GRASS5] Shared Libraries

Glynn Clements glynn.clements at virgin.net
Mon Apr 22 08:31:34 EDT 2002


Bernhard Reiter wrote:

> > > Glynn: Are you using something platform portable like libtool already?
> > 
> > No, and I don't intend to; actually, if GRASS ever starts using
> > libtool, I'm off.
> 
> Any reasons for this?

Primarily the fact that it makes the build process totally
incomprehensible to anyone other than the libtool authors.

With a normal build procedure, the user runs "make", which reads the
makefile, and runs the compiler or linker in a manner which follows
logically from the contents of the makefile.

With libtool, make runs libtool; libtool is FOUR THOUSAND lines of
Bourne-shell script (not the most legible of languages) which,
somewhere in its depths, runs the compiler or linker; usually with
some additional switches (which you never asked for), set somewhere
within the libtool script (good luck trying to find out where,
though).

A secondary reason is that libtool forcibly adds "-rpath" to the
linker switches, which means that the executables have the full path
to the shared libraries hardcoded within them. You cannot move the
shared libraries afterwards (-rpath overrides both ld.so.conf and
$LD_LIBRARY_PATH).

If you want to disable the use of -rpath at build time, it's easier to
modify (or wrap) the linker to ignore it than it is to figure out how
to stop libtool from doing it. If you don't discover the problem until
later, you have to modify the loader (e.g. ld-linux.so) to ignore the
embedded rpath.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list