This patch should fix the recent OpenLDAP breakage due to them finally
moving to a more netscape-ish opaque data type. This just generalizes the
tests for whether to use ldap_set_option and friends. It now actually
checks for the functions with AC_CHECK_FUNCS instead of making assumptions
about the SDK we are using, etc.
I am not sure if these tests will work with the really old netscape 1.0
LDAP library anymore. But they have been on 3.x for ages now, so I don't
know if that is a real loss or not. Checking for things like 'ldap10' or
'ldap30' seems silly. It should just be 'ldap'. Feh!
-Bill P.
[xemacs]cvs diff -cw configure.in src/config.h.in src/eldap.c
Index: configure.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/configure.in,v
retrieving revision 1.111.2.28
diff -c -w -r1.111.2.28 configure.in
*** configure.in 1999/06/04 20:08:07 1.111.2.28
--- configure.in 1999/06/07 20:14:36
***************
*** 2670,2692 ****
test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
if test "$with_ldap" != "no"; then
! test -z "$with_umich_ldap" && { AC_CHECK_LIB(ldap, ldap_open, with_umich_ldap=yes, with_umich_ldap=no, -llber) }
! test "$with_umich_ldap" = "no" && { AC_CHECK_LIB(ldap10, ldap_set_option, with_ns_ldap=yes, with_ns_ldap=no) }
! test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
fi
if test "$with_ldap" = "yes"; then
AC_DEFINE(HAVE_LDAP)
XE_ADD_OBJS(eldap.o)
- if test "$with_umich_ldap" = "yes" ; then
- AC_DEFINE(HAVE_UMICH_LDAP)
XE_PREPEND(-llber, LIBS)
XE_PREPEND(-lldap, LIBS)
! elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
! AC_DEFINE(HAVE_NS_LDAP)
! XE_PREPEND(-lldap10, LIBS)
! elif test "$with_ldap" = "yes" ; then
! XE_PREPEND(-lldap, LIBS)
! fi
fi
dnl ----------------------
--- 2670,2683 ----
test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
if test "$with_ldap" != "no"; then
! AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes, with_ldap=no, -llber)
fi
if test "$with_ldap" = "yes"; then
AC_DEFINE(HAVE_LDAP)
XE_ADD_OBJS(eldap.o)
XE_PREPEND(-llber, LIBS)
XE_PREPEND(-lldap, LIBS)
! AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno)
fi
dnl ----------------------
Index: src/config.h.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/config.h.in,v
retrieving revision 1.49.2.8
diff -c -w -r1.49.2.8 config.h.in
*** config.h.in 1999/06/03 17:23:15 1.49.2.8
--- config.h.in 1999/06/07 20:14:38
***************
*** 357,367 ****
/* Do we have LDAP support? */
#undef HAVE_LDAP
- /* Do we have the LDAP library of the University of Michigan ? */
- #undef HAVE_UMICH_LDAP
- /* Do we have Netscape LDAP SDK library */
- #undef HAVE_NS_LDAP
/* Do you have the Xauth library present? This will add some extra
functionality to gnuserv. */
#undef HAVE_XAUTH
--- 357,369 ----
/* Do we have LDAP support? */
#undef HAVE_LDAP
+ /* Do we have ldap_set_option in our LDAP library? */
+ #undef HAVE_LDAP_SET_OPTION
+
+ /* Do we have ldap_get_lderrno in our LDAP library? */
+ #undef HAVE_LDAP_GET_LDERRNO
+
/* Do you have the Xauth library present? This will add some extra
functionality to gnuserv. */
#undef HAVE_XAUTH
***************
*** 697,707 ****
--- 699,714 ----
#endif
#if defined (HAVE_SOCKS) && !defined (DO_NOT_SOCKSIFY)
+ #if HAVE_SOCKS == 4
#define accept Raccept
#define bind Rbind
#define connect Rconnect
#define getsockname Rgetsockname
#define listen Rlisten
+ #else
+ #define SOCKS
+ #include <socks.h>
+ #endif /* HAVE_SOCKS == 5 */
#endif /* HAVE_SOCKS && !DO_NOT_SOCKSIFY */
#undef SIZEOF_SHORT
Index: src/eldap.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/eldap.c,v
retrieving revision 1.13.2.6
diff -c -w -r1.13.2.6 eldap.c
*** eldap.c 1999/04/27 00:14:58 1.13.2.6
--- eldap.c 1999/06/07 20:14:40
***************
*** 40,53 ****
#include "eldap.h"
- #ifdef HAVE_NS_LDAP
- # define HAVE_LDAP_SET_OPTION 1
- # define HAVE_LDAP_GET_ERRNO 1
- #else
- # undef HAVE_LDAP_SET_OPTION
- # undef HAVE_LDAP_GET_ERRNO
- #endif
-
static int ldap_default_port;
static Lisp_Object Vldap_default_base;
--- 40,45 ----
***************
*** 71,77 ****
static void
signal_ldap_error (LDAP *ld)
{
! #ifdef HAVE_LDAP_GET_ERRNO
signal_simple_error
("LDAP error",
build_string (ldap_err2string (ldap_get_lderrno (ld, NULL, NULL))));
--- 63,69 ----
static void
signal_ldap_error (LDAP *ld)
{
! #ifdef HAVE_LDAP_GET_LDERRNO
signal_simple_error
("LDAP error",
build_string (ldap_err2string (ldap_get_lderrno (ld, NULL, NULL))));