]> arthur.barton.de Git - netatalk.git/blob - macros/db3-check.m4
Ooops. Typo.
[netatalk.git] / macros / db3-check.m4
1 dnl $Id: db3-check.m4,v 1.6 2001-11-16 21:51:05 jnewman Exp $
2 dnl Autoconf macro to check for the Berkeley DB3 library
3
4 AC_DEFUN([AC_PATH_DB3], [
5         trydb3dir=""
6         AC_ARG_WITH(db3,
7                 [  --with-db3=PATH         specify path to Berkeley DB3 installation],
8                 if test "x$withval" != "xno"; then
9                         trydb3dir="$withval"
10                 fi
11         )
12
13         db3found=no
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/'`"
18
19                         savedcflags="$CFLAGS"
20                         savedldflags="$LDFLAGS"
21                         CFLAGS="$CFLAGS -I$db3dir"
22                         LDFLAGS="-L$db3libdir $LDFLAGS"
23                         AC_CHECK_LIB(db, main, [
24                                 db3found=yes
25                                 DB3_CFLAGS="-I$db3dir"
26                                 DB3_LIBS="-L$db3libdir -ldb"
27                         ])
28                         CFLAGS="$savedcflags"
29                         LDFLAGS="$savedldflags"
30                         break;
31                 fi
32         done
33
34         if test "x$db3found" = "xyes"; then
35                 ifelse([$1], , :, [$1])
36         else
37                 ifelse([$2], , :, [$2])     
38         fi
39
40         AC_SUBST(DB3_CFLAGS)
41         AC_SUBST(DB3_LIBS)
42 ])