Commit fe4d6e24 authored by Bernhard Link's avatar Bernhard Link

allow compiling with libdb4.7

parent ab737e4d
2009-01-04
* add support for libdb4.7 (yet with some warnings to note I have not
tested it much yet)
2009-01-02
* FilterList/FilterFormula can be inherited with From: in update rules.
* bugfix: if FilterList return hold, FilterFormula was not asked.
......
......@@ -26,7 +26,7 @@ DBLIBS=""
DBCPPFLAGS=""
AH_TEMPLATE([LIBDB_VERSION],[variant of libdb used])
AC_ARG_WITH(libdb,
[ --with-libdb=path|4.4|4.3|3 Give prefix of libdb-4.3 or older version to use],[dnl
[ --with-libdb=path|4.7|4.6|4.4|4.3|3 Give prefix of libdb or specify version to use],[dnl
case "$withval" in
no)
AC_MSG_ERROR(["Cannot compile without libdb"]);
......@@ -43,6 +43,9 @@ AC_ARG_WITH(libdb,
4.6)
DB_WANT_VERSION=4.6
;;
4.7)
DB_WANT_VERSION=4.7
;;
/*)
DB_WANT_VERSION=any
DBLIBS="-L$withval/lib"
......@@ -89,13 +92,28 @@ elif test "x$DB_VERSION_MAJOR" = "x4" -a "x$DB_VERSION_MINOR" = "x6" ; then
elif test "$DB_WANT_VERSION" != "4.6" ; then
AC_MSG_ERROR([Found libdb major version $DB_VERSION_MAJOR.$DB_VERSION_MINOR, need $DB_WANT_VERSION])
fi
elif test "x$DB_VERSION_MAJOR" = "x4" -a "x$DB_VERSION_MINOR" = "x7" ; then
if test "$DB_WANT_VERSION" = "any" ; then
AC_MSG_ERROR([reprepro not yet tested with libdb4.7, use --with-libdb=4.7 to use it])
DB_WANT_VERSION=4.7
elif test "$DB_WANT_VERSION" != "4.7" ; then
AC_MSG_ERROR([Found libdb major version $DB_VERSION_MAJOR.$DB_VERSION_MINOR, need $DB_WANT_VERSION])
else
AC_MSG_WARN([reprepro not yet tested with libdb4.7, use on your own risk])
fi
else
AC_MSG_ERROR([Unsupported libdb major $DB_VERSION_MAJOR minor $DB_VERSION_MINOR
Only 4.3 (stronly recommended) or 3.2 or 4.4 or 4.6 are supported])
Only 4.6 (recommended) or 3.2 or 4.4 or 4.3 or 4.7 are supported])
fi
# now we have a header with the expected version, check for the library:
case "$DB_WANT_VERSION" in
4.7)
AC_CHECK_LIB(db-4.7,db_create,[dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP(LIBDB_VERSION),47)
DBLIBS="-ldb-4.7 $DBLIBS"
],[AC_MSG_ERROR(["no libdb-4.7 found"])],[$DBLIBS])
;;
4.6)
AC_CHECK_LIB(db-4.6,db_create,[dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP(LIBDB_VERSION),46)
......
......@@ -243,6 +243,9 @@ static retvalue database_opentable(struct database *database, const char *filena
#if LIBDB_VERSION == 46
#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
#elif LIBDB_VERSION == 47
#warning libdb4.7 not yet tested. Use on your own risk
#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
#elif LIBDB_VERSION == 44
#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
#elif LIBDB_VERSION == 43
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment