--- Modules/ldapmodule.c.orig	Tue Jul  2 20:00:00 2002
+++ Modules/ldapmodule.c	Tue Sep 23 06:44:49 2003
@@ -13,6 +13,8 @@
 
 #include "LDAPObject.h"
 
+#include <dlfcn.h>
+
 DL_EXPORT(void) init_ldap(void);
 
 /* dummy module methods */
@@ -27,6 +29,11 @@
 init_ldap()
 {
 	PyObject *m, *d;
+
+	/* Force loading of LDAP and LBER libraries */
+
+	dlopen("liblber.so", DL_LAZY);
+	dlopen("libldap_r.so", DL_LAZY);
 
 #if defined(WIN32) || defined(__CYGWIN__)
 	/* See http://www.python.org/doc/FAQ.html#3.24 */
