check for libradsec
[mech_eap.orig] / acinclude.m4
1 dnl Based on the one from the Boinc project by Reinhard
2
3 AC_DEFUN([AX_CHECK_KRB5],
4 [AC_MSG_CHECKING(for GSS-API and Kerberos implementation)
5 KRB5_DIR=
6 found_krb5="no"
7 AC_ARG_WITH(krb5,
8     AC_HELP_STRING([--with-krb5],
9        [Use krb5 (in specified installation directory)]),
10     [check_krb5_dir="$withval"],
11     [check_krb5_dir=])
12 for dir in $check_krb5_dir /usr /usr/local ; do
13    krb5dir="$dir"
14    if test -x "$dir/bin/krb5-config"; then
15      found_krb5="yes";
16      KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
17      KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`;
18      break;
19    fi
20 done
21 AC_MSG_RESULT($found_krb5)
22 if test x_$found_krb5 != x_yes; then
23    AC_MSG_ERROR([
24 ----------------------------------------------------------------------
25   Cannot find GSS-API/Kerberos libraries.
26
27   Please install MIT or Heimdal or specify installation directory with
28   --with-krb5=(dir).
29 ----------------------------------------------------------------------
30 ])
31 else
32         printf "Kerberos found in $krb5dir\n";
33         AC_SUBST(KRB5_CFLAGS)
34         AC_SUBST(KRB5_LIBS)
35         AC_CHECK_LIB(gssapi_krb5, GSS_C_NT_COMPOSITE_EXPORT, [AC_DEFINE_UNQUOTED([HAVE_GSS_C_NT_COMPOSITE_EXPORT], 1, [Define if GSS-API library supports recent naming extensions draft])], [], "$KRB5_LIBS")
36         AC_CHECK_LIB(gssapi_krb5, gss_inquire_attrs_for_mech, [AC_DEFINE_UNQUOTED([HAVE_GSS_INQUIRE_ATTRS_FOR_MECH], 1, [Define if GSS-API library supports RFC 5587])], [], "$KRB5_LIBS")
37         AC_CHECK_LIB(gssapi_krb5, gss_krb5_import_cred, [AC_DEFINE_UNQUOTED([HAVE_GSS_KRB5_IMPORT_CRED], 1, [Define if GSS-API library supports gss_krb5_import_cred])], [], "$KRB5_LIBS")
38 fi
39 ])dnl
40
41 AC_DEFUN([AX_CHECK_EAP],
42 [AC_MSG_CHECKING(for EAP implementation)
43 EAP_DIR=
44 found_eap="no"
45 AC_ARG_WITH(eap,
46     AC_HELP_STRING([--with-eap],
47        [Use eap (in specified installation directory)]),
48     [check_eap_dir="$withval"],
49     [check_eap_dir=])
50 for dir in $check_eap_dir /usr /usr/local ; do
51    eapdir="$dir"
52    if test -f "$dir/src/eap_peer/eap.h"; then
53      found_eap="yes";
54      EAP_DIR="${eapdir}"
55      EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
56      break;
57    fi
58 done
59 AC_MSG_RESULT($found_eap)
60 if test x_$found_eap != x_yes; then
61    AC_MSG_ERROR([
62 ----------------------------------------------------------------------
63   Cannot find EAP libraries.
64
65   Please install wpa_supplicant or specify installation directory with
66   --with-eap=(dir).
67 ----------------------------------------------------------------------
68 ])
69 else
70         printf "EAP found in $eapdir\n";
71         EAP_CFLAGS="$EAP_CFLAGS \
72 -DEAP_TLS \
73 -DEAP_PEAP \
74 -DEAP_TTLS \
75 -DEAP_MD5 \
76 -DEAP_MSCHAPv2 \
77 -DEAP_GTC \
78 -DEAP_OTP \
79 -DEAP_LEAP \
80 -DEAP_PSK \
81 -DEAP_PAX \
82 -DEAP_SAKE \
83 -DEAP_GPSK \
84 -DEAP_GPSK_SHA256 \
85 -DEAP_SERVER_IDENTITY \
86 -DEAP_SERVER_TLS \
87 -DEAP_SERVER_PEAP \
88 -DEAP_SERVER_TTLS \
89 -DEAP_SERVER_MD5 \
90 -DEAP_SERVER_MSCHAPV2 \
91 -DEAP_SERVER_GTC \
92 -DEAP_SERVER_PSK \
93 -DEAP_SERVER_PAX \
94 -DEAP_SERVER_SAKE \
95 -DEAP_SERVER_GPSK \
96 -DEAP_SERVER_GPSK_SHA256 \
97 -DIEEE8021X_EAPOL";
98         EAP_LIBS="-leap -lutils -lcrypto -ltls";
99         EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
100         AC_SUBST(EAP_CFLAGS)
101         AC_SUBST(EAP_LDFLAGS)
102         AC_SUBST(EAP_LIBS)
103 fi
104 ])dnl
105
106 AC_DEFUN([AX_CHECK_SHIBSP],
107 [AC_MSG_CHECKING(for Shibboleth implementation)
108 SHIBSP_DIR=
109 found_shibsp="no"
110 AC_ARG_WITH(shibsp,
111     AC_HELP_STRING([--with-shibsp],
112        [Use shibspboleth (in specified installation directory)]),
113     [check_shibsp_dir="$withval"],
114     [check_shibsp_dir=])
115 for dir in $check_shibsp_dir /usr /usr/local ; do
116    shibspdir="$dir"
117    if test -f "$dir/include/shibsp/SPConfig.h"; then
118      found_shibsp="yes";
119      SHIBSP_DIR="${shibspdir}"
120      SHIBSP_CXXFLAGS="-I$shibspdir/include";
121      break;
122    fi
123 done
124 AC_MSG_RESULT($found_shibsp)
125 if test x_$found_shibsp != x_yes; then
126    AC_MSG_ERROR([
127 ----------------------------------------------------------------------
128   Cannot find Shibboleth/OpenSAML libraries.
129
130   Please install Shibboleth or specify installation directory with
131   --with-shibsp=(dir).
132 ----------------------------------------------------------------------
133 ])
134 else
135         printf "Shibboleth found in $shibspdir\n";
136         SHIBSP_LIBS="-lshibsp -llog4shib -lsaml -lxml-security-c -lxmltooling -lxerces-c";
137         SHIBSP_LDFLAGS="-L$shibspdir/lib";
138         AC_SUBST(SHIBSP_CXXFLAGS)
139         AC_SUBST(SHIBSP_LDFLAGS)
140         AC_SUBST(SHIBSP_LIBS)
141 fi
142 ])dnl
143
144 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
145 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
146 SHIBRESOLVER_DIR=
147 found_shibresolver="no"
148 AC_ARG_WITH(shibresolver,
149     AC_HELP_STRING([--with-shibresolver],
150        [Use Shibboleth resolver (in specified installation directory)]),
151     [check_shibresolver_dir="$withval"],
152     [check_shibresolver_dir=])
153 for dir in $check_shibresolver_dir /usr /usr/local ; do
154    shibresolverdir="$dir"
155    if test -f "$dir/include/shibresolver/resolver.h"; then
156      found_shibresolver="yes";
157      SHIBRESOLVER_DIR="${shibresolverdir}"
158      SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
159      break;
160    fi
161 done
162 AC_MSG_RESULT($found_shibresolver)
163 if test x_$found_shibresolver != x_yes; then
164    AC_MSG_ERROR([
165 ----------------------------------------------------------------------
166   Cannot find Shibboleth resolver libraries.
167
168   Please install Shibboleth or specify installation directory with
169   --with-shibresolver=(dir).
170 ----------------------------------------------------------------------
171 ])
172 else
173         printf "Shibboleth resolver found in $shibresolverdir\n";
174         SHIBRESOLVER_LIBS="-lshibresolver";
175         SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
176         AC_SUBST(SHIBRESOLVER_CXXFLAGS)
177         AC_SUBST(SHIBRESOLVER_LDFLAGS)
178         AC_SUBST(SHIBRESOLVER_LIBS)
179 fi
180 ])dnl
181
182 AC_DEFUN([AX_CHECK_RADSEC],
183 [AC_MSG_CHECKING(for radsec)
184 RADSEC_DIR=
185 found_radsec="no"
186 AC_ARG_WITH(radsec,
187     AC_HELP_STRING([--with-radsec],
188        [Use radsec (in specified installation directory)]),
189     [check_radsec_dir="$withval"],
190     [check_radsec_dir=])
191 for dir in $check_radsec_dir /usr /usr/local ; do
192    radsecdir="$dir"
193    if test -f "$dir/include/radsec/radsec.h"; then
194      found_radsec="yes";
195      RADSEC_DIR="${radsecdir}"
196      RADSEC_CFLAGS="-I$radsecdir/include";
197      break;
198    fi
199 done
200 AC_MSG_RESULT($found_radsec)
201 if test x_$found_radsec != x_yes; then
202    AC_MSG_ERROR([
203 ----------------------------------------------------------------------
204   Cannot find radsec libraries.
205
206   Please install libradsec or specify installation directory with
207   --with-radsec=(dir).
208 ----------------------------------------------------------------------
209 ])
210 else
211         printf "radsec found in $radsecdir\n";
212         RADSEC_LIBS="-lradsec";
213         RADSEC_LDFLAGS="-L$$radsecdir/lib";
214         AC_SUBST(RADSEC_CLFAGS)
215         AC_SUBST(RADSEC_LDFLAGS)
216         AC_SUBST(RADSEC_LIBS)
217 fi
218 ])dnl