make the bdb check actually check for a linkable library

it only checked whether the header is compilable.

amends e1d0ea8a1.
This commit is contained in:
Oswald Buddenhagen 2015-05-01 11:45:06 +02:00
parent b85153f8eb
commit 825041fc8c

View File

@ -141,11 +141,16 @@ AC_SUBST(SASL_LIBS)
AC_CACHE_CHECK([for Berkley DB >= 4.2], ac_cv_berkdb4, AC_CACHE_CHECK([for Berkley DB >= 4.2], ac_cv_berkdb4,
[ac_cv_berkdb4=no [ac_cv_berkdb4=no
sav_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -ldb"
AC_TRY_LINK([#include <db.h>], AC_TRY_LINK([#include <db.h>],
[DB *db; [DB *db;
db_create(&db, 0, 0);
db->truncate(db, 0, 0, 0); db->truncate(db, 0, 0, 0);
db->open(db, 0, "foo", "foo", DB_HASH, DB_CREATE, 0)], db->open(db, 0, "foo", "foo", DB_HASH, DB_CREATE, 0)],
[ac_cv_berkdb4=yes])]) [ac_cv_berkdb4=yes])
LDFLAGS=$sav_LDFLAGS
])
if test "x$ac_cv_berkdb4" = xyes; then if test "x$ac_cv_berkdb4" = xyes; then
AC_SUBST([DB_LIBS], ["-ldb"]) AC_SUBST([DB_LIBS], ["-ldb"])
AC_DEFINE(USE_DB, 1, [if Berkley DB should be used]) AC_DEFINE(USE_DB, 1, [if Berkley DB should be used])