1 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
2 [ AC_CHECK_HEADER(gdbm-ndbm.h, [ gdbm_ndbm=true; have_db=true ], [ gdbm_ndbm=false; have_db=false ])
4 if test $gdbm_ndbm = true; then
5 AC_DEFINE(HAVE_GDBM_NDBM_H, [1], [Define to 1 if you have the <gdbm-ndbm.h> header file.])
7 AS_UNSET([ac_cv_header_gdbm_ndbm_h])
8 AC_CHECK_HEADER(gdbm/ndbm.h, [ gdbm_ndbm_=true; have_db=true ], [ gdbm_ndbm_=false; have_db=false ])
9 if test $gdbm_ndbm_ = true; then
10 AC_DEFINE(HAVE_GDBM_NDBM_H_, [1], [Define to 1 if you have the <gdbm/ndbm.h> header file.])
12 AC_CHECK_HEADER(gdbm.h, [ gdbm_ndbm_=true; have_db=true ], [ gdbm_ndbm_=false; have_db=false ])
13 AC_CHECK_HEADER(ndbm.h, [ ndbm_=true ], [ ndbm_=false ])
14 if test $gdbm_ndbm_ = true; then
15 if test $ndbm_ = true; then
16 AC_DEFINE(HAVE_GDBM_H, [1], [Define to 1 if you have both <gdbm.h> and <ndbm.h> header files.])
25 if test $have_db = true; then
26 AC_CHECK_LIB(gdbm,dbm_open,found=true,found=false)
27 AC_CHECK_LIB(gdbm,dbm_fetch,,found=false)
28 AC_CHECK_LIB(gdbm,dbm_store,,found=false)
29 AC_CHECK_LIB(gdbm,dbm_close,,found=false)
31 if test $found = true; then
32 libgdbm="${libgdbm} -lgdbm"
36 AC_CHECK_LIB(gdbm_compat,dbm_open,found=true,found=false,-lgdbm)
37 AC_CHECK_LIB(gdbm_compat,dbm_fetch,,found=false,-lgdbm)
38 AC_CHECK_LIB(gdbm_compat,dbm_store,,found=false,-lgdbm)
39 AC_CHECK_LIB(gdbm_compat,dbm_close,,found="no",-lgdbm)
41 if test $found = true ; then
42 libgdbm="${libgdbm} -lgdbm_compat -lgdbm"