+ with_ldap=yes
+else
+ echo "$ac_t""no" 1>&6
+with_ldap=no
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+ if test yes = "$with_ldap" -a yes != "$ldap_needs_lber";then
+ echo $ac_n "checking for LDAP_OPT_ON definition""... $ac_c" 1>&6
+echo "configure:8049: checking for LDAP_OPT_ON definition" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8052 "configure"
+#include "confdefs.h"
+#include <lber.h>
+#include <ldap.h>
+#ifdef LDAP_OPT_ON
+/* Relying on const defined by ac_c_const (upper case). */
+const void *const v = LDAP_OPT_ON;
+#else /* !defined (LDAP_OPT_ON) */
+choke me
+#endif /* !defined (LDAP_OPT_ON) */
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:8066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ xe_cv_have_LDAP_OPT_ON=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ xe_cv_have_LDAP_OPT_ON=no
+fi
+rm -f conftest*
+
+echo "$ac_t""$xe_cv_have_LDAP_OPT_ON" 1>&6
+ if test yes = "$xe_cv_have_LDAP_OPT_ON";then
+ echo $ac_n "checking LDAP_OPT_ON linking""... $ac_c" 1>&6
+echo "configure:8080: checking LDAP_OPT_ON linking" >&5
+
+xe_save_LIBS="$LIBS"
+ LIBS="-lldap $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8085 "configure"
+#include "confdefs.h"
+#include <lber.h>
+#include <ldap.h>
+const void *const v = LDAP_OPT_ON;
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:8094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ xe_cv_LDAP_OPT_ON_links=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ xe_cv_LDAP_OPT_ON_links=no
+fi
+rm -f conftest*
+ LIBS="$xe_save_LIBS"
+
+echo "$ac_t""$xe_cv_LDAP_OPT_ON_links" 1>&6
+ if test yes != "$xe_cv_LDAP_OPT_ON_links";then
+ ldap_needs_lber=yes ldap_other_libs=-llber
+ echo $ac_n "checking LDAP_OPT_ON linking with -llber""... $ac_c" 1>&6
+echo "configure:8110: checking LDAP_OPT_ON linking with -llber" >&5
+
+xe_save_LIBS="$LIBS"
+ LIBS="-lldap $ldap_other_libs $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8115 "configure"
+#include "confdefs.h"
+#include <lber.h>
+#include <ldap.h>
+const void *const v = LDAP_OPT_ON;
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ xe_cv_LDAP_OPT_ON_links_w_lber=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ xe_cv_LDAP_OPT_ON_links_w_lber=no
+fi
+rm -f conftest*
+ LIBS="$xe_save_LIBS"
+
+echo "$ac_t""$xe_cv_LDAP_OPT_ON_links_w_lber" 1>&6
+ if test yes != "$xe_cv_LDAP_OPT_ON_links_w_lber";then
+ with_ldap=no
+ fi
+ fi
+ fi
+ fi
+ if test yes = "$with_ldap";then
+ if test yes = "$ldap_needs_des";then
+ ldap_libs="-ldes $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldes\" to \$ldap_libs"; fi
+ fi
+ if test yes = "$ldap_needs_krb";then
+ ldap_libs="-lkrb $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$ldap_libs"; fi
+ fi
+ if test yes = "$ldap_needs_lber";then
+ ldap_libs="-llber $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-llber\" to \$ldap_libs"; fi
+ fi
+ ldap_libs="-lldap $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$ldap_libs"; fi
+ fi
+fi
+
+ else
+ save_LIBS="$LIBS" LIBS="$ldap_libs $LIBS"
+ echo $ac_n "checking for ldap_open""... $ac_c" 1>&6
+echo "configure:8160: checking for ldap_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8163 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char ldap_open(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char ldap_open();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_ldap_open) || defined (__stub___ldap_open)
+choke me
+#else
+ldap_open();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_ldap_open=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_ldap_open=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'ldap_open`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ with_ldap=yes
+ test yes = "$extra_verbose" &&
+ echo "Setting ldap_libs to $ldap_libs"
+else
+ echo "$ac_t""no" 1>&6
+ with_ldap=no
+fi
+
+ LIBS="$save_LIBS"
+ fi
+fi
+if test "$with_ldap" = "yes"; then
+ { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining HAVE_LDAP
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_LDAP 1
+EOF
+}
+
+ extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then
+ echo " xemacs will be linked with \"eldap.o\""
+ fi
+ LIBS="$ldap_libs $LIBS"
+ for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8226: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8229 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ { test "$extra_verbose" = "yes" && cat << EOF
+ Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1