]>
Commit | Line | Data |
---|---|---|
f7deaa1a | 1 | dnl |
2 | dnl "$Id$" | |
3 | dnl | |
321d8d57 | 4 | dnl GSSAPI/Kerberos library detection for CUPS. |
f7deaa1a | 5 | dnl |
f3c17241 | 6 | dnl Copyright 2007-2012 by Apple Inc. |
f7deaa1a | 7 | dnl Copyright 2006-2007 by Easy Software Products. |
8 | dnl | |
9 | dnl This file contains Kerberos support code, copyright 2006 by | |
10 | dnl Jelmer Vernooij. | |
11 | dnl | |
12 | dnl These coded instructions, statements, and computer programs are the | |
bc44d920 | 13 | dnl property of Apple Inc. and are protected by Federal copyright |
14 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
15 | dnl which should have been included with this file. If this file is | |
16 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
f7deaa1a | 17 | dnl |
18 | ||
bf3816c7 | 19 | AC_ARG_ENABLE(gssapi, [ --disable-gssapi disable GSSAPI support]) |
f7deaa1a | 20 | |
21 | LIBGSSAPI="" | |
e07d4801 | 22 | AC_SUBST(LIBGSSAPI) |
f7deaa1a | 23 | |
24 | if test x$enable_gssapi != xno; then | |
25 | AC_PATH_PROG(KRB5CONFIG, krb5-config) | |
26 | if test "x$KRB5CONFIG" != x; then | |
0a682745 MS |
27 | case "$uname" in |
28 | Darwin) | |
f3c17241 | 29 | # OS X weak-links to the Kerberos framework... |
0a682745 | 30 | LIBGSSAPI="-weak_framework Kerberos" |
eac3a0a0 MS |
31 | AC_MSG_CHECKING(for GSS framework) |
32 | if test -d /System/Library/Frameworks/GSS.framework; then | |
33 | AC_MSG_RESULT(yes) | |
34 | LIBGSSAPI="$LIBGSSAPI -weak_framework GSS" | |
35 | else | |
36 | AC_MSG_RESULT(no) | |
37 | fi | |
0a682745 MS |
38 | ;; |
39 | SunOS*) | |
40 | # Solaris has a non-standard krb5-config, don't use it! | |
41 | AC_CHECK_LIB(gss, gss_display_status, | |
42 | AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available]) | |
eac3a0a0 MS |
43 | CFLAGS="`$KRB5CONFIG --cflags` $CFLAGS" |
44 | CPPFLAGS="`$KRB5CONFIG --cflags` $CPPFLAGS" | |
0a682745 MS |
45 | LIBGSSAPI="-lgss `$KRB5CONFIG --libs`") |
46 | ;; | |
47 | *) | |
48 | # Other platforms just ask for GSSAPI | |
eac3a0a0 MS |
49 | CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS" |
50 | CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS" | |
0a682745 MS |
51 | LIBGSSAPI="`$KRB5CONFIG --libs gssapi`" |
52 | ;; | |
53 | esac | |
f7deaa1a | 54 | AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available]) |
55 | else | |
09a101d6 | 56 | # Check for vendor-specific implementations... |
57 | case "$uname" in | |
58 | HP-UX*) | |
59 | AC_CHECK_LIB(gss, gss_display_status, | |
60 | AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available]) | |
61 | LIBGSSAPI="-lgss -lgssapi_krb5") | |
62 | ;; | |
63 | SunOS*) | |
64 | AC_CHECK_LIB(gss, gss_display_status, | |
65 | AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available]) | |
66 | LIBGSSAPI="-lgss") | |
67 | ;; | |
68 | esac | |
f7deaa1a | 69 | fi |
70 | ||
71 | if test "x$LIBGSSAPI" != x; then | |
72 | AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H)) | |
eac3a0a0 | 73 | if test -d /System/Library/Frameworks/GSS.framework; then |
a2326b5b MS |
74 | gssdir="/System/Library/Frameworks/GSS.framework" |
75 | AC_MSG_CHECKING(for GSS/gssapi.h presence) | |
76 | if test -f $gssdir/Headers/gssapi.h; then | |
77 | AC_DEFINE(HAVE_GSS_GSSAPI_H) | |
78 | AC_MSG_RESULT(yes) | |
79 | else | |
80 | AC_MSG_RESULT(no) | |
81 | fi | |
82 | AC_MSG_CHECKING(for GSS/gssapi_generic.h presence) | |
83 | if test -f $gssdir/Headers/gssapi_generic.h; then | |
84 | AC_DEFINE(HAVE_GSSAPI_GENERIC_H) | |
85 | AC_MSG_RESULT(yes) | |
86 | else | |
87 | AC_MSG_RESULT(no) | |
88 | fi | |
a2326b5b MS |
89 | AC_MSG_CHECKING(for GSS/gssapi_spi.h presence) |
90 | if test -f $gssdir/PrivateHeaders/gssapi_spi.h; then | |
91 | AC_MSG_RESULT(yes) | |
92 | AC_MSG_CHECKING(for GSS/gssapi_spi.h usability) | |
93 | if test -s $gssdir/PrivateHeaders/gssapi_spi.h; then | |
94 | AC_MSG_RESULT(yes) | |
95 | AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H) | |
96 | else | |
97 | AC_MSG_RESULT(no) | |
98 | fi | |
99 | else | |
100 | AC_MSG_RESULT(no) | |
0fa6c7fa MS |
101 | if test $uversion -ge 110 -a $uversion -lt 120; then |
102 | # Broken public headers in 10.7.x... | |
a2326b5b MS |
103 | AC_MSG_ERROR(Run 'sudo mkdir -p $gssdir/PrivateHeaders' and 'sudo touch $gssdir/PrivateHeaders/gssapi_spi.h' to build CUPS.) |
104 | fi | |
105 | fi | |
eac3a0a0 MS |
106 | else |
107 | AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H)) | |
108 | AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H)) | |
eac3a0a0 | 109 | fi |
f7deaa1a | 110 | |
111 | SAVELIBS="$LIBS" | |
112 | LIBS="$LIBS $LIBGSSAPI" | |
113 | ||
eac3a0a0 MS |
114 | AC_CHECK_FUNC(__ApplePrivate_gss_acquire_cred_ex_f, |
115 | AC_DEFINE(HAVE_GSS_ACQUIRE_CRED_EX_F)) | |
f7deaa1a | 116 | |
117 | AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE) | |
eac3a0a0 | 118 | if test x$ac_cv_header_gssapi_gssapi_h = xyes; then |
f7deaa1a | 119 | AC_TRY_COMPILE([ #include <gssapi/gssapi.h> ], |
120 | [ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ], | |
121 | AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE) | |
122 | AC_MSG_RESULT(yes), | |
123 | AC_MSG_RESULT(no)) | |
eac3a0a0 MS |
124 | elif test x$ac_cv_header_gss_gssapi_h = xyes; then |
125 | AC_TRY_COMPILE([ #include <GSS/gssapi.h> ], | |
126 | [ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ], | |
127 | AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE) | |
128 | AC_MSG_RESULT(yes), | |
129 | AC_MSG_RESULT(no)) | |
f7deaa1a | 130 | else |
131 | AC_TRY_COMPILE([ #include <gssapi.h> ], | |
132 | [ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ], | |
133 | AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE) | |
134 | AC_MSG_RESULT(yes), | |
135 | AC_MSG_RESULT(no)) | |
136 | fi | |
137 | ||
138 | LIBS="$SAVELIBS" | |
f7deaa1a | 139 | fi |
140 | fi | |
141 | ||
142 | dnl Default GSS service name... | |
143 | AC_ARG_WITH(gssservicename, [ --with-gssservicename set default gss service name], | |
144 | default_gssservicename="$withval", | |
145 | default_gssservicename="default") | |
146 | ||
147 | if test x$default_gssservicename != xno; then | |
148 | if test "x$default_gssservicename" = "xdefault"; then | |
68b10830 | 149 | CUPS_DEFAULT_GSSSERVICENAME="host" |
f7deaa1a | 150 | else |
151 | CUPS_DEFAULT_GSSSERVICENAME="$default_gssservicename" | |
152 | fi | |
153 | else | |
154 | CUPS_DEFAULT_GSSSERVICENAME="" | |
155 | fi | |
156 | ||
dcb445bc | 157 | AC_SUBST(CUPS_DEFAULT_GSSSERVICENAME) |
f7deaa1a | 158 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME") |
159 | ||
160 | dnl | |
161 | dnl End of "$Id$". | |
162 | dnl |