Ian Kent 5a1604
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent 5a1604
index 5a85a8e..e393f33 100644
Ian Kent 5a1604
--- a/CHANGELOG
Ian Kent 5a1604
+++ b/CHANGELOG
Ian Kent 5a1604
@@ -4,6 +4,7 @@
Ian Kent 5a1604
 - catch "-xfn" map type and issue "no supported" message.
Ian Kent 5a1604
 - correction for handling of LDAP base dns with spaces.
Ian Kent 5a1604
 - avoid using UDP for probing NFSv4 mount requests.
Ian Kent 5a1604
+- use libldap instead of libldap_r (Guillaume Rousse).
Ian Kent 5a1604
  
Ian Kent 5a1604
 14/01/2008 autofs-5.0.3
Ian Kent 5a1604
 -----------------------
Ian Kent 5a1604
diff --git a/aclocal.m4 b/aclocal.m4
Ian Kent 5a1604
index f24e076..a1105ae 100644
Ian Kent 5a1604
--- a/aclocal.m4
Ian Kent 5a1604
+++ b/aclocal.m4
Ian Kent 5a1604
@@ -232,7 +232,7 @@ AC_DEFUN([AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL],
Ian Kent 5a1604
 
Ian Kent 5a1604
 # save current ldflags
Ian Kent 5a1604
 af_check_ldap_create_page_control_save_ldflags="$LDFLAGS"
Ian Kent 5a1604
-LDFLAGS="$LDFLAGS -lldap_r"
Ian Kent 5a1604
+LDFLAGS="$LDFLAGS -lldap"
Ian Kent 5a1604
 
Ian Kent 5a1604
 AC_TRY_LINK(
Ian Kent 5a1604
   [ #include <ldap.h> ],
Ian Kent 5a1604
@@ -265,7 +265,7 @@ AC_DEFUN([AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL],
Ian Kent 5a1604
 
Ian Kent 5a1604
 # save current ldflags
Ian Kent 5a1604
 af_check_ldap_parse_page_control_save_ldflags="$LDFLAGS"
Ian Kent 5a1604
-LDFLAGS="$LDFLAGS -lldap_r"
Ian Kent 5a1604
+LDFLAGS="$LDFLAGS -lldap"
Ian Kent 5a1604
 
Ian Kent 5a1604
 AC_TRY_LINK(
Ian Kent 5a1604
   [ #include <ldap.h> ],
Ian Kent 5a1604
diff --git a/configure b/configure
Ian Kent 5a1604
index e872392..0d3268c 100755
Ian Kent 5a1604
--- a/configure
Ian Kent 5a1604
+++ b/configure
Ian Kent 5a1604
@@ -4563,7 +4563,7 @@ fi
Ian Kent 5a1604
 { echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_initialize" >&5
Ian Kent 5a1604
 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_initialize" >&6; }
Ian Kent 5a1604
 if test $ac_cv_lib_ldap_ldap_initialize = yes; then
Ian Kent 5a1604
-  HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap_r -llber -lresolv"
Ian Kent 5a1604
+  HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv"
Ian Kent 5a1604
 fi
Ian Kent 5a1604
 
Ian Kent 5a1604
 	if test "$HAVE_LDAP" = "1"; then
Ian Kent 5a1604
@@ -4578,7 +4578,7 @@ echo $ECHO_N "checking for ldap_create_page_control in -lldap... $ECHO_C" >&6; }
Ian Kent 5a1604
 
Ian Kent 5a1604
 # save current ldflags
Ian Kent 5a1604
 af_check_ldap_create_page_control_save_ldflags="$LDFLAGS"
Ian Kent 5a1604
-LDFLAGS="$LDFLAGS -lldap_r"
Ian Kent 5a1604
+LDFLAGS="$LDFLAGS -lldap"
Ian Kent 5a1604
 
Ian Kent 5a1604
 cat >conftest.$ac_ext <<_ACEOF
Ian Kent 5a1604
 /* confdefs.h.  */
Ian Kent 5a1604
@@ -4648,7 +4648,7 @@ echo $ECHO_N "checking for ldap_parse_page_control in -lldap... $ECHO_C" >&6; }
Ian Kent 5a1604
 
Ian Kent 5a1604
 # save current ldflags
Ian Kent 5a1604
 af_check_ldap_parse_page_control_save_ldflags="$LDFLAGS"
Ian Kent 5a1604
-LDFLAGS="$LDFLAGS -lldap_r"
Ian Kent 5a1604
+LDFLAGS="$LDFLAGS -lldap"
Ian Kent 5a1604
 
Ian Kent 5a1604
 cat >conftest.$ac_ext <<_ACEOF
Ian Kent 5a1604
 /* confdefs.h.  */
Ian Kent 5a1604
diff --git a/configure.in b/configure.in
Ian Kent 5a1604
index a9c86dd..27b9bec 100644
Ian Kent 5a1604
--- a/configure.in
Ian Kent 5a1604
+++ b/configure.in
Ian Kent 5a1604
@@ -197,7 +197,7 @@ AC_ARG_WITH(openldap,
Ian Kent 5a1604
 if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" != "0"; then
Ian Kent 5a1604
 	HAVE_LDAP=0
Ian Kent 5a1604
 	LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1"
Ian Kent 5a1604
-	AC_CHECK_LIB(ldap, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap_r -llber -lresolv", ,
Ian Kent 5a1604
+	AC_CHECK_LIB(ldap, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv", ,
Ian Kent 5a1604
 		     -llber -lresolv $LIBS)
Ian Kent 5a1604
 	if test "$HAVE_LDAP" = "1"; then
Ian Kent 5a1604
 		AC_DEFINE(WITH_LDAP,1,