Starting with OpenLDAP 2.5 and later, there is no longer a libldap_r library, there is only libldap. setup.py, setup.cfg, Modules/constants_generated.h, and Lib/ldap/constants.py all need updating to account for this. Perhaps a flag in setup.cfg for 2.4 and prior vs 2.5 and later library usage.