Bug 11261 - Configure/Build Issue : rpm-3.0.4
Configure/Build Issue : rpm-3.0.4
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2000-05-06 01:38 EDT by Peter Bray
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-10 14:04:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Peter Bray 2000-05-06 01:38:44 EDT
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() {
; 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 03:30:59 EDT
Also in gcc-2.95.2 (as would be expected)
Comment 2 Jeff Johnson 2000-05-08 14:36:59 EDT
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-08 20:24:59 EDT
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.

Comment 4 Jeff Johnson 2000-05-10 14:04:59 EDT
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 16:49:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.