summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 17:06:43 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 17:06:43 +0000
commitc9569a1edaf6f93cbeefe0b8dacc02c14dbb6cc9 (patch)
tree0116f442851cc9734ad663f3825168e4d9852d8a /configure.in
parent77113d1158583ebcc931997786e2a930f6bfa7a6 (diff)
* Build apt-ftparchive with libdb4.2 rather than libdb2
Author: mdz Date: 2004-05-08 19:41:01 GMT * Build apt-ftparchive with libdb4.2 rather than libdb2 - Patch from Clint Adams to do most of the work - Build-Depends: s/libdb2-dev/libdb4.2-dev/ - Add AC_PREREQ(2.50) to configure.in - Use db_strerror(err) rather than GlobalError::Errno (which uses strerror)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 23 insertions, 5 deletions
diff --git a/configure.in b/configure.in
index a9b7275f2..2503c93bc 100644
--- a/configure.in
+++ b/configure.in
@@ -12,6 +12,7 @@ dnl not used but STL is.
dnl 'make -f Makefile startup' will generate the configure file from
dnl configure.in correctly and can be run at any time
+AC_PREREQ(2.50)
AC_INIT(configure.in)
AC_CONFIG_AUX_DIR(buildlib)
AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
@@ -52,11 +53,28 @@ dnl if test "$PTHREADLIB" != "-lpthread"; then
dnl AC_MSG_ERROR(failed: I need posix threads, pthread)
dnl fi
-dnl Check for DB2
-AC_CHECK_HEADER(db2/db.h,
- [AC_CHECK_LIB(db2,db_open,
- [AC_DEFINE(HAVE_DB2) DB2LIB="-ldb2"])])
-AC_SUBST(DB2LIB)
+dnl Check for BDB
+saveLIBS="$LIBS"
+LIBS="$LIBS -ldb"
+
+AC_CHECK_HEADER(db.h,
+ [AC_MSG_CHECKING(if we can link against BerkeleyDB)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <db.h>],
+ [int r, s, t; db_version(&r, &s, &t);]
+ )],
+ [AC_DEFINE(HAVE_BDB)
+ BDBLIB="-ldb"
+ AC_MSG_RESULT(yes)],
+ [BDBLIB=""
+ AC_MSG_RESULT(no)]
+ )]
+)
+
+LIBS="$saveLIBS"
+
+AC_SUBST(BDBLIB)
dnl Converts the ARCH to be something singular for this general CPU family
dnl This is often the dpkg architecture string.