Bug 11261

Summary: Configure/Build Issue : rpm-3.0.4
Product: [Retired] Red Hat Linux Reporter: Peter Bray <peter_darren_bray>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-10 18:04:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Bray 2000-05-06 05:38:44 UTC
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.

Comment 1 Peter Bray 2000-05-06 07:30:59 UTC
Also in gcc-2.95.2 (as would be expected)

Comment 2 Jeff Johnson 2000-05-08 18:36:59 UTC
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).

Comment 3 Peter Bray 2000-05-09 00:24:59 UTC
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

Comment 4 Jeff Johnson 2000-05-10 18:04:59 UTC
Ahh, I see. Thanks for the correction, I will try to fix when I get to
portability testing on solaris.

Comment 5 Jeff Johnson 2001-07-25 20:49:48 UTC
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.