Always use current db when linking. (libdb.so is symlink to the current db4) diff -up cyrus-sasl-2.1.22/cmulocal/berkdb.m4.current-db cyrus-sasl-2.1.22/cmulocal/berkdb.m4 --- cyrus-sasl-2.1.22/cmulocal/berkdb.m4.current-db 2005-04-26 21:14:07.000000000 +0200 +++ cyrus-sasl-2.1.22/cmulocal/berkdb.m4 2008-09-26 11:49:34.000000000 +0200 @@ -213,10 +213,11 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB], fi saved_LIBS=$LIBS - for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db + for dbname in db db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 do LIBS="$saved_LIBS -l$dbname" - AC_TRY_LINK([#include ], + AC_TRY_LINK([#include +#include ], [db_create(NULL, NULL, 0);], BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db, dblib="no") @@ -224,7 +225,8 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB], done if test "$dblib" = "no"; then LIBS="$saved_LIBS -ldb" - AC_TRY_LINK([#include ], + AC_TRY_LINK([#include +#include ], [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);], BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db, dblib="no")