aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-10-07 06:06:37 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-10-07 06:06:37 +0000
commit02cbf02d596593e87b8482a26d50d43354d5c684 (patch)
tree976d3fd319592e14dc1651e92107df496e180a47 /configure.ac
parentec8bdbcbffab993b8dd9c2acb175cd84b5b32372 (diff)
downloadmailfromd-02cbf02d596593e87b8482a26d50d43354d5c684.tar.gz
mailfromd-02cbf02d596593e87b8482a26d50d43354d5c684.tar.bz2
Fix Berkeley DB autodetection
git-svn-id: file:///svnroot/mailfromd/trunk@612 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac27
1 files changed, 15 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 42afb759..b100d90a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,14 +185,15 @@ esac])
## an error and stop.
##
check_bdb() {
+ ver=`echo $1 | tr -d '.'`
+ major=`expr $ver : '\(.\).*'`
AC_CHECK_LIB($2, $3,
- [ver=`echo $1|tr -d '.'`
- AC_CHECK_HEADERS(db.h,
- AC_DEFINE_UNQUOTED(WITH_BDB,$ver))
- LIBS="$LIBS -l$2"
- MU_DB2_CURSOR
- POPAUTH='popauth$(EXEEXT)'
- status_bdb=$1])
+ [AC_CHECK_HEADERS(db.h)
+ if test $ac_cv_header_db_h = yes; then
+ LIBS="$LIBS -l$2"
+ MU_DB2_CURSOR
+ status_bdb=$1
+ fi])
if test $status_bdb = no; then
:
else
@@ -200,16 +201,18 @@ check_bdb() {
[AC_LANG_PROGRAM([#include "db.h"],
[int v_major, v_minor, v_patch;
db_version(&v_major, &v_minor, &v_patch);
- return !(v_major == DB_VERSION_MAJOR
+ return !(DB_VERSION_MAJOR == $major
+ && v_major == DB_VERSION_MAJOR
&& v_minor == DB_VERSION_MINOR
&& v_patch == DB_VERSION_PATCH);
])],
- [],
- [AC_MSG_ERROR([DB Library and header versions don't match])
- status_bdb=no])
+ [AC_DEFINE_UNQUOTED(WITH_BDB,$ver)],
+ [status_bdb=no])
fi
}
+AC_SUBST(MU_COMMON_INCLUDES)
+
## Check for the Berkeley DB library version $1, assuming Slackware-like
## installation layout (header files in /usr/incude/db$vn and library named
## libdb-$version.so, where $version is the library version and $vn is
@@ -244,7 +247,7 @@ BDB) for version in 4 3 2
4|3) func=db_create;;
2) func=db_open;;
esac
- check_bdb $version $name $func
+ check_bdb $version db $func
if test "$status_bdb" != no; then
break;
fi

Return to:

Send suggestions and report system problems to the System administrator.