More stubs for EAP mechanism
[mech_eap.git] / acinclude.m4
1 dnl Based on the one from the Boinc project by Reinhard
2
3 AC_DEFUN([AX_CHECK_KRB5],
4 [AC_MSG_CHECKING(for Kerberos)
5 KRB5_DIR=
6 found_krb5="no"
7 AC_ARG_WITH(krb5,
8     AC_HELP_STRING([--with-krb5],
9        [Use krb5 (in specified installation directory)]),
10     [check_krb5_dir="$withval"],
11     [check_krb5_dir=])
12 for dir in $check_krb5_dir /usr /usr/local ; do
13    krb5dir="$dir"
14    if test -f "$dir/include/krb5.h"; then
15      found_krb5="yes";
16      krb5_DIR="${krb5dir}"
17      krb5_CFLAGS="-I$krb5dir/include";
18      break;
19    fi
20    if test -f "$dir/include/krb5.h"; then
21      found_krb5="yes";
22      krb5_DIR="${krb5dir}"
23      krb5_CFLAGS="-I$krb5dir/include/";
24      break
25    fi
26 done
27 AC_MSG_RESULT($found_krb5)
28 if test x_$found_krb5 != x_yes; then
29    AC_MSG_ERROR([
30 ----------------------------------------------------------------------
31   Cannot find krb5 libraries.
32
33   Please install MIT or Heimdal or specify installation directory with
34   --with-krb5=(dir).
35 ----------------------------------------------------------------------
36 ])
37 else
38         printf "Kerberos found in $krb5dir\n";
39         krb5_LIBS="-lgssapi_krb5 -lkrb5";
40         krb5_LDFLAGS="-L$krb5dir/lib";
41         AC_SUBST(KRB5_CFLAGS)
42         AC_SUBST(KRB5_LDFLAGS)
43         AC_SUBST(KRB5_LIBS)
44 fi
45 ])dnl