7f9401335541b079b267820863b39f23d32a42a8
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_tnc / configure.ac
1 AC_INIT(rlm_eap_tnc.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_eap_tnc])
4
5 if test x$with_[]modname != xno; then
6         dnl extra argument: --with-eap-tnc-include-dir=DIR
7         eap_tnc_include_dir=
8         AC_ARG_WITH(eap-tnc-include-dir,
9                 [AS_HELP_STRING([--with-eap-tnc-include-dir=DIR],
10                 [Directory where the libtnc includes may be found])],
11                 [case "$withval" in
12                     no)
13                         AC_MSG_ERROR(Need eap-tnc-include-dir)
14                     ;;
15                         yes)
16                     ;;
17                     *)
18                         eap_tnc_include_dir="$withval"
19                     ;;
20                 esac])
21
22         dnl extra argument: --with-eap-tnc-lib-dir=DIR
23         eap_tnc_lib_dir=
24         AC_ARG_WITH(eap-tnc-lib-dir,
25         [AS_HELP_STRING([--with-eap-tnc-lib-dir=DIR],
26                 [Directory where the libtnc libraries may be found])],
27                 [case "$withval" in
28                     no)
29                         AC_MSG_ERROR(Need eap-tnc-lib-dir)
30                         ;;
31                     yes)
32                         ;;
33                     *)
34                         eap_tnc_lib_dir="$withval"
35                         ;;
36                 esac])
37
38         dnl extra argument: --with-eap-tnc-dir=DIR
39         AC_ARG_WITH(eap-tnc-dir,
40         [AS_HELP_STRING([--with-eap-tnc-dir=DIR],
41                 [Base directory where libtnc is installed])],
42                 [case "$withval" in
43                     no)
44                         AC_MSG_ERROR(Need eap-tnc-dir)
45                         ;;
46                     yes)
47                         ;;
48                     *)
49                         eap_tnc_lib_dir="$withval/lib"
50                         eap_tnc_include_dir="$withval/include"
51                         ;;
52                 esac])
53
54         dnl ############################################################
55         dnl # Check for eap-tnc includes
56         dnl ############################################################
57         smart_try_dir="$eap_tnc_include_dir"
58         FR_SMART_CHECK_INCLUDE([naaeap/naaeap.h])
59         if test "x$ac_cv_header_naaeap_naaeap_h" != "xyes"; then
60                 fail="$fail naaeap.h"
61         fi
62         
63         dnl ############################################################
64         dnl # Check for eap-tnc library
65         dnl ############################################################
66         
67         smart_try_dir="$eap_tnc_lib_dir"
68         FR_SMART_CHECK_LIB([naaeap],[processEAPTNCData])
69         if test "x$ac_cv_lib_naaeap_processEAPTNCData" != "xyes"; then
70                 fail="$fail libnaaeap"
71         fi
72         
73         targetname=modname     # keep this!  Don't change!
74 else
75         targetname=            # keep this!  Don't change!
76         echo \*\*\* module modname is disabled.  # keep this!  Don't change!
77 fi
78
79 dnl  Don't change this section.
80 if test x"$fail" != x""; then
81         if test x"${enable_strict_dependencies}" = x"yes"; then
82                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
83         else
84                 AC_MSG_WARN([silently not building ]modname[.])
85                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
86                 AC_MSG_WARN([Required libraries are available from https://github.com/trustatfhh/tnc-fhh]); 
87                 targetname=""
88         fi
89 fi
90
91 mod_cflags="${SMART_CFLAGS}"
92 mod_ldflags="${SMART_LIBS}"
93
94 AC_SUBST(mod_cflags)
95 AC_SUBST(mod_ldflags)
96
97 AC_SUBST(targetname)  # keep this!  Don't change!
98 AC_OUTPUT(all.mk)  # keep this!  Don't change!