b6997a637617ada342598bd5137b8256284f3d18
[freeradius.git] / src / modules / rlm_example / configure.ac
1 AC_PREREQ([2.53])
2 AC_INIT(rlm_example.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_example])
5
6 if test x$with_[]modname != xno; then
7         AC_PROG_CC
8         AC_PROG_CPP
9
10         dnl put configuration checks here.
11         dnl set $fail to what's missing, on fatal errors.
12         dnl use AC_MSG_WARN() on important messages.
13         FR_SMART_CHECK_LIB(c, printf)
14         if test "x$ac_cv_lib_c_printf" != "xyes"; then
15                 fail="$fail libc"
16         fi
17
18         FR_SMART_CHECK_INCLUDE(stdio.h)
19         if test "$ac_cv_header_stdio_h" != "yes"; then
20                 fail="$fail stdio.h"
21         fi
22         targetname=modname
23 else
24         targetname=
25         echo \*\*\* module modname is disabled.
26 fi
27
28 if test x"$fail" != x""; then
29         if test x"${enable_strict_dependencies}" = x"yes"; then
30                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
31         else
32                 AC_MSG_WARN([silently not building ]modname[.])
33                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
34                 targetname=""
35         fi
36 fi
37
38 mod_ldflags="${SMART_LIBS}"
39 mod_cflags="${SMART_CFLAGS}"
40
41 AC_SUBST(mod_cflags)
42 AC_SUBST(mod_ldflags)
43
44 AC_CONFIG_HEADER(config.h)
45
46 AC_SUBST(targetname)
47 AC_OUTPUT(all.mk)