autotools revamp:
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_ttls / configure.in
1 AC_INIT(rlm_eap_ttls.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_eap_ttls])
4
5 fail=
6 SMART_LIBS=
7 SMART_CLFAGS=
8 if test x$with_[]modname != xno; then
9
10         AC_PROG_CC
11
12         dnl #
13         dnl # extra argument: --openssl-includes=dir
14         dnl #
15         AC_ARG_WITH(openssl-includes,
16         [  --with-openssl-includes=DIR       Directory to look for OpenSSL include files],
17         [ case "$withval" in
18             *)
19                 rlm_eap_peap_inc_dir="$rlm_eap_peap_inc_dir $withval"
20                 SMART_CFLAGS="$SMART_CFLAGS -I$withval"
21                 ;;
22           esac ]
23         )
24
25         dnl #
26         dnl # extra argument: --openssl-libraries=dir
27         dnl #
28         AC_ARG_WITH(openssl-libraries,
29         [  --with-openssl-libraries=DIR      Directory to look for OpenSSL library files],
30         [ case "$withval" in
31             *)
32                 rlm_eap_peap_lib_dir="$rlm_eap_peap_lib_dir $withval"
33                 SMART_LIBS="$SMART_LIBS -L$withval"
34                 ;;
35           esac ]
36         )
37
38         smart_try_dir=$rlm_eap_peap_inc_dir
39         FR_SMART_CHECK_INCLUDE(openssl/ssl.h)
40         if test "x$ac_cv_header_openssl_ssl_h" != "xyes"; then
41                 fail="$fail (openssl/ssl.h)"
42         fi
43
44         smart_try_dir=$rlm_eap_peap_lib_dir
45         FR_SMART_CHECK_LIB(crypto, DH_new)
46     if test "x$ac_cv_lib_crypto_DH_new" != "xyes"; then
47             fail="$fail libcrypto"
48     fi
49
50         FR_SMART_CHECK_LIB(ssl, SSL_new)
51     if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then
52             fail="$fail libssl"
53     fi
54
55         AC_CHECK_HEADERS( \
56                 openssl/err.h \
57                 openssl/engine.h \
58         )
59
60         targetname=modname
61 else
62         targetname=
63         echo \*\*\* module modname is disabled.
64 fi
65
66 if test x"$fail" != x""; then
67         if test x"${enable_strict_dependencies}" = x"yes"; then
68                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
69         else
70                 AC_MSG_WARN([silently not building ]modname[.])
71                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
72                 if test x"$headersuggestion" != x; then
73                         AC_MSG_WARN([$headersuggestion]) 
74                 fi
75                 if test x"$libsuggestion" != x; then
76                         AC_MSG_WARN([$libsuggestion]) 
77                 fi
78                 targetname=""
79         fi
80 fi
81
82 eap_ttls_ldflags=$SMART_LIBS
83 eap_ttls_cflags=$SMART_CFLAGS
84 AC_SUBST(eap_ttls_ldflags)
85 AC_SUBST(eap_ttls_cflags)
86 AC_SUBST(targetname)
87 AC_CONFIG_HEADER([config.h])
88 AC_OUTPUT(Makefile)