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