dirmngr (8 files)

cvs user wk cvs at cvs.gnupg.org
Fri Dec 17 11:37:47 CET 2004


    Date: Friday, December 17, 2004 @ 11:42:18
  Author: wk
    Path: /cvs/dirmngr/dirmngr

Modified: ChangeLog NEWS TODO acinclude.m4 configure.ac m4/ksba.m4
          src/ChangeLog src/Makefile.am

* acinclude.m4: Updated for automake 1.9.  Removed the LDAP test
and replaced it by the one from gnupg 1.4.

* Makefile.am (dirmngr_ldap_LDADD): Adjusted for new LDAP checks.


-----------------+
 ChangeLog       |    7 +
 NEWS            |    4 -
 TODO            |    5 -
 acinclude.m4    |    4 -
 configure.ac    |  201 +++++++++++++++++++-----------------------------------
 m4/ksba.m4      |    2 
 src/ChangeLog   |    4 +
 src/Makefile.am |    6 -
 8 files changed, 93 insertions(+), 140 deletions(-)


Index: dirmngr/ChangeLog
diff -u dirmngr/ChangeLog:1.80 dirmngr/ChangeLog:1.81
--- dirmngr/ChangeLog:1.80	Mon Dec 13 16:16:35 2004
+++ dirmngr/ChangeLog	Fri Dec 17 11:42:18 2004
@@ -1,3 +1,10 @@
+2004-12-17  Werner Koch  <wk at g10code.com>
+
+	Released 0.9.0.
+
+	* acinclude.m4: Updated for automake 1.9.  Removed the LDAP test
+	and replaced it by the one from gnupg 1.4.
+
 2004-12-13  Werner Koch  <wk at g10code.com>
 
 	* configure.ac (AC_CHECK_TYPES): Check for sigset_t.
Index: dirmngr/NEWS
diff -u dirmngr/NEWS:1.31 dirmngr/NEWS:1.32
--- dirmngr/NEWS:1.31	Thu Dec 16 08:49:25 2004
+++ dirmngr/NEWS	Fri Dec 17 11:42:18 2004
@@ -1,9 +1,9 @@
-Noteworthy changes in version 0.9.0
+Noteworthy changes in version 0.9.0 (2004-12-17)
 ------------------------------------------------
 
  * New option --daemon to start dirmngr as a system daemon.  This
    switches to the use of different directories and also does
-   CRl signing certificate validation on its own.
+   CRL signing certificate validation on its own.
 
  * New tool dirmngr-client.
 
Index: dirmngr/TODO
diff -u dirmngr/TODO:1.16 dirmngr/TODO:1.17
--- dirmngr/TODO:1.16	Wed Nov 24 13:25:53 2004
+++ dirmngr/TODO	Fri Dec 17 11:42:18 2004
@@ -1,11 +1,6 @@
 Things we might want to do                              -*- outline -*-
 
-* Audit the code!
-
-* Write a useful README
-
 * Map LDAP error codes
-  and use the LDAP autoconf tests from gnupg 1.3
 
 * Optimize lookup
 ** Use the most likely server first.
Index: dirmngr/acinclude.m4
diff -u dirmngr/acinclude.m4:1.4 dirmngr/acinclude.m4:1.5
--- dirmngr/acinclude.m4:1.4	Tue Nov 16 19:24:36 2004
+++ dirmngr/acinclude.m4	Fri Dec 17 11:42:18 2004
@@ -20,7 +20,7 @@
 dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
 dnl Check whether a typedef exists and create a #define $2 if it exists
 dnl
-AC_DEFUN(GNUPG_CHECK_TYPEDEF,
+AC_DEFUN([GNUPG_CHECK_TYPEDEF],
   [ AC_MSG_CHECKING(for $1 typedef)
     AC_CACHE_VAL(gnupg_cv_typedef_$1,
     [AC_TRY_COMPILE([#define _GNU_SOURCE 1
@@ -40,7 +40,7 @@
 # If the version is sufficient, HAVE_PTH will be set to yes.
 #
 # Taken form the m4 macros which come with Pth
-AC_DEFUN(GNUPG_PTH_VERSION_CHECK,
+AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
   [
     _pth_version=`$PTH_CONFIG --version | awk 'NR==1 {print [$]3}'`
     _req_version="ifelse([$1],,1.2.0,$1)"
Index: dirmngr/configure.ac
diff -u dirmngr/configure.ac:1.65 dirmngr/configure.ac:1.66
--- dirmngr/configure.ac:1.65	Mon Dec 13 16:16:35 2004
+++ dirmngr/configure.ac	Fri Dec 17 11:42:18 2004
@@ -19,10 +19,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
 # Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.57)
-min_automake_version="1.7.6"
+AC_PREREQ(2.59)
+min_automake_version="1.9.3"
 
-AC_INIT(dirmngr, 0.9.0-cvs, gpa-dev at gnupg.org)
+AC_INIT(dirmngr, 0.9.0, gpa-dev at gnupg.org)
 
 NEED_GPG_ERROR_VERSION=0.7
 
@@ -48,7 +48,7 @@
 have_libgcrypt=no 
 have_libassuan=no
 have_ksba=no
-
+have_ldap=no
 
 AM_MAINTAINER_MODE
 
@@ -199,133 +199,70 @@
 
 
 #
-# Do we need the resolver lib
-#
-AC_HAVE_LIBRARY(resolv)
-
-
-#
-# OpenLDAP libraries/includes
-#
-AC_DEFUN(AC_FIND_FILE,
-[
-$3=NO
-for i in $2;
-do
-  for j in $1;
-  do
-    echo "configure: __oline__: $i/$j" >&AC_FD_CC
-    if test -r "$i/$j"; then
-      echo "taking that" >&AC_FD_CC
-      $3=$i
-      break 2
+# Must check for network library requirements before doing link tests
+# for ldap, for example. If ldap libs are static (or dynamic and without
+# ELF runtime link paths), then link will fail and LDAP support won't
+# be detected.
+#
+AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
+	[NETLIBS="-lnsl $NETLIBS"]))
+AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
+	[NETLIBS="-lsocket $NETLIBS"]))
+
+#
+# LDAP libraries/includes
+#
+# From gnupg 1.4:
+# 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"
+#
+for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv" "-lwldap32"; do
+    _ldap_save_libs=$LIBS
+    LIBS="$MY_LDAPLIBS $NETLIBS $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" = yes ; then
+       LDAPLIBS=$MY_LDAPLIBS
+       have_ldap=yes
+
+       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
-  done
-done
-])
-
 
-AC_MSG_CHECKING(for OpenLDAP)
-AC_ARG_WITH(ldap,
-[  --with-ldap-prefix=PATH     Set path for LDAP files [default=check]],
-[ case "$withval" in
-  yes)
-    with_ldap=CHECK
-    ;;
-  esac ],
-[ with_ldap=CHECK ]
-)dnl
-
-if test "x$with_ldap" = "xCHECK" ; then
-  with_ldap=NOTFOUND
-  search_incs="$kde_includes /usr/include /usr/local/include"
-  AC_FIND_FILE(ldap.h, $search_incs, ldap_incdir)
-  if test -r $ldap_incdir/ldap.h ; then
-    test "x$ldap_incdir" != "x/usr/include" && LDAP_INCS="-I$ldap_incdir"
-    with_ldap=FOUND
-  fi
-  if test $with_ldap = FOUND ; then
-    with_ldap=NOTFOUND
-    for ext in la so sl a ; do
-      AC_FIND_FILE(libldap.$ext, /usr/lib /usr/local/lib,
-        ldap_libdir)
-      if test -r $ldap_libdir/libldap.$ext ; then
-        if test "x$ldap_libdir" != "x/usr/lib" ; then
-          LDAP_LIBS="-L$ldap_libdir "
-          test "$USE_RPATH" = yes && LDAP_RPATH="-R $ldap_libdir"
-        fi
-        LDAP_LIBS="${LDAP_LIBS}-lldap -llber"
-        with_ldap=FOUND
-        break
-      fi
-    done
-  fi
-fi
+    LIBS=$_ldap_save_libs
 
-case "$with_ldap" in
-no) AC_MSG_RESULT(no) ;;
-NOTFOUND) AC_MSG_ERROR([[
-***  
-*** libldap was not found. You may want to get it from
-*** http://www.openldap.org
-***
-]]) ;;
-FOUND)
-    AC_DEFINE_UNQUOTED(HAVE_LIBLDAP, 1, [Define if you have LDAP libraries])
-    LDAP_SUBDIR="ldap"
-    AC_MSG_RESULT(Yes)
-    ;;
-*)
-    msg="$with_ldap"
-    LDAP_ROOT="$with_ldap"
-    if test "x$LDAP_ROOT" != "x/usr" ; then
-      LDAP_INCS="-I${LDAP_ROOT}/include"
-      LDAP_LIBS="-L${LDAP_ROOT}/lib "
-      if test "$USE_RPATH" = "yes" ; then
-        LDAP_RPATH="-R ${LDAP_ROOT}/lib"
-      fi
-    fi
-    LDAP_LIBS="${LDAP_LIBS}-lldap -llber"
-  safe_LIBS="$LIBS"
-  safe_CFLAGS="$CFLAGS"
-  LIBS="$LIBS $all_libraries $LDAP_LIBS $KERBEROS_LIBS $X_EXTRA_LIBS"
-  CFLAGS="$CFLAGS $all_includes $LDAP_INCS $KERBEROS_INCS"
-  AC_LANG_SAVE
-  AC_LANG_C
-  AC_TRY_LINK(dnl
-  [
-  #include <lber.h>
-  #include <ldap.h>
-  #if LDAP_VENDOR_VERSION < 20000
-  #error OpenLDAP version too old, please upgrade to version 2 or higher
-  #endif
-  ],
-  [
-  LDAP *ldap;
-  ],
-  , with_ldap=no
-  )
-  AC_LANG_RESTORE
-  CFLAGS=$safe_CFLAGS
-  LIBS=$safe_LIBS
-  if test "$with_ldap" = "no" ; then
-    LDAP_INCS=
-    LDAP_LIBS=
-    LDAP_RPATH=
-    LDAP_SUBDIR=
-    AC_MSG_ERROR(OpenLDAP not found)
-  else
-    AC_DEFINE_UNQUOTED(HAVE_LIBLDAP, 1, [Define if you have LDAP libraries])
-    LDAP_SUBDIR="ldap"
-    AC_MSG_RESULT($msg)
-  fi
-  ;;
-esac
+    if test $have_ldap = yes ; then break; fi
+done
+AC_SUBST(LDAPLIBS)
 
-AC_SUBST(LDAP_INCS)
-AC_SUBST(LDAP_LIBS)
-AC_SUBST(LDAP_RPATH)
-AC_SUBST(LDAP_SUBDIR)
 
 
 # Checks for header files.
@@ -429,6 +366,16 @@
 *** (at least version $NEED_KSBA_VERSION is required).
 ***]])
 fi
+if test "$have_ldap" = "no"; then
+   die=yes
+    AC_MSG_NOTICE([[
+***
+*** You need a LDAP library to build this program.
+*** Check out 
+***    http://www.openldap.org 
+*** for a suitable implementation. 
+***]])
+fi
 
 if test "$die" = "yes"; then
     AC_MSG_ERROR([[
Index: dirmngr/m4/ksba.m4
diff -u dirmngr/m4/ksba.m4:1.1 dirmngr/m4/ksba.m4:1.2
--- dirmngr/m4/ksba.m4:1.1	Tue Nov 11 19:15:01 2003
+++ dirmngr/m4/ksba.m4	Fri Dec 17 11:42:18 2004
@@ -14,7 +14,7 @@
 dnl              [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
 dnl Test for libksba and define KSBA_CFLAGS and KSBA_LIBS
 dnl
-AC_DEFUN(AM_PATH_KSBA,
+AC_DEFUN([AM_PATH_KSBA],
 [ AC_ARG_WITH(ksba-prefix,
             AC_HELP_STRING([--with-ksba-prefix=PFX],
                            [prefix where KSBA is installed (optional)]),
Index: dirmngr/src/ChangeLog
diff -u dirmngr/src/ChangeLog:1.37 dirmngr/src/ChangeLog:1.38
--- dirmngr/src/ChangeLog:1.37	Thu Dec 16 08:49:25 2004
+++ dirmngr/src/ChangeLog	Fri Dec 17 11:42:18 2004
@@ -1,3 +1,7 @@
+2004-12-17  Werner Koch  <wk at g10code.com>
+
+	* Makefile.am (dirmngr_ldap_LDADD): Adjusted for new LDAP checks.
+
 2004-12-16  Werner Koch  <wk at g10code.com>
 
 	* ldap.c (ldap_wrapper): Peek on the output to detect empty output
Index: dirmngr/src/Makefile.am
diff -u dirmngr/src/Makefile.am:1.22 dirmngr/src/Makefile.am:1.23
--- dirmngr/src/Makefile.am:1.22	Wed Dec  1 17:11:14 2004
+++ dirmngr/src/Makefile.am	Fri Dec 17 11:42:18 2004
@@ -50,10 +50,10 @@
 
 dirmngr_ldap_SOURCES = dirmngr_ldap.c i18n.h util.h \
                        no-libgcrypt.c no-libgcrypt.h 
-dirmngr_ldap_CFLAGS = $(LDAP_INCS) $(GPG_ERROR_CFLAGS)
-dirmngr_ldap_LDFLAGS = $(LDAP_RPATH)
+dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS)
+dirmngr_ldap_LDFLAGS =
 dirmngr_ldap_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(GPG_ERROR_LIBS) \
-		    $(LDAP_LIBS)
+		    $(LDAPLIBS)
 
 
 dirmngr_client_SOURCES = dirmngr-client.c i18n.h util.h b64enc.c maperror.c \




More information about the Gnupg-commits mailing list