> > > Is it because of the _order_ of the -L options?

Seems so:

cc -g -O2 -fstack-protector-strong -Wall -Wmissing-prototypes 
-Wstrict-prototypes -fstack-protector-strong -Wl,--as-needed -o .libs/sox sox.o 
 -L/usr/local/lib -L./.libs -lsox -lpng -lltdl -lao -lgsm -lid3tag -lz -lmad 
-lmp3lame -ltwolame -lopusfile -lopus -lsndio -lvorbisfile -lwavpack -lcrypto 
-lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm -Wl,-rpath,/home/hans/lib 
-Wl,-rpath,/usr/local/lib

fails, but

cc -g -O2 -fstack-protector-strong -Wall -Wmissing-prototypes 
-Wstrict-prototypes -fstack-protector-strong -Wl,--as-needed -o .libs/sox sox.o 
 -L./.libs -lsox -L/usr/local/lib -lpng -lltdl -lao -lgsm -lid3tag -lz -lmad 
-lmp3lame -ltwolame -lopusfile -lopus -lsndio -lvorbisfile -lwavpack -lcrypto 
-lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm -Wl,-rpath,/home/hans/lib 
-Wl,-rpath,/usr/local/lib

succeeds. The only difference between the two is the -L order, namely,

cc [...] -o .libs/sox sox.o  -L/usr/local/lib -L./.libs -lsox -lpng [...]
cc [...] -o .libs/sox sox.o  -L./.libs -lsox -L/usr/local/lib -lpng [...]

That confirms my suspition the ./configure LDFLAGS=-L...
puts the extra -L in a wrong place. Running ./configure
without options, on the other hand, detects e.g. flac
and puts the -L/usr/local/lib at the right place in that line.

> > For each -l option, the directories specified with -L options preceding
> > it are searched in order until a match is found.
> 
> In that case,
> 
> -o .libs/sox sox.o -L/usr/local/lib -L./.libs -lsox
> 
> will find /usr/local/lib/libsox.so first,
> i.e. the one from a previous installation.
> That seems wrong.
> 
> > Unless there are
> > conflicting libraries in different locations, the order doesn't matter.
> 
> There is /usr/local/lib/libsox.so from the already installed sox,
> and there is .libs/libsox.so ; at any rate, the sox being built
> should probably not be linked against the old library.
> 
> > > Note that with LDFLAGS=/usr/local/lib, the order is
> > >
> > >   -o .libs/sox sox.o  -L/usr/local/lib -L./.libs -lsox [etc]
> 
> which seems wrong, if the above is true.
> 
> > > but without LDFLAGS it's
> > >
> > >   -o .libs/sox sox.o  -L ./.libs -lsox -L/usr/local/lib -lFLAC [etc]
> 
> Which seems correct: fond libsox in .libs,
> and then find flac etc in /usr/local/lib


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to