bogofilter on Mac OSX?

David Relson relson at osagesoftware.com
Tue Dec 28 17:00:59 CET 2004


On Tue, 28 Dec 2004 16:24:21 +0100
John wrote:

> 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?):

Nope.  "-db" is a typo in the released README.osx.  Run "./configure
--help" and you'll see that options include:

  --with-libsqlite3-prefix[=DIR]  search for libsqlite3 in DIR/include and DIR/lib
  --without-libsqlite3-prefix     don't search for libsqlite3 in includedir and libdir
  --with-libtdb-prefix[=DIR]  search for libtdb in DIR/include and DIR/lib
  --without-libtdb-prefix     don't search for libtdb in includedir and libdir
  --with-libqdbm-prefix[=DIR]  search for libqdbm in DIR/include and DIR/lib
  --without-libqdbm-prefix     don't search for libqdbm in includedir and libdir
  --with-libdb-prefix[=DIR]  search for libdb in DIR/include and DIR/lib
  --without-libdb-prefix     don't search for libdb in includedir and libdir
  --with-included-gsl     force use of shipped GSL rather than system GSL
  --with-gsl-prefix=PFX   Prefix where GSL is installed (optional)
  --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional)

but not:

  --with-libdb-prefix-db

> $ ./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.

I'll let Matthias handle this part :-)



More information about the Bogofilter mailing list