[gconf] Bug 498934 - make openldap support optional
- From: Gilles Dartiguelongue <gdartigu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gconf] Bug 498934 - make openldap support optional
- Date: Sun, 3 May 2009 14:16:10 -0400 (EDT)
commit 2075a32cddcc9066229cd851019f9c370d51d0ec
Author: Gilles Dartiguelongue <gilles dartiguelongue esiee org>
Date: Tue Apr 28 20:42:54 2009 +0200
Bug 498934 - make openldap support optional
Allow passing explicit enable or disable configure switch and allow
automagic detection as well.
---
configure.in | 67 ++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 44 insertions(+), 23 deletions(-)
diff --git a/configure.in b/configure.in
index ef6556c..2dae314 100644
--- a/configure.in
+++ b/configure.in
@@ -207,36 +207,57 @@ AC_CHECK_HEADERS(syslog.h sys/wait.h)
AC_CHECK_FUNCS(getuid sigaction fsync fchmod fdwalk)
+dnl **************************************************
+dnl LDAP support.
+dnl **************************************************
+
+AC_ARG_WITH(openldap,
+ AS_HELP_STRING([--with-openldap],
+ [Enable LDAP backend @<:@default=auto@:>@]),
+ ,with_openldap=auto)
LDAP_LIBS=
-AC_CHECK_HEADER(ldap.h, [
+
+if test "x$with_openldap" != "xno"; then
+ AC_CHECK_HEADER(ldap.h, [
AC_CHECK_LIB(ldap, ldap_init, AC_CHECK_LIB(lber, ber_free, [LDAP_LIBS="-lldap -llber"]))
])
-AC_SUBST(LDAP_LIBS)
-AM_CONDITIONAL(LDAP_SUPPORT, test -n "$LDAP_LIBS")
-dnl **************************************************
-dnl LDAP support.
-dnl **************************************************
-if test "$os_win32" != yes; then
-
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LIBS="$LIBS"
-LDAP_CFLAGS="-DLDAP_DEPRECATED"
-CFLAGS="$CFLAGS $LDAP_CFLAGS"
-LIBS="$LIBS $LDAP_LIBS"
-AC_CHECK_FUNCS(ldap_ntlm_bind)
-CFLAGS="$SAVE_CFLAGS"
-LIBS="$SAVE_LIBS"
-
-else # Win32
-LDAP_CFLAGS="-DLDAP_DEPRECATED"
-LDAP_LIBS="-lwldap32"
+ if test "x$os_win32" != "xyes"; then
+ SAVE_CFLAGS="$CFLAGS"
+ SAVE_LIBS="$LIBS"
+ LDAP_CFLAGS="-DLDAP_DEPRECATED"
+ CFLAGS="$CFLAGS $LDAP_CFLAGS"
+ LIBS="$LIBS $LDAP_LIBS"
+ AC_CHECK_FUNCS(ldap_ntlm_bind)
+ CFLAGS="$SAVE_CFLAGS"
+ LIBS="$SAVE_LIBS"
+
+ else # Win32
+ LDAP_CFLAGS="-DLDAP_DEPRECATED"
+ LDAP_LIBS="-lwldap32"
+ AC_SUBST(LDAP_CFLAGS)
+ AC_SUBST(LDAP_LIBS)
+ AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
+ msg_ldap="yes"
+
+ fi # Win32
+
+ if test -z "$LDAP_LIBS"; then
+ if test "x$with_openldap" = "xyes"; then
+ AC_MSG_ERROR([*** LDAP support explicitely requested but not found ***])
+ else
+ AC_MSG_WARN([*** LDAP support not found ***])
+ fi
+ fi
+
+ have_ldap=yes
+else
+ have_ldap=no
+fi
AC_SUBST(LDAP_CFLAGS)
AC_SUBST(LDAP_LIBS)
-AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
-msg_ldap="yes"
-fi # Win32
+AM_CONDITIONAL(LDAP_SUPPORT, [test -n "$LDAP_LIBS"])
IT_PROG_INTLTOOL([0.35.0])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]