aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--configure.in77
2 files changed, 52 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 79c502f5e9..bb5ad510e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-20 Dan Winship <danw@ximian.com>
+
+ * configure.in: Change --enable-ldap to --with-openldap, allow a
+ path prefix as an argument. Add some libtooly goodness to the
+ libldap check in case it depends on ssl libraries.
+
2001-06-20 Kevin Breit <battery841@mediaone.net>
* doc/C/apx-gloss.sgml: Took out a reference to gloss.
diff --git a/configure.in b/configure.in
index bc020579ad..1adce69ddd 100644
--- a/configure.in
+++ b/configure.in
@@ -365,43 +365,58 @@ LIBS="$LIBS_save"
dnl **************************************************
dnl * ldap related stuff.
dnl **************************************************
-AC_ARG_ENABLE(ldap,
-[ --enable-ldap=[no/yes] Enable LDAP support in evolution],,enable_ldap=no)
-if test x$enable_ldap = xyes; then
- LDAP_LIBS=
- AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="-lresolv")
- AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="-llber $LDAP_LIBS", ,$LDAP_LIBS)
- if test x$ac_cv_lib_lber_ber_get_tag = xyes; then
- AC_CHECK_LIB(ldap, ldap_open, LDAP_LIBS="-lldap $LDAP_LIBS", ,$LDAP_LIBS)
- fi
-fi
+AC_ARG_WITH(openldap, [ --with-openldap=[no/yes/PREFIX] Enable LDAP support in evolution])
+if test "$with_openldap" != no; then
+ case $with_openldap in
+ /*)
+ LDAP_CFLAGS="-I$with_openldap/include"
+ LDAP_LDFLAGS="-L$with_openldap/lib"
+ ;;
+ *)
+ with_openldap=/usr
+ esac
+ AC_DEFINE(HAVE_LDAP)
+ msg_ldap=yes
+
+ AC_CACHE_CHECK(if OpenLDAP is version 2.x, ac_cv_openldap_version2, [
+ CPPFLAGS_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LDAP_CFLAGS"
+ AC_EGREP_CPP(yes, [
+ #include "ldap.h"
+ #if LDAP_VENDOR_VERSION > 20000
+ yes
+ #endif
+ ], ac_cv_openldap_version2=yes, ac_cv_openldap_version2=no)
+ CPPFLAGS="$CPPFLAGS_save"
+ ])
+ if test "$ac_cv_openldap_version2" = no; then
+ AC_MSG_ERROR(evolution requires OpenLDAP version >= 2)
+ fi
+ AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="-lresolv")
+ AC_CHECK_LIB(lber, ber_get_tag, [
+ LDAP_LIBS="-llber $LDAP_LIBS"
+ # libldap might depend on OpenSSL... We need to pull
+ # in the dependency libs explicitly here since we're
+ # not using libtool for the configure test.
+ if test -f $with_openldap/lib/libldap.la; then
+ LDAP_LIBS="`. $with_openldap/lib/libldap.la; echo $dependency_libs` $LDAP_LIBS"
+ fi
+ AC_CHECK_LIB(ldap, ldap_open, LDAP_LIBS="-lldap $LDAP_LIBS",
+ LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS)
+ LDAP_LIBS="$LDAP_LDFLAGS $LDAP_LIBS"
+ ], LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS)
-if test x$ac_cv_lib_ldap_ldap_open = xyes; then
-dnl *
-dnl * check for openldap version 2.x, since 1.x doesn't have the schema stuff
-dnl *
- AC_MSG_CHECKING(if openldap is version 2.x)
- AC_EGREP_CPP(yes,
- [#include "ldap.h"
- #if LDAP_VENDOR_VERSION > 20000
- yes
- #endif
- ], is_2x=yes, is_2x=no)
-
- if test x$is_2x = xyes; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LDAP)
+ if test -z "$LDAP_LIBS"; then
+ AC_MSG_ERROR(could not find OpenLDAP libraries)
+ fi
+
+ AC_SUBST(LDAP_CFLAGS)
AC_SUBST(LDAP_LIBS)
- msg_ldap=yes
- else
- AC_MSG_ERROR(evolution requires OpenLDAP version >= 2)
- fi
else
msg_ldap=no
- enable_ldap=no
fi
-AM_CONDITIONAL(ENABLE_LDAP, test x$enable_ldap = xyes)
+AM_CONDITIONAL(ENABLE_LDAP, test $msg_ldap = yes)
dnl **************************************************
dnl NNTP support.