summaryrefslogtreecommitdiffstats
path: root/m4/db.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/db.m4')
-rw-r--r--m4/db.m410
1 files changed, 10 insertions, 0 deletions
diff --git a/m4/db.m4 b/m4/db.m4
index e463ed7f..680f57e1 100644
--- a/m4/db.m4
+++ b/m4/db.m4
@@ -65,3 +65,13 @@ if test -z "$db_inc"; then
AC_MSG_ERROR([db not found, specify with --with-db.])
fi
fi
+dnl figure out which version of db we're using from the header file
+db_ver_maj=`grep DB_VERSION_MAJOR $db_incdir/db.h | awk '{print $3}'`
+db_ver_min=`grep DB_VERSION_MINOR $db_incdir/db.h | awk '{print $3}'`
+db_ver_pat=`grep DB_VERSION_PATCH $db_incdir/db.h | awk '{print $3}'`
+dnl libname is libdb-maj.min e.g. libdb-4.2
+db_libver=${db_ver_maj}.${db_ver_min}
+dnl make sure the lib is available
+AC_CHECK_LIB([db-$db_libver], [db_create], [],
+ [AC_MSG_ERROR([$db_incdir/db.h is version $db_libver but libdb-$db_libver not found])])
+