Bug 11261 - Configure/Build Issue : rpm-3.0.4
Summary: Configure/Build Issue : rpm-3.0.4
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-06 05:38 UTC by Peter Bray
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-05-10 18:04:16 UTC
Embargoed:


Attachments (Terms of Use)

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.


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