diff --git a/configure.in b/configure.in index ac01d2c..5da654a 100644 --- a/configure.in +++ b/configure.in @@ -301,66 +301,6 @@ dnl for this macro (not LIBS=...), otherwise the check for dbopen dnl will fail. AC_CHECK_LIB(port, writev) -WITH_DB_SUBDIR= -WITH_INTERNAL_DB=0 -DBLIBSRCS="db3.c" -libdb3="" -libdb3a="" - -dnl -dnl Detect whether internal Berkeley DB should be built. -dnl -withval=no -AC_ARG_WITH(db, [ --with-db use internal Berkeley db]) - -if test $withval = no ; then -dnl ------------------ without internal db - -AC_CHECK_HEADERS([db4/db.h] [db3/db.h]) - -dnl Check for Berkeley db3 API. -AC_CHECK_FUNC(db_create, , - AC_CHECK_LIB(db, db_create, [libdb3="-ldb"], - AC_MSG_ERROR([sorry rpm requires Berkeley db3/db4]) - ) -) - -if test -n "$libdb3" -a -n "$libthread" ; then - AC_MSG_CHECKING(whether $libdb3 needs $libthread) - saveLIBS="$LIBS" - LIBS="$LIBS $libdb3" - AC_TRY_LINK_FUNC(db_create, AC_MSG_RESULT(no), - [libdb3="$libdb3 $libthread"; AC_MSG_RESULT(yes)]) - LIBS="$saveLIBS" -fi - -else -dnl ------------------ with internal db - AC_DEFINE(HAVE_DB3_DB_H, 1, [Define if you have the header file]) - WITH_DB_SUBDIR=db3 - WITH_INTERNAL_DB=1 - libdb3="# \$(top_builddir)/db3/libdb.la" - libdb3a="\$(top_builddir)/db3/libdb.a" -dnl INCPATH="-I\$(top_builddir)/$(WITH_DB_SUBDIR) $INCPATH" -fi - -AC_SUBST(WITH_DB_SUBDIR) -AC_SUBST(WITH_INTERNAL_DB) - -DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` - -AC_SUBST(DBLIBSRCS) -AC_SUBST(DBLIBOBJS) -AC_SUBST(libdb3) -AC_SUBST(libdb3a) - -for dbi in $DBLIBSRCS; do - case $dbi in - db3.c) AC_DEFINE(USE_DB3, 1, [Use the Berkeley db3 API?]) ;; - db1.c) AC_DEFINE(USE_DB1, 1, [Use the Berkeley db1 retrofit to db3 API?]) ;; - esac -done - dnl AmigaOS and IXEmul have a fork() dummy case "$target" in m68k-*-amigaos ) diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am index 1f13318..9d6de64 100644 --- a/rpmdb/Makefile.am +++ b/rpmdb/Makefile.am @@ -8,7 +8,7 @@ INCLUDES = -I. \ -I$(top_srcdir)/rpmio \ @INCPATH@ -LIBDB = @libdb3@ +LIBDB = -ldb LIBELF = @WITH_LIBELF_LIB@ LIBPOPT = @LIBPOPT@ @@ -25,7 +25,7 @@ lib_LTLIBRARIES = librpmdb.la librpmdb_la_SOURCES = db3.c \ dbconfig.c hdrNVR.c header.c fprint.c legacy.c merge.c poptDB.c \ rpmhash.c rpmdb.c rpmvercmp.c tagname.c tagtbl.c -librpmdb_la_LDFLAGS = -release @VERSION@ @libdb3@ +librpmdb_la_LDFLAGS = -release @VERSION@ librpmdb_la_LIBADD = $(LIBDB) $(LIBELF) $(LIBPOPT) $(top_builddir)/rpmio/librpmio.la librpmdb_la_DEPENDENCIES = $(top_builddir)/rpmio/librpmio.la diff --git a/rpmdb/db3.c b/rpmdb/db3.c index f70413e..bc9c009 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -23,11 +23,7 @@ typedef int int32_t; /*@=redef@*/ #endif -#if defined(HAVE_DB4_DB_H) -#include -#elif defined(HAVE_DB3_DB_H) -#include -#endif +#include #include "rpmlib.h" #include "rpmmacro.h" diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index de6354a..9fa29d6 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -15,11 +15,7 @@ typedef int int32_t; /*@=redef@*/ #endif -#if defined(HAVE_DB4_DB_H) -#include -#elif defined(HAVE_DB3_DB_H) -#include -#endif +#include #include "rpmlib.h" #include "rpmmacro.h" @@ -35,9 +31,6 @@ typedef int int32_t; /*@access dbiIndex@*/ /*@access dbiIndexSet@*/ -#if (DB_VERSION_MAJOR == 3) || (DB_VERSION_MAJOR == 4) -#define __USE_DB3 1 - /*@-exportlocal -exportheadervar@*/ /*@unchecked@*/ struct _dbiIndex db3dbi; @@ -573,5 +566,3 @@ const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags) } return buf; } - -#endif diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index df3c5d8..cdb2ff3 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -176,13 +176,9 @@ static void dbiTagsInit(void) #define DB1vec NULL #define DB2vec NULL -#if USE_DB3 /*@unchecked@*/ extern struct _dbiVec db3vec; #define DB3vec &db3vec -#else -#define DB3vec NULL -#endif /*@=redecl@*/ /*@-nullassign@*/