1 dnl Based on the one from the Boinc project by Reinhard
3 AC_DEFUN([AX_CHECK_WINDOWS],
4 [AC_MSG_CHECKING(for windows)
6 AC_CHECK_HEADER(windows.h,[target_windows="yes"],[target_windows="no"])
7 AC_MSG_RESULT($target_windows)
8 AM_CONDITIONAL(TARGET_WINDOWS,test "x$target_windows" = "xyes")
11 AC_DEFUN([AX_CHECK_KRB5],
12 [AC_MSG_CHECKING(for GSS-API and Kerberos implementation)
16 AC_HELP_STRING([--with-krb5],
17 [Use krb5 (in specified installation directory)]),
18 [check_krb5_dir="$withval"],
20 for dir in $check_krb5_dir $prefix /usr/local /usr ; do
22 if test -x "$dir/bin/krb5-config"; then
24 if test "x$target_windows" = "xyes"; then
25 KRB5_CFLAGS=-I"$check_krb5_dir/include";
26 KRB5_LDFLAGS="-L$check_krb5_dir/lib/";
27 KRB5_LIBS="-lkrb5_32 -lgssapi32";
28 COMPILE_ET="$check_krb5_dir/bin/compile_et";
31 KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
32 KRB5_LDFLAGS="-L$dir/lib";
33 KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`
35 AC_PATH_PROG(COMPILE_ET, [compile_et], [compile_et], [$dir/bin$PATH_SEPARATOr])
40 if test x_$found_krb5 != x_yes; then
41 AC_MSG_RESULT($found_krb5)
43 ----------------------------------------------------------------------
44 Cannot find GSS-API/Kerberos libraries.
46 Please install MIT or Heimdal or specify installation directory with
48 ----------------------------------------------------------------------
51 printf "Kerberos found in $krb5dir\n";
53 AC_SUBST(KRB5_LDFLAGS)
56 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")
57 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")
58 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")
59 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")
60 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
61 AC_CHECK_TYPE(gss_const_name_t, [AC_DEFINE([MECHEAP_GSS_CONST_NAME_T_IS_POINTER], 1, [Define if gss_const_name_t is a pointer. Broken krb5 10.x headers define it as a struct.])], [], [[#include <gssapi/gssapi.h>"]])
65 AC_DEFUN([AX_CHECK_EAP],
66 [AC_MSG_CHECKING(for EAP implementation)
70 AC_HELP_STRING([--with-eap],
71 [Use eap (in specified installation directory)]),
72 [check_eap_dir="$withval"],
74 for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
76 if test -f "$dir/src/eap_peer/eap.h"; then
79 EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
83 AC_MSG_RESULT($found_eap)
84 if test x_$found_eap != x_yes; then
86 ----------------------------------------------------------------------
87 Cannot find EAP libraries.
89 Please install wpa_supplicant or specify installation directory with
91 ----------------------------------------------------------------------
94 printf "EAP found in $eapdir\n";
95 EAP_CFLAGS="$EAP_CFLAGS \
109 -DEAP_SERVER_IDENTITY \
114 -DEAP_SERVER_MSCHAPV2 \
120 -DEAP_SERVER_GPSK_SHA256 \
122 EAP_LIBS="-leap -lutils -lcrypto -ltls -lssl";
123 EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
125 AC_SUBST(EAP_LDFLAGS)
130 AC_DEFUN([AX_CHECK_SHIBSP],
131 [AC_MSG_CHECKING(for Shibboleth implementation)
135 AC_HELP_STRING([--with-shibsp],
136 [Use shibspboleth (in specified installation directory)]),
137 [check_shibsp_dir="$withval"],
139 for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
141 if test -f "$dir/include/shibsp/SPConfig.h"; then
143 SHIBSP_DIR="${shibspdir}"
144 SHIBSP_CXXFLAGS="-I$shibspdir/include";
148 AC_MSG_RESULT($found_shibsp)
149 if test x_$found_shibsp != x_yes; then
151 ----------------------------------------------------------------------
152 Cannot find Shibboleth libraries.
154 Please install Shibboleth or specify installation directory with
156 ----------------------------------------------------------------------
159 printf "Shibboleth found in $shibspdir\n";
160 SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
161 SHIBSP_LDFLAGS="-L$shibspdir/lib";
162 AC_SUBST(SHIBSP_CXXFLAGS)
163 AC_SUBST(SHIBSP_LDFLAGS)
164 AC_SUBST(SHIBSP_LIBS)
165 AC_DEFINE_UNQUOTED([HAVE_SHIBSP], 1, [Define is Shibboleth SP is available])
169 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
170 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
172 found_shibresolver="no"
173 AC_ARG_WITH(shibresolver,
174 AC_HELP_STRING([--with-shibresolver],
175 [Use Shibboleth resolver (in specified installation directory)]),
176 [check_shibresolver_dir="$withval"],
177 [check_shibresolver_dir=])
178 if test x_$check_shibresolver_dir != x_no; then
179 for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
180 shibresolverdir="$dir"
181 if test -f "$dir/include/shibresolver/resolver.h"; then
182 found_shibresolver="yes";
183 SHIBRESOLVER_DIR="${shibresolverdir}"
184 SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
189 AC_MSG_RESULT($found_shibresolver)
190 if test x_$check_shibresolver_dir != x_no; then
191 if test x_$found_shibresolver != x_yes; then
193 ----------------------------------------------------------------------
194 Cannot find Shibboleth resolver libraries, building without
197 Please install Shibboleth or specify installation directory with
198 --with-shibresolver=(dir).
199 ----------------------------------------------------------------------
202 printf "Shibboleth resolver found in $shibresolverdir\n";
203 SHIBRESOLVER_LIBS="-lshibresolver";
204 SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
205 AC_SUBST(SHIBRESOLVER_CXXFLAGS)
206 AC_SUBST(SHIBRESOLVER_LDFLAGS)
207 AC_SUBST(SHIBRESOLVER_LIBS)
208 AC_DEFINE_UNQUOTED([HAVE_SHIBRESOLVER], 1, [Define is Shibboleth resolver is available])
213 AC_DEFUN([AX_CHECK_OPENSAML],
214 [AC_MSG_CHECKING(for OpenSAML implementation)
217 AC_ARG_WITH(opensaml,
218 AC_HELP_STRING([--with-opensaml],
219 [Use OpenSAML (in specified installation directory)]),
220 [check_opensaml_dir="$withval"],
221 [check_opensaml_dir=])
222 if test x_$check_opensaml_dir != x_no; then
223 for dir in $check_opensaml_dir $prefix /usr /usr/local ; do
225 if test -f "$dir/include/saml/Assertion.h"; then
226 found_opensaml="yes";
227 OPENSAML_DIR="${opensamldir}"
228 OPENSAML_CXXFLAGS="-I$opensamldir/include";
233 AC_MSG_RESULT($found_opensaml)
234 if test x_$check_opensaml_dir != x_no; then
235 if test x_$found_opensaml != x_yes; then
237 ----------------------------------------------------------------------
238 Cannot find OpenSAML libraries, building without OpenSAML support.
240 Please install OpenSAML or specify installation directory with
241 --with-opensaml=(dir).
242 ----------------------------------------------------------------------
245 printf "OpenSAML found in $opensamldir\n";
246 OPENSAML_LIBS="-lsaml -lxml-security-c -lxmltooling -lxerces-c";
247 OPENSAML_LDFLAGS="-L$opensamldir/lib";
248 AC_SUBST(OPENSAML_CXXFLAGS)
249 AC_SUBST(OPENSAML_LDFLAGS)
250 AC_SUBST(OPENSAML_LIBS)
251 AC_DEFINE_UNQUOTED([HAVE_OPENSAML], 1, [Define is OpenSAML is available])
256 AC_DEFUN([AX_CHECK_OPENSSL],
257 [AC_MSG_CHECKING(for OpenSSL)
261 AC_HELP_STRING([--with-openssl],
262 [Use OpenSSL (in specified installation directory)]),
263 [check_openssl_dir="$withval"],
264 [check_openssl_dir=])
265 for dir in $check_openssl_dir $prefix /usr /usr/local ; do
267 if test -f "$dir/include/openssl/opensslv.h"; then
269 OPENSSL_DIR="${openssldir}"
270 OPENSSL_CFLAGS="-I$openssldir/include";
274 AC_MSG_RESULT($found_openssl)
275 if test x_$found_openssl != x_yes; then
277 ----------------------------------------------------------------------
278 Cannot find OpenSSL libraries.
280 Please install libssl or specify installation directory with
281 --with-openssl=(dir).
282 ----------------------------------------------------------------------
285 printf "OpenSSL found in $openssldir\n";
286 OPENSSL_LIBS="-lssl -lcrypto";
287 OPENSSL_LDFLAGS="-L$openssldir/lib";
288 AC_SUBST(OPENSSL_CFLAGS)
289 AC_SUBST(OPENSSL_LDFLAGS)
290 AC_SUBST(OPENSSL_LIBS)
294 AC_DEFUN([AX_CHECK_RADSEC],
295 [AC_MSG_CHECKING(for radsec)
299 AC_HELP_STRING([--with-radsec],
300 [Use radsec (in specified installation directory)]),
301 [check_radsec_dir="$withval"],
303 for dir in $check_radsec_dir $prefix /usr /usr/local ; do
305 if test -f "$dir/include/radsec/radsec.h"; then
307 RADSEC_DIR="${radsecdir}"
308 RADSEC_CFLAGS="-I$radsecdir/include";
312 AC_MSG_RESULT($found_radsec)
313 if test x_$found_radsec != x_yes; then
315 ----------------------------------------------------------------------
316 Cannot find radsec libraries.
318 Please install libradsec or specify installation directory with
320 ----------------------------------------------------------------------
323 printf "radsec found in $radsecdir\n";
324 RADSEC_LIBS="-lradsec";
325 RADSEC_LDFLAGS="-L$radsecdir/lib";
326 AC_SUBST(RADSEC_CFLAGS)
327 AC_SUBST(RADSEC_LDFLAGS)
328 AC_SUBST(RADSEC_LIBS)
332 AC_DEFUN([AX_CHECK_JANSSON],
333 [AC_MSG_CHECKING(for jansson)
337 AC_HELP_STRING([--with-jansson],
338 [Use jansson (in specified installation directory)]),
339 [check_jansson_dir="$withval"],
340 [check_jansson_dir=])
341 for dir in $check_jansson_dir $prefix /usr /usr/local ; do
343 if test -f "$dir/include/jansson.h"; then
345 JANSSON_DIR="${janssondir}"
346 JANSSON_CFLAGS="-I$janssondir/include";
350 AC_MSG_RESULT($found_jansson)
351 if test x_$found_jansson != x_yes; then
353 ----------------------------------------------------------------------
354 Cannot find jansson libraries.
356 Please install libjansson or specify installation directory with
357 --with-jansson=(dir).
358 ----------------------------------------------------------------------
361 printf "jansson found in $janssondir\n";
362 JANSSON_LIBS="-ljansson";
363 JANSSON_LDFLAGS="-L$janssondir/lib";
364 AC_SUBST(JANSSON_CFLAGS)
365 AC_SUBST(JANSSON_LDFLAGS)
366 AC_SUBST(JANSSON_LIBS)
370 AC_DEFUN([AX_CHECK_LIBMOONSHOT],
371 [AC_MSG_CHECKING(for Moonshot identity selector implementation)
376 found_libmoonshot="no"
377 AC_ARG_WITH(libmoonshot,
378 AC_HELP_STRING([--with-libmoonshot],
379 [Use libmoonshot (in specified installation directory)]),
380 [check_libmoonshot_dir="$withval"],
381 [check_libmoonshot_dir=])
382 for dir in $check_libmoonshot_dir $prefix /usr /usr/local ; do
383 libmoonshotdir="$dir"
384 if test -f "$dir/include/libmoonshot.h"; then
385 found_libmoonshot="yes";
386 LIBMOONSHOT_DIR="${libmoonshotdir}"
387 LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include";
391 AC_MSG_RESULT($found_libmoonshot)
392 if test x_$found_libmoonshot = x_yes; then
393 printf "libmoonshot found in $libmoonshotdir\n";
394 LIBMOONSHOT_LIBS="-lmoonshot";
395 LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib";
396 AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS")
398 AC_SUBST(LIBMOONSHOT_CFLAGS)
399 AC_SUBST(LIBMOONSHOT_LDFLAGS)
400 AC_SUBST(LIBMOONSHOT_LIBS)
401 AM_CONDITIONAL(LIBMOONSHOT, test "x$found_libmoonshot" != "xno")