components/samba/samba/patches/mozldap.patch
changeset 628 c3c0c8f3f696
child 1396 2c75b46fc80a
equal deleted inserted replaced
627:5b7574ad99b9 628:c3c0c8f3f696
       
     1 --- a/source3/configure.in	2011-12-12 10:59:00.851079500 -0800
       
     2 +++ b/source3/configure.in	2011-12-12 11:29:54.993566333 -0800
       
     3 @@ -3368,6 +3368,20 @@
       
     4      with_ldap_support=yes
       
     5      AC_MSG_CHECKING(whether LDAP support is used)
       
     6      AC_MSG_RESULT(yes)
       
     7 +
       
     8 +    ##############################
       
     9 +    # Check if LDAP SDK is Mozilla
       
    10 +    AC_CACHE_CHECK([for LDAP_OPT_SIZELIMIT macro],samba_cv_HAVE_LDAP_MOZ,[
       
    11 +    AC_TRY_COMPILE([
       
    12 +#include <stdio.h>
       
    13 +#include <ldap.h>],
       
    14 +    [printf("%s\n", LDAP_OPT_SIZELIMIT);],
       
    15 +    samba_cv_HAVE_LDAP_MOZ=yes,samba_cv_HAVE_LDAP_MOZ=no)])
       
    16 +    if test x"$samba_cv_HAVE_LDAP_MOZ" = x"yes"; then
       
    17 +	AC_DEFINE(HAVE_HAVE_LDAP_MOZ,1,
       
    18 +		[Whether the LDAP SDK is Mozilla])
       
    19 +    fi
       
    20 +
       
    21    else
       
    22      if test x"$with_ldap_support" = x"yes"; then
       
    23  	AC_MSG_ERROR(libldap is needed for LDAP support)
       
    24 @@ -3415,8 +3429,21 @@
       
    25      # Check to see whether there is enough LDAP functionality to be able
       
    26      # to build AD support.
       
    27  
       
    28 -# HPUX only has ldap_init; ok, we take care of this in smbldap.c
       
    29 -case "$host_os" in
       
    30 + if test x"$samba_cv_HAVE_LDAP_MOZ" = x"yes"; then
       
    31 +  # Mozilla LDAP C-SDK has only has ldap_open/ldap_init; ok, we take care of this in smbldap.c
       
    32 +  AC_CHECK_FUNC_EXT(ldap_open,$LDAP_LIBS)
       
    33 +
       
    34 +  if test x"$ac_cv_func_ext_ldap_open" != x"yes"; then
       
    35 +    if test x"$with_ads_support" = x"yes"; then
       
    36 +      AC_MSG_ERROR(Active Directory support with Mozldap C-SDK requires ldap_open)
       
    37 +    elif test x"$with_ads_support" = x"auto"; then
       
    38 +      AC_MSG_WARN(Disabling Active Directory support (requires ldap_open with Mozldap C-SDK))
       
    39 +      with_ads_support=no
       
    40 +    fi
       
    41 +  fi
       
    42 + else
       
    43 +  # HPUX only has ldap_init; ok, we take care of this in smbldap.c
       
    44 +  case "$host_os" in
       
    45  	*hpux*)
       
    46      AC_CHECK_FUNC_EXT(ldap_init,$LDAP_LIBS)
       
    47  
       
    48 @@ -3441,7 +3468,8 @@
       
    49  	fi
       
    50      fi
       
    51      ;;
       
    52 -esac
       
    53 +  esac
       
    54 + fi
       
    55  
       
    56  
       
    57      AC_CHECK_FUNC_EXT(ldap_add_result_entry,$LDAP_LIBS)