1 dnl $Id: db3-check.m4,v 1.11 2003-02-24 10:49:57 didg 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/'`"
18 bdbbindir="`echo $bdbdir | sed 's/include\/db3$/bin/'`"
19 bdbbindir="`echo $bdbbindir | sed 's/include$/bin/'`"
22 savedldflags="$LDFLAGS"
23 CFLAGS="$CFLAGS -I$bdbdir"
24 LDFLAGS="-L$bdblibdir $LDFLAGS"
25 AC_CHECK_LIB(db, main, [
27 if test "$bdbdir" != "/usr/include"; then
28 BDB_CFLAGS="-I$bdbdir"
30 if test "$bdblibdir" != "/usr/lib"; then
31 BDB_LIBS="-L$bdblibdir"
33 BDB_LIBS="$BDB_LIBS -ldb"
35 BDB_PATH="`echo $bdbdir | sed 's,include/db3$,,'`"
38 LDFLAGS="$savedldflags"
43 if test "x$bdbfound" = "xyes"; then
44 ifelse([$1], , :, [$1])
46 ifelse([$2], , :, [$2])