Hoist OpenSSL checks from a number of different places into
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_sim / configure.in
1 AC_INIT(rlm_eap_sim.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_eap_sim])
4
5 fail=
6 SMART_LIBS=
7 SMART_CLFAGS=
8 if test x$with_[]modname != xno; then
9
10         AC_PROG_CC
11
12         if test "x$OPENSSL_INCLUDE" != "x"; then
13           SMART_CFLAGS="-I$OPENSSL_INCLUDE"
14         else
15           fail="$fail (openssl/ssl.h)"
16         fi
17
18         if test "x$OPENSSL_LIBS" != "x"; then
19           SMART_LIBS="-L$OPENSSL_LIBS -lcrypto -lssl"
20         else
21           fail="$fail libssl"
22         fi
23
24         targetname=modname
25 else
26         targetname=
27         echo \*\*\* module modname is disabled.
28 fi
29
30 if test x"$fail" != x""; then
31         if test x"${enable_strict_dependencies}" = x"yes"; then
32                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
33         else
34                 AC_MSG_WARN([silently not building ]modname[.])
35                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
36                 if test x"$headersuggestion" != x; then
37                         AC_MSG_WARN([$headersuggestion]) 
38                 fi
39                 if test x"$libsuggestion" != x; then
40                         AC_MSG_WARN([$libsuggestion]) 
41                 fi
42                 targetname=""
43         fi
44 fi
45
46 eap_sim_ldflags=$SMART_LIBS
47 eap_sim_cflags=$SMART_CFLAGS
48 AC_SUBST(eap_sim_ldflags)
49 AC_SUBST(eap_sim_cflags)
50 AC_SUBST(targetname)
51 AC_CONFIG_HEADER([config.h])
52 AC_OUTPUT(Makefile)