Debian updates. Brings files in packaging/Debian on par with the
[Samba.git] / packaging / Debian / debian / patches / krb5-vars.patch
blob28ee4855d84c823d123ce5599b6e42174a4ca379
1 --- samba_3_0/source/Makefile.in.orig 2003-07-15 12:26:55.000000000 -0400
2 +++ samba_3_0/source/Makefile.in 2003-07-15 12:26:57.000000000 -0400
3 @@ -32,7 +32,6 @@
4 ACLLIBS=@ACLLIBS@
5 PASSDBLIBS=@PASSDBLIBS@
6 IDMAP_LIBS=@IDMAP_LIBS@
7 -ADSLIBS=@ADSLIBS@
8 KRB5LIBS=@KRB5_LIBS@
9 LDAPLIBS=@LDAP_LIBS@
11 @@ -735,12 +734,12 @@
13 bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy
14 @echo Linking $@
15 - @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(ADSLIBS) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \
16 + @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(KRB5LIBS) $(LDAPLIBS) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \
17 $(AUTHLIBS) $(ACLLIBS) $(PASSDBLIBS) $(LIBS) @POPTLIBS@
19 bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy
20 @echo Linking $@
21 - @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(ADSLIBS)
22 + @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAPLIBS)
24 bin/wrepld@EXEEXT@: $(WREPL_OBJ) @BUILD_POPT@ bin/.dummy
25 @echo Linking $@
26 @@ -749,19 +748,19 @@
27 bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
28 @echo Linking $@
29 @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \
30 - $(AUTHLIBS) $(LIBS) $(PASSDBLIBS) @POPTLIBS@ $(KRB5LIBS)
31 + $(AUTHLIBS) $(LIBS) $(PASSDBLIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAPLIBS)
33 bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
34 @echo Linking $@
35 - @$(CC) $(FLAGS) -o $@ $(PASSDBLIBS) $(RPCCLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(ADSLIBS)
36 + @$(CC) $(FLAGS) -o $@ $(PASSDBLIBS) $(RPCCLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAPLIBS)
38 bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
39 @echo Linking $@
40 - @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(ADSLIBS)
41 + @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAPLIBS)
43 bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy
44 @echo Linking $@
45 - @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(ADSLIBS) $(PASSDBLIBS)
46 + @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAPLIBS) $(PASSDBLIBS)
48 bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy
49 @echo Linking $@
50 @@ -809,7 +808,7 @@
52 bin/smbpasswd@EXEEXT@: $(SMBPASSWD_OBJ) bin/.dummy
53 @echo Linking $@
54 - @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(PASSDBLIBS) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS)
55 + @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(PASSDBLIBS) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAPLIBS)
57 bin/pdbedit@EXEEXT@: $(PDBEDIT_OBJ) @BUILD_POPT@ bin/.dummy
58 @echo Linking $@
59 @@ -881,7 +880,7 @@
61 bin/smbw_sample@EXEEXT@: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy
62 @echo Linking $@
63 - @$(CC) $(FLAGS) -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(LIBS) $(KRB5LIBS)
64 + @$(CC) $(FLAGS) -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAPLIBS)
66 bin/smbsh@EXEEXT@: $(SMBSH_OBJ) bin/.dummy
67 @echo Linking $@
68 @@ -890,12 +889,14 @@
69 bin/smbwrapper.@SHLIBEXT@: $(PICOBJS) bin/.dummy
70 @echo Linking shared library $@
71 @$(SHLD) $(LDSHFLAGS) -o $@ $(PICOBJS) $(LIBS) \
72 - @SONAMEFLAG@`basename $@` $(KRB5LIBS)
73 + $(KRB5LIBS) $(LDAPLIBS) \
74 + @SONAMEFLAG@`basename $@`
76 bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS)
77 @echo Linking libsmbclient shared library $@
78 @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(LIBS) \
79 - $(KRB5LIBS) @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
80 + $(KRB5LIBS) $(LDAPLIBS) \
81 + @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
83 bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS)
84 @echo Linking libsmbclient non-shared library $@
85 @@ -905,7 +906,8 @@
86 bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
87 @echo Linking bigballofmud shared library $@
88 @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \
89 - @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR) $(PASSDBLIBS) $(IDMAP_LIBS) $(ADSLIBS)
90 + $(PASSDBLIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAPLIBS) \
91 + @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
92 ln -snf libbigballofmud.so bin/libbigballofmud.so.0
94 # It would be nice to build a static bigballofmud too, but when I try
95 diff -uNr samba-3.0.0beta2.orig/source/aclocal.m4 samba-3.0.0beta2/source/aclocal.m4
96 --- samba-3.0.0beta2.orig/source/aclocal.m4 2003-07-01 15:44:25.000000000 -0500
97 +++ samba-3.0.0beta2/source/aclocal.m4 2003-07-05 16:22:30.000000000 -0500
98 @@ -111,6 +111,113 @@
99 esac
102 +# AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
103 +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
104 +# [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
105 +# ------------------------------------------------------
107 +# Use a cache variable name containing both the library and function name,
108 +# because the test really is for library $1 defining function $3, not
109 +# just for library $1. Separate tests with the same $1 and different $3s
110 +# may have different results.
112 +# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
113 +# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
114 +# ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence
115 +# the AS_LITERAL_IF indirection.
117 +# FIXME: This macro is extremely suspicious. It DEFINEs unconditionnally,
118 +# whatever the FUNCTION, in addition to not being a *S macro. Note
119 +# that the cache does depend upon the function we are looking for.
121 +# It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
122 +# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
123 +# changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
124 +# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
125 +# freedom.
126 +AC_DEFUN([AC_CHECK_LIB_EXT],
128 +AH_CHECK_LIB_EXT([$1])
129 +ac_check_lib_ext_save_LIBS=$LIBS
130 +LIBS="-l$1 $$2 $7 $LIBS"
131 +AS_LITERAL_IF([$1],
132 + [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
133 + [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
135 +m4_ifval([$3],
137 + AH_CHECK_FUNC_EXT([$3])
138 + AS_LITERAL_IF([$1],
139 + [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
140 + [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
141 + AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
142 + [AC_TRY_LINK_FUNC($3,
143 + [AS_VAR_SET(ac_Lib_func, yes);
144 + AS_VAR_SET(ac_Lib_ext, yes)],
145 + [AS_VAR_SET(ac_Lib_func, no);
146 + AS_VAR_SET(ac_Lib_ext, no)])
147 + ])
148 + AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
149 + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
150 + AS_VAR_POPDEF([ac_Lib_func])dnl
151 + ],[
152 + AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
153 + [AC_TRY_LINK_FUNC([main],
154 + [AS_VAR_SET(ac_Lib_ext, yes)],
155 + [AS_VAR_SET(ac_Lib_ext, no)])
156 + ])
157 + ])
158 +LIBS=$ac_check_lib_ext_save_LIBS
160 +AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
161 + [m4_default([$4],
162 + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
163 + case "$$2" in
164 + *-l$1*)
165 + ;;
166 + *)
167 + $2="$$2 -l$1"
168 + ;;
169 + esac])
170 + [$6]
171 + ],
172 + [$5])dnl
173 +AS_VAR_POPDEF([ac_Lib_ext])dnl
174 +])# AC_CHECK_LIB_EXT
176 +# AH_CHECK_LIB_EXT(LIBNAME)
177 +# ---------------------
178 +m4_define([AH_CHECK_LIB_EXT],
179 +[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
180 + [Define to 1 if you have the `]$1[' library (-l]$1[).])])
182 +# AC_CHECK_FUNCS_EXT(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
183 +# -----------------------------------------------------------------
184 +dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
185 +dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
186 +AC_DEFUN([AC_CHECK_FUNC_EXT],
188 + AH_CHECK_FUNC_EXT($1)
189 + ac_check_func_ext_save_LIBS=$LIBS
190 + LIBS="$2 $LIBS"
191 + AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
192 + AC_CACHE_CHECK([for $1], ac_var,
193 + [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
194 + [AS_VAR_SET(ac_var, yes)],
195 + [AS_VAR_SET(ac_var, no)])])
196 + LIBS=$ac_check_func_ext_save_LIBS
197 + AS_IF([test AS_VAR_GET(ac_var) = yes],
198 + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3],
199 + [$4])dnl
200 +AS_VAR_POPDEF([ac_var])dnl
201 +])# AC_CHECK_FUNC
203 +# AH_CHECK_FUNC_EXT(FUNCNAME)
204 +# ---------------------
205 +m4_define([AH_CHECK_FUNC_EXT],
206 +[AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
207 + [Define to 1 if you have the `]$1[' function.])])
209 dnl Define an AC_DEFINE with ifndef guard.
210 dnl AC_N_DEFINE(VARIABLE [, VALUE])
211 define(AC_N_DEFINE,
212 diff -uNr samba-3.0.0beta2.orig/source/configure.in samba-3.0.0beta2/source/configure.in
213 --- samba-3.0.0beta2.orig/source/configure.in 2003-07-05 16:22:00.000000000 -0500
214 +++ samba-3.0.0beta2/source/configure.in 2003-07-05 16:23:53.000000000 -0500
215 @@ -162,12 +162,10 @@
216 AC_SUBST(PRINTLIBS)
217 AC_SUBST(AUTHLIBS)
218 AC_SUBST(ACLLIBS)
219 -AC_SUBST(ADSLIBS)
220 AC_SUBST(PASSDBLIBS)
221 AC_SUBST(IDMAP_LIBS)
222 AC_SUBST(KRB5_LIBS)
223 AC_SUBST(LDAP_LIBS)
224 -AC_SUBST(LDAP_OBJ)
225 AC_SUBST(SHLIB_PROGS)
226 AC_SUBST(SMBWRAPPER)
227 AC_SUBST(EXTRA_BIN_PROGS)
228 @@ -2105,14 +2103,107 @@
229 AC_MSG_RESULT(no)
232 +########################################################
233 +# Compile with LDAP support?
235 +with_ldap_support=auto
236 +AC_MSG_CHECKING([for LDAP support])
238 +AC_ARG_WITH(ldap,
239 +[ --with-ldap LDAP support (default yes)],
240 +[ case "$withval" in
241 + yes|no)
242 + with_ldap_support=$withval
243 + ;;
244 + esac ])
246 +AC_MSG_RESULT($with_ldap_support)
248 +SMBLDAP=""
249 +SMBLDAP_PROTO=""
250 +AC_SUBST(SMBLDAP)
251 +AC_SUBST(SMBLDAP_PROTO)
252 +if test x"$with_ldap_support" != x"no"; then
254 + ##################################################################
255 + # first test for ldap.h and lber.h
256 + # (ldap.h is required for this test)
257 + AC_CHECK_HEADERS(ldap.h lber.h)
259 + if test x"$ac_cv_header_ldap_h" != x"yes"; then
260 + if test x"$with_ldap_support" = x"yes"; then
261 + AC_MSG_ERROR(ldap.h is needed for LDAP support)
262 + else
263 + AC_MSG_WARN(ldap.h is needed for LDAP support)
264 + fi
266 + with_ldap_support=no
267 + fi
270 +if test x"$with_ldap_support" != x"no"; then
271 + ac_save_LIBS=$LIBS
273 + ##################################################################
274 + # we might need the lber lib on some systems. To avoid link errors
275 + # this test must be before the libldap test
276 + AC_CHECK_LIB_EXT(lber, LDAP_LIBS, ber_scanf)
278 + ########################################################
279 + # now see if we can find the ldap libs in standard paths
280 + AC_CHECK_LIB_EXT(ldap, LDAP_LIBS, ldap_init)
282 + AC_CHECK_FUNC_EXT(ldap_domain2hostlist,$LDAP_LIBS)
284 + ########################################################
285 + # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
286 + # Check found in pam_ldap 145.
287 + AC_CHECK_FUNC_EXT(ldap_set_rebind_proc,$LDAP_LIBS)
289 + LIBS="$LIBS $LDAP_LIBS"
290 + AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, smb_ldap_cv_ldap_set_rebind_proc, [
291 + AC_TRY_COMPILE([
292 + #include <lber.h>
293 + #include <ldap.h>],
294 + [ldap_set_rebind_proc(0, 0, 0);],
295 + [smb_ldap_cv_ldap_set_rebind_proc=3],
296 + [smb_ldap_cv_ldap_set_rebind_proc=2]
297 + )
298 + ])
300 + AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
302 + AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)
304 + if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes" -a x"$ac_cv_func_ext_ldap_domain2hostlist" = x"yes"; then
305 + AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
306 + default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
307 + SMBLDAP="lib/smbldap.o"
308 + with_ldap_support=yes
309 + AC_MSG_CHECKING(whether LDAP support is used)
310 + AC_MSG_RESULT(yes)
311 + else
312 + if test x"$with_ldap_support" = x"yes"; then
313 + AC_MSG_ERROR(libldap is needed for LDAP support)
314 + else
315 + AC_MSG_WARN(libldap is needed for LDAP support)
316 + fi
318 + LDAP_LIBS=""
319 + with_ldap_support=no
320 + fi
321 + LIBS=$ac_save_LIBS
325 #################################################
326 # active directory support
328 with_ads_support=auto
329 -AC_MSG_CHECKING([whether to use Active Directory])
330 +AC_MSG_CHECKING([for Active Directory and krb5 support])
332 AC_ARG_WITH(ads,
333 -[ --with-ads Active Directory support (default yes)],
334 +[ --with-ads Active Directory support (default auto)],
335 [ case "$withval" in
336 yes|no)
337 with_ads_support="$withval"
338 @@ -2124,22 +2215,28 @@
339 FOUND_KRB5=no
340 KRB5_LIBS=""
342 +if test x"$with_ldap_support" != x"yes"; then
343 + if test x"$with_ads_support" = x"yes"; then
344 + AC_MSG_ERROR(Active Directory Support requires LDAP support)
345 + elif test x"$with_ads_support" != x"no"; then
346 + AC_MSG_WARN(Active Directory Support requires LDAP support)
347 + fi
348 + with_ads_support=no
351 if test x"$with_ads_support" != x"no"; then
353 # Do no harm to the values of CFLAGS and LIBS while testing for
354 # Kerberos support.
356 - ac_save_CFLAGS="$CFLAGS"
357 - ac_save_LIBS="$LIBS"
359 #################################################
360 # check for krb5-config from recent MIT and Heimdal kerberos 5
361 AC_PATH_PROG(KRB5_CONFIG, krb5-config)
362 AC_MSG_CHECKING(for working krb5-config)
363 if test -x "$KRB5_CONFIG"; then
364 - LIBS="$LIBS `$KRB5_CONFIG --libs`"
365 - CFLAGS="$CFLAGS `$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
366 - CPPFLAGS="$CPPFLAGS `$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
367 + KRB5_LIBS="`CFLAGS='' $KRB5_CONFIG --libs gssapi`"
368 + KRB5_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
369 + KRB5_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
370 FOUND_KRB5=yes
371 AC_MSG_RESULT(yes)
372 else
373 @@ -2154,18 +2251,23 @@
374 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
375 [ case "$withval" in
377 - AC_MSG_RESULT(no)
378 + AC_MSG_RESULT(no krb5-path given)
379 + ;;
380 + yes)
381 + AC_MSG_RESULT(/usr)
382 + KRB5_LIBS="-lkrb5"
383 + FOUND_KRB5=yes
386 - AC_MSG_RESULT(yes)
387 - LIBS="$LIBS -lkrb5"
388 - CFLAGS="$CFLAGS -I$withval/include"
389 - CPPFLAGS="$CPPFLAGS -I$withval/include"
390 - LDFLAGS="$LDFLAGS -L$withval/lib"
391 + AC_MSG_RESULT($withval)
392 + KRB5_LIBS="-lkrb5"
393 + KRB5_CFLAGS="-I$withval/include"
394 + KRB5_CPPFLAGS="-I$withval/include"
395 + KRB5_LDFLAGS="-L$withval/lib"
396 FOUND_KRB5=yes
398 esac ],
399 - AC_MSG_RESULT(no)
400 + AC_MSG_RESULT(no krb5-path given)
404 @@ -2175,15 +2277,15 @@
405 AC_MSG_CHECKING(for /usr/include/heimdal)
406 if test -d /usr/include/heimdal; then
407 if test -f /usr/lib/heimdal/lib/libkrb5.a; then
408 - LIBS="$LIBS -lkrb5"
409 - CFLAGS="$CFLAGS -I/usr/include/heimdal"
410 - CPPFLAGS="$CPPFLAGS -I/usr/include/heimdal"
411 - LDFLAGS="$LDFLAGS -L/usr/lib/heimdal/lib"
412 + KRB5_LIBS="-lkrb5"
413 + KRB5_CFLAGS="-I/usr/include/heimdal"
414 + KRB5_CPPFLAGS="-I/usr/include/heimdal"
415 + KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
416 AC_MSG_RESULT(yes)
417 else
418 - LIBS="$LIBS -lkrb5"
419 - CFLAGS="$CFLAGS -I/usr/include/heimdal"
420 - CPPFLAGS="$CPPFLAGS -I/usr/include/heimdal"
421 + KRB5_LIBS="-lkrb5"
422 + KRB5_CFLAGS="-I/usr/include/heimdal"
423 + KRB5_CPPFLAGS="-I/usr/include/heimdal"
424 AC_MSG_RESULT(yes)
426 else
427 @@ -2196,16 +2298,26 @@
428 # see if this box has the RedHat location for kerberos
429 AC_MSG_CHECKING(for /usr/kerberos)
430 if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then
431 - LIBS="$LIBS -lkrb5"
432 - LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
433 - CFLAGS="$CFLAGS -I/usr/kerberos/include"
434 - CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
435 + KRB5_LIBS="-lkrb5"
436 + KRB5_LDFLAGS="-L/usr/kerberos/lib"
437 + KRB5_CFLAGS="-I/usr/kerberos/include"
438 + KRB5_CPPFLAGS="-I/usr/kerberos/include"
439 AC_MSG_RESULT(yes)
440 else
441 AC_MSG_RESULT(no)
445 + ac_save_CFLAGS=$CFLAGS
446 + ac_save_CPPFLAGS=$CPPFLAGS
447 + ac_save_LDFLAGS=$LDFLAGS
449 + CFLAGS="$CFLAGS $KRB5_CFLAGS"
450 + CPPFLAGS="$CPPFLAGS $KRB5_CPPFLAGS"
451 + LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
453 + KRB5_LIBS="$KRB5_LDFLAGS $KRB5_LIBS"
455 # now check for krb5.h. Some systems have the libraries without the headers!
456 # note that this check is done here to allow for different kerberos
457 # include paths
458 @@ -2225,24 +2337,17 @@
459 # Turn off AD support and restore CFLAGS and LIBS variables
461 with_ads_support="no"
463 - CFLAGS="$ac_save_CFLAGS"
464 - LIBS="$ac_save_LIBS"
466 - else
468 - # Get rid of case where $with_ads_support=auto
470 - with_ads_support="yes"
473 + CFLAGS=$ac_save_CFLAGS
474 + CPPFLAGS=$ac_save_CPPFLAGS
475 + LDFLAGS=$ac_save_LDFLAGS
479 # Now we have determined whether we really want ADS support
481 -if test x"$with_ads_support" = x"yes"; then
483 - AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
484 +if test x"$with_ads_support" != x"no"; then
485 + ac_save_LIBS=$LIBS
487 # now check for gssapi headers. This is also done here to allow for
488 # different kerberos include paths
489 @@ -2250,62 +2355,45 @@
491 ##################################################################
492 # we might need the k5crypto and com_err libraries on some systems
493 - AC_CHECK_LIB(com_err, _et_list)
494 - AC_CHECK_LIB(k5crypto, krb5_encrypt_data)
495 + AC_CHECK_LIB_EXT(com_err, KRB5_LIBS, _et_list)
496 + AC_CHECK_LIB_EXT(k5crypto, KRB5_LIBS, krb5_encrypt_data)
498 # Heimdal checks.
499 - AC_CHECK_LIB(crypto, des_set_key)
500 - AC_CHECK_LIB(asn1, copy_Authenticator)
501 - AC_CHECK_LIB(roken, roken_getaddrinfo_hostspec)
502 + AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, des_set_key)
503 + AC_CHECK_LIB_EXT(asn1, KRB5_LIBS, copy_Authenticator)
504 + AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec)
506 # Heimdal checks. On static Heimdal gssapi must be linked before krb5.
507 - AC_CHECK_LIB(gssapi, gss_display_status, [LIBS="$LIBS -lgssapi -lkrb5";
508 - AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
509 + AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status, [KRB5_LIBS="$KRB5_LIBS -lgssapi -lkrb5";
510 + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
512 + ########################################################
513 + # now see if we can find the krb5 libs in standard paths
514 + # or as specified above
515 + AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_mk_req_extended)
517 + ########################################################
518 + # now see if we can find the gssapi libs in standard paths
519 + AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],
520 + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
522 - AC_CHECK_LIB(krb5, krb5_set_real_time,
523 - [AC_DEFINE(HAVE_KRB5_SET_REAL_TIME,1,
524 - [Whether krb5_set_real_time is available])])
525 - AC_CHECK_LIB(krb5, krb5_set_default_in_tkt_etypes,
526 - [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES,1,
527 - [Whether krb5_set_default_in_tkt_etypes, is available])])
528 - AC_CHECK_LIB(krb5, krb5_set_default_tgs_ktypes,
529 - [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_TGS_KTYPES,1,
530 - [Whether krb5_set_default_tgs_ktypes is available])])
532 - AC_CHECK_LIB(krb5, krb5_principal2salt,
533 - [AC_DEFINE(HAVE_KRB5_PRINCIPAL2SALT,1,
534 - [Whether krb5_principal2salt is available])])
535 - AC_CHECK_LIB(krb5, krb5_use_enctype,
536 - [AC_DEFINE(HAVE_KRB5_USE_ENCTYPE,1,
537 - [Whether krb5_use_enctype is available])])
538 - AC_CHECK_LIB(krb5, krb5_string_to_key,
539 - [AC_DEFINE(HAVE_KRB5_STRING_TO_KEY,1,
540 - [Whether krb5_string_to_key is available])])
541 - AC_CHECK_LIB(krb5, krb5_get_pw_salt,
542 - [AC_DEFINE(HAVE_KRB5_GET_PW_SALT,1,
543 - [Whether krb5_get_pw_salt is available])])
544 - AC_CHECK_LIB(krb5, krb5_string_to_key_salt,
545 - [AC_DEFINE(HAVE_KRB5_STRING_TO_KEY_SALT,1,
546 - [Whether krb5_string_to_key_salt is available])])
547 - AC_CHECK_LIB(krb5, krb5_auth_con_setkey,
548 - [AC_DEFINE(HAVE_KRB5_AUTH_CON_SETKEY,1,
549 - [Whether krb5_auth_con_setkey is available])])
550 - AC_CHECK_LIB(krb5, krb5_auth_con_setuseruserkey,
551 - [AC_DEFINE(HAVE_KRB5_AUTH_CON_SETUSERUSERKEY,1,
552 - [Whether krb5_auth_con_setuseruserkey is available])])
553 - AC_CHECK_LIB(krb5, krb5_locate_kdc,
554 - [AC_DEFINE(HAVE_KRB5_LOCATE_KDC,1,
555 - [Whether krb5_locate_kdc is available])])
556 - AC_CHECK_LIB(krb5, krb5_get_permitted_enctypes,
557 - [AC_DEFINE(HAVE_KRB5_GET_PERMITTED_ENCTYPES,1,
558 - [Whether krb5_get_permitted_enctypes is available])])
559 - AC_CHECK_LIB(krb5, krb5_get_default_in_tkt_etypes,
560 - [AC_DEFINE(HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES,1,
561 - [Whether krb5_get_default_in_tkt_etypes is available])])
562 - AC_CHECK_LIB(krb5, krb5_free_ktypes,
563 - [AC_DEFINE(HAVE_KRB5_FREE_KTYPES,1,
564 - [Whether krb5_free_ktypes is available])])
565 + AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
566 + AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS)
567 + AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS)
568 + AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS)
569 + AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS)
570 + AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS)
571 + AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS)
572 + AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS)
573 + AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
574 + AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS)
575 + AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
576 + AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS)
577 + AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS)
578 + AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS)
580 + LIBS="$LIBS $KRB5_LIBS"
582 AC_CACHE_CHECK([for addrtype in krb5_address],
583 samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[
584 AC_TRY_COMPILE([#include <krb5.h>],
585 @@ -2365,87 +2453,21 @@
586 [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available])
589 - ########################################################
590 - # now see if we can find the krb5 libs in standard paths
591 - # or as specified above
592 - AC_CHECK_LIB(krb5, krb5_mk_req_extended, [KRB5_LIBS="$LIBS -lkrb5";
593 - KRB5_CFLAGS="$CFLAGS";
594 - AC_DEFINE(HAVE_KRB5,1,[Whether KRB5 is available])])
596 - ########################################################
597 - # now see if we can find the gssapi libs in standard paths
598 - AC_CHECK_LIB(gssapi_krb5, gss_display_status,
599 - [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5";
600 - AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
602 - CFLAGS="$ac_save_CFLAGS"
603 - LIBS="$ac_save_LIBS"
606 -########################################################
607 -# Compile with LDAP support?
609 -LDAP_OBJ=""
610 -with_ldap_support=yes
611 -AC_MSG_CHECKING([whether to use LDAP])
613 -AC_ARG_WITH(ldap,
614 -[ --with-ldap LDAP support (default yes)],
615 -[ case "$withval" in
616 - no)
617 - with_ldap_support=no
618 - ;;
619 - esac ])
621 -AC_MSG_RESULT($with_ldap_support)
623 -SMBLDAP=""
624 -if test x"$with_ldap_support" = x"yes"; then
625 - ac_save_LIBS="$LIBS"
626 - LIBS=""
628 - ##################################################################
629 - # we might need the lber lib on some systems. To avoid link errors
630 - # this test must be before the libldap test
631 - AC_CHECK_LIB(lber, ber_scanf)
633 - ########################################################
634 - # now see if we can find the ldap libs in standard paths
635 - if test x$have_ldap != xyes; then
636 - AC_CHECK_LIB(ldap, ldap_init, [
637 - LIBS="$LIBS -lldap";
638 - AC_CHECK_LIB(ldap, ldap_domain2hostlist, [
639 - AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
640 - AC_CHECK_HEADERS([ldap.h lber.h],
641 - [default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
642 - SMBLDAP="lib/smbldap.o"])
643 - ])
644 - ])
646 - ########################################################
647 - # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
648 - # Check found in pam_ldap 145.
649 - AC_CHECK_FUNCS(ldap_set_rebind_proc)
650 - AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, pam_ldap_cv_ldap_set_rebind_proc, [
651 - AC_TRY_COMPILE([
652 - #include <lber.h>
653 - #include <ldap.h>], [ldap_set_rebind_proc(0, 0, 0);], [pam_ldap_cv_ldap_set_rebind_proc=3], [pam_ldap_cv_ldap_set_rebind_proc=2]) ])
654 - AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
655 - AC_CHECK_FUNCS(ldap_initialize)
656 - fi
658 - AC_SUBST(SMBLDAP)
659 - LDAP_LIBS="$LIBS";
660 - LIBS="$ac_save_LIBS";
661 -else
662 - # Can't have ADS support without LDAP
663 + if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then
664 + AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
665 + AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
666 + AC_MSG_CHECKING(whether Active Directory and krb5 support is used)
667 + AC_MSG_RESULT(yes)
668 + else
669 if test x"$with_ads_support" = x"yes"; then
670 - AC_MSG_ERROR(Active directory support requires LDAP)
671 + AC_MSG_ERROR(libkrb5 is needed for Active Directory support)
672 + else
673 + AC_MSG_WARN(libkrb5 is needed for Active Directory support)
677 -if test x"$with_ads_support" = x"yes"; then
678 - ADSLIBS="$LDAP_LIBS $KRB5_LIBS"
679 + KRB5_LIBS=""
680 + with_ads_support=no
681 + fi
682 + LIBS="$ac_save_LIBS"
685 ########################################################