import from HEAD
[freeradius.git] / src / modules / rlm_ippool / configure.in
1 AC_INIT(rlm_ippool.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_ippool])
4
5 if test x$with_[]modname != xno; then
6
7         AC_PROG_CC
8         AC_PROG_CPP
9
10         AC_SMART_CHECK_INCLUDE(gdbm.h)
11         AC_SMART_CHECK_LIB(gdbm, gdbm_open)
12         if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then
13                 fail="$fail libgdbm"
14         fi
15
16         if test "x$fail" = "x"; then
17                 AC_MSG_CHECKING(to see GDBM_SYNC status)
18                 AC_EGREP_CPP(found-gdbm-sync, [
19 #include <gdbm.h>
20 #ifdef GDBM_SYNC
21         found-gdbm-sync!
22 #else
23         not found.  this version must use sync by default.
24 #endif
25                         ], [
26                         AC_DEFINE(NEED_GDBM_SYNC, yes) 
27                         AC_MSG_RESULT(needs it.)
28                         ], [
29                         AC_MSG_RESULT(SYNCs by default.)
30                         ]
31                 )
32         fi
33
34         old_LIBS=$LIBS
35         LIBS="$LIBS $SMART_LIBS"
36         AC_CHECK_FUNC(gdbm_fdesc)
37         if test "x$ac_cv_func_gdbm_fdesc" = "xyes";
38         then
39                 AC_DEFINE(HAVE_GDBM_FDESC)
40         fi
41         LIBS=$old_LIBS
42
43         targetname=modname
44 else
45         targetname=
46         echo \*\*\* module modname is disabled.
47 fi
48
49 if test x"$fail" != x""; then
50         if test x"${enable_strict_dependencies}" = x"yes"; then
51                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
52         else
53                 AC_MSG_WARN([silently not building ]modname[.])
54                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); 
55                 targetname=""
56         fi
57 fi
58
59 if test x"$targetname" != x""; then
60         ippool_utils="rlm_ippool_tool"
61         ippool_install="rlm_ippool_install"
62 fi
63
64 ippool_ldflags=$SMART_LIBS
65 ippool_cflags=$SMART_CFLAGS
66 AC_SUBST(ippool_ldflags)
67 AC_SUBST(ippool_cflags)
68 AC_SUBST(targetname)
69 AC_SUBST(ippool_utils)
70 AC_SUBST(ippool_install)
71 AC_CONFIG_HEADER(config.h)
72 AC_OUTPUT(Makefile)