Support GSS_C_NT_COMPOSITE_EXPORT
[mech_eap.orig] / 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 -lk5crypto";
34         KRB5_LDFLAGS="-L$krb5dir/lib";
35         AC_SUBST(KRB5_CFLAGS)
36         AC_SUBST(KRB5_LDFLAGS)
37         AC_SUBST(KRB5_LIBS)
38         AC_CHECK_LIB(gssapi_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_LDFLAGS")
39 fi
40 ])dnl
41
42 AC_DEFUN([AX_CHECK_EAP],
43 [AC_MSG_CHECKING(for EAP implementation)
44 EAP_DIR=
45 found_eap="no"
46 AC_ARG_WITH(eap,
47     AC_HELP_STRING([--with-eap],
48        [Use eap (in specified installation directory)]),
49     [check_eap_dir="$withval"],
50     [check_eap_dir=])
51 for dir in $check_eap_dir /usr /usr/local ; do
52    eapdir="$dir"
53    if test -f "$dir/src/eap_peer/eap.h"; then
54      found_eap="yes";
55      EAP_DIR="${eapdir}"
56      EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
57      break;
58    fi
59 done
60 AC_MSG_RESULT($found_eap)
61 if test x_$found_eap != x_yes; then
62    AC_MSG_ERROR([
63 ----------------------------------------------------------------------
64   Cannot find EAP libraries.
65
66   Please install wpa_supplicant or specify installation directory with
67   --with-eap=(dir).
68 ----------------------------------------------------------------------
69 ])
70 else
71         printf "EAP found in $eapdir\n";
72         EAP_CFLAGS="$EAP_CFLAGS \
73 -DEAP_TLS \
74 -DEAP_PEAP \
75 -DEAP_TTLS \
76 -DEAP_MD5 \
77 -DEAP_MSCHAPv2 \
78 -DEAP_GTC \
79 -DEAP_OTP \
80 -DEAP_LEAP \
81 -DEAP_PSK \
82 -DEAP_PAX \
83 -DEAP_SAKE \
84 -DEAP_GPSK \
85 -DEAP_GPSK_SHA256 \
86 -DEAP_SERVER_IDENTITY \
87 -DEAP_SERVER_TLS \
88 -DEAP_SERVER_PEAP \
89 -DEAP_SERVER_TTLS \
90 -DEAP_SERVER_MD5 \
91 -DEAP_SERVER_MSCHAPV2 \
92 -DEAP_SERVER_GTC \
93 -DEAP_SERVER_PSK \
94 -DEAP_SERVER_PAX \
95 -DEAP_SERVER_SAKE \
96 -DEAP_SERVER_GPSK \
97 -DEAP_SERVER_GPSK_SHA256 \
98 -DIEEE8021X_EAPOL";
99         EAP_LIBS="-leap -lutils -lcrypto -ltls";
100         EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
101         AC_SUBST(EAP_CFLAGS)
102         AC_SUBST(EAP_LDFLAGS)
103         AC_SUBST(EAP_LIBS)
104 fi
105 ])dnl
106
107 AC_DEFUN([AX_CHECK_SHIBSP],
108 [AC_MSG_CHECKING(for Shibboleth implementation)
109 SHIBSP_DIR=
110 found_shibsp="no"
111 AC_ARG_WITH(shibsp,
112     AC_HELP_STRING([--with-shibsp],
113        [Use shibspboleth (in specified installation directory)]),
114     [check_shibsp_dir="$withval"],
115     [check_shibsp_dir=])
116 for dir in $check_shibsp_dir /usr /usr/local ; do
117    shibspdir="$dir"
118    if test -f "$dir/include/shibsp/SPConfig.h"; then
119      found_shibsp="yes";
120      SHIBSP_DIR="${shibspdir}"
121      SHIBSP_CXXFLAGS="-I$shibspdir/include";
122      break;
123    fi
124 done
125 AC_MSG_RESULT($found_shibsp)
126 if test x_$found_shibsp != x_yes; then
127    AC_MSG_ERROR([
128 ----------------------------------------------------------------------
129   Cannot find Shibboleth/OpenSAML libraries.
130
131   Please install Shibboleth or specify installation directory with
132   --with-shibsp=(dir).
133 ----------------------------------------------------------------------
134 ])
135 else
136         printf "Shibboleth found in $shibspdir\n";
137         SHIBSP_LIBS="-lshibsp -llog4shib -lsaml -lxml-security-c -lxmltooling -lxerces-c";
138         SHIBSP_LDFLAGS="-L$shibspdir/lib";
139         AC_SUBST(SHIBSP_CXXFLAGS)
140         AC_SUBST(SHIBSP_LDFLAGS)
141         AC_SUBST(SHIBSP_LIBS)
142 fi
143 ])dnl