Initial commit of DBM module, from Andrei Koulik <agk@sci-nnov.ru>
[freeradius.git] / src / modules / rlm_dbm / configure.in
1 AC_INIT(rlm_dbm.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_dbm])
4
5 if test x$with_[]modname != xno; then
6
7         AC_PROG_CC
8         AC_PROG_CPP
9
10         AC_SMART_CHECK_INCLUDE(ndbm.h)
11         if test "x$ac_cv_header_ndbm_h" = "xyes"; then
12           SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_NDBM_H"
13         else
14                 AC_SMART_CHECK_INCLUDE(gdbm/ndbm.h)
15                 if test "x$ac_cv_header_gdbm_ndbm_h" = "xyes"; then
16                   SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBM_NDBM_H"
17                 fi
18         fi
19
20         AC_SMART_CHECK_LIB(ndbm, dbm_open)
21         if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
22                 fail="$fail libdbm"
23         fi
24
25         targetname=modname
26 else
27         targetname=
28         echo \*\*\* module modname is disabled.
29 fi
30
31 if test x"$fail" != x""; then
32         if test x"${enable_strict_dependencies}" = x"yes"; then
33                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
34         else
35                 AC_MSG_WARN([silently not building ]modname[.])
36                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); 
37                 targetname=""
38         fi
39 fi
40
41 dbm_ldflags=$SMART_LIBS
42 dbm_cflags=$SMART_CFLAGS
43 AC_SUBST(dbm_ldflags)
44 AC_SUBST(dbm_cflags)
45 AC_SUBST(targetname)
46 AC_OUTPUT(Makefile)