aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-06-20 23:25:53 +0800
committerDan Winship <danw@src.gnome.org>2001-06-20 23:25:53 +0800
commit85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d (patch)
tree85bc26d35d15b9f47287cc51229bba746f046d74 /configure.in
parentd9e3885428ec973fc18995b83daf6a1ad82103f0 (diff)
downloadgsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar.gz
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar.bz2
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar.lz
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar.xz
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.tar.zst
gsoc2013-evolution-85bcb7adf947fc8bf1f4262c1e4a7e75972aae6d.zip
Change --enable-ldap to --with-openldap, allow a path prefix as an
* 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. svn path=/trunk/; revision=10334
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in77
1 files changed, 46 insertions, 31 deletions
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.