diff options
author | David Shaw <[email protected]> | 2002-04-30 22:53:51 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-04-30 22:53:51 +0000 |
commit | 473506054011a199954646f56c78a7d7e77c3851 (patch) | |
tree | a291832559c7ea016436d30ebb4c8f019b7605ca | |
parent | 2002-04-30 Timo Schulz <[email protected]> (diff) | |
download | gnupg-473506054011a199954646f56c78a7d7e77c3851.tar.gz gnupg-473506054011a199954646f56c78a7d7e77c3851.zip |
configure.ac: Try and link to a sample LDAP program to check if the LDAP
we're about to use is really sane. The most common problem (using a very
old OpenLDAP), could be fixed with an extra #include, but this would not
be very portable to other LDAP libraries.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.ac | 19 |
2 files changed, 25 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2002-04-30 David Shaw <[email protected]> + + * configure.ac: Try and link to a sample LDAP program to check if + the LDAP we're about to use is really sane. The most common + problem (using a very old OpenLDAP), could be fixed with an extra + #include, but this would not be very portable to other LDAP + libraries. + 2002-04-29 Werner Koch <[email protected]> Released 1.0.7. diff --git a/configure.ac b/configure.ac index 100d1eb44..8b10c3737 100644 --- a/configure.ac +++ b/configure.ac @@ -273,10 +273,25 @@ if test "$NO_PIC" = yes; then try_dynload=no fi +# Try and link a LDAP test program to weed out unusable LDAP libraries + if test "$try_ldap" = yes ; then - AC_CHECK_LIB(ldap,ldap_init, - [GPGKEYS_LDAP="gpgkeys_ldap"],,-llber -lresolv) + _ldap_save_libs=$LIBS + LIBS="-lldap -llber -lresolv $LIBS" + + AC_CACHE_CHECK([whether LDAP is sane], + [gnupg_cv_func_ldap_init], + [AC_TRY_LINK([#include <ldap.h>], + [ldap_open("foobar",1234);], + [gnupg_cv_func_ldap_init=yes], + [gnupg_cv_func_ldap_init=no])]) + + if test $gnupg_cv_func_ldap_init = yes; then + GPGKEYS_LDAP="gpgkeys_ldap" fi + + LIBS=$_ldap_save_libs +fi AC_SUBST(GPGKEYS_LDAP) if test "$try_mailto" = yes ; then |