mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
MDBM detection feature.
This commit is contained in:
parent
a95247a58a
commit
009038a795
@ -337,6 +337,51 @@ AC_DEFUN([OL_GDBM],
|
|||||||
])dnl
|
])dnl
|
||||||
dnl
|
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 if NDBM library exists
|
||||||
dnl Check for dbm_open in standard libraries or -lndbm or -ldbm
|
dnl Check for dbm_open in standard libraries or -lndbm or -ldbm
|
||||||
dnl
|
dnl
|
||||||
|
16
configure.in
16
configure.in
@ -220,6 +220,10 @@ else
|
|||||||
$ol_with_ldbm_type = btree ; then
|
$ol_with_ldbm_type = btree ; then
|
||||||
AC_MSG_ERROR([GDBM only supports LDBM type hash])
|
AC_MSG_ERROR([GDBM only supports LDBM type hash])
|
||||||
fi
|
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 \
|
if test $ol_with_ldbm_api = ndbm -a \
|
||||||
$ol_with_ldbm_type = btree ; then
|
$ol_with_ldbm_type = btree ; then
|
||||||
AC_MSG_ERROR([NDBM only supports LDBM type hash])
|
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
|
ol_with_ldbm_api=none
|
||||||
fi
|
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
|
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
|
||||||
OL_GDBM
|
OL_GDBM
|
||||||
|
|
||||||
|
@ -636,6 +636,9 @@
|
|||||||
/* define if GNU DBM is available */
|
/* define if GNU DBM is available */
|
||||||
#undef HAVE_GDBM
|
#undef HAVE_GDBM
|
||||||
|
|
||||||
|
/* define if MDBM is available */
|
||||||
|
#undef HAVE_MDBM
|
||||||
|
|
||||||
/* define if NDBM is available */
|
/* define if NDBM is available */
|
||||||
#undef HAVE_NDBM
|
#undef HAVE_NDBM
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user