[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Libtool incorrectly adds dependency libs to $deplibs
From: |
Albert Chin |
Subject: |
Re: Libtool incorrectly adds dependency libs to $deplibs |
Date: |
Sun, 8 Feb 2004 17:08:56 -0600 |
User-agent: |
Mutt/1.4i |
On Sun, Feb 08, 2004 at 08:40:20PM +0000, Scott James Remnant wrote:
> On Sun, 2004-02-08 at 19:31, Albert Chin wrote:
>
> > When libtool adds a .la file to $deplibs, it first adds the library
> > name to $deplibs and if $link_all_deplibs=yes, each dependency library
> > is added to the library search path with -L. However, when libtool
> > does this, it places non-duplicated -L paths *before* other $deplibs
> > entries. Why doesn't libtool add the new -L paths *before* the
> > library name entry from the .la file? If we agree this is the correct
> > behavior, patch below.
> >
> Could you give an example of what you mean... Preferably one showing
> the current behaviour and how it breaks something along with your
> modified behaviour and how/why it fixes it.
Say I'm trying to build libpng-1.2.4 on a Solaris 9/SPARC machine with
the Sun C compiler:
$ grep dependency_libs /opt/TWWfsw/zlib11/lib/libz.la
dependency_libs='-L/tmp'
$ /bin/bash ./libtool --mode=link cc -mr -Qn -xstrconst -xO2
-xtarget=generic -xarch=v8 -L/opt/TWWfsw/zlib11/lib -o libpng.la
-rpath /opt/TWWfsw/libpng12/lib -version-info 2:2:0 -module png.lo
pngerror.lo pngget.lo pngmem.lo pngpread.lo pngrio.lo pngread.lo
pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo pngwrite.lo
pngwtran.lo pngwutil.lo -lz -lm
Libtool will expand this to (note that the -L/tmp from dependency_libs
in /opt/TWWfsw/zlib11/lib/libz.la is searched *before* the
-L/opt/TWWfsw/zlib11/lib in the libtool command-line above):
/usr/ccs/bin/ld -G -h libpng.so.2 -o .libs/libpng.so.2.0.2
.libs/png.o .libs/pngerror.o .libs/pngget.o .libs/pngmem.o
.libs/pngpread.o .libs/pngrio.o .libs/pngread.o .libs/pngrtran.o
.libs/pngrutil.o .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o
.libs/pngwrite.o .libs/pngwtran.o .libs/pngwutil.o
-R/opt/TWWfsw/zlib11/lib -R/opt/TWWfsw/zlib11/lib -L/tmp
-L/opt/TWWfsw/zlib11/lib /opt/TWWfsw/zlib11/lib/libz.so -lm -lc
When I think it should expand it to:
/usr/ccs/bin/ld -G -h libpng.so.2 -o .libs/libpng.so.2.0.2
.libs/png.o .libs/pngerror.o .libs/pngget.o .libs/pngmem.o
.libs/pngpread.o .libs/pngrio.o .libs/pngread.o .libs/pngrtran.o
.libs/pngrutil.o .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o
.libs/pngwrite.o .libs/pngwtran.o .libs/pngwutil.o
-R/opt/TWWfsw/zlib11/lib -R/opt/TWWfsw/zlib11/lib
-L/opt/TWWfsw/zlib11/lib -L/tmp /opt/TWWfsw/zlib11/lib/libz.so -lm -lc
--
albert chin (address@hidden)