+ if test x"$libldap" != "x"; then
+
+
+echo $ac_n "checking for ldap_start_tls_s in -l"$libldap"""... $ac_c" 1>&6
+echo "configure:1770: checking for ldap_start_tls_s in -l"$libldap"" >&5
+
+smart_lib=
+smart_lib_dir=
+
+ old_LIBS="$LIBS"
+ LIBS="$LIBS -l"$libldap""
+ cat > conftest.$ac_ext <<EOF
+#line 1778 "configure"
+#include "confdefs.h"
+extern char ldap_start_tls_s();
+int main() {
+ ldap_start_tls_s()
+; return 0; }
+EOF
+if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ smart_lib="-l"$libldap""
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+
+ if test "x$smart_lib" = "x"; then
+
+
+if test "x$LOCATE" != "x"; then
+ DIRS=
+ file=lib"$libldap"${libltdl_cv_shlibext}
+
+ for x in `${LOCATE} $file 2>/dev/null`; do
+ base=`echo $x | sed "s%/${file}%%"`
+ if test "x$x" = "x$base"; then
+ continue;
+ fi
+
+ dir=`${DIRNAME} $x 2>/dev/null`
+ exclude=`echo ${dir} | ${GREP} /home`
+ if test "x$exclude" != "x"; then
+ continue
+ fi
+
+ already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
+ if test "x$already" = "x"; then
+ DIRS="$DIRS $dir"
+ fi
+ done
+fi
+
+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
+
+
+
+if test "x$LOCATE" != "x"; then
+ DIRS=
+ file=lib"$libldap".a
+
+ for x in `${LOCATE} $file 2>/dev/null`; do
+ base=`echo $x | sed "s%/${file}%%"`
+ if test "x$x" = "x$base"; then
+ continue;
+ fi
+
+ dir=`${DIRNAME} $x 2>/dev/null`
+ exclude=`echo ${dir} | ${GREP} /home`
+ if test "x$exclude" != "x"; then
+ continue
+ fi
+
+ already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
+ if test "x$already" = "x"; then
+ DIRS="$DIRS $dir"
+ fi
+ done
+fi
+
+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
+
+
+ for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
+ LIBS="$old_LIBS -L$try -l"$libldap""
+
+ cat > conftest.$ac_ext <<EOF
+#line 1854 "configure"
+#include "confdefs.h"
+extern char ldap_start_tls_s();
+int main() {
+ ldap_start_tls_s()
+; return 0; }
+EOF
+if { (eval echo configure:1861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ smart_lib="-L$try -l"$libldap""
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ if test "x$smart_lib" != "x"; then
+ break;
+ fi
+ done
+ LIBS="$old_LIBS"
+ fi
+
+ if test "x$smart_lib" != "x"; then
+ echo "$ac_t""yes" 1>&6
+ eval "ac_cv_lib_"$libldap"_ldap_start_tls_s=yes"
+ LIBS="$old_LIBS $smart_lib"
+ SMART_LIBS="$SMART_LIBS $smart_lib"
+ else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ if test "x${ac_cv_lib_ldap_ldap_start_tls_s}${ac_cv_lib_ldap_r_ldap_start_tls_s}" != "x"; then
+ SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS"
+ fi
+ fi
+
+