components/samba/samba/patches/ldap-libs.patch
changeset 4371 29fdb14099eb
equal deleted inserted replaced
4370:7043c27399f1 4371:29fdb14099eb
       
     1 Source: Home brewed
       
     2 Fixes: OpenLDAP C-SDK library has other name than libldap.so hardwired in wscript's
       
     3 
       
     4 --- a/source3/wscript	2013-12-05 01:16:48.000000000 -0800
       
     5 +++ b/source3/wscript	2014-05-21 06:47:12.420295640 -0700
       
     6 @@ -61,6 +65,15 @@
       
     7  
       
     8      opt.SAMBA3_ADD_OPTION('glusterfs', with_name="enable", without_name="disable", default=True)
       
     9  
       
    10 +    opt.add_option('--with-libldap',
       
    11 +                   help=("Name of the libldap for -l<libname> format."),
       
    12 +                   action="store", dest='libldap_name', default='ldap')
       
    13 +
       
    14 +    # mozldap has lber-calls part of the libldap so it should be also set on ldap60 to avoid link of lber from OpenLDAP
       
    15 +    opt.add_option('--with-liblber',
       
    16 +                   help=("Name of the liblber for -l<libname> format."),
       
    17 +                   action="store", dest='liblber_name', default='lber')
       
    18 +
       
    19  
       
    20  def configure(conf):
       
    21      from samba_utils import TO_LIST
       
    22 @@ -618,7 +631,7 @@
       
    23      if Options.options.with_ldap:
       
    24          conf.CHECK_HEADERS('ldap.h lber.h ldap_pvt.h')
       
    25          conf.CHECK_TYPE('ber_tag_t', 'unsigned int', headers='ldap.h lber.h')
       
    26 -        conf.CHECK_FUNCS_IN('ber_scanf ber_sockbuf_add_io', 'lber')
       
    27 +        conf.CHECK_FUNCS_IN('ber_scanf ber_sockbuf_add_io', Options.options.liblber_name )
       
    28          conf.CHECK_VARIABLE('LDAP_OPT_SOCKBUF', headers='ldap.h')
       
    29  
       
    30          # if we LBER_OPT_LOG_PRINT_FN we can intercept ldap logging and print it out
       
    31 @@ -626,8 +639,8 @@
       
    32          conf.CHECK_VARIABLE('LBER_OPT_LOG_PRINT_FN',
       
    33                              define='HAVE_LBER_LOG_PRINT_FN', headers='lber.h')
       
    34  
       
    35 -        conf.CHECK_FUNCS_IN('ldap_init ldap_init_fd ldap_initialize ldap_set_rebind_proc', 'ldap')
       
    36 -        conf.CHECK_FUNCS_IN('ldap_add_result_entry', 'ldap')
       
    37 +        conf.CHECK_FUNCS_IN('ldap_init ldap_init_fd ldap_initialize ldap_set_rebind_proc', Options.options.libldap_name )
       
    38 +        conf.CHECK_FUNCS_IN('ldap_add_result_entry', Options.options.libldap_name )
       
    39  
       
    40          # Check if ldap_set_rebind_proc() takes three arguments
       
    41          if conf.CHECK_CODE('ldap_set_rebind_proc(0, 0, 0)',
       
    42 @@ -648,6 +661,25 @@
       
    43              if conf.CONFIG_SET('HAVE_BER_SOCKBUF_ADD_IO') and \
       
    44                      conf.CONFIG_SET('HAVE_LDAP_OPT_SOCKBUF'):
       
    45                  conf.DEFINE('HAVE_LDAP_SASL_WRAPPING', '1')
       
    46 +        # fix the conf.TARGET_TYPE and conf.LIB_... items
       
    47 +        if 'ldap' != Options.options.libldap_name:
       
    48 +            conf.SET_TARGET_TYPE('ldap', 'SYSLIB')
       
    49 +            #conf.SET_TARGET_TYPE(Options.options.libldap_name, 'EMPTY')
       
    50 +            conf.define('HAVE_LIBLDAP', 1)
       
    51 +            conf.undefine('HAVE_LIB%s' % Options.options.libldap_name.upper().replace('-','_'))
       
    52 +            conf.define('LIB_LDAP', Options.options.libldap_name)
       
    53 +            conf.undefine('LIB_%s' % Options.options.libldap_name.upper().replace('-','_'))
       
    54 +            #conf.define('LIB_ldap', [ Options.options.libldap_name ] )
       
    55 +            #conf.undefine('LIB_%s' % Options.options.libldap_name.replace('-','_'))
       
    56 +        if 'lber' != Options.options.liblber_name:
       
    57 +            conf.SET_TARGET_TYPE('lber', 'SYSLIB')
       
    58 +            #conf.SET_TARGET_TYPE(Options.options.liblber_name, 'EMPTY')
       
    59 +            conf.define('HAVE_LIBLBER', 1)
       
    60 +            conf.undefine('HAVE_LIB%s' % Options.options.liblber_name.upper().replace('-','_'))
       
    61 +            conf.define('LIB_LBER', Options.options.liblber_name)
       
    62 +            conf.undefine('LIB_%s' % Options.options.liblber_name.upper().replace('-','_'))
       
    63 +            #conf.define('LIB_lber', [ Options.options.liblber_name ] )
       
    64 +            #conf.undefine('LIB_%s' % Options.options.liblber_name.replace('-','_'))
       
    65      else:
       
    66          conf.SET_TARGET_TYPE('ldap', 'EMPTY')
       
    67          conf.SET_TARGET_TYPE('lber', 'EMPTY')