pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/41865: Problem building pkg_install on Linux box

>Number:         41865
>Category:       pkg
>Synopsis:       Problem building pkg_install on Linux box
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 10 09:50:01 +0000 2009
>Originator:     David Sainty
>Release:        Linux
Linux 2.6.16-gentoo-r7 #6 SMP PREEMPT Wed May 7 20:30:01 NZST 2008 i686 
Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
pkgtools/pkg_install/files/lib/pkgdb.c wants to use dbopen().

pkgtools/pkg_install/files/ looks for a solution.  Snippets follow.

checking for __db185_open in -ldb... no
checking for library containing dbopen... none required
checking db1/db.h usability... yes
checking db1/db.h presence... yes
checking for db1/db.h... yes
checking db_185.h usability... yes
checking db_185.h presence... yes
checking for db_185.h... yes
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes

The "checking for library containing dbopen" decides no linking is required, 
because libnbcompat is providing dbopen, and is linked automatically.

However, there are system installed db*.h files, including 

Ultimately, pkgdb.c pulls in db_185.h because HAVE_DB_185_H is installed.  But 
it doesn't link any system installed libdb.

% fgrep dbopen /usr/include/db_185.h                                            
/* Re-define the user's dbopen calls. */
#define dbopen __db185_open_4002

And it all goes wrong:

gcc -L/home/dave/pkgsrc3/pkgtools/pkg_install/work/bzip2 
-L/home/dave/pkgsrc3/pkgtools/pkg_install/work/libfetch -L/home/da
ve/pkgsrc3/pkgtools/pkg_install/work/libnbcompat -Wl,-R/home/dave/pkgroot3/lib 
-L../lib -o pkg_add main.o perform.o -linstall -lfetch -larchive -lbz2 -lz 
../lib/libinstall.a(pkgdb.o): In function `pkgdb_open':
pkgdb.c:(.text+0x83): undefined reference to `__db185_open_4002'
collect2: ld returned 1 exit status
*** Error code 1

bmake: stopped in 
*** Error code 1

bmake: stopped in 
*** Error code 1

Build any package on this box, which starts with:

===> Trying to handle out-dated pkg_install...
===> Cleaning for pkg_install-20090806
===> Installing dependencies for pkg_install-20090806

There's an air of mystery around the nbcompat features stuff.  However, the 
pkg_install/Makefile suggests that nbcompat db support is unconditionally 
built, therefore it seems appropriate that the nbcompat db.h is unconditionally 
included.  This does fix the build.

If this is the correct fix, then should probably also stop looking 
for the non-libnbcompat db*.h files.

--- pkgdb.c     2 Aug 2009 17:56:45 -0000       1.34
+++ pkgdb.c     10 Aug 2009 09:40:58 -0000
@@ -38,15 +38,7 @@
-#if HAVE_DB_185_H
-#include <db_185.h>
-#elif HAVE_DB1_DB_H
-#include <db1/db.h>
-#elif HAVE_DB_H
-#include <db.h>
 #include <nbcompat/db.h>
 #include <err.h>

Home | Main Index | Thread Index | Old Index