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