]> git.sur5r.net Git - openldap/commitdiff
MDBM detection feature.
authorJuan Gomez <gomez@openldap.org>
Tue, 30 Mar 1999 04:25:52 +0000 (04:25 +0000)
committerJuan Gomez <gomez@openldap.org>
Tue, 30 Mar 1999 04:25:52 +0000 (04:25 +0000)
build/openldap.m4
configure.in
include/portable.h.in

index f5a14dfcf1e0fa3475a04ba2fe48f967c4ac9b7c..16e2647c009caeea528a77dc6c49c440cb9b7bd9 100644 (file)
@@ -337,6 +337,51 @@ AC_DEFUN([OL_GDBM],
 ])dnl
 dnl
 dnl ====================================================================
+dnl Check if MDBM library exists
+dnl Check for mdbm_open in standard libraries or -lmdbm
+dnl
+dnl defines ol_cv_lib_mdbm to 'yes' or '-lmdbm' or 'no'
+dnl            'yes' implies mdbm_open is in $LIBS
+dnl
+dnl uses:
+dnl            AC_CHECK_FUNC(mdbm_set_chain)
+dnl            AC_CHECK_LIB(mdbm,mdbm_set_chain)
+dnl
+AC_DEFUN([OL_LIB_MDBM],
+[AC_CACHE_CHECK(for MDBM library, [ol_cv_lib_mdbm],
+[      ol_LIBS="$LIBS"
+       AC_CHECK_FUNC(mdbm_set_chain,[ol_cv_lib_mdbm=yes], [
+               AC_CHECK_LIB(mdbm,mdbm_set_chain,[ol_cv_lib_mdbm=-lmdbm],[ol_cv_lib_mdbm=no])
+       ])
+       LIBS="$ol_LIBS"
+])
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check if MDBM exists
+dnl
+dnl defines ol_cv_mdbm to 'yes' or 'no'
+dnl 
+dnl uses:
+dnl            OL_LIB_MDBM
+dnl            AC_CHECK_HEADERS(mdbm.h)
+dnl
+AC_DEFUN([OL_MDBM],
+[AC_REQUIRE([OL_LIB_MDBM])
+ AC_CHECK_HEADERS(mdbm.h)
+ AC_CACHE_CHECK(for db, [ol_cv_mdbm], [
+       if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
+               ol_cv_mdbm=no
+       else
+               ol_cv_mdbm=yes
+       fi
+])
+ if test $ol_cv_mdbm = yes ; then
+       AC_DEFINE(HAVE_MDBM,1, [define if MDBM is available])
+ fi
+])dnl
+dnl
+dnl ====================================================================
 dnl Check if NDBM library exists
 dnl Check for dbm_open in standard libraries or -lndbm or -ldbm
 dnl
index 61dc27746e08f7e59f5b510357fe72b96edfa164..3b2b2e7f082ff459f9dd6535ecbb00109cc2a771 100644 (file)
@@ -220,6 +220,10 @@ else
                $ol_with_ldbm_type = btree ; then
                AC_MSG_ERROR([GDBM only supports LDBM type hash])
        fi
+       if test $ol_with_ldbm_api = mdbm -a \
+               $ol_with_ldbm_type = btree ; then
+               AC_MSG_ERROR([MDBM only supports LDBM type hash])
+       fi
        if test $ol_with_ldbm_api = ndbm -a \
                $ol_with_ldbm_type = btree ; then
                AC_MSG_ERROR([NDBM only supports LDBM type hash])
@@ -1397,6 +1401,18 @@ if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
        ol_with_ldbm_api=none
 fi
 
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
+       OL_MDBM
+
+       if test $ol_cv_mdbm = yes ; then
+               ol_link_ldbm=mdbm
+               ol_with_ldbm_api=mdbm
+               if test $ol_cv_lib_mdbm != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
+               fi
+       fi
+fi
+
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
        OL_GDBM
 
index 8ea0c646e19477fbbbccc9efb59adcc6544dedb4..3ac216399c92eee35940097333df7fc7773391dd 100644 (file)
 /* define if GNU DBM is available */
 #undef HAVE_GDBM
 
+/* define if MDBM is available */
+#undef HAVE_MDBM
+
 /* define if NDBM is available */
 #undef HAVE_NDBM