In Fedora 14, 389-ds started linking against openldap libraries instead
of the old mozldap libraries.
This patch allows us to conditionally build plugins against openldap as
well. Failure to do so may cause symbol clashes when the plugin is used
by directory server because then we get 2 different ldap libraries
loaded at the same time.
The spec file has already been changed to build plugins --with-openldap
by default.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
From 4bdfe38e0ce4f2aaeb07ac43880ca87cd30f9d57 Mon Sep 17 00:00:00 2001
From: Simo Sorce sso...@redhat.com
Date: Fri, 3 Dec 2010 15:02:29 -0500
Subject: [PATCH] Make use of mozldap vs openldap for plugins selectable
---
daemons/configure.ac | 21 ---
.../ipa-slapi-plugins/ipa-enrollment/Makefile.am |4 +-
daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am |4 +-
.../ipa-slapi-plugins/ipa-pwd-extop/Makefile.am|4 +-
daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h |2 +
.../ipa-pwd-extop/ipapwd_common.c |4 +-
daemons/ipa-slapi-plugins/ipa-uuid/Makefile.am |4 +-
daemons/ipa-slapi-plugins/ipa-version/Makefile.am |4 +-
daemons/ipa-slapi-plugins/ipa-winsync/Makefile.am |4 +-
.../ipa-slapi-plugins/ipa-winsync/ipa-winsync.c|3 ++
ipa.spec.in|4 +++
11 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/daemons/configure.ac b/daemons/configure.ac
index d959f987a49f4cefb1c96fd86d89ce1b4749f7aa..221a63a7f4dca8352b41874c777469cadc685d7a 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -137,11 +137,9 @@ fi
AC_SUBST(KRB5_LIBS)
dnl ---
-dnl - Check for Mozilla LDAP *and* OpenLDAP SDK
+dnl - Check for Mozilla LDAP and OpenLDAP SDK
dnl ---
-dnl The mozldap libraries are always needed because ipa-slapi-plugins/dna/
-dnl will not build against OpenLDAP.
SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$NSPR4 $NSS3
AC_CHECK_HEADER(svrcore.h)
@@ -193,6 +191,21 @@ AC_SUBST(OPENLDAP_LIBS)
OPENLDAP_CFLAGS=${OPENLDAP_CFLAGS} -DWITH_OPENLDAP
AC_SUBST(OPENLDAP_CFLAGS)
+AC_ARG_WITH([openldap],
+[AS_HELP_STRING([--with-openldap],
+[compile plugins with openldap instead of mozldap])],
+[], [])
+
+if test x$with_openldap == xyes; then
+LDAP_CFLAGS=${OPENLDAP_CFLAGS} $NSPR4 $NSS3 -DUSE_OPENLDAP
+LDAP_LIBS=${OPENLDAP_LIBS}
+else
+LDAP_CFLAGS=${MOZLDAP_CFLAGS}
+LDAP_LIBS=${MOZLDAP_LIBS}
+fi
+AC_SUBST(LDAP_CFLAGS)
+AC_SUBST(LDAP_LIBS)
+
dnl ---
dnl - Check for OpenSSL Crypto library
dnl ---
@@ -312,7 +325,7 @@ echo
source code location: ${srcdir}
compiler: ${CC}
cflags: ${CFLAGS}
-LDAP libs:${OPENLDAP_LIBS}
+LDAP libs:${LDAP_LIBS}
KRB5 libs:${KRB5_LIBS}
OpenSSL libs: ${SSL_LIBS}
Maintainer mode: ${USE_MAINTAINER_MODE}
diff --git a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
index d041815a2693a990431e2f42d22d0ae6ad5024fa..c3bb279598cc6eafbaa545ef0774882d2fe98a1e 100644
--- a/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-enrollment/Makefile.am
@@ -12,7 +12,7 @@ INCLUDES = \
-DLIBEXECDIR=\$(libexecdir)\ \
-DDATADIR=\$(datadir)\\
$(AM_CFLAGS) \
- $(MOZLDAP_CFLAGS) \
+ $(LDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
@@ -29,7 +29,7 @@ libipa_enrollment_extop_la_SOURCES = \
libipa_enrollment_extop_la_LDFLAGS = -avoid-version
libipa_enrollment_extop_la_LIBADD = \
- $(MOZLDAP_LIBS) \
+ $(LDAP_LIBS) \
$(NULL)
appdir = $(IPA_DATA_DIR)
diff --git a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
index b7986874822690422f015b1d39454c2ed9995340..5d9db51f41c427894961d8af2b9b6b8d4d289ae0 100644
--- a/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-modrdn/Makefile.am
@@ -13,7 +13,7 @@ INCLUDES = \
-DLIBEXECDIR=\$(libexecdir)\ \
-DDATADIR=\$(datadir)\\
$(AM_CFLAGS) \
- $(MOZLDAP_CFLAGS) \
+ $(LDAP_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
@@ -29,7 +29,7 @@ libipa_modrdn_la_SOURCES = \
libipa_modrdn_la_LDFLAGS = -avoid-version
libipa_modrdn_la_LIBADD = \
- $(MOZLDAP_LIBS) \
+ $(LDAP_LIBS) \
$(NULL)
appdir = $(IPA_DATA_DIR)
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
index