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";
30 KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
31 KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`
33 AC_PATH_PROG(COMPILE_ET, [compile_et], [compile_et], [$dir/bin$PATH_SEPARATOr])
38 if test x_$found_krb5 != x_yes; then
39 AC_MSG_RESULT($found_krb5)
41 ----------------------------------------------------------------------
42 Cannot find GSS-API/Kerberos libraries.
44 Please install MIT or Heimdal or specify installation directory with
46 ----------------------------------------------------------------------
49 printf "Kerberos found in $krb5dir\n";
53 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")
54 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")
55 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")
56 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")
57 AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
61 AC_DEFUN([AX_CHECK_EAP],
62 [AC_MSG_CHECKING(for EAP implementation)
66 AC_HELP_STRING([--with-eap],
67 [Use eap (in specified installation directory)]),
68 [check_eap_dir="$withval"],
70 for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
72 if test -f "$dir/src/eap_peer/eap.h"; then
75 EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
79 AC_MSG_RESULT($found_eap)
80 if test x_$found_eap != x_yes; then
82 ----------------------------------------------------------------------
83 Cannot find EAP libraries.
85 Please install wpa_supplicant or specify installation directory with
87 ----------------------------------------------------------------------
90 printf "EAP found in $eapdir\n";
91 EAP_CFLAGS="$EAP_CFLAGS \
105 -DEAP_SERVER_IDENTITY \
110 -DEAP_SERVER_MSCHAPV2 \
116 -DEAP_SERVER_GPSK_SHA256 \
118 EAP_LIBS="-leap -lutils -lcrypto -ltls";
119 EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
121 AC_SUBST(EAP_LDFLAGS)
126 AC_DEFUN([AX_CHECK_SHIBSP],
127 [AC_MSG_CHECKING(for Shibboleth implementation)
131 AC_HELP_STRING([--with-shibsp],
132 [Use shibspboleth (in specified installation directory)]),
133 [check_shibsp_dir="$withval"],
135 for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
137 if test -f "$dir/include/shibsp/SPConfig.h"; then
139 SHIBSP_DIR="${shibspdir}"
140 SHIBSP_CXXFLAGS="-I$shibspdir/include";
144 AC_MSG_RESULT($found_shibsp)
145 if test x_$found_shibsp != x_yes; then
147 ----------------------------------------------------------------------
148 Cannot find Shibboleth libraries.
150 Please install Shibboleth or specify installation directory with
152 ----------------------------------------------------------------------
155 printf "Shibboleth found in $shibspdir\n";
156 SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
157 SHIBSP_LDFLAGS="-L$shibspdir/lib";
158 AC_SUBST(SHIBSP_CXXFLAGS)
159 AC_SUBST(SHIBSP_LDFLAGS)
160 AC_SUBST(SHIBSP_LIBS)
161 AC_DEFINE_UNQUOTED([HAVE_SHIBSP], 1, [Define is Shibboleth SP is available])
165 AC_DEFUN([AX_CHECK_SHIBRESOLVER],
166 [AC_MSG_CHECKING(for Shibboleth resolver implementation)
168 found_shibresolver="no"
169 AC_ARG_WITH(shibresolver,
170 AC_HELP_STRING([--with-shibresolver],
171 [Use Shibboleth resolver (in specified installation directory)]),
172 [check_shibresolver_dir="$withval"],
173 [check_shibresolver_dir=])
174 if test x_$check_shibresolver_dir != x_no; then
175 for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
176 shibresolverdir="$dir"
177 if test -f "$dir/include/shibresolver/resolver.h"; then
178 found_shibresolver="yes";
179 SHIBRESOLVER_DIR="${shibresolverdir}"
180 SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
185 AC_MSG_RESULT($found_shibresolver)
186 if test x_$check_shibresolver_dir != x_no; then
187 if test x_$found_shibresolver != x_yes; then
189 ----------------------------------------------------------------------
190 Cannot find Shibboleth resolver libraries, building without
193 Please install Shibboleth or specify installation directory with
194 --with-shibresolver=(dir).
195 ----------------------------------------------------------------------
198 printf "Shibboleth resolver found in $shibresolverdir\n";
199 SHIBRESOLVER_LIBS="-lshibresolver";
200 SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
201 AC_SUBST(SHIBRESOLVER_CXXFLAGS)
202 AC_SUBST(SHIBRESOLVER_LDFLAGS)
203 AC_SUBST(SHIBRESOLVER_LIBS)
204 AC_DEFINE_UNQUOTED([HAVE_SHIBRESOLVER], 1, [Define is Shibboleth resolver is available])
209 AC_DEFUN([AX_CHECK_OPENSAML],
210 [AC_MSG_CHECKING(for OpenSAML implementation)
213 AC_ARG_WITH(opensaml,
214 AC_HELP_STRING([--with-opensaml],
215 [Use OpenSAML (in specified installation directory)]),
216 [check_opensaml_dir="$withval"],
217 [check_opensaml_dir=])
218 if test x_$check_opensaml_dir != x_no; then
219 for dir in $check_opensaml_dir $prefix /usr /usr/local ; do
221 if test -f "$dir/include/saml/Assertion.h"; then
222 found_opensaml="yes";
223 OPENSAML_DIR="${opensamldir}"
224 OPENSAML_CXXFLAGS="-I$opensamldir/include";
229 AC_MSG_RESULT($found_opensaml)
230 if test x_$check_opensaml_dir != x_no; then
231 if test x_$found_opensaml != x_yes; then
233 ----------------------------------------------------------------------
234 Cannot find OpenSAML libraries, building without OpenSAML support.
236 Please install OpenSAML or specify installation directory with
237 --with-opensaml=(dir).
238 ----------------------------------------------------------------------
241 printf "OpenSAML found in $opensamldir\n";
242 OPENSAML_LIBS="-lsaml -lxml-security-c -lxmltooling -lxerces-c";
243 OPENSAML_LDFLAGS="-L$opensamldir/lib";
244 AC_SUBST(OPENSAML_CXXFLAGS)
245 AC_SUBST(OPENSAML_LDFLAGS)
246 AC_SUBST(OPENSAML_LIBS)
247 AC_DEFINE_UNQUOTED([HAVE_OPENSAML], 1, [Define is OpenSAML is available])
252 AC_DEFUN([AX_CHECK_RADSEC],
253 [AC_MSG_CHECKING(for radsec)
257 AC_HELP_STRING([--with-radsec],
258 [Use radsec (in specified installation directory)]),
259 [check_radsec_dir="$withval"],
261 for dir in $check_radsec_dir $prefix /usr /usr/local ; do
263 if test -f "$dir/include/radsec/radsec.h"; then
265 RADSEC_DIR="${radsecdir}"
266 RADSEC_CFLAGS="-I$radsecdir/include";
270 AC_MSG_RESULT($found_radsec)
271 if test x_$found_radsec != x_yes; then
273 ----------------------------------------------------------------------
274 Cannot find radsec libraries.
276 Please install libradsec or specify installation directory with
278 ----------------------------------------------------------------------
281 printf "radsec found in $radsecdir\n";
282 RADSEC_LIBS="-lradsec";
283 RADSEC_LDFLAGS="-L$radsecdir/lib";
284 AC_SUBST(RADSEC_CFLAGS)
285 AC_SUBST(RADSEC_LDFLAGS)
286 AC_SUBST(RADSEC_LIBS)
290 AC_DEFUN([AX_CHECK_JANSSON],
291 [AC_MSG_CHECKING(for jansson)
295 AC_HELP_STRING([--with-jansson],
296 [Use jansson (in specified installation directory)]),
297 [check_jansson_dir="$withval"],
298 [check_jansson_dir=])
299 for dir in $check_jansson_dir $prefix /usr /usr/local ; do
301 if test -f "$dir/include/jansson.h"; then
303 JANSSON_DIR="${janssondir}"
304 JANSSON_CFLAGS="-I$janssondir/include";
308 AC_MSG_RESULT($found_jansson)
309 if test x_$found_jansson != x_yes; then
311 ----------------------------------------------------------------------
312 Cannot find jansson libraries.
314 Please install libjansson or specify installation directory with
315 --with-jansson=(dir).
316 ----------------------------------------------------------------------
319 printf "jansson found in $janssondir\n";
320 JANSSON_LIBS="-ljansson";
321 JANSSON_LDFLAGS="-L$janssondir/lib";
322 AC_SUBST(JANSSON_CFLAGS)
323 AC_SUBST(JANSSON_LDFLAGS)
324 AC_SUBST(JANSSON_LIBS)
328 AC_DEFUN([AX_CHECK_LIBMOONSHOT],
329 [AC_MSG_CHECKING(for Moonshot identity selector implementation)
331 found_libmoonshot="no"
332 AC_ARG_WITH(libmoonshot,
333 AC_HELP_STRING([--with-libmoonshot],
334 [Use libmoonshot (in specified installation directory)]),
335 [check_libmoonshot_dir="$withval"],
336 [check_libmoonshot_dir=])
337 for dir in $check_libmoonshot_dir $prefix /usr /usr/local ../../moonshot-ui/libmoonshot ; do
338 libmoonshotdir="$dir"
339 if test -f "$dir/include/libmoonshot.h"; then
340 found_libmoonshot="yes";
341 LIBMOONSHOT_DIR="${libmoonshotdir}"
342 LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include";
346 AC_MSG_RESULT($found_libmoonshot)
347 if test x_$found_libmoonshot != x_yes; then
349 ----------------------------------------------------------------------
350 Cannot find Moonshot identity selector libraries.
352 Please install wpa_supplicant or specify installation directory with
353 --with-libmoonshot=(dir).
354 ----------------------------------------------------------------------
357 printf "libmoonshot found in $libmoonshotdir\n";
358 LIBMOONSHOT_LIBS="-lmoonshot";
359 LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib";
360 AC_SUBST(LIBMOONSHOT_CFLAGS)
361 AC_SUBST(LIBMOONSHOT_LDFLAGS)
362 AC_SUBST(LIBMOONSHOT_LIBS)
363 AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS")