1 dnl $Id: db3-check.m4,v 1.8 2003-01-04 21:41:49 jmarcus Exp $
2 dnl Autoconf macro to check for the Berkeley DB library
4 AC_DEFUN([AC_PATH_BDB], [
7 [ --with-bdb=PATH specify path to Berkeley DB installation],
8 if test "x$withval" != "xno"; then
14 for bdbdir in "" "$trybdbdir" "$trybdbdir/include" "$trybdbdir/include/db3" "/usr/local/BerkeleyDB.3.3/include" "/usr/local/include/db3" "/usr/local/include" "/usr/include/db3" "/usr/include" ; do
15 if test -f "$bdbdir/db.h" ; then
16 bdblibdir="`echo $bdbdir | sed 's/include\/db3$/lib/'`"
17 bdblibdir="`echo $bdblibdir | sed 's/include$/lib/'`"
20 savedldflags="$LDFLAGS"
21 CFLAGS="$CFLAGS -I$bdbdir"
22 LDFLAGS="-L$bdblibdir $LDFLAGS"
23 AC_CHECK_LIB(db, main, [
25 BDB_CFLAGS="-I$bdbdir"
26 BDB_LIBS="-L$bdblibdir -ldb"
27 BDB_PATH="`echo $bdbdir | sed 's,include/db3$,,'`"
30 LDFLAGS="$savedldflags"
35 if test "x$bdbfound" = "xyes"; then
36 ifelse([$1], , :, [$1])
38 ifelse([$2], , :, [$2])