1 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
4 AC_CHECK_HEADER(gdbm-ndbm.h,
7 AC_DEFINE(HAVE_GDBM_NDBM_H, [1],
8 [Define to 1 if you have the <gdbm-ndbm.h> header file.])
11 if test -z "$have_db"; then
12 dnl gdbm-ndbm.h and gdbm/ndbm.h map to the same autoconf internal
13 dnl variable. We need to clear it or this test will be skipped
14 dnl and the cached result from first test will be used.
15 AS_UNSET([ac_cv_header_gdbm_ndbm_h])
16 AC_CHECK_HEADER(gdbm/ndbm.h,
19 AC_DEFINE(HAVE_GDBM_NDBM_H_, [1],
20 [Define to 1 if you have the <gdbm/ndbm.h> header file.])
24 if test -z "$have_db"; then
25 AC_CHECK_HEADER(gdbm.h,
33 AC_CHECK_HEADER(ndbm.h,
39 if test $gdbm_ndbm_ = true; then
40 if test $ndbm_ = true; then
41 AC_DEFINE(HAVE_GDBM_H, [1],
42 [Define to 1 if you have both <gdbm.h> and <ndbm.h> header files.])
47 if test "$have_db" = true; then
49 AC_CHECK_LIB(gdbm, dbm_open, found=true, found=false)
50 AC_CHECK_LIB(gdbm, dbm_fetch,, found=false)
51 AC_CHECK_LIB(gdbm, dbm_store,, found=false)
52 AC_CHECK_LIB(gdbm, dbm_close,, found=false)
54 if test "$found" = true; then
57 AC_CHECK_LIB(gdbm_compat, dbm_open, found=true, found=false, -lgdbm)
58 AC_CHECK_LIB(gdbm_compat, dbm_fetch,, found=false, -lgdbm)
59 AC_CHECK_LIB(gdbm_compat, dbm_store,, found=false, -lgdbm)
60 AC_CHECK_LIB(gdbm_compat, dbm_close,, found="no", -lgdbm)
62 if test "$found" = "true"; then
63 libgdbm="-lgdbm_compat -lgdbm"