1 dnl Based on the one from the Boinc project by Reinhard
3 AC_DEFUN([AX_CHECK_KRB5],
4 [AC_MSG_CHECKING(for GSS-API and Kerberos implementation)
8 AC_HELP_STRING([--with-krb5],
9 [Use krb5 (in specified installation directory)]),
10 [check_krb5_dir="$withval"],
12 AM_COND_IF(TARGET_WINDOWS,[
14 krb5dir=$check_krb5_dir
15 KRB5_CFLAGS=-I"$check_krb5_dir/include"
16 KRB5_LIBS="-L$check_krb5_dir/lib/ -lkrb5_32 -lgssapi32"
19 [for dir in $check_krb5_dir $prefix /usr /usr/local ; do
21 if test -x "$dir/bin/krb5-config"; then
23 KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
24 KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`;
25 COMPILE_ET="$dir/bin/compile_et";
29 AC_MSG_RESULT($found_krb5)
30 if test x_$found_krb5 != x_yes; then
32 ----------------------------------------------------------------------
33 Cannot find GSS-API/Kerberos libraries.
35 Please install MIT or Heimdal or specify installation directory with
37 ----------------------------------------------------------------------
40 printf "Kerberos found in $krb5dir\n";
44 AC_CHECK_LIB(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")
45 AC_CHECK_LIB(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")
46 AC_CHECK_LIB(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")
47 AC_CHECK_LIB(krb5, heimdal_version, [AC_DEFINE_UNQUOTED([HAVE_HEIMDAL_VERSION], 1, [Define if building against Heimdal Kerberos implementation]), heimdal=yes], [heimdal=no], "$KRB5_LIBS")
48 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
52 AC_DEFUN([AX_CHECK_EAP],
53 [AC_MSG_CHECKING(for EAP implementation)
57 AC_HELP_STRING([--with-eap],
58 [Use eap (in specified installation directory)]),
59 [check_eap_dir="$withval"],
61 for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
63 if test -f "$dir/src/eap_peer/eap.h"; then
66 EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
70 AC_MSG_RESULT($found_eap)
71 if test x_$found_eap != x_yes; then
73 ----------------------------------------------------------------------
74 Cannot find EAP libraries.
76 Please install wpa_supplicant or specify installation directory with
78 ----------------------------------------------------------------------
81 printf "EAP found in $eapdir\n";
82 EAP_CFLAGS="$EAP_CFLAGS \
96 -DEAP_SERVER_IDENTITY \
101 -DEAP_SERVER_MSCHAPV2 \
107 -DEAP_SERVER_GPSK_SHA256 \
109 EAP_LIBS="-leap -lutils -lcrypto -ltls";
110 EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
112 AC_SUBST(EAP_LDFLAGS)
117 AC_DEFUN([AX_CHECK_SHIBSP],
118 [AC_MSG_CHECKING(for Shibboleth implementation)
122 AC_HELP_STRING([--with-shibsp],
123 [Use shibspboleth (in specified installation directory)]),
124 [check_shibsp_dir="$withval"],
126 for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
128 if test -f "$dir/include/shibsp/SPConfig.h"; then
130 SHIBSP_DIR="${shibspdir}"
131 SHIBSP_CXXFLAGS="-I$shibspdir/include";
135 AC_MSG_RESULT($found_shibsp)
136 if test x_$found_shibsp != x_yes; then
138 ----------------------------------------------------------------------
139 Cannot find Shibboleth/OpenSAML libraries.
141 Please install Shibboleth or specify installation directory with
143 ----------------------------------------------------------------------
146 printf "Shibboleth found in $shibspdir\n";
147 SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
148 SHIBSP_LDFLAGS="-L$shibspdir/lib";
149 AC_SUBST(SHIBSP_CXXFLAGS)
150 AC_SUBST(SHIBSP_LDFLAGS)
151 AC_SUBST(SHIBSP_LIBS)
155 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
156 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
158 found_shibresolver="no"
159 AC_ARG_WITH(shibresolver,
160 AC_HELP_STRING([--with-shibresolver],
161 [Use Shibboleth resolver (in specified installation directory)]),
162 [check_shibresolver_dir="$withval"],
163 [check_shibresolver_dir=])
164 for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
165 shibresolverdir="$dir"
166 if test -f "$dir/include/shibresolver/resolver.h"; then
167 found_shibresolver="yes";
168 SHIBRESOLVER_DIR="${shibresolverdir}"
169 SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
173 AC_MSG_RESULT($found_shibresolver)
174 if test x_$found_shibresolver != x_yes; then
176 ----------------------------------------------------------------------
177 Cannot find Shibboleth resolver libraries.
179 Please install Shibboleth or specify installation directory with
180 --with-shibresolver=(dir).
181 ----------------------------------------------------------------------
184 printf "Shibboleth resolver found in $shibresolverdir\n";
185 SHIBRESOLVER_LIBS="-lshibresolver";
186 SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
187 AC_SUBST(SHIBRESOLVER_CXXFLAGS)
188 AC_SUBST(SHIBRESOLVER_LDFLAGS)
189 AC_SUBST(SHIBRESOLVER_LIBS)
193 AC_DEFUN([AX_CHECK_WINDOWS],
194 [AC_MSG_CHECKING(for windows)
196 AC_CHECK_HEADER(windows.h,[target_windows="yes"],[target_windows="no"])
197 AC_MSG_RESULT($target_windows)
198 AM_CONDITIONAL(TARGET_WINDOWS,test "x$target_windows" == "xyes")
202 AC_DEFUN([AX_CHECK_RADSEC],
203 [AC_MSG_CHECKING(for radsec)
207 AC_HELP_STRING([--with-radsec],
208 [Use radsec (in specified installation directory)]),
209 [check_radsec_dir="$withval"],
211 for dir in $check_radsec_dir $prefix /usr /usr/local ; do
213 if test -f "$dir/include/radsec/radsec.h"; then
215 RADSEC_DIR="${radsecdir}"
216 RADSEC_CFLAGS="-I$radsecdir/include";
220 AC_MSG_RESULT($found_radsec)
221 if test x_$found_radsec != x_yes; then
223 ----------------------------------------------------------------------
224 Cannot find radsec libraries.
226 Please install libradsec or specify installation directory with
228 ----------------------------------------------------------------------
231 printf "radsec found in $radsecdir\n";
232 RADSEC_LIBS="-lradsec";
233 RADSEC_LDFLAGS="-L$radsecdir/lib";
234 AC_SUBST(RADSEC_CFLAGS)
235 AC_SUBST(RADSEC_LDFLAGS)
236 AC_SUBST(RADSEC_LIBS)
240 AC_DEFUN([AX_CHECK_JANSSON],
241 [AC_MSG_CHECKING(for jansson)
245 AC_HELP_STRING([--with-jansson],
246 [Use jansson (in specified installation directory)]),
247 [check_jansson_dir="$withval"],
248 [check_jansson_dir=])
249 for dir in $check_jansson_dir $prefix /usr /usr/local ; do
251 if test -f "$dir/include/jansson.h"; then
253 JANSSON_DIR="${janssondir}"
254 JANSSON_CFLAGS="-I$janssondir/include";
258 AC_MSG_RESULT($found_jansson)
259 if test x_$found_jansson != x_yes; then
261 ----------------------------------------------------------------------
262 Cannot find jansson libraries.
264 Please install libjansson or specify installation directory with
265 --with-jansson=(dir).
266 ----------------------------------------------------------------------
269 printf "jansson found in $janssondir\n";
270 JANSSON_LIBS="-ljansson";
271 JANSSON_LDFLAGS="-L$janssondir/lib";
272 AC_SUBST(JANSSON_CFLAGS)
273 AC_SUBST(JANSSON_LDFLAGS)
274 AC_SUBST(JANSSON_LIBS)