bogofilter on Mac OSX?

John xd890cc2b41c31d74 at f4n.org
Tue Dec 28 16:24:21 CET 2004


On Mon, Dec 27, 2004 at 16:03:24 -0500, David Relson wrote:
> Silly me.  I forgot that bogofilter includes doc/programmer/README.osx.
> I've revised it and have attached the revision.  Would you OSX folks
> please verify that it's accurate?
Using doc/programmer/README.osx from CVS on 0.93.3.1 on OSX 10.3.6
with Berkeley DB 4 installed by fink (same result with
--with-libdb-prefix, without -db, is this a typo?):

$ ./configure --with-libdb-prefix-db=/sw/include/db4
[...]
checking how to link with libdb... -ldb
checking db and dependent libraries... -ldb 
checking if a program can be linked against Berkeley DB and run... yes
checking if Berkeley DB header and library versions match... no
configure: error: db.h header file and db library version do not match. 

config.log:
configure:12364: checking if Berkeley DB header and library versions match
configure:12406: gcc -o conftest -g -O2  -Wpointer-arith -ggdb -Wall -W
 -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast
 -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return
 -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -fno-common
 -Wchar-subscripts -Wcomment -Wimplicit -Wsequence-point -Wreturn-type
 -Wno-system-headers -Wformat   conftest.c -lm  -ldb  >&5
conftest.c:97: warning: function declaration isn't a prototype
conftest.c: In function `main':
conftest.c:100: warning: implicit declaration of function `db_version'
conftest.c:102: error: `DB_VERSION_MAJOR' undeclared (first use in this function)
conftest.c:102: error: (Each undeclared identifier is reported only once
conftest.c:102: error: for each function it appears in.)
conftest.c:102: error: `DB_VERSION_MINOR' undeclared (first use in this function)

This is because /usr/include/db.h doesn't refer to Sleepycat's
version, which is also true for OpenBSD, FreeBSD and probably NetBSD
too. The following works for me with 0.93.3.1:

OpenBSD 3.5 (db4 from packages):
env CPPFLAGS=-I/usr/local/include/db4 LDFLAGS=-L/usr/local/lib ./configure

FreeBSD 4.10 (db4 from ports):
env CPPFLAGS=-I/usr/local/include/db4 LIBS=-ldb4 LDFLAGS=-L/usr/local/lib ./configure

Mac OS X 10.3.6 (db4 from fink):
env CPPFLAGS=-I/sw/include/db4 LDFLAGS=-L/sw/lib ./configure

There's no point (?) in using --with-libdb-prefix in this case.
What's needed is probably a "--with"-flag for libdb's include dir
(bogofilter looks for <db.h> and not <db[34]/db.h>) to prevent loading
the system /usr/include/db.h. Notice that FreeBSD names the library
libdb[34], whereas OpenBSD and OS X uses libdb.

The "how to link with libdb" result is misleading using the above for
FreeBSD: it reports "checking how to link with libdb... -ldb", but
there's no libdb, it's libdb[34]. Would it have found -ldb[34]
automatically if no environment tampering had taken place?

Btw, if things should be kept simple in README.osx: Apple's Developer
tools uses gcc, I think xlc users can figure out CC=xlc. Also, "HP
Gnome Desktop" (HP?) is probably far less common than fink.



More information about the Bogofilter mailing list