I wrote:
> Oh, that's interesting. elver's failure seems to be because it's now
> deciding it doesn't HAVE_LDAP_INITIALIZE. However, on my RHEL8 machine
> the current configure coding is still finding ldap_initialize;
... or not. I must have been seeing what I expected to see yesterday,
because when I check it again now, it isn't finding ldap_initialize.
Close inspection of the Autoconf manual reveals the problem:
AC_CHECK_LIB updates LIBS only as part of its *default* success
action, which the current coding isn't using for libldap_r.
So we arrive at the ldap_initialize test with neither library
in LIBS.
But we really ought to probe libldap not libldap_r for
ldap_initialize, because we use that only on the backend side.
So the right fix is to do that probe before we mess around
with libldap_r, which I've now done.
regards, tom lane