Bug 12124 - LDAP API for build should be addressable.
LDAP API for build should be addressable.
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
unspecified
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-07 21:30 UTC by Jura Sasek
Modified: 2016-08-09 15:33 UTC (History)
1 user (show)

See Also:


Attachments
Patch adding the check for .pc (2.26 KB, patch)
2016-08-07 21:30 UTC, Jura Sasek
no flags Details
Search appropriate LDAP API also for "ldb" (557 bytes, patch)
2016-08-07 21:33 UTC, Jura Sasek
no flags Details
...adds deps for build (to find the correct headers) (477 bytes, patch)
2016-08-07 21:35 UTC, Jura Sasek
no flags Details
...adds deps for build (to find the correct headers) (360 bytes, patch)
2016-08-07 21:36 UTC, Jura Sasek
no flags Details
...adds deps for build (to find the correct headers) (1.97 KB, patch)
2016-08-07 21:37 UTC, Jura Sasek
no flags Details
...adds deps for build (to find the correct headers) (995 bytes, patch)
2016-08-07 21:37 UTC, Jura Sasek
no flags Details
small fix of CHECK_STRUCTURE_MEMBER which breaks passing of the "lib=..." parameter. (793 bytes, patch)
2016-08-07 21:39 UTC, Jura Sasek
no flags Details
Git diff agains the *master* (7.91 KB, patch)
2016-08-08 09:24 UTC, Jura Sasek
no flags Details
git format-patch master --stdout ...commented (9.64 KB, patch)
2016-08-08 13:18 UTC, Jura Sasek
no flags Details
previous patch with "--amend"-ed comment (9.66 KB, patch)
2016-08-09 15:33 UTC, Jura Sasek
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jura Sasek 2016-08-07 21:30:49 UTC
Created attachment 12316 [details]
Patch adding the check for .pc

Samba build expects "hardwired" names of ldap libs (ldap.so, lber.so) and also the ldap.h header can not be located on customized path. Even worse is on Solaris 11 which delivers 2 ldap APIS:

 - "legacy" DS 5 C-SDK represented by:
   /usr/include/ldap.h
   /usr/lib/libldap.so -> libldap.so.5

 - new OpenLDAP C-SDK represented by:
   /usr/include/openldap/ldap.h  ...lber.h ...
   /usr/lib/libldap_r.so -> libldap_r.so.${cur.ver.}

...so the default one found by waf is the "wrong one"

Here I propose the wide acceptable (not only for Solaris) patches based on pkg-config (site specific) files.

For Solaris 11 the .pc files can looks like:

 $ cat Solaris/ldap.pc
Name: ldap
Description: DS C-SDK
Version: 2.8
Requires: openldap
 $ cat Solaris/lber.pc
Name: lber
Description: DS C-SDK BER routines
Version: 2.8
Requires: openldap
 $ cat Solaris/openldap.pc
prefix=/usr
includedir=${prefix}/include/openldap

Name: openldap
Description: OpenLDAP C-SDK
URL: http://www.openldap.org/
Version: 2.10.7
Libs: -lldap_r -llber
Cflags: -I${includedir}

...please evaluate the following patches for upstream.

Thank you in advance,
Jiri
Comment 1 Jura Sasek 2016-08-07 21:33:30 UTC
Created attachment 12317 [details]
Search appropriate LDAP API also for "ldb"
Comment 2 Jura Sasek 2016-08-07 21:35:29 UTC
Created attachment 12318 [details]
...adds deps for build (to find the correct headers)
Comment 3 Jura Sasek 2016-08-07 21:36:10 UTC
Created attachment 12319 [details]
...adds deps for build (to find the correct headers)
Comment 4 Jura Sasek 2016-08-07 21:37:10 UTC
Created attachment 12320 [details]
...adds deps for build (to find the correct headers)
Comment 5 Jura Sasek 2016-08-07 21:37:37 UTC
Created attachment 12321 [details]
...adds deps for build (to find the correct headers)
Comment 6 Jura Sasek 2016-08-07 21:39:02 UTC
Created attachment 12322 [details]
small fix of CHECK_STRUCTURE_MEMBER which breaks passing of the "lib=..." parameter.
Comment 7 Jura Sasek 2016-08-08 09:24:35 UTC
Created attachment 12324 [details]
Git diff agains the *master*

Add a ldap and lber as the system libraries.
Comment 8 Volker Lendecke 2016-08-08 10:37:45 UTC
ssuming you have git installed -- would you mind sending in the patches as "git format-patch --stdout" patches with your authorship and some commit message explaining the checkin? This would make review much more pleasant.
Comment 9 Jura Sasek 2016-08-08 13:18:00 UTC
Created attachment 12325 [details]
git format-patch master --stdout   ...commented

Thank you for your attention Volker.
I have modified patch a bit because I hit the problem on platform where standard (libldap.so and liblber.so) libs were residing in standard path (using no .pc files). Now it should be OK.
Auth. comment was added into the patch.
Comment 10 Jura Sasek 2016-08-09 15:33:49 UTC
Created attachment 12348 [details]
previous patch with "--amend"-ed comment

I have added a comment to act as a commit comment.
Patch contents remains the same.
I apologize for inconvenience with updating a patches but I am not familiar with git.