~ubuntu-branches/ubuntu/utopic/moonshot-gss-eap/utopic-backports

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
dnl Based on the one from the Boinc project by Reinhard

AC_DEFUN([AX_CHECK_WINDOWS],
[AC_MSG_CHECKING(for windows)
target_windows="no"
AC_CHECK_HEADER(windows.h,[target_windows="yes"],[target_windows="no"])
AC_MSG_RESULT($target_windows)
AM_CONDITIONAL(TARGET_WINDOWS,test "x$target_windows" = "xyes")
])dnl

AC_DEFUN([AX_CHECK_KRB5],
[AC_MSG_CHECKING(for GSS-API and Kerberos implementation)
KRB5_DIR=
found_krb5="no"
AC_ARG_WITH(krb5,
    AC_HELP_STRING([--with-krb5],
       [Use krb5 (in specified installation directory)]),
    [check_krb5_dir="$withval"],
    [check_krb5_dir=])
for dir in $check_krb5_dir $prefix /usr/local /usr ; do
   krb5dir="$dir"
   if test -x "$dir/bin/krb5-config"; then
     found_krb5="yes";
     if test "x$target_windows" = "xyes"; then
        KRB5_CFLAGS=-I"$check_krb5_dir/include";
        KRB5_LDFLAGS="-L$check_krb5_dir/lib/";
        KRB5_LIBS="-lkrb5_32 -lgssapi32";
        COMPILE_ET="$check_krb5_dir/bin/compile_et";
	AC_MSG_RESULT([yes])
     else
        KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
        KRB5_LDFLAGS="-L$dir/lib";
        KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`
AC_MSG_RESULT([yes])
        AC_PATH_PROG(COMPILE_ET, [compile_et], [compile_et], [$dir/bin$PATH_SEPARATOr])
     fi
     break;
   fi
done
if test x_$found_krb5 != x_yes; then
   AC_MSG_RESULT($found_krb5)
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find GSS-API/Kerberos libraries.

  Please install MIT or Heimdal or specify installation directory with
  --with-krb5=(dir).
----------------------------------------------------------------------
])
else
	printf "Kerberos found in $krb5dir\n";
	AC_SUBST(KRB5_CFLAGS)
        AC_SUBST(KRB5_LDFLAGS)
	AC_SUBST(KRB5_LIBS)
	AC_SUBST(COMPILE_ET)
	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")
	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")
	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")
	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")
	AM_CONDITIONAL(HEIMDAL, test "x$heimdal" != "xno")
fi
])dnl

AC_DEFUN([AX_CHECK_EAP],
[AC_MSG_CHECKING(for EAP implementation)
EAP_DIR=
found_eap="no"
AC_ARG_WITH(eap,
    AC_HELP_STRING([--with-eap],
       [Use eap (in specified installation directory)]),
    [check_eap_dir="$withval"],
    [check_eap_dir=])
for dir in $check_eap_dir $prefix /usr /usr/local ../libeap ; do
   eapdir="$dir"
   if test -f "$dir/src/eap_peer/eap.h"; then
     found_eap="yes";
     EAP_DIR="${eapdir}"
     EAP_CFLAGS="-I$eapdir/src/common -I$eapdir/src -I$eapdir/src/utils";
     break;
   fi
done
AC_MSG_RESULT($found_eap)
if test x_$found_eap != x_yes; then
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find EAP libraries.

  Please install wpa_supplicant or specify installation directory with
  --with-eap=(dir).
----------------------------------------------------------------------
])
else
	printf "EAP found in $eapdir\n";
	EAP_CFLAGS="$EAP_CFLAGS \
-DEAP_TLS \
-DEAP_PEAP \
-DEAP_TTLS \
-DEAP_MD5 \
-DEAP_MSCHAPv2 \
-DEAP_GTC \
-DEAP_OTP \
-DEAP_LEAP \
-DEAP_PSK \
-DEAP_PAX \
-DEAP_SAKE \
-DEAP_GPSK \
-DEAP_GPSK_SHA256 \
-DEAP_SERVER_IDENTITY \
-DEAP_SERVER_TLS \
-DEAP_SERVER_PEAP \
-DEAP_SERVER_TTLS \
-DEAP_SERVER_MD5 \
-DEAP_SERVER_MSCHAPV2 \
-DEAP_SERVER_GTC \
-DEAP_SERVER_PSK \
-DEAP_SERVER_PAX \
-DEAP_SERVER_SAKE \
-DEAP_SERVER_GPSK \
-DEAP_SERVER_GPSK_SHA256 \
-DIEEE8021X_EAPOL";
	EAP_LIBS="-leap -lutils -lcrypto -ltls -lssl";
	EAP_LDFLAGS="-L$eapdir/eap_example -L$eapdir/src/utils -L$eapdir/src/crypto -L$eapdir/src/tls";
	AC_SUBST(EAP_CFLAGS)
	AC_SUBST(EAP_LDFLAGS)
	AC_SUBST(EAP_LIBS)
fi
])dnl

AC_DEFUN([AX_CHECK_SHIBSP],
[AC_MSG_CHECKING(for Shibboleth implementation)
SHIBSP_DIR=
found_shibsp="no"
AC_ARG_WITH(shibsp,
    AC_HELP_STRING([--with-shibsp],
       [Use shibspboleth (in specified installation directory)]),
    [check_shibsp_dir="$withval"],
    [check_shibsp_dir=])
for dir in $check_shibsp_dir $prefix /usr /usr/local ; do
   shibspdir="$dir"
   if test -f "$dir/include/shibsp/SPConfig.h"; then
     found_shibsp="yes";
     SHIBSP_DIR="${shibspdir}"
     SHIBSP_CXXFLAGS="-I$shibspdir/include";
     break;
   fi
done
AC_MSG_RESULT($found_shibsp)
if test x_$found_shibsp != x_yes; then
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find Shibboleth libraries.

  Please install Shibboleth or specify installation directory with
  --with-shibsp=(dir).
----------------------------------------------------------------------
])
else
	printf "Shibboleth found in $shibspdir\n";
	SHIBSP_LIBS="-lshibsp -lsaml -lxml-security-c -lxmltooling -lxerces-c";
	SHIBSP_LDFLAGS="-L$shibspdir/lib";
	AC_SUBST(SHIBSP_CXXFLAGS)
	AC_SUBST(SHIBSP_LDFLAGS)
	AC_SUBST(SHIBSP_LIBS)
	AC_DEFINE_UNQUOTED([HAVE_SHIBSP], 1, [Define is Shibboleth SP is available])
fi
])dnl

AC_DEFUN([AX_CHECK_SHIBRESOLVER],
[AC_MSG_CHECKING(for Shibboleth resolver implementation)
SHIBRESOLVER_DIR=
found_shibresolver="no"
AC_ARG_WITH(shibresolver,
    AC_HELP_STRING([--with-shibresolver],
       [Use Shibboleth resolver (in specified installation directory)]),
    [check_shibresolver_dir="$withval"],
    [check_shibresolver_dir=])
if test x_$check_shibresolver_dir != x_no; then
for dir in $check_shibresolver_dir $prefix /usr /usr/local ; do
   shibresolverdir="$dir"
   if test -f "$dir/include/shibresolver/resolver.h"; then
     found_shibresolver="yes";
     SHIBRESOLVER_DIR="${shibresolverdir}"
     SHIBRESOLVER_CXXFLAGS="-I$shibresolverdir/include";
     break;
   fi
done
fi
AC_MSG_RESULT($found_shibresolver)
if test x_$check_shibresolver_dir != x_no; then
if test x_$found_shibresolver != x_yes; then
   AC_MSG_WARN([
----------------------------------------------------------------------
  Cannot find Shibboleth resolver libraries, building without
  Shibboleth support.

  Please install Shibboleth or specify installation directory with
  --with-shibresolver=(dir).
----------------------------------------------------------------------
])
else
	printf "Shibboleth resolver found in $shibresolverdir\n";
	SHIBRESOLVER_LIBS="-lshibresolver";
	SHIBRESOLVER_LDFLAGS="-L$shibresolverdir/lib";
	AC_SUBST(SHIBRESOLVER_CXXFLAGS)
	AC_SUBST(SHIBRESOLVER_LDFLAGS)
	AC_SUBST(SHIBRESOLVER_LIBS)
	AC_DEFINE_UNQUOTED([HAVE_SHIBRESOLVER], 1, [Define is Shibboleth resolver is available])
fi
fi
])dnl

AC_DEFUN([AX_CHECK_OPENSAML],
[AC_MSG_CHECKING(for OpenSAML implementation)
OPENSAML_DIR=
found_opensaml="no"
AC_ARG_WITH(opensaml,
    AC_HELP_STRING([--with-opensaml],
       [Use OpenSAML (in specified installation directory)]),
    [check_opensaml_dir="$withval"],
    [check_opensaml_dir=])
if test x_$check_opensaml_dir != x_no; then
for dir in $check_opensaml_dir $prefix /usr /usr/local ; do
   opensamldir="$dir"
   if test -f "$dir/include/saml/Assertion.h"; then
     found_opensaml="yes";
     OPENSAML_DIR="${opensamldir}"
     OPENSAML_CXXFLAGS="-I$opensamldir/include";
     break;
   fi
done
fi
AC_MSG_RESULT($found_opensaml)
if test x_$check_opensaml_dir != x_no; then
if test x_$found_opensaml != x_yes; then
   AC_MSG_WARN([
----------------------------------------------------------------------
  Cannot find OpenSAML libraries, building without OpenSAML support.

  Please install OpenSAML or specify installation directory with
  --with-opensaml=(dir).
----------------------------------------------------------------------
])
else
	printf "OpenSAML found in $opensamldir\n";
	OPENSAML_LIBS="-lsaml -lxml-security-c -lxmltooling -lxerces-c";
	OPENSAML_LDFLAGS="-L$opensamldir/lib";
	AC_SUBST(OPENSAML_CXXFLAGS)
	AC_SUBST(OPENSAML_LDFLAGS)
	AC_SUBST(OPENSAML_LIBS)
	AC_DEFINE_UNQUOTED([HAVE_OPENSAML], 1, [Define is OpenSAML is available])
fi
fi
])dnl

AC_DEFUN([AX_CHECK_OPENSSL],
[AC_MSG_CHECKING(for OpenSSL)
OPENSSL_DIR=
found_openssl="no"
AC_ARG_WITH(openssl,
    AC_HELP_STRING([--with-openssl],
       [Use OpenSSL (in specified installation directory)]),
    [check_openssl_dir="$withval"],
    [check_openssl_dir=])
for dir in $check_openssl_dir $prefix /usr /usr/local ; do
   openssldir="$dir"
   if test -f "$dir/include/openssl/opensslv.h"; then
     found_openssl="yes";
     OPENSSL_DIR="${openssldir}"
     OPENSSL_CFLAGS="-I$openssldir/include";
     break;
   fi
done
AC_MSG_RESULT($found_openssl)
if test x_$found_openssl != x_yes; then
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find OpenSSL libraries.

  Please install libssl or specify installation directory with
  --with-openssl=(dir).
----------------------------------------------------------------------
])
else
	printf "OpenSSL found in $openssldir\n";
	OPENSSL_LIBS="-lssl -lcrypto";
	OPENSSL_LDFLAGS="-L$openssldir/lib";
	AC_SUBST(OPENSSL_CFLAGS)
	AC_SUBST(OPENSSL_LDFLAGS)
	AC_SUBST(OPENSSL_LIBS)
fi
])dnl

AC_DEFUN([AX_CHECK_RADSEC],
[AC_MSG_CHECKING(for radsec)
RADSEC_DIR=
found_radsec="no"
AC_ARG_WITH(radsec,
    AC_HELP_STRING([--with-radsec],
       [Use radsec (in specified installation directory)]),
    [check_radsec_dir="$withval"],
    [check_radsec_dir=])
for dir in $check_radsec_dir $prefix /usr /usr/local ; do
   radsecdir="$dir"
   if test -f "$dir/include/radsec/radsec.h"; then
     found_radsec="yes";
     RADSEC_DIR="${radsecdir}"
     RADSEC_CFLAGS="-I$radsecdir/include";
     break;
   fi
done
AC_MSG_RESULT($found_radsec)
if test x_$found_radsec != x_yes; then
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find radsec libraries.

  Please install libradsec or specify installation directory with
  --with-radsec=(dir).
----------------------------------------------------------------------
])
else
	printf "radsec found in $radsecdir\n";
	RADSEC_LIBS="-lradsec";
	RADSEC_LDFLAGS="-L$radsecdir/lib";
	AC_SUBST(RADSEC_CFLAGS)
	AC_SUBST(RADSEC_LDFLAGS)
	AC_SUBST(RADSEC_LIBS)
fi
])dnl

AC_DEFUN([AX_CHECK_JANSSON],
[AC_MSG_CHECKING(for jansson)
JANSSON_DIR=
found_jansson="no"
AC_ARG_WITH(jansson,
    AC_HELP_STRING([--with-jansson],
       [Use jansson (in specified installation directory)]),
    [check_jansson_dir="$withval"],
    [check_jansson_dir=])
for dir in $check_jansson_dir $prefix /usr /usr/local ; do
   janssondir="$dir"
   if test -f "$dir/include/jansson.h"; then
     found_jansson="yes";
     JANSSON_DIR="${janssondir}"
     JANSSON_CFLAGS="-I$janssondir/include";
     break;
   fi
done
AC_MSG_RESULT($found_jansson)
if test x_$found_jansson != x_yes; then
   AC_MSG_ERROR([
----------------------------------------------------------------------
  Cannot find jansson libraries.

  Please install libjansson or specify installation directory with
  --with-jansson=(dir).
----------------------------------------------------------------------
])
else
	printf "jansson found in $janssondir\n";
	JANSSON_LIBS="-ljansson";
	JANSSON_LDFLAGS="-L$janssondir/lib";
	AC_SUBST(JANSSON_CFLAGS)
	AC_SUBST(JANSSON_LDFLAGS)
	AC_SUBST(JANSSON_LIBS)
fi
])dnl

AC_DEFUN([AX_CHECK_LIBMOONSHOT],
[AC_MSG_CHECKING(for Moonshot identity selector implementation)
LIBMOONSHOT_DIR=
LIBMOONSHOT_CFLAGS=
LIBMOONSHOT_LDFLAGS=
LIBMOONSHOT_LIBS=
found_libmoonshot="no"
AC_ARG_WITH(libmoonshot,
    AC_HELP_STRING([--with-libmoonshot],
       [Use libmoonshot (in specified installation directory)]),
    [check_libmoonshot_dir="$withval"],
    [check_libmoonshot_dir=])
for dir in $check_libmoonshot_dir $prefix /usr /usr/local ; do
   libmoonshotdir="$dir"
   if test -f "$dir/include/libmoonshot.h"; then
     found_libmoonshot="yes";
     LIBMOONSHOT_DIR="${libmoonshotdir}"
     LIBMOONSHOT_CFLAGS="-I$libmoonshotdir/include";
     break;
   fi
done
AC_MSG_RESULT($found_libmoonshot)
if test x_$found_libmoonshot = x_yes; then
    printf "libmoonshot found in $libmoonshotdir\n";
    LIBMOONSHOT_LIBS="-lmoonshot";
    LIBMOONSHOT_LDFLAGS="-L$libmoonshot/lib";
    AC_CHECK_LIB(moonshot, moonshot_get_identity, [AC_DEFINE_UNQUOTED([HAVE_MOONSHOT_GET_IDENTITY], 1, [Define if Moonshot identity selector is available])], [], "$LIBMOONSHOT_LIBS")
fi
    AC_SUBST(LIBMOONSHOT_CFLAGS)
    AC_SUBST(LIBMOONSHOT_LDFLAGS)
    AC_SUBST(LIBMOONSHOT_LIBS)
    AM_CONDITIONAL(LIBMOONSHOT, test "x$found_libmoonshot" != "xno")
])dnl