When building rpm 4.0.2 on our sparc-sun-solaris2.8 build machine, when
it gets to the tools directory, and the `dump' executable, I see the
/bin/sh ../libtool --mode=link cc -g -o dump dump.o
../build/librpmbuild.la ../lib/librpm.la ../rpmio/librpmio.la
../popt/libpopt.la -L/usr/ucblib -R/usr/ucblib -lnsl -lsocket -lz
cc -g -o dump dump.o ../build/.libs/librpmbuild.a ../lib/.libs/librpm.a
-ldb -lpthread ../rpmio/.libs/librpmio.a -L/usr/ucblib -lnsl -lsocket -lz
-lbz2 ../popt/.libs/libpopt.a -L/local/BerkeleyDB/lib -L/local/lib
-L/usr/ucblib -lnsl -lsocket -lz -lbz2 -R/usr/ucblib -R/usr/ucblib
ild: (argument error) can't find library argument :: -ldb
make: *** [dump] Error 8
The problem is that the LDFLAGS, which contains `-L/local/BerkeleyDB/lib',
doesn't precede the `-ldb -lpthread' on the line.
That should in theory be easy to fix, but after looking at tools/Makefile
for a while, I'm really puzzled. Nowhere in the Makefile is
Also, I see a section like this:
libdb3 = -ldb -lpthread
But `libdb3' and `-ldb' aren't mentioned anywhere else in the Makefile, so
I don't see how that's making it onto the link line shown above.
I also notice that `LIBS' is being substituted into all the other Makefiles
in every subdirectory, but it's not being substituted into tools/Makefile.
At this point, I'm at a loss to explain how the tools/Makefile is working
After looking some more, I see the the
is coming because of what's recorded in libpopt.la, which is being linked in.
the problem is that it's too far down the link line to do any good for the
problem at hand.
Is there a reason why both LDFLAGS and LIBS are purposely not substituted into
this is not a wolverine / Red Hat Linux problem.
AFAIK, using an internal version of Berkeley DB should "fix" this problem.
Otherwise, please reopen this bug.