Bug 39524

Summary: Compilation of rpm 4.0.2 gets undefined reference to `db3Free' to 'db3New'
Product: [Retired] Red Hat Linux Reporter: Mark Post <mark.post>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
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: 2001-05-08 01:55:11 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 Mark Post 2001-05-08 01:55:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (WinNT; U)

Description of problem:
When compiling rpm 4.0.2 from source I really get _two_ errors.  The first is that, even though the ./configure step determines that I only have 
db1 installed on my system, the lib/dbconfig.c module does a hard-coded #include <db3/db.h>, which of course is not found.  If I update that to 
be #include <db1/db.h>, things go fine until I get to the point where this is seen:
/bin/sh ../libtool --mode=link gcc  -g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
-Wno-char-subscripts  -o dump  dump.o ../build/librpmbuild.la       ../lib/librpm.la    ../rpmio/librpmio.la    ../popt/libpopt.lamkdir .libs
gcc -g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -o .libs/dump dump.o 
../build/.libs/librpmbuild.so ../lib/.libs/librpm.so -ldb1 ../rpmio/.libs/librpmio.so -L/usr/local/lib -lz -lbz2 ../popt/.libs/libpopt.so
../lib/.libs/librpm.so: undefined reference to `db3Free'
../lib/.libs/librpm.so: undefined reference to `db3New'
collect2: ld returned 1 exit status
make[2]: *** [dump] Error 1
make[2]: Leaving directory `/tmp/rpm-4.0.2/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/rpm-4.0.2'
make: *** [all-recursive-am] Error 2

How reproducible:
Always

Steps to Reproduce:
1. Untar the sources
2. Apply the ferror.patch, s390.patch, and rpm-deb.patch
3. ./configure
4. make
This produces the first problem of db3/db.h not being found.
5. edit lib/dbconfig.c to replace db3/db.h with db1/db.h
6. make
This eventually gets to the undefined references for db3New and db3Free.
	

Actual Results:  /bin/sh ../libtool --mode=link gcc  -g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
-Wno-char-subscripts  -o dump  dump.o ../build/librpmbuild.la       ../lib/librpm.la    ../rpmio/librpmio.la    ../popt/libpopt.lamkdir .libs
gcc -g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -o .libs/dump dump.o 
../build/.libs/librpmbuild.so ../lib/.libs/librpm.so -ldb1 ../rpmio/.libs/librpmio.so -L/usr/local/lib -lz -lbz2 ../popt/.libs/libpopt.so
../lib/.libs/librpm.so: undefined reference to `db3Free'
../lib/.libs/librpm.so: undefined reference to `db3New'
collect2: ld returned 1 exit status
make[2]: *** [dump] Error 1
make[2]: Leaving directory `/tmp/rpm-4.0.2/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/rpm-4.0.2'
make: *** [all-recursive-am] Error 2

Expected Results:  A clean compile and link.

Additional info:

Comment 1 Jeff Johnson 2001-05-08 12:07:38 UTC
You can't successfully compile rpm-4.0 without db3 installed, and installed
as in the Red Hat spec file, with include file in /usr/include/db3 etc. The
choice
of db3 (and db1 in rpm-4.0.2) is not optional.

Meanwhile, db1 has already been eliminated and db-3.2.9 has been added
to the rpm source tree in rpm-4.0.3-0.18 (still under development).

Comment 2 Mark Post 2001-05-08 13:22:05 UTC
Then the ./configure script should be updated to actually _fail_ if it can't find db3, instead of continuing as it does now.  Actually, it should also be 
updated to not even look for db1.