Subject: Re: CVS commit: pkgsrc/pkgtools/pkg_install
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 04/11/2003 10:35:58
On Fri, 11 Apr 2003, grant beattie wrote:

> only include db1 support if on NetBSD. fixes updating problem on Solaris.

I use the pkg_* tools under Linux. This is version 20030325. (Before your

My .buildlink/lib directory is empty, but it does have a
.buildlink/include/ for /usr/include/db.h

But the configure detected it. The pkg_install-20030325/config.status has:
s%@LIBS@%-ldb1 %g

And pkg_install-20030325/lib/config.h has:
#define HAVE_DBOPEN 1
#define HAVE_DB_H 1
#define HAVE_DB1_DB_H 1
#define HAVE_NETDB_H 1
#define HAVE_LIBDB1 1

$ ldd /usr/sbin/pkg_*
/usr/sbin/pkg_add: => /lib/ (0x2aac8000) => /lib/ (0x2aad7000)
        /lib/ => /lib/ (0x2aaab000)
/usr/sbin/pkg_admin: => /lib/ (0x2aac8000) => /lib/ (0x2aad7000)
        /lib/ => /lib/ (0x2aaab000)
/usr/sbin/pkg_create: => /lib/ (0x2aac8000) => /lib/ (0x2aad7000)
        /lib/ => /lib/ (0x2aaab000)
/usr/sbin/pkg_delete: => /lib/ (0x2aac8000) => /lib/ (0x2aad7000)
        /lib/ => /lib/ (0x2aaab000)
/usr/sbin/pkg_info: => /lib/ (0x2aac8000) => /lib/ (0x2aad7000)
        /lib/ => /lib/ (0x2aaab000)

Although, this is not what I wanted. I wanted to it to build and
install the db from pkgsrc and link to it.

So I moved my /usr/include/db.h (and /usr/include/db1/db.h) out of the
way. Then rebuilt pkg_install which built and installed db-2.7.7nb1.
And created buildlink for it. Then the pkg_install build failed:

gcc -DHAVE_CONFIG_H -I. -I. -I/usr/include/db2  -I/usr/include -O2
-I/usr/include -c pkgdb.c -o pkgdb.o
pkgdb.c: In function `pkgdb_open':
pkgdb.c:81: `BTREEINFO' undeclared (first use in this function)
pkgdb.c:142: `R_NOOVERWRITE' undeclared (first use in this function)
pkgdb.c:192: `R_FIRST' undeclared (first use in this function)
pkgdb.c:192: `R_NEXT' undeclared (first use in this function)

These are defined in

The pkgdb.c has:
#ifdef HAVE_DB1_DB_H
#include <db1/db.h>
#elif defined(HAVE_DB_H)
#include <db.h>

I don't have db.h nor db1/db.h buildlinked.

I think the autoconf setup needs to be modified so it checks for db_185.h
and sets some HAVE_DB_185_H. Also, it needs ot be sure to use the correct
db includes.

I made it work by manually changing pkgdb.c to have:
#include <db2/db_185.h>
(and commented out other db includes.)

That build fine and ran fine, but I see it linked to wrong library.

So I manually fixed Makefiles to use db2 instead of db1 library.

This also worked.

Can someone fix the autoconf to correctly use the db2 (or whatever is

   Jeremy C. Reed