summaryrefslogtreecommitdiffstats
path: root/src/modules/rlm_counter/configure.ac
blob: d547946d35ce57577ad5a4bbd0d57e4e9d3ff05b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
AC_PREREQ([2.68])
AC_INIT(rlm_counter.c)
AC_REVISION($Revision$)
FR_INIT_MODULE([rlm_counter])

if test x$with_[]modname != xno; then

	AC_PROG_CC
	AC_PROG_CPP

	FR_SMART_CHECK_INCLUDE(gdbm.h)
	FR_SMART_CHECK_LIB(gdbm, gdbm_open)
	if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then
		fail="$fail libgdbm"
	fi

	if test "x$fail" = "x"; then
		AC_MSG_CHECKING(to see GDBM_SYNC status)
		AC_EGREP_CPP(found-gdbm-sync, [
#include <gdbm.h>
#ifdef GDBM_SYNC
	found-gdbm-sync!
#else
	not found.  this version must use sync by default.
#endif
			], [
			AC_DEFINE(NEED_GDBM_SYNC, yes, [do we need GDBM_SYNC])
			AC_MSG_RESULT(needs it.)
			], [
			AC_MSG_RESULT(SYNCs by default.)
			]
		)
	fi

	old_LIBS=$LIBS
	LIBS="$LIBS $SMART_LIBS"
	AC_CHECK_FUNC(gdbm_fdesc)
	if test "x$ac_cv_func_gdbm_fdesc" = "xyes";
	then
		AC_DEFINE(HAVE_GDBM_FDESC, [], [do we have gdbm_fdesc])
	fi
	LIBS=$old_LIBS

	targetname=modname
else
	targetname=
	echo \*\*\* module modname is disabled.
fi

if test x"$fail" != x""; then
	if test x"${enable_strict_dependencies}" = x"yes"; then
		AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
	else
		AC_MSG_WARN([silently not building ]modname[.])
		AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
		targetname=""
	fi
fi

mod_ldflags="$SMART_LIBS"
mod_cflags="$SMART_CPPFLAGS"

AC_SUBST(mod_ldflags)
AC_SUBST(mod_cflags)
AC_SUBST(targetname)
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(all.mk)