portability of -Lrelative_directory_name

2008-02-24 Thread Bruno Haible
Hi,

A while ago someone said that if in a build directory I have a (not yet
installed) ../lib/libfoo.la, to link with this library I should *not* use

   libtool ... -L../lib -lfoo

but rather mention the .la file explicitly:

   libtool ... -L../lib ../lib/libfoo.la
or
   libtool ... ../lib/libfoo.la

Now I see the same advice in the second-to-last paragraph of
  http://wiki.finkproject.org/index.php/Fink:Porting_Notes

Is it true that references to non-yet-installed libool libraries should not be
made with -l? If so, it would be worth to document this in the libtool
documentation. I didn't find it there.

Bruno



___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: portability of -Lrelative_directory_name

2008-02-24 Thread Peter O'Gorman
Hi Bruno,

Bruno Haible wrote:
 Hi,
 
 A while ago someone said that if in a build directory I have a (not yet
 installed) ../lib/libfoo.la, to link with this library I should *not* use
 
libtool ... -L../lib -lfoo
 
 but rather mention the .la file explicitly:
 
libtool ... -L../lib ../lib/libfoo.la

Even this will probably end up with the build directory encoded in the
.la file's dependency_libs, the -L../lib will be modified to
-L/absolute/path/to/lib and that added to dependency_libs.

 or
libtool ... ../lib/libfoo.la
 
 Now I see the same advice in the second-to-last paragraph of
   http://wiki.finkproject.org/index.php/Fink:Porting_Notes
 
 Is it true that references to non-yet-installed libool libraries should not be
 made with -l? If so, it would be worth to document this in the libtool
 documentation. I didn't find it there.

I think this is a bug in libtool that it encodes the build directory
into the .la files, however, you are correct, it is a doc bug too, I
will look making a patch to the docs tonight.

Thanks,
Peter
-- 
Peter O'Gorman
http://pogma.com


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: portability of -Lrelative_directory_name

2008-02-24 Thread Roumen Petrov

Bruno Haible wrote:

Hi,

A while ago someone said that if in a build directory I have a (not yet
installed) ../lib/libfoo.la, to link with this library I should *not* use

   libtool ... -L../lib -lfoo

but rather mention the .la file explicitly:

   libtool ... -L../lib ../lib/libfoo.la
or
   libtool ... ../lib/libfoo.la

Now I see the same advice in the second-to-last paragraph of
  http://wiki.finkproject.org/index.php/Fink:Porting_Notes

Is it true that references to non-yet-installed libool libraries should not be
made with -l? If so, it would be worth to document this in the libtool
documentation. I didn't find it there.

Bruno

  


Automake document this in paragraph Program and Library Variables 
xxx_LIBADD and xxx_LDADD

But if project don't use automake may be good libtool to detail too.


Roumen



___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: portability of -Lrelative_directory_name

2008-02-24 Thread Ralf Wildenhues
Hello Bruno,

* Bruno Haible wrote on Sun, Feb 24, 2008 at 02:51:08PM CET:
 
 A while ago someone said that if in a build directory I have a (not yet
 installed) ../lib/libfoo.la, to link with this library I should *not* use
 
libtool ... -L../lib -lfoo
 
 but rather mention the .la file explicitly:
 
libtool ... -L../lib ../lib/libfoo.la
 or
libtool ... ../lib/libfoo.la

You should use the last one, none of the others.

 Is it true that references to non-yet-installed libool libraries should not be
 made with -l? If so, it would be worth to document this in the libtool
 documentation. I didn't find it there.

Quoting info libtool Linking executables:

   (1) However, you should avoid using `-L' or `-l' flags to link
against an uninstalled libtool library.  Just specify the relative path
to the `.la' file, such as `../intl/libintl.la'.  This is a design
decision to eliminate any ambiguity when linking against uninstalled
shared libraries.

This has been documented for eons.

Cheers,
Ralf


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool