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$target_windows" = "xyes"; then
23 krb5includedir="$dir/include";
24 if test -e "$krb5includedir/krb5.h"; then
26 krb5libdir="$dir/lib/i386"
27 KRB5_CFLAGS=-I"$krb5includedir";
28 KRB5_LDFLAGS=-L"$krb5libdir";
29 KRB5_LIBS="$krb5libdir/krb5_32.lib $krb5libdir/gssapi32.lib $krb5libdir/comerr32.lib";
30 COMPILE_ET="$(pwd)/windows/compile_et";
35 if test -x "$dir/bin/krb5-config"; then
37 KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
38 KRB5_LDFLAGS="-L$dir/lib";
39 KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`
41 AC_PATH_PROG(COMPILE_ET, [compile_et], [compile_et], [$dir/bin$PATH_SEPARATOr])
46 if test x_$found_krb5 != x_yes; then
47 AC_MSG_RESULT($found_krb5)
49 ----------------------------------------------------------------------
50 Cannot find GSS-API/Kerberos libraries.
52 Please install MIT or Heimdal or specify installation directory with
54 ----------------------------------------------------------------------
57 printf "Kerberos found in $krb5dir\n";
59 AC_SUBST(KRB5_LDFLAGS)
62 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")
63 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")
64 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")
65 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")
66 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
70 AC_DEFUN([AX_CHECK_EAP],
71 [AC_MSG_CHECKING(for EAP implementation)
75 AC_HELP_STRING([--with-eap],
76 [Use eap (in specified installation directory)]),
77 [check_eap_dir="$withval"],
79 for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
81 if test -f "$dir/src/eap_peer/eap.h"; then
84 EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
88 AC_MSG_RESULT($found_eap)
89 if test x_$found_eap != x_yes; then
91 ----------------------------------------------------------------------
92 Cannot find EAP libraries.
94 Please install wpa_supplicant or specify installation directory with
96 ----------------------------------------------------------------------
99 printf "EAP found in $eapdir\n";
100 EAP_CFLAGS="$EAP_CFLAGS \
114 -DEAP_SERVER_IDENTITY \
119 -DEAP_SERVER_MSCHAPV2 \
125 -DEAP_SERVER_GPSK_SHA256 \
127 EAP_LIBS="-leap -lutils -lcrypto -ltls -lssl";
128 EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
130 AC_SUBST(EAP_LDFLAGS)
135 AC_DEFUN([AX_CHECK_SHIBSP],
136 [AC_MSG_CHECKING(for Shibboleth implementation)
140 AC_HELP_STRING([--with-shibsp],
141 [Use shibspboleth (in specified installation directory)]),
142 [check_shibsp_dir="$withval"],
144 for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
146 if test -f "$dir/include/shibsp/SPConfig.h"; then
148 SHIBSP_DIR="${shibspdir}"
149 SHIBSP_CXXFLAGS="-I$shibspdir/include";
153 AC_MSG_RESULT($found_shibsp)
154 if test x_$found_shibsp != x_yes; then
156 ----------------------------------------------------------------------
157 Cannot find Shibboleth libraries.
159 Please install Shibboleth or specify installation directory with
161 ----------------------------------------------------------------------
164 printf "Shibboleth found in $shibspdir\n";
165 SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
166 SHIBSP_LDFLAGS="-L$shibspdir/lib";
167 AC_SUBST(SHIBSP_CXXFLAGS)
168 AC_SUBST(SHIBSP_LDFLAGS)
169 AC_SUBST(SHIBSP_LIBS)
170 AC_DEFINE_UNQUOTED([HAVE_SHIBSP], 1, [Define is Shibboleth SP is available])
174 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
175 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
177 found_shibresolver="no"
178 AC_ARG_WITH(shibresolver,
179 AC_HELP_STRING([--with-shibresolver],
180 [Use Shibboleth resolver (in specified installation directory)]),
181 [check_shibresolver_dir="$withval"],
182 [check_shibresolver_dir=])
183 if test x_$check_shibresolver_dir != x_no; then
184 for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
185 shibresolverdir="$dir"
186 if test -f "$dir/include/shibresolver/resolver.h"; then
187 found_shibresolver="yes";
188 SHIBRESOLVER_DIR="${shibresolverdir}"
189 SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
194 AC_MSG_RESULT($found_shibresolver)
195 if test x_$check_shibresolver_dir != x_no; then
196 if test x_$found_shibresolver != x_yes; then
198 ----------------------------------------------------------------------
199 Cannot find Shibboleth resolver libraries, building without
202 Please install Shibboleth or specify installation directory with
203 --with-shibresolver=(dir).
204 ----------------------------------------------------------------------
207 printf "Shibboleth resolver found in $shibresolverdir\n";
208 SHIBRESOLVER_LIBS="-lshibresolver";
209 SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
210 AC_SUBST(SHIBRESOLVER_CXXFLAGS)
211 AC_SUBST(SHIBRESOLVER_LDFLAGS)
212 AC_SUBST(SHIBRESOLVER_LIBS)
213 AC_DEFINE_UNQUOTED([HAVE_SHIBRESOLVER], 1, [Define is Shibboleth resolver is available])
218 AC_DEFUN([AX_CHECK_OPENSAML],
219 [AC_MSG_CHECKING(for OpenSAML implementation)
222 AC_ARG_WITH(opensaml,
223 AC_HELP_STRING([--with-opensaml],
224 [Use OpenSAML (in specified installation directory)]),
225 [check_opensaml_dir="$withval"],
226 [check_opensaml_dir=])
227 if test x_$check_opensaml_dir != x_no; then
228 for dir in $check_opensaml_dir $prefix /usr /usr/local ; do
230 if test -f "$dir/include/saml/Assertion.h"; then
231 found_opensaml="yes";
232 OPENSAML_DIR="${opensamldir}"
233 OPENSAML_CXXFLAGS="-I$opensamldir/include";
238 AC_MSG_RESULT($found_opensaml)
239 if test x_$check_opensaml_dir != x_no; then
240 if test x_$found_opensaml != x_yes; then
242 ----------------------------------------------------------------------
243 Cannot find OpenSAML libraries, building without OpenSAML support.
245 Please install OpenSAML or specify installation directory with
246 --with-opensaml=(dir).
247 ----------------------------------------------------------------------
250 printf "OpenSAML found in $opensamldir\n";
251 OPENSAML_LIBS="-lsaml -lxml-security-c -lxmltooling -lxerces-c";
252 OPENSAML_LDFLAGS="-L$opensamldir/lib";
253 AC_SUBST(OPENSAML_CXXFLAGS)
254 AC_SUBST(OPENSAML_LDFLAGS)
255 AC_SUBST(OPENSAML_LIBS)
256 AC_DEFINE_UNQUOTED([HAVE_OPENSAML], 1, [Define is OpenSAML is available])
261 AC_DEFUN([AX_CHECK_OPENSSL],
262 [AC_MSG_CHECKING(for OpenSSL)
266 AC_HELP_STRING([--with-openssl],
267 [Use OpenSSL (in specified installation directory)]),
268 [check_openssl_dir="$withval"],
269 [check_openssl_dir=])
270 for dir in $check_openssl_dir $prefix /usr /usr/local ; do
272 if test -f "$dir/include/openssl/opensslv.h"; then
274 OPENSSL_DIR="${openssldir}"
275 OPENSSL_CFLAGS="-I$openssldir/include";
279 AC_MSG_RESULT($found_openssl)
280 if test x_$found_openssl != x_yes; then
282 ----------------------------------------------------------------------
283 Cannot find OpenSSL libraries.
285 Please install libssl or specify installation directory with
286 --with-openssl=(dir).
287 ----------------------------------------------------------------------
290 printf "OpenSSL found in $openssldir\n";
291 if test "x$target_windows" = "xyes"; then
292 OPENSSL_LIBS="$openssldir/lib/libeay32.lib $openssldir/lib/ssleay32.lib";
294 OPENSSL_LIBS="-lssl -lcrypto";
296 OPENSSL_LDFLAGS="-L$openssldir/lib";
297 AC_SUBST(OPENSSL_CFLAGS)
298 AC_SUBST(OPENSSL_LDFLAGS)
299 AC_SUBST(OPENSSL_LIBS)
303 AC_DEFUN([AX_CHECK_RADSEC],
304 [AC_MSG_CHECKING(for radsec)
308 AC_HELP_STRING([--with-radsec],
309 [Use radsec (in specified installation directory)]),
310 [check_radsec_dir="$withval"],
312 for dir in $check_radsec_dir $prefix /usr /usr/local ; do
314 if test -f "$dir/include/radsec/radsec.h"; then
316 RADSEC_DIR="${radsecdir}"
317 RADSEC_CFLAGS="-I$radsecdir/include";
321 AC_MSG_RESULT($found_radsec)
322 if test x_$found_radsec != x_yes; then
324 ----------------------------------------------------------------------
325 Cannot find radsec libraries.
327 Please install libradsec or specify installation directory with
329 ----------------------------------------------------------------------
332 printf "radsec found in $radsecdir\n";
333 RADSEC_LIBS="-lradsec";
334 RADSEC_LDFLAGS="-L$radsecdir/lib";
335 AC_SUBST(RADSEC_CFLAGS)
336 AC_SUBST(RADSEC_LDFLAGS)
337 AC_SUBST(RADSEC_LIBS)
341 AC_DEFUN([AX_CHECK_JANSSON],
342 [AC_MSG_CHECKING(for jansson)
346 AC_HELP_STRING([--with-jansson],
347 [Use jansson (in specified installation directory)]),
348 [check_jansson_dir="$withval"],
349 [check_jansson_dir=])
350 for dir in $check_jansson_dir $prefix /usr /usr/local ; do
352 if test -f "$dir/include/jansson.h"; then
354 JANSSON_DIR="${janssondir}"
355 JANSSON_CFLAGS="-I$janssondir/include";
359 AC_MSG_RESULT($found_jansson)
360 if test x_$found_jansson != x_yes; then
362 ----------------------------------------------------------------------
363 Cannot find jansson libraries.
365 Please install libjansson or specify installation directory with
366 --with-jansson=(dir).
367 ----------------------------------------------------------------------
370 printf "jansson found in $janssondir\n";
371 JANSSON_LIBS="-ljansson";
372 JANSSON_LDFLAGS="-L$janssondir/lib";
373 AC_SUBST(JANSSON_CFLAGS)
374 AC_SUBST(JANSSON_LDFLAGS)
375 AC_SUBST(JANSSON_LIBS)
379 AC_DEFUN([AX_CHECK_LIBMOONSHOT],
380 [AC_MSG_CHECKING(for Moonshot identity selector implementation)
385 found_libmoonshot="no"
386 AC_ARG_WITH(libmoonshot,
387 AC_HELP_STRING([--with-libmoonshot],
388 [Use libmoonshot (in specified installation directory)]),
389 [check_libmoonshot_dir="$withval"],
390 [check_libmoonshot_dir=])
391 for dir in $check_libmoonshot_dir $prefix /usr /usr/local ; do
392 libmoonshotdir="$dir"
393 if test -f "$dir/include/libmoonshot.h"; then
394 found_libmoonshot="yes";
395 LIBMOONSHOT_DIR="${libmoonshotdir}"
396 LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include";
400 AC_MSG_RESULT($found_libmoonshot)
401 if test x_$found_libmoonshot = x_yes; then
402 printf "libmoonshot found in $libmoonshotdir\n";
403 LIBMOONSHOT_LIBS="-lmoonshot";
404 LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib";
405 AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS")
407 AC_SUBST(LIBMOONSHOT_CFLAGS)
408 AC_SUBST(LIBMOONSHOT_LDFLAGS)
409 AC_SUBST(LIBMOONSHOT_LIBS)
410 AM_CONDITIONAL(LIBMOONSHOT, test "x$found_libmoonshot" != "xno")