Check for gssapi libraries and header files.
Showing
1 changed file
with
80 additions
and
0 deletions
m4/gssapi.m4
0 → 100644
1 | # Based on gssapi.m4 by Brendan Cully <brendan@kublai.com> 20010529 | ||
2 | |||
3 | dnl MU_CHECK_GSSAPI(PREFIX) | ||
4 | dnl Search for a GSSAPI implementation in the standard locations plus PREFIX, | ||
5 | dnl if it is set and not "yes". | ||
6 | dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found. | ||
7 | dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found | ||
8 | AC_DEFUN(MU_CHECK_GSSAPI, | ||
9 | [ | ||
10 | if test "x$mu_cv_lib_gssapi_libs" = x; then | ||
11 | cache="" | ||
12 | GSSAPI_PREFIX=[$1] | ||
13 | GSSAPI_IMPL="none" | ||
14 | # First try krb5-config | ||
15 | if test "$GSSAPI_PREFIX" != "yes"; then | ||
16 | krb5_path="$GSSAPI_PREFIX/bin" | ||
17 | else | ||
18 | krb5_path="$PATH" | ||
19 | fi | ||
20 | AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path) | ||
21 | if test "$KRB5CFGPATH" != "none"; then | ||
22 | GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`" | ||
23 | GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`" | ||
24 | GSSAPI_IMPL="Heimdal" | ||
25 | else | ||
26 | ## OK, try the old code | ||
27 | saved_CPPFLAGS="$CPPFLAGS" | ||
28 | saved_LDFLAGS="$LDFLAGS" | ||
29 | saved_LIBS="$LIBS" | ||
30 | if test "$GSSAPI_PREFIX" != "yes"; then | ||
31 | GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include" | ||
32 | GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib" | ||
33 | CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" | ||
34 | LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS" | ||
35 | fi | ||
36 | |||
37 | ## Check for new MIT kerberos V support | ||
38 | AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, | ||
39 | [GSSAPI_IMPL="MIT", | ||
40 | GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"] | ||
41 | ,, -lkrb5 -lk5crypto -lcom_err) | ||
42 | |||
43 | ## Heimdal kerberos V support | ||
44 | if test "$GSSAPI_IMPL" = "none"; then | ||
45 | AC_CHECK_LIB(gssapi, gss_init_sec_context, | ||
46 | [GSSAPI_IMPL="Heimdal" | ||
47 | GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken" | ||
48 | GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"] | ||
49 | ,, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err) | ||
50 | fi | ||
51 | |||
52 | ## Old MIT Kerberos V | ||
53 | ## Note: older krb5 distributions use -lcrypto instead of | ||
54 | ## -lk5crypto, which collides with OpenSSL. One way of dealing | ||
55 | ## with that is to extract all objects from krb5's libcrypto | ||
56 | ## and from openssl's libcrypto into the same directory, then | ||
57 | ## to create a new libcrypto from these. | ||
58 | if test "$GSSAPI_IMPL" = "none"; then | ||
59 | AC_CHECK_LIB(gssapi_krb5, g_order_init, | ||
60 | [GSSAPI_IMPL="OldMIT", | ||
61 | GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"] | ||
62 | ,, -lkrb5 -lcrypto -lcom_err) | ||
63 | fi | ||
64 | fi | ||
65 | |||
66 | mu_cv_lib_gssapi_cflags="$GSSAPI_CFLAGS" | ||
67 | mu_cv_lib_gssapi_libs="$GSSAPI_LIBS" | ||
68 | mu_cv_lib_gssapi_impl="$GSSAPI_IMPL" | ||
69 | |||
70 | LDFLAGS="$saved_LDFLAGS" | ||
71 | LIBS="$saved_LIBS" | ||
72 | else | ||
73 | cached=" (cached) " | ||
74 | GSSAPI_CFLAGS="$mu_cv_lib_gssapi_cflags" | ||
75 | GSSAPI_LIBS="$mu_cv_lib_gssapi_libs" | ||
76 | GSSAPI_IMPL="$mu_cv_lib_gssapi_impl" | ||
77 | fi | ||
78 | AC_MSG_CHECKING(GSSAPI implementation) | ||
79 | AC_MSG_RESULT(${cached}$GSSAPI_IMPL) | ||
80 | ]) | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment