Bug 125 - configure fails checking ldap (init, rebind) stuff and not compile ldap modules
configure fails checking ldap (init, rebind) stuff and not compile ldap modules
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.0preX
Other Linux
: P2 normal
: none
Assigned To: Tim Potter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-26 01:32 UTC by Ignacio Coupeau
Modified: 2005-08-24 10:16 UTC (History)
0 users

See Also:


Attachments
configure.in patch (1.83 KB, patch)
2003-06-26 19:27 UTC, Tim Potter
no flags Details
better ldap,krb5 and ads detection (30.59 KB, patch)
2003-06-30 12:48 UTC, Stefan Metzmacher
no flags Details
better krb5 ldap detection (23.91 KB, patch)
2003-06-30 13:00 UTC, Stefan Metzmacher
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio Coupeau 2003-05-26 01:32:24 UTC
I'm compiling samba a24 (and CVS, 8:00 GMT, 05/26) in Debian 3.0 (2.4.18, gcc
version egcs-2.92.11)UltraSparc IIi.  
  ./configure --with-ldapsam
The system has an openldap 2.0.27 compiled, installed and *heavily* tested, also
with the ldd. At last, the only way to generate a configure/Makefile that
includes the ldap support was two fixes to the "configure.in":

diff -u configure.in-DIST configure.in
--- configure.in-DIST   Sat May 24 11:38:07 2003
+++ configure.in        Mon May 26 10:12:31 2003
@@ -2301,13 +2301,13 @@
 AC_MSG_RESULT($with_ldap_support)
 
 if test x"$with_ldap_support" = x"yes"; then
-ac_save_LIBS="$LIBS"
+ac_save_LIBS="$LIBS -lresolv"
 LIBS=""
 
   ##################################################################
   # we might need the lber lib on some systems. To avoid link errors
   # this test must be before the libldap test
-  AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber"])
+  AC_CHECK_LIB(lber, ber_scanf, [LIBS="$LIBS -llber -lresolv"])
 
   ########################################################
   # now see if we can find the ldap libs in standard paths
Comment 1 Tim Potter 2003-06-01 18:15:48 UTC
Can you send some more debugging info on what is happening?  I can't reproduce
this on my debian system here.

From config.log:

configure:22811: checking for ber_scanf in -llber
configure:22844: gcc -o conftest -g -O2  -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE  -I/usr/include  -Wl,-rpath,/usr/lib
conftest.c -llber   >&5configure:22847: $? = 0
configure:22850: test -s conftest
configure:22853: $? = 0
configure:22864: result: yes

I have the following openldap packages installed:

ii  libldap2       2.0.27-4       OpenLDAP libraries (without TLS support).
ii  libldap2-dev   2.0.27-4       OpenLDAP development libraries.
Comment 2 Tim Potter 2003-06-19 23:23:18 UTC
Upon further review of the autoconf code, it looks like -lresolv should be added
to the library list at a very early stage.  There should be a line like:

checking for dn_expand in -lresolv... yes

Do you get this?  I wonder if your libresolv doesn't contain dn_expand???
Comment 3 Tim Potter 2003-06-23 05:43:54 UTC
I've worked out why this isn't working.  It's because in the Kerberos detection
code the LIBS variables is set to "" while the detection is occuring.

I'll try and test up and commit a fix tomorrow.
Comment 4 Tim Potter 2003-06-24 23:46:40 UTC
This should be fixed now but I don't have a system to check it on.
Comment 5 Tim Potter 2003-06-25 00:20:25 UTC
Whoops - my last message was entered in the wrong bug.  I'm still working on a
fix for this.  Sorry.
Comment 6 Tim Potter 2003-06-26 19:27:35 UTC
Created attachment 36 [details]
configure.in patch

Here's a patch which should fix the problem.  It was a similar bug to one
of the Kerberos configure.in problems.

Let me know how it goes!
Comment 7 Stefan Metzmacher 2003-06-30 12:48:42 UTC
Created attachment 39 [details]
better ldap,krb5 and ads detection
Comment 8 Stefan Metzmacher 2003-06-30 12:52:54 UTC
this patch should fix this problem

and adds better ldap,krb5 and ads autodetection...

it also removes ADSLIBS from Makefile.in

we should only use LDAPLIBS and KRB5LIBS this is much easier logic!

It would be good if this would be tested on different platforms 
and old and new heimdal and MIT krb5 implementations.

For me it works, but I don't want to introduce new bugs...


metze 
Comment 9 Stefan Metzmacher 2003-06-30 13:00:18 UTC
Created attachment 40 [details]
better krb5 ldap detection
Comment 10 Stefan Metzmacher 2003-06-30 13:01:02 UTC
here's a new diff

as the last has also other stuff in it :-(

metze
Comment 11 Ignacio Coupeau 2003-07-14 04:12:01 UTC
I tested (2.4.18, gcc egcs-2.92.11)UltraSparc IIi with the CVS (03/07/14, 11:47
GMT) as 
  ./configure --with-quotas --prefix=/usr/local/etc2/samba_3 --with-ldapsam"
-- with openldap-2.0.27 don't make the ldapsam's build "... pdb_ldap... no"
-- with openldap-2.1.22 does: "checking how to build pdb_ldap... static" 

Comment 12 Tim Potter 2003-07-22 20:15:15 UTC
I've checked in Metze's latest patch.  Does this work for you Ignacio?
Comment 13 Ignacio Coupeau 2003-07-24 01:14:48 UTC
With the CVS 8:30 GMT builds the ldapsam stuff ok:
"checking how to build pdb_ldap... static"
libs: libldap*.so.2.0.17 liblber.so.2.0.17

Thanks
Comment 14 Tim Potter 2003-07-24 16:30:40 UTC
Cool - I'm glad this is finally sorted out.
Comment 15 Gerald (Jerry) Carter 2005-02-07 07:57:27 UTC
originally reported against 3.0aph24.  Bugzilla spring cleaning.  
Removing old alpha versions.
Comment 16 Gerald (Jerry) Carter 2005-08-24 10:16:31 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.