Platform : Solaris 2.7 Intel / GCC 2.8.1 Command Lines : export LIBS='-L/pkgs/lib -L/pkgs/db-2.7.7/BerkeleyDB/lib/' export CPPFLAGS='-I/pkgs/include -I/pkgs/db-2.7.7/BerkeleyDB/include' ./configure --prefix=/pkgs/rpm-3.0.4 Configure Log File configure:4082: checking for dbopen in -ldb configure:4101: gcc -o conftest -g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -I/pkgs/include -I/pkgs/db-2.7.7/BerkeleyDB/include conftest.c -ldb -L/pkgs/lib -L/pkgs/db-2.7.7/BerkeleyDB/lib/ -L/usr/ucblib -R/usr/ucblib -lnsl -lsocket 1>&5 configure:4094: warning: function declaration isn't a prototype configure:4096: warning: function declaration isn't a prototype Undefined first referenced symbol in file dbopen /var/tmp/ccU4aGyv1.o ld: fatal: Symbol referencing errors. No output written to conftest configure: failed program was: #line 4090 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen(); int main() { dbopen() ; return 0; } Problem Summary: The LIBS are placed after the -ldb which is causing the search for dbopen to fail, rearranging the command line manually fixs the problem. Unfortunately I'm not an AutoMake/AutoConf person so this is presently stopping me from building RPM.
Also in gcc-2.95.2 (as would be expected)
The routine dbopen is available only if you have installed libdb with db-1.85 compatibility enabled (rpm uses a db-1.85 API, not a db-2.x API).
As I stated in the summary its an autoconf/automake issue, as by rearranging the to the gcc cmdline I can get it to link (ie I built db-2.x correctly with 1.x support). But gcc ..... -ldb -L/path/to/lib is not the same as gcc ..... -L/path/to/lib -ldb Hence the command line being constructed by Auto* is incorrect. The $(LIBS) must be before the -ldb in order for the link to succeed. Regards Peter
Ahh, I see. Thanks for the correction, I will try to fix when I get to portability testing on solaris.
rpm-4.0.3 has an internal copy of db-3.3.x, so the path to the Berkeley DB library is no longer an issue.