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
5 PASSDBLIBS=@PASSDBLIBS@
6 IDMAP_LIBS=@IDMAP_LIBS@
13 bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy
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
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
27 bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
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
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
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
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
52 bin/smbpasswd@EXEEXT@: $(SMBPASSWD_OBJ) bin/.dummy
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
61 bin/smbw_sample@EXEEXT@: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy
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
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 $@
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
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
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"
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
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)])
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
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)])
158 +LIBS=$ac_check_lib_ext_save_LIBS
160 +AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
162 + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
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
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],
200 +AS_VAR_POPDEF([ac_var])dnl
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])
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 @@
225 AC_SUBST(SHLIB_PROGS)
227 AC_SUBST(EXTRA_BIN_PROGS)
228 @@ -2105,14 +2103,107 @@
232 +########################################################
233 +# Compile with LDAP support?
235 +with_ldap_support=auto
236 +AC_MSG_CHECKING([for LDAP support])
239 +[ --with-ldap LDAP support (default yes)],
240 +[ case "$withval" in
242 + with_ldap_support=$withval
246 +AC_MSG_RESULT($with_ldap_support)
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)
263 + AC_MSG_WARN(ldap.h is needed for LDAP support)
266 + with_ldap_support=no
270 +if test x"$with_ldap_support" != x"no"; then
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, [
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]
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)
312 + if test x"$with_ldap_support" = x"yes"; then
313 + AC_MSG_ERROR(libldap is needed for LDAP support)
315 + AC_MSG_WARN(libldap is needed for LDAP support)
319 + with_ldap_support=no
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])
333 -[ --with-ads Active Directory support (default yes)],
334 +[ --with-ads Active Directory support (default auto)],
337 with_ads_support="$withval"
338 @@ -2124,22 +2215,28 @@
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)
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
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@//`"
373 @@ -2154,18 +2251,23 @@
374 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
378 + AC_MSG_RESULT(no krb5-path given)
381 + AC_MSG_RESULT(/usr)
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)
393 + KRB5_CFLAGS="-I$withval/include"
394 + KRB5_CPPFLAGS="-I$withval/include"
395 + KRB5_LDFLAGS="-L$withval/lib"
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"
413 + KRB5_CFLAGS="-I/usr/include/heimdal"
414 + KRB5_CPPFLAGS="-I/usr/include/heimdal"
415 + KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
418 - LIBS="$LIBS -lkrb5"
419 - CFLAGS="$CFLAGS -I/usr/include/heimdal"
420 - CPPFLAGS="$CPPFLAGS -I/usr/include/heimdal"
422 + KRB5_CFLAGS="-I/usr/include/heimdal"
423 + KRB5_CPPFLAGS="-I/usr/include/heimdal"
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"
436 + KRB5_LDFLAGS="-L/usr/kerberos/lib"
437 + KRB5_CFLAGS="-I/usr/kerberos/include"
438 + KRB5_CPPFLAGS="-I/usr/kerberos/include"
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
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"
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
487 # now check for gssapi headers. This is also done here to allow for
488 # different kerberos include paths
489 @@ -2250,64 +2365,46 @@
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)
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_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status, [KRB5_LIBS="$KRB5_LIBS -lgssapi -lkrb5";
509 AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
511 - AC_CHECK_LIB(krb5, krb5_set_real_time,
512 - [AC_DEFINE(HAVE_KRB5_SET_REAL_TIME,1,
513 - [Whether krb5_set_real_time is available])])
514 - AC_CHECK_LIB(krb5, krb5_set_default_in_tkt_etypes,
515 - [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES,1,
516 - [Whether krb5_set_default_in_tkt_etypes, is available])])
517 - AC_CHECK_LIB(krb5, krb5_set_default_tgs_ktypes,
518 - [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_TGS_KTYPES,1,
519 - [Whether krb5_set_default_tgs_ktypes is available])])
521 - AC_CHECK_LIB(krb5, krb5_principal2salt,
522 - [AC_DEFINE(HAVE_KRB5_PRINCIPAL2SALT,1,
523 - [Whether krb5_principal2salt is available])])
524 - AC_CHECK_LIB(krb5, krb5_use_enctype,
525 - [AC_DEFINE(HAVE_KRB5_USE_ENCTYPE,1,
526 - [Whether krb5_use_enctype is available])])
527 - AC_CHECK_LIB(krb5, krb5_string_to_key,
528 - [AC_DEFINE(HAVE_KRB5_STRING_TO_KEY,1,
529 - [Whether krb5_string_to_key is available])])
530 - AC_CHECK_LIB(krb5, krb5_get_pw_salt,
531 - [AC_DEFINE(HAVE_KRB5_GET_PW_SALT,1,
532 - [Whether krb5_get_pw_salt is available])])
533 - AC_CHECK_LIB(krb5, krb5_string_to_key_salt,
534 - [AC_DEFINE(HAVE_KRB5_STRING_TO_KEY_SALT,1,
535 - [Whether krb5_string_to_key_salt is available])])
536 - AC_CHECK_LIB(krb5, krb5_auth_con_setkey,
537 - [AC_DEFINE(HAVE_KRB5_AUTH_CON_SETKEY,1,
538 - [Whether krb5_auth_con_setkey is available])])
539 - AC_CHECK_LIB(krb5, krb5_auth_con_setuseruserkey,
540 - [AC_DEFINE(HAVE_KRB5_AUTH_CON_SETUSERUSERKEY,1,
541 - [Whether krb5_auth_con_setuseruserkey is available])])
542 - AC_CHECK_LIB(krb5, krb5_locate_kdc,
543 - [AC_DEFINE(HAVE_KRB5_LOCATE_KDC,1,
544 - [Whether krb5_locate_kdc is available])])
545 - AC_CHECK_LIB(krb5, krb5_get_permitted_enctypes,
546 - [AC_DEFINE(HAVE_KRB5_GET_PERMITTED_ENCTYPES,1,
547 - [Whether krb5_get_permitted_enctypes is available])])
548 - AC_CHECK_LIB(krb5, krb5_get_default_in_tkt_etypes,
549 - [AC_DEFINE(HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES,1,
550 - [Whether krb5_get_default_in_tkt_etypes is available])])
551 - AC_CHECK_LIB(krb5, krb5_free_ktypes,
552 - [AC_DEFINE(HAVE_KRB5_FREE_KTYPES,1,
553 - [Whether krb5_free_ktypes is available])])
554 - AC_CHECK_LIB(krb5, krb5_principal_get_comp_string,
555 - [AC_DEFINE(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING,1,
556 - [Whether krb5_principal_get_comp_string is available])])
557 + ########################################################
558 + # now see if we can find the krb5 libs in standard paths
559 + # or as specified above
560 + AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_mk_req_extended)
562 + ########################################################
563 + # now see if we can find the gssapi libs in standard paths
564 + AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],
565 + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
567 + AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
568 + AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS)
569 + AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS)
570 + AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS)
571 + AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS)
572 + AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS)
573 + AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS)
574 + AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS)
575 + AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
576 + AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS)
577 + AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
578 + AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS)
579 + AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS)
580 + AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS)
581 + AC_CHECK_FUNC_EXT(krb5_principal_get_comp_string, $KRB5_LIBS)
583 + LIBS="$LIBS $KRB5_LIBS"
585 AC_CACHE_CHECK([for the krb5_princ_component macro],
586 samba_cv_HAVE_KRB5_PRINC_COMPONENT,[
587 AC_TRY_LINK([#include <krb5.h>],
588 @@ -2380,87 +2468,21 @@
589 [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available])
592 - ########################################################
593 - # now see if we can find the krb5 libs in standard paths
594 - # or as specified above
595 - AC_CHECK_LIB(krb5, krb5_mk_req_extended, [KRB5_LIBS="$LIBS -lkrb5";
596 - KRB5_CFLAGS="$CFLAGS";
597 - AC_DEFINE(HAVE_KRB5,1,[Whether KRB5 is available])])
599 - ########################################################
600 - # now see if we can find the gssapi libs in standard paths
601 - AC_CHECK_LIB(gssapi_krb5, gss_display_status,
602 - [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5";
603 - AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
605 - CFLAGS="$ac_save_CFLAGS"
606 - LIBS="$ac_save_LIBS"
609 -########################################################
610 -# Compile with LDAP support?
613 -with_ldap_support=yes
614 -AC_MSG_CHECKING([whether to use LDAP])
617 -[ --with-ldap LDAP support (default yes)],
618 -[ case "$withval" in
620 - with_ldap_support=no
624 -AC_MSG_RESULT($with_ldap_support)
627 -if test x"$with_ldap_support" = x"yes"; then
628 - ac_save_LIBS="$LIBS"
631 - ##################################################################
632 - # we might need the lber lib on some systems. To avoid link errors
633 - # this test must be before the libldap test
634 - AC_CHECK_LIB(lber, ber_scanf)
636 - ########################################################
637 - # now see if we can find the ldap libs in standard paths
638 - if test x$have_ldap != xyes; then
639 - AC_CHECK_LIB(ldap, ldap_init, [
640 - LIBS="$LIBS -lldap";
641 - AC_CHECK_LIB(ldap, ldap_domain2hostlist, [
642 - AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
643 - AC_CHECK_HEADERS([ldap.h lber.h],
644 - [default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
645 - SMBLDAP="lib/smbldap.o"])
649 - ########################################################
650 - # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
651 - # Check found in pam_ldap 145.
652 - AC_CHECK_FUNCS(ldap_set_rebind_proc)
653 - AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, pam_ldap_cv_ldap_set_rebind_proc, [
656 - #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]) ])
657 - AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
658 - AC_CHECK_FUNCS(ldap_initialize)
663 - LIBS="$ac_save_LIBS";
665 - # Can't have ADS support without LDAP
666 + if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then
667 + AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
668 + AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
669 + AC_MSG_CHECKING(whether Active Directory and krb5 support is used)
672 if test x"$with_ads_support" = x"yes"; then
673 - AC_MSG_ERROR(Active directory support requires LDAP)
674 + AC_MSG_ERROR(libkrb5 is needed for Active Directory support)
676 + AC_MSG_WARN(libkrb5 is needed for Active Directory support)
680 -if test x"$with_ads_support" = x"yes"; then
681 - ADSLIBS="$LDAP_LIBS $KRB5_LIBS"
683 + with_ads_support=no
685 + LIBS="$ac_save_LIBS"
688 ########################################################