Skip Menu |

This queue is for tickets about the perldap CPAN distribution.

Report information
The Basics
Id: 73686
Status: new
Priority: 0/
Queue: perldap

People
Owner: Nobody in particular
Requestors: d.thomas [...] its.uq.edu.au
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: SDK paths for RHEL5, ignore OpenLDAP libraries, build under perl 5.14.2 [patch]
I use an automated process to install hundreds of module tarballs and it's necessary for each tarball to PASS its tests. Maybe should have supplied separate patches. First problem is that you're supposed to provide a path to the SDK installation for Makefile.PL to find the include and library paths. However the RHEL5 RPM doesn't put these in one place (/usr/lib64 & /usr/include/mozldap. Makefile.PL was changed to explicitly set these against $include_ldap and $lib_ldap variables. One step forward, but make then failed with errors like: API.c: In function ‘avref2charptrptr’: API.c:205: error: ‘na’ undeclared (first use in this function) Eventually found http://osdir.com/ml/mozilla.devel.directory/2003-11/msg00004.html so that make worked after defining '-DPERL_POLLUTE'. [DMT 23-Apr-2011] downloaded 1.4.1 (2000-09-19) version from the Mercurial repo mentioned on https://wiki.mozilla.org/LDAP_C_SDK. This includes fixes for some things done in perldap-1.4.tar.gz.diff. More importantly, I've modified Makefile.PL to explicitly use the libraries installed by the mozldap rpm # repoquery --list mozldap /usr/lib64/libldap60.so /usr/lib64/libldif60.so /usr/lib64/libprldap60.so /usr/lib64/libssldap60.so /usr/share/doc/mozldap-6.0.5 /usr/share/doc/mozldap-6.0.5/README.rpm Without doing this on a system with OpenLDAP libraries, the API.so library fails Error loading Mozilla::LDAP::API: perldap_init failed I didn't run into this problem initially because distro-5.10.1-20100503 was built on ldaptest. Later builds were on kolanut which does have the OpenLDAP libraries, though Mozilla::LDAP failed: symbol lookup error: .../lib/site_perl/5.10.1/x86_64-linux/auto/Mozilla/LDAP/API/API.so: undefined symbol: ldap_set_option because the perl was built in a different location (even if built in the final location which was a symlink). NB the Mozilla::LDAP tests are dummy ones, probably because real tests would need access to an ldap server. perl 5.14 no longer supports "#define PERL_POLLUTE" but offers the alternative perl Makefile.PL POLLUTE=1 Instead the patch restores the needed symbols. Another approach might have been http://search.cpan.org/~mhx/Devel-PPPort-3.20/PPPort_pm.PL FYI The PL_ "namespace" for C symbols was introduced in perl 5.005 http://search.cpan.org/~flora/perl-5.14.2/pod/perl5005delta.pod#C_Source_Compatibility "All Perl global variables that are visible for use by extensions now have a PL_ prefix. New extensions should not refer to perl globals by their unqualified names." NB perl_destruct_level was needed for DBD::Ingres but not perldap-1.41 diff -u perldap-1.41.orig/API.xs perldap-1.41/API.xs --- perldap-1.41.orig/API.xs 2011-04-23 11:39:49.000000000 +1000 +++ perldap-1.41/API.xs 2011-11-29 06:20:38.000000000 +1000 @@ -55,6 +55,16 @@ } #endif +/* [DMT 29-Nov-2011] needed for perl 5.14 */ +#ifndef sv_yes +#define sv_yes PL_sv_yes +#define sv_no PL_sv_yes +#define sv_undef PL_sv_undef +#define dirty PL_dirty +#define stack_base PL_stack_base +#define na PL_na +#endif + /* LDAP C SDK Include Files */ #include <lber.h> #include <ldap.h> diff -u perldap-1.41.orig/Makefile.PL perldap-1.41/Makefile.PL --- perldap-1.41.orig/Makefile.PL 2011-04-23 11:39:49.000000000 +1000 +++ perldap-1.41/Makefile.PL 2011-11-29 06:16:02.000000000 +1000 @@ -78,8 +78,8 @@ $dir_sep = "/"; } -$include_ldap = $ldapsdk_loc . $dir_sep . "include"; -$lib_ldap = $ldapsdk_loc . $dir_sep . "lib"; +$include_ldap = '/usr/include/mozldap'; # $ldapsdk_loc . $dir_sep . "include"; +$lib_ldap = '/usr/lib64'; # $ldapsdk_loc . $dir_sep . "lib"; print "Using LDAPv3 Developer Kit (default: yes)? "; if (!$ldapsdk_ver) @@ -131,6 +131,7 @@ $lline_ldap =~ s/^lib//; $lline_ldap =~ s/\.($libexts)$//; $lline = "-L$lib_ldap -l$lline_ldap"; +$lline = "-L/usr/lib64 -lldap60 -lldif60 -lprldap60 -lssldap60"; if ($#lberlib >= 0 && $lline =~ /ldap$/) {