patch to compile with OpenLDAP 2.0.7

Jeffrey C. Ollie jeff at ollie.clive.ia.us
Thu Nov 16 22:56:10 CET 2000


I've gotten today's CVS version to compile against OpenLDAP 2.0.7.  It
seems that the OpenLDAP people dropped a number of macros between v1
and v2.  A fairly simple patch that #ifdefs the dropped macros and
everything compiles fine.  Oh yeah, I did have to use "LIBS=-lresolv
./configure" to get the configure script to properly: apparently the
RedHat RPM for OpenLDAP introduces a depencency because the configure
script fails with an undefined reference to __dn_expand and
__res_query.

I've attached the patch and also entered a bug on sourceforge.

Jeff

-------------- next part --------------
--- python-ldap/Modules/constants.c	Sun Aug 13 10:00:59 2000
+++ python-ldap-20001116/Modules/constants.c	Thu Nov 16 15:15:24 2000
@@ -66,7 +66,9 @@
 	add_int(d,VERSION1);
 	add_int(d,VERSION2);
 	add_int(d,VERSION);
+#ifdef LDAP_MAX_ATTR_LEN
 	add_int(d,MAX_ATTR_LEN);
+#endif
 	add_int(d,TAG_MESSAGE);
 	add_int(d,TAG_MSGID);
 
@@ -79,9 +81,15 @@
 	add_int(d,REQ_MODRDN);
 	add_int(d,REQ_COMPARE);
 	add_int(d,REQ_ABANDON);
+#ifdef LDAP_REQ_UNBIND_30
 	add_int(d,REQ_UNBIND_30);
+#endif
+#ifdef LDAP_REQ_DELETE_30
 	add_int(d,REQ_DELETE_30);
+#endif
+#ifdef LDAP_REQ_ABANDON_30
 	add_int(d,REQ_ABANDON_30);
+#endif
 
 	/* reversibles */
 
@@ -106,9 +114,15 @@
 	add_int(d,AUTH_KRBV4);
 	add_int(d,AUTH_KRBV41);
 	add_int(d,AUTH_KRBV42);
+#ifdef LDAP_AUTH_SIMPLE_30
 	add_int(d,AUTH_SIMPLE_30);
+#endif
+#ifdef LDAP_AUTH_KRBV41_30
 	add_int(d,AUTH_KRBV41_30);
+#endif
+#ifdef LDAP_AUTH_KRBV42_30
 	add_int(d,AUTH_KRBV42_30);
+#endif
 	add_int(d,FILTER_AND);
 	add_int(d,FILTER_OR);
 	add_int(d,FILTER_NOT);
@@ -118,13 +132,21 @@
 	add_int(d,FILTER_LE);
 	add_int(d,FILTER_PRESENT);
 	add_int(d,FILTER_APPROX);
+#ifdef LDAP_FILTER_PRESENT_30
 	add_int(d,FILTER_PRESENT_30);
+#endif
 	add_int(d,SUBSTRING_INITIAL);
 	add_int(d,SUBSTRING_ANY);
 	add_int(d,SUBSTRING_FINAL);
+#ifdef LDAP_SUBSTRING_INITIAL_30
 	add_int(d,SUBSTRING_INITIAL_30);
+#endif
+#ifdef LDAP_SUBSTRING_ANY_30
 	add_int(d,SUBSTRING_ANY_30);
+#endif
+#ifdef LDAP_SUBSTRING_FINAL_30
 	add_int(d,SUBSTRING_FINAL_30);
+#endif
 	add_int(d,SCOPE_BASE);
 	add_int(d,SCOPE_ONELEVEL);
 	add_int(d,SCOPE_SUBTREE);
@@ -135,7 +157,9 @@
 
 	/* (errors.c contains the error constants) */
 
+#ifdef LDAP_DEFAULT_REFHOPLIMIT
 	add_int(d,DEFAULT_REFHOPLIMIT);
+#endif
 #ifdef LDAP_CACHE_BUCKETS
 	add_int(d,CACHE_BUCKETS);
 #endif
@@ -161,8 +185,12 @@
 
 	/* XXX - these belong in errors.c */
 
+#ifdef LDAP_URL_ERR_NOTLDAP
 	add_int(d,URL_ERR_NOTLDAP);
+#endif
+#ifdef LDAP_URL_ERR_NODN
 	add_int(d,URL_ERR_NODN);
+#endif
 	add_int(d,URL_ERR_BADSCOPE);
 	add_int(d,URL_ERR_MEM);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20001116/7061de9c/attachment.pgp>


More information about the python-ldap mailing list