Skip to content
Snippets Groups Projects
Commit 70d53c90 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add BDB version mismatch check

parent 41d3389c
No related branches found
No related tags found
No related merge requests found
......@@ -335,6 +335,58 @@ OL_BERKELEY_DB_TRY(ol_cv_db_db_1,[-ldb-1])
])
dnl
dnl --------------------------------------------------------------------
dnl Check if Berkeley DB version
AC_DEFUN([OL_BERKELEY_DB_VERSION],
[AC_CACHE_CHECK([for Berkeley DB version match], [ol_cv_berkeley_db_version], [
ol_LIBS="$LIBS"
LIBS="$LTHREAD_LIBS $LIBS"
if test $ol_cv_lib_db != yes ; then
LIBS="$ol_cv_lib_db $LIBS"
fi
AC_TRY_RUN([
#ifdef HAVE_DB_185_H
choke me;
#else
#include <db.h>
#endif
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
#endif
#ifndef NULL
#define NULL ((void *)0)
#endif
main()
{
#if DB_VERSION_MAJOR > 1
char *version;
int major, minor, patch;
version = db_version( &major, &minor, &patch );
if( major != DB_VERSION_MAJOR || minor < DB_VERSION_MINOR ) {
printf("Berkeley DB version mismatch\n"
"\texpected: %s\n\tgot: %s\n",
DB_VERSION_STRING, version);
return 1;
}
#endif
return 0;
}],
[ol_cv_berkeley_db_version=yes],
[ol_cv_berkeley_db_version=no],
[ol_cv_berkeley_db_version=cross])
LIBS="$ol_LIBS"
])
if test $ol_cv_berkeley_db_version = no ; then
AC_MSG_ERROR([Berkeley DB version mismatch])
fi
])dnl
dnl
dnl --------------------------------------------------------------------
dnl Check if Berkeley DB supports DB_THREAD
AC_DEFUN([OL_BERKELEY_DB_THREAD],
[AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
......@@ -430,6 +482,7 @@ if test $ac_cv_header_db_h = yes; then
OL_BERKELEY_DB_LINK
if test "$ol_cv_lib_db" != no ; then
ol_cv_berkeley_db=yes
OL_BERKELEY_DB_VERSION
OL_BERKELEY_DB_THREAD
fi
fi
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment