ports/114333: sysutils/cfengine detects wrong version of Berkeley DB

Scot Hetzel swhetzel at gmail.com
Thu Jul 5 16:30:06 UTC 2007


>Number:         114333
>Category:       ports
>Synopsis:       sysutils/cfengine detects wrong version of Berkeley DB
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 05 16:30:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        FreeBSD 7.0-CURRENT
>Organization:
>Environment:
FreeBSD hp010 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Jul  4 17:39:08 CDT 2007     swhetzel at hp010:/usr/src/7x/sys-p4/amd64/compile/GENERIC.debug  amd64

>Description:
The sysutils/cfengine configure script detects the wrong version of Berkeley DB if more than one Berkeley DB port is installed.

The problem is that setting BERKELEY_DB_{CFLAGS, LDFLAGS, LIB} in CONFIGURE_ENV has no effect in determining the version of Berkeley DB to use.
>How-To-Repeat:
cd /usr/ports/databases/db4 ; make install
cd /usr/ports/databases/db44 ; make install
cd /usr/ports/sysutils/cfengine ; make build
===>  Patching for cfengine-2.2.1
===>  Applying FreeBSD patches for cfengine-2.2.1
===>   cfengine-2.2.1 depends on shared library: db-4.4.0 - found
===>  Configuring for cfengine-2.2.1
...
checking for BerkeleyDB location in default... Found header in
/usr/local/include/db4
checking for library containing db_create... -ldb4
/usr/local
checking Berkeley DB Version... 4.0.14 OK
checking Berkeley DB API... 4.0.14 checking for db_create in -ldb... no
..
if cc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/db4
-I/usr/include   -D_THREAD_SAFE -g -O2 -Wreturn-type
-Wmissing-prototypes -Wuninitialized -D_THREAD_SAFE  -O -pipe
-I/usr/local/include/db4  -D_THREAD_SAFE -DBUILDTIN_GCC_THREAD
-D_THREAD_SAFE  -O -pipe  -I/usr/local/include/db4  -D_THREAD_SAFE
-DBUILDTIN_GCC_THREAD -MT instrument.o -MD -MP -MF
".deps/instrument.Tpo" -c -o instrument.o instrument.c;  then mv -f
".deps/instrument.Tpo" ".deps/instrument.Po"; else rm -f
".deps/instrument.Tpo"; exit 1; fi
instrument.c: In function `RecordPerformance':
instrument.c:65: error: incompatible type for argument 4 of indirect
function call
instrument.c:65: error: too many arguments to function
*** Error code 1

>Fix:
Apply the attached patch.

Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/cfengine/Makefile,v
retrieving revision 1.38
diff -u -r1.38 Makefile
--- Makefile	15 Jun 2007 18:18:57 -0000	1.38
+++ Makefile	5 Jul 2007 16:18:35 -0000
@@ -17,7 +17,7 @@
 
 USE_RC_SUBR=	cfexecd cfservd
 
-USE_BDB?=	44
+USE_BDB=	44+
 USE_OPENSSL=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -25,10 +25,7 @@
 		--docdir=${DOCSDIR} \
 		--infodir=${PREFIX}/info \
 		--mandir=${MANPREFIX}/man
-CONFIGURE_ENV+=	PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS} \
-		BERKELEY_DB_CFLAGS=-I${BDB_INCLUDE_DIR} \
-		BERKELEY_DB_LDFLAGS=-L${BDB_LIB_DIR} \
-		BERKELEY_DB_LIB=-l${BDB_LIB_NAME}
+CONFIGURE_ENV+=	PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS}
 
 .if !defined(NOPORTDOCS)
 INFO=		cfengine-Anomalies cfengine-Reference cfengine-Tutorial
Index: files/patch-configure
===================================================================
RCS file: /home/ncvs/ports/sysutils/cfengine/files/patch-configure,v
retrieving revision 1.1
diff -u -r1.1 patch-configure
--- files/patch-configure	24 Jan 2007 22:47:36 -0000	1.1
+++ files/patch-configure	5 Jul 2007 16:02:11 -0000
@@ -1,6 +1,33 @@
---- configure.orig	Wed Sep 20 10:27:07 2006
-+++ configure	Thu Dec 14 18:00:21 2006
-@@ -8539,7 +8539,7 @@
+--- configure.orig	2007-05-29 13:07:07.000000000 -0500
++++ configure	2007-07-05 11:01:34.000000000 -0500
+@@ -9570,7 +9570,7 @@
+     if test "x$BERKELEY_DB_DIR" = "xdefault" ; then
+ 
+         for d in $prefix /opt /usr/local /usr; do
+-            for v in db-4 db4 db3 db db40; do
++            for v in db45 db44 db-4 db4 db3 db db40; do
+ 
+                 if test -f "$d/include/$v/db.h" ; then
+                     echo "Found header in $d/include/$v "
+@@ -9580,7 +9580,7 @@
+ 		    # In RedHat 8, for instance, we have /usr/include/db4
+ 		    # and libdb-4.0.a.  Debian has /usr/lib/libdb-4.1.a, for
+ 		    # instance.  Look for the appropriate library.
+-                    if test $v = db4 -o $v = db40; then
++                    if test $v = db4 -o $v = db40 -o $v = db45 -o $v = db44; then
+ 			save_CFLAGS="$CFLAGS"
+ 			save_LDFLAGS="$LDFLAGS"
+ 			CFLAGS="$CFLAGS $BERKELEY_DB_CFLAGS"
+@@ -9613,7 +9613,7 @@
+   return 0;
+ }
+ _ACEOF
+-for ac_lib in '' db-4 db4 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0; do
++for ac_lib in '' db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4; do
+   if test -z "$ac_lib"; then
+     ac_res="none required"
+   else
+@@ -9745,7 +9745,7 @@
          done
  
          BERKELEY_DB_LIB="-ldb"
@@ -9,7 +36,7 @@
              if test -f "$BERKELEY_DB_DIR/lib/lib$v.so"; then
                  BERKELEY_DB_LIB="-l$v"
  		break
-@@ -15998,7 +15998,7 @@
+@@ -17933,7 +17933,7 @@
  
  
  
@@ -17,4 +44,4 @@
 +LIBS="../pub/libpub.a $LIBS"
  
  
- echo "$as_me:$LINENO: checking Checking for GCC Specific compile flags" >&5
+ { echo "$as_me:$LINENO: checking Checking for GCC Specific compile flags" >&5


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list