-dnl $Id: db3-check.m4,v 1.23 2010-04-12 14:28:48 franklahm Exp $
dnl Autoconf macros to check for the Berkeley DB library
dnl -- check header for minimum version and return version in
])
dnl -- This is called from configure
-AC_DEFUN([AC_PATH_BDB],[
+AC_DEFUN([AC_NETATALK_PATH_BDB],[
+if test "x$bdb_required" = "xyes"; then
trybdbdir=""
dobdbsearch=yes
bdb_search_dirs="/usr/local /usr"
- search_subdirs="/ /db5 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
+ search_subdirs="/ /db5 /db5.1 /db51 /db5.0 /db50 /db4.8 /db48 /db4.7 /db47 /db4.6 /db46 /db4"
bdbfound=no
savedcflags="$CFLAGS"
if test x"${atalk_cv_bdb_version}" = x"yes"; then
BDB_CFLAGS="-I${bdbdir}/include${subdir}"
BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}"
+ if test x"$need_dash_r" = x"yes"; then
+ BDB_LIBS="$BDB_LIBS -R${bdblibdir}"
+ fi
BDB_BIN="$bdbbindir"
BDB_PATH="$bdbdir"
bdbfound=yes
break;
fi
- dnl -- Search for 64bit lib in "lib" too
- if test x"$atalk_libname" = x"lib64" ; then
+ dnl -- Search lib in "lib" too, as $atalk_libname might be set
+ dnl -- to "lib64" or "lib/64" which would not be found above
+ dnl -- if 64bit lib were installed in a dir named "lib"
+ if test x"$atalk_libname" != x"lib" ; then
bdblibdir="${bdbdir}/lib"
bdbbindir="${bdbdir}/bin"
if test x"${atalk_cv_bdb_version}" = x"yes"; then
BDB_CFLAGS="-I${bdbdir}/include${subdir}"
BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}"
+ if test x"$need_dash_r" = x"yes"; then
+ BDB_LIBS="$BDB_LIBS -R${bdblibdir}"
+ fi
BDB_BIN="$bdbbindir"
BDB_PATH="$bdbdir"
bdbfound=yes
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
+ AC_MSG_ERROR([Berkeley DB library required but not found!])
fi
CFLAGS_REMOVE_USR_INCLUDE(BDB_CFLAGS)
AC_SUBST(BDB_LIBS)
AC_SUBST(BDB_BIN)
AC_SUBST(BDB_PATH)
+fi
])