|
1 Patch file created at Oracle to use krb5-config to discover libraries |
|
2 and include paths for linking with gssapi. |
|
3 |
|
4 Intention is to share patch with ISC for their inclusion in future |
|
5 releases of BIND. |
|
6 |
|
7 --- a/configure.in Thu Jun 2 11:28:43 2016 |
|
8 +++ b/configure.in Thu Jun 2 11:43:34 2016 |
|
9 @@ -799,6 +799,49 @@ |
|
10 [ --with-gssapi=PATH Specify path for system-supplied GSSAPI [[default=yes]]], |
|
11 use_gssapi="$withval", use_gssapi="yes") |
|
12 |
|
13 +# first try using krb5-config, if that does not work then fall back to "yes" method. |
|
14 +if test "$use_gssapi" = "krb5-config" |
|
15 +then |
|
16 + AC_MSG_RESULT(trying krb5_config) |
|
17 + AC_PATH_PROG(KRB5_CONFIG, krb5-config) |
|
18 + gssapi_cflags=`$KRB5_CONFIG --cflags gssapi` |
|
19 + gssapi_libs=`$KRB5_CONFIG --libs gssapi` |
|
20 + saved_cppflags="$CPPFLAGS" |
|
21 + CPPFLAGS="$gssapi_cflags $CPPFLAGS" |
|
22 + AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h, |
|
23 + [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"]) |
|
24 + if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then |
|
25 + AC_MSG_RESULT([krb5-config: gssapi.h not found]) |
|
26 + CPPFLAGS="$saved_cppflags" |
|
27 + use_gssapi="yes" |
|
28 + else |
|
29 + AC_CHECK_HEADERS(krb5/krb5.h krb5.h, |
|
30 + [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"]) |
|
31 + if test "$ISC_PLATFORM_KRB5HEADER" = ""; then |
|
32 + AC_MSG_RESULT([krb5-config: krb5.h not found]) |
|
33 + CPPFLAGS="$saved_cppflags" |
|
34 + use_gssapi="yes" |
|
35 + else |
|
36 + CPPFLAGS="$saved_cppflags" |
|
37 + saved_libs="$LIBS" |
|
38 + LIBS=$gssapi_libs |
|
39 + AC_MSG_CHECKING([krb5-config linking as $LIBS]) |
|
40 + AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()], |
|
41 + gssapi_linked=yes, gssapi_linked=no) |
|
42 + case $gssapi_linked in |
|
43 + yes) AC_MSG_RESULT([krb5-config: linked]);; |
|
44 + no) AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage]) |
|
45 + use_gssapi="yes" |
|
46 + ;; |
|
47 + esac |
|
48 + LIBS=$saved_libs |
|
49 + fi |
|
50 + fi |
|
51 + if test "$use_gssapi" = "yes"; then |
|
52 + AC_MSG_CHECKING([for GSSAPI library, non krb5-config method]) |
|
53 + fi |
|
54 +fi |
|
55 + |
|
56 # gssapi is just the framework, we really require kerberos v5, so |
|
57 # look for those headers (the gssapi headers must be there, too) |
|
58 # The problem with this implementation is that it doesn't allow |
|
59 @@ -842,6 +885,11 @@ |
|
60 yes) |
|
61 AC_MSG_ERROR([--with-gssapi must specify a path]) |
|
62 ;; |
|
63 + krb5-config) |
|
64 + USE_GSSAPI='-DGSSAPI' |
|
65 + DST_GSSAPI_INC="$gssapi_cflags" |
|
66 + DNS_GSSAPI_LIBS="$gssapi_libs" |
|
67 + ;; |
|
68 *) |
|
69 AC_MSG_RESULT(looking in $use_gssapi/lib) |
|
70 USE_GSSAPI='-DGSSAPI' |
|
71 --- a/configure Sun Feb 28 16:29:06 2016 |
|
72 +++ b/configure Thu Jun 2 03:56:59 2016 |
|
73 @@ -1,5 +1,5 @@ |
|
74 #! /bin/sh |
|
75 -# Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC") |
|
76 +# Copyright (C) 2004-2016 Internet Systems Consortium, Inc. ("ISC") |
|
77 # Copyright (C) 1996-2003 Internet Software Consortium. |
|
78 # |
|
79 # Permission to use, copy, modify, and/or distribute this software for any |
|
80 @@ -851,6 +851,7 @@ |
|
81 ISC_PLATFORM_GSSAPI_KRB5_HEADER |
|
82 ISC_PLATFORM_GSSAPIHEADER |
|
83 ISC_PLATFORM_HAVEGSSAPI |
|
84 +KRB5_CONFIG |
|
85 GEOIPLINKOBJS |
|
86 GEOIPLINKSRCS |
|
87 LWRES_PLATFORM_NEEDSYSSELECTH |
|
88 @@ -13975,6 +13976,133 @@ |
|
89 fi |
|
90 |
|
91 |
|
92 +# first try using krb5-config, if that does not work then fall back to "yes" method. |
|
93 +if test "$use_gssapi" = "krb5-config" |
|
94 +then |
|
95 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: trying krb5_config" >&5 |
|
96 +$as_echo "trying krb5_config" >&6; } |
|
97 + # Extract the first word of "krb5-config", so it can be a program name with args. |
|
98 +set dummy krb5-config; ac_word=$2 |
|
99 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
|
100 +$as_echo_n "checking for $ac_word... " >&6; } |
|
101 +if ${ac_cv_path_KRB5_CONFIG+:} false; then : |
|
102 + $as_echo_n "(cached) " >&6 |
|
103 +else |
|
104 + case $KRB5_CONFIG in |
|
105 + [\\/]* | ?:[\\/]*) |
|
106 + ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path. |
|
107 + ;; |
|
108 + *) |
|
109 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
110 +for as_dir in $PATH |
|
111 +do |
|
112 + IFS=$as_save_IFS |
|
113 + test -z "$as_dir" && as_dir=. |
|
114 + for ac_exec_ext in '' $ac_executable_extensions; do |
|
115 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
|
116 + ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext" |
|
117 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
118 + break 2 |
|
119 + fi |
|
120 +done |
|
121 + done |
|
122 +IFS=$as_save_IFS |
|
123 + |
|
124 + ;; |
|
125 +esac |
|
126 +fi |
|
127 +KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG |
|
128 +if test -n "$KRB5_CONFIG"; then |
|
129 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KRB5_CONFIG" >&5 |
|
130 +$as_echo "$KRB5_CONFIG" >&6; } |
|
131 +else |
|
132 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
133 +$as_echo "no" >&6; } |
|
134 +fi |
|
135 + |
|
136 + |
|
137 + gssapi_cflags=`$KRB5_CONFIG --cflags gssapi` |
|
138 + gssapi_libs=`$KRB5_CONFIG --libs gssapi` |
|
139 + saved_cppflags="$CPPFLAGS" |
|
140 + CPPFLAGS="$gssapi_cflags $CPPFLAGS" |
|
141 + for ac_header in gssapi.h gssapi/gssapi.h |
|
142 +do : |
|
143 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
|
144 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" |
|
145 +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
|
146 + cat >>confdefs.h <<_ACEOF |
|
147 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 |
|
148 +_ACEOF |
|
149 + ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>" |
|
150 +fi |
|
151 + |
|
152 +done |
|
153 + |
|
154 + if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then |
|
155 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: krb5-config: gssapi.h not found" >&5 |
|
156 +$as_echo "krb5-config: gssapi.h not found" >&6; } |
|
157 + CPPFLAGS="$saved_cppflags" |
|
158 + use_gssapi="yes" |
|
159 + else |
|
160 + for ac_header in krb5/krb5.h krb5.h |
|
161 +do : |
|
162 + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
|
163 +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" |
|
164 +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
|
165 + cat >>confdefs.h <<_ACEOF |
|
166 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 |
|
167 +_ACEOF |
|
168 + ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>" |
|
169 +fi |
|
170 + |
|
171 +done |
|
172 + |
|
173 + if test "$ISC_PLATFORM_KRB5HEADER" = ""; then |
|
174 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: krb5-config: krb5.h not found" >&5 |
|
175 +$as_echo "krb5-config: krb5.h not found" >&6; } |
|
176 + CPPFLAGS="$saved_cppflags" |
|
177 + use_gssapi="yes" |
|
178 + else |
|
179 + CPPFLAGS="$saved_cppflags" |
|
180 + saved_libs="$LIBS" |
|
181 + LIBS=$gssapi_libs |
|
182 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking krb5-config linking as $LIBS" >&5 |
|
183 +$as_echo_n "checking krb5-config linking as $LIBS... " >&6; } |
|
184 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
|
185 +/* end confdefs.h. */ |
|
186 + |
|
187 +int |
|
188 +main () |
|
189 +{ |
|
190 +gss_acquire_cred();krb5_init_context() |
|
191 + ; |
|
192 + return 0; |
|
193 +} |
|
194 +_ACEOF |
|
195 +if ac_fn_c_try_link "$LINENO"; then : |
|
196 + gssapi_linked=yes |
|
197 +else |
|
198 + gssapi_linked=no |
|
199 +fi |
|
200 +rm -f core conftest.err conftest.$ac_objext \ |
|
201 + conftest$ac_exeext conftest.$ac_ext |
|
202 + case $gssapi_linked in |
|
203 + yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: krb5-config: linked" >&5 |
|
204 +$as_echo "krb5-config: linked" >&6; };; |
|
205 + no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: krb5-config: could not determine proper GSSAPI linkage" >&5 |
|
206 +$as_echo "krb5-config: could not determine proper GSSAPI linkage" >&6; } |
|
207 + use_gssapi="yes" |
|
208 + ;; |
|
209 + esac |
|
210 + LIBS=$saved_libs |
|
211 + fi |
|
212 + fi |
|
213 + if test "$use_gssapi" = "yes"; then |
|
214 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSSAPI library, non krb5-config method" >&5 |
|
215 +$as_echo_n "checking for GSSAPI library, non krb5-config method... " >&6; } |
|
216 + fi |
|
217 +fi |
|
218 + |
|
219 # gssapi is just the framework, we really require kerberos v5, so |
|
220 # look for those headers (the gssapi headers must be there, too) |
|
221 # The problem with this implementation is that it doesn't allow |
|
222 @@ -14019,6 +14147,11 @@ |
|
223 yes) |
|
224 as_fn_error $? "--with-gssapi must specify a path" "$LINENO" 5 |
|
225 ;; |
|
226 + krb5-config) |
|
227 + USE_GSSAPI='-DGSSAPI' |
|
228 + DST_GSSAPI_INC="$gssapi_cflags" |
|
229 + DNS_GSSAPI_LIBS="$gssapi_libs" |
|
230 + ;; |
|
231 *) |
|
232 { $as_echo "$as_me:${as_lineno-$LINENO}: result: looking in $use_gssapi/lib" >&5 |
|
233 $as_echo "looking in $use_gssapi/lib" >&6; } |