1 dnl $Id: db3-check.m4,v 1.6.2.1 2002-02-09 20:29:02 jmarcus Exp $
2 dnl Autoconf macro to check for the Berkeley DB3 library
4 AC_DEFUN([AC_PATH_DB3], [
7 [ --with-db3=PATH specify path to Berkeley DB3 installation],
8 if test "x$withval" != "xno"; then
14 for db3dir in "" "$trydb3dir" "$trydb3dir/include" "$trydb3dir/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 "$db3dir/db.h" ; then
16 db3libdir="`echo $db3dir | sed 's/include\/db3$/lib/'`"
17 db3libdir="`echo $db3libdir | sed 's/include$/lib/'`"
20 savedldflags="$LDFLAGS"
21 CFLAGS="$CFLAGS -I$db3dir"
22 LDFLAGS="-L$db3libdir $LDFLAGS"
23 AC_CHECK_LIB(db, main, [
25 DB3_CFLAGS="-I$db3dir"
26 DB3_LIBS="-L$db3libdir -ldb"
27 DB3_PATH="`echo $db3dir | sed 's,include/db3$,,'`"
30 LDFLAGS="$savedldflags"
35 if test "x$db3found" = "xyes"; then
36 ifelse([$1], , :, [$1])
38 ifelse([$2], , :, [$2])