aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-04-30 22:53:51 +0000
committerDavid Shaw <[email protected]>2002-04-30 22:53:51 +0000
commit473506054011a199954646f56c78a7d7e77c3851 (patch)
treea291832559c7ea016436d30ebb4c8f019b7605ca
parent2002-04-30 Timo Schulz <[email protected]> (diff)
downloadgnupg-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--ChangeLog8
-rw-r--r--configure.ac19
2 files changed, 25 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a5e4a014c..9b1c02acb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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