document rlm_otp fd leak fix
[freeradius.git] / src / modules / rlm_unix / configure.in
1 AC_PREREQ([2.53])
2 AC_INIT(rlm_unix.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_unix])
5
6 if test x$with_[]modname != xno; then
7
8         AC_PROG_CC
9         AC_PROG_CPP
10
11         AC_MSG_CHECKING(for system password file)
12         if test -f /etc/passwd; then
13                 AC_MSG_RESULT(/etc/passwd)
14         else
15                 AC_MSG_RESULT(no /etc/passwd file.)
16                 [ fail=$fail" /etc/passwd" ],
17         fi
18
19         dnl useless?
20         AC_MSG_CHECKING(for system shadow password file)
21         if test -f /etc/shadow; then
22                 AC_MSG_RESULT(/etc/shadow)
23         else
24                 AC_MSG_RESULT(no /etc/shadow file.)
25         fi
26
27         AC_CHECK_HEADERS(shadow.h)
28         AC_CHECK_FUNCS(getspnam getusershell)
29
30         AC_CHECK_LIB(shadow, getspnam, 
31                 [ 
32                         unix_ldflags="${unix_ldflags} -lshadow"
33                         AC_DEFINE(HAVE_GETSPNAM) 
34                 ]
35         )
36
37         targetname=modname
38 else
39         targetname=
40         echo \*\*\* module modname is disabled.
41 fi
42
43 if test x"$fail" != x""; then
44         if test x"${enable_strict_dependencies}" = x"yes"; then
45                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
46         else
47                 AC_MSG_WARN([silently not building ]modname[.])
48                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); 
49                 targetname=""
50         fi
51 fi
52
53 AC_SUBST(unix_ldflags)
54 AC_SUBST(unix_cflags)
55 AC_SUBST(targetname)
56 AC_CONFIG_HEADER(config.h)
57 AC_OUTPUT(Makefile)