Permit EAP-Message and State from the home server, so that
[freeradius.git] / src / modules / rlm_perl / configure.in
1 AC_INIT(rlm_perl.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_perl])
4
5 if test x$with_[]modname != xno; then
6
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
14         AC_CHECK_PROG(PERL, perl, yes, no)
15         if test "$PERL" = "no"; then
16            fail=$fail" perl"
17         else
18           old_CFLAGS=$CFLAGS
19           CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
20
21           smart_try_dir=
22           AC_SMART_CHECK_INCLUDE(EXTERN.h)
23           if test "x$ac_cv_header_EXTERN_h" = "xyes"; then
24                 perl_cflags="`perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
25           else
26                 fail="$fail EXTERN.h"
27                 targetname=
28           fi
29
30           AC_SMART_CHECK_INCLUDE(perl.h, [#include <EXTERN.h>])
31           if test "x$ac_cv_header_perl_h" = "xyes"; then
32                 perl_cflags="`perl -MExtUtils::Embed -e ccopts; perl -MConfig -e 'print $Config{cppflags}'`"
33           else
34                 fail="$fail perl.h"
35                 targetname=
36           fi
37
38           perl_ldflags='`perl -MExtUtils::Embed -e ldopts`'
39
40           CFLAGS=$old_CFLAGS
41         fi
42         targetname=modname
43
44 else
45         targetname=
46         echo \*\*\* module modname is disabled.  # keep this!  Don't change!
47 fi
48
49 dnl  Don't change this section.
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                 perl_cflags=""
58                 perl_ldflags=""
59         fi
60 fi
61
62
63 AC_SUBST(perl_cflags)
64 AC_SUBST(perl_ldflags)
65
66 AC_CONFIG_HEADER(config.h)
67
68 AC_SUBST(targetname)
69 AC_OUTPUT(Makefile)