Fix a problem reporting the lber library from apu-N-config.

It wouldn't be reported if you override the default ldap library name
using --with-ldap=FOO.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/trunk@741150 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES b/CHANGES
index 71fc32b..be4fe14 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,7 @@
   *) LDAP detection improvements: --with-ldap now supports library names 
      containing non-alphanumeric characters, such as libldap-2.4.so.  New
      option --with-lber can be used to override the default liblber name.
+     Fix a problem reporting the lber library from apu-N-config.
      [Jeff Trawick]
 
 Changes with APR-util 1.4.0
diff --git a/build/apu-conf.m4 b/build/apu-conf.m4
index cc0cf00..9eb9b60 100644
--- a/build/apu-conf.m4
+++ b/build/apu-conf.m4
@@ -285,7 +285,8 @@
     fi
 
     test ${apu_has_ldap} != "1" && AC_MSG_ERROR(could not find an LDAP library)
-    AC_CHECK_LIB($apu_liblber_name, ber_init)
+    AC_CHECK_LIB($apu_liblber_name, ber_init,
+      [LDADD_ldap="${LDADD_ldap} -l${apu_liblber_name}"])
 
     AC_CHECK_HEADERS(lber.h, lber_h=["#include <lber.h>"])