gnupg/m4 (ChangeLog ldap.m4)

cvs user dshaw cvs at cvs.gnupg.org
Thu Mar 17 04:51:45 CET 2005


    Date: Thursday, March 17, 2005 @ 05:05:14
  Author: dshaw
    Path: /cvs/gnupg/gnupg/m4

   Added: ldap.m4
Modified: ChangeLog

* ldap.m4: New.  Moved from configure.ac.


-----------+
 ChangeLog |    4 ++
 ldap.m4   |   88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)


Index: gnupg/m4/ChangeLog
diff -u gnupg/m4/ChangeLog:1.15 gnupg/m4/ChangeLog:1.16
--- gnupg/m4/ChangeLog:1.15	Tue Mar  1 01:05:16 2005
+++ gnupg/m4/ChangeLog	Thu Mar 17 05:05:14 2005
@@ -1,3 +1,7 @@
+2005-03-16  David Shaw  <dshaw at jabberwocky.com>
+
+	* ldap.m4: New.  Moved from configure.ac.
+
 2005-02-28  David Shaw  <dshaw at jabberwocky.com>
 
 	* libcurl.m4: Use $LIBS instead of $LDFLAGS.  This should help
Index: gnupg/m4/ldap.m4
diff -u /dev/null gnupg/m4/ldap.m4:1.1
--- /dev/null	Thu Mar 17 05:05:14 2005
+++ gnupg/m4/ldap.m4	Thu Mar 17 05:05:14 2005
@@ -0,0 +1,88 @@
+dnl Check for LDAP
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines HAVE_LIBUSB to 1 if a working libusb setup is found, and sets
+dnl @LIBUSB@ to the necessary libraries.  HAVE_USB_GET_BUSSES is set if
+dnl usb_get_busses() exists.
+
+AC_DEFUN([GNUPG_CHECK_LDAP],
+[
+# Try and link a LDAP test program to weed out unusable LDAP
+# libraries.  -lldap [-llber [-lresolv]] is for older OpenLDAPs.
+# OpenLDAP, circa 1999, was terrible with creating weird dependencies.
+# This seems to have all been resolved, so I'm simplifying this code
+# significantly.  If all else fails, the user can play
+# guess-the-dependency by using something like ./configure
+# LDAPLIBS="-Lfoo -lbar"
+
+  AC_ARG_WITH(ldap,
+     AC_HELP_STRING([--with-ldap=DIR],[look for the LDAP library in DIR]),
+     [
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
+     ])
+
+  for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv" "-lwldap32"; do
+    _ldap_save_libs=$LIBS
+    LIBS="$MY_LDAPLIBS $1 $LIBS"
+
+    AC_MSG_CHECKING([whether LDAP via \"$MY_LDAPLIBS\" is present and sane])
+    AC_TRY_LINK([
+#ifdef _WIN32
+#include <winsock2.h>
+#include <winldap.h>
+#else
+#include <ldap.h>
+#endif
+],[ldap_open("foobar",1234);],
+                [gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
+    AC_MSG_RESULT([$gnupg_cv_func_ldap_init])
+
+    if test $gnupg_cv_func_ldap_init = no; then
+      AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
+      AC_TRY_LINK([#include <lber.h>
+#include <ldap.h>],[ldap_open("foobar",1234);],
+         [gnupg_cv_func_ldaplber_init=yes],[gnupg_cv_func_ldaplber_init=no])
+      AC_MSG_RESULT([$gnupg_cv_func_ldaplber_init])
+    fi
+
+    if test "$gnupg_cv_func_ldaplber_init" = yes ; then
+       AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
+    fi
+
+    if test "$gnupg_cv_func_ldap_init" = yes || \
+        test "$gnupg_cv_func_ldaplber_init" = yes ; then
+       LDAPLIBS=$MY_LDAPLIBS
+       GPGKEYS_LDAP="gpgkeys_ldap$EXEEXT"
+
+       AC_CHECK_FUNCS(ldap_get_option ldap_set_option ldap_start_tls_s)
+
+       if test "$ac_cv_func_ldap_get_option" != yes ; then
+          AC_MSG_CHECKING([whether LDAP supports ld_errno])
+	  AC_TRY_LINK([#include <ldap.h>],[LDAP *ldap; ldap->ld_errno;],
+	     [gnupg_cv_func_ldap_ld_errno=yes],
+	     [gnupg_cv_func_ldap_ld_errno=no])
+          AC_MSG_RESULT([$gnupg_cv_func_ldap_ld_errno])
+
+	  if test "$gnupg_cv_func_ldap_ld_errno" = yes ; then
+	     AC_DEFINE(HAVE_LDAP_LD_ERRNO,1,[Define if the LDAP library supports ld_errno])
+          fi
+       fi
+    fi
+
+    LIBS=$_ldap_save_libs
+
+    if test "$GPGKEYS_LDAP" != "" ; then break; fi
+  done
+
+  AC_SUBST(GPGKEYS_LDAP)
+  AC_SUBST(LDAPLIBS)
+])dnl




More information about the Gnupg-commits mailing list