Subject: Re: [Fwd: Re: Bekerley DB v1]
To: pierre bourgin <pierre.bourgin@pcotech.fr>
From: grant beattie <grant@netbsd.org>
List: tech-pkg
Date: 03/18/2003 20:25:11
On Tue, Mar 18, 2003 at 11:10:41AM +0100, pierre bourgin wrote:

> I forgot to tell I already tried it.
> 
> Under NetBSD, no problem (DB v1 provided by system), but under Solaris, 
> databases/db package will be used (that provides DB v2) and the program 
> I (try to) compile will failed: this is DB v1 that is required, not DB v2.

Try the following patch, it allows pkg_install to find and use the
correct db_185.h from databases/db.

The right way to fix this is to create a db1 package and statically
link with libdb. I think Johnny Lam was working on this.


Index: configure.in
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/pkg_install/configure.in,v
retrieving revision 1.9
diff -u -r1.9 configure.in
--- configure.in	2002/11/27 03:48:28	1.9
+++ configure.in	2003/02/11 15:52:37
@@ -30,12 +30,13 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(db1/db.h)
-AC_CHECK_HEADERS(assert.h db.h dirent.h err.h fcntl.h fnmatch.h limits.h md5.h md5global.h netdb.h pwd.h regex.h signal.h stdlib.h string.h termios.h time.h unistd.h vis.h)
+AC_CHECK_HEADERS(assert.h db.h db_185.h dirent.h err.h fcntl.h fnmatch.h limits.h md5.h md5global.h netdb.h pwd.h regex.h signal.h stdlib.h string.h termios.h time.h unistd.h vis.h)
 AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/queue.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sys/wait.h)
 
 dnl Check for libraries
 AC_CHECK_LIB(md, MD5File)
 AC_CHECK_LIB(db1, dbopen)
+AC_CHECK_LIB(db2, dbopen)
 
 dnl Check for functions
 AC_CHECK_FUNCS(chflags)
Index: lib/config.h.in
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/pkg_install/lib/config.h.in,v
retrieving revision 1.9
diff -u -r1.9 config.h.in
--- lib/config.h.in	2002/12/27 20:00:50	1.9
+++ lib/config.h.in	2003/02/11 15:52:37
@@ -63,6 +63,9 @@
 /* Define if you have the <assert.h> header file.  */
 #undef HAVE_ASSERT_H
 
+/* Define if you have the <db_185.h> header file.  */
+#undef HAVE_DB_185_H
+
 /* Define if you have the <db.h> header file.  */
 #undef HAVE_DB_H
 
Index: lib/pkgdb.c
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/pkg_install/lib/pkgdb.c,v
retrieving revision 1.8
diff -u -r1.8 pkgdb.c
--- lib/pkgdb.c	2003/01/20 04:30:17	1.8
+++ lib/pkgdb.c	2003/02/11 15:52:38
@@ -42,6 +42,8 @@
 
 #ifdef HAVE_DB1_DB_H
 #include <db1/db.h>
+#elif defined(HAVE_DB_185_H)
+#include <db_185.h>
 #elif defined(HAVE_DB_H)
 #include <db.h>
 #endif