Subject: pkg/35417: opencobol doesn't build with db4
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dholland@eecs.harvard.edu>
List: pkgsrc-bugs
Date: 01/13/2007 17:05:00
>Number:         35417
>Category:       pkg
>Synopsis:       opencobol doesn't build with db4
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 13 17:05:00 +0000 2007
>Originator:     David A. Holland <dholland@eecs.harvard.edu>
>Release:        NetBSD 2.1.0_STABLE (-20061223)
>Organization:
   Harvard EECS
>Environment:
System: NetBSD bantha 2.1.0_STABLE NetBSD 2.1.0_STABLE (GENERIC) #3: Fri Dec  1 14:58:15 EST 2006  root@bantha:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

If you have 
   BDB_DEFAULT=db4
   BDB185_DEFAULT=db4

lang/opencobol fails to build. This is because its configure stuff
assumes that if it can find dbopen without taking any special steps it
must have db 1.85. With the above settings that's not true, and so it
includes the wrong header and bombs.

>How-To-Repeat:

Set the default to db4 and build opencobol. It fails on libcob/fileio.c.

>Fix:

(1) Add this patch so it'll always have --with-db if it's not using db1:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/opencobol/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	11 Jan 2007 11:56:08 -0000	1.15
+++ Makefile	13 Jan 2007 16:56:47 -0000
@@ -33,4 +33,7 @@
 .include "../../devel/libltdl/buildlink3.mk"
 .include "../../devel/ncurses/buildlink3.mk"
 .include "../../mk/bdb.buildlink3.mk"
+.if ${BDB_TYPE} != "db1"
+CONFIGURE_ARGS+=	--with-db
+.endif
 .include "../../mk/bsd.pkg.mk"


and (2) add this patch as patches/patch-ab or whatever so it uses the
right header file.


--- libcob/fileio.c.orig	2005-05-03 05:31:14.000000000 -0400
+++ libcob/fileio.c	2007-01-13 11:42:01.000000000 -0500
@@ -48,7 +48,11 @@
 #endif
 
 #if HAVE_DBOPEN
+#if defined(WITH_DB)
+#include <db_185.h>
+#else
 #include <db.h>
+#endif
 #else
 #if HAVE_DB1_DB_H
 #include <db1/db.h>


Note that this is still a hack; the right fix is to straighten out
configure.ac and not try to use the results of function tests to
govern header inclusion.