Add BDB version mismatch check

This commit is contained in:
Kurt Zeilenga 2004-04-21 20:43:57 +00:00
parent 41d3389c5b
commit 70d53c906b
2 changed files with 352 additions and 227 deletions

View File

@ -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

526
configure vendored

File diff suppressed because it is too large Load Diff