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(ndbm.h,
28 AC_DEFINE(HAVE_NDBM_H, [1],
29 [Define to 1 if you have the <ndbm.h> header file.])
33 if test "$have_db" = true; then
35 AC_CHECK_LIB(gdbm, dbm_open, found=true, found=false)
36 AC_CHECK_LIB(gdbm, dbm_fetch,, found=false)
37 AC_CHECK_LIB(gdbm, dbm_store,, found=false)
38 AC_CHECK_LIB(gdbm, dbm_close,, found=false)
40 if test "$found" = true; then
43 AC_CHECK_LIB(gdbm_compat, dbm_open, found=true, found=false, -lgdbm)
44 AC_CHECK_LIB(gdbm_compat, dbm_fetch,, found=false, -lgdbm)
45 AC_CHECK_LIB(gdbm_compat, dbm_store,, found=false, -lgdbm)
46 AC_CHECK_LIB(gdbm_compat, dbm_close,, found="no", -lgdbm)
48 if test "$found" = "true"; then
49 libgdbm="-lgdbm_compat -lgdbm"