3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_dbm])
6 if test x$with_[]modname != xno; then
11 dnl extra argument: --with-rlm-dbm-lib-dir
13 AC_ARG_WITH(rlm-dbm-lib-dir,
14 [ --with-rlm-dbm-lib-dir=DIR Directory for DBM library files []],
17 AC_MSG_ERROR(Need rlm-dbm-lib-dir)
22 rlm_dbm_lib_dir="$withval"
27 dnl extra argument: --with-rlm-dbm-include-dir
29 AC_ARG_WITH(rlm-dbm-include-dir,
30 [ --with-rlm-dbm-include-dir=DIR Directory for DBM include files []],
33 AC_MSG_ERROR(Need rlm-dbm-include-dir)
38 rlm_dbm_include_dir="$withval"
43 smart_try_dir=$rlm_dbm_include_dir
44 FR_SMART_CHECK_INCLUDE(ndbm.h)
45 if test "x$ac_cv_header_ndbm_h" = "xyes"; then
46 SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_NDBM_H"
48 FR_SMART_CHECK_INCLUDE(gdbm/ndbm.h)
49 if test "x$ac_cv_header_gdbm_ndbm_h" = "xyes"; then
50 SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBM_NDBM_H"
52 ac_cv_header_gdbm_ndbm_h="bad autoconf assumption"
53 FR_SMART_CHECK_INCLUDE(gdbm-ndbm.h)
54 if test "x$ac_cv_header_gdbmmndbm_h" = "xyes"; then
55 SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBMNDBM_H"
57 fail="$fail (ndbm.h or gdbm/ndbm.h or gdbm-ndbm.h)"
61 AC_MSG_CHECKING([for dbm in default lib])
62 AC_TRY_LINK([extern void* dbm_open();],dbm_open(),[ac_cv_lib_default_dbm_open=yes
63 AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
64 if test "x$ac_cv_lib_default_dbm_open" != "xyes"; then
65 smart_try_dir=$rlm_dbm_lib_dir
66 FR_SMART_CHECK_LIB(ndbm, dbm_open)
67 if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
69 FR_SMART_CHECK_LIB(gdbm, dbm_open)
70 if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then
72 FR_SMART_CHECK_LIB(gdbm_compat, dbm_open)
73 if test "x$ac_cv_lib_gdbm_compat_dbm_open" != "xyes"; then
74 fail="$fail (libndbm or libgdbm or libgdbm_compat)"
83 echo \*\*\* module modname is disabled.
86 if test x"$fail" != x""; then
87 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
88 if test x"${enable_strict_dependencies}" = x"yes"; then
89 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
91 AC_MSG_WARN([silently not building ]modname[.])
96 if test "x$targetname" != "x"; then
97 dbm_utils="rlm_dbm_parser rlm_dbm_cat"
98 dbm_install="rlm_dbm_install"
101 dbm_ldflags=$SMART_LIBS
102 dbm_cflags=$SMART_CFLAGS
103 AC_SUBST(dbm_ldflags)
107 AC_SUBST(dbm_install)