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 /usr/local ; 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_LIBS="-L$check_krb5_dir/lib/ -lkrb5_32 -lgssapi32";
27 COMPILE_ET="$check_krb5_dir/bin/compile_et";
29 KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
30 KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`;
31 COMPILE_ET="$dir/bin/compile_et";
36 AC_MSG_RESULT($found_krb5)
37 if test x_$found_krb5 != x_yes; then
39 ----------------------------------------------------------------------
40 Cannot find GSS-API/Kerberos libraries.
42 Please install MIT or Heimdal or specify installation directory with
44 ----------------------------------------------------------------------
47 printf "Kerberos found in $krb5dir\n";
51 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")
52 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")
53 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")
54 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")
55 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
59 AC_DEFUN([AX_CHECK_EAP],
60 [AC_MSG_CHECKING(for EAP implementation)
64 AC_HELP_STRING([--with-eap],
65 [Use eap (in specified installation directory)]),
66 [check_eap_dir="$withval"],
68 for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
70 if test -f "$dir/src/eap_peer/eap.h"; then
73 EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
77 AC_MSG_RESULT($found_eap)
78 if test x_$found_eap != x_yes; then
80 ----------------------------------------------------------------------
81 Cannot find EAP libraries.
83 Please install wpa_supplicant or specify installation directory with
85 ----------------------------------------------------------------------
88 printf "EAP found in $eapdir\n";
89 EAP_CFLAGS="$EAP_CFLAGS \
103 -DEAP_SERVER_IDENTITY \
108 -DEAP_SERVER_MSCHAPV2 \
114 -DEAP_SERVER_GPSK_SHA256 \
116 EAP_LIBS="-leap -lutils -lcrypto -ltls";
117 EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
119 AC_SUBST(EAP_LDFLAGS)
124 AC_DEFUN([AX_CHECK_SHIBSP],
125 [AC_MSG_CHECKING(for Shibboleth implementation)
129 AC_HELP_STRING([--with-shibsp],
130 [Use shibspboleth (in specified installation directory)]),
131 [check_shibsp_dir="$withval"],
133 for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
135 if test -f "$dir/include/shibsp/SPConfig.h"; then
137 SHIBSP_DIR="${shibspdir}"
138 SHIBSP_CXXFLAGS="-I$shibspdir/include";
142 AC_MSG_RESULT($found_shibsp)
143 if test x_$found_shibsp != x_yes; then
145 ----------------------------------------------------------------------
146 Cannot find Shibboleth libraries.
148 Please install Shibboleth or specify installation directory with
150 ----------------------------------------------------------------------
153 printf "Shibboleth found in $shibspdir\n";
154 SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
155 SHIBSP_LDFLAGS="-L$shibspdir/lib";
156 AC_SUBST(SHIBSP_CXXFLAGS)
157 AC_SUBST(SHIBSP_LDFLAGS)
158 AC_SUBST(SHIBSP_LIBS)
159 AC_DEFINE_UNQUOTED([HAVE_SHIBSP], 1, [Define is Shibboleth SP is available])
163 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
164 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
166 found_shibresolver="no"
167 AC_ARG_WITH(shibresolver,
168 AC_HELP_STRING([--with-shibresolver],
169 [Use Shibboleth resolver (in specified installation directory)]),
170 [check_shibresolver_dir="$withval"],
171 [check_shibresolver_dir=])
172 if test x_$check_shibresolver_dir != x_no; then
173 for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
174 shibresolverdir="$dir"
175 if test -f "$dir/include/shibresolver/resolver.h"; then
176 found_shibresolver="yes";
177 SHIBRESOLVER_DIR="${shibresolverdir}"
178 SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
183 AC_MSG_RESULT($found_shibresolver)
184 if test x_$check_shibresolver_dir != x_no; then
185 if test x_$found_shibresolver != x_yes; then
187 ----------------------------------------------------------------------
188 Cannot find Shibboleth resolver libraries, building without
191 Please install Shibboleth or specify installation directory with
192 --with-shibresolver=(dir).
193 ----------------------------------------------------------------------
196 printf "Shibboleth resolver found in $shibresolverdir\n";
197 SHIBRESOLVER_LIBS="-lshibresolver";
198 SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
199 AC_SUBST(SHIBRESOLVER_CXXFLAGS)
200 AC_SUBST(SHIBRESOLVER_LDFLAGS)
201 AC_SUBST(SHIBRESOLVER_LIBS)
202 AC_DEFINE_UNQUOTED([HAVE_SHIBRESOLVER], 1, [Define is Shibboleth resolver is available])
207 AC_DEFUN([AX_CHECK_OPENSAML],
208 [AC_MSG_CHECKING(for OpenSAML implementation)
211 AC_ARG_WITH(opensaml,
212 AC_HELP_STRING([--with-opensaml],
213 [Use OpenSAML (in specified installation directory)]),
214 [check_opensaml_dir="$withval"],
215 [check_opensaml_dir=])
216 if test x_$check_opensaml_dir != x_no; then
217 for dir in $check_opensaml_dir $prefix /usr /usr/local ; do
219 if test -f "$dir/include/saml/Assertion.h"; then
220 found_opensaml="yes";
221 OPENSAML_DIR="${opensamldir}"
222 OPENSAML_CXXFLAGS="-I$opensamldir/include";
227 AC_MSG_RESULT($found_opensaml)
228 if test x_$check_opensaml_dir != x_no; then
229 if test x_$found_opensaml != x_yes; then
231 ----------------------------------------------------------------------
232 Cannot find OpenSAML libraries, building without OpenSAML support.
234 Please install OpenSAML or specify installation directory with
235 --with-opensaml=(dir).
236 ----------------------------------------------------------------------
239 printf "OpenSAML found in $opensamldir\n";
240 OPENSAML_LIBS="-lsaml -lxml-security-c -lxmltooling -lxerces-c";
241 OPENSAML_LDFLAGS="-L$opensamldir/lib";
242 AC_SUBST(OPENSAML_CXXFLAGS)
243 AC_SUBST(OPENSAML_LDFLAGS)
244 AC_SUBST(OPENSAML_LIBS)
245 AC_DEFINE_UNQUOTED([HAVE_OPENSAML], 1, [Define is OpenSAML is available])
250 AC_DEFUN([AX_CHECK_RADSEC],
251 [AC_MSG_CHECKING(for radsec)
255 AC_HELP_STRING([--with-radsec],
256 [Use radsec (in specified installation directory)]),
257 [check_radsec_dir="$withval"],
259 for dir in $check_radsec_dir $prefix /usr /usr/local ; do
261 if test -f "$dir/include/radsec/radsec.h"; then
263 RADSEC_DIR="${radsecdir}"
264 RADSEC_CFLAGS="-I$radsecdir/include";
268 AC_MSG_RESULT($found_radsec)
269 if test x_$found_radsec != x_yes; then
271 ----------------------------------------------------------------------
272 Cannot find radsec libraries.
274 Please install libradsec or specify installation directory with
276 ----------------------------------------------------------------------
279 printf "radsec found in $radsecdir\n";
280 RADSEC_LIBS="-lradsec";
281 RADSEC_LDFLAGS="-L$radsecdir/lib";
282 AC_SUBST(RADSEC_CFLAGS)
283 AC_SUBST(RADSEC_LDFLAGS)
284 AC_SUBST(RADSEC_LIBS)
288 AC_DEFUN([AX_CHECK_JANSSON],
289 [AC_MSG_CHECKING(for jansson)
293 AC_HELP_STRING([--with-jansson],
294 [Use jansson (in specified installation directory)]),
295 [check_jansson_dir="$withval"],
296 [check_jansson_dir=])
297 for dir in $check_jansson_dir $prefix /usr /usr/local ; do
299 if test -f "$dir/include/jansson.h"; then
301 JANSSON_DIR="${janssondir}"
302 JANSSON_CFLAGS="-I$janssondir/include";
306 AC_MSG_RESULT($found_jansson)
307 if test x_$found_jansson != x_yes; then
309 ----------------------------------------------------------------------
310 Cannot find jansson libraries.
312 Please install libjansson or specify installation directory with
313 --with-jansson=(dir).
314 ----------------------------------------------------------------------
317 printf "jansson found in $janssondir\n";
318 JANSSON_LIBS="-ljansson";
319 JANSSON_LDFLAGS="-L$janssondir/lib";
320 AC_SUBST(JANSSON_CFLAGS)
321 AC_SUBST(JANSSON_LDFLAGS)
322 AC_SUBST(JANSSON_LIBS)
326 AC_DEFUN([AX_CHECK_LIBMOONSHOT],
327 [AC_MSG_CHECKING(for Moonshot identity selector implementation)
329 found_libmoonshot="no"
330 AC_ARG_WITH(libmoonshot,
331 AC_HELP_STRING([--with-libmoonshot],
332 [Use libmoonshot (in specified installation directory)]),
333 [check_libmoonshot_dir="$withval"],
334 [check_libmoonshot_dir=])
335 for dir in $check_libmoonshot_dir $prefix /usr /usr/local ../../moonshot-ui/libmoonshot ; do
336 libmoonshotdir="$dir"
337 if test -f "$dir/include/libmoonshot.h"; then
338 found_libmoonshot="yes";
339 LIBMOONSHOT_DIR="${libmoonshotdir}"
340 LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include";
344 AC_MSG_RESULT($found_libmoonshot)
345 if test x_$found_libmoonshot != x_yes; then
347 ----------------------------------------------------------------------
348 Cannot find Moonshot identity selector libraries.
350 Please install wpa_supplicant or specify installation directory with
351 --with-libmoonshot=(dir).
352 ----------------------------------------------------------------------
355 printf "libmoonshot found in $libmoonshotdir\n";
356 LIBMOONSHOT_LIBS="-lmoonshot";
357 LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib";
358 AC_SUBST(LIBMOONSHOT_CFLAGS)
359 AC_SUBST(LIBMOONSHOT_LDFLAGS)
360 AC_SUBST(LIBMOONSHOT_LIBS)
361 AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS")