Robert Bannocks
2006-Dec-08 16:52 UTC
[Samba] A mass O trouble with solaris 10 and Samba+ADS
I have been having a great deal of trouble compiling Samba on Solaris 10 with ADS support. Kerberos compiles fine. Samba does not configure with the standard Solaris LDAP libraries and fails in the following way.: checking for ldap_initialize... no configure: error: Active Directory support requires ldap_initialize And is caused by: configure:35160: checking for ldap_initialize configure:35217: gcc -o conftest -O -D_SAMBA_BUILD_ -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DLDAP_DE PRECATED -lthread conftest.c -lldap -lresolv -lnsl -lsocket >&5 Undefined first referenced symbol in file ldap_initialize /var/tmp//ccGc936o.o ld: fatal: Symbol referencing errors. No output written to conftest collect2: ld returned 1 exit status configure:35223: $? = 1 As documented elsewhere you can use the OpenLDAP libraries: Compiling these requires setting CFLAGS=-D_AVL_H inorder to compile them. I configured OpenLDAP as follows: ./configure -prefix=/usr/local/opt/openldap-2.3.27 -with-shared=no make install Then running samba configuration with these setting: LDFAGS=-L/usr/local/opt/openldap-2.3.27/lib CPPFLAGS=-I/usr/local/opt/openldap-2.3.27/include ./configure --prefix=/usr/local/opt/samba/samba-3.0.23d --with-automount --with-nisplus-home --with-acl-support --with-ads --=/usr/local/opt/krb5/krb5-1.5.1 Gives the following error: checking for ldap_dn2ad_canonical... no configure: error: libldap is needed for LDAP support The problem being seen in config.log Undefined first referenced symbol in file ldap_dn2ad_canonical /var/tmp//ccI8vbBq.o ld: fatal: Symbol referencing errors. No output written to conftest collect2: ld returned 1 exit status configure:35045: $? = 1 configure: failed program was: However configure works if OpenLDAP is compiled with shared libraries! i.e OpenLDAP configured with ./configure -prefix=/usr/local/opt/openldap-2.3.27 -with-shared=yes I have yet to find out why this works with shared libraries but not with static ones (which is what I want). The failure to configure with static libraries seems to be because Openldap's configure picks up the presence of libsasl on Solaris 10 (not present on solaris 9) and uses code found in it. The compile line invoked by Samba's configure does not include -lsasl and hence it fails to compile the program and give the above misleading error. Setting LDFLAGS="-L/usr/local/opt/openldap-2.3.27/lib -lsasl" Makes configure work and samba compiles clean with only the static libraries. Also re-compiling OpenLDAP with ./configure -prefix=/usr/local/opt/openldap-2.3.27 -with-shared=no -with-cyrus-sasl=no Also produces a set of (static) openldap libraries that Samba configure copes with without adding -lsasl to the LDFLAGS. So my questions. 1. Are these known bugs? - i.e. if openldap was compiled with sasl support then the compilation line requires a -lsasl. Is configure going to be fixed? 2. For samba purposes is removing libldap's dependency on sasl going to break or limit the functionality of samba in any way? In my case I am not intending to use the OpenLDAP libraries for anything other than Samba. 3. Will samba ever be "fixed" to compile/configure with native Solaris LDAP libraries. 4. It would be nice to see this documented somewhere, my googleing found little on this topic. Thanks in advance. RB
Gerald (Jerry) Carter
2006-Dec-13 17:22 UTC
[Samba] A mass O trouble with solaris 10 and Samba+ADS
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Robert Bannocks wrote:> So my questions. > > 1. Are these known bugs? - i.e. if openldap was compiled > with sasl support then the compilation line requires a -lsasl. > Is configure going to be fixed?Your linker should be pulling in any indirect dependencies. Use Gnu ld and not Sun's ld (IMO).> > 2. For samba purposes is removing libldap's dependency on > sasl going to break or limit the functionality of samba > in any way?Currently no.> 3. Will samba ever be "fixed" to compile/configure with > native Solaris LDAP libraries.Probably not unless someone else submits a patch and works around the things we need from the ldap libs.> 4. It would be nice to see this documented somewhere, > my googleing found little on this topic.Please add this to wiki.samba.org. We should create a "Building" page for various OS lavors. cheers, jerry ====================================================================Samba ------- samba.org Centeris ----------- centeris.com "What man is a man who does not make the world better?" --Balian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - enigmail.mozdev.org iD8DBQFFgDaWIR7qMdg1EfYRAuXJAKCi40KRmkTymHfkMJp2lL5MXdsQ4ACcDTaN f9YR+/jSRaVn1ErhvrGaILI=VK21 -----END PGP SIGNATURE-----