More work on initial implementation
[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 GSS-API and Kerberos implementation)
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 done
21 AC_MSG_RESULT($found_krb5)
22 if test x_$found_krb5 != x_yes; then
23    AC_MSG_ERROR([
24 ----------------------------------------------------------------------
25   Cannot find GSS-API/Kerberos libraries.
26
27   Please install MIT or Heimdal or specify installation directory with
28   --with-krb5=(dir).
29 ----------------------------------------------------------------------
30 ])
31 else
32         printf "Kerberos found in $krb5dir\n";
33         KRB5_LIBS="-lgssapi_krb5 -lkrb5";
34         KRB5_LDFLAGS="-L$krb5dir/lib";
35         AC_SUBST(KRB5_CFLAGS)
36         AC_SUBST(KRB5_LDFLAGS)
37         AC_SUBST(KRB5_LIBS)
38 fi
39 ])dnl
40
41 AC_DEFUN([AX_CHECK_EAP],
42 [AC_MSG_CHECKING(for EAP implementation)
43 EAP_DIR=
44 found_eap="no"
45 AC_ARG_WITH(eap,
46     AC_HELP_STRING([--with-eap],
47        [Use eap (in specified installation directory)]),
48     [check_eap_dir="$withval"],
49     [check_eap_dir=])
50 for dir in $check_eap_dir /usr /usr/local ; do
51    eapdir="$dir"
52    if test -f "$dir/src/eap_peer/eap.h"; then
53      found_eap="yes";
54      EAP_DIR="${eapdir}"
55      EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
56      break;
57    fi
58 done
59 AC_MSG_RESULT($found_eap)
60 if test x_$found_eap != x_yes; then
61    AC_MSG_ERROR([
62 ----------------------------------------------------------------------
63   Cannot find EAP libraries.
64
65   Please install wpa_supplicant or specify installation directory with
66   --with-eap=(dir).
67 ----------------------------------------------------------------------
68 ])
69 else
70         printf "EAP found in $eapdir\n";
71         EAP_LIBS="-leap";
72         EAP_LDFLAGS="-L$eapdir/eap_example";
73         AC_SUBST(EAP_CFLAGS)
74         AC_SUBST(EAP_LDFLAGS)
75         AC_SUBST(EAP_LIBS)
76 fi
77 ])dnl
78