libtool
[Top][All Lists]
Advanced

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

Linking with relocated libraries


From: psmith
Subject: Linking with relocated libraries
Date: Thu, 5 Feb 2004 14:18:08 -0500

I have a situation where I'm constructing a filesystem image, and I need
to use the contents of that image to build new packages to be installed
in the image.  For example, I have $ROOT, which might be something like
/usr/local/images or whatever.

Under $ROOT will be a complete image of a working filesystem, so I'll
have $ROOT/etc, $ROOT/usr/bin, $ROOT/var, etc. etc.

The thing about this image is that I will be taking it and actually
booting off of it: at _runtime_  the paths will be /usr/lib, not
$ROOT/usr/lib.


When I'm building packages to be placed into that image, I need to link
with libraries in $ROOT/usr/lib (for example), but at runtime those
libraries will be at /usr/lib.


I have this all working very well for many packages, but now I'm trying
to get a package set up that uses glib, and glib was installed with
libtool.  I can't figure out how to make this work in this situation.

The problem is when libtool is invoked by my package (Ethereal in this
case) it looks like this:

  /bin/sh ../../libtool --mode=link powerpc-unknown-linux-gnu-3.2.3-gcc  
-D_U_="__attribute__((unused))" -Wall -W 
-I/localdisk/viewstore/images/ppc-mse-stable/usr/include/glib-1.2 
-I/localdisk/viewstore/images/ppc-mse-stable/usr/lib/glib/include  
-I/usr/include/glib-1.2 -I/usr/lib/glib/include  
-L/localdisk/viewstore/images/ppc-mse-stable/usr/lib -lglib -L/usr/local/lib 
-L/usr/local/lib -o lemon  lemon.o  -lz 

Note how the first -L has the proper pathname, to my $ROOT/usr/lib.
Now, libtool does this:

  mkdir .libs
  powerpc-unknown-linux-gnu-3.2.3-gcc "-D_U_=__attribute__((unused))" -Wall -W 
-I/localdisk/viewstore/images/ppc-mse-stable/usr/include/glib-1.2 
-I/localdisk/viewstore/images/ppc-mse-stable/usr/lib/glib/include 
-I/usr/include/glib-1.2 -I/usr/lib/glib/include -o lemon lemon.o  
-L/localdisk/viewstore/images/ppc-mse-stable/usr/lib /usr/lib/libglib.so 
-L/usr/local/lib -lz
  /usr/lib/libglib.so: could not read symbols: Invalid operation

Note how the path to glib can been changed from -lglib, to
"/usr/lib/libglib.so", ignoring my -L setting.  And of course, this is
the wrong one so it fails.

I've never developed with libtool before (although I know
autoconf/automake very well): I read the libtool manual but I'm not sure
what's going on here: somehow libtool is coming up with "/usr/lib"
instead of my $ROOT/usr/lib.  Where is that coming from, and how do I
override it?

And, does anyone have any suggestions for working with libtool in an
environment such as I describe above?


Thanks!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>   HASMAT: HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.




reply via email to

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